void simple_atevent (s_window_t *window, s_event_t *event) { if (event->type & KEYBD_EVENT) { debugf(DCLI, "[%d] event: 0x%08X, f: 0x%08X, b: %d, a:%c", window->id, event->type, event->keybd->flag, event->keybd->button, event->keybd->ascii); } if (event->type & MOUSE_EVENT) { debugf(DCLI, "[%d] event->type : 0x%08X, button : 0x%08X, buttons : 0x%08X", window->id, event->type, event->mouse->b, event->mouse->buttons); } } void simple_atexit (s_window_t *window) { debugf(DCLI, "[%d] exited", window->id); } int main (int argc, char *argv[]) { int x = 60; int y = 60; int w = 400; int h = 300; int mw = 1000; int mh = 1000; s_window_t *window; s_window_init(&window); s_window_new(window, WINDOW_MAIN, NULL); mw = window->surface->width; mh = window->surface->height; s_window_set_title(window, "Demo - %s", argv[0]); s_window_set_coor(window, 0, x, y, MIN(mw, w), MIN(mh, h)); s_window_atevent(window, simple_atevent); s_window_atexit(window, simple_atexit); s_window_show(window); s_window_main(window); return 0; }
Data Structures | |
| struct | s_window_s |
| window struct More... | |
Enumerations | |
| enum | S_WINDOW { WINDOW_NOFORM = 0x0040, WINDOW_MAIN = 0x0080, WINDOW_TEMP = 0x0100, WINDOW_CHILD = 0x0200, WINDOW_DESKTOP = 0x0400 } |
| window types More... | |
Functions | |
| void | s_window_set_cursor (s_window_t *window, S_MOUSE_CURSOR cursor) |
| sets the cursor for desired window | |
| void | s_window_set_title (s_window_t *window, char *fmt,...) |
| sets the title for desired window | |
| void | s_window_form_draw (s_window_t *window) |
| redraws the form of the desired window | |
| void | s_window_hide (s_window_t *window) |
| hides the given window | |
| void | s_window_show (s_window_t *window) |
| shows the given window | |
| void | s_window_set_coor (s_window_t *window, int form, int x, int y, int w, int h) |
| moves the given window to the desired coordinates | |
| void | s_window_set_resizeable (s_window_t *window, int resizeable) |
| sets the resizable property ot the given window | |
| void | s_window_set_alwaysontop (s_window_t *window, int alwaysontop) |
| sets the always on top property ot the given window | |
| int | s_window_new (s_window_t *window, S_WINDOW type, s_window_t *parent) |
| creates a new window with the given type, attached to the window parent. | |
| int | s_window_init (s_window_t **window) |
| initiliazes the window struct, creates a connection to the server. | |
| void | s_window_uninit (s_window_t *window) |
| uninitializes the window struct. | |
| void | s_window_exit (s_window_t *window) |
| exits the client window | |
| void | s_window_quit (s_window_t *window) |
| quits the client window | |
| int | s_window_wakeup (s_window_t *window) |
| wakes up the window | |
| void * | s_window_loop_event (void *arg) |
| event loop thread function. | |
| void * | s_window_loop (void *arg) |
| main loop thread function, starts the even tool thread | |
| void * | s_window_main (void *arg) |
| main functions that creates or tarts the loop function. | |
| void | s_window_atevent (s_window_t *window, void(*f)(s_window_t *, s_event_t *)) |
| sets the atevent callback function for given window | |
| void | s_window_atexit (s_window_t *window, void(*f)(s_window_t *)) |
| sets the atexit callback function for given window | |
| enum S_WINDOW |
| void s_window_atevent | ( | s_window_t * | window, | |
| void(*)(s_window_t *, s_event_t *) | f | |||
| ) |
sets the atevent callback function for given window
| *window | - the window | |
| *f | - callback function |
| void s_window_atexit | ( | s_window_t * | window, | |
| void(*)(s_window_t *) | f | |||
| ) |
sets the atexit callback function for given window
| *window | - the window | |
| *f | - callback function |
| void s_window_exit | ( | s_window_t * | window | ) |
exits the client window
| *window | - pointer to window struct |
| void s_window_form_draw | ( | s_window_t * | window | ) |
redraws the form of the desired window
| *window | - the window |
| void s_window_hide | ( | s_window_t * | window | ) |
hides the given window
| *window | - the window |
| int s_window_init | ( | s_window_t ** | window | ) |
initiliazes the window struct, creates a connection to the server.
| **window | - pointer to window pointer |
| void* s_window_loop | ( | void * | arg | ) |
main loop thread function, starts the even tool thread
| *arg | - thread argument |
| void* s_window_loop_event | ( | void * | arg | ) |
event loop thread function.
| *arg | - thread argument |
| void* s_window_main | ( | void * | arg | ) |
main functions that creates or tarts the loop function.
| *arg | - thread argument |
| int s_window_new | ( | s_window_t * | window, | |
| S_WINDOW | type, | |||
| s_window_t * | parent | |||
| ) |
creates a new window with the given type, attached to the window parent.
| *window | - the window | |
| type | - window type | |
| parent | - parent window for the given window |
| void s_window_quit | ( | s_window_t * | window | ) |
quits the client window
| *window | - pointer to window struct |
| void s_window_set_alwaysontop | ( | s_window_t * | window, | |
| int | alwaysontop | |||
| ) |
sets the always on top property ot the given window
| *window | - the window | |
| alwaysontop | - 0 (regular), 1 (always on top), -1 (always on bottom) |
| void s_window_set_coor | ( | s_window_t * | window, | |
| int | form, | |||
| int | x, | |||
| int | y, | |||
| int | w, | |||
| int | h | |||
| ) |
moves the given window to the desired coordinates
| *window | - the window | |
| form | - is window form included in given coordinates | |
| x | - position x | |
| y | - position y | |
| w | - width | |
| h | - height |
| void s_window_set_cursor | ( | s_window_t * | window, | |
| S_MOUSE_CURSOR | cursor | |||
| ) |
sets the cursor for desired window
| *window | - the window | |
| cursor | - the cursor type |
| void s_window_set_resizeable | ( | s_window_t * | window, | |
| int | resizeable | |||
| ) |
sets the resizable property ot the given window
| *window | - the window | |
| resizeable | - 0 (enable) or 1 (disable) |
| void s_window_set_title | ( | s_window_t * | window, | |
| char * | fmt, | |||
| ... | ||||
| ) |
sets the title for desired window
| *window | - the window | |
| fmt | - the title |
| void s_window_show | ( | s_window_t * | window | ) |
shows the given window
| *window | - the window |
| void s_window_uninit | ( | s_window_t * | window | ) |
uninitializes the window struct.
| *window | - pointer to window struct |
| int s_window_wakeup | ( | s_window_t * | window | ) |
wakes up the window
| *window | - pointer to window struct |
1.4.7