absence_thelab

diff 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 diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/src/nwt/nucwin.h	Thu Oct 23 01:46:07 2014 +0300
     1.3 @@ -0,0 +1,47 @@
     1.4 +#ifndef _NUCWIN_H_
     1.5 +#define _NUCWIN_H_
     1.6 +
     1.7 +#include <string>
     1.8 +#include "widget.h"
     1.9 +
    1.10 +struct Point {
    1.11 +	int x, y;
    1.12 +	inline Point(int x=0, int y=0) {this->x = x; this->y = y;}
    1.13 +};
    1.14 +
    1.15 +struct Rect : public RECT {
    1.16 +	inline Rect() {}
    1.17 +	inline Rect(int l, int t, int r, int b) {left=l; top=t; right=r; bottom=b;}
    1.18 +};
    1.19 +
    1.20 +
    1.21 +#define HandlerFunctionPtr int (*)(Widget*, int)
    1.22 +
    1.23 +extern char *Arguments;
    1.24 +
    1.25 +enum HandlerType {
    1.26 +	HANDLER_KEY, 
    1.27 +	HANDLER_CLOSE, 
    1.28 +	HANDLER_MOUSE, 
    1.29 +	HANDLER_WHEEL, 
    1.30 +	HANDLER_WINMOVE,
    1.31 +	HANDLER_MOUSEUP,
    1.32 +	HANDLER_PAINT
    1.33 +};
    1.34 +enum MainLoopMode {EventLoop, RealTimeLoop};
    1.35 +
    1.36 +void SetHandler(HandlerType htype, int (*Handler)(Widget*, int));
    1.37 +
    1.38 +void SetMainLoopFunc(void (*func)());
    1.39 +
    1.40 +Point NWGetScreenSize();
    1.41 +
    1.42 +int NWMainLoop(MainLoopMode mode = EventLoop);
    1.43 +bool NWCheckForMessages();
    1.44 +LRESULT CALLBACK MainHandler(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam);
    1.45 +
    1.46 +void NWCloseWindow(Widget *win);
    1.47 +
    1.48 +std::string NWFileSaveChooser(Widget *win, const char *title, const char *filetypes, const char *defext);
    1.49 +
    1.50 +#endif	// _NUCWIN_H_
    1.51 \ No newline at end of file