-
hatchond authored
alphabetical order and type order (class, generic function, function, ...) - input.lisp: minor modification in event-process for client-message on application. An application that does not support to be maximized in fullscreen don't have the _net_wm_state_fullscreen property sets anymore. - lib/clx-patch.lisp: fixed bug found in input-focus. - wm.lisp: focused-p modified. dispatch-repaint: new method for the repaint protocol. draw-focused-decoration & draw-unfocused-decoration: removed. - widget.lisp: focused-p modified. repaint implementations for icon, button and box-button. - themer.lisp: themes are now defined in their own packages. - themes/*/theme.lisp: All default themes converted in this new system. The rest concern what we discuss on precedent post about a repaint protocol. The two generic functions draw-on-focus-{in,out} had been supressed in favor of a single one named repaint. repaint widget name focus [generic function] This method is dedicated to widget repaint such as every buttons, icons, edges ... It is specialized on widget type, theme name (via an eql specializer) and a boolean that indicate if the corresponding toplevel (type decoration) is or not focused. Except for standard expose events, the repaint dispatching on focus change will be perform according to parts-to-redraw-on-focus list given in define-theme. The core of eclipse provide some basic implementation for the repaint method: (defmethod repaint ((widget base-widget) theme-name (focused-p t)) (values)) (defmethod repaint ((widget button) theme-name (focused-p t)) ;; draw a pixmap if the button provide a pixmap to display when ;; toplevel is focused. ;; in case of title bar draw a centered text corresponding to the app ;; name. ) (defmethod repaint ((widget button) theme-name (focused-p null)) ;; clear the button. ) (defmethod repaint ((widget box-button) theme-name focused-p) ;; draw the message that is displayed by this box. ) (defmethod repaint ((widget icon) theme-name focused-p) ;; draw the icon name if aplication does not provide a pixmap for it. ) This method is expected to be overloaded by theme implementors as well as to be exported by theme package definition. Theme implementation notes: -------------------------- - themes are supposed to be defined in their own packages. - theme package definition should be suplied. - the naming convention for themes packages is: <theme-name>-ECLIPSE-THEME. Typically a theme package will export at least two symbols: - INITIALIZE-FRAME - REPAINT Here comes an example of how defining a theme (see our predefined themes for more): ;;; -*- Mode: Lisp; Package: FOO-ECLIPSE-THEME -*- ;;; GPL Disclaimer for example. ;;; file theme.lisp (common-lisp:in-package :common-lisp-user) (defpackage "FOO-ECLIPSE-THEME" (:use eclipse clx-ext common-lisp) (:size 10) (:export repaint initialize-frame) (:documentation "Foo theme decoration for the eclipse window manager. Written by ...") ) (in-package "FOO-ECLIPSE-THEME") (define-theme "Foo" ;; the rest of the definition ) (defmethod repaint ((widget title-bar) (name (eql "Foo")) (focus t)) "handle repaint WHEN focused." ;; do some stuff ) (defmethod repaint ((widget title-bar) (name (eql "Foo")) (focus null)) "handle repaint WHEN NOT focused." ;; do some stuff ) (defun bar () ;; do what you want ) ;;; end of theme.lisp
64c49c91