+++ /dev/null
-#| -*-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)))
;(include "pangocairo")
-(extern (* cairo_t) gdk_cairo_create
- (window (* GdkWindow)))
-
(extern void gdk_cairo_set_source_pixbuf
(cr (* cairo_t))
(pixbuf (* (const GdkPixbuf)))
(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))
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
(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))
(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)))
(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!)
;;;; 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)))
(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)
(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
(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)))
(import (glib main)
maybe-yield-glib)
(export (gtk)
- gdk-cairo-create
- gdk-window-process-updates
<pixbuf-loader> make-pixbuf-loader
load-pixbuf-from-port load-pixbuf-from-file
pixbuf-loader-size-hook set-pixbuf-loader-size-hook!
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
@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.
@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,