2000-08-23 Akira Ohashi <bg66@luck.gr.jp>
authorbg66 <bg66>
Wed, 23 Aug 2000 01:38:47 +0000 (01:38 +0000)
committerbg66 <bg66>
Wed, 23 Aug 2000 01:38:47 +0000 (01:38 +0000)
* etc/Makefile.am (ICONS): Add `balloon.xpm'.

* etc/icons/balloon.xpm: New file.

* lisp/liece-xemacs.el (liece-xemacs-channel-balloon): New function.
Show balloon icon to `liece-channel-list-buffer' as XEmacs glyphs
when non-current channel message is received.
(liece-xemacs-channel-balloon-kill): New function.
Kill the balloon icon.

etc/Makefile.am
etc/icons/balloon.xpm [new file with mode: 0644]
lisp/ChangeLog
lisp/liece-xemacs.el

index 0f662a1..99cf0b3 100644 (file)
@@ -20,7 +20,8 @@ ICONS = \
        icons/print.xpm \
        icons/reload.xpm \
        icons/search.xpm \
-       icons/stop.xpm
+       icons/stop.xpm \
+       icons/balloon.xpm
 CATALOGS = po/ja.po
 STYLES = \
        styles/bottom \
diff --git a/etc/icons/balloon.xpm b/etc/icons/balloon.xpm
new file mode 100644 (file)
index 0000000..db84538
--- /dev/null
@@ -0,0 +1,19 @@
+/* XPM */
+static char * balloon_xpm[] = {
+"12 12 4 1",
+"       c None",
+".      c #000000",
+"+      c #FFFFFF",
+"@      c #808080",
+"   ......   ",
+"  ..++++..  ",
+" .++++++++. ",
+".++@@@@@@++.",
+".++++++++++.",
+".++@@@@@@++.",
+".++++++++++.",
+".++@@@@@@++.",
+" .++++++++. ",
+"  .++++++.  ",
+"  .+++...   ",
+" .....      "};
index 73084b9..ecc90a3 100644 (file)
@@ -1,3 +1,11 @@
+2000-08-23  Akira Ohashi  <bg66@luck.gr.jp>
+
+       * liece-xemacs.el (liece-xemacs-channel-balloon): New function.
+       Show balloon icon to `liece-cahnnel-list-buffer' as XEmacs glyphs
+       when non-current channel message is received.
+       (liece-xemacs-channel-balloon-kill): New function.
+       Kill the balloon icon.
+       
 2000-08-17   Daiki Ueno  <ueno@unixuser.org>
 
        * liece.el (liece-server-keyword-map): Bind connection type.
index f68f823..7c39886 100644 (file)
@@ -31,6 +31,7 @@
 
 (eval-when-compile
   (require 'liece-inlines)
+  (require 'liece-misc)
   (require 'liece-crypt)
   (require 'liece-commands))
 
@@ -147,6 +148,11 @@ If it is non-nil, it must be a toolbar.  The five valid values are
   :type 'liece-toolbar-icon
   :group 'liece-toolbar-icons)
 
+(defcustom liece-xemacs-channel-balloon-icon "balloon.xpm"
+  "Balloon icon."
+  :type 'file
+  :group 'liece-look)
+
 ;;; @ internal variables
 ;;; 
 (defvar liece-glyph-cache nil)
@@ -592,6 +598,46 @@ If ARG is given, don't hide splash buffer."
 (or (eq 'stream (device-type))
     (liece-xemacs-splash))
 
+;;; @ channel balloon
+;;; 
+;;; To use:
+;;; (and (featurep 'xpm)
+;;;      (memq (console-type) '(x mswindows))
+;;;      (add-hook 'liece-privmsg-cleartext-hook
+;;;               'liece-xemacs-channel-balloon)
+;;;      (add-hook 'liece-redisplay-buffer-functions
+;;;               'liece-xemacs-channel-balloon-kill))
+;;; 
+(defun liece-xemacs-channel-balloon (prefix rest)
+  (with-current-buffer liece-channel-list-buffer
+    (let* ((buffer-read-only nil)
+          (file (liece-xemacs-icon-path
+                 liece-xemacs-channel-balloon-icon))
+          (glyph (make-glyph (vector 'xpm ':file file)))
+          chnl ext)
+      (multiple-value-bind (chnl) (liece-split-line rest)
+       (setq chnl (liece-channel-virtual chnl))
+       (goto-char (point-min))
+       (and (liece-channel-p (liece-channel-real chnl))
+            (not (string= liece-current-channel chnl))
+            (re-search-forward (concat "^ ?[0-9]+: " chnl "$") nil t)
+            (progn
+              (goto-char (match-end 0))
+              (insert " ")
+              (setq ext (make-extent (match-end 0) (1+ (match-end 0))))
+              (set-extent-end-glyph ext glyph))))
+      nil)))
+
+(defun liece-xemacs-channel-balloon-kill (chnl)
+  (with-current-buffer liece-channel-list-buffer
+    (let ((buffer-read-only nil))
+      (goto-char (point-min))
+      (and (liece-channel-p (liece-channel-real chnl))
+          (re-search-forward (concat "^ ?[0-9]+: " chnl " $") nil t)
+          (progn
+            (goto-char (1- (match-end 0)))
+            (delete-char 1))))))
+
 \f
 ;;; @ emulation functions
 ;;;