From: bg66 Date: Wed, 23 Aug 2000 01:38:47 +0000 (+0000) Subject: 2000-08-23 Akira Ohashi X-Git-Tag: liece-1_4_4-1~50 X-Git-Url: http://git.chise.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=44c182b183843d6328a0f85b877b69448568ef37;p=elisp%2Fliece.git 2000-08-23 Akira Ohashi * 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. --- diff --git a/etc/Makefile.am b/etc/Makefile.am index 0f662a1..99cf0b3 100644 --- a/etc/Makefile.am +++ b/etc/Makefile.am @@ -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 index 0000000..db84538 --- /dev/null +++ b/etc/icons/balloon.xpm @@ -0,0 +1,19 @@ +/* XPM */ +static char * balloon_xpm[] = { +"12 12 4 1", +" c None", +". c #000000", +"+ c #FFFFFF", +"@ c #808080", +" ...... ", +" ..++++.. ", +" .++++++++. ", +".++@@@@@@++.", +".++++++++++.", +".++@@@@@@++.", +".++++++++++.", +".++@@@@@@++.", +" .++++++++. ", +" .++++++. ", +" .+++... ", +" ..... "}; diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 73084b9..ecc90a3 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,11 @@ +2000-08-23 Akira Ohashi + + * 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 * liece.el (liece-server-keyword-map): Bind connection type. diff --git a/lisp/liece-xemacs.el b/lisp/liece-xemacs.el index f68f823..7c39886 100644 --- a/lisp/liece-xemacs.el +++ b/lisp/liece-xemacs.el @@ -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)))))) + ;;; @ emulation functions ;;;