1 #include "notify.h" 2 3 #include "debug.h" 4 #include "window.h" 5 6 #include "layout/notify.h" 7 8 #include "native/window.h" 9 10 #include <stddef.h> 11 #include <stdint.h> 12 13 static uint16_t notification_number = 0; 14 notify_new(NOTIFY_TYPE type)15UTOX_WINDOW *notify_new(NOTIFY_TYPE type) { 16 LOG_NOTE("Notifier", "Notify:\tCreating Notification #%u", notification_number); 17 18 const int notify_w = 400; 19 const int notify_h = 150; 20 21 22 const int x = 30; 23 const int y = 30 + (20 + notify_h) * notification_number; 24 ++notification_number; 25 26 PANEL *panel; 27 switch (type) { 28 case NOTIFY_TYPE_NONE: { 29 return NULL; 30 } 31 case NOTIFY_TYPE_MSG: { 32 panel = &panel_notify_generic; 33 break; 34 } 35 case NOTIFY_TYPE_CALL: 36 case NOTIFY_TYPE_CALL_VIDEO: { 37 panel = &panel_notify_generic; // TODO create a video call panel type 38 break; 39 } 40 } 41 42 UTOX_WINDOW *w = window_create_notify(x, y, notify_w, notify_h, panel); 43 44 native_window_set_target(w); 45 46 return w; 47 } 48