[Xcb-commit] 2 commits - icccm wm
Ian Osgood
iano at kemper.freedesktop.org
Wed Feb 7 19:15:53 PST 2007
icccm/icccm.c | 218 ++++++++++++++++++++++++++---------------------------
icccm/xcb_icccm.h | 196 +++++++++++++++++++++++------------------------
wm/manage.c | 28 +++---
wm/reply_formats.c | 8 -
wm/reply_formats.h | 8 -
wm/table.c | 14 +--
wm/xcb_wm.h | 30 +++----
wm/xcbwm-test.c | 28 +++---
8 files changed, 265 insertions(+), 265 deletions(-)
New commits:
diff-tree e9f791e0977f818d1f7b4b8db7baacd98fe591ce (from f13b887e4744b1849efe1bc1083dfe93d317ea3c)
Author: Thomas Hunger <hto at arcor.de>
Date: Wed Feb 7 19:11:08 2007 -0800
icccm: new naming convention
diff --git a/icccm/icccm.c b/icccm/icccm.c
index 63d4694..969d8aa 100644
--- a/icccm/icccm.c
+++ b/icccm/icccm.c
@@ -5,7 +5,7 @@
static int
-GetTextProperty(xcb_connection_t *c,
+get_text_property(xcb_connection_t *c,
xcb_window_t window,
xcb_atom_t property,
uint8_t *format,
@@ -39,7 +39,7 @@ GetTextProperty(xcb_connection_t *c,
/* WM_NAME */
void
-SetWMName (xcb_connection_t *c,
+set_wm_name (xcb_connection_t *c,
xcb_window_t window,
xcb_atom_t encoding,
uint32_t name_len,
@@ -49,18 +49,18 @@ SetWMName (xcb_connection_t *c,
}
int
-GetWMName (xcb_connection_t *c,
+get_wm_name (xcb_connection_t *c,
xcb_window_t window,
uint8_t *format,
xcb_atom_t *encoding,
uint32_t *name_len,
char **name)
{
- return GetTextProperty(c, window, WM_NAME, format, encoding, name_len, name);
+ return get_text_property(c, window, WM_NAME, format, encoding, name_len, name);
}
void
-WatchWMName (property_handlers_t *prophs,
+watch_wm_name (property_handlers_t *prophs,
uint32_t long_len,
generic_property_handler handler,
void *data)
@@ -71,7 +71,7 @@ WatchWMName (property_handlers_t *p
/* WM_ICON_NAME */
void
-SetWMIconName (xcb_connection_t *c,
+set_wm_icon_name (xcb_connection_t *c,
xcb_window_t window,
xcb_atom_t encoding,
uint32_t name_len,
@@ -81,18 +81,18 @@ SetWMIconName (xcb_connection_t *c,
}
int
-GetWMIconName (xcb_connection_t *c,
+get_wm_icon_name (xcb_connection_t *c,
xcb_window_t window,
uint8_t *format,
xcb_atom_t *encoding,
uint32_t *name_len,
char **name)
{
- return GetTextProperty(c, window, WM_ICON_NAME, format, encoding, name_len, name);
+ return get_text_property(c, window, WM_ICON_NAME, format, encoding, name_len, name);
}
void
-WatchWMIconName (property_handlers_t *prophs,
+watch_wm_icon_name (property_handlers_t *prophs,
uint32_t long_len,
generic_property_handler handler,
void *data)
@@ -103,7 +103,7 @@ WatchWMIconName (property_handlers_t
/* WM_CLIENT_MACHINE */
void
-SetWMClientMachine (xcb_connection_t *c,
+set_wm_client_machine (xcb_connection_t *c,
xcb_window_t window,
xcb_atom_t encoding,
uint32_t name_len,
@@ -113,18 +113,18 @@ SetWMClientMachine (xcb_connection_t *c,
}
int
-GetWMClientMachine (xcb_connection_t *c,
+get_wm_client_machine (xcb_connection_t *c,
xcb_window_t window,
uint8_t *format,
xcb_atom_t *encoding,
uint32_t *name_len,
char **name)
{
- return GetTextProperty(c, window, WM_CLIENT_MACHINE, format, encoding, name_len, name);
+ return get_text_property(c, window, WM_CLIENT_MACHINE, format, encoding, name_len, name);
}
void
-WatchWMClientMachine (property_handlers_t *prophs,
+watch_wm_client_machine (property_handlers_t *prophs,
uint32_t long_len,
generic_property_handler handler,
void *data)
@@ -147,7 +147,7 @@ typedef enum {
PWinGravity = 1 << 9
} SizeHintsFlags;
-struct SizeHints {
+struct size_hints_t {
uint32_t flags;
int32_t x, y, width, height;
int32_t min_width, min_height;
@@ -159,20 +159,20 @@ struct SizeHints {
uint32_t win_gravity;
};
-SizeHints *
-AllocSizeHints()
+size_hints_t *
+alloc_size_hints()
{
- return calloc(1, sizeof(SizeHints));
+ return calloc(1, sizeof(size_hints_t));
}
void
-FreeSizeHints(SizeHints *hints)
+free_size_hints(size_hints_t *hints)
{
free(hints);
}
void
-SizeHintsGetPosition (SizeHints *hints,
+size_hints_get_position (size_hints_t *hints,
int32_t *x,
int32_t *y)
{
@@ -181,7 +181,7 @@ SizeHintsGetPosition (SizeHints *hints,
}
void
-SizeHintsGetSize (SizeHints *hints,
+size_hints_get_size (size_hints_t *hints,
int32_t *width,
int32_t *height)
{
@@ -190,7 +190,7 @@ SizeHintsGetSize (SizeHints *hints,
}
void
-SizeHintsGetMinSize (SizeHints *hints,
+size_hints_get_min_size (size_hints_t *hints,
int32_t *min_width,
int32_t *min_height)
{
@@ -199,7 +199,7 @@ SizeHintsGetMinSize (SizeHints *hints,
}
void
-SizeHintsGetMaxSize (SizeHints *hints,
+size_hints_get_max_size (size_hints_t *hints,
int32_t *max_width,
int32_t *max_height)
{
@@ -208,7 +208,7 @@ SizeHintsGetMaxSize (SizeHints *hints,
}
void
-SizeHintsGetIncrease (SizeHints *hints,
+size_hints_get_increase (size_hints_t *hints,
int32_t *width_inc,
int32_t *height_inc)
{
@@ -217,7 +217,7 @@ SizeHintsGetIncrease (SizeHints *hints,
}
void
-SizeHintsGetMinAspect (SizeHints *hints,
+size_hints_get_min_aspect (size_hints_t *hints,
int32_t *min_aspect_num,
int32_t *min_aspect_den)
{
@@ -226,7 +226,7 @@ SizeHintsGetMinAspect (SizeHints *hints,
}
void
-SizeHintsGetMaxAspect (SizeHints *hints,
+size_hints_get_max_aspect (size_hints_t *hints,
int32_t *max_aspect_num,
int32_t *max_aspect_den)
{
@@ -235,7 +235,7 @@ SizeHintsGetMaxAspect (SizeHints *hints,
}
void
-SizeHintsGetBaseSize (SizeHints *hints,
+size_hints_get_base_size (size_hints_t *hints,
int32_t *base_width,
int32_t *base_height)
{
@@ -244,139 +244,139 @@ SizeHintsGetBaseSize (SizeHints *hints,
}
uint32_t
-SizeHintsGetWinGravity (SizeHints *hints)
+size_hints_get_win_gravity (size_hints_t *hints)
{
return hints->win_gravity;
}
uint8_t
-SizeHintsIsUSPosition (SizeHints *hints)
+size_hints_is_us_position (size_hints_t *hints)
{
return (hints->flags & USPosition);
}
uint8_t
-SizeHintsIsUSSize (SizeHints *hints)
+size_hints_is_us_size (size_hints_t *hints)
{
return (hints->flags & USSize);
}
uint8_t
-SizeHintsIsPPosition (SizeHints *hints)
+size_hints_is_p_position (size_hints_t *hints)
{
return (hints->flags & PPosition);
}
uint8_t
-SizeHintsIsPSize (SizeHints *hints)
+size_hints_is_p_size (size_hints_t *hints)
{
return (hints->flags & PSize);
}
uint8_t
-SizeHintsIsPMinSize (SizeHints *hints)
+size_hints_is_p_min_size (size_hints_t *hints)
{
return (hints->flags & PMinSize);
}
uint8_t
-SizeHintsIsPMaxSize (SizeHints *hints)
+size_hints_is_p_max_size (size_hints_t *hints)
{
return (hints->flags & PMaxSize);
}
uint8_t
-SizeHintsIsPResizeInc (SizeHints *hints)
+size_hints_is_p_resize_inc (size_hints_t *hints)
{
return (hints->flags & PResizeInc);
}
uint8_t
-SizeHintsIsPAspect (SizeHints *hints)
+size_hints_is_p_aspect (size_hints_t *hints)
{
return (hints->flags & PAspect);
}
uint8_t
-SizeHintsIsPBaseSize (SizeHints *hints)
+size_hints_is_p_base_size (size_hints_t *hints)
{
return (hints->flags & PBaseSize);
}
uint8_t
-SizeHintsIsPWinGravity (SizeHints *hints)
+size_hints_is_p_win_gravity (size_hints_t *hints)
{
return (hints->flags & PWinGravity);
}
void
-SizeHintsSetFlagNone (SizeHints *hints)
+size_hints_set_flag_none (size_hints_t *hints)
{
hints->flags = 0;
}
void
-SizeHintsSetFlagUSPosition (SizeHints *hints)
+size_hints_set_flag_us_position (size_hints_t *hints)
{
hints->flags = USPosition;
}
void
-SizeHintsSetFlagUSSize (SizeHints *hints)
+size_hints_set_flag_us_size (size_hints_t *hints)
{
hints->flags = USSize;
}
void
-SizeHintsSetFlagPPosition (SizeHints *hints)
+size_hints_set_flag_p_position (size_hints_t *hints)
{
hints->flags = PPosition;
}
void
-SizeHintsSetFlagPSize (SizeHints *hints)
+size_hints_set_flag_p_size (size_hints_t *hints)
{
hints->flags = PSize;
}
void
-SizeHintsSetFlagPMinSize (SizeHints *hints)
+size_hints_set_flag_p_min_size (size_hints_t *hints)
{
hints->flags = PMinSize;
}
void
-SizeHintsSetFlagPMaxSize (SizeHints *hints)
+size_hints_set_flag_p_max_size (size_hints_t *hints)
{
hints->flags = PMaxSize;
}
void
-SizeHintsSetFlagPResizeInc (SizeHints *hints)
+size_hints_set_flag_p_resize_inc (size_hints_t *hints)
{
hints->flags = PResizeInc;
}
void
-SizeHintsSetFlagPAspect (SizeHints *hints)
+size_hints_set_flag_p_aspect (size_hints_t *hints)
{
hints->flags = PAspect;
}
void
-SizeHintsSetFlagPBaseSize (SizeHints *hints)
+size_hints_set_flag_p_base_size (size_hints_t *hints)
{
hints->flags = PBaseSize;
}
void
-SizeHintsSetFlagPWinGravity (SizeHints *hints)
+size_hints_set_flag_p_win_gravity (size_hints_t *hints)
{
hints->flags = PWinGravity;
}
void
-SizeHintsSetPosition (SizeHints *hints,
+size_hints_set_position (size_hints_t *hints,
int user_specified,
int32_t x,
int32_t y)
@@ -391,7 +391,7 @@ SizeHintsSetPosition (SizeHints *hints,
}
void
-SizeHintsSetSize (SizeHints *hints,
+size_hints_set_size (size_hints_t *hints,
int user_specified,
int32_t width,
int32_t height)
@@ -406,7 +406,7 @@ SizeHintsSetSize (SizeHints *hints,
}
void
-SizeHintsSetMinSize (SizeHints *hints,
+size_hints_set_min_size (size_hints_t *hints,
int32_t min_width,
int32_t min_height)
{
@@ -416,7 +416,7 @@ SizeHintsSetMinSize (SizeHints *hints,
}
void
-SizeHintsSetMaxSize (SizeHints *hints,
+size_hints_set_max_size (size_hints_t *hints,
int32_t max_width,
int32_t max_height)
{
@@ -426,7 +426,7 @@ SizeHintsSetMaxSize (SizeHints *hints,
}
void
-SizeHintsSetResizeInc (SizeHints *hints,
+size_hints_set_resize_inc (size_hints_t *hints,
int32_t width_inc,
int32_t height_inc)
{
@@ -436,7 +436,7 @@ SizeHintsSetResizeInc (SizeHints *hints,
}
void
-SizeHintsSetAspect (SizeHints *hints,
+size_hints_set_aspect (size_hints_t *hints,
int32_t min_aspect_num,
int32_t min_aspect_den,
int32_t max_aspect_num,
@@ -450,7 +450,7 @@ SizeHintsSetAspect (SizeHints *hints,
}
void
-SizeHintsSetBaseSize (SizeHints *hints,
+size_hints_set_base_size (size_hints_t *hints,
int32_t base_width,
int32_t base_height)
{
@@ -460,7 +460,7 @@ SizeHintsSetBaseSize (SizeHints *hints,
}
void
-SizeHintsSetWinGravity (SizeHints *hints,
+size_hints_set_win_gravity (size_hints_t *hints,
uint8_t win_gravity)
{
hints->flags |= PWinGravity;
@@ -468,19 +468,19 @@ SizeHintsSetWinGravity (SizeHints *hints
}
void
-SetWMSizeHints (xcb_connection_t *c,
+set_wm_size_hints (xcb_connection_t *c,
xcb_window_t window,
xcb_atom_t property,
- SizeHints *hints)
+ size_hints_t *hints)
{
xcb_change_property(c, XCB_PROP_MODE_REPLACE, window, property, WM_SIZE_HINTS, 32, sizeof(*hints) / 4, hints);
}
int
-GetWMSizeHints (xcb_connection_t *c,
+get_wm_size_hints (xcb_connection_t *c,
xcb_window_t window,
xcb_atom_t property,
- SizeHints *hints,
+ size_hints_t *hints,
long *supplied)
{
xcb_get_property_cookie_t cookie;
@@ -508,7 +508,7 @@ GetWMSizeHints (xcb_connection_t *c,
prop = (char *)malloc(sizeof(char)*length);
memcpy(prop, xcb_get_property_value (rep), length);
prop[length] = '\0';
- hints = (SizeHints *)strdup (prop);
+ hints = (size_hints_t *)strdup (prop);
*supplied = (USPosition | USSize |
PPosition | PSize |
@@ -538,25 +538,25 @@ GetWMSizeHints (xcb_connection_t *c,
/* WM_NORMAL_HINTS */
void
-SetWMNormalHints (xcb_connection_t *c,
+set_wm_normal_hints (xcb_connection_t *c,
xcb_window_t window,
- SizeHints *hints)
+ size_hints_t *hints)
{
- SetWMSizeHints(c, window, WM_NORMAL_HINTS, hints);
+ set_wm_size_hints(c, window, WM_NORMAL_HINTS, hints);
}
int
-GetWMNormalHints (xcb_connection_t *c,
+get_wm_normal_hints (xcb_connection_t *c,
xcb_window_t window,
- SizeHints *hints,
+ size_hints_t *hints,
long *supplied)
{
- return (GetWMSizeHints (c, window, WM_NORMAL_HINTS, hints, supplied));
+ return (get_wm_size_hints (c, window, WM_NORMAL_HINTS, hints, supplied));
}
/* WM_HINTS */
-struct WMHints {
+struct wm_hints_t {
int32_t flags; /* marks which fields in this structure are defined */
uint8_t input; /* does this application rely on the window manager
to get keyboard input? */
@@ -585,192 +585,192 @@ typedef enum {
IconWindowHint| IconPositionHint | IconMaskHint | \
WindowGroupHint)
-WMHints *
-AllocWMHints()
+wm_hints_t *
+alloc_wm_hints()
{
- return calloc(1, sizeof(WMHints));
+ return calloc(1, sizeof(wm_hints_t));
}
uint8_t
-WMHintsGetInput(WMHints *hints)
+wm_hints_get_input(wm_hints_t *hints)
{
return hints->input;
}
xcb_pixmap_t
-WMHintsGetIconPixmap(WMHints *hints)
+wm_hints_get_icon_pixmap(wm_hints_t *hints)
{
return hints->icon_pixmap;
}
xcb_pixmap_t
-WMHintsGetIconMask(WMHints *hints)
+wm_hints_get_icon_mask(wm_hints_t *hints)
{
return hints->icon_mask;
}
xcb_window_t
-WMHintsGetIconWindow(WMHints *hints)
+wm_hints_get_icon_window(wm_hints_t *hints)
{
return hints->icon_window;
}
xcb_window_t
-WMHintsGetWindowGroup(WMHints *hints)
+wm_hints_get_window_group(wm_hints_t *hints)
{
return hints->window_group;
}
uint8_t
-WMHintsIsInputHint(WMHints *hints)
+wm_hints_is_input_hint(wm_hints_t *hints)
{
return (hints->flags & xcb_wm_input_hint_t);
}
uint8_t
-WMHintsIsStateHint(WMHints *hints)
+wm_hints_is_state_hint(wm_hints_t *hints)
{
return (hints->flags & xcb_wm_state_hint_t);
}
uint8_t
-WMHintsIsIconPixmapHint(WMHints *hints)
+wm_hints_is_icon_pixmap_hint(wm_hints_t *hints)
{
return (hints->flags & xcb_wm_icon_pixmap_hint_t);
}
uint8_t
-WMHintsIsIconWindowHint(WMHints *hints)
+wm_hints_is_icon_window_hint(wm_hints_t *hints)
{
return (hints->flags & xcb_wm_icon_window_hint_t);
}
uint8_t
-WMHintsIsIconPositionHint(WMHints *hints)
+wm_hints_is_icon_position_hint(wm_hints_t *hints)
{
return (hints->flags & xcb_wm_icon_position_hint_t);
}
uint8_t
-WMHintsIsIconMaskHint(WMHints *hints)
+wm_hints_is_icon_mask_hint(wm_hints_t *hints)
{
return (hints->flags & xcb_wm_icon_mask_hint_t);
}
uint8_t
-WMHintsIsWindowGroupHint(WMHints *hints)
+wm_hints_is_window_group_hint(wm_hints_t *hints)
{
return (hints->flags & xcb_wm_window_group_hint_t);
}
uint8_t
-WMHintsIsXUrgencyHint(WMHints *hints)
+wm_hints_is_xu_hint(wm_hints_t *hints)
{
return (hints->flags & xcb_wmx_urgency_hint_t);
}
uint8_t
-WMHintsStateIsWithdrawn(WMHints *hints)
+wm_hints_state_is_withdrawn(wm_hints_t *hints)
{
return (hints->initial_state == xcb_wm_withdrawn_state_t);
}
uint8_t
-WMHintsStateIsNormal(WMHints *hints)
+wm_hints_state_is_normal(wm_hints_t *hints)
{
return (hints->initial_state == xcb_wm_normal_state_t);
}
uint8_t
-WMHintsStateIsIconic(WMHints *hints)
+wm_hints_state_is_iconic(wm_hints_t *hints)
{
return (hints->initial_state == xcb_wm_iconic_state_t);
}
void
-WMHintsSetInput(WMHints *hints, uint8_t input)
+wm_hints_set_input(wm_hints_t *hints, uint8_t input)
{
hints->input = input;
hints->flags |= xcb_wm_input_hint_t;
}
void
-WMHintsSetIconic(WMHints *hints)
+wm_hints_set_iconic(wm_hints_t *hints)
{
hints->initial_state = xcb_wm_iconic_state_t;
hints->flags |= xcb_wm_state_hint_t;
}
void
-WMHintsSetNormal(WMHints *hints)
+wm_hints_set_normal(wm_hints_t *hints)
{
hints->initial_state = xcb_wm_normal_state_t;
hints->flags |= xcb_wm_state_hint_t;
}
void
-WMHintsSetWithdrawn(WMHints *hints)
+wm_hints_set_withdrawn(wm_hints_t *hints)
{
hints->initial_state = xcb_wm_withdrawn_state_t;
hints->flags |= xcb_wm_state_hint_t;
}
void
-WMHintsSetNone(WMHints *hints)
+wm_hints_set_none(wm_hints_t *hints)
{
hints->flags &= ~xcb_wm_state_hint_t;
}
void
-WMHintsSetUrgent(WMHints *hints)
+wm_hints_set_urgent(wm_hints_t *hints)
{
hints->flags |= xcb_wmx_urgency_hint_t;
}
void
-WMHintsSetIconPixmap(WMHints *hints, xcb_pixmap_t icon_pixmap)
+wm_hints_set_icon_pixmap(wm_hints_t *hints, xcb_pixmap_t icon_pixmap)
{
hints->icon_pixmap = icon_pixmap;
hints->flags |= xcb_wm_icon_pixmap_hint_t;
}
void
-WMHintsSetIconMask(WMHints *hints, xcb_pixmap_t icon_mask)
+wm_hints_set_icon_mask(wm_hints_t *hints, xcb_pixmap_t icon_mask)
{
hints->icon_mask = icon_mask;
hints->flags |= xcb_wm_icon_mask_hint_t;
}
void
-WMHintsSetIconWindow(WMHints *hints, xcb_window_t icon_window)
+wm_hints_set_icon_window(wm_hints_t *hints, xcb_window_t icon_window)
{
hints->icon_window = icon_window;
hints->flags |= xcb_wm_icon_window_hint_t;
}
void
-WMHintsSetWindowGroup(WMHints *hints, xcb_window_t window_group)
+wm_hints_set_window_group(wm_hints_t *hints, xcb_window_t window_group)
{
hints->window_group = window_group;
hints->flags |= xcb_wm_window_group_hint_t;
}
void
-SetWMHints (xcb_connection_t *c,
+set_wm_hints (xcb_connection_t *c,
xcb_window_t window,
- WMHints *hints)
+ wm_hints_t *hints)
{
xcb_change_property(c, XCB_PROP_MODE_REPLACE, window, WM_HINTS, WM_HINTS, 32, sizeof(*hints) / 4, hints);
}
-WMHints *
-GetWMHints (xcb_connection_t *c,
+wm_hints_t *
+get_wm_hints (xcb_connection_t *c,
xcb_window_t window)
{
xcb_get_property_cookie_t cookie;
xcb_get_property_reply_t *rep;
- WMHints *hints;
+ wm_hints_t *hints;
char *prop;
long length;
@@ -788,7 +788,7 @@ GetWMHints (xcb_connection_t *c,
free (rep);
return NULL;
}
- hints = (WMHints *)calloc (1, (unsigned)sizeof (WMHints));
+ hints = (wm_hints_t *)calloc (1, (unsigned)sizeof (wm_hints_t));
if (!hints)
{
free (rep);
@@ -798,7 +798,7 @@ GetWMHints (xcb_connection_t *c,
length = xcb_get_property_value_length (rep);
prop = (char *) xcb_get_property_value (rep);
prop[length] = '\0';
- hints = (WMHints *)strdup (prop);
+ hints = (wm_hints_t *)strdup (prop);
if (rep->value_len < NumWMHintsElements)
hints->window_group = XCB_NONE;
@@ -808,7 +808,7 @@ GetWMHints (xcb_connection_t *c,
/* WM_PROTOCOLS */
void
-SetWMProtocols (xcb_connection_t *c,
+set_wm_protocols (xcb_connection_t *c,
xcb_window_t window,
uint32_t list_len,
xcb_atom_t *list)
@@ -823,7 +823,7 @@ SetWMProtocols (xcb_connection_t *c,
}
int
-GetWMProtocols (xcb_connection_t *c,
+get_wm_protocols (xcb_connection_t *c,
xcb_window_t window,
uint32_t *list_len,
xcb_atom_t **list)
@@ -878,17 +878,17 @@ static char *makename(const char *fmt, .
return ret;
}
-char *DiscriminatedAtomNameByScreen(const char *base, uint8_t screen)
+char *discriminated_atom_name_by_screen(const char *base, uint8_t screen)
{
return makename("%s_S%u", base, screen);
}
-char *DiscriminatedAtomNameByResource(const char *base, uint32_t resource)
+char *discriminated_atom_name_by_resource(const char *base, uint32_t resource)
{
return makename("%s_R%08X", base, resource);
}
-char *DiscriminatedAtomNameUnique(const char *base, uint32_t id)
+char *discriminated_atom_name_unique(const char *base, uint32_t id)
{
if(base)
return makename("%s_U%lu", base, id);
diff --git a/icccm/xcb_icccm.h b/icccm/xcb_icccm.h
index b655935..09e2e76 100644
--- a/icccm/xcb_icccm.h
+++ b/icccm/xcb_icccm.h
@@ -12,181 +12,181 @@ extern "C" {
/* WM_NAME */
-void SetWMName (xcb_connection_t *c,
+void set_wm_name (xcb_connection_t *c,
xcb_window_t window,
xcb_atom_t encoding,
uint32_t name_len,
const char *name);
-int GetWMName (xcb_connection_t *c,
+int get_wm_name (xcb_connection_t *c,
xcb_window_t window,
uint8_t *format,
xcb_atom_t *encoding,
uint32_t *name_len,
char **name);
-void WatchWMName (property_handlers_t *prophs,
+void watch_wm_name (property_handlers_t *prophs,
uint32_t long_len,
generic_property_handler handler,
void *data);
/* WM_ICON_NAME */
-void SetWMIconName (xcb_connection_t *c,
+void set_wm_icon_name (xcb_connection_t *c,
xcb_window_t window,
xcb_atom_t encoding,
uint32_t name_len,
const char *name);
-int GetWMIconName (xcb_connection_t *c,
+int get_wm_icon_name (xcb_connection_t *c,
xcb_window_t window,
uint8_t *format,
xcb_atom_t *encoding,
uint32_t *name_len,
char **name);
-void WatchWMIconName (property_handlers_t *prophs,
+void watch_wm_icon_name (property_handlers_t *prophs,
uint32_t long_len,
generic_property_handler handler,
void *data);
/* WM_CLIENT_MACHINE */
-void SetWMClientMachine (xcb_connection_t *c,
+void set_wm_client_machine (xcb_connection_t *c,
xcb_window_t window,
xcb_atom_t encoding,
uint32_t name_len,
const char *name);
-int GetWMClientMachine (xcb_connection_t *c,
+int get_wm_client_machine (xcb_connection_t *c,
xcb_window_t window,
uint8_t *format,
xcb_atom_t *encoding,
uint32_t *name_len,
char **name);
-void WatchWMClientMachine (property_handlers_t *prophs,
+void watch_wm_client_machine (property_handlers_t *prophs,
uint32_t long_len,
generic_property_handler handler,
void *data);
/* WM_SIZE_HINTS */
-typedef struct SizeHints SizeHints;
+typedef struct size_hints_t size_hints_t;
-SizeHints *AllocSizeHints ();
+size_hints_t *alloc_size_hints ();
-void FreeSizeHints (SizeHints *hints);
+void free_size_hints (size_hints_t *hints);
-void SizeHintsGetPosition (SizeHints *hints,
+void size_hints_get_position (size_hints_t *hints,
int32_t *x,
int32_t *y);
-void SizeHintsGetSize (SizeHints *hints,
+void size_hints_get_size (size_hints_t *hints,
int32_t *width,
int32_t *height);
-void SizeHintsGetMinSize (SizeHints *hints,
+void size_hints_get_min_size (size_hints_t *hints,
int32_t *min_width,
int32_t *min_height);
-void SizeHintsGetMaxSize (SizeHints *hints,
+void size_hints_get_max_size (size_hints_t *hints,
int32_t *max_width,
int32_t *max_height);
-void SizeHintsGetIncrease (SizeHints *hints,
+void size_hints_get_increase (size_hints_t *hints,
int32_t *width_inc,
int32_t *height_inc);
-void SizeHintsGetMinAspect (SizeHints *hints,
+void size_hints_get_min_aspect (size_hints_t *hints,
int32_t *min_aspect_num,
int32_t *min_aspect_den);
-void SizeHintsGetMaxAspect (SizeHints *hints,
+void size_hints_get_max_aspect (size_hints_t *hints,
int32_t *max_aspect_num,
int32_t *max_aspect_den);
-void SizeHintsGetBaseSize (SizeHints *hints,
+void size_hints_get_base_size (size_hints_t *hints,
int32_t *base_width,
int32_t *base_height);
-uint32_t SizeHintsGetWinGravity (SizeHints *hints);
+uint32_t size_hints_get_win_gravity (size_hints_t *hints);
-uint8_t SizeHintsIsUSPosition (SizeHints *hints);
-uint8_t SizeHintsIsUSSize (SizeHints *hints);
-uint8_t SizeHintsIsPPosition (SizeHints *hints);
-uint8_t SizeHintsIsPSize (SizeHints *hints);
-uint8_t SizeHintsIsPMinSize (SizeHints *hints);
-uint8_t SizeHintsIsPMaxSize (SizeHints *hints);
-uint8_t SizeHintsIsPResizeInc (SizeHints *hints);
-uint8_t SizeHintsIsPAspect (SizeHints *hints);
-uint8_t SizeHintsIsPBaseSize (SizeHints *hints);
-uint8_t SizeHintsIsPWinGravity (SizeHints *hints);
-
-void SizeHintsSetFlagNone (SizeHints *hints);
-void SizeHintsSetFlagUSPosition (SizeHints *hints);
-void SizeHintsSetFlagUSSize (SizeHints *hints);
-void SizeHintsSetFlagPPosition (SizeHints *hints);
-void SizeHintsSetFlagPSize (SizeHints *hints);
-void SizeHintsSetFlagPMinSize (SizeHints *hints);
-void SizeHintsSetFlagPMaxSize (SizeHints *hints);
-void SizeHintsSetFlagPResizeInc (SizeHints *hints);
-void SizeHintsSetFlagPAspect (SizeHints *hints);
-void SizeHintsSetFlagPBaseSize (SizeHints *hints);
-void SizeHintsSetFlagPWinGravity (SizeHints *hints);
+uint8_t size_hints_is_us_position (size_hints_t *hints);
+uint8_t size_hints_is_us_size (size_hints_t *hints);
+uint8_t size_hints_is_p_position (size_hints_t *hints);
+uint8_t size_hints_is_p_size (size_hints_t *hints);
+uint8_t size_hints_is_p_min_size (size_hints_t *hints);
+uint8_t size_hints_is_p_max_size (size_hints_t *hints);
+uint8_t size_hints_is_p_resize_inc (size_hints_t *hints);
+uint8_t size_hints_is_p_aspect (size_hints_t *hints);
+uint8_t size_hints_is_p_base_size (size_hints_t *hints);
+uint8_t size_hints_is_p_win_gravity (size_hints_t *hints);
+
+void size_hints_set_flag_none (size_hints_t *hints);
+void size_hints_set_flag_us_position (size_hints_t *hints);
+void size_hints_set_flag_us_size (size_hints_t *hints);
+void size_hints_set_flag_p_position (size_hints_t *hints);
+void size_hints_set_flag_p_size (size_hints_t *hints);
+void size_hints_set_flag_p_min_size (size_hints_t *hints);
+void size_hints_set_flag_p_max_size (size_hints_t *hints);
+void size_hints_set_flag_p_resize_inc (size_hints_t *hints);
+void size_hints_set_flag_p_aspect (size_hints_t *hints);
+void size_hints_set_flag_p_base_size (size_hints_t *hints);
+void size_hints_set_flag_p_win_gravity (size_hints_t *hints);
-void SizeHintsSetPosition (SizeHints *hints,
+void size_hints_set_position (size_hints_t *hints,
int user_specified,
int32_t x,
int32_t y);
-void SizeHintsSetSize (SizeHints *hints,
+void size_hints_set_size (size_hints_t *hints,
int user_specified,
int32_t width,
int32_t height);
-void SizeHintsSetMinSize (SizeHints *hints,
+void size_hints_set_min_size (size_hints_t *hints,
int32_t min_width,
int32_t min_height);
-void SizeHintsSetMaxSize (SizeHints *hints,
+void size_hints_set_max_size (size_hints_t *hints,
int32_t max_width,
int32_t max_height);
-void SizeHintsSetResizeInc (SizeHints *hints,
+void size_hints_set_resize_inc (size_hints_t *hints,
int32_t width_inc,
int32_t height_inc);
-void SizeHintsSetAspect (SizeHints *hints,
+void size_hints_set_aspect (size_hints_t *hints,
int32_t min_aspect_num,
int32_t min_aspect_den,
int32_t max_aspect_num,
int32_t max_aspect_den);
-void SizeHintsSetBaseSize (SizeHints *hints,
+void size_hints_set_base_size (size_hints_t *hints,
int32_t base_width,
int32_t base_height);
-void SizeHintsSetWinGravity (SizeHints *hints,
+void size_hints_set_win_gravity (size_hints_t *hints,
uint8_t win_gravity);
-void SetWMSizeHints (xcb_connection_t *c,
+void set_wm_size_hints (xcb_connection_t *c,
xcb_window_t window,
xcb_atom_t property,
- SizeHints *hints);
+ size_hints_t *hints);
-int GetWMSizeHints (xcb_connection_t *c,
+int get_wm_size_hints (xcb_connection_t *c,
xcb_window_t window,
xcb_atom_t property,
- SizeHints *hints,
+ size_hints_t *hints,
long *supplied);
/* WM_NORMAL_HINTS */
-void SetWMNormalHints (xcb_connection_t *c,
+void set_wm_normal_hints (xcb_connection_t *c,
xcb_window_t window,
- SizeHints *hints);
+ size_hints_t *hints);
-int GetWMNormalHints (xcb_connection_t *c,
+int get_wm_normal_hints (xcb_connection_t *c,
xcb_window_t window,
- SizeHints *hints,
+ size_hints_t *hints,
long *supplied);
/* WM_HINTS */
-typedef struct WMHints WMHints;
+typedef struct wm_hints_t wm_hints_t;
#define NumWMHintsElements 9 /* number of elements in this structure */
typedef enum {
@@ -195,61 +195,61 @@ typedef enum {
xcb_wm_iconic_state_t = 3
} xcb_wm_state_t;
-WMHints *AllocWMHints();
+wm_hints_t *alloc_wm_hints();
-uint8_t WMHintsGetInput (WMHints *hints);
-xcb_pixmap_t WMHintsGetIconPixmap (WMHints *hints);
-xcb_pixmap_t WMHintsGetIconMask (WMHints *hints);
-xcb_window_t WMHintsGetIconWindow (WMHints *hints);
-xcb_window_t WMHintsGetWindowGroup (WMHints *hints);
-
-uint8_t WMHintsIsInputHint (WMHints *hints);
-uint8_t WMHintsIsStateHint (WMHints *hints);
-uint8_t WMHintsIsIconPixmapHint (WMHints *hints);
-uint8_t WMHintsIsIconWindowHint (WMHints *hints);
-uint8_t WMHintsIsIconPositionHint (WMHints *hints);
-uint8_t WMHintsIsIconMaskHint (WMHints *hints);
-uint8_t WMHintsIsWindowGroupHint (WMHints *hints);
-uint8_t WMHintsIsXUrgencyHint (WMHints *hints);
-
-uint8_t WMHintsStateIsWithdrawn (WMHints *hints);
-uint8_t WMHintsStateIsNormal (WMHints *hints);
-uint8_t WMHintsStateIsIconic (WMHints *hints);
-
-void WMHintsSetInput (WMHints *hints, uint8_t input);
-void WMHintsSetIconic (WMHints *hints);
-void WMHintsSetNormal (WMHints *hints);
-void WMHintsSetWithdrawn (WMHints *hints);
-void WMHintsSetNone (WMHints *hints);
-void WMHintsSetUrgent (WMHints *hints);
-void WMHintsSetIconPixmap (WMHints *hints, xcb_pixmap_t icon_pixmap);
-void WMHintsSetIconMask (WMHints *hints, xcb_pixmap_t icon_mask);
-void WMHintsSetIconWindow (WMHints *hints, xcb_window_t icon_window);
-void WMHintsSetWindowGroup (WMHints *hints, xcb_window_t window_group);
+uint8_t wm_hints_get_input (wm_hints_t *hints);
+xcb_pixmap_t wm_hints_get_icon_pixmap (wm_hints_t *hints);
+xcb_pixmap_t wm_hints_get_icon_mask (wm_hints_t *hints);
+xcb_window_t wm_hints_get_icon_window (wm_hints_t *hints);
+xcb_window_t wm_hints_get_window_group (wm_hints_t *hints);
+
+uint8_t wm_hints_is_input_hint (wm_hints_t *hints);
+uint8_t wm_hints_is_state_hint (wm_hints_t *hints);
+uint8_t wm_hints_is_icon_pixmap_hint (wm_hints_t *hints);
+uint8_t wm_hints_is_icon_window_hint (wm_hints_t *hints);
+uint8_t wm_hints_is_icon_position_hint (wm_hints_t *hints);
+uint8_t wm_hints_is_icon_mask_hint (wm_hints_t *hints);
+uint8_t wm_hints_is_window_group_hint (wm_hints_t *hints);
+uint8_t wm_hints_is_xu_hint (wm_hints_t *hints);
+
+uint8_t wm_hints_state_is_withdrawn (wm_hints_t *hints);
+uint8_t wm_hints_state_is_normal (wm_hints_t *hints);
+uint8_t wm_hints_state_is_iconic (wm_hints_t *hints);
+
+void wm_hints_set_input (wm_hints_t *hints, uint8_t input);
+void wm_hints_set_iconic (wm_hints_t *hints);
+void wm_hints_set_normal (wm_hints_t *hints);
+void wm_hints_set_withdrawn (wm_hints_t *hints);
+void wm_hints_set_none (wm_hints_t *hints);
+void wm_hints_set_urgent (wm_hints_t *hints);
+void wm_hints_set_icon_pixmap (wm_hints_t *hints, xcb_pixmap_t icon_pixmap);
+void wm_hints_set_icon_mask (wm_hints_t *hints, xcb_pixmap_t icon_mask);
+void wm_hints_set_icon_window (wm_hints_t *hints, xcb_window_t icon_window);
+void wm_hints_set_window_group (wm_hints_t *hints, xcb_window_t window_group);
-void SetWMHints (xcb_connection_t *c,
+void set_wm_hints (xcb_connection_t *c,
xcb_window_t window,
- WMHints *hints);
+ wm_hints_t *hints);
-WMHints *GetWMHints (xcb_connection_t *c,
+wm_hints_t *get_wm_hints (xcb_connection_t *c,
xcb_window_t window);
/* WM_PROTOCOLS */
-void SetWMProtocols (xcb_connection_t *c,
+void set_wm_protocols (xcb_connection_t *c,
xcb_window_t window,
uint32_t list_len,
xcb_atom_t *list);
-int GetWMProtocols (xcb_connection_t *c,
+int get_wm_protocols (xcb_connection_t *c,
xcb_window_t window,
uint32_t *list_len,
xcb_atom_t **list);
#define HAS_DISCRIMINATED_NAME 0
#if HAS_DISCRIMINATED_NAME
-char *DiscriminatedAtomNameByScreen (const char *base, uint8_t screen);
-char *DiscriminatedAtomNameByResource (const char *base, uint32_t resource);
-char *DiscriminatedAtomNameUnique (const char *base, uint32_t id);
+char *discriminated_atom_name_by_screen (const char *base, uint8_t screen);
+char *discriminated_atom_name_by_resource (const char *base, uint32_t resource);
+char *discriminated_atom_name_unique (const char *base, uint32_t id);
#endif
diff-tree f13b887e4744b1849efe1bc1083dfe93d317ea3c (from 02e439a7e5023611a11ff320db7f24f9b79a2523)
Author: Thomas Hunger <hto at arcor.de>
Date: Wed Feb 7 18:56:03 2007 -0800
wm: new naming convention
diff --git a/wm/manage.c b/wm/manage.c
index 8c7b295..bd10d22 100644
--- a/wm/manage.c
+++ b/wm/manage.c
@@ -2,10 +2,10 @@
#include <stdio.h>
#include "xcb_wm.h"
-Table *byChild = 0;
-Table *byParent = 0;
+table_t *byChild = 0;
+table_t *byParent = 0;
-void manageWindow(property_handlers_t *prophs, xcb_connection_t *c, xcb_window_t window, WindowAttributes wa)
+void manage_window(property_handlers_t *prophs, xcb_connection_t *c, xcb_window_t window, window_attributes_t wa)
{
xcb_drawable_t d = { window };
xcb_get_geometry_cookie_t geomc;
@@ -25,7 +25,7 @@ void manageWindow(property_handlers_t *p
wa.tag = TAG_VALUE;
wa.u.override_redirect = attr->override_redirect;
}
- if(!wa.u.override_redirect && TableGet(byChild, window))
+ if(!wa.u.override_redirect && table_get(byChild, window))
{
printf("Window 0x%08x already managed. Ignoring.\n", window);
free(attr);
@@ -47,25 +47,25 @@ void manageWindow(property_handlers_t *p
geom = xcb_get_geometry_reply(c, geomc, 0);
if(attr && geom)
{
- reparentWindow(c, window, attr->visual, geom->root, geom->depth, geom->x, geom->y, geom->width, geom->height);
+ reparent_window(c, window, attr->visual, geom->root, geom->depth, geom->x, geom->y, geom->width, geom->height);
property_changed(prophs, XCB_PROPERTY_NEW_VALUE, window, WM_NAME);
}
free(attr);
free(geom);
}
-int handleMapNotifyEvent(void *prophs, xcb_connection_t *c, xcb_map_notify_event_t *e)
+int handle_map_notify_event(void *prophs, xcb_connection_t *c, xcb_map_notify_event_t *e)
{
- WindowAttributes wa = { TAG_VALUE };
+ window_attributes_t wa = { TAG_VALUE };
wa.u.override_redirect = e->override_redirect;
printf("MapNotify for 0x%08x.\n", e->window);
- manageWindow(prophs, c, e->window, wa);
+ manage_window(prophs, c, e->window, wa);
return 1;
}
-int handleUnmapNotifyEvent(void *data, xcb_connection_t *c, xcb_unmap_notify_event_t *e)
+int handle_unmap_notify_event(void *data, xcb_connection_t *c, xcb_unmap_notify_event_t *e)
{
- ClientWindow *client = TableRemove(byChild, e->event);
+ client_window_t *client = table_remove(byChild, e->event);
xcb_window_t root;
printf("UnmapNotify for 0x%08x (received from 0x%08x): ", e->window, e->event);
if(!client)
@@ -79,12 +79,12 @@ int handleUnmapNotifyEvent(void *data, x
xcb_reparent_window(c, client->child, root, 0, 0);
xcb_destroy_window(c, client->parent);
xcb_flush(c);
- TableRemove(byParent, client->parent);
+ table_remove(byParent, client->parent);
free(client);
return 1;
}
-void manageExistingWindows(xcb_connection_t *c, property_handlers_t *prophs, xcb_window_t root)
+void manage_existing_windows(xcb_connection_t *c, property_handlers_t *prophs, xcb_window_t root)
{
xcb_query_tree_cookie_t wintree;
xcb_query_tree_reply_t *rep;
@@ -108,8 +108,8 @@ void manageExistingWindows(xcb_connectio
cookies[i] = xcb_get_window_attributes(c, children[i]);
for(i = 0; i < len; ++i)
{
- WindowAttributes wa = { TAG_COOKIE, { cookies[i] } };
- manageWindow(prophs, c, children[i], wa);
+ window_attributes_t wa = { TAG_COOKIE, { cookies[i] } };
+ manage_window(prophs, c, children[i], wa);
}
free(rep);
}
diff --git a/wm/reply_formats.c b/wm/reply_formats.c
index 736f47a..30e34d0 100644
--- a/wm/reply_formats.c
+++ b/wm/reply_formats.c
@@ -9,7 +9,7 @@
#define WINFMT "0x%08x"
-int formatGetWindowAttributesReply(xcb_window_t wid, xcb_get_window_attributes_reply_t *reply)
+int format_get_window_attributes_reply(xcb_window_t wid, xcb_get_window_attributes_reply_t *reply)
{
if(!reply)
{
@@ -55,7 +55,7 @@ int formatGetWindowAttributesReply(xcb_w
return 1;
}
-int formatGetGeometryReply(xcb_window_t wid, xcb_get_geometry_reply_t *reply)
+int format_get_geometry_reply(xcb_window_t wid, xcb_get_geometry_reply_t *reply)
{
if(!reply)
{
@@ -75,7 +75,7 @@ int formatGetGeometryReply(xcb_window_t
return 1;
}
-int formatQueryTreeReply(xcb_window_t wid, xcb_query_tree_reply_t *reply)
+int format_query_tree_reply(xcb_window_t wid, xcb_query_tree_reply_t *reply)
{
int i;
@@ -296,7 +296,7 @@ static const char *labelSendEvent[] = {
" (from SendEvent)",
};
-int formatEvent(xcb_generic_event_t *e)
+int format_event(xcb_generic_event_t *e)
{
uint8_t sendEvent;
uint16_t seqnum;
diff --git a/wm/reply_formats.h b/wm/reply_formats.h
index e4f5a31..38530bb 100644
--- a/wm/reply_formats.h
+++ b/wm/reply_formats.h
@@ -9,10 +9,10 @@
#include <xcb/xcb.h>
-int formatGetWindowAttributesReply(xcb_window_t wid, xcb_get_window_attributes_reply_t *reply);
-int formatGetGeometryReply(xcb_window_t wid, xcb_get_geometry_reply_t *reply);
-int formatQueryTreeReply(xcb_window_t wid, xcb_query_tree_reply_t *reply);
-int formatEvent(xcb_generic_event_t *e);
+int format_get_window_attributes_reply(xcb_window_t wid, xcb_get_window_attributes_reply_t *reply);
+int format_get_geometry_reply(xcb_window_t wid, xcb_get_geometry_reply_t *reply);
+int format_query_tree_reply(xcb_window_t wid, xcb_query_tree_reply_t *reply);
+int format_event(xcb_generic_event_t *e);
#if 0 /* not yet ready */
int formatButtonReleaseEvent(void *data, xcb_connection_t *c, xcb_button_release_event_t *event);
diff --git a/wm/table.c b/wm/table.c
index 7249988..b6d5c9e 100644
--- a/wm/table.c
+++ b/wm/table.c
@@ -8,21 +8,21 @@ struct node {
void *value;
};
-struct Table {
+struct table_t {
node *head;
};
-Table *AllocTable()
+table_t *alloc_table()
{
- return calloc(1, sizeof(Table));
+ return calloc(1, sizeof(table_t));
}
-void FreeTable(Table *table)
+void free_table(table_t *table)
{
free(table);
}
-int TablePut(Table *table, uint32_t key, void *value)
+int table_put(table_t *table, uint32_t key, void *value)
{
node *record = malloc(sizeof(node));
if(!record)
@@ -34,7 +34,7 @@ int TablePut(Table *table, uint32_t key,
return 1;
}
-void *TableGet(Table *table, uint32_t key)
+void *table_get(table_t *table, uint32_t key)
{
node *cur;
for(cur = table->head; cur; cur = cur->next)
@@ -43,7 +43,7 @@ void *TableGet(Table *table, uint32_t ke
return 0;
}
-void *TableRemove(Table *table, uint32_t key)
+void *table_remove(table_t *table, uint32_t key)
{
node **cur;
for(cur = &table->head; *cur; cur = &(*cur)->next)
diff --git a/wm/xcb_wm.h b/wm/xcb_wm.h
index f971854..4d1c0c6 100644
--- a/wm/xcb_wm.h
+++ b/wm/xcb_wm.h
@@ -11,7 +11,7 @@ extern "C" {
#endif
-void reparentWindow(xcb_connection_t *c, xcb_window_t child,
+void reparent_window(xcb_connection_t *c, xcb_window_t child,
xcb_visualid_t v, xcb_window_t r, uint8_t d,
int16_t x, int16_t y, uint16_t width, uint16_t height);
@@ -21,7 +21,7 @@ typedef struct {
int name_len;
char *name;
xcb_gcontext_t titlegc;
-} ClientWindow;
+} client_window_t;
typedef struct {
enum tag_t tag;
@@ -29,24 +29,24 @@ typedef struct {
xcb_get_window_attributes_cookie_t cookie;
uint8_t override_redirect;
} u;
-} WindowAttributes;
+} window_attributes_t;
-void manageWindow(property_handlers_t *prophs, xcb_connection_t *c, xcb_window_t window, WindowAttributes wa);
-int handleMapNotifyEvent(void *prophs, xcb_connection_t *c, xcb_map_notify_event_t *e);
-int handleUnmapNotifyEvent(void *data, xcb_connection_t *c, xcb_unmap_notify_event_t *e);
-void manageExistingWindows(xcb_connection_t *c, property_handlers_t *prophs, xcb_window_t root);
+void manage_window(property_handlers_t *prophs, xcb_connection_t *c, xcb_window_t window, window_attributes_t wa);
+int handle_map_notify_event(void *prophs, xcb_connection_t *c, xcb_map_notify_event_t *e);
+int handle_unmap_notify_event(void *data, xcb_connection_t *c, xcb_unmap_notify_event_t *e);
+void manage_existing_windows(xcb_connection_t *c, property_handlers_t *prophs, xcb_window_t root);
-typedef struct Table Table;
+typedef struct table_t table_t;
-Table *AllocTable();
-void FreeTable(Table *table);
+table_t *alloc_table();
+void free_table(table_t *table);
-int TablePut(Table *table, uint32_t key, void *value);
-void *TableGet(Table *table, uint32_t key);
-void *TableRemove(Table *table, uint32_t key);
+int table_put(table_t *table, uint32_t key, void *value);
+void *table_get(table_t *table, uint32_t key);
+void *table_remove(table_t *table, uint32_t key);
-extern Table *byChild;
-extern Table *byParent;
+extern table_t *byChild;
+extern table_t *byParent;
#ifdef __cplusplus
diff --git a/wm/xcbwm-test.c b/wm/xcbwm-test.c
index 3b04a44..a596f75 100644
--- a/wm/xcbwm-test.c
+++ b/wm/xcbwm-test.c
@@ -25,7 +25,7 @@ static int16_t move_from_y = -1;
static int handleEvent(void *ignored, xcb_connection_t *c, xcb_generic_event_t *e)
{
- return formatEvent(e);
+ return format_event(e);
}
static int handleButtonPressEvent(void *data, xcb_connection_t *c, xcb_button_press_event_t *e)
@@ -60,20 +60,20 @@ static int handleButtonReleaseEvent(void
static int addClientWindow(xcb_window_t child, xcb_window_t parent, xcb_gcontext_t titlegc)
{
int success;
- ClientWindow *record = malloc(sizeof(ClientWindow));
+ client_window_t *record = malloc(sizeof(client_window_t));
assert(record);
record->child = child;
record->parent = parent;
record->name_len = 0;
record->name = 0;
record->titlegc = titlegc;
- success = TablePut(byParent, parent, record) &&
- TablePut(byChild, child, record);
+ success = table_put(byParent, parent, record) &&
+ table_put(byChild, child, record);
assert(success);
return 1;
}
-void reparentWindow(xcb_connection_t *c, xcb_window_t child,
+void reparent_window(xcb_connection_t *c, xcb_window_t child,
xcb_visualid_t v, xcb_window_t r, uint8_t d,
int16_t x, int16_t y, uint16_t width, uint16_t height)
{
@@ -121,7 +121,7 @@ void reparentWindow(xcb_connection_t *c,
xcb_flush(c);
}
-static void redrawWindow(xcb_connection_t *c, ClientWindow *client)
+static void redrawWindow(xcb_connection_t *c, client_window_t *client)
{
xcb_drawable_t d = { client->parent };
if(!client->name_len)
@@ -134,7 +134,7 @@ static void redrawWindow(xcb_connection_
static int handleExposeEvent(void *data, xcb_connection_t *c, xcb_expose_event_t *e)
{
- ClientWindow *client = TableGet(byParent, e->window);
+ client_window_t *client = table_get(byParent, e->window);
if(!client || e->count != 0)
return 1;
redrawWindow(c, client);
@@ -143,7 +143,7 @@ static int handleExposeEvent(void *data,
static int handleWMNameChange(void *data, xcb_connection_t *c, uint8_t state, xcb_window_t window, xcb_atom_t atom, xcb_get_property_reply_t *prop)
{
- ClientWindow *client = TableGet(byChild, window);
+ client_window_t *client = table_get(byChild, window);
printf("WM_NAME change: Window 0x%08x ", window);
if(!client)
{
@@ -183,8 +183,8 @@ int main(int argc, char **argv)
int screen_nbr;
int i;
- byChild = AllocTable();
- byParent = AllocTable();
+ byChild = alloc_table();
+ byParent = alloc_table();
c = xcb_connect(NULL, &screen_nbr);
@@ -196,12 +196,12 @@ int main(int argc, char **argv)
set_error_handler(evenths, i, (generic_error_handler) handleEvent, 0);
set_button_press_event_handler(evenths, handleButtonPressEvent, 0);
set_button_release_event_handler(evenths, handleButtonReleaseEvent, 0);
- set_unmap_notify_event_handler(evenths, handleUnmapNotifyEvent, 0);
+ set_unmap_notify_event_handler(evenths, handle_unmap_notify_event, 0);
set_expose_event_handler(evenths, handleExposeEvent, 0);
prophs = alloc_property_handlers(evenths);
- set_map_notify_event_handler(evenths, handleMapNotifyEvent, prophs);
- WatchWMName(prophs, 40, handleWMNameChange, 0);
+ set_map_notify_event_handler(evenths, handle_map_notify_event, prophs);
+ watch_wm_name(prophs, 40, handleWMNameChange, 0);
if(TEST_THREADS)
{
@@ -217,7 +217,7 @@ int main(int argc, char **argv)
}
xcb_flush(c);
- manageExistingWindows(c, prophs, root);
+ manage_existing_windows(c, prophs, root);
/* Terminate only when the event loop terminates */
if(TEST_THREADS)
More information about the xcb-commit
mailing list