summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBart Massey <bart@cs.pdx.edu>2007-12-07 00:27:52 -0800
committerBart Massey <bart@cs.pdx.edu>2007-12-07 00:27:52 -0800
commit6bb3a61fbfaf9487ce0f4a9843819616746bbc8a (patch)
tree1ebe9f68852c6d402d0a02c2fd9d5734dbcef455
parent1085bf8426d016876aeb551e4894439aecf49d5e (diff)
added aux_set_line_attributes_checked
-rw-r--r--aux/xcb_aux.c21
-rw-r--r--aux/xcb_aux.h9
2 files changed, 30 insertions, 0 deletions
diff --git a/aux/xcb_aux.c b/aux/xcb_aux.c
index 011d9d1..f152669 100644
--- a/aux/xcb_aux.c
+++ b/aux/xcb_aux.c
@@ -302,3 +302,24 @@ xcb_aux_parse_color(char *color_name,
*blue = b << n;
return 1;
}
+
+/* Drawing related functions */
+
+/* Adapted from Xlib */
+xcb_void_cookie_t
+xcb_aux_set_line_attributes_checked (xcb_connection_t *dpy,
+ xcb_gcontext_t gc,
+ uint16_t linewidth,
+ int32_t linestyle,
+ int32_t capstyle,
+ int32_t joinstyle)
+{
+ uint32_t mask = 0;
+ xcb_params_gc_t gv;
+
+ XCB_AUX_ADD_PARAM(&mask, &gv, line_width, linewidth);
+ XCB_AUX_ADD_PARAM(&mask, &gv, line_style, linestyle);
+ XCB_AUX_ADD_PARAM(&mask, &gv, cap_style, capstyle);
+ XCB_AUX_ADD_PARAM(&mask, &gv, join_style, joinstyle);
+ return xcb_aux_change_gc_checked(dpy, gc, mask, &gv);
+}
diff --git a/aux/xcb_aux.h b/aux/xcb_aux.h
index 6144971..c376b77 100644
--- a/aux/xcb_aux.h
+++ b/aux/xcb_aux.h
@@ -180,6 +180,15 @@ int
xcb_aux_parse_color(char *color_name,
uint16_t *red, uint16_t *green, uint16_t *blue);
+xcb_void_cookie_t
+xcb_aux_set_line_attributes_checked (xcb_connection_t *dpy,
+ xcb_gcontext_t gc,
+ uint16_t linewidth,
+ int32_t linestyle,
+ int32_t capstyle,
+ int32_t joinstyle);
+
+
#ifdef __cplusplus
}
#endif