MCPcopy Create free account
hub / github.com/DISTRHO/DPF / puglEventCallback

Method puglEventCallback

dgl/src/WindowPrivateData.cpp:936–1181  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

934#endif
935
936PuglStatus Window::PrivateData::puglEventCallback(PuglView* const view, const PuglEvent* const event)
937{
938 Window::PrivateData* const pData = (Window::PrivateData*)puglGetHandle(view);
939#if defined(DEBUG) && defined(DGL_DEBUG_EVENTS)
940 if (event->type != PUGL_TIMER && event->type != PUGL_EXPOSE && event->type != PUGL_MOTION) {
941 printEvent(event, "pugl event: ", true);
942 }
943#endif
944
945 if (pData->waitingForClipboardEvents)
946 {
947 switch (event->type)
948 {
949 case PUGL_UPDATE:
950 case PUGL_EXPOSE:
951 case PUGL_FOCUS_IN:
952 case PUGL_FOCUS_OUT:
953 case PUGL_KEY_PRESS:
954 case PUGL_KEY_RELEASE:
955 case PUGL_TEXT:
956 case PUGL_POINTER_IN:
957 case PUGL_POINTER_OUT:
958 case PUGL_BUTTON_PRESS:
959 case PUGL_BUTTON_RELEASE:
960 case PUGL_MOTION:
961 case PUGL_SCROLL:
962 case PUGL_TIMER:
963 case PUGL_LOOP_ENTER:
964 case PUGL_LOOP_LEAVE:
965 return PUGL_SUCCESS;
966 case PUGL_DATA_OFFER:
967 case PUGL_DATA:
968 break;
969 default:
970 d_stdout("Got event %d while waitingForClipboardEvents", event->type);
971 break;
972 }
973 }
974
975 switch (event->type)
976 {
977 ///< No event
978 case PUGL_NOTHING:
979 break;
980
981 ///< View realized, a #PuglRealizeEvent
982 case PUGL_REALIZE:
983 if (! pData->isEmbed && ! puglGetTransientParent(view))
984 {
985 #if defined(DISTRHO_OS_WINDOWS) && defined(DGL_WINDOWS_ICON_ID)
986 WNDCLASSEX wClass = {};
987 const HINSTANCE hInstance = GetModuleHandle(nullptr);
988
989 if (GetClassInfoEx(hInstance, view->world->strings[PUGL_CLASS_NAME], &wClass))
990 wClass.hIcon = LoadIcon(nullptr, MAKEINTRESOURCE(DGL_WINDOWS_ICON_ID));
991
992 SetClassLongPtr(view->impl->hwnd, GCLP_HICON, (LONG_PTR) LoadIcon(hInstance, MAKEINTRESOURCE(DGL_WINDOWS_ICON_ID)));
993 #endif

Callers

nothing calls this directly

Calls 15

printEventFunction · 0.85
d_stdoutFunction · 0.85
d_roundToUnsignedIntFunction · 0.85
onPuglConfigureMethod · 0.80
onPuglExposeMethod · 0.80
onPuglCloseMethod · 0.80
onPuglFocusMethod · 0.80
onPuglKeyMethod · 0.80
onPuglTextMethod · 0.80
onPuglMouseMethod · 0.80
onPuglMotionMethod · 0.80
onPuglScrollMethod · 0.80

Tested by

no test coverage detected