]>
Dogcows Code - chaz/openbox/blob - src/actions.cc
35f53db4719eb2004615e9f413f457085dbfff87
1 // -*- mode: C++; indent-tabs-mode: nil; -*-
4 # include "../config.h"
13 const unsigned int OBActions::DOUBLECLICKDELAY
;
15 OBActions::OBActions()
16 : _button(0), _enter_win(0)
18 _presses
[0] = new MousePressAction();
19 _presses
[1] = new MousePressAction();
20 _presses
[2] = new MousePressAction();
22 // XXX: load a configuration out of somewhere
27 OBActions::~OBActions()
32 void OBActions::insertPress(Window win
, unsigned int button
, Time time
)
34 MousePressAction
*a
= _presses
[1];
35 _presses
[1] = _presses
[0];
43 void OBActions::bpress(Window win
, unsigned int modifiers
, unsigned int button
,
47 // XXX: run the PRESS guile hook
48 printf("GUILE: PRESS: win %lx modifiers %ux button %ud time %lx",
49 (long)win
, modifiers
, button
, time
);
51 if (_button
) return; // won't count toward CLICK events
55 insertPress(win
, button
, time
);
59 void OBActions::brelease(Window win
, const otk::Rect
&area
,
60 const otk::Point
&mpos
,
61 unsigned int modifiers
, unsigned int button
,
65 // XXX: run the RELEASE guile hook
66 printf("GUILE: RELEASE: win %lx modifiers %ux button %ud time %lx",
67 (long)win
, modifiers
, button
, time
);
69 if (_button
&& _button
!= button
) return; // not for the button we're watchin
73 if (!area
.contains(mpos
)) return; // not on the window any more
75 // XXX: run the CLICK guile hook
76 printf("GUILE: CLICK: win %lx modifiers %ux button %ud time %lx",
77 (long)win
, modifiers
, button
, time
);
79 if (_presses
[0]->win
== _presses
[1]->win
&&
80 _presses
[0]->button
== _presses
[1]->button
&&
81 time
- _presses
[1]->time
< DOUBLECLICKDELAY
) {
83 // XXX: run the DOUBLECLICK guile hook
84 printf("GUILE: DOUBLECLICK: win %lx modifiers %ux button %ud time %lx",
85 (long)win
, modifiers
, button
, time
);
91 void OBActions::enter(Window win
, unsigned int modifiers
)
96 // XXX: run the ENTER guile hook
97 printf("GUILE: ENTER: win %lx modifiers %ux", (long)win
, modifiers
);
102 void OBActions::leave(unsigned int modifiers
)
105 // XXX: run the LEAVE guile hook
106 printf("GUILE: LEAVE: win %lx modifiers %ux", (long)_enter_win
, modifiers
);
112 void OBActions::drag(Window win
, otk::Point delta
, unsigned int modifiers
,
113 unsigned int button
, Time time
)
115 (void)win
;(void)delta
;(void)modifiers
;(void)button
;(void)time
;
117 // XXX: some guile shit...
121 void OBActions::key(Window win
, unsigned int modifiers
, unsigned int keycode
)
123 (void)win
;(void)modifiers
;(void)keycode
;
125 // XXX: some guile shit...
This page took 0.037387 seconds and 4 git commands to generate.