From 7504e771847baee63bb57b42c9520e9022d4c420 Mon Sep 17 00:00:00 2001 From: Matt Birkholz Date: Fri, 5 Apr 2013 10:12:47 -0700 Subject: [PATCH] gtk: Add gtk-window-set-type-hint. --- src/gtk/Includes/gtkwindow.cdecl | 5 +++++ src/gtk/gtk-widget.scm | 17 +++++++++++++++++ src/gtk/gtk.pkg | 1 + 3 files changed, 23 insertions(+) diff --git a/src/gtk/Includes/gtkwindow.cdecl b/src/gtk/Includes/gtkwindow.cdecl index 7738691ac..74a29dd43 100644 --- a/src/gtk/Includes/gtkwindow.cdecl +++ b/src/gtk/Includes/gtkwindow.cdecl @@ -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))) diff --git a/src/gtk/gtk-widget.scm b/src/gtk/gtk-widget.scm index bdb776285..fa0107e81 100644 --- a/src/gtk/gtk-widget.scm +++ b/src/gtk/gtk-widget.scm @@ -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)) diff --git a/src/gtk/gtk.pkg b/src/gtk/gtk.pkg index 402def643..07ffc45fe 100644 --- a/src/gtk/gtk.pkg +++ b/src/gtk/gtk.pkg @@ -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 -- 2.25.1