Lines Matching refs:receiver

143 def messages_header_filename(receiver):
144 return '%sMessages.h' % receiver.name
293 def forward_declarations_and_headers(receiver):
301 for message in receiver.messages:
306 for parameter in receiver.iterparameters():
331 receiver = MessageReceiver.parse(file)
332 header_guard = messages_header_filename(receiver).replace('.', '_')
341 if receiver.condition:
342 result.append('#if %s\n\n' % receiver.condition)
344 forward_declarations, headers = forward_declarations_and_headers(receiver)
352 result.append('namespace Messages {\n\nnamespace %s {\n\n' % receiver.name)
353 result.append(messages_to_kind_enum(receiver.messages))
355 result.append('\n'.join([message_to_struct_declaration(x) for x in receiver.messages]))
356 result.append('\n} // namespace %s\n\n} // namespace Messages\n' % receiver.name)
359 result.append('template<> struct MessageKindTraits<Messages::%s::Kind> {\n' % receiver.name)
360 result.append(' static const MessageClass messageClass = MessageClass%s;\n' % receiver.name)
364 if receiver.condition:
365 result.append('\n#endif // %s\n' % receiver.condition)
372 def handler_function(receiver, message):
374 return '%s::%s' % (receiver.name, 'url' + message.name[3:])
375 return '%s::%s' % (receiver.name, message.name[0].lower() + message.name[1:])
378 def async_case_statement(receiver, message):
384 result.append(' case Messages::%s::%s:\n' % (receiver.name, message.id()))
385 result.append(' CoreIPC::%s<Messages::%s::%s>(arguments, this, &%s);\n' % (dispatch_function, receiver.name, message.name, handler_function(receiver, message)))
390 def sync_case_statement(receiver, message):
398 result.append(' case Messages::%s::%s:\n' % (receiver.name, message.id()))
399 result.append(' CoreIPC::%s<Messages::%s::%s>(%sarguments, reply, this, &%s);\n' % (dispatch_function, receiver.name, message.name, 'connection, ' if message.is_delayed else '', handler_function(receiver, message)))
468 receiver = MessageReceiver.parse(file)
470 '"%s"' % messages_header_filename(receiver): None,
476 for parameter in receiver.iterparameters():
499 for message in receiver.messages:
519 if receiver.condition:
520 result.append('#if %s\n\n' % receiver.condition)
522 result.append('#include "%s.h"\n\n' % receiver.name)
533 for message in receiver.messages:
538 result.append('namespace Messages {\n\nnamespace %s {\n\n' % receiver.name)
570 result.append('} // namespace %s\n\n} // namespace Messages\n\n' % receiver.name)
576 for message in receiver.messages:
583 result.append('void %s::didReceive%sMessage(CoreIPC::Connection*, CoreIPC::MessageID messageID, CoreIPC::ArgumentDecoder* arguments)\n' % (receiver.name, receiver.name))
585 result.append(' switch (messageID.get<Messages::%s::Kind>()) {\n' % receiver.name)
586 result += [async_case_statement(receiver, message) for message in async_messages]
595 result.append('CoreIPC::SyncReplyMode %s::didReceiveSync%sMessage(CoreIPC::Connection*%s, CoreIPC::MessageID messageID, CoreIPC::ArgumentDecoder* arguments, CoreIPC::ArgumentEncoder* reply)\n' % (receiver.name, receiver.name, ' connection' if sync_delayed_messages else ''))
597 result.append(' switch (messageID.get<Messages::%s::Kind>()) {\n' % receiver.name)
598 result += [sync_case_statement(receiver, message) for message in sync_messages]
608 if receiver.condition:
609 result.append('\n#endif // %s\n' % receiver.condition)