Permalink
Browse files

Map and Unmap notify events

  • Loading branch information...
1 parent 47d88f2 commit 1e22980cc3d018364b635793ce26259381ffa4df @NotFound committed Dec 12, 2011
Showing with 37 additions and 1 deletion.
  1. +3 −1 GuitorConstants.winxhead
  2. +15 −0 src/Guitor.winxed
  3. +19 −0 src/GuitorNci.winxed
View
@@ -106,7 +106,9 @@ const int
FocusOut = 10,
Expose = 12,
DestroyNotify = 17,
- ConfigureNotify = 22,
+ UnmapNotify = 18,
+ MapNotify = 19,
+ ConfigureNotify = 22,
SelectionClear = 29,
SelectionRequest = 30,
SelectionNotify = 31,
View
@@ -35,6 +35,7 @@ extern function getstructureview;
extern function getexposeview;
extern function getcrossingview;
extern function getfocusview;
+extern function getmapview;
extern function getmotionview;
extern function getbuttonview;
extern function getkeyview;
@@ -716,6 +717,10 @@ class Event
case FocusOut:
view = getfocusview();
break;
+ case MapNotify:
+ case UnmapNotify:
+ view = getmapview();
+ break;
case EnterNotify:
case LeaveNotify:
view = getcrossingview();
@@ -1718,6 +1723,8 @@ class ListenerWindow : Window
var OnLeave;
var OnFocusIn;
var OnFocusOut;
+ var OnMap;
+ var OnUnmap;
var OnSelectionClear;
var OnSelectionRequest;
var OnSelectionNotify;
@@ -1736,6 +1743,8 @@ class ListenerWindow : Window
self.OnLeave = new EventHandler(self, LeaveWindowMask);
self.OnFocusIn = new EventHandler(self, FocusChangeMask);
self.OnFocusOut = new EventHandler(self, FocusChangeMask);
+ self.OnMap = new EventHandler(self, StructureNotifyMask);
+ self.OnUnmap = new EventHandler(self, StructureNotifyMask);
self.OnSelectionClear = new EventHandler(self, 0);
self.OnSelectionRequest = new EventHandler(self, 0);
self.OnSelectionNotify = new EventHandler(self, 0);
@@ -1783,6 +1792,12 @@ class ListenerWindow : Window
case FocusOut:
handler = self.OnFocusOut;
break;
+ case MapNotify:
+ handler = self.OnMap;
+ break;
+ case UnmapNotify:
+ handler = self.OnUnmap;
+ break;
case EnterNotify:
handler = self.OnEnter;
break;
View
@@ -27,6 +27,7 @@ const string
STRUCTUREVIEW = "structureview",
EXPOSEVIEW = "exposeview",
FOCUSVIEW = "focusview",
+ MAPVIEW = "mapview",
CROSSINGVIEW = "crossingview",
SELECTIONCLEARVIEW = "selectionclearview",
SELECTIONVIEW = "selectionview",
@@ -301,6 +302,24 @@ function getfocusview()
return st;
}
+function getmapview()
+{
+ // Used for Map and Unmap Notify
+ var ns = namespace Xlib__nci;
+ var st = ns[MAPVIEW];
+ if (st == null)
+ ns[FOCUSVIEW] = st = new ["StructView"]( [ DATATYPE_STRUCT, 7,
+ DATATYPE_INT, // type
+ DATATYPE_LONG, // serial
+ XLIB_Bool, // send event
+ DATATYPE_PTR, // display
+ XLIB_Window, // event window
+ XLIB_Window, // window mapped
+ XLIB_Bool // dverride_redirect or from_configure
+ ] );
+ return st;
+}
+
function getcrossingview()
{
var ns = namespace Xlib__nci;

0 comments on commit 1e22980

Please sign in to comment.