Client Library - Window API


Detailed Description

these are simple low-level windows api functions, for further information you may look in demo directory.

Example:
for further information look in demo/ directory

 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


Enumeration Type Documentation

enum S_WINDOW

window types

Enumerator:
WINDOW_NOFORM  dont calculate form area, for requested action
WINDOW_MAIN  window main
WINDOW_TEMP  window temp
WINDOW_CHILD  window child
WINDOW_DESKTOP  window desktop, this is a bitwise or'ed property


Function Documentation

void s_window_atevent ( s_window_t window,
void(*)(s_window_t *, s_event_t *)  f 
)

sets the atevent callback function for given window

Parameters:
*window - the window
*f - callback function
Returns:
no return

void s_window_atexit ( s_window_t window,
void(*)(s_window_t *)  f 
)

sets the atexit callback function for given window

Parameters:
*window - the window
*f - callback function
Returns:
no return

void s_window_exit ( s_window_t window  ) 

exits the client window

Parameters:
*window - pointer to window struct
Returns:
no return

void s_window_form_draw ( s_window_t window  ) 

redraws the form of the desired window

Parameters:
*window - the window
Returns:
no returns

void s_window_hide ( s_window_t window  ) 

hides the given window

Parameters:
*window - the window
Returns:
no returns

int s_window_init ( s_window_t **  window  ) 

initiliazes the window struct, creates a connection to the server.

Parameters:
**window - pointer to window pointer
Returns:
0 on success

void* s_window_loop ( void *  arg  ) 

main loop thread function, starts the even tool thread

Parameters:
*arg - thread argument
Returns:
no return

void* s_window_loop_event ( void *  arg  ) 

event loop thread function.

Parameters:
*arg - thread argument
Returns:
no return

void* s_window_main ( void *  arg  ) 

main functions that creates or tarts the loop function.

Parameters:
*arg - thread argument
Returns:
no return

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.

Parameters:
*window - the window
type - window type
parent - parent window for the given window
Returns:
no returns

void s_window_quit ( s_window_t window  ) 

quits the client window

Parameters:
*window - pointer to window struct
Returns:
no return

void s_window_set_alwaysontop ( s_window_t window,
int  alwaysontop 
)

sets the always on top property ot the given window

Parameters:
*window - the window
alwaysontop - 0 (regular), 1 (always on top), -1 (always on bottom)
Returns:
no returns

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

Parameters:
*window - the window
form - is window form included in given coordinates
x - position x
y - position y
w - width
h - height
Returns:
no returns

void s_window_set_cursor ( s_window_t window,
S_MOUSE_CURSOR  cursor 
)

sets the cursor for desired window

Parameters:
*window - the window
cursor - the cursor type
Returns:
no returns

void s_window_set_resizeable ( s_window_t window,
int  resizeable 
)

sets the resizable property ot the given window

Parameters:
*window - the window
resizeable - 0 (enable) or 1 (disable)
Returns:
no returns

void s_window_set_title ( s_window_t window,
char *  fmt,
  ... 
)

sets the title for desired window

Parameters:
*window - the window
fmt - the title
Returns:
no returns

void s_window_show ( s_window_t window  ) 

shows the given window

Parameters:
*window - the window
Returns:
no returns

void s_window_uninit ( s_window_t window  ) 

uninitializes the window struct.

Parameters:
*window - pointer to window struct
Returns:
no return

int s_window_wakeup ( s_window_t window  ) 

wakes up the window

Parameters:
*window - pointer to window struct
Returns:
0 on success


Generated on Wed Dec 27 17:53:06 2006 for xynth-0.8.40 by  doxygen 1.4.7