simplify window.h macros, and rename the window types to ObWindowClass for consistent name style
Dana Jansens danakj@orodu.net
7 files changed,
37 insertions(+),
37 deletions(-)
M
openbox/event.c
→
openbox/event.c
@@ -476,7 +476,7 @@ break;
case OB_WINDOW_CLASS_MENUFRAME: menu = WINDOW_AS_MENUFRAME(obwin); break; - case OB_WINDOW_CLASS_INTERNALWINDOW: + case OB_WINDOW_CLASS_INTERNAL: /* we don't do anything with events directly on these windows */ break; }@@ -711,7 +711,7 @@ else {
ObWindow *w; if ((w = window_find(e->xbutton.subwindow)) && - WINDOW_IS_INTERNALWINDOW(w)) + WINDOW_IS_INTERNAL(w)) { event_handle_user_input(client, e); }
M
openbox/focus_cycle_indicator.c
→
openbox/focus_cycle_indicator.c
@@ -59,10 +59,10 @@ visible = FALSE;
if (reconfig) return; - focus_indicator.top.obwin.type = OB_WINDOW_CLASS_INTERNALWINDOW; - focus_indicator.left.obwin.type = OB_WINDOW_CLASS_INTERNALWINDOW; - focus_indicator.right.obwin.type = OB_WINDOW_CLASS_INTERNALWINDOW; - focus_indicator.bottom.obwin.type = OB_WINDOW_CLASS_INTERNALWINDOW; + focus_indicator.top.obwin.type = OB_WINDOW_CLASS_INTERNAL; + focus_indicator.left.obwin.type = OB_WINDOW_CLASS_INTERNAL; + focus_indicator.right.obwin.type = OB_WINDOW_CLASS_INTERNAL; + focus_indicator.bottom.obwin.type = OB_WINDOW_CLASS_INTERNAL; attr.override_redirect = True; attr.background_pixel = BlackPixel(obt_display, ob_screen);@@ -79,18 +79,18 @@ focus_indicator.bottom.window =
create_window(obt_root(ob_screen), CWOverrideRedirect | CWBackPixel, &attr); - stacking_add(INTERNALWINDOW_AS_WINDOW(&focus_indicator.top)); - stacking_add(INTERNALWINDOW_AS_WINDOW(&focus_indicator.left)); - stacking_add(INTERNALWINDOW_AS_WINDOW(&focus_indicator.right)); - stacking_add(INTERNALWINDOW_AS_WINDOW(&focus_indicator.bottom)); + stacking_add(INTERNAL_AS_WINDOW(&focus_indicator.top)); + stacking_add(INTERNAL_AS_WINDOW(&focus_indicator.left)); + stacking_add(INTERNAL_AS_WINDOW(&focus_indicator.right)); + stacking_add(INTERNAL_AS_WINDOW(&focus_indicator.bottom)); window_add(&focus_indicator.top.window, - INTERNALWINDOW_AS_WINDOW(&focus_indicator.top)); + INTERNAL_AS_WINDOW(&focus_indicator.top)); window_add(&focus_indicator.left.window, - INTERNALWINDOW_AS_WINDOW(&focus_indicator.left)); + INTERNAL_AS_WINDOW(&focus_indicator.left)); window_add(&focus_indicator.right.window, - INTERNALWINDOW_AS_WINDOW(&focus_indicator.right)); + INTERNAL_AS_WINDOW(&focus_indicator.right)); window_add(&focus_indicator.bottom.window, - INTERNALWINDOW_AS_WINDOW(&focus_indicator.bottom)); + INTERNAL_AS_WINDOW(&focus_indicator.bottom)); color_white = RrColorNew(ob_rr_inst, 0xff, 0xff, 0xff);@@ -122,10 +122,10 @@ window_remove(focus_indicator.left.window);
window_remove(focus_indicator.right.window); window_remove(focus_indicator.bottom.window); - stacking_remove(INTERNALWINDOW_AS_WINDOW(&focus_indicator.top)); - stacking_remove(INTERNALWINDOW_AS_WINDOW(&focus_indicator.left)); - stacking_remove(INTERNALWINDOW_AS_WINDOW(&focus_indicator.right)); - stacking_remove(INTERNALWINDOW_AS_WINDOW(&focus_indicator.bottom)); + stacking_remove(INTERNAL_AS_WINDOW(&focus_indicator.top)); + stacking_remove(INTERNAL_AS_WINDOW(&focus_indicator.left)); + stacking_remove(INTERNAL_AS_WINDOW(&focus_indicator.right)); + stacking_remove(INTERNAL_AS_WINDOW(&focus_indicator.bottom)); XDestroyWindow(obt_display, focus_indicator.top.window); XDestroyWindow(obt_display, focus_indicator.left.window);
M
openbox/focus_cycle_popup.c
→
openbox/focus_cycle_popup.c
@@ -98,7 +98,7 @@ XSetWindowAttributes attrib;
single_popup = icon_popup_new(); - popup.obwin.type = OB_WINDOW_CLASS_INTERNALWINDOW; + popup.obwin.type = OB_WINDOW_CLASS_INTERNAL; popup.a_bg = RrAppearanceCopy(ob_rr_theme->osd_hilite_bg); popup.a_text = RrAppearanceCopy(ob_rr_theme->osd_hilite_label); popup.a_icon = RrAppearanceCopy(ob_rr_theme->a_clear_tex);@@ -126,8 +126,8 @@ popup.hilite_rgba = NULL;
XMapWindow(obt_display, popup.text); - stacking_add(INTERNALWINDOW_AS_WINDOW(&popup)); - window_add(&popup.bg, INTERNALWINDOW_AS_WINDOW(&popup)); + stacking_add(INTERNAL_AS_WINDOW(&popup)); + window_add(&popup.bg, INTERNAL_AS_WINDOW(&popup)); } void focus_cycle_popup_shutdown(gboolean reconfig)@@ -135,7 +135,7 @@ {
icon_popup_free(single_popup); window_remove(popup.bg); - stacking_remove(INTERNALWINDOW_AS_WINDOW(&popup)); + stacking_remove(INTERNAL_AS_WINDOW(&popup)); while(popup.targets) { ObFocusCyclePopupTarget *t = popup.targets->data;
M
openbox/popup.c
→
openbox/popup.c
@@ -33,7 +33,7 @@ {
XSetWindowAttributes attrib; ObPopup *self = g_new0(ObPopup, 1); - self->obwin.type = OB_WINDOW_CLASS_INTERNALWINDOW; + self->obwin.type = OB_WINDOW_CLASS_INTERNAL; self->gravity = NorthWestGravity; self->x = self->y = self->textw = self->h = 0; self->a_bg = RrAppearanceCopy(ob_rr_theme->osd_hilite_bg);@@ -56,8 +56,8 @@ RrColorPixel(ob_rr_theme->osd_border_color));
XMapWindow(obt_display, self->text); - stacking_add(INTERNALWINDOW_AS_WINDOW(self)); - window_add(&self->bg, INTERNALWINDOW_AS_WINDOW(self)); + stacking_add(INTERNAL_AS_WINDOW(self)); + window_add(&self->bg, INTERNAL_AS_WINDOW(self)); return self; }@@ -141,7 +141,7 @@ {
ObPopup *self = data; XMapWindow(obt_display, self->bg); - stacking_raise(INTERNALWINDOW_AS_WINDOW(self)); + stacking_raise(INTERNAL_AS_WINDOW(self)); self->mapped = TRUE; self->delay_mapped = FALSE;
M
openbox/window.c
→
openbox/window.c
@@ -52,8 +52,8 @@ case OB_WINDOW_CLASS_DOCK:
return WINDOW_AS_DOCK(self)->frame; case OB_WINDOW_CLASS_CLIENT: return WINDOW_AS_CLIENT(self)->frame->window; - case OB_WINDOW_CLASS_INTERNALWINDOW: - return WINDOW_AS_INTERNALWINDOW(self)->window; + case OB_WINDOW_CLASS_INTERNAL: + return WINDOW_AS_INTERNAL(self)->window; } g_assert_not_reached(); return None;@@ -67,7 +67,7 @@ return config_dock_layer;
case OB_WINDOW_CLASS_CLIENT: return ((ObClient*)self)->layer; case OB_WINDOW_CLASS_MENUFRAME: - case OB_WINDOW_CLASS_INTERNALWINDOW: + case OB_WINDOW_CLASS_INTERNAL: return OB_STACKING_LAYER_INTERNAL; } g_assert_not_reached();
M
openbox/window.h
→
openbox/window.h
@@ -31,13 +31,13 @@ typedef enum {
OB_WINDOW_CLASS_MENUFRAME, OB_WINDOW_CLASS_DOCK, OB_WINDOW_CLASS_CLIENT, - OB_WINDOW_CLASS_INTERNALWINDOW -} Window_InternalType; + OB_WINDOW_CLASS_INTERNAL +} ObWindowClass; /* In order to be an ObWindow, you need to make this struct the top of your struct */ struct _ObWindow { - Window_InternalType type; + ObWindowClass type; }; #define WINDOW_IS_MENUFRAME(win) \@@ -46,8 +46,8 @@ #define WINDOW_IS_DOCK(win) \
(((ObWindow*)win)->type == OB_WINDOW_CLASS_DOCK) #define WINDOW_IS_CLIENT(win) \ (((ObWindow*)win)->type == OB_WINDOW_CLASS_CLIENT) -#define WINDOW_IS_INTERNALWINDOW(win) \ - (((ObWindow*)win)->type == OB_WINDOW_CLASS_INTERNALWINDOW) +#define WINDOW_IS_INTERNAL(win) \ + (((ObWindow*)win)->type == OB_WINDOW_CLASS_INTERNAL) struct _ObMenu; struct _ObDock;@@ -57,12 +57,12 @@
#define WINDOW_AS_MENUFRAME(win) ((struct _ObMenuFrame*)win) #define WINDOW_AS_DOCK(win) ((struct _ObDock*)win) #define WINDOW_AS_CLIENT(win) ((struct _ObClient*)win) -#define WINDOW_AS_INTERNALWINDOW(win) ((struct _ObInternalWindow*)win) +#define WINDOW_AS_INTERNAL(win) ((struct _ObInternalWindow*)win) #define MENUFRAME_AS_WINDOW(menu) ((ObWindow*)menu) #define DOCK_AS_WINDOW(dock) ((ObWindow*)dock) #define CLIENT_AS_WINDOW(client) ((ObWindow*)client) -#define INTERNALWINDOW_AS_WINDOW(intern) ((ObWindow*)intern) +#define INTERNAL_AS_WINDOW(intern) ((ObWindow*)intern) void window_startup (gboolean reconfig); void window_shutdown(gboolean reconfig);