widl: Support WinRT eventadd/eventremove attributes.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com> Signed-off-by: Jacek Caban <jacek@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
1a62712e25
commit
8233b3d537
|
@ -185,6 +185,10 @@ const char *get_name(const var_t *v)
|
||||||
{
|
{
|
||||||
static char *buffer;
|
static char *buffer;
|
||||||
free( buffer );
|
free( buffer );
|
||||||
|
if (is_attr( v->attrs, ATTR_EVENTADD ))
|
||||||
|
return buffer = strmake( "add_%s", v->name );
|
||||||
|
if (is_attr( v->attrs, ATTR_EVENTREMOVE ))
|
||||||
|
return buffer = strmake( "remove_%s", v->name );
|
||||||
if (is_attr( v->attrs, ATTR_PROPGET ))
|
if (is_attr( v->attrs, ATTR_PROPGET ))
|
||||||
return buffer = strmake( "get_%s", v->name );
|
return buffer = strmake( "get_%s", v->name );
|
||||||
if (is_attr( v->attrs, ATTR_PROPPUT ))
|
if (is_attr( v->attrs, ATTR_PROPPUT ))
|
||||||
|
|
|
@ -359,6 +359,8 @@ static const struct keyword attr_keywords[] =
|
||||||
{"encode", tENCODE, 0},
|
{"encode", tENCODE, 0},
|
||||||
{"endpoint", tENDPOINT, 0},
|
{"endpoint", tENDPOINT, 0},
|
||||||
{"entry", tENTRY, 0},
|
{"entry", tENTRY, 0},
|
||||||
|
{"eventadd", tEVENTADD, 1},
|
||||||
|
{"eventremove", tEVENTREMOVE, 1},
|
||||||
{"exclusiveto", tEXCLUSIVETO, 1},
|
{"exclusiveto", tEXCLUSIVETO, 1},
|
||||||
{"explicit_handle", tEXPLICITHANDLE, 0},
|
{"explicit_handle", tEXPLICITHANDLE, 0},
|
||||||
{"fault_status", tFAULTSTATUS, 0},
|
{"fault_status", tFAULTSTATUS, 0},
|
||||||
|
|
|
@ -197,6 +197,7 @@ static typelib_t *current_typelib;
|
||||||
%token tDLLNAME tDONTFREE tDOUBLE tDUAL
|
%token tDLLNAME tDONTFREE tDOUBLE tDUAL
|
||||||
%token tENABLEALLOCATE tENCODE tENDPOINT
|
%token tENABLEALLOCATE tENCODE tENDPOINT
|
||||||
%token tENTRY tENUM tERRORSTATUST
|
%token tENTRY tENUM tERRORSTATUST
|
||||||
|
%token tEVENTADD tEVENTREMOVE
|
||||||
%token tEXCLUSIVETO
|
%token tEXCLUSIVETO
|
||||||
%token tEXPLICITHANDLE tEXTERN
|
%token tEXPLICITHANDLE tEXTERN
|
||||||
%token tFALSE
|
%token tFALSE
|
||||||
|
@ -572,6 +573,8 @@ attribute: { $$ = NULL; }
|
||||||
| tENCODE { $$ = make_attr(ATTR_ENCODE); }
|
| tENCODE { $$ = make_attr(ATTR_ENCODE); }
|
||||||
| tENDPOINT '(' str_list ')' { $$ = make_attrp(ATTR_ENDPOINT, $3); }
|
| tENDPOINT '(' str_list ')' { $$ = make_attrp(ATTR_ENDPOINT, $3); }
|
||||||
| tENTRY '(' expr_const ')' { $$ = make_attrp(ATTR_ENTRY, $3); }
|
| tENTRY '(' expr_const ')' { $$ = make_attrp(ATTR_ENTRY, $3); }
|
||||||
|
| tEVENTADD { $$ = make_attr(ATTR_EVENTADD); }
|
||||||
|
| tEVENTREMOVE { $$ = make_attr(ATTR_EVENTREMOVE); }
|
||||||
| tEXCLUSIVETO '(' decl_spec ')' { if ($3->type->type_type != TYPE_RUNTIMECLASS)
|
| tEXCLUSIVETO '(' decl_spec ')' { if ($3->type->type_type != TYPE_RUNTIMECLASS)
|
||||||
error_loc("type %s is not a runtimeclass\n", $3->type->name);
|
error_loc("type %s is not a runtimeclass\n", $3->type->name);
|
||||||
$$ = make_attrp(ATTR_EXCLUSIVETO, $3->type); }
|
$$ = make_attrp(ATTR_EXCLUSIVETO, $3->type); }
|
||||||
|
@ -2258,6 +2261,8 @@ struct allowed_attr allowed_attr[] =
|
||||||
/* ATTR_ENCODE */ { 0, 0, 0, 1, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "encode" },
|
/* ATTR_ENCODE */ { 0, 0, 0, 1, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "encode" },
|
||||||
/* ATTR_ENDPOINT */ { 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "endpoint" },
|
/* ATTR_ENDPOINT */ { 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "endpoint" },
|
||||||
/* ATTR_ENTRY */ { 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "entry" },
|
/* ATTR_ENTRY */ { 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "entry" },
|
||||||
|
/* ATTR_EVENTADD */ { 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "eventadd" },
|
||||||
|
/* ATTR_EVENTREMOVE */ { 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "eventremove" },
|
||||||
/* ATTR_EXCLUSIVETO */ { 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "exclusive_to" },
|
/* ATTR_EXCLUSIVETO */ { 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "exclusive_to" },
|
||||||
/* ATTR_EXPLICIT_HANDLE */ { 1, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "explicit_handle" },
|
/* ATTR_EXPLICIT_HANDLE */ { 1, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "explicit_handle" },
|
||||||
/* ATTR_FAULTSTATUS */ { 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "fault_status" },
|
/* ATTR_FAULTSTATUS */ { 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "fault_status" },
|
||||||
|
@ -2932,6 +2937,8 @@ static void check_functions(const type_t *iface, int is_inside_library)
|
||||||
{
|
{
|
||||||
if (func == func_iter) break;
|
if (func == func_iter) break;
|
||||||
if (strcmp(func->name, func_iter->name)) continue;
|
if (strcmp(func->name, func_iter->name)) continue;
|
||||||
|
if (is_attr(func->attrs, ATTR_EVENTADD) != is_attr(func_iter->attrs, ATTR_EVENTADD)) continue;
|
||||||
|
if (is_attr(func->attrs, ATTR_EVENTREMOVE) != is_attr(func_iter->attrs, ATTR_EVENTREMOVE)) continue;
|
||||||
if (is_attr(func->attrs, ATTR_PROPGET) != is_attr(func_iter->attrs, ATTR_PROPGET)) continue;
|
if (is_attr(func->attrs, ATTR_PROPGET) != is_attr(func_iter->attrs, ATTR_PROPGET)) continue;
|
||||||
if (is_attr(func->attrs, ATTR_PROPPUT) != is_attr(func_iter->attrs, ATTR_PROPPUT)) continue;
|
if (is_attr(func->attrs, ATTR_PROPPUT) != is_attr(func_iter->attrs, ATTR_PROPPUT)) continue;
|
||||||
if (is_attr(func->attrs, ATTR_PROPPUTREF) != is_attr(func_iter->attrs, ATTR_PROPPUTREF)) continue;
|
if (is_attr(func->attrs, ATTR_PROPPUTREF) != is_attr(func_iter->attrs, ATTR_PROPPUTREF)) continue;
|
||||||
|
|
|
@ -103,6 +103,8 @@ enum attr_type
|
||||||
ATTR_ENCODE,
|
ATTR_ENCODE,
|
||||||
ATTR_ENDPOINT,
|
ATTR_ENDPOINT,
|
||||||
ATTR_ENTRY,
|
ATTR_ENTRY,
|
||||||
|
ATTR_EVENTADD,
|
||||||
|
ATTR_EVENTREMOVE,
|
||||||
ATTR_EXCLUSIVETO,
|
ATTR_EXCLUSIVETO,
|
||||||
ATTR_EXPLICIT_HANDLE,
|
ATTR_EXPLICIT_HANDLE,
|
||||||
ATTR_FAULTSTATUS,
|
ATTR_FAULTSTATUS,
|
||||||
|
|
Loading…
Reference in New Issue