]> Dogcows Code - chaz/openbox/blob - src/widgetbase.hh
make restart's parameter optional
[chaz/openbox] / src / widgetbase.hh
1 // -*- mode: C++; indent-tabs-mode: nil; c-basic-offset: 2; -*-
2 #ifndef __widgetbase_hh
3 #define __widgetbase_hh
4
5 #include "python.hh"
6
7 namespace ob {
8
9 class WidgetBase {
10 public:
11 enum WidgetType {
12 Type_Frame,
13 Type_Titlebar,
14 Type_Handle,
15 Type_Plate,
16 Type_Label,
17 Type_MaximizeButton,
18 Type_CloseButton,
19 Type_IconifyButton,
20 Type_AllDesktopsButton,
21 Type_LeftGrip,
22 Type_RightGrip,
23 Type_Client,
24 Type_Root
25 };
26
27 private:
28 WidgetType _type;
29
30 public:
31 WidgetBase(WidgetType type) : _type(type) {}
32
33 inline WidgetType type() const { return _type; }
34
35 inline MouseContext::MC mcontext() const {
36 switch (_type) {
37 case Type_Frame:
38 return MouseContext::Frame;
39 case Type_Titlebar:
40 return MouseContext::Titlebar;
41 case Type_Handle:
42 return MouseContext::Handle;
43 case Type_Plate:
44 return MouseContext::Window;
45 case Type_Label:
46 return MouseContext::Titlebar;
47 case Type_MaximizeButton:
48 return MouseContext::MaximizeButton;
49 case Type_CloseButton:
50 return MouseContext::CloseButton;
51 case Type_IconifyButton:
52 return MouseContext::IconifyButton;
53 case Type_AllDesktopsButton:
54 return MouseContext::AllDesktopsButton;
55 case Type_LeftGrip:
56 return MouseContext::Grip;
57 case Type_RightGrip:
58 return MouseContext::Grip;
59 case Type_Client:
60 return MouseContext::Window;
61 case Type_Root:
62 return MouseContext::Root;
63 default:
64 assert(false); // unhandled type
65 }
66 }
67 };
68
69 }
70
71 #endif // __widgetbase_hh
This page took 0.037652 seconds and 4 git commands to generate.