Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
52788d1f
Commit
52788d1f
authored
Jun 30, 2005
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added support for HTML resource type.
parent
9c80ef3d
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
67 additions
and
3 deletions
+67
-3
genres.c
tools/wrc/genres.c
+33
-0
newstruc.c
tools/wrc/newstruc.c
+14
-0
newstruc.h
tools/wrc/newstruc.h
+1
-1
parser.l
tools/wrc/parser.l
+1
-0
parser.y
tools/wrc/parser.y
+12
-2
wrctypes.h
tools/wrc/wrctypes.h
+6
-0
No files found.
tools/wrc/genres.c
View file @
52788d1f
...
...
@@ -1341,6 +1341,35 @@ static res_t *fontdir2res(name_id_t *name, fontdir_t *fnd)
/*
*****************************************************************************
* Function : html2res
* Syntax : res_t *html2res(name_id_t *name, html_t *html)
* Input :
* name - Name/ordinal of the resource
* rdt - The html descriptor
* Output : New .res format structure
* Description :
* Remarks :
*****************************************************************************
*/
static
res_t
*
html2res
(
name_id_t
*
name
,
html_t
*
html
)
{
int
restag
;
res_t
*
res
;
assert
(
name
!=
NULL
);
assert
(
html
!=
NULL
);
res
=
new_res
();
restag
=
put_res_header
(
res
,
WRC_RT_HTML
,
NULL
,
name
,
html
->
memopt
,
&
(
html
->
data
->
lvc
));
put_raw_data
(
res
,
html
->
data
,
0
);
/* Set ResourceSize */
SetResSize
(
res
,
restag
);
if
(
win32
)
put_pad
(
res
);
return
res
;
}
/*
*****************************************************************************
* Function : rcdata2res
* Syntax : res_t *rcdata2res(name_id_t *name, rcdata_t *rdt)
* Input :
...
...
@@ -1932,6 +1961,10 @@ void resources2res(resource_t *top)
if
(
!
top
->
binres
)
top
->
binres
=
menuex2res
(
top
->
name
,
top
->
res
.
menex
);
break
;
case
res_html
:
if
(
!
top
->
binres
)
top
->
binres
=
html2res
(
top
->
name
,
top
->
res
.
html
);
break
;
case
res_rdt
:
if
(
!
top
->
binres
)
top
->
binres
=
rcdata2res
(
top
->
name
,
top
->
res
.
rdt
);
...
...
tools/wrc/newstruc.c
View file @
52788d1f
...
...
@@ -123,6 +123,20 @@ characts_t *dup_characts(characts_t *c)
return
new_characts
(
*
c
);
}
html_t
*
new_html
(
raw_data_t
*
rd
,
int
*
memopt
)
{
html_t
*
html
=
xmalloc
(
sizeof
(
html_t
));
html
->
data
=
rd
;
if
(
memopt
)
{
html
->
memopt
=
*
memopt
;
free
(
memopt
);
}
else
html
->
memopt
=
WRC_MO_MOVEABLE
|
WRC_MO_PURE
;
return
html
;
}
rcdata_t
*
new_rcdata
(
raw_data_t
*
rd
,
int
*
memopt
)
{
rcdata_t
*
rc
=
(
rcdata_t
*
)
xmalloc
(
sizeof
(
rcdata_t
));
...
...
tools/wrc/newstruc.h
View file @
52788d1f
...
...
@@ -61,6 +61,7 @@ language_t *new_language(int id, int sub);
language_t
*
dup_language
(
language_t
*
l
);
version_t
*
dup_version
(
version_t
*
v
);
characts_t
*
dup_characts
(
characts_t
*
c
);
html_t
*
new_html
(
raw_data_t
*
rd
,
int
*
memopt
);
rcdata_t
*
new_rcdata
(
raw_data_t
*
rd
,
int
*
memopt
);
font_id_t
*
new_font_id
(
int
size
,
string_t
*
face
,
int
weight
,
int
italic
);
user_t
*
new_user
(
name_id_t
*
type
,
raw_data_t
*
rd
,
int
*
memopt
);
...
...
@@ -82,4 +83,3 @@ style_pair_t *new_style_pair(style_t *style, style_t *exstyle);
style_t
*
new_style
(
DWORD
or_mask
,
DWORD
and_mask
);
#endif
tools/wrc/parser.l
View file @
52788d1f
...
...
@@ -204,6 +204,7 @@ static struct keyword keywords[] = {
{ "GRAYED", tGRAYED, 0, 0, 0},
{ "GROUPBOX", tGROUPBOX, 0, 0, 0},
{ "HELP", tHELP, 0, 0, 0},
{ "HTML", tHTML, 0, 0, 0},
{ "ICON", tICON, 0, 0, 0},
{ "IMPURE", tIMPURE, 0, 0, 0},
{ "INACTIVE", tINACTIVE, 0, 0, 0},
...
...
tools/wrc/parser.y
View file @
52788d1f
...
...
@@ -251,6 +251,7 @@ static int rsrcid_to_token(int lookahead);
fontdir_t *fnd;
menu_t *men;
menuex_t *menex;
html_t *html;
rcdata_t *rdt;
stringtable_t *stt;
stt_entry_t *stte;
...
...
@@ -285,7 +286,7 @@ static int rsrcid_to_token(int lookahead);
%token
<str>
tSTRING tIDENT tFILENAME
%token
<raw>
tRAWDATA
%token tACCELERATORS tBITMAP tCURSOR tDIALOG tDIALOGEX tMENU tMENUEX tMESSAGETABLE
%token tRCDATA tVERSIONINFO tSTRINGTABLE tFONT tFONTDIR tICON
%token tRCDATA tVERSIONINFO tSTRINGTABLE tFONT tFONTDIR tICON
tHTML
%token tAUTO3STATE tAUTOCHECKBOX tAUTORADIOBUTTON tCHECKBOX tDEFPUSHBUTTON
%token tPUSHBUTTON tRADIOBUTTON tSTATE3 /* PUSHBOX */
%token tGROUPBOX tCOMBOBOX tLISTBOX tSCROLLBAR
...
...
@@ -323,6 +324,7 @@ static int rsrcid_to_token(int lookahead);
%type
<iptr>
helpid
%type
<dlgex>
dialogex dlgex_attribs
%type
<ctl>
exctrls gen_exctrl lab_exctrl exctrl_desc
%type
<html>
html
%type
<rdt>
rcdata
%type
<raw>
raw_data raw_elements opt_data file_raw
%type
<veri>
versioninfo fix_version
...
...
@@ -644,6 +646,7 @@ resource_definition
$$
=
NULL;
}
|
messagetable
{
$$
=
new_resource(res_msg,
$1,
WRC_MO_MOVEABLE
|
WRC_MO_DISCARDABLE,
$1->data->lvc.language);
}
|
html
{
$$
=
new_resource(res_html,
$1,
$1->memopt,
$1->data->lvc.language);
}
|
rcdata
{
$$
=
new_resource(res_rdt,
$1,
$1->memopt,
$1->data->lvc.language);
}
|
toolbar
{
$$
=
new_resource(res_toolbar,
$1,
$1->memopt,
$1->lvc.language);
}
|
userres
{
$$
=
new_resource(res_usr,
$1,
$1->memopt,
$1->data->lvc.language);
}
...
...
@@ -724,6 +727,10 @@ messagetable
}
;
/* ------------------------------ HTML ------------------------------ */
html
:
tHTML
loadmemopts
file_raw
{
$$
=
new_html($3,
$2);
}
;
/* ------------------------------ RCData ------------------------------ */
rcdata
:
tRCDATA
loadmemopts
file_raw
{
$$
=
new_rcdata($3,
$2);
}
;
...
...
@@ -3008,6 +3015,10 @@ static int rsrcid_to_token(int lookahead)
type
=
"TOOLBAR"
;
token
=
tTOOLBAR;
break;
case
WRC_RT_HTML
:
type
=
"HTML"
;
token
=
tHTML;
break;
case
WRC_RT_STRING
:
type
=
"STRINGTABLE"
;
...
...
@@ -3023,7 +3034,6 @@ static int rsrcid_to_token(int lookahead)
case
WRC_RT_DLGINCLUDE
:
case
WRC_RT_PLUGPLAY
:
case
WRC_RT_VXD
:
case WRC_RT_HTML:
yywarning
(
"Usertype uses reserved type ID %d, which is not supported by wrc yet"
,
yylval
.
num
);
default
:
return
lookahead
;
...
...
tools/wrc/wrctypes.h
View file @
52788d1f
...
...
@@ -441,6 +441,11 @@ typedef struct bitmap {
raw_data_t
*
data
;
}
bitmap_t
;
typedef
struct
html
{
DWORD
memopt
;
raw_data_t
*
data
;
}
html_t
;
typedef
struct
rcdata
{
DWORD
memopt
;
raw_data_t
*
data
;
...
...
@@ -615,6 +620,7 @@ typedef struct resource {
menu_t
*
men
;
menuex_t
*
menex
;
messagetable_t
*
msg
;
html_t
*
html
;
rcdata_t
*
rdt
;
stringtable_t
*
stt
;
toolbar_t
*
tbt
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment