From: Matt Birkholz Date: Mon, 28 Aug 2017 18:39:46 +0000 (-0700) Subject: gtk: Punt/replace functions deprecated in Gtk 3.22. X-Git-Tag: mit-scheme-pucked-9.2.12~79 X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=d846dd930fc6dd6a27f7d733cccb7de17c126109;p=mit-scheme.git gtk: Punt/replace functions deprecated in Gtk 3.22. --- diff --git a/src/gtk/Includes/cairo-xlib.cdecl b/src/gtk/Includes/cairo-xlib.cdecl deleted file mode 100644 index 95372beca..000000000 --- a/src/gtk/Includes/cairo-xlib.cdecl +++ /dev/null @@ -1,40 +0,0 @@ -#| -*-Scheme-*- - -cairo/cairo-xlib.h (v1.4) |# - -(include "cairo") - -(extern (* cairo_surface_t) cairo_xlib_surface_create - (dpy (* Display)) - (drawable Drawable) - (visual (* Visual)) - (width int) (height int)) - -;(extern (* cairo_surface_t) cairo_xlib_surface_create_for_bitmap -; (dpy (* Display)) -; (bitmap Pixmap) -; (screen (* Screen)) -; (width int) (height int)) - -(extern void cairo_xlib_surface_set_size - (surface (* cairo_surface_t)) - (width int) (height int)) - -;(extern void cairo_xlib_surface_set_drawable -; (surface (* cairo_surface_t)) -; (drawable Drawable) -; (width int) (height int)) - -;(extern (* Display) cairo_xlib_surface_get_display(surface(* cairo_surface_t))) - -;(extern Drawable cairo_xlib_surface_get_drawable (surface (* cairo_surface_t))) - -;(extern (* Screen) cairo_xlib_surface_get_screen (surface (* cairo_surface_t))) - -;(extern (* Visual) cairo_xlib_surface_get_visual (surface (* cairo_surface_t))) - -;(extern int cairo_xlib_surface_get_depth (surface (* cairo_surface_t))) - -;(extern int cairo_xlib_surface_get_width (surface (* cairo_surface_t))) - -;(extern int cairo_xlib_surface_get_height (surface (* cairo_surface_t))) diff --git a/src/gtk/Includes/gdkcairo.cdecl b/src/gtk/Includes/gdkcairo.cdecl index c8afedb52..15e6470fb 100644 --- a/src/gtk/Includes/gdkcairo.cdecl +++ b/src/gtk/Includes/gdkcairo.cdecl @@ -4,9 +4,6 @@ gdk/gdkcairo.h |# ;(include "pangocairo") -(extern (* cairo_t) gdk_cairo_create - (window (* GdkWindow))) - (extern void gdk_cairo_set_source_pixbuf (cr (* cairo_t)) (pixbuf (* (const GdkPixbuf))) diff --git a/src/gtk/Includes/gdkwindow.cdecl b/src/gtk/Includes/gdkwindow.cdecl index 0b1121b8b..e5012c1a2 100644 --- a/src/gtk/Includes/gdkwindow.cdecl +++ b/src/gtk/Includes/gdkwindow.cdecl @@ -147,10 +147,6 @@ gdk/gdkwindow.h |# (window (* GdkWindow)) (x gint) (y gint) (width gint) (height gint)) -(extern void gdk_window_set_background_rgba - (window (* GdkWindow)) - (rgba (* GdkRGBA))) - #;(extern (* GdkWindow) gdk_window_get_pointer (window (* GdkWindow)) (x (* gint)) @@ -170,8 +166,4 @@ gdk/gdkwindow.h |# gdk_window_invalidate_rect (window (* GdkWindow)) (rect (* (const GdkRectangle))) - (invalidate_children gboolean)) - -(extern void gdk_window_process_updates - (window (* GdkWindow)) - (update_children gboolean)) \ No newline at end of file + (invalidate_children gboolean)) \ No newline at end of file diff --git a/src/gtk/Includes/gtkstylecontext.cdecl b/src/gtk/Includes/gtkstylecontext.cdecl index 9134538a2..a7902ef70 100644 --- a/src/gtk/Includes/gtkstylecontext.cdecl +++ b/src/gtk/Includes/gtkstylecontext.cdecl @@ -7,15 +7,6 @@ gtk/gtkstylecontext.h |# (provider (* GtkStyleProvider)) (priority guint)) -;; Deprecated as of Gtk+ 3.18. -#;(extern void gtk_style_context_set_background - (context (* GtkStyleContext)) - (window (* GdkWindow))) - -(extern void gtk_render_background - (context (* GtkStyleContext)) (cr (* cairo_t)) - (x gdouble) (y gdouble) (width gdouble) (height gdouble)) - (extern void gtk_render_frame (context (* GtkStyleContext)) (cr (* cairo_t)) (x gdouble) (y gdouble) (width gdouble) (height gdouble)) diff --git a/src/gtk/Includes/gtkwidget.cdecl b/src/gtk/Includes/gtkwidget.cdecl index a551118e1..8a486d77e 100644 --- a/src/gtk/Includes/gtkwidget.cdecl +++ b/src/gtk/Includes/gtkwidget.cdecl @@ -138,10 +138,6 @@ gtk/gtkwidget.h |# (extern gint gtk_widget_get_events (widget (* GtkWidget))) -(extern gboolean - gtk_widget_is_composited - (widget (* GtkWidget))) - (extern (* PangoContext) gtk_widget_get_pango_context (widget (* GtkWidget))) diff --git a/src/gtk/fix-layout.scm b/src/gtk/fix-layout.scm index 898735270..dbb4c730b 100644 --- a/src/gtk/fix-layout.scm +++ b/src/gtk/fix-layout.scm @@ -508,7 +508,8 @@ Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. (gobject-alien widget))) (set-fix-rect-position! view new-x new-y) (adjust-adjustments widget)) - (C-call "gdk_window_process_updates" gdkwindow 0)))))))) + ;;(C-call "gdk_window_process_updates" gdkwindow 0) + ))))))) (define (set-fix-layout-scroll-step! widget width height) (guarantee-fix-layout widget 'set-fix-layout-scroll-step!) diff --git a/src/gtk/gdk.scm b/src/gtk/gdk.scm index 8e862ffaa..35a575636 100644 --- a/src/gtk/gdk.scm +++ b/src/gtk/gdk.scm @@ -24,21 +24,6 @@ Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. ;;;; GDK Objects ;;; package: (gdk) -(define (gdk-cairo-create gdkwindow) - (guarantee-gdk-window gdkwindow 'gdk-cairo-create) - (let ((cairo (make-alien '|cairo_t|)) - (copy (make-alien '|cairo_t|))) - (add-glib-cleanup cairo (make-cairo-cleanup copy)) - (C-call "gdk_cairo_create" copy gdkwindow) - (copy-alien-address! cairo copy) - (error-if-null cairo "Could not create:" cairo gdkwindow) - (check-cairo-status cairo) - cairo)) - -(define (gdk-window-process-updates gdkwindow children-too?) - (guarantee-gdk-window gdkwindow 'gdk-window-process-updates) - (C-call "gdk_window_process_updates" gdkwindow (if children-too? 1 0))) - (define-integrable-operator (guarantee-gdk-window object operator) (if (not (and (alien? object) (eq? '|GdkWindow| (alien/ctype object)))) (error:wrong-type-argument object "a GdkWindow address" operator))) diff --git a/src/gtk/gtk-ev.scm b/src/gtk/gtk-ev.scm index 72523658d..ba38abd27 100644 --- a/src/gtk/gtk-ev.scm +++ b/src/gtk/gtk-ev.scm @@ -124,14 +124,6 @@ Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. (C-call "gdk_window_show" event-GdkWindow) (C-call "g_object_unref" GdkCursor) - (let ((rgba (malloc (C-sizeof "GdkRGBA") '|GdkRGBA|))) - (C->= rgba "GdkRGBA red" 1.0) - (C->= rgba "GdkRGBA green" 1.0) - (C->= rgba "GdkRGBA blue" 1.0) - (C->= rgba "GdkRGBA alpha" 1.0) - (C-call "gdk_window_set_background_rgba" event-GdkWindow rgba) - (free rgba)) - unspecific)) (define (unrealize-callback widget) @@ -263,6 +255,12 @@ Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. (layout (gtk-widget-create-pango-layout widget "")) (title (string-append "Event Window (0x" (alien/address-string event-window)")"))) + + (cairo-save cr) + (cairo-set-source-color cr (->color "white" 'paint-event-window)) + (cairo-paint cr) + (cairo-restore cr) + (pango-layout-set-text layout title) (pango-layout-get-pixel-extents layout diff --git a/src/gtk/gtk-widget.scm b/src/gtk/gtk-widget.scm index 7ff195fb7..b36094fa1 100644 --- a/src/gtk/gtk-widget.scm +++ b/src/gtk/gtk-widget.scm @@ -158,10 +158,6 @@ Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. (guarantee-gtk-widget widget 'gtk-widget-drawable?) (not (zero? (C-call "gtk_widget_is_drawable" (gobject-alien widget))))) -(define (gtk-widget-is-composited? widget) - (guarantee-gtk-widget widget 'gtk-widget-is-composited?) - (not (zero? (C-call "gtk_widget_is_composited" (gobject-alien widget))))) - (define (gtk-widget-grab-focus widget) (guarantee-gtk-widget widget 'gtk-widget-grab-focus) (C-call "gtk_widget_grab_focus" (gobject-alien widget))) diff --git a/src/gtk/gtk.pkg b/src/gtk/gtk.pkg index bba7a5639..2679efbd4 100644 --- a/src/gtk/gtk.pkg +++ b/src/gtk/gtk.pkg @@ -47,8 +47,6 @@ Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. (import (glib main) maybe-yield-glib) (export (gtk) - gdk-cairo-create - gdk-window-process-updates make-pixbuf-loader load-pixbuf-from-port load-pixbuf-from-file pixbuf-loader-size-hook set-pixbuf-loader-size-hook! @@ -70,7 +68,6 @@ Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. gtk-widget-parent gtk-widget-realized? gtk-widget-drawable? gtk-widget-has-focus? - gtk-widget-is-composited? gtk-widget-grab-focus gtk-widget-show gtk-widget-show-all diff --git a/src/gtk/gtk.texi b/src/gtk/gtk.texi index 2b6b779a7..16ba4f2fd 100644 --- a/src/gtk/gtk.texi +++ b/src/gtk/gtk.texi @@ -541,16 +541,10 @@ the widget will likely fail and cause critical warnings. @code{#t} if @var{widget} has the keyboard. @end deffn -@anchor{gtk-widget-is-composited?} -@deffn Procedure gtk-widget-is-composited? widget -@code{#t} if @var{widget} has an alpha channel. -@end deffn - @deffn Procedure gtk-widget-set-opacity widget opacity Request a partially transparent @var{widget}. @var{Opacity} can vary from 0.0 (fully transparent) to 1.0 (fully opaque). On X11 the request has no effect without a compositing manager. -@xref{gtk-widget-is-composited?}. Note that setting a window's opacity after the window has been shown causes it to flicker once on Windows. @@ -1985,17 +1979,6 @@ widgets. @node Gdk Functions, Debugging Facilities, Fix Layout, API Reference @section Gdk Functions -@deffn Procedure gdk-cairo-create window -Creates a cairo context targeting @var{window}. -@end deffn - -@deffn Procedure gdk-window-process-updates window children-too? -Force expose events to be delivered immediately and synchronously to -@var{window}. This is occasionally useful, e.g. to produce nicer -scrolling behavior. @var{Children-too?} should be @code{#f} to avoid -sending expose events to child windows. -@end deffn - @anchor{gdk-key-state->char-bits} @deffn Procedure gdk-key-state->char-bits modifier-state A bitmap of char-bits (char-bit:control, char-bit:meta,