emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] /srv/bzr/emacs/trunk r102092: Avoid inline image variables


From: Chong Yidong
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r102092: Avoid inline image variables for checkboxes (Bug#7222).
Date: Sun, 24 Oct 2010 19:40:55 -0400
User-agent: Bazaar (2.0.3)

------------------------------------------------------------
revno: 102092
committer: Chong Yidong <address@hidden>
branch nick: trunk
timestamp: Sun 2010-10-24 19:40:55 -0400
message:
  Avoid inline image variables for checkboxes (Bug#7222).
  
  * etc/images/checked.xpm:
  * etc/images/unchecked.xpm: New images.
  
  * image.el (image-checkbox-checked, image-checkbox-unchecked):
  Deleted (Bug#7222).
  
  * startup.el (fancy-startup-tail): Instead of using inline images,
  refer to image files from etc/.
  
  * wid-edit.el (checkbox): Likewise.
  (widget-image-find): Center image specs.
added:
  etc/images/checked.xpm
  etc/images/unchecked.xpm
modified:
  etc/ChangeLog
  lisp/ChangeLog
  lisp/image.el
  lisp/startup.el
  lisp/wid-edit.el
=== modified file 'etc/ChangeLog'
--- a/etc/ChangeLog     2010-10-24 21:36:09 +0000
+++ b/etc/ChangeLog     2010-10-24 23:40:55 +0000
@@ -1,3 +1,8 @@
+2010-10-24  Chong Yidong  <address@hidden>
+
+       * images/checked.xpm:
+       * images/unchecked.xpm: New images.
+
 2010-10-20  Richard Stallman  <address@hidden>
 
        * DISTRIB: Update donation section.

=== added file 'etc/images/checked.xpm'
--- a/etc/images/checked.xpm    1970-01-01 00:00:00 +0000
+++ b/etc/images/checked.xpm    2010-10-24 23:40:55 +0000
@@ -0,0 +1,20 @@
+/* XPM */
+static char * checked_xpm[] = {
+"12 12 5 1",
+"      c None",
+".     c gray20",
+"+     c white",
+"@     c gray70",
+"#     c black",
+"............",
+"............",
+"..@@@@@@##+.",
+"..@@@@@@##+.",
+"..#@@@@address@hidden",
+"..##@@@address@hidden",
+"address@hidden@@+.",
+"address@hidden@@+.",
+"..@@###@@@+.",
+"address@hidden",
+"address@hidden",
+"............"};

=== added file 'etc/images/unchecked.xpm'
--- a/etc/images/unchecked.xpm  1970-01-01 00:00:00 +0000
+++ b/etc/images/unchecked.xpm  2010-10-24 23:40:55 +0000
@@ -0,0 +1,20 @@
+/* XPM */
+static char * unchecked_xpm[] = {
+"12 12 5 1",
+"      c None",
+".     c gray20",
+"+     c white",
+"@     c gray70",
+"#     c black",
+"............",
+"............",
+"..@@@@@@@@+.",
+"..@@@@@@@@+.",
+"..@@@@@@@@+.",
+"..@@@@@@@@+.",
+"..@@@@@@@@+.",
+"..@@@@@@@@+.",
+"..@@@@@@@@+.",
+"address@hidden",
+"address@hidden",
+"............"};

=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2010-10-24 22:07:06 +0000
+++ b/lisp/ChangeLog    2010-10-24 23:40:55 +0000
@@ -1,3 +1,14 @@
+2010-10-24  Chong Yidong  <address@hidden>
+
+       * image.el (image-checkbox-checked, image-checkbox-unchecked):
+       Deleted (Bug#7222).
+
+       * startup.el (fancy-startup-tail): Instead of using inline images,
+       refer to image files from etc/.
+
+       * wid-edit.el (checkbox): Likewise.
+       (widget-image-find): Center image specs.
+
 2010-10-24  Glenn Morris  <address@hidden>
 
        * term/ns-win.el (x-select-text): Doc fix.

=== modified file 'lisp/image.el'
--- a/lisp/image.el     2010-10-13 14:50:06 +0000
+++ b/lisp/image.el     2010-10-24 23:40:55 +0000
@@ -723,21 +723,6 @@
         (cons (concat "\\." extension "\\'") 'imagemagick)
         image-type-file-name-regexps)))))
 
-
-;;; Inline stock images
-
-(defvar image-checkbox-checked
-  (create-image "\300\300\141\143\067\076\034\030"
-               'xbm t :width 8 :height 8 :background "grey75"
-               :foreground "black" :relief -2 :ascent 'center)
-  "Image of a checked checkbox.")
-
-(defvar image-checkbox-unchecked
-  (create-image (make-string 8 0)
-               'xbm t :width 8 :height 8 :background "grey75"
-               :foreground "black" :relief -2 :ascent 'center)
-  "Image of an unchecked checkbox.")
-
 (provide 'image)
 
 ;; arch-tag: 8e76a07b-eb48-4f3e-a7a0-1a7ba9f096b3

=== modified file 'lisp/startup.el'
--- a/lisp/startup.el   2010-10-11 04:49:59 +0000
+++ b/lisp/startup.el   2010-10-24 23:40:55 +0000
@@ -1563,21 +1563,26 @@
                 (kill-buffer "*GNU Emacs*")))
        "  ")
       (when (or user-init-file custom-file)
-       (insert-button
-        " "
-        :on-glyph image-checkbox-checked
-        :off-glyph image-checkbox-unchecked
-        'checked nil 'display image-checkbox-unchecked 'follow-link t
-        'action (lambda (button)
-                  (if (overlay-get button 'checked)
-                      (progn (overlay-put button 'checked nil)
-                             (overlay-put button 'display
-                                          (overlay-get button :off-glyph))
-                             (setq startup-screen-inhibit-startup-screen nil))
-                    (overlay-put button 'checked t)
-                    (overlay-put button 'display
-                                 (overlay-get button :on-glyph))
-                    (setq startup-screen-inhibit-startup-screen t))))
+       (let ((checked (create-image "checked.xpm"
+                                    nil nil :ascent 'center))
+             (unchecked (create-image "unchecked.xpm"
+                                      nil nil :ascent 'center)))
+         (insert-button
+          " "
+          :on-glyph checked
+          :off-glyph unchecked
+          'checked nil 'display unchecked 'follow-link t
+          'action (lambda (button)
+                    (if (overlay-get button 'checked)
+                        (progn (overlay-put button 'checked nil)
+                               (overlay-put button 'display
+                                            (overlay-get button :off-glyph))
+                               (setq startup-screen-inhibit-startup-screen
+                                     nil))
+                      (overlay-put button 'checked t)
+                      (overlay-put button 'display
+                                   (overlay-get button :on-glyph))
+                      (setq startup-screen-inhibit-startup-screen t)))))
        (fancy-splash-insert :face '(variable-pitch (:height 0.9))
                             " Never show it again.")))))
 

=== modified file 'lisp/wid-edit.el'
--- a/lisp/wid-edit.el  2010-10-11 04:49:59 +0000
+++ b/lisp/wid-edit.el  2010-10-24 23:40:55 +0000
@@ -638,7 +638,8 @@
                specs)
           (dolist (elt widget-image-conversion)
             (dolist (ext (cdr elt))
-              (push (list :type (car elt) :file (concat image ext)) specs)))
+              (push (list :type (car elt) :file (concat image ext)
+                          :ascent 'center) specs)))
           (find-image (nreverse specs))))
        (t
         ;; Oh well.
@@ -2195,9 +2196,9 @@
   ;; We could probably do the same job as the images using single
   ;; space characters in a boxed face with a stretch specification to
   ;; make them square.
-  :on-glyph image-checkbox-checked
+  :on-glyph "checked"
   :off "[ ]"
-  :off-glyph image-checkbox-unchecked
+  :off-glyph "unchecked"
   :help-echo "Toggle this item."
   :action 'widget-checkbox-action)
 


reply via email to

[Prev in Thread] Current Thread [Next in Thread]