Home My Page Projects Code Snippets Project Openings SML/NJ
Summary Activity Forums Tracker Lists Tasks Docs Surveys News SCM Files

SCM Repository

[smlnj] Diff of /sml/trunk/src/eXene/lib/window/window.sml
ViewVC logotype

Diff of /sml/trunk/src/eXene/lib/window/window.sml

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1910, Thu Mar 2 23:45:19 2006 UTC revision 1911, Fri Mar 3 03:33:16 2006 UTC
# Line 101  Line 101 
101            val SCRDEPTH{depth, ...} = root_servers            val SCRDEPTH{depth, ...} = root_servers
102            val DPY{xdpy = XDisplay.XDPY{conn, nextXId, ...}, ...} = dpy            val DPY{xdpy = XDisplay.XDPY{conn, nextXId, ...}, ...} = dpy
103            val winId = nextXId()            val winId = nextXId()
104            val (inEnv, win) = TopLevelWin.mkTopLevelWinEnv (scr, root_servers, winId)        (* modified ddeboer Jul 2004: original:
105          val (inEnv, win) = TopLevelWin.mkTopLevelWinEnv (scr, root_servers, winId) *)
106          val (inEnv, win, delCh) = TopLevelWin.mkTopLevelWinEnv (scr, root_servers, winId)
107            fun createFn {geom, border, backgrnd} = (            fun createFn {geom, border, backgrnd} = (
108                  XWin.newXWin conn {                  XWin.newXWin conn {
109                      id = winId,                      id = winId,
# Line 116  Line 118 
118                          XWin.XWV_EventMask stdXEventMask                          XWin.XWV_EventMask stdXEventMask
119                        ]                        ]
120                    };                    };
121                  (win, inEnv))          (* modified ddeboer Jul 2004; original: *
122            (win, inEnv)) *)
123            (win, inEnv, delCh))
124            in            in
125              createFn              createFn
126            end (* createSimpleTopWin *)            end (* createSimpleTopWin *)
# Line 167  Line 171 
171            val SCRDEPTH{depth, ...} = root_servers            val SCRDEPTH{depth, ...} = root_servers
172            val DPY{xdpy = XDisplay.XDPY{conn, nextXId, ...}, ...} = dpy            val DPY{xdpy = XDisplay.XDPY{conn, nextXId, ...}, ...} = dpy
173            val winId = nextXId()            val winId = nextXId()
174            val (inEnv, win) = TopLevelWin.mkTopLevelWinEnv(scrn, root_servers, winId)        (* modified ddeboer, Jul 2004; original:
175          val (inEnv, win) = TopLevelWin.mkTopLevelWinEnv(scrn, root_servers, winId) *)
176          val (inEnv, win, delCh) = TopLevelWin.mkTopLevelWinEnv(scrn, root_servers, winId)
177            in            in
178              XWin.newXWin conn {              XWin.newXWin conn {
179                  id = winId,                  id = winId,
# Line 195  Line 201 
201            val SCRDEPTH{depth, ...} = root_servers            val SCRDEPTH{depth, ...} = root_servers
202            val DPY{xdpy = XDisplay.XDPY{conn, nextXId, ...}, ...} = dpy            val DPY{xdpy = XDisplay.XDPY{conn, nextXId, ...}, ...} = dpy
203            val winId = nextXId()            val winId = nextXId()
204            val (inEnv, win) = TopLevelWin.mkTopLevelWinEnv(scrn, root_servers, winId)        (* modified ddeboer, Jul 2004; original:
205          val (inEnv, win) = TopLevelWin.mkTopLevelWinEnv(scrn, root_servers, winId) *)
206          val (inEnv, win, delCh) = TopLevelWin.mkTopLevelWinEnv(scrn, root_servers, winId)
207            in            in
208              XWin.newXWin conn {              XWin.newXWin conn {
209                  id = winId,                  id = winId,
# Line 391  Line 399 
399      fun screenOfWin (WIN{scr, ...}) = scr      fun screenOfWin (WIN{scr, ...}) = scr
400      fun displayOfWin (WIN{scr=SCREEN{dpy, ...}, ...}) = dpy      fun displayOfWin (WIN{scr=SCREEN{dpy, ...}, ...}) = dpy
401    
402        (* added ddeboer Jan 2005 *)
403        (* grabKeyboard: we would like a reply of XProtTypes.GrabSuccess *)
404        fun grabKeyboard (WIN{id,scr=SCREEN{dpy, ...}, ...}) = 0
405            (* commented out, ddeboer, mar 2005 - this needs reworked.
406            let val ans =
407                (XReply.decodeGrabKeyboardReply (CML.sync (Display.dpyRequestReply dpy
408                            (XRequest.encodeGrabKeyboard {
409                                win=id, * type XTy.XID *
410                                owner_evts=false,
411                                ptr_mode=XProtTypes.AsynchronousGrab,
412                                kbd_mode=XProtTypes.AsynchronousGrab,
413                                time=XProtTypes.CurrentTime}))))
414                    handle XIo.LostReply => raise (MLXError.XERROR "[reply lost]")
415                         | (XIo.ErrorReply err) =>
416                            raise (MLXError.XERROR(XPrint.xerrorToString err))
417            in (case (ans) of
418                XProtTypes.GrabSuccess => 0
419              | XProtTypes.AlreadyGrabbed => 1
420              | XProtTypes.GrabInvalidTime => 2
421              | XProtTypes.GrabNotViewable => 3
422              | XProtTypes.GrabFrozen => 4)
423            end *)
424        fun ungrabKeyboard (WIN{id,scr=SCREEN{dpy, ...}, ...}) =
425            let val ans =
426                ( (* XReply.decodeGrabKeyboardReply *) (CML.sync (Display.dpyRequestReply dpy
427                            (XRequest.encodeUngrabKeyboard {
428                                time=XProtTypes.CurrentTime}))))
429                    handle XIo.LostReply => raise (MLXError.XERROR "[reply lost]")
430                         | (XIo.ErrorReply err) =>
431                            raise (MLXError.XERROR(XPrint.xerrorToString err))
432            in (* TODO: figure out what type of reply comes from an ungrab request, and decode it *)
433                0
434            end
435        (* end added ddeboer *)
436    end (* Window *)    end (* Window *)

Legend:
Removed from v.1910  
changed lines
  Added in v.1911

root@smlnj-gforge.cs.uchicago.edu
ViewVC Help
Powered by ViewVC 1.0.0