gtk: Add gtk-window-set-type-hint.
authorMatt Birkholz <matt@birkholz.chandler.az.us>
Fri, 5 Apr 2013 17:12:47 +0000 (10:12 -0700)
committerMatt Birkholz <matt@birkholz.chandler.az.us>
Fri, 5 Apr 2013 17:12:47 +0000 (10:12 -0700)
src/gtk/Includes/gtkwindow.cdecl
src/gtk/gtk-widget.scm
src/gtk/gtk.pkg

index 7738691aceced1e90b38ad7d7125044442b0832a..74a29dd439c34412379f59753dff5ed8bf7bccee 100644 (file)
@@ -25,6 +25,11 @@ gtk-2.0/gtk/gtkwindow.h |#
        (window (* GtkWindow))
        (opacity gdouble))
 
+(extern void
+       gtk_window_set_type_hint
+       (window (* GtkWindow))
+       (hint GdkWindowTypeHint))
+
 (extern gdouble
        gtk_window_get_opacity
        (window (* GtkWindow)))
index bdb7762852c44131cb9e744d75e7438050d6b8bd..fa0107e81a4ffd61905c358b63fe91bf5d4d2cd2 100644 (file)
@@ -832,6 +832,23 @@ USA.
       (error:bad-range-argument opacity 'gtk-window-set-opacity))
   (C-call "gtk_window_set_opacity" (gobject-alien window) opacity))
 
+(define (gtk-window-set-type-hint window hint)
+  (guarantee-gtk-window window 'gtk-window-set-type-hint)
+  (let ((type-hint (->type-hint hint 'gtk-window-set-type-hint)))
+    (C-call "gtk_window_set_type_hint" (gobject-alien window) type-hint)))
+
+(define (->type-hint object operator)
+  (case object
+    ((NORMAL) (C-enum "GDK_WINDOW_TYPE_HINT_NORMAL"))
+    ((DIALOG) (C-enum "GDK_WINDOW_TYPE_HINT_DIALOG"))
+    ((MENU) (C-enum "GDK_WINDOW_TYPE_HINT_MENU"))
+    ((TOOLBAR) (C-enum "GDK_WINDOW_TYPE_HINT_TOOLBAR"))
+    ((SPLASHSCREEN) (C-enum "GDK_WINDOW_TYPE_HINT_SPLASHSCREEN"))
+    ((UTILITY) (C-enum "GDK_WINDOW_TYPE_HINT_UTILITY"))
+    ((DOCK) (C-enum "GDK_WINDOW_TYPE_HINT_DOCK"))
+    ((DESKTOP) (C-enum "GDK_WINDOW_TYPE_HINT_DESKTOP"))
+    (else (error:wrong-type-argument object "a GdkWindow type hint" operator))))
+
 (define (gtk-window-get-default-size window receiver)
   (guarantee-gtk-window window 'gtk-window-get-default-size)
   (let* ((*width (malloc (fix:* 2 (C-sizeof "gint")) 'gint))
index 402def6438315cf2abce1239b9d031ffc81ac797..07ffc45fe343d8f7dfbf815229a1505b84a65267 100644 (file)
@@ -182,6 +182,7 @@ USA.
          gtk-window-set-geometry-hints
          gtk-window-set-title
          gtk-window-set-opacity
+         gtk-window-set-type-hint
          gtk-window-set-default-size gtk-window-get-default-size
          gtk-window-parse-geometry
          gtk-window-resize