MCPcopy Create free account
hub / github.com/ClassiCube/ClassiCube / DispatchMessage

Method DispatchMessage

src/Window_BeOS.cpp:99–134  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

97
98static void CallOpenFileCallback(const char* path);
99void CC_BApp::DispatchMessage(BMessage* msg, BHandler* handler) {
100 CCEvent event = { 0 };
101 const char* filename;
102 entry_ref fileRef;
103
104 switch (msg->what)
105 {
106 case B_QUIT_REQUESTED:
107 Platform_LogConst("APP QUIT");
108 event.type = CC_WIN_QUIT;
109 break;
110 case B_REFS_RECEIVED:
111 // TODO do we need to support more than 1 ref?
112 if (msg->FindRef("refs", 0, &fileRef) == B_OK) {
113 BPath path(&fileRef);
114 CallOpenFileCallback(path.Path());
115 }
116 break;
117 case B_SAVE_REQUESTED:
118 // TODO do we need to support more than 1 ref?
119 if (msg->FindRef("directory", 0, &fileRef) == B_OK &&
120 msg->FindString("name", &filename) == B_OK) {
121 BDirectory folder(&fileRef);
122 BPath path(&folder, filename);
123 // TODO add default file extension
124 CallOpenFileCallback(path.Path());
125 }
126 break;
127 default:
128 //Platform_LogConst("UNHANDLED APP MESSAGE:");
129 //msg->PrintToStream();
130 break;
131 }
132 if (event.type) Events_Push(&event);
133 BApplication::DispatchMessage(msg, handler);
134}
135
136// BWindow implementation
137class CC_BWindow : public BWindow

Callers

nothing calls this directly

Calls 6

Platform_LogConstFunction · 0.85
CallOpenFileCallbackFunction · 0.85
UpdateMouseButtonsFunction · 0.85
HandleMouseMovementFunction · 0.85
ProcessKeyInputFunction · 0.85
Events_PushFunction · 0.70

Tested by

no test coverage detected