* - Added extra comment about grammar
*/
#include "config.h"
+#include "wine/port.h"
#include <stdio.h>
#include <stdlib.h>
fontdir_t *fnd;
menu_t *men;
menuex_t *menex;
+ html_t *html;
rcdata_t *rdt;
stringtable_t *stt;
stt_entry_t *stte;
%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
%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
%type <lan> opt_language
%type <chars> opt_characts
%type <ver> opt_version
-%type <num> expr xpr
+%type <num> expr xpr xpr_no_not
%type <iptr> e_expr
%type <tlbar> toolbar
%type <tlbarItems> toolbar_items
$$ = 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); }
}
;
+/* ------------------------------ HTML ------------------------------ */
+html : tHTML loadmemopts file_raw { $$ = new_html($3, $2); }
+ ;
+
/* ------------------------------ RCData ------------------------------ */
rcdata : tRCDATA loadmemopts file_raw { $$ = new_rcdata($3, $2); }
;
style
: style '|' style { $$ = new_style($1->or_mask | $3->or_mask, $1->and_mask | $3->and_mask); free($1); free($3);}
| '(' style ')' { $$ = $2; }
- | any_num { $$ = new_style($1, 0); }
- | tNOT any_num { $$ = new_style(0, $2); }
+ | xpr_no_not { $$ = new_style($1, 0); }
+ | tNOT xpr_no_not { $$ = new_style(0, $2); }
;
ctlclass
*/
item_options
: /* Empty */ { $$ = 0; }
- | ',' tCHECKED item_options { $$ = $3 | MF_CHECKED; }
- | ',' tGRAYED item_options { $$ = $3 | MF_GRAYED; }
- | ',' tHELP item_options { $$ = $3 | MF_HELP; }
- | ',' tINACTIVE item_options { $$ = $3 | MF_DISABLED; }
- | ',' tMENUBARBREAK item_options { $$ = $3 | MF_MENUBARBREAK; }
- | ',' tMENUBREAK item_options { $$ = $3 | MF_MENUBREAK; }
+ | opt_comma tCHECKED item_options { $$ = $3 | MF_CHECKED; }
+ | opt_comma tGRAYED item_options { $$ = $3 | MF_GRAYED; }
+ | opt_comma tHELP item_options { $$ = $3 | MF_HELP; }
+ | opt_comma tINACTIVE item_options { $$ = $3 | MF_DISABLED; }
+ | opt_comma tMENUBARBREAK item_options { $$ = $3 | MF_MENUBARBREAK; }
+ | opt_comma tMENUBREAK item_options { $$ = $3 | MF_MENUBREAK; }
;
/* ------------------------------ MenuEx ------------------------------ */
expr : xpr { $$ = ($1); }
;
-xpr : xpr '+' xpr { $$ = ($1) + ($3); }
- | xpr '-' xpr { $$ = ($1) - ($3); }
- | xpr '|' xpr { $$ = ($1) | ($3); }
- | xpr '&' xpr { $$ = ($1) & ($3); }
- | xpr '*' xpr { $$ = ($1) * ($3); }
- | xpr '/' xpr { $$ = ($1) / ($3); }
- | xpr '^' xpr { $$ = ($1) ^ ($3); }
- | '~' xpr { $$ = ~($2); }
- | '-' xpr %prec pUPM { $$ = -($2); }
- | '+' xpr %prec pUPM { $$ = $2; }
- | '(' xpr ')' { $$ = $2; }
- | any_num { $$ = $1; }
+xpr_no_not : xpr '+' xpr { $$ = ($1) + ($3); }
+ | xpr '-' xpr { $$ = ($1) - ($3); }
+ | xpr '|' xpr { $$ = ($1) | ($3); }
+ | xpr '&' xpr { $$ = ($1) & ($3); }
+ | xpr '*' xpr { $$ = ($1) * ($3); }
+ | xpr '/' xpr { $$ = ($1) / ($3); }
+ | xpr '^' xpr { $$ = ($1) ^ ($3); }
+ | '~' xpr { $$ = ~($2); }
+ | '-' xpr %prec pUPM { $$ = -($2); }
+ | '+' xpr %prec pUPM { $$ = $2; }
+ | '(' xpr ')' { $$ = $2; }
+ | any_num { $$ = $1; }
+ ;
+
+
+xpr : xpr_no_not { $$ = ($1); }
| tNOT any_num { $$ = ~($2); }
;
static event_t *add_string_event(string_t *key, int id, int flags, event_t *prev)
{
- int keycode = 0;
+ int keycode = 0, keysym = 0;
event_t *ev = new_event();
- if(key->type != str_char)
- yyerror("Key code must be an ascii string");
+ if(key->type == str_char)
+ keysym = key->str.cstr[0];
+ else
+ keysym = key->str.wstr[0];
- if((flags & WRC_AF_VIRTKEY) && (!isupper(key->str.cstr[0] & 0xff) && !isdigit(key->str.cstr[0] & 0xff)))
+ if((flags & WRC_AF_VIRTKEY) && (!isupper(keysym & 0xff) && !isdigit(keysym & 0xff)))
yyerror("VIRTKEY code is not equal to ascii value");
- if(key->str.cstr[0] == '^' && (flags & WRC_AF_CONTROL) != 0)
+ if(keysym == '^' && (flags & WRC_AF_CONTROL) != 0)
{
yyerror("Cannot use both '^' and CONTROL modifier");
}
- else if(key->str.cstr[0] == '^')
+ else if(keysym == '^')
{
- keycode = toupper(key->str.cstr[1]) - '@';
+ if(key->type == str_char)
+ keycode = toupper(key->str.cstr[1]) - '@';
+ else
+ keycode = toupper(key->str.wstr[1]) - '@';
if(keycode >= ' ')
yyerror("Control-code out of range");
}
else
- keycode = key->str.cstr[0];
+ keycode = keysym;
ev->key = keycode;
ev->id = id;
ev->flags = flags & ~WRC_AF_ASCII;
if (codepage <= 0 && filename->type != str_char)
yyerror("Cannot convert filename to ASCII string");
name = convert_string( filename, str_char, codepage );
- if (!(path = wpp_find_include(name->str.cstr, 1)))
+ if (!(path = wpp_find_include(name->str.cstr, input_name, 1)))
yyerror("Cannot open file %s", name->str.cstr);
if (!(fp = fopen( path, "rb" )))
yyerror("Cannot open file %s", name->str.cstr);
}
/* qsort sorting function for string table entries */
-#define STE(p) ((stt_entry_t *)(p))
+#define STE(p) ((const stt_entry_t *)(p))
static int sort_stt_entry(const void *e1, const void *e2)
{
return STE(e1)->id - STE(e2)->id;
type = "TOOLBAR";
token = tTOOLBAR;
break;
+ case WRC_RT_HTML:
+ type = "HTML";
+ token = tHTML;
+ break;
case WRC_RT_STRING:
type = "STRINGTABLE";
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;