]> Dogcows Code - chaz/openbox/commitdiff
simplify window.h macros, and rename the window types to ObWindowClass for consistent...
authorDana Jansens <danakj@orodu.net>
Thu, 31 Jan 2008 15:00:10 +0000 (10:00 -0500)
committerDana Jansens <danakj@orodu.net>
Thu, 31 Jan 2008 17:25:31 +0000 (12:25 -0500)
openbox/event.c
openbox/focus_cycle_indicator.c
openbox/focus_cycle_popup.c
openbox/menuframe.h
openbox/popup.c
openbox/window.c
openbox/window.h

index c54cd1666d4494c76bce690b8c31088ccb0f5664..2e3a44c56a63f64a7c301c7b0de2e8a977ce7eef 100644 (file)
@@ -476,7 +476,7 @@ static void event_process(const XEvent *ec, gpointer data)
         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 @@ static void event_process(const XEvent *ec, gpointer data)
             ObWindow *w;
 
             if ((w = window_find(e->xbutton.subwindow)) &&
-                WINDOW_IS_INTERNALWINDOW(w))
+                WINDOW_IS_INTERNAL(w))
             {
                 event_handle_user_input(client, e);
             }
index 4ee456b9a723b8c66ed0bcfdd93dc3830c481225..79c76e2fd29cb54268af1e2a316603f63d26eded 100644 (file)
@@ -59,10 +59,10 @@ void focus_cycle_indicator_startup(gboolean reconfig)
 
     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 @@ void focus_cycle_indicator_startup(gboolean reconfig)
         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 @@ void focus_cycle_indicator_shutdown(gboolean reconfig)
     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);
index 755414c1598aae437ed2404855f831d3852e5553..cb1af4813b18a5e391329dffb3c594b7cf0be68d 100644 (file)
@@ -98,7 +98,7 @@ void focus_cycle_popup_startup(gboolean reconfig)
 
     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 @@ void focus_cycle_popup_startup(gboolean reconfig)
 
     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 @@ void focus_cycle_popup_shutdown(gboolean reconfig)
     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;
index 069759721e0c0b8a437156d2afe9dc69f3d10464..ea1003dedd7c119fe8a05ef673205591a1db0360 100644 (file)
@@ -38,7 +38,7 @@ extern GList *menu_frame_visible;
 struct _ObMenuFrame
 {
     /* stuff to be an ObWindow */
-    Window_InternalType type;
+    ObWindow type;
     Window window;
 
     struct _ObMenu *menu;
index d9a52145554dd13d6cfe6e6742d3c08e4e163049..8176b6bf4e166512081b8d2b345e73bafd4510a4 100644 (file)
@@ -33,7 +33,7 @@ ObPopup *popup_new(void)
     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 @@ ObPopup *popup_new(void)
 
     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 @@ static gboolean popup_show_timeout(gpointer data)
     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;
 
index 32f1ea52ca0aae9d9b84ee6ab9c3773946959349..f094602cbdb26c34428a4d6eeb5bb5c22263d200 100644 (file)
@@ -52,8 +52,8 @@ Window window_top(ObWindow *self)
         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 @@ ObStackingLayer window_layer(ObWindow *self)
     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();
index ccd8def211bca0b148f3e66706937ecb3dac7b22..252145b9d600d56e1bd911c2b36efa060c9bc140 100644 (file)
@@ -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 @@ struct _ObWindow {
     (((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 @@ struct _ObClient;
 #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);
This page took 0.041578 seconds and 4 git commands to generate.