From 0086bcb2b4d20dfa557b19f121c4edb5bb057e95 Mon Sep 17 00:00:00 2001 From: Michael Stapelberg Date: Sun, 23 Oct 2011 17:26:06 +0100 Subject: [PATCH] i3-input: eliminate xcb_change_gc_single usage with C99 --- i3-input/main.c | 8 ++++---- i3-input/xcb.c | 8 -------- 2 files changed, 4 insertions(+), 12 deletions(-) diff --git a/i3-input/main.c b/i3-input/main.c index ca6ae7a0..931afc2b 100644 --- a/i3-input/main.c +++ b/i3-input/main.c @@ -92,13 +92,13 @@ static int handle_expose(void *data, xcb_connection_t *conn, xcb_expose_event_t /* re-draw the background */ xcb_rectangle_t border = {0, 0, 500, font_height + 8}, inner = {2, 2, 496, font_height + 8 - 4}; - xcb_change_gc_single(conn, pixmap_gc, XCB_GC_FOREGROUND, get_colorpixel(conn, "#FF0000")); + xcb_change_gc(conn, pixmap_gc, XCB_GC_FOREGROUND, (uint32_t[]){ get_colorpixel(conn, "#FF0000") }); xcb_poly_fill_rectangle(conn, pixmap, pixmap_gc, 1, &border); - xcb_change_gc_single(conn, pixmap_gc, XCB_GC_FOREGROUND, get_colorpixel(conn, "#000000")); + xcb_change_gc(conn, pixmap_gc, XCB_GC_FOREGROUND, (uint32_t[]){ get_colorpixel(conn, "#000000") }); xcb_poly_fill_rectangle(conn, pixmap, pixmap_gc, 1, &inner); /* restore font color */ - xcb_change_gc_single(conn, pixmap_gc, XCB_GC_FOREGROUND, get_colorpixel(conn, "#FFFFFF")); + xcb_change_gc(conn, pixmap_gc, XCB_GC_FOREGROUND, (uint32_t[]){ get_colorpixel(conn, "#FFFFFF") }); uint8_t *con = concat_strings(glyphs_ucs, input_position); char *full_text = (char*)con; if (prompt != NULL) { @@ -374,7 +374,7 @@ int main(int argc, char *argv[]) { xcb_set_input_focus(conn, XCB_INPUT_FOCUS_POINTER_ROOT, win, XCB_CURRENT_TIME); /* Create graphics context */ - xcb_change_gc_single(conn, pixmap_gc, XCB_GC_FONT, font_id); + xcb_change_gc(conn, pixmap_gc, XCB_GC_FONT, (uint32_t[]){ font_id }); /* Grab the keyboard to get all input */ xcb_flush(conn); diff --git a/i3-input/xcb.c b/i3-input/xcb.c index 3c1d99e1..0c7e9434 100644 --- a/i3-input/xcb.c +++ b/i3-input/xcb.c @@ -20,14 +20,6 @@ #include "i3-input.h" -/* - * Convenience-wrapper around xcb_change_gc which saves us declaring a variable - * - */ -void xcb_change_gc_single(xcb_connection_t *conn, xcb_gcontext_t gc, uint32_t mask, uint32_t value) { - xcb_change_gc(conn, gc, mask, &value); -} - /* * Returns the colorpixel to use for the given hex color (think of HTML). * -- 2.39.5