[gtk-cffi-cvs] CVS gtk-cffi/gtk

CVS User rklochkov rklochkov at common-lisp.net
Tue Jul 31 17:57:12 UTC 2012


Update of /project/gtk-cffi/cvsroot/gtk-cffi/gtk
In directory tiger.common-lisp.net:/tmp/cvs-serv2691/gtk

Modified Files:
	action.lisp button.lisp enums.lisp gtk-cffi.asd image.lisp 
	loadlib.lisp package.lisp widget.lisp window.lisp 
Added Files:
	actionable.lisp activatable.lisp color-button.lisp 
	color-chooser.lisp spinner.lisp status-icon.lisp 
Log Message:
Added pack of Gtk*Buttons


--- /project/gtk-cffi/cvsroot/gtk-cffi/gtk/action.lisp	2011/04/25 19:16:08	1.1.1.1
+++ /project/gtk-cffi/cvsroot/gtk-cffi/gtk/action.lisp	2012/07/31 17:57:12	1.2
@@ -1,6 +1,6 @@
 (in-package :gtk-cffi)
 
-(defclass action (gobject)
+(defclass action (g-object)
   ())
 
 (defcfun gtk-action-new :pointer (name gtk-string) (label gtk-string)
@@ -27,3 +27,5 @@
     visible-vertical :boolean
     is-important :boolean)
 
+(init-slots action)
+
--- /project/gtk-cffi/cvsroot/gtk-cffi/gtk/button.lisp	2012/02/12 17:29:42	1.2
+++ /project/gtk-cffi/cvsroot/gtk-cffi/gtk/button.lisp	2012/07/31 17:57:12	1.3
@@ -1,15 +1,19 @@
+;;;; -*- Mode: lisp; indent-tabs-mode: nil -*-
+;;;
+;;; button.lisp --- Wrapper for GtkButton
+;;;
+;;; Copyright (C) 2012, Roman Klochkov <kalimehtar at mail.ru>
+;;;
+
 (in-package :gtk-cffi)
 
-(defclass button (bin)
+(defclass button (bin actionable activatable)
   ())
 
-(defcfun "gtk_button_new" :pointer)
-
-(defcfun "gtk_button_new_with_label" :pointer (label :string))
-
-(defcfun "gtk_button_new_with_mnemonic" :pointer (label :string))
-
-(defcfun "gtk_button_new_from_stock" :pointer (label :string))
+(defcfun gtk-button-new :pointer)
+(defcfun gtk-button-new-with-label :pointer (label :string))
+(defcfun gtk-button-new-with-mnemonic :pointer (label :string))
+(defcfun gtk-button-new-from-stock :pointer (label cffi-keyword))
 
 (defmethod gconstructor ((button button)
                          &key label type &allow-other-keys)
@@ -23,3 +27,72 @@
         (funcall creator label))
     (gtk-button-new)))
 
+(defslots button
+  relief relief-style
+  label :string
+  use-stock :boolean
+  use-underline :boolean
+  focus-on-click :boolean
+  image pobject
+  image-position position-type)
+
+(deffuns button
+  (clicked :void)
+  (:get event-window pobject))
+
+(defcfun gtk-button-set-alignment :void (button pobject) (x :float) (y :float))
+(defmethod (setf alignment) (coords (button button))
+  (gtk-button-set-alignment button
+                          (float (first coords))
+                          (float (second coords))))
+(save-setter button alignment)
+
+(defcfun gtk-button-get-alignment :void 
+  (button pobject) (x :pointer) (y :pointer))
+
+(defmethod alignment ((button button))
+  (with-foreign-outs-list ((x :float) (y :float)) :ignore
+    (gtk-button-get-alignment button x y)))
+
+(init-slots button)
+
+(defclass toggle-button (button)
+  ())
+
+(defcfun gtk-toggle-button-new :pointer)
+(defcfun gtk-toggle-button-new-with-label :pointer (label :string))
+(defcfun gtk-toggle-button-new-with-mnemonic :pointer (label :string))
+
+(defmethod gconstructor ((toggle-button toggle-button) &key label type)
+  (if label
+      (case type
+        (:mnemonic (gtk-toggle-button-new-with-mnemonic label))
+        (otherwise (gtk-toggle-button-new-with-label label)))
+    (gtk-toggle-button-new)))
+
+(defslots toggle-button
+  mode :boolean
+  active :boolean
+  inconsistent :boolean)
+
+(deffuns toggle-button
+  (toggled :void))
+
+(init-slots toggle-button)
+
+(defclass check-button (toggle-button)
+  ())
+
+(defcfun gtk-check-button-new :pointer)
+(defcfun gtk-check-button-new-with-label :pointer (label :string))
+(defcfun gtk-check-button-new-with-mnemonic :pointer (label :string))
+
+(defmethod gconstructor ((check-button check-button) &key label type)
+  (if label
+      (case type
+        (:mnemonic (gtk-check-button-new-with-mnemonic label))
+        (otherwise (gtk-check-button-new-with-label label)))
+    (gtk-check-button-new)))
+
+
+
--- /project/gtk-cffi/cvsroot/gtk-cffi/gtk/enums.lisp	2012/07/29 15:13:59	1.5
+++ /project/gtk-cffi/cvsroot/gtk-cffi/gtk/enums.lisp	2012/07/31 17:57:12	1.6
@@ -29,4 +29,8 @@
 (defcenum justification
   :left :right :center :fill)
 
-(defcenum pack-type :start :end)
\ No newline at end of file
+(defcenum pack-type :start :end)
+
+(defcenum relief-style :normal :half :none)
+
+(defcenum position-type :left :right :top :bottom)
\ No newline at end of file
--- /project/gtk-cffi/cvsroot/gtk-cffi/gtk/gtk-cffi.asd	2012/07/29 15:13:59	1.20
+++ /project/gtk-cffi/cvsroot/gtk-cffi/gtk/gtk-cffi.asd	2012/07/31 17:57:12	1.21
@@ -29,7 +29,8 @@
    (:file window-group :depends-on (loadlib))
    (:file orientable :depends-on (loadlib))
    (:file buildable :depends-on (loadlib))   
-   (:file builder :depends-on (loadlib))))
+   (:file builder :depends-on (loadlib))
+   (:file color-chooser :depends-on (loadlib))))
 
 (defsystem gtk-cffi-widget
   :description "Interface to GTK/Glib via CFFI"
@@ -39,7 +40,9 @@
   :depends-on (gtk-cffi-core)
   :components
   ((:file widget)
-   (:file invisible :depends-on (widget))))
+   (:file invisible :depends-on (widget))
+   (:file actionable :depends-on (widget))
+   (:file activatable :depends-on (widget))))
 
 (defsystem gtk-cffi-misc
   :description "Interface to GTK/Glib via CFFI"
@@ -113,9 +116,9 @@
 (defsystem gtk-cffi-button
   :description "Interface to GTK/Glib via CFFI"
   :author "Roman Klochkov <kalimehtar at mail.ru>"
-  :version "0.1"
+  :version "0.99"
   :license "LLGPL"
-  :depends-on (gtk-cffi-widget)
+  :depends-on (gtk-cffi-widget gtk-cffi-misc)
   :components
   ((:file :button)))
 
@@ -383,7 +386,7 @@
   :license "LLGPL"
   :depends-on (gtk-cffi-file-chooser gtk-cffi-hbox)
   :components
-  ((:file :file-chooser-button)))
+  ((:file file-chooser-button)))
 
 (defsystem gtk-cffi-progress-bar
   :description "Interface to GTK/Glib via CFFI"
@@ -392,7 +395,7 @@
   :license "LLGPL"
   :depends-on (gtk-cffi-widget)
   :components
-  ((:file :progress-bar)))
+  ((:file progress-bar)))
 
 (defsystem gtk-cffi-table
   :description "Interface to GTK/Glib via CFFI"
@@ -401,7 +404,7 @@
   :license "LLGPL"
   :depends-on (gtk-cffi-container)
   :components
-  ((:file :table)))
+  ((:file table)))
 
 (defsystem gtk-cffi-menu-shell
   :description "Interface to GTK/Glib via CFFI"
@@ -410,7 +413,7 @@
   :license "LLGPL"
   :depends-on (gtk-cffi-container)
   :components
-  ((:file :menu-shell)))
+  ((:file menu-shell)))
 
 (defsystem gtk-cffi-menu
   :description "Interface to GTK/Glib via CFFI"
@@ -419,7 +422,7 @@
   :license "LLGPL"
   :depends-on (gtk-cffi-menu-shell)
   :components
-  ((:file :menu)))
+  ((:file menu)))
 
 (defsystem gtk-cffi-menu-bar
   :description "Interface to GTK/Glib via CFFI"
@@ -428,7 +431,7 @@
   :license "LLGPL"
   :depends-on (gtk-cffi-menu-shell)
   :components
-  ((:file :menu-bar)))
+  ((:file menu-bar)))
 
 (defsystem gtk-cffi-tool-shell
   :description "Interface to GTK/Glib via CFFI"
@@ -437,7 +440,7 @@
   :license "LLGPL"
   :depends-on (gtk-cffi-container)
   :components
-  ((:file :tool-shell)))
+  ((:file tool-shell)))
 
 (defsystem gtk-cffi-toolbar
   :description "Interface to GTK/Glib via CFFI"
@@ -455,7 +458,7 @@
   :license "LLGPL"
   :depends-on (gtk-cffi-container)
   :components
-  ((:file :notebook)))
+  ((:file notebook)))
 
 (defsystem gtk-cffi-statusbar
   :description "Interface to GTK/Glib via CFFI"
@@ -464,7 +467,7 @@
   :license "LLGPL"
   :depends-on (gtk-cffi-hbox)
   :components
-  ((:file :statusbar)))
+  ((:file statusbar)))
 
 (defsystem gtk-cffi-image
   :description "Interface to GTK/Glib via CFFI"
@@ -473,19 +476,56 @@
   :license "LLGPL"
   :depends-on (gtk-cffi-misc)
   :components
-  ((:file :image)))
+  ((:file image)))
+
+(defsystem gtk-cffi-status-icon
+  :description "Interface to GTK/Glib via CFFI"
+  :author "Roman Klochkov <kalimehtar at mail.ru>"
+  :version "0.99"
+  :license "LLGPL"
+  :depends-on (gtk-cffi-core)
+  :components
+  ((:file status-icon)))
+
+(defsystem gtk-cffi-spinner
+  :description "Interface to GTK/Glib via CFFI"
+  :author "Roman Klochkov <kalimehtar at mail.ru>"
+  :version "1.0"
+  :license "LLGPL"
+  :depends-on (gtk-cffi-widget)
+  :components
+  ((:file spinner)))
+
+(defsystem gtk-cffi-action
+  :description "Interface to GTK/Glib via CFFI"
+  :author "Roman Klochkov <kalimehtar at mail.ru>"
+  :version "0.1"
+  :license "LLGPL"
+  :depends-on (gtk-cffi-core)
+  :components
+  ((:file action)))
+
+(defsystem gtk-cffi-color-button
+  :description "Interface to GTK/Glib via CFFI"
+  :author "Roman Klochkov <kalimehtar at mail.ru>"
+  :version "0.99"
+  :license "LLGPL"
+  :depends-on (gtk-cffi-button)
+  :components
+  ((:file color-button)))
+
 
 (defsystem gtk-cffi
   :description "Interface to GTK/Glib via CFFI"
   :author "Roman Klochkov <kalimehtar at mail.ru>"
   :version "0.1"
   :license "LLGPL"
-  :depends-on (gtk-cffi-message-dialog
+  :depends-on (gtk-cffi-info-bar
                gtk-cffi-file-chooser-dialog
                gtk-cffi-file-chooser-button
                gtk-cffi-progress-bar
                gtk-cffi-entry
-               gtk-cffi-button
+               gtk-cffi-color-button
                gtk-cffi-label
                gtk-cffi-paned
                gtk-cffi-frame
@@ -505,5 +545,6 @@
                gtk-cffi-notebook
                gtk-cffi-image
                gtk-cffi-combo-box
+               gtk-cffi-status-icon
                gtk-cffi-text-view))
 
--- /project/gtk-cffi/cvsroot/gtk-cffi/gtk/image.lisp	2012/07/29 15:13:59	1.4
+++ /project/gtk-cffi/cvsroot/gtk-cffi/gtk/image.lisp	2012/07/31 17:57:12	1.5
@@ -9,14 +9,15 @@
 (defclass image (misc)
   ())
 
-(defcfun gtk-image-new-from-file :pointer (filename :string))
+(defcfun gtk-image-new-from-file :pointer (filename cffi-pathname))
 (defcfun gtk-image-new-from-icon-set :pointer 
   (icon-set pobject) (icon-size icon-size))
 (defcfun gtk-image-new-from-pixbuf :pointer (pixbuf pobject))
-(defcfun gtk-image-new-from-icon-name :pointer (icon-name :string) (icon-size icon-size))
+(defcfun gtk-image-new-from-icon-name :pointer 
+  (icon-name :string) (icon-size icon-size))
 (defcfun gtk-image-new-from-animation :pointer (animation pobject))
 (defcfun gtk-image-new-from-stock :pointer 
-  (stock-id :string) (size icon-size))
+  (stock-id cffi-keyword) (size icon-size))
 (defcfun gtk-image-new-from-gicon :pointer 
   (gicon pobject) (icon-size icon-size))
 (defcfun gtk-image-new :pointer)
@@ -50,7 +51,6 @@
   (image pobject) (stock-id :string) (size icon-size))
 (defcfun gtk-image-set-from-gicon :pointer 
   (image pobject) (gicon pobject) (icon-size icon-size))
-;(defcfun gtk-image-clear :void (image pobject))
 
 
 (defmethod reinitialize-instance ((image image) &key file pixbuf stock-id gicon
--- /project/gtk-cffi/cvsroot/gtk-cffi/gtk/loadlib.lisp	2012/02/20 16:51:37	1.5
+++ /project/gtk-cffi/cvsroot/gtk-cffi/gtk/loadlib.lisp	2012/07/31 17:57:12	1.6
@@ -38,5 +38,7 @@
   (defcfun gtk-get-major-version :uint)
   (defcfun gtk-get-minor-version :uint)
   (when (and (>= (gtk-get-major-version) 3) (>= (gtk-get-minor-version) 2))
-    (push :gtk3.2 *features*)))
+    (push :gtk3.2 *features*))
+  (when (and (>= (gtk-get-major-version) 3) (>= (gtk-get-minor-version) 4))
+    (push :gtk3.4 *features*)))
 
--- /project/gtk-cffi/cvsroot/gtk-cffi/gtk/package.lisp	2012/07/29 15:13:59	1.22
+++ /project/gtk-cffi/cvsroot/gtk-cffi/gtk/package.lisp	2012/07/31 17:57:12	1.23
@@ -349,6 +349,19 @@
 
   
    #:button
+   ;; slots
+   #:relief
+   #:use-stock
+   #:image-position
+   ;; methods
+   #:clicked
+   #:event-window
+
+   #:toggle-button
+   #:inconsistent
+   #:toggled
+
+   #:check-button
    
    #:box
    ;; box slots
@@ -866,6 +879,39 @@
    #:objects
    #:type-from-name
    #:value-from-string
+
+   #:status-icon
+   #:size
+   #:stock
+   #:is-embedded
+   #:gicon
+   #:x11-window-id
+   #:storage-type
+
+   #:info-bar
+   
+
+   #:spinner
+   ;methods
+   #:start
+   #:stop
+
+   #:activatable
+   #:related-action
+   #:use-action-appearance
+   #:do-set-related-action
+   #:sync-action-properties
+   
+   #:actionable
+   #:action-name
+   #:action-target-value
+   #:detailed-action-name
+
+   #:color-button
+   #:rgba
+   #:color
+   #:use-alpha
+   #:title
    ))
 
 (in-package #:gtk-cffi)
--- /project/gtk-cffi/cvsroot/gtk-cffi/gtk/widget.lisp	2012/05/13 16:20:07	1.14
+++ /project/gtk-cffi/cvsroot/gtk-cffi/gtk/widget.lisp	2012/07/31 17:57:12	1.15
@@ -126,8 +126,8 @@
     parent-window pobject
     parent pobject
     child-visible :boolean
-    tooltip-markup :string
-    tooltip-text :string
+    tooltip-markup g-lib-string
+    tooltip-text g-lib-string
     tooltip-window pobject
     has-tooltip :boolean
     can-default :boolean
@@ -142,7 +142,7 @@
     sensitive :boolean
     events event-mask
     visual pobject
-    composite-name :string
+    composite-name g-lib-string
     halign align
     valign align
     margin-left :int
@@ -162,10 +162,11 @@
   (hide :boolean)  
   (size-allocate :void (allocation (struct allocation)))
   (add-accelerator :void
-   (accel-signal :string) (accel-group pobject) (accel-key key)
-   (accel-mods modifier-type) (accel-flags accel-flags))
+                   (accel-signal :string) (accel-group pobject) (accel-key key)
+                   (accel-mods modifier-type) (accel-flags accel-flags))
   (remove-accelerator :boolean
-   (accel-group pobject) (accel-key key) (accel-mods modifier-type))
+                      (accel-group pobject) (accel-key key) 
+                      (accel-mods modifier-type))
   (list-accel-closures g-list)
   (can-activate-accel :boolean (signal-id :uint))   
   ((widget-event . event) :boolean (event event))
--- /project/gtk-cffi/cvsroot/gtk-cffi/gtk/window.lisp	2012/07/29 16:11:54	1.5
+++ /project/gtk-cffi/cvsroot/gtk-cffi/gtk/window.lisp	2012/07/31 17:57:12	1.6
@@ -196,7 +196,16 @@
   (:method (icon)
     (gtk-window-set-default-icon icon)))
 
+(defcfun (default-icon-list "gtk_window_get_default_icon_list") g-list-object)
 (defcfun gtk-window-set-default-icon-list :void (icons g-list-object))
+(defun (setf default-icon-list) (value)
+  (gtk-window-set-default-icon-list value))
+
+(defcfun (default-icon-name "gtk_window_get_default_icon_name") :string)
+(defcfun gtk-window-set-default-icon-name :void (name :string))
+(defun (setf default-icon-name) (name)
+  (gtk-window-set-default-icon-name name))
+
 
 (init-slots window ((width -1) (height -1) geometry resize)
   (when (or (/= width -1) (/= height -1))

--- /project/gtk-cffi/cvsroot/gtk-cffi/gtk/actionable.lisp	2012/07/31 17:57:12	NONE
+++ /project/gtk-cffi/cvsroot/gtk-cffi/gtk/actionable.lisp	2012/07/31 17:57:12	1.1
;;;
;;; actionable.lisp -- GtkActionable
;;;
;;; Copyright (C) 2012, Roman Klochkov <kalimehtar at mail.ru>
;;;

(in-package :gtk-cffi)

(defclass actionable (object)
  ())

#+gtk3.4 
(defslots actionable
  action-name :string
  action-target-value variant)

#+gtk3.4
(deffuns actionable
    (:set detailed-action-name :string))

#+gtk3.4
(init-slots actionable)
  
  
  

--- /project/gtk-cffi/cvsroot/gtk-cffi/gtk/activatable.lisp	2012/07/31 17:57:12	NONE
+++ /project/gtk-cffi/cvsroot/gtk-cffi/gtk/activatable.lisp	2012/07/31 17:57:12	1.1
;;;
;;; activatable.lisp -- GtkActivatable
;;;
;;; Copyright (C) 2012, Roman Klochkov <kalimehtar at mail.ru>
;;;

(in-package :gtk-cffi)

(defclass activatable (object)
  ())

(defslots activatable
  related-action pobject
  use-action-appearance :boolean)

(deffuns activatable
  (do-set-related-action :void (action pobject))
  (sync-action-properties :void (action pobject)))

(init-slots activatable)
  --- /project/gtk-cffi/cvsroot/gtk-cffi/gtk/color-button.lisp	2012/07/31 17:57:12	NONE
+++ /project/gtk-cffi/cvsroot/gtk-cffi/gtk/color-button.lisp	2012/07/31 17:57:12	1.1
;;;; -*- Mode: lisp; indent-tabs-mode: nil -*-
;;;
;;; color-button.lisp --- Wrapper for GtkColorButton
;;;
;;; Copyright (C) 2012, Roman Klochkov <kalimehtar at mail.ru>
;;;

(in-package :gtk-cffi)

(defclass color-button (button color-chooser)
  ())

(defcfun gtk-color-button-new :pointer)
(defcfun gtk-color-button-new-with-color :pointer (color pcolor))
(defcfun gtk-color-button-new-with-rgba :pointer (rgbd prgba))

(defmethod gconstructor ((color-button color-button) &key color rgba)
  (cond
    (color (gtk-color-button-new-with-color color))
    (rgba (gtk-color-button-new-with-rgba rgba))
    (t (gtk-color-button-new))))

(defslots color-button
  rgba prgba
  alpha :uint16
  use-alpha :boolean
  title :string)

(deffuns color-button
  (:get color pcolor &key)
  (:set color pcolor &key))

(remove-setter color-button color)
(remove-setter color-button rgba)

(init-slots color-button)--- /project/gtk-cffi/cvsroot/gtk-cffi/gtk/color-chooser.lisp	2012/07/31 17:57:12	NONE
+++ /project/gtk-cffi/cvsroot/gtk-cffi/gtk/color-chooser.lisp	2012/07/31 17:57:12	1.1
;;;
;;; color-chooser.lisp -- GtkColorChooser
;;;
;;; Copyright (C) 2012, Roman Klochkov <kalimehtar at mail.ru>
;;;

(in-package :gtk-cffi)

(defclass color-chooser (object)
  ())

(defslots color-chooser
  rgba prgba
  use-alpha :boolean)

(defcfun gtk-color-chooser-add-palette 
    :void (color-chooser pobject) (orientation orientation) 
    (colors-per-line :int) (n-colors :int) (colors :pointer))

(defgeneric add-palette (color-chooser colors colors-per-line 
                                       &key orientation)
  (:method ((color-chooser color-chooser) colors colors-per-line 
            &key orientation)
    (let ((type 'gdk-cffi::rgba-struct)
          (n-colors (length colors)))
      (with-foreign-object (pcolors type n-colors)
        (dotimes (i n-colors)
          (destructuring-bind (red green blue alpha) (elt colors i)
            (template (field var) 
                (('gdk-cffi::red red) ('gdk-cffi::green green)
                 ('gdk-cffi::blue blue) ('gdk-cffi::alpha alpha))
              `(setf (foreign-slot-value (mem-ref pcolors type i)
                                         type ,field) ,var))))
        (gtk-color-chooser-add-palette color-chooser orientation
                                       colors-per-line n-colors colors)))))--- /project/gtk-cffi/cvsroot/gtk-cffi/gtk/spinner.lisp	2012/07/31 17:57:12	NONE
+++ /project/gtk-cffi/cvsroot/gtk-cffi/gtk/spinner.lisp	2012/07/31 17:57:12	1.1
;;;; -*- Mode: lisp; indent-tabs-mode: nil -*-
;;;
;;; spinner.lisp --- Wrapper for GtkSpinner
;;;
;;; Copyright (C) 2012, Roman Klochkov <kalimehtar at mail.ru>
;;;

(in-package :gtk-cffi)

(defclass spinner (widget)
  ())

(defcfun gtk-spinner-new :pointer)

(defmethod gconstructor ((spinner spinner) &key)
  (gtk-spinner-new))

(deffuns spinner
  (start :void)
  (stop :void))--- /project/gtk-cffi/cvsroot/gtk-cffi/gtk/status-icon.lisp	2012/07/31 17:57:12	NONE
+++ /project/gtk-cffi/cvsroot/gtk-cffi/gtk/status-icon.lisp	2012/07/31 17:57:12	1.1
(in-package :gtk-cffi)

(defclass status-icon (g-object)
  ())

(defcfun gtk-status-icon-new-from-file :pointer (filename cffi-pathname))
(defcfun gtk-status-icon-new-from-pixbuf :pointer (pixbuf pobject))
(defcfun gtk-status-icon-new-from-icon-name :pointer (icon-name :string))
(defcfun gtk-status-icon-new-from-stock :pointer (stock-id cffi-keyword))
(defcfun gtk-status-icon-new-from-gicon :pointer (gicon pobject))
(defcfun gtk-status-icon-new :pointer)

(defmethod gconstructor ((status-icon status-icon) 
                         &key file pixbuf stock-id gicon icon-name)
  (cond
    (file (gtk-status-icon-new-from-file file))
    (pixbuf (gtk-status-icon-new-from-pixbuf pixbuf))
    (stock-id (gtk-status-icon-new-from-stock stock-id))
    (icon-name (gtk-status-icon-new-from-icon-name icon-name))
    (gicon (gtk-status-icon-new-from-gicon gicon))
    (t (gtk-status-icon-new))))

(defcfun gtk-status-icon-set-from-file :pointer 
  (status-icon pobject) (filename cffi-pathname))
(defcfun gtk-status-icon-set-from-pixbuf :pointer 
  (status-icon pobject) (pixbuf pobject))
(defcfun gtk-status-icon-set-from-icon-name :pointer 
  (status-icon pobject) (icon-name :string))
(defcfun gtk-status-icon-set-from-stock :pointer 
  (status-icon pobject) (stock-id :string))
(defcfun gtk-status-icon-set-from-gicon :pointer 
  (status-icon pobject) (gicon pobject))

(defmethod reinitialize-instance ((status-icon status-icon) 
                                  &key file pixbuf stock-id gicon icon-name)
  (cond
    (file (gtk-status-icon-set-from-file status-icon file))
    (pixbuf (gtk-status-icon-set-from-pixbuf status-icon pixbuf))
    (stock-id (gtk-status-icon-set-from-stock status-icon stock-id))
    (icon-name (gtk-status-icon-set-from-icon-name status-icon icon-name))
    (gicon (gtk-status-icon-set-from-gicon status-icon gicon))))

(defslots status-icon
  screen pobject
  tooltip-text :string
  tooltip-markup :string
  has-tooltip :boolean
  title :string
  visible :boolean)

(deffuns status-icon
  ((name . get-icon-name) :string)
  (:set name :string)
  (is-embedded :boolean)
  (:get x11-window-id :uint32)
  (:get storage-type image-type)
  (:get pixbuf pobject)
  (:get stock :string)
  (:get gicon pobject)
  (:get size :int))
  

(defcfun gtk-status-icon-get-geometry :boolean 
  (status-icon pobject) (screen :pointer) (area (struct rectangle :out t)) 
  (orientation :pointer))

(defgeneric geometry (status-icon)
  (:method ((status-icon status-icon))
    (let ((area (make-instance 'rectangle)))
      (with-foreign-objects ((screen :pointer) (orientation orientation))
        (when (gtk-status-icon-get-geometry status-icon screen area orientation)
          (list (make-instance 'screen :pointer (mem-ref screen :pointer))
                area (mem-ref orientation 'orientation)))))))

;; gtk_status_icon_position_menu can be used 
;; in menu-popup as :gtk-status-icon-position-menu


(init-slots status-icon)




More information about the gtk-cffi-cvs mailing list