|
libxputty
0.1
A damn tiny abstraction Layer to create X11 window/widgets with cairo surfaces
|
|
Go to the documentation of this file.
29 XWindowAttributes attrs;
30 XGetWindowAttributes(w->
app->
dpy, (Window)w->
widget, &attrs);
31 int width = attrs.width-2;
32 int height = attrs.height-4;
33 if (attrs.map_state != IsViewable)
return;
37 cairo_rectangle(w->
crb,2.0, 4.0, width, height);
40 cairo_set_line_width(w->
crb, 1.0);
42 cairo_fill_preserve(w->
crb);
44 }
else if(w->
state==1) {
46 cairo_fill_preserve(w->
crb);
47 cairo_set_line_width(w->
crb, 1.5);
49 }
else if(w->
state==2) {
51 cairo_fill_preserve(w->
crb);
52 cairo_set_line_width(w->
crb, 1.0);
54 }
else if(w->
state==3) {
56 cairo_fill_preserve(w->
crb);
57 cairo_set_line_width(w->
crb, 1.0);
63 cairo_rectangle(w->
crb,4.0, 6.0, width, height);
65 cairo_rectangle(w->
crb,3.0, 4.0, width, height);
67 }
else if (w->
state==3) {
68 cairo_rectangle(w->
crb,3.0, 4.0, width, height);
75 }
else if(w->
state==1) {
78 }
else if(w->
state==2) {
81 }
else if(w->
state==3) {
92 cairo_move_to(w->
crb, wa+offset, h+offset);
93 cairo_line_to(w->
crb, wa1+offset, h1+offset);
94 cairo_line_to(w->
crb, wa2+offset, h+offset);
95 cairo_line_to(w->
crb, wa+offset, h+offset);
103 XWindowAttributes attrs;
104 XGetWindowAttributes(w->
app->
dpy, (Window)w->
widget, &attrs);
105 int width = attrs.width-2;
106 int height = attrs.height-2;
107 if (attrs.map_state != IsViewable)
return;
109 cairo_rectangle(w->
crb,2.0, 2.0, width, height);
112 cairo_set_line_width(w->
crb, 1.0);
114 cairo_fill_preserve(w->
crb);
116 }
else if(w->
state==1) {
118 cairo_fill_preserve(w->
crb);
119 cairo_set_line_width(w->
crb, 1.5);
121 }
else if(w->
state==2) {
123 cairo_fill_preserve(w->
crb);
124 cairo_set_line_width(w->
crb, 1.0);
126 }
else if(w->
state==3) {
128 cairo_fill_preserve(w->
crb);
129 cairo_set_line_width(w->
crb, 1.0);
131 }
else if(w->
state==4) {
133 cairo_fill_preserve(w->
crb);
134 cairo_set_line_width(w->
crb, 1.0);
137 cairo_stroke(w->
crb);
139 cairo_rectangle(w->
crb,4.0, 4.0, width, height);
140 cairo_stroke(w->
crb);
141 cairo_rectangle(w->
crb,3.0, 3.0, width, height);
142 cairo_stroke(w->
crb);
144 cairo_text_extents_t extents;
148 cairo_set_font_size (w->
crb, font_size);
149 cairo_text_extents(w->
crb,w->
label , &extents);
151 cairo_move_to (w->
crb, (width-extents.width)*0.4, (height+extents.height)*0.55);
153 cairo_new_path (w->
crb);
154 if (extents.width > (
float)width-20) {
165 XButtonEvent *xbutton = (XButtonEvent*)button_;
166 if (xbutton->button == Button3) {
175 XButtonEvent *xbutton = (XButtonEvent*)button_;
void use_text_color_scheme(Widget_t *w, Color_state st)
use_text_color_scheme - use text Colors to paint on Widget_t
void _button_combobox_released(void *w_, void *button_, void *user_data)
_button_combobox_released - popup the combobox menu
void _draw_combobox(void *w_, void *user_data)
_draw_combobox - internal draw the combobox to the buffer
void _entry_released(void *w_, void *item_, void *user_data)
_entry_released - the combobox menu release func
void _draw_combobox_button(void *w_, void *user_data)
_draw_combobox_button - internal draw the combobox button to the buffer
Color_state get_color_state(Widget_t *wid)
get_color_state - get the Color_state to use in relation to the Widget_t state
void use_shadow_color_scheme(Widget_t *w, Color_state st)
use_shadow_color_scheme - use shadow Colors to paint on Widget_t
float adj_get_value(Adjustment_t *adj)
adj_get_value - get the current value of the Adjustment_t
void adj_set_value(Adjustment_t *adj, float value)
adj_set_value - set the current value to the Adjustment_t
void use_fg_color_scheme(Widget_t *w, Color_state st)
use_fg_color_scheme - use forground Colors to paint on Widget_t
void use_frame_color_scheme(Widget_t *w, Color_state st)
use_frame_color_scheme - use frame Colors to paint on Widget_t
void _set_entry(void *w_, void *user_data)
_set_entry - set the active combobox entry on adjustment change
void _combobox_button_released(void *w_, void *button_, void *user_data)
_combobox_button_released - popup menu on right click
int childlist_has_child(Childlist_t *childlist)
childlist_has_child - check if a Widget_t Childlist_t contain a child