1
0
Fork 0
mirror of https://github.com/davatorium/rofi.git synced 2024-11-25 13:55:34 -05:00

Remove Atom with xcb_atom_t.

This commit is contained in:
Dave Davenport 2016-02-28 12:19:56 +01:00
parent c519b6a65a
commit ab57479da9
5 changed files with 9 additions and 5 deletions

View file

@ -21,7 +21,7 @@
*
* @returns a newly allocated string with the result or NULL
*/
char* window_get_text_prop ( xcb_connection_t *xcb_connection, xcb_window_t w, Atom atom );
char* window_get_text_prop ( xcb_connection_t *xcb_connection, xcb_window_t w, xcb_atom_t atom );
void window_set_atom_prop ( xcb_connection_t *xcb_connection, xcb_window_t w, xcb_atom_t prop, xcb_atom_t *atoms, int count );

View file

@ -216,7 +216,7 @@ static xcb_get_window_attributes_reply_t * window_get_attributes ( xcb_connectio
return NULL;
}
// _NET_WM_STATE_*
static int client_has_state ( client *c, Atom state )
static int client_has_state ( client *c, xcb_atom_t state )
{
for ( int i = 0; i < c->states; i++ ) {
if ( c->state[i] == state ) {
@ -226,7 +226,7 @@ static int client_has_state ( client *c, Atom state )
return 0;
}
static int client_has_window_type ( client *c, Atom type )
static int client_has_window_type ( client *c, xcb_atom_t type )
{
for ( int i = 0; i < c->window_types; i++ ) {
if ( c->window_type[i] == type ) {

View file

@ -551,7 +551,7 @@ static Window __create_window ( xcb_connection_t *xcb_connection, xcb_screen_t *
xcb_ewmh._NET_WM_STATE_FULLSCREEN,
xcb_ewmh._NET_WM_STATE_ABOVE
};
window_set_atom_prop ( xcb_connection, box, xcb_ewmh._NET_WM_STATE, atoms, sizeof ( atoms ) / sizeof ( Atom ) );
window_set_atom_prop ( xcb_connection, box, xcb_ewmh._NET_WM_STATE, atoms, sizeof ( atoms ) / sizeof ( xcb_atom_t ) );
}
// Set the WM_NAME

View file

@ -76,7 +76,7 @@ extern xcb_connection_t *xcb_connection;
// retrieve a text property from a window
// technically we could use window_get_prop(), but this is better for character set support
char* window_get_text_prop ( xcb_connection_t *xcb_connection, xcb_window_t w, Atom atom )
char* window_get_text_prop ( xcb_connection_t *xcb_connection, xcb_window_t w, xcb_atom_t atom )
{
xcb_get_property_cookie_t c = xcb_get_property( xcb_connection, 0, w, atom, XCB_GET_PROPERTY_TYPE_ANY, 0, UINT_MAX);
xcb_get_property_reply_t *r = xcb_get_property_reply( xcb_connection, c, NULL);

View file

@ -48,6 +48,10 @@ int show_error_message ( const char *msg, int markup )
int main ( G_GNUC_UNUSED int argc, G_GNUC_UNUSED char **argv )
{
cairo_surface_t *surf = cairo_image_surface_create(CAIRO_FORMAT_ARGB32, 100, 100);
cairo_t *draw = cairo_create(surf);
PangoContext *p = pango_cairo_create_context ( draw );
textbox_set_pango_context ( p );
textbox *box = textbox_create ( TB_EDITABLE | TB_AUTOWIDTH | TB_AUTOHEIGHT, 0, 0, -1, -1,
NORMAL, "test" );