29 return widget_type_names[0];
30 else if (w->
widget_type >= XPUTTY_WIDGET_NAME_COUNT)
31 return widget_type_names[XPUTTY_WIDGET_NAME_COUNT];
38 if (xkey->
keycode == XKeysymToKeycode(dpy,XK_Tab))
39 return (xkey->
state & ShiftMask) ? 1 : 2;
40 else if (xkey->
keycode == XKeysymToKeycode(dpy,XK_Up))
42 else if (xkey->
keycode == XKeysymToKeycode(dpy,XK_Right))
44 else if (xkey->
keycode == XKeysymToKeycode(dpy,XK_Down))
46 else if (xkey->
keycode == XKeysymToKeycode(dpy,XK_Left))
48 else if (xkey->
keycode == XKeysymToKeycode(dpy,XK_Home))
50 else if (xkey->
keycode == XKeysymToKeycode(dpy,XK_Insert))
52 else if (xkey->
keycode == XKeysymToKeycode(dpy,XK_End))
54 else if (xkey->
keycode == XKeysymToKeycode(dpy,XK_Return))
56 else if (xkey->
keycode == XKeysymToKeycode(dpy,XK_BackSpace))
58 else if (xkey->
keycode == XKeysymToKeycode(dpy,XK_Delete))
61 else if (xkey->
keycode == XKeysymToKeycode(dpy,XK_KP_Subtract))
63 else if (xkey->
keycode == XKeysymToKeycode(dpy,XK_KP_Add))
65 else if (xkey->
keycode == XKeysymToKeycode(dpy,XK_KP_Up))
67 else if (xkey->
keycode == XKeysymToKeycode(dpy,XK_KP_Right))
69 else if (xkey->
keycode == XKeysymToKeycode(dpy,XK_KP_Down))
71 else if (xkey->
keycode == XKeysymToKeycode(dpy,XK_KP_Left))
73 else if (xkey->
keycode == XKeysymToKeycode(dpy,XK_KP_Home))
75 else if (xkey->
keycode == XKeysymToKeycode(dpy,XK_KP_Insert))
77 else if (xkey->
keycode == XKeysymToKeycode(dpy,XK_KP_End))
79 else if (xkey->
keycode == XKeysymToKeycode(dpy,XK_KP_Enter))
81 else if (xkey->
keycode == XKeysymToKeycode(dpy,XK_KP_Delete))
88 if (count == 0 && main->
run ==
true) {
114 cairo_surface_destroy(w->
image);
115 cairo_destroy(w->
crb);
116 cairo_surface_destroy(w->
buffer);
117 cairo_destroy(w->
cr);
118 cairo_surface_destroy(w->
surface);
144 debug_print(
"Widget_t configure callback width %i height %i\n", metrics.
width, metrics.
height);
164 int x,
int y,
int width,
int height) {
168 debug_print(
"assert(w)\n");
173 w->
flags &= ~NO_AUTOREPEAT;
174 w->
flags &= ~FAST_REDRAW;
175 w->
flags &= ~HIDE_ON_DELETE;
176 w->
flags &= ~REUSE_IMAGE;
177 w->
flags &= ~NO_PROPAGATE;
178 w->
flags &= ~IS_SUBMENU;
179 w->
flags &= ~DONT_PROPAGATE;
252 assert(cairo_surface_status(w->
surface) == CAIRO_STATUS_SUCCESS);
254 cairo_select_font_face (w->
cr,
"Sans", CAIRO_FONT_SLANT_NORMAL,
255 CAIRO_FONT_WEIGHT_NORMAL);
258 CAIRO_CONTENT_COLOR_ALPHA, width, height);
259 assert(cairo_surface_status(w->
buffer) == CAIRO_STATUS_SUCCESS);
261 cairo_select_font_face (w->
crb,
"Sans", CAIRO_FONT_SLANT_NORMAL,
262 CAIRO_FONT_WEIGHT_NORMAL);
266 int x,
int y,
int width,
int height) {
270 debug_print(
"assert(w)\n");
275 w->
flags &= ~NO_AUTOREPEAT;
276 w->
flags &= ~FAST_REDRAW;
277 w->
flags &= ~HIDE_ON_DELETE;
278 w->
flags &= ~REUSE_IMAGE;
279 w->
flags &= ~NO_PROPAGATE;
280 w->
flags &= ~IS_SUBMENU;
281 w->
flags &= ~DONT_PROPAGATE;
353 debug_print(
"address of a is: %p\n", (
void*)event);
354 debug_print(
"address of b is: %p\n", (
void*)handler);
356 debug_print(
"address of a is: %p\n", (
void*)(*event));
455 cairo_push_group (wid->
cr);
460 debug_print(
"Widget_t _transparency \n");
461 cairo_set_source_surface (wid->
crb, parent->
buffer, -m.
x, -m.
y);
462 cairo_paint (wid->
crb);
465 cairo_push_group (wid->
crb);
467 cairo_pop_group_to_source (wid->
crb);
468 cairo_paint (wid->
crb);
470 cairo_set_source_surface (wid->
cr, wid->
buffer,0,0);
471 cairo_paint (wid->
cr);
473 cairo_pop_group_to_source (wid->
cr);
474 cairo_paint (wid->
cr);
482 cairo_push_group (wid->
cr);
489 debug_print(
"Widget_t draw widget \n");
490 cairo_set_source_surface (wid->
crb, parent->
buffer, -m.
x, -m.
y);
491 cairo_paint (wid->
crb);
494 cairo_push_group (wid->
crb);
496 cairo_pop_group_to_source (wid->
crb);
497 cairo_paint (wid->
crb);
499 cairo_set_source_surface (wid->
cr, wid->
buffer,0,0);
500 cairo_paint (wid->
cr);
502 cairo_pop_group_to_source (wid->
cr);
503 cairo_paint (wid->
cr);
Childlist_t - struct to hold a Widget_t child list Xputty main holds a list of any Widget_t created...
xevfunc configure_notify_callback
evfunc button_release_callback
xevfunc configure_callback
xevfunc map_notify_callback
xevfunc unmap_notify_callback
evfunc key_release_callback
evfunc key_press_callback
xevfunc visibiliy_change_callback
evfunc double_click_callback
xevfunc value_changed_callback
xevfunc dnd_notify_callback
xevfunc mem_free_callback
evfunc button_press_callback
Metrics_t - struct to receive window size, position & visibility Pass this struct to os_get_window_...
XColor_t - the Widget_t Color struct XColor_t could be used for theming you Widget_t set.
Xputty - the main struct. It should be declared before any other call to a Xputty function....
void * delete_adjustment(Adjustment_t *adj)
delete_adjustment - freeing the memory of the Adjustment_t You usually don't need to call this,...
void childlist_add_child(Childlist_t *childlist, Widget_t *child)
childlist_add_child - internal use to add a child to the Childlist_t You usually didn't need to cal...
int childlist_find_child(Childlist_t *childlist, Widget_t *child)
childlist_find_child - find a child in a the Childlist_t this could be sued to check if a Widget_t is...
void childlist_destroy(Childlist_t *childlist)
childlist_destroy - internal use to free the Childlist_t You usually didn't need to call this
void childlist_remove_child(Childlist_t *childlist, Widget_t *child)
childlist_remove_child - internal use to remove a child from the childlist You usually didn't need ...
void childlist_init(Childlist_t *childlist)
childlist_init - internal use to allocate the array to min size You usually didn't need to call thi...
int childlist_has_child(Childlist_t *childlist)
childlist_has_child - check if a Widget_t Childlist_t contain a child