Commit 62451da5 authored by Bertho Stultiens's avatar Bertho Stultiens Committed by Alexandre Julliard

- Generalized the distinction between 2 and 4 byte integers slightly through

a new parser state. The is now a warning when a 2 byte integer is larger than 16 bit (and is truncated). - Fixed a couple of cosmetic things in the DLGINIT stuff so that dumping of this type will work as expected. - Added generalized language/version/characteristics support to the DLGINIT resource type. Ulrich Czekalla <ulrichc@corel.ca> - Added support for DLGINIT resource-type. - Added string continuation and embedded quoting. - Added numeric IDs for icons in controls. Eric Pouech <Eric.Pouech@wanadoo.fr> - Bugfix: Distinguish between 2 and 4 byte integers in RCDATA.
parent 3dc04219
---------------------------------------------------------------------------
Version 1.0.12 (18-Jul-1999)
Bertho Stultiens <bertho@akhphd.au.dk>
- Generalized the distinction between 2 and 4 byte integers slightly through
a new parser state. The is now a warning when a 2 byte integer is larger
than 16 bit (and is truncated).
- Fixed a couple of cosmetic things in the DLGINIT stuff so that dumping of
this type will work as expected.
- Added generalized language/version/characteristics support to the DLGINIT
resource type.
Ulrich Czekalla <ulrichc@corel.ca>
- Added support for DLGINIT resource-type.
- Added string continuation and embedded quoting.
- Added numeric IDs for icons in controls.
Eric Pouech <Eric.Pouech@wanadoo.fr>
- Bugfix: Distinguish between 2 and 4 byte integers in RCDATA.
---------------------------------------------------------------------------
Version 1.0.11 (22-Apr-1999)
Bertho Stultiens <bertho@akhphd.au.dk>
......
......@@ -43,6 +43,7 @@ char *get_typename(resource_t* r)
case res_usr: return "UserResource";
case res_msg: return "MESSAGETABLE";
case res_ver: return "VERSIONINFO";
case res_dlginit: return "DLGINIT";
case res_toolbar: return "TOOLBAR";
default: return "Unknown";
}
......@@ -492,7 +493,7 @@ void dump_stringtable(stringtable_t *stt)
void dump_control(control_t *ctrl)
{
printf("Control {\n\tClass: %s\n", get_nameid_str(ctrl->ctlclass));
printf("\tText: "); print_string(ctrl->title); printf("\n");
printf("\tText: "); get_nameid_str(ctrl->title); printf("\n");
printf("\tId: %d\n", ctrl->id);
printf("\tx, y, w, h: %d, %d, %d, %d\n", ctrl->x, ctrl->y, ctrl->width, ctrl->height);
if(ctrl->gotstyle)
......@@ -850,7 +851,7 @@ void dump_toolbar_items(toolbar_item_t *items)
/*
*****************************************************************************
* Function : dump_toolbar
* Syntax : void dump_toolbar(dialogex_t *toolbar)
* Syntax : void dump_toolbar(toolbar_t *toolbar)
* Input :
* toolbar - Toolbar resource descriptor
* Output :
......@@ -867,6 +868,24 @@ void dump_toolbar(toolbar_t *toolbar)
/*
*****************************************************************************
* Function : dump_dlginit
* Syntax : void dump_dlginit(dlginit_t *dit)
* Input :
* dit - DlgInit resource descriptor
* Output :
* Description :
* Remarks :
*****************************************************************************
*/
void dump_dlginit(dlginit_t *dit)
{
dump_memopt(dit->memopt);
dump_lvc(&(dit->lvc));
dump_raw_data(dit->data);
}
/*
*****************************************************************************
* Function :
* Syntax :
* Input :
......@@ -945,6 +964,9 @@ void dump_resources(resource_t *top)
case res_ver:
dump_versioninfo(top->res.ver);
break;
case res_dlginit:
dump_dlginit(top->res.dlgi);
break;
case res_toolbar:
dump_toolbar(top->res.tbt);
break;
......
......@@ -457,7 +457,7 @@ res_t *dialog2res(name_id_t *name, dialog_t *dlg)
else
internal_error(__FILE__, __LINE__, "Control has no control-class");
if(ctrl->title)
put_string(res, ctrl->title, str_unicode, TRUE);
put_name_id(res, ctrl->title, TRUE);
else
put_word(res, 0);
if(ctrl->extra)
......@@ -528,7 +528,7 @@ res_t *dialog2res(name_id_t *name, dialog_t *dlg)
else
internal_error(__FILE__, __LINE__, "Control has no control-class");
if(ctrl->title)
put_string(res, ctrl->title, str_char, TRUE);
put_name_id(res, ctrl->title, FALSE);
else
put_byte(res, 0);
......@@ -634,7 +634,7 @@ res_t *dialogex2res(name_id_t *name, dialogex_t *dlgex)
else
internal_error(__FILE__, __LINE__, "Control has no control-class");
if(ctrl->title)
put_string(res, ctrl->title, str_unicode, TRUE);
put_name_id(res, ctrl->title, TRUE);
else
put_word(res, 0);
if(ctrl->extra)
......@@ -1493,6 +1493,35 @@ res_t *toolbar2res(name_id_t *name, toolbar_t *toolbar)
/*
*****************************************************************************
* Function : dlginit2res
* Syntax : res_t *dlginit2res(name_id_t *name, dlginit_t *dit)
* Input :
* name - Name/ordinal of the resource
* rdt - The dlginit descriptor
* Output : New .res format structure
* Description :
* Remarks :
*****************************************************************************
*/
res_t *dlginit2res(name_id_t *name, dlginit_t *dit)
{
int restag;
res_t *res;
assert(name != NULL);
assert(dit != NULL);
res = new_res();
restag = put_res_header(res, WRC_RT_DLGINIT, NULL, name, dit->memopt, &(dit->lvc));
put_raw_data(res, dit->data, 0);
/* Set ResourceSize */
SetResSize(res, restag);
if(win32)
put_pad(res);
return res;
}
/*
*****************************************************************************
* Function : prep_nid_for_label
* Syntax : char *prep_nid_for_label(name_id_t *nid)
* Input :
......@@ -1615,6 +1644,7 @@ char *get_c_typename(enum res_e type)
case res_msg: return "MsgTab";
case res_ver: return "VerInf";
case res_toolbar: return "TlBr";
case res_dlginit: return "DlgInit";
default: return "Oops";
}
}
......@@ -1704,6 +1734,11 @@ void resources2res(resource_t *top)
if(!top->binres)
top->binres = toolbar2res(top->name, top->res.tbt);
break;
case res_dlginit:
if(!top->binres)
top->binres = dlginit2res(top->name, top->res.dlgi);
break;
default:
internal_error(__FILE__, __LINE__, "Unknown resource type encountered %d in binary res generation", top->type);
}
......
......@@ -263,3 +263,26 @@ toolbar_t *new_toolbar(int button_width, int button_height, toolbar_item_t *item
tb->items = items;
return tb;
}
dlginit_t *new_dlginit(raw_data_t *rd, int *memopt)
{
dlginit_t *di = (dlginit_t *)xmalloc(sizeof(dlginit_t));
di->data = rd;
if(memopt)
{
di->memopt = *memopt;
free(memopt);
}
else
di->memopt = WRC_MO_MOVEABLE | WRC_MO_PURE | WRC_MO_DISCARDABLE;
return di;
}
style_pair_t *new_style_pair(int style, int exstyle)
{
style_pair_t *sp = (style_pair_t *)xmalloc(sizeof(style_pair_t));
sp->style = style;
sp->exstyle = exstyle;
return sp;
}
......@@ -59,10 +59,12 @@ bitmap_t *new_bitmap(raw_data_t *rd, int *memopt);
ver_words_t *new_ver_words(int i);
ver_words_t *add_ver_words(ver_words_t *w, int i);
messagetable_t *new_messagetable(raw_data_t *rd);
dlginit_t *new_dlginit(raw_data_t *rd, int *memopt);
void copy_raw_data(raw_data_t *dst, raw_data_t *src, int offs, int len);
int *new_int(int i);
stringtable_t *new_stringtable(lvc_t *lvc);
toolbar_t *new_toolbar(int button_width, int button_Height, toolbar_item_t *items, int nitems);
style_pair_t *new_style_pair(int style, int exstyle);
#endif
......@@ -277,6 +277,7 @@ static struct keyword keywords[] = {
{ "DIALOG", DIALOG, 0, 0, 0},
{ "DIALOGEX", DIALOGEX, 1, 0, 0},
{ "DISCARDABLE", DISCARDABLE, 0, 0, 0},
{ "DLGINIT", DLGINIT, 0, 0, 0},
{ "EDITTEXT", EDITTEXT, 0, 0, 0},
{ "END", tEND, 0, 0, 1},
{ "EXSTYLE", EXSTYLE, 0, 0, 0},
......@@ -584,9 +585,9 @@ void add_to_substtext(char *text, int len)
\{ return tBEGIN;
\} return tEND;
[0-9]+[lL]? { yylval.num = atoi(yytext); return NUMBER; }
0[xX][0-9A-Fa-f]+[lL]? { yylval.num = strtoul(yytext,0,16); return NUMBER; }
0[oO][0-7]+ { yylval.num = strtoul(yytext+2,0,8); return NUMBER; }
[0-9]+[lL]? { yylval.num = strtoul(yytext, 0, 10); return toupper(yytext[yyleng-1]) == 'L' ? LNUMBER : NUMBER; }
0[xX][0-9A-Fa-f]+[lL]? { yylval.num = strtoul(yytext, 0, 16); return toupper(yytext[yyleng-1]) == 'L' ? LNUMBER : NUMBER; }
0[oO][0-7]+[lL]? { yylval.num = strtoul(yytext+2, 0, 8); return toupper(yytext[yyleng-1]) == 'L' ? LNUMBER : NUMBER; }
[A-Za-z_0-9]+ {
struct keyword *token;
struct pp_entry *ppp;
......@@ -630,6 +631,7 @@ void add_to_substtext(char *text, int len)
case CURSOR:
case tBITMAP:
case MESSAGETABLE:
case DLGINIT:
push_to(yywf);
break;
case FONT:
......@@ -703,6 +705,9 @@ L\" {
<yylstr>\\t addwchar('\t');
<yylstr>\\v addwchar('\v');
<yylstr>\\(.|\n) addwchar(yytext[1]);
<yylstr>\"\" addcchar('\"'); /* "bla""bla" -> "bla\"bla" */
<yylstr>\\\"\" addcchar('\"'); /* "bla\""bla" -> "bla\"bla" */
<yylstr>\"{ws}+\" ; /* "bla" "bla" -> "blabla" */
<yylstr>[^\\\n\"]+ {
char *yptr = yytext;
while(*yptr) /* FIXME: codepage translation */
......@@ -745,6 +750,9 @@ L\" {
while(*yptr)
addcchar(*yptr++);
}
<yystr>\"\" addcchar('\"'); /* "bla""bla" -> "bla\"bla" */
<yystr>\\\"\" addcchar('\"'); /* "bla\""bla" -> "bla\"bla" */
<yystr>\"{ws}+\" ; /* "bla" "bla" -> "blabla" */
......
......@@ -90,7 +90,7 @@ char usage[] = "Usage: wrc [options...] [infile[.rc|.res]]\n"
;
char version_string[] = "Wine Resource Compiler Version " WRC_FULLVERSION "\n"
"Copyright 1998 Bertho A. Stultiens\n"
"Copyright 1998,1999 Bertho A. Stultiens\n"
" 1994 Martin von Loewis\n";
/*
......
......@@ -12,8 +12,8 @@
#include "wrctypes.h"
#endif
#define WRC_VERSION "1.0.11"
#define WRC_RELEASEDATE "(22-Apr-1999)"
#define WRC_VERSION "1.0.12"
#define WRC_RELEASEDATE "(18-Jul-1999)"
#define WRC_FULLVERSION WRC_VERSION " " WRC_RELEASEDATE
/* Only used in heavy debugging sessions */
......
......@@ -44,6 +44,7 @@
#define WRC_RT_VXD (20)
#define WRC_RT_ANICURSOR (21)
#define WRC_RT_ANIICON (22)
#define WRC_RT_DLGINIT (240)
#define WRC_RT_TOOLBAR (241)
/* Default class type IDs */
......@@ -145,6 +146,7 @@ enum res_e {
res_anicur, /* Not implemented, no layout available */
res_aniico, /* Not implemented, no layout available */
res_dlginit = WRC_RT_DLGINIT, /* 240 */
res_toolbar = WRC_RT_TOOLBAR, /* 241 */
res_menex = 256 + 4,
......@@ -163,7 +165,7 @@ typedef struct control {
struct control *next; /* List of controls */
struct control *prev;
name_id_t *ctlclass; /* ControlClass */
string_t *title; /* Title of control */
name_id_t *title; /* Title of control */
int id;
int x; /* Position */
int y;
......@@ -470,6 +472,13 @@ typedef struct toolbar {
toolbar_item_t *items;
} toolbar_t;
typedef struct dlginit {
DWORD memopt;
lvc_t lvc;
raw_data_t *data;
} dlginit_t;
/* A top-level resource node */
typedef struct resource {
struct resource *next;
......@@ -484,6 +493,7 @@ typedef struct resource {
cursor_group_t *curg;
dialog_t *dlg;
dialogex_t *dlgex;
dlginit_t *dlgi;
font_t *fnt;
icon_t *ico;
icon_group_t *icog;
......@@ -518,6 +528,11 @@ typedef struct res_count {
int n_name_entries;
} res_count_t;
typedef struct style_pair {
int style;
int exstyle;
} style_pair_t;
#endif
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment