widl: Add progid, threading and vi_progid attributes for coclasses.

This is a Wine extension, modelled after the corresponding attributes
supported by Visual C++.
This commit is contained in:
Alexandre Julliard 2010-11-30 12:05:57 +01:00
parent ad6b7cd46a
commit 3991b05746
3 changed files with 39 additions and 4 deletions

View File

@ -289,11 +289,13 @@ static const struct keyword attr_keywords[] =
{"aggregatable", tAGGREGATABLE}, {"aggregatable", tAGGREGATABLE},
{"allocate", tALLOCATE}, {"allocate", tALLOCATE},
{"annotation", tANNOTATION}, {"annotation", tANNOTATION},
{"apartment", tAPARTMENT},
{"appobject", tAPPOBJECT}, {"appobject", tAPPOBJECT},
{"async", tASYNC}, {"async", tASYNC},
{"async_uuid", tASYNCUUID}, {"async_uuid", tASYNCUUID},
{"auto_handle", tAUTOHANDLE}, {"auto_handle", tAUTOHANDLE},
{"bindable", tBINDABLE}, {"bindable", tBINDABLE},
{"both", tBOTH},
{"broadcast", tBROADCAST}, {"broadcast", tBROADCAST},
{"byte_count", tBYTECOUNT}, {"byte_count", tBYTECOUNT},
{"call_as", tCALLAS}, {"call_as", tCALLAS},
@ -320,6 +322,7 @@ static const struct keyword attr_keywords[] =
{"explicit_handle", tEXPLICITHANDLE}, {"explicit_handle", tEXPLICITHANDLE},
{"fault_status", tFAULTSTATUS}, {"fault_status", tFAULTSTATUS},
{"force_allocate", tFORCEALLOCATE}, {"force_allocate", tFORCEALLOCATE},
{"free", tFREE},
{"handle", tHANDLE}, {"handle", tHANDLE},
{"helpcontext", tHELPCONTEXT}, {"helpcontext", tHELPCONTEXT},
{"helpfile", tHELPFILE}, {"helpfile", tHELPFILE},
@ -342,6 +345,7 @@ static const struct keyword attr_keywords[] =
{"local", tLOCAL}, {"local", tLOCAL},
{"maybe", tMAYBE}, {"maybe", tMAYBE},
{"message", tMESSAGE}, {"message", tMESSAGE},
{"neutral", tNEUTRAL},
{"nocode", tNOCODE}, {"nocode", tNOCODE},
{"nonbrowsable", tNONBROWSABLE}, {"nonbrowsable", tNONBROWSABLE},
{"noncreatable", tNONCREATABLE}, {"noncreatable", tNONCREATABLE},
@ -356,6 +360,7 @@ static const struct keyword attr_keywords[] =
{"out", tOUT}, {"out", tOUT},
{"partial_ignore", tPARTIALIGNORE}, {"partial_ignore", tPARTIALIGNORE},
{"pointer_default", tPOINTERDEFAULT}, {"pointer_default", tPOINTERDEFAULT},
{"progid", tPROGID},
{"propget", tPROPGET}, {"propget", tPROPGET},
{"propput", tPROPPUT}, {"propput", tPROPPUT},
{"propputref", tPROPPUTREF}, {"propputref", tPROPPUTREF},
@ -369,12 +374,14 @@ static const struct keyword attr_keywords[] =
{"requestedit", tREQUESTEDIT}, {"requestedit", tREQUESTEDIT},
{"restricted", tRESTRICTED}, {"restricted", tRESTRICTED},
{"retval", tRETVAL}, {"retval", tRETVAL},
{"single", tSINGLE},
{"size_is", tSIZEIS}, {"size_is", tSIZEIS},
{"source", tSOURCE}, {"source", tSOURCE},
{"strict_context_handle", tSTRICTCONTEXTHANDLE}, {"strict_context_handle", tSTRICTCONTEXTHANDLE},
{"string", tSTRING}, {"string", tSTRING},
{"switch_is", tSWITCHIS}, {"switch_is", tSWITCHIS},
{"switch_type", tSWITCHTYPE}, {"switch_type", tSWITCHTYPE},
{"threading", tTHREADING},
{"transmit_as", tTRANSMITAS}, {"transmit_as", tTRANSMITAS},
{"uidefault", tUIDEFAULT}, {"uidefault", tUIDEFAULT},
{"unique", tUNIQUE}, {"unique", tUNIQUE},
@ -384,6 +391,7 @@ static const struct keyword attr_keywords[] =
{"v1_enum", tV1ENUM}, {"v1_enum", tV1ENUM},
{"vararg", tVARARG}, {"vararg", tVARARG},
{"version", tVERSION}, {"version", tVERSION},
{"vi_progid", tVIPROGID},
{"wire_marshal", tWIREMARSHAL}, {"wire_marshal", tWIREMARSHAL},
}; };

View File

@ -239,7 +239,7 @@ static statement_list_t *append_statement(statement_list_t *list, statement_t *s
%token tOUT %token tOUT
%token tPARTIALIGNORE tPASCAL %token tPARTIALIGNORE tPASCAL
%token tPOINTERDEFAULT %token tPOINTERDEFAULT
%token tPROPERTIES %token tPROGID tPROPERTIES
%token tPROPGET tPROPPUT tPROPPUTREF %token tPROPGET tPROPPUT tPROPPUTREF
%token tPROXY tPTR %token tPROXY tPTR
%token tPUBLIC %token tPUBLIC
@ -260,7 +260,7 @@ static statement_list_t *append_statement(statement_list_t *list, statement_t *s
%token tSTRICTCONTEXTHANDLE %token tSTRICTCONTEXTHANDLE
%token tSTRING tSTRUCT %token tSTRING tSTRUCT
%token tSWITCH tSWITCHIS tSWITCHTYPE %token tSWITCH tSWITCHIS tSWITCHTYPE
%token tTRANSMITAS %token tTHREADING tTRANSMITAS
%token tTRUE %token tTRUE
%token tTYPEDEF %token tTYPEDEF
%token tUIDEFAULT tUNION %token tUIDEFAULT tUNION
@ -269,9 +269,10 @@ static statement_list_t *append_statement(statement_list_t *list, statement_t *s
%token tUSESGETLASTERROR tUSERMARSHAL tUUID %token tUSESGETLASTERROR tUSERMARSHAL tUUID
%token tV1ENUM %token tV1ENUM
%token tVARARG %token tVARARG
%token tVERSION %token tVERSION tVIPROGID
%token tVOID %token tVOID
%token tWCHAR tWIREMARSHAL %token tWCHAR tWIREMARSHAL
%token tAPARTMENT tNEUTRAL tSINGLE tFREE tBOTH
%type <attr> attribute type_qualifier function_specifier %type <attr> attribute type_qualifier function_specifier
%type <attr_list> m_attributes attributes attrib_list m_type_qual_list %type <attr_list> m_attributes attributes attrib_list m_type_qual_list
@ -299,7 +300,7 @@ static statement_list_t *append_statement(statement_list_t *list, statement_t *s
%type <declarator> m_abstract_declarator abstract_declarator abstract_declarator_no_direct abstract_direct_declarator %type <declarator> m_abstract_declarator abstract_declarator abstract_declarator_no_direct abstract_direct_declarator
%type <declarator_list> declarator_list struct_declarator_list %type <declarator_list> declarator_list struct_declarator_list
%type <type> coclass coclasshdr coclassdef %type <type> coclass coclasshdr coclassdef
%type <num> pointer_type version %type <num> pointer_type threading_type version
%type <str> libraryhdr callconv cppquote importlib import t_ident %type <str> libraryhdr callconv cppquote importlib import t_ident
%type <uuid> uuid_string %type <uuid> uuid_string
%type <import> import_start %type <import> import_start
@ -538,6 +539,7 @@ attribute: { $$ = NULL; }
| tOUT { $$ = make_attr(ATTR_OUT); } | tOUT { $$ = make_attr(ATTR_OUT); }
| tPARTIALIGNORE { $$ = make_attr(ATTR_PARTIALIGNORE); } | tPARTIALIGNORE { $$ = make_attr(ATTR_PARTIALIGNORE); }
| tPOINTERDEFAULT '(' pointer_type ')' { $$ = make_attrv(ATTR_POINTERDEFAULT, $3); } | tPOINTERDEFAULT '(' pointer_type ')' { $$ = make_attrv(ATTR_POINTERDEFAULT, $3); }
| tPROGID '(' aSTRING ')' { $$ = make_attrp(ATTR_PROGID, $3); }
| tPROPGET { $$ = make_attr(ATTR_PROPGET); } | tPROPGET { $$ = make_attr(ATTR_PROPGET); }
| tPROPPUT { $$ = make_attr(ATTR_PROPPUT); } | tPROPPUT { $$ = make_attr(ATTR_PROPPUT); }
| tPROPPUTREF { $$ = make_attr(ATTR_PROPPUTREF); } | tPROPPUTREF { $$ = make_attr(ATTR_PROPPUTREF); }
@ -559,6 +561,7 @@ attribute: { $$ = NULL; }
| tSWITCHIS '(' expr ')' { $$ = make_attrp(ATTR_SWITCHIS, $3); } | tSWITCHIS '(' expr ')' { $$ = make_attrp(ATTR_SWITCHIS, $3); }
| tSWITCHTYPE '(' type ')' { $$ = make_attrp(ATTR_SWITCHTYPE, $3); } | tSWITCHTYPE '(' type ')' { $$ = make_attrp(ATTR_SWITCHTYPE, $3); }
| tTRANSMITAS '(' type ')' { $$ = make_attrp(ATTR_TRANSMITAS, $3); } | tTRANSMITAS '(' type ')' { $$ = make_attrp(ATTR_TRANSMITAS, $3); }
| tTHREADING '(' threading_type ')' { $$ = make_attrv(ATTR_THREADING, $3); }
| tUIDEFAULT { $$ = make_attr(ATTR_UIDEFAULT); } | tUIDEFAULT { $$ = make_attr(ATTR_UIDEFAULT); }
| tUSESGETLASTERROR { $$ = make_attr(ATTR_USESGETLASTERROR); } | tUSESGETLASTERROR { $$ = make_attr(ATTR_USESGETLASTERROR); }
| tUSERMARSHAL '(' type ')' { $$ = make_attrp(ATTR_USERMARSHAL, $3); } | tUSERMARSHAL '(' type ')' { $$ = make_attrp(ATTR_USERMARSHAL, $3); }
@ -566,6 +569,7 @@ attribute: { $$ = NULL; }
| tV1ENUM { $$ = make_attr(ATTR_V1ENUM); } | tV1ENUM { $$ = make_attr(ATTR_V1ENUM); }
| tVARARG { $$ = make_attr(ATTR_VARARG); } | tVARARG { $$ = make_attr(ATTR_VARARG); }
| tVERSION '(' version ')' { $$ = make_attrv(ATTR_VERSION, $3); } | tVERSION '(' version ')' { $$ = make_attrv(ATTR_VERSION, $3); }
| tVIPROGID '(' aSTRING ')' { $$ = make_attrp(ATTR_VIPROGID, $3); }
| tWIREMARSHAL '(' type ')' { $$ = make_attrp(ATTR_WIREMARSHAL, $3); } | tWIREMARSHAL '(' type ')' { $$ = make_attrp(ATTR_WIREMARSHAL, $3); }
| pointer_type { $$ = make_attrv(ATTR_POINTERTYPE, $1); } | pointer_type { $$ = make_attrv(ATTR_POINTERTYPE, $1); }
; ;
@ -1069,6 +1073,14 @@ init_declarator:
| declarator '=' expr_const { $$ = $1; $1->var->eval = $3; } | declarator '=' expr_const { $$ = $1; $1->var->eval = $3; }
; ;
threading_type:
tAPARTMENT { $$ = THREADING_APARTMENT; }
| tNEUTRAL { $$ = THREADING_NEUTRAL; }
| tSINGLE { $$ = THREADING_SINGLE; }
| tFREE { $$ = THREADING_FREE; }
| tBOTH { $$ = THREADING_BOTH; }
;
pointer_type: pointer_type:
tREF { $$ = RPC_FC_RP; } tREF { $$ = RPC_FC_RP; }
| tUNIQUE { $$ = RPC_FC_UP; } | tUNIQUE { $$ = RPC_FC_UP; }
@ -2070,6 +2082,7 @@ struct allowed_attr allowed_attr[] =
/* ATTR_PARTIALIGNORE */ { 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, "partial_ignore" }, /* ATTR_PARTIALIGNORE */ { 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, "partial_ignore" },
/* ATTR_POINTERDEFAULT */ { 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "pointer_default" }, /* ATTR_POINTERDEFAULT */ { 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "pointer_default" },
/* ATTR_POINTERTYPE */ { 1, 0, 0, 0, 1, 1, 0, 0, 0, 1, 0, 0, 0, 0, "ref, unique or ptr" }, /* ATTR_POINTERTYPE */ { 1, 0, 0, 0, 1, 1, 0, 0, 0, 1, 0, 0, 0, 0, "ref, unique or ptr" },
/* ATTR_PROGID */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, "progid" },
/* ATTR_PROPGET */ { 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "propget" }, /* ATTR_PROPGET */ { 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "propget" },
/* ATTR_PROPPUT */ { 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "propput" }, /* ATTR_PROPPUT */ { 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "propput" },
/* ATTR_PROPPUTREF */ { 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "propputref" }, /* ATTR_PROPPUTREF */ { 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "propputref" },
@ -2087,6 +2100,7 @@ struct allowed_attr allowed_attr[] =
/* ATTR_STRING */ { 1, 0, 0, 1, 1, 1, 0, 0, 0, 1, 0, 0, 0, 0, "string" }, /* ATTR_STRING */ { 1, 0, 0, 1, 1, 1, 0, 0, 0, 1, 0, 0, 0, 0, "string" },
/* ATTR_SWITCHIS */ { 1, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, "switch_is" }, /* ATTR_SWITCHIS */ { 1, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, "switch_is" },
/* ATTR_SWITCHTYPE */ { 1, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, "switch_type" }, /* ATTR_SWITCHTYPE */ { 1, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, "switch_type" },
/* ATTR_THREADING */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, "threading" },
/* ATTR_TRANSMITAS */ { 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, "transmit_as" }, /* ATTR_TRANSMITAS */ { 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, "transmit_as" },
/* ATTR_UIDEFAULT */ { 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "uidefault" }, /* ATTR_UIDEFAULT */ { 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "uidefault" },
/* ATTR_USESGETLASTERROR */ { 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "usesgetlasterror" }, /* ATTR_USESGETLASTERROR */ { 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "usesgetlasterror" },
@ -2095,6 +2109,7 @@ struct allowed_attr allowed_attr[] =
/* ATTR_V1ENUM */ { 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, "v1_enum" }, /* ATTR_V1ENUM */ { 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, "v1_enum" },
/* ATTR_VARARG */ { 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "vararg" }, /* ATTR_VARARG */ { 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "vararg" },
/* ATTR_VERSION */ { 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, "version" }, /* ATTR_VERSION */ { 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, "version" },
/* ATTR_VIPROGID */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, "vi_progid" },
/* ATTR_WIREMARSHAL */ { 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, "wire_marshal" }, /* ATTR_WIREMARSHAL */ { 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, "wire_marshal" },
}; };

View File

@ -135,6 +135,7 @@ enum attr_type
ATTR_PARTIALIGNORE, ATTR_PARTIALIGNORE,
ATTR_POINTERDEFAULT, ATTR_POINTERDEFAULT,
ATTR_POINTERTYPE, ATTR_POINTERTYPE,
ATTR_PROGID,
ATTR_PROPGET, ATTR_PROPGET,
ATTR_PROPPUT, ATTR_PROPPUT,
ATTR_PROPPUTREF, ATTR_PROPPUTREF,
@ -152,6 +153,7 @@ enum attr_type
ATTR_STRING, ATTR_STRING,
ATTR_SWITCHIS, ATTR_SWITCHIS,
ATTR_SWITCHTYPE, ATTR_SWITCHTYPE,
ATTR_THREADING,
ATTR_TRANSMITAS, ATTR_TRANSMITAS,
ATTR_UIDEFAULT, ATTR_UIDEFAULT,
ATTR_USERMARSHAL, ATTR_USERMARSHAL,
@ -160,6 +162,7 @@ enum attr_type
ATTR_V1ENUM, ATTR_V1ENUM,
ATTR_VARARG, ATTR_VARARG,
ATTR_VERSION, ATTR_VERSION,
ATTR_VIPROGID,
ATTR_WIREMARSHAL ATTR_WIREMARSHAL
}; };
@ -240,6 +243,15 @@ enum statement_type
STMT_CPPQUOTE STMT_CPPQUOTE
}; };
enum threading_type
{
THREADING_APARTMENT = 1,
THREADING_NEUTRAL,
THREADING_SINGLE,
THREADING_FREE,
THREADING_BOTH
};
enum type_basic_type enum type_basic_type
{ {
TYPE_BASIC_INT8 = 1, TYPE_BASIC_INT8 = 1,