Add error handling to gtk:ui-manager-load-from-file and gtk:ui-manager-load-from...
[cl-gtk2.git] / gdk / gdk.functions.lisp
blob88bbc1ec93ae059a3af123648e45bc64251c184e
1 (in-package :gdk)
3 (defcfun (default-screen "gdk_screen_get_default") (g-object gdk-screen))
4 (export 'default-screen)
6 (defcfun gdk-window-get-events event-mask
7 (window (g-object gdk-window)))
9 (defcfun gdk-window-set-events :void
10 (window (g-object gdk-window))
11 (flags event-mask))
13 (defun gdk-window-events (window)
14 (gdk-window-get-events window))
16 (defun (setf gdk-window-events) (new-value window)
17 (gdk-window-set-events window new-value))
19 (export 'gdk-window-events)
21 (defcfun gdk-gc-new (g-object graphics-context :already-referenced)
22 (drawable (g-object drawable)))
24 (defcfun gdk-draw-line :void
25 (drawable (g-object drawable))
26 (gc (g-object graphics-context))
27 (x1 :int)
28 (y1 :int)
29 (x2 :int)
30 (y2 :int))
32 (defcfun gdk-gc-set-rgb-fg-color :void
33 (gc (g-object graphics-context))
34 (color (g-boxed-foreign color)))
36 (defcfun gdk-drawable-get-size :void
37 (drawable (g-object drawable))
38 (width (:pointer :int))
39 (height (:pointer :int)))
41 (defun drawable-get-size (drawable)
42 (with-foreign-objects ((x :int)
43 (y :int))
44 (gdk-drawable-get-size drawable x y)
45 (values (mem-ref x :int) (mem-ref y :int))))
47 (export 'drawable-get-size)
49 (defcfun gdk-draw-layout :void
50 (drawable (g-object drawable))
51 (gc (g-object graphics-context))
52 (x :int)
53 (y :int)
54 (layout (g-object pango-layout)))
56 (defcfun gdk-atom-name (glib:g-string :free-from-foreign t)
57 (atom gdk-atom))
59 (defcfun gdk-atom-intern gdk-atom
60 (name :string)
61 (only-if-exists :boolean))
63 (export 'drawable-size)
65 (defcfun gdk-pixbuf-get-from-drawable (g-object pixbuf :already-referenced)
66 (dest (g-object pixbuf))
67 (src (g-object drawable))
68 (colormap :pointer)
69 (src-x :int)
70 (src-y :int)
71 (dest-x :int)
72 (dest-y :int)
73 (width :int)
74 (height :int))
76 (defun pixbuf-get-from-drawable (pixbuf drawable &key (src-x 0) (src-y 0) (dest-x 0) (dest-y 0) (width -1) (height -1))
77 (gdk-pixbuf-get-from-drawable pixbuf drawable (null-pointer) src-x src-y dest-x dest-y width height))
79 (export 'pixbuf-get-from-drawable)
81 (defcfun gdk-pixbuf-savev :boolean
82 (pixbuf (g-object pixbuf))
83 (filename :string)
84 (type :string)
85 (option-keys (:pointer (:pointer :char)))
86 (option-values (:pointer (:pointer :char)))
87 (error :pointer))
89 (defun pixbuf-save (pixbuf filename type)
90 (gdk-pixbuf-savev pixbuf
91 (etypecase filename
92 (string filename)
93 (pathname (namestring filename)))
94 type
95 (null-pointer)
96 (null-pointer)
97 (null-pointer)))
99 (export 'pixbuf-save)
101 (defcfun gdk-pixbuf-new-from-file (g-object pixbuf :already-referenced)
102 (filename :string)
103 (error :pointer))
105 (defun pixbuf-new-from-file (filename)
106 (glib:with-g-error (err)
107 (gdk-pixbuf-new-from-file filename err)))
109 (export 'pixbuf-new-from-file)