summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNisar Ahmad <nisarahmad1324@gmail.com>2018-01-05 16:17:37 +0530
committerGitHub <noreply@github.com>2018-01-05 16:17:37 +0530
commitfb77c2f1c3136dab5ec61f41b7030c96874cb204 (patch)
tree218396074cd349f608f25341dce0fccd66308ccf
parent2ae61ed2de7d48e60d22f6ff8b03539df6e33284 (diff)
parent063d522ffb1cf11338ed38633a070538f0bfa1ed (diff)
Merge pull request #424 from robert-strandh/developiteration-11
small enhancements and mapping-notify handling
-rw-r--r--Backends/CLX/input.lisp70
-rw-r--r--Examples/clim-examples.asd16
-rw-r--r--Libraries/Drei/input-editor.lisp9
-rw-r--r--mcclim.asd2
4 files changed, 55 insertions, 42 deletions
diff --git a/Backends/CLX/input.lisp b/Backends/CLX/input.lisp
index a0d328fd..e189b748 100644
--- a/Backends/CLX/input.lisp
+++ b/Backends/CLX/input.lisp
@@ -115,12 +115,14 @@
(defgeneric port-client-message (sheet time type data))
(defun event-handler (&key display window event-key code state mode time
- type width height x y root-x root-y
- data override-redirect-p send-event-p hint-p
- target property requestor selection
- request first-keycode count
- &allow-other-keys)
- (declare (ignore display request first-keycode count))
+ type width height x y root-x root-y
+ data override-redirect-p send-event-p hint-p
+ target property requestor selection
+ request first-keycode count
+ &allow-other-keys)
+ (declare (ignore first-keycode count))
+ (when (eql event-key :mapping-notify)
+ (return-from event-handler (xlib:mapping-notify display request 0 0)))
(let ((sheet (and window (port-lookup-sheet *clx-port* window))))
(when sheet
(case event-key
@@ -131,13 +133,13 @@
(make-instance (if (eq event-key :key-press)
'key-press-event
'key-release-event)
- :key-name keysym-name
- :key-character (and (characterp keyname) keyname)
- :x x :y y
- :graft-x root-x
- :graft-y root-y
- :sheet (or (frame-properties (pane-frame sheet) 'focus) sheet)
- :modifier-state modifier-state :timestamp time)))
+ :key-name keysym-name
+ :key-character (and (characterp keyname) keyname)
+ :x x :y y
+ :graft-x root-x
+ :graft-y root-y
+ :sheet (or (frame-properties (pane-frame sheet) 'focus) sheet)
+ :modifier-state modifier-state :timestamp time)))
((:button-press :button-release)
(let ((modifier-state (clim-xcommon:x-event-state-modifiers *clx-port* state))
(button (decode-x-button-code code)))
@@ -207,11 +209,11 @@
;; Instead, query the new coordinates from the X server,
;; and later the event handler will set the correct
;; native-transformation using those. --Hefner
-; (multiple-value-bind (x y) (transform-position
-; (compose-transformations
-; (sheet-transformation sheet)
-; (sheet-native-transformation (graft sheet)))
-; 0 0)
+;;; (multiple-value-bind (x y) (transform-position
+;;; (compose-transformations
+;;; (sheet-transformation sheet)
+;;; (sheet-native-transformation (graft sheet)))
+;;; 0 0)
;; Easier to let X compute the position relative to the root window for us.
(multiple-value-bind (x y)
@@ -233,7 +235,7 @@
state)))
(if hint-p
(multiple-value-bind (x y same-screen-p child mask
- root-x root-y)
+ root-x root-y)
(xlib:query-pointer window)
(declare (ignore mask))
;; If not same-screen-p or the child is different
@@ -273,28 +275,28 @@
;; :display event should be left in.
;;
(make-instance 'window-repaint-event
- :timestamp time
- :sheet sheet
- :region (make-rectangle* x y (+ x width) (+ y height))))
+ :timestamp time
+ :sheet sheet
+ :region (make-rectangle* x y (+ x width) (+ y height))))
;;
(:selection-notify
(make-instance 'clx-selection-notify-event
- :sheet sheet
- :selection selection
- :target target
- :property property))
+ :sheet sheet
+ :selection selection
+ :target target
+ :property property))
(:selection-clear
(make-instance 'selection-clear-event
- :sheet sheet
- :selection selection))
+ :sheet sheet
+ :selection selection))
(:selection-request
(make-instance 'clx-selection-request-event
- :sheet sheet
- :selection selection
- :requestor requestor
- :target target
- :property property
- :timestamp time))
+ :sheet sheet
+ :selection selection
+ :requestor requestor
+ :target target
+ :property property
+ :timestamp time))
(:client-message
(port-client-message sheet time type data))
(t
diff --git a/Examples/clim-examples.asd b/Examples/clim-examples.asd
index 1516e469..edb139c9 100644
--- a/Examples/clim-examples.asd
+++ b/Examples/clim-examples.asd
@@ -1,5 +1,7 @@
+(in-package #:asdf-user)
+
;;; CLIM-Examples depends on having at least one backend loaded.
-(asdf:defsystem #:clim-examples
+(defsystem #:clim-examples
:depends-on (#:mcclim #:mcclim-layouts/tab :mcclim-raster-image #:mcclim-bezier #:closer-mop)
:components
((:file "package")
@@ -13,7 +15,10 @@
(:file "puzzle")
(:file "transformations-test")
(:file "town-example")
- (:file "demodemo" :depends-on ("tabdemo" "town-example" "sliderdemo" "tabledemo"))
+ (:file "tabdemo")
+ (:file "sliderdemo")
+ (:file "tabledemo")
+ (:file "demodemo")
(:file "stream-test")
(:file "presentation-test")
(:file "dragndrop")
@@ -27,18 +32,15 @@
(:file "logic-cube")
(:file "views")
(:file "font-selector")
- (:file "tabdemo")
(:file "bordered-output-examples")
(:file "misc-tests")
(:file "drawing-tests")
(:file "render-image-tests")
(:file "image-viewer")
- (:file "sliderdemo")
(:file "accepting-values")
(:file "accepting-values-test")
- (:file "graph-toy")
- (:file "tabledemo")))
+ (:file "graph-toy")))
-(asdf:defsystem #:clim-examples/superapp
+(defsystem #:clim-examples/superapp
:depends-on (#:mcclim #:bordeaux-threads)
:components ((:file "superapp")))
diff --git a/Libraries/Drei/input-editor.lisp b/Libraries/Drei/input-editor.lisp
index a573ba15..6cc1b771 100644
--- a/Libraries/Drei/input-editor.lisp
+++ b/Libraries/Drei/input-editor.lisp
@@ -651,7 +651,14 @@ if stuff is inserted after the insertion pointer."
(input-position stream) (min scan-pointer (input-position stream))))
;; This has been cribbed from SPLIT-SEQUENCE and lightly modified.
-(defun split-sequence (delimiter seq &key (count nil) (remove-empty-subseqs nil) (start 0) (end nil) (test nil test-supplied) (test-not nil test-not-supplied) (key nil key-supplied))
+(defun split-sequence (delimiter seq &key
+ (count nil)
+ (remove-empty-subseqs nil)
+ (start 0)
+ (end nil)
+ (test nil test-supplied)
+ (test-not nil test-not-supplied)
+ (key nil key-supplied))
"Return a list of subsequences in seq delimited by delimiter.
If :remove-empty-subseqs is NIL, empty subsequences will be
diff --git a/mcclim.asd b/mcclim.asd
index d4527919..a3dcecbd 100644
--- a/mcclim.asd
+++ b/mcclim.asd
@@ -22,6 +22,8 @@
;;; The actual McCLIM system that people should to use in their ASDF
;;; package dependency lists.
+(in-package #:asdf-user)
+
(defsystem :mcclim
:author "Alessandro Serra
Alexey Dejneka