Add Gdk/Pixbufs
[cl-gtk2.git] / gdk / gdk.objects.lisp
index aec7927..aa2c59c 100644 (file)
 (defcenum notify-type (:ancestor 0) :virtual :inferior :nonlinear :nonlinear-virtual :unknown)
 (export 'notify-type)
 
-(define-g-object-class "GdkDisplay" display () ())
+(gobject:define-g-enum "GdkFillRule"
+    gdk-fill-rule
+    (:export t :type-initializer "gdk_fill_rule_get_type")
+  (:even-odd-rule 0)
+  (:winding-rule 1))
+
+(define-g-enum "GdkOverlapType"
+    overlap-type
+    (:export t :type-initializer "gdk_overlap_type_get_type")
+  (:in 0)
+  (:out 1)
+  (:part 2))
+
+(define-g-flags "GdkGCValuesMask"
+    gc-values-mask
+    (:export t :type-initializer "gdk_gc_values_mask_get_type")
+  (:foreground 1)
+  (:background 2)
+  (:font 4)
+  (:function 8)
+  (:fill 16)
+  (:tile 32)
+  (:stipple 64)
+  (:clip-mask 128)
+  (:subwindow 256)
+  (:ts-x-origin 512)
+  (:ts-y-origin 1024)
+  (:clip-x-origin 2048)
+  (:clip-y-origin 4096)
+  (:exposures 8192)
+  (:line-width 16384)
+  (:line-style 32768)
+  (:cap-style 65536)
+  (:join-style 131072))
+
+(define-g-enum "GdkFunction"
+    gdk-function
+    (:export t :type-initializer "gdk_function_get_type")
+  (:copy 0)
+  (:invert 1)
+  (:xor 2)
+  (:clear 3)
+  (:and 4)
+  (:and-reverse 5)
+  (:and-invert 6)
+  (:noop 7)
+  (:or 8)
+  (:equiv 9)
+  (:or-reverse 10)
+  (:copy-invert 11)
+  (:or-invert 12)
+  (:nand 13)
+  (:nor 14)
+  (:set 15))
+
+(define-g-enum "GdkFill"
+    gdk-fill
+    (:export t :type-initializer "gdk_fill_get_type")
+  (:solid 0)
+  (:tiled 1)
+  (:stippled 2)
+  (:opaque-stippled 3))
+
+(define-g-enum "GdkSubwindowMode"
+    subwindow-mode
+    (:export t :type-initializer "gdk_subwindow_mode_get_type")
+  (:clip-by-children 0)
+  (:include-inferiors 1))
+
+(define-g-enum "GdkLineStyle"
+    line-style
+    (:export t :type-initializer "gdk_line_style_get_type")
+  (:solid 0)
+  (:on-off-dash 1)
+  (:double-dash 2))
+
+(define-g-enum "GdkCapStyle"
+    cap-style
+    (:export t :type-initializer "gdk_cap_style_get_type")
+  (:not-last 0)
+  (:butt 1)
+  (:round 2)
+  (:projecting 3))
+
+(define-g-enum "GdkJoinStyle"
+    join-style
+    (:export t :type-initializer "gdk_join_style_get_type")
+  (:miter 0)
+  (:round 1)
+  (:bevel 2))
+
+(define-g-enum "GdkRgbDither"
+    rgb-dither
+    (:export t :type-initializer "gdk_rgb_dither_get_type")
+  (:none 0)
+  (:normal 1)
+  (:max 2))
+
+(define-g-object-class "GdkDisplay" display ()
+  ((:cffi name display-name (glib:g-string :free-from-foreign nil)
+          "gdk_display_get_name" nil)
+   (:cffi n-screens display-n-screens :int
+          "gdk_display_get_n_screens" nil)
+   (:cffi default-screen display-default-screen (g-object screen)
+          "gdk_display_get_default_screen" nil)
+   (:cffi devices display-devices (glib:glist g-object :free-from-foreign nil)
+          "gdk_display_list_devices" nil)
+   (:cffi supports-cursor-color display-supports-cursor-color :boolean
+          "gdk_display_supports_cursor_color" nil)
+   (:cffi supports-cursor-alpha display-supports-color-alpha :boolean
+          "gdk_display_supports_cursor_alpha" nil)
+   (:cffi default-cursor-size display-default-cursor-size :uint
+          "gdk_display_get_default_cursor_size" nil)
+   (:cffi default-group display-default-group (g-object gdk-window)
+          "gdk_display_get_default_group" nil)
+   (:cffi supports-selection-notification display-supports-selection-notification :boolean
+          "gdk_display_supports_selection_notification" nil)
+   (:cffi supports-clipboard-persistence display-supports-clipboard-persistence :boolean
+          "gdk_display_supports_clipboard_persistence" nil)
+   (:cffi supports-shapes display-supports-shapes :boolean
+          "gdk_display_supports_shapes" nil)
+   (:cffi supports-input-shapes display-supports-input-shapes :boolean
+          "gdk_display_supports_input_shapes" nil)
+   (:cffi supports-composite display-supports-composite :boolean
+          "gdk_display_supports_composite" nil)
+   (:cffi core-pointer display-core-pointer g-object
+          "gdk_display_get_core_pointer" nil)))
+
+;gdk_display_get_screen
 
 (define-g-object-class "GdkDisplayManager" display-manager ()
-  ((default-display display-manager-default-display "default-display" "GdkDisplay" t t)))
+  ((default-display display-manager-default-display "default-display" "GdkDisplay" t t)
+   (:cffi displays display-manager-displays (glib:gslist (g-object display) :free-from-foreign t)
+          "gdk_display_manager_list_displays" nil)))
 
 (define-g-object-class "GdkVisual" visual () ())
 
    (:cffi window-stack screen-window-stack (glib:glist (g-object gdk-window) :free-from-foreign t)
           "gdk_screen_get_window_stack" nil)))
 
-;gdk_screen_get_monitor_geometry
-;gdk_screen_get_monitor_at_point
-;gdk_screen_get_monitor_at_window
-;gdk_screen_get_monitor_height_mm
-;gdk_screen_get_monitor_width_mm
-;gdk_screen_get_monitor_plug_name
-;gdk_screen_broadcast_client_message
-;gdk_screen_get_setting
-;gdk_spawn_on_screen
-;gdk_spawn_on_screen_with_pipes
-;gdk_spawn_command_line_on_screen
+(defcfun gdk-region-new :pointer)
 
-(define-g-object-class "GdkGC" graphics-context () ())
+(define-g-boxed-opaque region nil :alloc (gdk-region-new))
 
-(define-g-object-class "GdkDrawable" drawable () ())
+(export (boxed-related-symbols 'region))
+
+(define-g-boxed-cstruct point nil
+  (x :int :initform 0)
+  (y :int :initform 0))
+
+(export (boxed-related-symbols 'point))
+
+(define-g-boxed-cstruct span nil
+  (x :int :initform 0)
+  (y :int :initform 0)
+  (width :int :initform 0))
+
+(export (boxed-related-symbols 'span))
+
+(define-g-boxed-cstruct segment nil
+  (x1 :int :initform 0)
+  (y1 :int :initform 0)
+  (x2 :int :initform 0)
+  (y2 :int :initform 0))
+
+(export (boxed-related-symbols 'segment))
+
+(define-g-boxed-cstruct trapezoid nil
+  (y1 :double :initform 0d0)
+  (x11 :double :initform 0d0)
+  (x21 :double :initform 0d0)
+  (y2 :double :initform 0d0)
+  (x12 :double :initform 0d0)
+  (x22 :double :initform 0d0))
+
+(export (boxed-related-symbols 'trapezoid))
+
+(define-g-boxed-cstruct rectangle "GdkRectangle"
+  (x :int :initform 0)
+  (y :int :initform 0)
+  (width :int :initform 0)
+  (height :int :initform 0))
+
+(export (boxed-related-symbols 'rectangle))
+
+(define-g-boxed-opaque font "GdkFont"
+  :alloc (error "GDK:FONT objects may not be allocated directly"))
+
+(export (boxed-related-symbols 'font))
+
+(define-g-boxed-cstruct color "GdkColor"
+  (pixel :uint32 :initform 0)
+  (red :uint16 :initform 0)
+  (green :uint16 :initform 0)
+  (blue :uint16 :initform 0))
+
+(export (boxed-related-symbols 'color))
+
+(define-g-object-class "GdkGC" graphics-context ()
+  ((:cffi screen graphics-context-screen (g-object screen)
+          "gdk_gc_get_screen" nil)
+   (:cffi foreground graphics-context-foreground (g-boxed-foreign color)
+          nil "gdk_gc_set_foreground")
+   (:cffi background graphics-context-background (g-boxed-foreign color)
+          nil "gdk_gc_set_background")
+   (:cffi rgb-fg-color graphics-context-rgb-fg-color (g-boxed-foreign color)
+          nil "gdk_gc_set_rgb_fg_color")
+   (:cffi rgb-bg-color graphics-context-rgb-bg-color (g-boxed-foreign color)
+          nil "gdk_gc_set_rgb_bg_color")
+   (:cffi font graphics-context-font (g-boxed-foreign font)
+          nil "gdk_gc_set_font")
+   (:cffi function graphics-context-function gdk-function
+          nil "gdk_gc_set_function")
+   (:cffi fill graphics-context-fill gdk-fill
+          nil "gdk_gc_set_fill")
+   (:cffi tile graphics-context-tile (g-object pixmap)
+          nil "gdk_gc_set_tile")
+   (:cffi stipple graphics-context-stipple (g-object pixmap)
+          nil "gdk_gc_set_stipple")
+   (:cffi clip-mask graphics-context-clip-mask (g-object pixmap)
+          nil "gdk_gc_set_clip_mask")
+   (:cffi clip-rectangle graphics-context-clip-rectangle (g-boxed-foreign rectangle)
+          nil "gdk_gc_set_clip_rectangle")
+   (:cffi clip-region graphics-context-clip-region (g-boxed-foreign region)
+          nil "gdk_gc_set_clip_region")
+   (:cffi subwindow graphics-context-subwindow subwindow-mode
+          nil "gdk_gc_set_subwindow")
+   (:cffi exposures graphics-context-exposures :boolean
+          nil "gdk_gc_set_exposures")
+   (:cffi colormap graphics-context-colormap (g-object colormap)
+          "gdk_gc_get_colormap" "gdk_gc_set_colormap")))
+
+(define-g-object-class "GdkDrawable" drawable ()
+  ((:cffi display drawable-display (g-object display)
+          "gdk_drawable_get_display" nil)
+   (:cffi screen drawable-screen (g-object screen)
+          "gdk_drawable_get_screen" nil)
+   (:cffi visual drawable-visual (g-object visual)
+          "gdk_drawable_get_visual" nil)
+   (:cffi colormap drawable-colormap (g-object colormap)
+          "gdk_drawable_get_colormap" "gdk_drawable_set_colormap")
+   (:cffi depth drawable-depth :int
+          "gdk_drawable_get_depth" nil)
+   (:cffi clip-region drawable-clip-region (g-boxed-foreign region :return)
+          "gdk_drawable_get_clip_region" nil)
+   (:cffi visible-region drawable-visible-region (g-boxed-foreign region :return)
+          "gdk_drawable_get_visible_region" nil)))
 
 (define-g-object-class "GdkPixmap" pixmap (:superclass drawable) ())
 
   :south-east
   :static)
 
-(define-g-boxed-cstruct rectangle "GdkRectangle"
-  (x :int :initform 0)
-  (y :int :initform 0)
-  (width :int :initform 0)
-  (height :int :initform 0))
-
-(export (boxed-related-symbols 'rectangle))
-
-(define-g-boxed-cstruct font "GdkFont"
-  (type font-type :initform :font)
-  (ascent :int :initform 0)
-  (descent :int :initform 0))
-
-(export (boxed-related-symbols 'font))
-
-(define-g-boxed-cstruct color "GdkColor"
-  (pixel :uint32 :initform 0)
-  (red :uint16 :initform 0)
-  (green :uint16 :initform 0)
-  (blue :uint16 :initform 0))
-
-(export (boxed-related-symbols 'color))
-
 (define-g-boxed-cstruct geometry "GdkGeometry"
   (min-width :int :initform 0)
   (min-height :int :initform 0)
      (pixels pixbuf-pixels "pixels" "gpointer" t nil)))
 
 (define-g-object-class "GdkPixbufAnimation" pixbuf-animation ()
-    nil) 
\ No newline at end of file
+    nil) 
+
+(define-g-object-class "GdkImage" gdk-image
+  (:superclass g-object :export t :interfaces
+               nil :type-initializer
+               "gdk_image_get_type")
+  ((:cffi colormap gdk-image-colormap (g-object gdk-colormap)
+          "gdk_image_get_colormap" "gdk_image_set_colormap")))
+
+(define-g-enum "GdkImageType"
+    gdk-image-type
+    (:export t :type-initializer "gdk_image_type_get_type")
+  (:normal 0)
+  (:shared 1)
+  (:fastest 2))
+
+(define-g-enum "GdkPixbufAlphaMode"
+    pixbuf-alpha-mode
+    (:export t :type-initializer "gdk_pixbuf_alpha_mode_get_type")
+  (:bilevel 0)
+  (:full 1))
+