;; License along with this library; if not, write to the Free Software
;; Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-;; $Id: gtk.lisp,v 1.14 2004-11-03 10:41:23 espen Exp $
+;; $Id: gtk.lisp,v 1.16 2004-11-07 01:23:38 espen Exp $
(in-package "GTK")
(defbinding get-default-language () string)
+;;;; Initalization
+
+(defbinding (gtk-init "gtk_parse_args") () nil
+ "Initializes the library without opening the display."
+ (nil null)
+ (nil null))
+
+(defun clg-init (&optional display)
+ "Initializes the system and starts the event handling"
+ (unless (gdk:display-get-default)
+ (gdk:gdk-init)
+ (gtk-init)
+ (prog1
+ (gdk:display-open display)
+ (system:add-fd-handler
+ (gdk:display-connection-number) :input #'main-iterate-all)
+ (setq lisp::*periodic-polling-function* #'main-iterate-all)
+ (setq lisp::*max-event-to-sec* 0)
+ (setq lisp::*max-event-to-usec* 1000))))
+
+
;;; Acccel group
(defmethod shared-initialize ((combo combo) names &rest initargs
&key popdown-strings)
+ (declare (ignore initargs))
(call-next-method)
(when popdown-strings
(combo-set-popdown-strings combo popdown-strings)))
;;;; Dialog
(defmethod shared-initialize ((dialog dialog) names &rest initargs &key button)
+ (declare (ignore button))
(call-next-method)
(dolist (button-definition (get-all initargs :button))
(apply #'dialog-add-button dialog (mklist button-definition))))
(edge gdk:window-edge)
(button int)
(root-x int) (root-y int)
- (timestamp (unsigned-int 32)))
+ (timestamp unsigned-int))
(defbinding window-begin-move-drag () nil
(window window)
(edge gdk:window-edge)
(button int)
(root-x int) (root-y int)
- (timestamp (unsigned-int 32)))
+ (timestamp unsigned-int))
(defbinding window-set-frame-dimensions () nil
(window window)
(menu-item menu-item)
((%menu-position menu position) int))
-(def-callback menu-position-callback-marshal
- (c-call:void (x c-call:int) (y c-call:int) (push-in c-call:int)
- (callback-id c-call:unsigned-int))
- (invoke-callback callback-id nil x y (not (zerop push-in))))
+(def-callback-marshal %menu-popup-callback (nil (x int) (y int) (push-in boolean)))
(defbinding %menu-popup () nil
(menu menu)
(unwind-protect
(%menu-popup
menu parent-menu-shell parent-menu-item
- (callback menu-position-callback-marshal)
+ (callback %menu-popup-callback)
callback-id button activate-time)
(destroy-user-data callback-id)))
(%menu-popup