X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~mdw/git/clg/blobdiff_plain/eacab64f20d7d986eaa76df1ee47bee2a5e273eb..b4a94e209931fdae387a11090159e96e42417fee:/gtk/gtk.lisp diff --git a/gtk/gtk.lisp b/gtk/gtk.lisp index e8e8b4b..05f6c8a 100644 --- a/gtk/gtk.lisp +++ b/gtk/gtk.lisp @@ -20,7 +20,7 @@ ;; TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE ;; SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -;; $Id: gtk.lisp,v 1.43 2005-04-24 13:30:40 espen Exp $ +;; $Id: gtk.lisp,v 1.52 2006-02-09 22:32:47 espen Exp $ (in-package "GTK") @@ -44,7 +44,8 @@ (defun gtk-version () (format nil "Gtk+ v~A.~A" major minor) (format nil "Gtk+ v~A.~A.~A" major minor micro)))) -(defbinding get-default-language () (copy-of pango:language)) +(defun clg-version () + "clg 0.91 version") ;;;; Initalization @@ -78,6 +79,8 @@ (defbinding grab-get-current () widget) (defbinding grab-remove () nil (widget widget)) +(defbinding get-default-language () (copy-of pango:language)) + ;;; About dialog @@ -698,6 +701,16 @@ (defbinding (dialog-set-alternative-button-order new-order) (vector int))) +#+gtk2.8 +(progn + (defbinding %dialog-get-response-for-widget () int + (dialog dialog) + (widget widget)) + + (defun dialog-get-response-for-widget (dialog widget) + (dialog-find-response dialog (dialog-get-response-for-widget dialog widget)))) + + (defmethod container-add ((dialog dialog) (child widget) &rest args) (apply #'container-add (dialog-vbox dialog) child args)) @@ -922,6 +935,11 @@ (defun create-image-widget (source &optional mask) ((or list vector) (make-instance 'image :pixmap source)) (gdk:pixmap (make-instance 'image :pixmap source :mask mask)))) +#+gtk2.8 +(defbinding image-clear () nil + (image image)) + + ;;; Image menu item @@ -1073,13 +1091,14 @@ (defbinding menu-tool-button-set-arrow-tooltip () nil ;;; Message dialog -(defmethod initialize-instance ((dialog message-dialog) - &key (message-type :info) (buttons :close) - flags text #+gtk 2.6 secondary-text - transient-parent) - (setf - (slot-value dialog 'location) - (%message-dialog-new transient-parent flags message-type buttons)) +(defmethod allocate-foreign ((dialog message-dialog) &key (message-type :info) + (buttons :close) flags transient-parent) + (%message-dialog-new transient-parent flags message-type buttons)) + + +(defmethod shared-initialize ((dialog message-dialog) names + &key text #+gtk 2.6 secondary-text) + (declare (ignore names)) (when text (message-dialog-set-markup dialog text)) #+gtk2.6 @@ -1267,9 +1286,24 @@ (defbinding window-propagate-key-event () boolean (window window) (event gdk:key-event)) +#-gtk2.8 (defbinding window-present () nil (window window)) +#+gtk2.8 +(progn + (defbinding %window-present () nil + (window window)) + + (defbinding %window-present-with-time () nil + (window window) + (timespamp unsigned-int)) + + (defun window-present (window &optional timestamp) + (if timestamp + (%window-present-with-time window timestamp) + (%window-present window)))) + (defbinding window-iconify () nil (window window)) @@ -1333,7 +1367,7 @@ (defbinding window-get-frame-dimensions () nil (window window) (left int :out) (top int :out) (rigth int :out) (bottom int :out)) -(defbinding %window-get-icon-list () (glist gdk:pixbuf) +(defbinding %window-get-icon-list () (glist (copy-of gdk:pixbuf)) (window window)) (defbinding window-get-position () nil @@ -1553,7 +1587,7 @@ (defbinding notebook-prev-page () nil (defbinding notebook-reorder-child (notebook child position) nil (notebook notebook) (child widget) - ((%notebook-position notebook position) int)) + ((%ensure-notebook-position notebook position) int)) (defbinding notebook-popup-enable () nil (notebook notebook)) @@ -1620,7 +1654,7 @@ (defun (setf notebook-menu-label) (menu-label notebook page) (defbinding notebook-query-tab-label-packing (notebook page) nil (notebook notebook) - ((%notebook-child notebook page) widget) + ((%ensure-notebook-child notebook page) widget) (expand boolean :out) (fill boolean :out) (pack-type pack-type :out)) @@ -1628,7 +1662,7 @@ (defbinding notebook-query-tab-label-packing (notebook page) nil (defbinding notebook-set-tab-label-packing (notebook page expand fill pack-type) nil (notebook notebook) - ((%notebook-child notebook page) widget) + ((%ensure-notebook-child notebook page) widget) (expand boolean) (fill boolean) (pack-type pack-type)) @@ -2198,7 +2232,7 @@ (defbinding %stock-lookup () boolean (defun stock-lookup (stock-id) (let ((location - (allocate-memory (proxy-instance-size (find-class 'stock-item))))) + (allocate-memory (foreign-size (find-class 'stock-item))))) (unwind-protect (when (%stock-lookup stock-id location) (ensure-proxy-instance 'stock-item (%stock-item-copy location))) @@ -2236,7 +2270,7 @@ (defbinding tooltips-get-info-from-tip-window () boolean (current-widget widget :out)) -;;; Rc +;;; Resource Files (defbinding rc-add-default-file (filename) nil ((namestring (truename filename)) string))