]> Dogcows Code - chaz/openbox/blobdiff - src/widget.hh
decor and functions set set right for !normal windows
[chaz/openbox] / src / widget.hh
index ed0f0a9d740f2a35931741f9094fda8ae65e8685..85b9dcc597517544a8294224cf3cf0b6c6a78341 100644 (file)
@@ -2,11 +2,15 @@
 #ifndef   __obwidget_hh
 #define   __obwidget_hh
 
+#include "python.hh"
+
 namespace ob {
 
 class OBWidget {
 public:
+  // update the enum in openbox.i to match this one
   enum WidgetType {
+    Type_Frame,
     Type_Titlebar,
     Type_Handle,
     Type_Plate,
@@ -16,7 +20,9 @@ public:
     Type_IconifyButton,
     Type_StickyButton,
     Type_LeftGrip,
-    Type_RightGrip
+    Type_RightGrip,
+    Type_Client,
+    Type_Root
   };
 
 private:
@@ -26,6 +32,39 @@ public:
   OBWidget(WidgetType type) : _type(type) {}
   
   inline WidgetType type() const { return _type; }
+
+  inline MouseContext mcontext() const {
+    switch (_type) {
+    case Type_Frame:
+      return MC_Frame;
+    case Type_Titlebar:
+      return MC_Titlebar;
+    case Type_Handle:
+      return MC_Handle;
+    case Type_Plate:
+      return MC_Window;
+    case Type_Label:
+      return MC_Titlebar;
+    case Type_MaximizeButton:
+      return MC_MaximizeButton;
+    case Type_CloseButton:
+      return MC_CloseButton;
+    case Type_IconifyButton:
+      return MC_IconifyButton;
+    case Type_StickyButton:
+      return MC_StickyButton;
+    case Type_LeftGrip:
+      return MC_Grip;
+    case Type_RightGrip:
+      return MC_Grip;
+    case Type_Client:
+      return MC_Window;
+    case Type_Root:
+      return MC_Root;
+    default:
+      assert(false); // unhandled type
+    }
+  }
 };
 
 }
This page took 0.023846 seconds and 4 git commands to generate.