diff options
author | Jess VanDerwalker <washu@sonic.net> | 2012-03-13 21:01:48 -0700 |
---|---|---|
committer | Jess VanDerwalker <washu@sonic.net> | 2012-03-13 21:01:48 -0700 |
commit | a4babd544afb94d5b7151f9db208ae036e152f55 (patch) | |
tree | 1a521bc9eaaa64e2cf96bf36ef4f3d22985438c1 | |
parent | 4134e98b15ffcc2463b6c197b5fbc2dca9d53c4b (diff) | |
parent | 8a8d8b89d14b712112b5724bdff23c18aa6fff5c (diff) |
Merge branch 'milestone4-damage' of https://projects.cecs.pdx.edu/git/fa2011cs487-euclid into milestone4-damage
-rw-r--r-- | src/libcompositewm/xtoq.c | 19 | ||||
-rw-r--r-- | src/libcompositewm/xtoq_internal.h | 30 |
2 files changed, 28 insertions, 21 deletions
diff --git a/src/libcompositewm/xtoq.c b/src/libcompositewm/xtoq.c index 8635c55..a6daee9 100644 --- a/src/libcompositewm/xtoq.c +++ b/src/libcompositewm/xtoq.c @@ -111,7 +111,6 @@ xtoq_get_image(xtoq_context_t *context) { xcb_get_geometry_reply_t *geom_reply; - //image_data_t img_data; xcb_image_t *image; geom_reply = _xtoq_get_window_geometry(context->conn, context->window); @@ -138,15 +137,9 @@ xtoq_get_image(xtoq_context_t *context) { free(geom_reply); -/* printf("Returning initial image with x=%d y=%d w=%d h=%d\n", xtoq_image->x, xtoq_image->y, xtoq_image->width, xtoq_image->height); */ return xtoq_image; } -void -xtoq_free_image(xcb_image_t *img) { - free(img); -} - int xtoq_start_event_loop (xtoq_context_t *context, xtoq_event_cb_t callback) @@ -158,14 +151,8 @@ xtoq_start_event_loop (xtoq_context_t *context, xtoq_image_t * test_xtoq_get_image(xtoq_context_t *context) { - // printf("Top of test get image\n"); - //xcb_get_geometry_reply_t *geom_reply; - - //image_data_t img_data; xcb_image_t *image; - //geom_reply = _xtoq_get_window_geometry(context.conn, context.window); - xcb_flush(context->conn); /* Get the image of the root window */ image = xcb_image_get(context->conn, @@ -176,7 +163,6 @@ test_xtoq_get_image(xtoq_context_t *context) { context->damaged_height, (unsigned int) ~0L, XCB_IMAGE_FORMAT_Z_PIXMAP); - //xtoq_image_t * xtoq_image; //FIXME - Calculate memory size correctly xtoq_image_t * xtoq_image = (xtoq_image_t *) malloc(10 * sizeof (xtoq_image_t)); @@ -187,16 +173,13 @@ test_xtoq_get_image(xtoq_context_t *context) { xtoq_image->width = context->damaged_width; xtoq_image->height = context->damaged_height; - //printf("Returning image with x=%d y=%d w=%d h=%d\n", xtoq_image->x, xtoq_image->y, xtoq_image->width, xtoq_image->height); - - //free(geom_reply); return xtoq_image; } void xtoq_image_destroy(xtoq_image_t * xtoq_image){ - //FIXME - is this all that needs to be done? + xcb_image_destroy(xtoq_image->image); free(xtoq_image); } diff --git a/src/libcompositewm/xtoq_internal.h b/src/libcompositewm/xtoq_internal.h index 2f2c002..8702719 100644 --- a/src/libcompositewm/xtoq_internal.h +++ b/src/libcompositewm/xtoq_internal.h @@ -92,6 +92,9 @@ _xtoq_get_window_geometry (xcb_connection_t *conn, xcb_window_t window); * Print out information about the existing windows attached to our * root. Most of this code is taken from src/manage.c from the i3 code * by Michael Stapelberg + * @param conn a connection the the xserver. + * @param window the window. + * @return the geometry of the window */ void _xtoq_write_all_children_window_info (xcb_connection_t *conn, @@ -99,9 +102,9 @@ _xtoq_write_all_children_window_info (xcb_connection_t *conn, /** * Get the image data for a window. - * @param conn The connection to the xserver. - * @param window The window. - * @return Structure containing data and data length + * @param conn the connection to the xserver. + * @param root the window acenstral to all children to be written. + * @return a structure containing data and data length. */ image_data_t _xtoq_get_window_image_data (xcb_connection_t *conn, xcb_window_t window); @@ -130,20 +133,41 @@ _xtoq_request_check (xcb_connection_t *conn, xcb_void_cookie_t cookie, * init.c ****************/ +/** + * Initializes an extension on the xserver. + * @param conn The connection to the xserver. + * @param extension_name The string specifying the name of the extension. + * @return The reply structure + */ xcb_query_extension_reply_t * _xtoq_init_extension(xcb_connection_t *conn, char *extension_name); +/** + * Initializes damage on a window contained in a context. + * The context will likely contain the root window. + * @param contxt A context containing a window + */ void _xtoq_init_damage(xtoq_context_t *contxt); +/** + * Initializes the composite extension on the context containg + * the root window. + * @param contxt The contxt containing the root window + */ void _xtoq_init_composite(xtoq_context_t *contxt); +/** + * Initialize the xfixes extension. + * @param contxt The context + */ void _xtoq_init_xfixes (xtoq_context_t *contxt); /** * Get the values for the WM_* atoms that we need. + * @param contxt The context */ void _xtoq_get_wm_atoms (xtoq_context_t *contxt); |