absence_thelab

view src/nwt/nucwin.h @ 0:1cffe3409164

initial commit
author John Tsiombikas <nuclear@member.fsf.org>
date Thu, 23 Oct 2014 01:46:07 +0300
parents
children
line source
1 #ifndef _NUCWIN_H_
2 #define _NUCWIN_H_
4 #include <string>
5 #include "widget.h"
7 struct Point {
8 int x, y;
9 inline Point(int x=0, int y=0) {this->x = x; this->y = y;}
10 };
12 struct Rect : public RECT {
13 inline Rect() {}
14 inline Rect(int l, int t, int r, int b) {left=l; top=t; right=r; bottom=b;}
15 };
18 #define HandlerFunctionPtr int (*)(Widget*, int)
20 extern char *Arguments;
22 enum HandlerType {
23 HANDLER_KEY,
24 HANDLER_CLOSE,
25 HANDLER_MOUSE,
26 HANDLER_WHEEL,
27 HANDLER_WINMOVE,
28 HANDLER_MOUSEUP,
29 HANDLER_PAINT
30 };
31 enum MainLoopMode {EventLoop, RealTimeLoop};
33 void SetHandler(HandlerType htype, int (*Handler)(Widget*, int));
35 void SetMainLoopFunc(void (*func)());
37 Point NWGetScreenSize();
39 int NWMainLoop(MainLoopMode mode = EventLoop);
40 bool NWCheckForMessages();
41 LRESULT CALLBACK MainHandler(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam);
43 void NWCloseWindow(Widget *win);
45 std::string NWFileSaveChooser(Widget *win, const char *title, const char *filetypes, const char *defext);
47 #endif // _NUCWIN_H_