xwem-devel
[Top] [All Lists]

Summary for xwem--main--2.1--patch-20

From: Zajcev Evgeny <lg@xxxxxxxx>
Subject: Summary for xwem--main--2.1--patch-20
Date: Thu, 10 Feb 2005 03:16:29 +0300 (MSK)
Location: lg@xxxxxxxxxxxxxx http://arch.xwem.org/2005/

Revision: xwem--main--2.1--patch-20
Archive: lg@xxxxxxxxxxxxxx
Creator: Zajcev Evgeny <lg@xxxxxxxx>
Date: Thu Feb 10 03:16:23 MSK 2005
Standard-date: 2005-02-10 00:16:23 GMT
Modified-files: dockapp/xwem-pager.el
    dockapp/xwem-weather.el lisp/xwem-focus.el
    lisp/xwem-frame.el lisp/xwem-launcher.el
    lisp/xwem-misc.el lisp/xwem-mouse.el lisp/xwem-theme.el
    utils/xwem-diagram.el utils/xwem-worklog.el
New-patches: dev@xxxxxxxxxxxxxxxx/xwem--dev--2.1--patch-12
    lg@xxxxxxxxxxxxxx/xwem--main--2.1--patch-20
Summary: merge from ckent, some addons and fixes
Keywords: weather, frame, diagram

* lisp/xwem-pager.el (xwem-pager-dim): 2x3 is the default minimal pager
  size. (agreed on #xwem)

* lisp/xwem-weather.el (xwem-weather-keymap): [bug fix] typo.

* lisp/xwem-focus.el (xwem-turn-on-focus-click-mode): [addon] more client
  checks when enabling focus-click bindings.

* lisp/xwem-focus.el (xwem-turn-off-focus-click-mode): [addon] more
  client checks when disabling focus-click bindings.

* lisp/xwem-frame.el (xwem-frame-events-handler): [bug typo] Handle
  events for embedded frames only for embedded frames.

* lisp/xwem-launcher.el (xwem-file-find-command): [typo] fix

* lisp/xwem-misc.el (xwem-misc-linesp-show): [fix] support for Drawable

* lisp/xwem-mouse.el (xwem-mouse-ungrab): [sem] FLUSH-P parameter added.
  non-nil mean, ungrab mouse immediately.

* lisp/xwem-theme.el (xwem-theme-apply): [addon] Apply face changes only
  if face exists.

* lisp/xwem-diagram.el (many): [fix] support for Drawable

* lisp/xwem-worklog.el (many): Pixmaping done, worklog pause window (`H-W
  l') will not flick anymore when updating.

* lisp/xwem-worklog.el (xwem-worklog-dockapp-update-task-brick): [new]
  update only current task brick in the worklog dockapp.

* lisp/xwem-worklog.el (xwem-worklog-start-dockapp): Use
  xwem-worklog-dockapp-update-task-brick instead of
  xwem-worklog-dockapp-update when task is changed.  This will speedup
  whole xwem for worklog dockapp users.

* added files

    {arch}/xwem/xwem--dev/xwem--dev--2.1/dev@xxxxxxxxxxxxxxxx/patch-log/patch-12
    {arch}/xwem/xwem--main/xwem--main--2.1/lg@xxxxxxxxxxxxxx/patch-log/patch-20

* modified files

--- orig/dockapp/xwem-pager.el
+++ mod/dockapp/xwem-pager.el
@@ -73,7 +73,7 @@
   :prefix "xwem-pager-"
   :group 'xwem-tray)
 
-(defcustom xwem-pager-dim (cons '(3 . 3) '(4 . 4))
+(defcustom xwem-pager-dim (cons '(2 . 3) '(4 . 4))
   "Minimum and maximum viewports to show at X and Y."
   :type '(cons (cons :tag "Minimum"
                      (number :tag "X")


--- orig/dockapp/xwem-weather.el
+++ mod/dockapp/xwem-weather.el
@@ -101,15 +101,14 @@
 
 ;;;###autoload(autoload 'xwem-weather-prefix "xwem-weather" nil nil 'keymap)
 (xwem-define-prefix-command 'xwem-weather-prefix t)
-(defvar xwem-weather-keymap
-  (let ((map (make-sparse-keymap)))
-    (define-key map ?d 'xwem-weather-show-details)
-    (define-key map ?u 'xwem-weather-update)
-    map)
+(defvar xwem-weather-keymap (symbol-function 'xwem-weather-prefix)
   "Keymap for weather commands.
 Bindings:
 \\{xwem-weather-keymap}")
 
+(define-key xwem-weather-keymap ?d 'xwem-weather-show-details)
+(define-key xwem-weather-keymap ?u 'xwem-weather-update)
+
 ;;; Internal variables
 
 (defvar xwem-weather-osd nil)
@@ -357,6 +356,6 @@
 (provide 'xwem-weather)
 
 ;;; On-load actions
-(define-key xwem-global-map (xwem-kbd "H-c W") 'xwem-weather-prefix)
+(xwem-global-set-key (xwem-kbd "H-c W") 'xwem-weather-prefix)
 
 ;;; xwem-weather.el ends here


--- orig/lisp/xwem-focus.el
+++ mod/lisp/xwem-focus.el
@@ -224,16 +224,18 @@
 (defun xwem-turn-on-focus-click-mode (cl)
   "On CL, turn on click to focus minor mode."
   (unless (xwem-client-local-variable-value cl 'xwem-focus-click-minor-mode)
-    (xwem-kbd-install-grab xwem-focus-click-to-focus-map
-                           (xwem-cl-xwin cl) X-GrabModeSync)
-    (xwem-client-local-variable-set cl 'xwem-focus-click-minor-mode t)))
+    (when (xwem-misc-xwin-valid-p (xwem-cl-xwin cl))
+      (xwem-kbd-install-grab xwem-focus-click-to-focus-map
+                             (xwem-cl-xwin cl) X-GrabModeSync)
+      (xwem-client-local-variable-set cl 'xwem-focus-click-minor-mode t))))
 
 (defun xwem-turn-off-focus-click-mode (cl)
   "On CL, turn off click to focus minor mode."
   (when (xwem-client-local-variable-value cl 'xwem-focus-click-minor-mode)
-    (XAllowEvents (xwem-dpy) X-ReplayPointer)
-    (xwem-kbd-uninstall-grab xwem-focus-click-to-focus-map (xwem-cl-xwin cl))
-    (xwem-client-local-variable-set cl 'xwem-focus-click-minor-mode nil)))
+    (when (xwem-misc-xwin-valid-p (xwem-cl-xwin cl))
+      (XAllowEvents (xwem-dpy) X-ReplayPointer)
+      (xwem-kbd-uninstall-grab xwem-focus-click-to-focus-map (xwem-cl-xwin cl))
+      (xwem-client-local-variable-set cl 'xwem-focus-click-minor-mode nil))))
 
 (defun xwem-focus-click-mode (cl)
   "On CL, toggle click to focus minor mode."
@@ -273,8 +275,7 @@
 
         ((memq action '(before-mode-change before-keymap-change))
          ;; Remove button1 from local keymap and ungrab it
-         (xwem-turn-off-focus-click-mode cl))
-        ))
+         (xwem-turn-off-focus-click-mode cl))))
 
 ;; Register minor mode
 (xwem-add-minor-mode 'xwem-focus-click-minor-mode


--- orig/lisp/xwem-frame.el
+++ mod/lisp/xwem-frame.el
@@ -815,6 +815,8 @@
 (define-xwem-deffered xwem-frame-apply-size (frame)
   "Apply FRAME's size to life."
   (when (xwem-frame-p frame)
+    (xwem-debug 'xwem-frame "Applying size: %dx%d"
+               '(xwem-frame-width frame) '(xwem-frame-height frame))
     (XResizeWindow (xwem-dpy) (xwem-frame-xwin frame)
                    (xwem-frame-width frame) (xwem-frame-height frame))
 
@@ -957,9 +959,15 @@
         (:X-ClientMessage (xwem-frame-hclient frame xev))
 
        ;; For emebedded frames
-        (:X-ConfigureNotify (xwem-frame-hconfigure frame xev))
-       (:X-MapNotify (xwem-frame-map frame))
-       (:X-UnmapNotify (xwem-frame-unmap frame))
+        (:X-ConfigureNotify
+        (when (xwem-frame-embedded-p frame)
+          (xwem-frame-hconfigure frame xev)))
+       (:X-MapNotify
+        (when (xwem-frame-embedded-p frame)
+          (xwem-frame-map frame)))
+       (:X-UnmapNotify
+        (when (xwem-frame-embedded-p frame)
+          (xwem-frame-unmap frame)))
         ))))
 
 ;;;; Frame Events handling ends here


--- orig/lisp/xwem-launcher.el
+++ mod/lisp/xwem-launcher.el
@@ -894,7 +894,7 @@
 (defun xwem-file-find-command (filename)
   "Find appropriate command to open FILENAME file."
   (let ((cmds xwem-open-file-commands-alist))
-    (while (and cmds (not (string-match (caar cmds) file)))
+    (while (and cmds (not (string-match (caar cmds) filename)))
       (setq cmds (cdr cmds)))
     (cdr (car cmds))))
 


--- orig/lisp/xwem-misc.el
+++ mod/lisp/xwem-misc.el
@@ -1156,8 +1156,8 @@
                          (cdr el)))
                       linesp)))
 
-(defun xwem-misc-linesp-show (xwin x y linesp &optional type 
default-background)
-  "In x window XWIN at X and Y coordinates show line spec LINESP.
+(defun xwem-misc-linesp-show (d x y linesp &optional type default-background)
+  "In X drawable D at X and Y coordinates show line spec LINESP.
 TYPE is one of XImageString or XDrawString, default is XImageString."
   (let ((cxoff 0))
     (mapc (lambda (el)
@@ -1168,11 +1168,11 @@
                             'XImageString)
                            ((not (null type)) type)
                            (t 'XImageString))
-                     (X-Win-dpy xwin) xwin
+                     (X-Drawable-dpy d) d
                      (xwem-face-get-gc (car el))
                      (+ x cxoff) y (cdr el))
             (setq cxoff (+ cxoff (X-Text-width
-                                  (X-Win-dpy xwin)
+                                  (X-Drawable-dpy d)
                                   (X-Gc-font (xwem-face-get-gc (car el)))
                                   (cdr el)))))
           linesp)))


--- orig/lisp/xwem-mouse.el
+++ mod/lisp/xwem-mouse.el
@@ -64,17 +64,21 @@
                 cursor))
 
 ;;;###autoload
-(defun xwem-mouse-ungrab ()
-  "Stop grabing mouse."
+(defun xwem-mouse-ungrab (&optional flush-p)
+  "Stop grabing mouse.
+If FLUSH-P is non-nil, mouse is ungrabbed imediately."
   (XUngrabPointer (xwem-dpy))
-  (XFlush (xwem-dpy)))
+  (when flush-p
+    ;; XX flush data to server and wait a little
+    (XFlush (xwem-dpy))
+    (sit-for 0)))
 
 ;;; Menus
 ;;;###autoload
 (defun xwem-popup-menu (menu &optional event)
   "@opup MENU.
 MENU and EVENT is same as for `popup-menu'."
-  (xwem-mouse-ungrab)
+  (xwem-mouse-ungrab t)
 
   (funcall xwem-popup-menu-function menu
            (or event


--- orig/lisp/xwem-theme.el
+++ mod/lisp/xwem-theme.el
@@ -33,7 +33,6 @@
 ;;; Code:
 
 (require 'xwem-load)
-(require 'xwem-strokes)                 ; for xwem-strokes-face
 
 (defgroup xwem-theme nil
   "Group to customize xwem themes."
@@ -458,7 +457,8 @@
   (mapc (lambda (tspec)
           (case (car tspec)
             (face
-             (xwem-theme-apply-face-spec (cadr tspec) (caddr tspec) domain))
+            (when (find-face (cadr tspec))
+              (xwem-theme-apply-face-spec (cadr tspec) (caddr tspec) domain)))
 
             (frame-property
              (if (and domain (xwem-frame-p domain))


--- orig/utils/xwem-diagram.el
+++ mod/utils/xwem-diagram.el
@@ -99,12 +99,12 @@
     (cons (round (+ (X-Point-x cnt-dot) rx))
           (round (+ (X-Point-y cnt-dot) (- ry))))))
 
-(defun xwem-diag-draw-rect (xwin gc dot1 dot2 dot3 dot4 &optional fill-gc)
+(defun xwem-diag-draw-rect (d gc dot1 dot2 dot3 dot4 &optional fill-gc)
   "Draw parallelogram with vertexes at DOT1 DOT2 DOT3 and DOT4."
   (when (X-Gc-p fill-gc)
-    (XFillPoly (X-Win-dpy xwin) xwin fill-gc (list dot1 dot2 dot3 dot4)))
+    (XFillPoly (X-Drawable-dpy d) d fill-gc (list dot1 dot2 dot3 dot4)))
 
-  (XDrawLines (X-Win-dpy xwin) xwin gc (list dot1 dot2 dot3 dot4 dot1)))
+  (XDrawLines (X-Drawable-dpy d) d gc (list dot1 dot2 dot3 dot4 dot1)))
 
 (defun xwem-diag-calc-sector-dots (x y w h a1 a2)
   (let* ((mcnt (cons (+ x (/ w 2))
@@ -153,7 +153,7 @@
           (truncate (+ (X-Point-y (nth 1 ds2))
                        ny)))))
             
-(defun xwem-diag-draw-3d-sector (xwin gc x y w h a1 a2 sector-width &optional 
fill-gc)
+(defun xwem-diag-draw-3d-sector (d gc x y w h a1 a2 sector-width &optional 
fill-gc)
   "Draw 3d sector."
   (let ((ds1 (xwem-diag-calc-sector-dots x y w h a1 a2))
         (ds2 (xwem-diag-calc-sector-dots x (+ y sector-width) w h a1 a2))
@@ -256,81 +256,78 @@
     (if (and buta1 buta2)
         (progn
           (when fill-gc
-            (XFillArc (X-Win-dpy xwin) xwin fill-gc x (+ y sector-width) w h 
buta1 buta2))
-          (XDrawArc (X-Win-dpy xwin) xwin gc x (+ y sector-width) w h buta1 
buta2)
-          )
+            (XFillArc (X-Drawable-dpy d) d fill-gc x (+ y sector-width) w h 
buta1 buta2))
+          (XDrawArc (X-Drawable-dpy d) d gc x (+ y sector-width) w h buta1 
buta2))
 
       (if (or (and d0-buta1 d0-buta2)
               (and d2-buta1 d2-buta2))
           (progn
             (when (and d0-buta1 d0-buta2)
               (when fill-gc
-                (XFillArc (X-Win-dpy xwin) xwin fill-gc x (+ y sector-width) w 
h d0-buta1 d0-buta2))
-              (XDrawArc (X-Win-dpy xwin) xwin gc x (+ y sector-width) w h 
d0-buta1 d0-buta2)
-              )
+                (XFillArc (X-Drawable-dpy d) d fill-gc x (+ y sector-width) w 
h d0-buta1 d0-buta2))
+              (XDrawArc (X-Drawable-dpy d) d gc x (+ y sector-width) w h 
d0-buta1 d0-buta2))
             (when (and d2-buta1 d2-buta2)
               (when fill-gc
-                (XFillArc (X-Win-dpy xwin) xwin fill-gc x (+ y sector-width) w 
h d2-buta1 d2-buta2))
-              (XDrawArc (X-Win-dpy xwin) xwin gc x (+ y sector-width) w h 
d2-buta1 d2-buta2)
-              ))
+                (XFillArc (X-Drawable-dpy d) d fill-gc x (+ y sector-width) w 
h d2-buta1 d2-buta2))
+              (XDrawArc (X-Drawable-dpy d) d gc x (+ y sector-width) w h 
d2-buta1 d2-buta2)))
 
         (when (and (xwem-diag-dot->= 'y (nth 0 ds1) (nth 1 ds1))
                    (xwem-diag-dot->= 'y (nth 2 ds1) (nth 1 ds1)))
           (when fill-gc
-            (XFillArc (X-Win-dpy xwin) xwin fill-gc x (+ y sector-width) w h 
a1 a2))
-          (XDrawArc (X-Win-dpy xwin) xwin gc x (+ y sector-width) w h a1 a2))))
+            (XFillArc (X-Drawable-dpy d) d fill-gc x (+ y sector-width) w h a1 
a2))
+          (XDrawArc (X-Drawable-dpy d) d gc x (+ y sector-width) w h a1 a2))))
 
     ;; fill other stuff
     (when fill-gc
       ;; main sector
-      (XFillArc (X-Win-dpy xwin) xwin fill-gc x y w h a1 a2)
+      (XFillArc (X-Drawable-dpy d) d fill-gc x y w h a1 a2)
 
-      (xwem-diag-draw-rect xwin fill-gc
+      (xwem-diag-draw-rect d fill-gc
                            (nth 2 ds2) (nth 2 ds1)
                            (nth 1 ds1) (nth 1 ds2)
                            fill-gc)
-      (xwem-diag-draw-rect xwin fill-gc
+      (xwem-diag-draw-rect d fill-gc
                            (nth 0 ds2) (nth 0 ds1)
                            (nth 1 ds1) (nth 1 ds2)
                            fill-gc)
 
       (when (and d0-adds1 d0-adds2)
-        (XFillPoly (X-Win-dpy xwin) xwin fill-gc
+        (XFillPoly (X-Drawable-dpy d) d fill-gc
                    (list d0-adds1 d0-adds2 (nth 1 ds2) (nth 1 ds1)
                          d0-adds1)))
 
       (when (and d2-adds1 d2-adds2)
-        (XFillPoly (X-Win-dpy xwin) xwin fill-gc
+        (XFillPoly (X-Drawable-dpy d) d fill-gc
                    (list d2-adds1 d2-adds2 (nth 1 ds2) (nth 1 ds1)
                          d2-adds1)))
       )
 
     ;; Draw main sector
-    (XDrawLines (X-Win-dpy xwin) xwin gc ds1)
-    (XDrawArc (X-Win-dpy xwin) xwin gc x y w h a1 a2)
+    (XDrawLines (X-Drawable-dpy d) d gc ds1)
+    (XDrawArc (X-Drawable-dpy d) d gc x y w h a1 a2)
 
-    (xwem-diag-draw-sector xwin gc x y w h a1 a2 fill-gc) ; sector always 
visible
+    (xwem-diag-draw-sector d gc x y w h a1 a2 fill-gc) ; sector always visible
 
     ;; Draw visibilities
     (when center-visible
-      (XDrawLines (X-Win-dpy xwin) xwin gc (list (nth 1 ds1) (nth 1 ds2))))
+      (XDrawLines (X-Drawable-dpy d) d gc (list (nth 1 ds1) (nth 1 ds2))))
     (when cd0-visible
-      (XDrawLines (X-Win-dpy xwin) xwin gc (list (nth 1 ds2) (nth 0 ds2))))
+      (XDrawLines (X-Drawable-dpy d) d gc (list (nth 1 ds2) (nth 0 ds2))))
     (when cd2-visible
-      (XDrawLines (X-Win-dpy xwin) xwin gc (list (nth 1 ds2) (nth 2 ds2))))
+      (XDrawLines (X-Drawable-dpy d) d gc (list (nth 1 ds2) (nth 2 ds2))))
     (when dot0-visible
-      (XDrawLines (X-Win-dpy xwin) xwin gc (list (nth 0 ds1) (nth 0 ds2))))
+      (XDrawLines (X-Drawable-dpy d) d gc (list (nth 0 ds1) (nth 0 ds2))))
     (when dot2-visible
-      (XDrawLines (X-Win-dpy xwin) xwin gc (list (nth 2 ds1) (nth 2 ds2))))
+      (XDrawLines (X-Drawable-dpy d) d gc (list (nth 2 ds1) (nth 2 ds2))))
     (when (and d0-adds1 d0-adds2)
-      (XDrawLines (X-Win-dpy xwin) xwin gc (list d0-adds1 d0-adds2)))
+      (XDrawLines (X-Drawable-dpy d) d gc (list d0-adds1 d0-adds2)))
     (when (and d2-adds1 d2-adds2)
-      (XDrawLines (X-Win-dpy xwin) xwin gc (list d2-adds1 d2-adds2)))
+      (XDrawLines (X-Drawable-dpy d) d gc (list d2-adds1 d2-adds2)))
     ))
 
-(defun xwem-diag-draw-bar (xwin gc x y w h &optional fill-gc)
+(defun xwem-diag-draw-bar (d gc x y w h &optional fill-gc)
   "Draw plain bar."
-  (xwem-diag-draw-rect xwin gc
+  (xwem-diag-draw-rect d gc
                        (cons x y) (cons (+ x w) y)
                        (cons (+ x w) (+ y h)) (cons x (+ y h))
                        fill-gc))


--- orig/utils/xwem-worklog.el
+++ mod/utils/xwem-worklog.el
@@ -61,6 +61,7 @@
   (type 'pause)                         ; type of pause, can be 'pause or 'list
   prefix-arg                            ; prefix arg, when entering pause
   pwin                                  ; xwin that shows pause stuff
+  ppix                                  ; pixmap to redraw worklog
   pbuf                                  ; buffer to render
   start-time
   end-time
@@ -699,7 +70 ,7 @@
       (when (and (memq xwem-last-command wfuncs)
                  (not (memq xwem-last-command
                             xwem-worklog-keymap-functions-skip)))
-        (xwem-worklog-pause-update t)
+        (xwem-worklog-pause-update)
         (xwem-kbd-stop-command-keys-echoing))))
 
   (setq xwem-override-map xwem-worklog-pause-map))
@@ -758,8 +759,7 @@
               (delq 'xwem-worklog-post-command xwem-post-command-hook))
         ;; Ungrab keyboard and stop pauser if any
         (xwem-worklog-pause-stop)
-        (xwem-kbd-stop-grabbing))
-      )))
+        (xwem-kbd-stop-grabbing)))))
 
 (define-xwem-command xwem-worklog-task-list (arg)
   "Display task list using pause window."
@@ -795,17 +795,23 @@
           (make-xwem-worklog-pause
            :type type
            :prefix-arg arg
-           :pwin (xwem-worklog-pause-create-xwin)
            :pbuf (get-buffer-create " *worklog-pause*")
            :start-time (current-time)))
-    
-    ;; TODO: need to wait exposure event?
-    (xwem-worklog-pause-update t)))
+
+    ;; Create window and pixmap
+    (setf (xwem-worklog-pause-pwin xwem-worklog-pause-p)
+          (xwem-worklog-pause-create-xwin)
+          (xwem-worklog-pause-ppix xwem-worklog-pause-p)
+          (xwem-worklog-pause-create-xpixmap
+           (xwem-worklog-pause-pwin xwem-worklog-pause-p)))
+
+    (xwem-worklog-pause-update)))
 
 (defun xwem-worklog-pause-stop ()
   "Stop xwem worklog pausing."
 
   (when xwem-worklog-pause-p
+    (XFreePixmap (xwem-dpy) (xwem-worklog-pause-ppix xwem-worklog-pause-p))
     (when (X-Win-p (xwem-worklog-pause-pwin xwem-worklog-pause-p))
       (XDestroyWindow
        (xwem-dpy) (xwem-worklog-pause-pwin xwem-worklog-pause-p)))
@@ -815,7 +821,7 @@
     (setq xwem-worklog-pause-p nil)))
                            
 (defun xwem-worklog-pause-create-xwin ()
-  "Create pause window in center of selected frame.."
+  "Create pause window at the centre of selected frame."
   ;; Create cursor
   (unless xwem-worklog-pause-cursor
     (setq xwem-worklog-pause-cursor
@@ -850,6 +856,14 @@
     (XRaiseWindow (xwem-dpy) xwin)
     xwin))
 
+(defun xwem-worklog-pause-create-xpixmap (xwin)
+  "Create X Pixmap for pause window."
+  (XCreatePixmap
+   (xwem-dpy) (make-X-Pixmap :dpy (xwem-dpy)
+                             :id (X-Dpy-get-id (xwem-dpy)))
+   xwin (XDefaultDepth (xwem-dpy))
+   xwem-worklog-pwin-width xwem-worklog-pwin-height))
+
 (defun xwem-worklog-time-diff (a b)
   "Return the difference between two times.
 This function requires the second argument B to be earlier in time
@@ -902,43 +916,55 @@
           (substring lfm 0 padlen))
       lfm)))
 
-(defun xwem-worklog-pause-update (&optional full)
+(define-xwem-deffered xwem-worklog-pause-update ()
   "Redraw pause win."
-  (with-current-buffer (xwem-worklog-pause-pbuf xwem-worklog-pause-p)
-    (erase-buffer)
+  (when xwem-worklog-pause-p
+    (with-current-buffer (xwem-worklog-pause-pbuf xwem-worklog-pause-p)
+      (erase-buffer)
 
-    (insert "XWEM Worklog mode ")
-    (insert-face "PAUSE: " 'red)
-    (insert (xwem-worklog-format-time
-             (xwem-worklog-time-diff
-              (current-time)
-              (xwem-worklog-pause-start-time xwem-worklog-pause-p))
-             20))
-    (insert "\n\n")
-
-    (if (eq (xwem-worklog-pause-type xwem-worklog-pause-p) 'pause)
-        (xwem-worklog-insert-current-task)
-      (xwem-worklog-insert-task-list))
+      (insert "XWEM Worklog mode ")
+      (insert-face "PAUSE: " 'red)
+      (insert (xwem-worklog-format-time
+               (xwem-worklog-time-diff
+                (current-time)
+                (xwem-worklog-pause-start-time xwem-worklog-pause-p))
+               20))
+      (insert "\n\n")
+
+      (if (eq (xwem-worklog-pause-type xwem-worklog-pause-p) 'pause)
+          (xwem-worklog-insert-current-task)
+        (xwem-worklog-insert-task-list))
+
+      (insert "\n")
+      (insert "Press any key to continue with current task.\n")
+      (if (eq (xwem-worklog-pause-type xwem-worklog-pause-p) 'list)
+          (insert (substitute-command-keys
+                   "Press ``\\<xwem-worklog-pause-map>\\[xwem-worklog-pause]'' 
to show pause buffer.\n"))
+
+        (insert "Bindings:\n")
+        (insert "Key             Binding\n")
+        (insert "---             -------\n")
+        (describe-bindings-internal xwem-worklog-pause-map))
+
+
+      (xwem-set-face-foreground 'xwem-worklog-temp-face
+                                xwem-worklog-pwin-background)
+      (XFillRectangle (xwem-dpy) (xwem-worklog-pause-ppix xwem-worklog-pause-p)
+                      (xwem-face-get-gc 'xwem-worklog-temp-face)
+                      0 0 xwem-worklog-pwin-width xwem-worklog-pwin-height)
+      (xwem-misc-textsp-show (xwem-worklog-pause-ppix xwem-worklog-pause-p)
+                             20 20      ; XXX
+                             (xwem-misc-buffer->textsp 'default)))
 
-    (insert "\n")
-    (insert "Press any key to continue with current task.\n")
-    (if (eq (xwem-worklog-pause-type xwem-worklog-pause-p) 'list)
-        (insert (substitute-command-keys
-                 "Press ``\\<xwem-worklog-pause-map>\\[xwem-worklog-pause]'' 
to show pause buffer.\n"))
-
-      (insert "Bindings:\n")
-      (insert "Key             Binding\n")
-      (insert "---             -------\n")
-      (describe-bindings-internal xwem-worklog-pause-map))
-
-    (when full
-      (XClearArea (xwem-dpy) (xwem-worklog-pause-pwin xwem-worklog-pause-p)
-                  0 0 xwem-worklog-pwin-width xwem-worklog-pwin-height nil))
-    (xwem-misc-textsp-show (xwem-worklog-pause-pwin xwem-worklog-pause-p)
-                           20 20        ; XXX
-                           (xwem-misc-buffer->textsp 'default))
+    ;; Run update hooks in case there is something to draw more
+    (run-hooks 'xwem-worklog-pause-window-update-hook)
 
-    (run-hooks 'xwem-worklog-pause-window-update-hook)))
+    ;; Update PWIN
+    (XCopyArea (xwem-dpy) (xwem-worklog-pause-ppix xwem-worklog-pause-p)
+               (xwem-worklog-pause-pwin xwem-worklog-pause-p)
+               (XDefaultGC (xwem-dpy)) 0 0 
+               xwem-worklog-pwin-width xwem-worklog-pwin-height
+               0 0)))
 
 (defun xwem-worklog-last-time-string (task &optional padlen)
   "Return time string of last time of TASK was runned."
@@ -1279,7 +1305,7 @@
                                      (xwem-worklog-task-name task))) :color)
                    "black"))
               (xwem-diag-draw-rect
-               (xwem-worklog-pause-pwin xwem-worklog-pause-p)
+               (xwem-worklog-pause-ppix xwem-worklog-pause-p)
                (xwem-face-get-gc 'default)
                (cons x y) (cons (+ x w) y)
                (cons (+ x w) (+ y w)) (cons x (+ y w))
@@ -1346,7 +1372,7 @@
       (when spec
         (xwem-diag-draw-percentage
          xwem-worklog-diagram-type spec
-         (xwem-worklog-pause-pwin xwem-worklog-pause-p)
+         (xwem-worklog-pause-ppix xwem-worklog-pause-p)
          (xwem-face-get-gc 'default) x-off y-off wwid whei sec-hei)))))
 
 (defvar xwem-worklog-dockapp-map
@@ -1379,6 +1405,26 @@
 ;;   - Get rid of double call to `xwem-worklog-generate-percentage-spec'
 ;;   - Implement separated update for current task brick
 
+(define-xwem-deffered xwem-worklog-dockapp-update-task-brick (dockapp)
+  "Update DOCKAPP's current task brick."
+  (when (and xwem-worklog-current-task
+            (xwem-worklog-lookup-description
+             (xwem-worklog-task-name xwem-worklog-current-task)))
+    (xwem-set-face-foreground
+     'xwem-worklog-temp-face
+     (or (plist-get (cadr (xwem-worklog-lookup-description
+                          (xwem-worklog-task-name xwem-worklog-current-task)))
+                   :color) "black"))
+    (XFillRectangle (xwem-dpy) (xwem-worklog-dockapp-win dockapp)
+                   (xwem-face-get-gc 'xwem-worklog-temp-face) 0 0 6 6)
+    ))
+    ;; Do we really need this?
+;    (XFillRectangle (xwem-dpy) (xwem-worklog-dockapp-mask dockapp)
+;                  xwem-misc-mask-fgc 0 0 6 6)
+;    (X-XShapeMask (xwem-dpy) (xwem-worklog-dockapp-win dockapp)
+;                X-XShape-Bounding X-XShapeInt 0 0
+;                (xwem-worklog-dockapp-mask dockapp))))
+  
 (define-xwem-deffered xwem-worklog-dockapp-update (dockapp)
   "Update worklog dockapp."
   (when (xwem-worklog-dockapp-p dockapp)
@@ -1407,20 +1453,18 @@
          (/ sec-w 2) (/ sec-w 2) w h sec-w nil nil
          xwem-misc-mask-fgc))
 
+      ;; Draw a task brick
       (when (and xwem-worklog-current-task
                  (setq td (xwem-worklog-lookup-description
                            (xwem-worklog-task-name 
xwem-worklog-current-task))))
         (xwem-set-face-foreground 'xwem-worklog-temp-face
                                   (or (plist-get (cadr td) :color) "black"))
         (XFillRectangle
-         xdpy win (xwem-face-get-gc 'xwem-worklog-temp-face) 0 0 6 6)
-
-        (XFillRectangle
-         xdpy mask xwem-misc-mask-fgc 0 0 6 6))
+        xdpy win (xwem-face-get-gc 'xwem-worklog-temp-face) 0 0 6 6)
+        (XFillRectangle xdpy mask xwem-misc-mask-fgc 0 0 6 6))
       
       ;; Apply mask
-      (X-XShapeMask xdpy win X-XShape-Bounding X-XShapeSet 0 0 mask)
-      )))
+      (X-XShapeMask xdpy win X-XShape-Bounding X-XShapeSet 0 0 mask))))
 
 (defun xwem-worklog-dockapp-event-handler (xdpy xwin xev)
   "Event handler for worklog dockapp."
@@ -1483,14 +1527,14 @@
                         (xwem-worklog-meaning-update-time)))
 
     (add-hook 'xwem-worklog-task-start-hook
-                 `(lambda () (xwem-worklog-dockapp-update ,wd)))
+             `(lambda () (xwem-worklog-dockapp-update-task-brick ,wd)))
     wd))
 
 (defun xwem-worklog-dockapp-stop (dockapp)
   "Stop worklog dockapp."
   (when (xwem-worklog-dockapp-p dockapp)
     (remove-hook 'xwem-worklog-task-start-hook
-                 `(lambda () (xwem-worklog-dockapp-update ,dockapp)))
+                 `(lambda () (xwem-worklog-dockapp-update-task-brick 
,dockapp)))
     (delete-itimer (xwem-worklog-dockapp-update-itimer dockapp))
     (X-Win-rem-prop (xwem-worklog-dockapp-win dockapp) 'xwem-worklog-dockapp)
     (X-invalidate-cl-struct dockapp)))




<Prev in Thread] Current Thread [Next in Thread>
  • Summary for xwem--main--2.1--patch-20, Zajcev Evgeny <=