Gtk changes: new <fix-widget> factored from <fix-layout>.
authorMatt Birkholz <matt@birkholz.chandler.az.us>
Fri, 30 Sep 2011 05:20:17 +0000 (22:20 -0700)
committerMatt Birkholz <matt@birkholz.chandler.az.us>
Fri, 30 Sep 2011 05:20:17 +0000 (22:20 -0700)
src/gtk-screen/gtk-screen.pkg
src/gtk-screen/gtk-screen.scm

index 4e33dbc8a23af4a3a35704f04c88e6ef78a289d0..f9dd3e6d41e4b163df6d630578ed14a8365e0d81 100644 (file)
@@ -87,12 +87,9 @@ USA.
          gtk-object-destroy-callback
          gtk-container-reverse-children)
   (import (gtk fix-layout)
+         fix-widget-geometry
+
          drawing-damage
-         fix-layout-new-geometry-callback
-         fix-layout-realize-callback
-         fix-layout-window
-         fix-layout-geometry
-         fix-layout-scroll-nw!
          fix-drawing-display-list
          fix-drawing-extent
          fix-ink-expose-callback
@@ -157,17 +154,23 @@ USA.
          pango-font-metrics-get-approximate-char-width
          pango-font-metrics-unref
 
+         fix-widget?
+         fix-widget-new-geometry-callback fix-widget-realize-callback
+         set-fix-widget-size!
+         set-fix-widget-map-handler!
+         set-fix-widget-unmap-handler!
+         set-fix-widget-enter-notify-handler!
+         set-fix-widget-leave-notify-handler!
+         set-fix-widget-focus-change-handler!
+         set-fix-widget-visibility-notify-handler!
+         set-fix-widget-key-press-handler!
+         set-fix-widget-motion-handler!
+         set-fix-widget-button-handler!
+
          <fix-layout> fix-layout?
-         fix-layout-drawing set-fix-layout-drawing! set-fix-layout-size!
+         fix-layout-view fix-layout-drawing set-fix-layout-drawing!
          fix-layout-scroll-step set-fix-layout-scroll-step!
-         fix-layout-view fix-layout-scroll-to!
-         set-fix-layout-map-handler!
-         set-fix-layout-unmap-handler!
-         set-fix-layout-focus-change-handler!
-         set-fix-layout-visibility-notify-handler!
-         set-fix-layout-key-press-handler!
-         ;;set-fix-layout-motion-handler!
-         ;;set-fix-layout-button-release-handler!
+         fix-layout-scroll-to! fix-layout-scroll-nw!
 
          <fix-drawing> guarantee-fix-drawing
          make-fix-drawing fix-drawing-widgets
index dca6e44e625016010d7cb61c7e6571af13f29254..44592a1e229642b4d98cfe5e22d26dab0b4c98c4 100644 (file)
@@ -795,7 +795,7 @@ USA.
                 (re-pack-windows! windows box (cdr widgets) prefix)))))))
 
     (define (re-size! widget window)
-      (let ((area (fix-layout-geometry widget))
+      (let ((area (fix-widget-geometry widget))
            (window-x-size (%text-x-size window))
            (window-y-size (%text-y-size window)))
        (let ((width (fix-rect-width area))
@@ -814,7 +814,7 @@ USA.
                              "("width"x"height")"
                              " to "window-x-size"x"window-y-size" "
                              "("new-width"x"new-height")\n")
-                     (set-fix-layout-size! widget new-width new-height))))))))
+                     (set-fix-widget-size! widget new-width new-height))))))))
 
     (define (pack-new! box window prefix)
       (%trace ";     "prefix"pack-new! "window" in "box"\n")
@@ -981,11 +981,11 @@ USA.
                               (fix-rect-height extent))))
     (set-text-widget-override-drawing! widget drawing)
     (set-fix-layout-drawing! widget drawing 0 0))
-  (set-fix-layout-map-handler! widget map-handler)
-  (set-fix-layout-unmap-handler! widget unmap-handler)
-  (set-fix-layout-focus-change-handler! widget focus-change-handler)
-  (set-fix-layout-visibility-notify-handler! widget visibility-notify-handler)
-  (set-fix-layout-key-press-handler! widget key-press-handler)
+  (set-fix-widget-map-handler! widget map-handler)
+  (set-fix-widget-unmap-handler! widget unmap-handler)
+  (set-fix-widget-focus-change-handler! widget focus-change-handler)
+  (set-fix-widget-visibility-notify-handler! widget visibility-notify-handler)
+  (set-fix-widget-key-press-handler! widget key-press-handler)
   widget)
 
 (define-method gtk-object-destroy-callback ((widget <text-widget>))
@@ -1003,9 +1003,9 @@ USA.
     (gobject-unref! layout))
   unspecific)
 
-(define-method fix-layout-realize-callback ((widget <text-widget>))
-  (%trace ";(fix-layout-realize-callback <text-widget>) "widget"\n")
-  (let ((geometry (fix-layout-geometry widget)))
+(define-method fix-widget-realize-callback ((widget <text-widget>))
+  (%trace ";(fix-widget-realize-callback <text-widget>) "widget"\n")
+  (let ((geometry (fix-widget-geometry widget)))
     (if (or (not (fix-rect-width geometry))
            (not (fix-rect-height geometry)))
        ;; Unfortunately a widget can be realized before it is
@@ -1025,8 +1025,8 @@ USA.
   (set-gtk-widget-fg-color! widget (gtk-widget-text-color widget))
   (set-gtk-widget-bg-color! widget (gtk-widget-base-color widget)))
 
-(define-method fix-layout-new-geometry-callback ((widget <text-widget>))
-  (%trace ";(fix-layout-new-geometry-callback <text-widget>) "widget"\n")
+(define-method fix-widget-new-geometry-callback ((widget <text-widget>))
+  (%trace ";(fix-widget-new-geometry-callback <text-widget>) "widget"\n")
   (call-next-method widget)
   (thread-queue/queue-no-hang!
    event-queue
@@ -1034,7 +1034,7 @@ USA.
     'SET-WINDOW-SIZE
     (lambda (widget)
       (%trace ";  input event: set-window-size "widget"\n")
-      (let ((geometry (fix-layout-geometry widget))
+      (let ((geometry (fix-widget-geometry widget))
            (screen (edwin-widget-screen widget))
            (window (text-widget-buffer-frame widget)))
        (let ((widget-x-size (width->x-size screen (fix-rect-width geometry)))
@@ -1176,16 +1176,16 @@ USA.
                               (fix-rect-width extent)
                               (fix-rect-height extent))))
     (set-fix-layout-drawing! widget drawing 0 0))
-  (set-fix-layout-map-handler! widget map-handler)
-  (set-fix-layout-unmap-handler! widget unmap-handler)
-  (set-fix-layout-focus-change-handler! widget focus-change-handler)
-  (set-fix-layout-visibility-notify-handler! widget visibility-notify-handler)
-  (set-fix-layout-key-press-handler! widget key-press-handler)
+  (set-fix-widget-map-handler! widget map-handler)
+  (set-fix-widget-unmap-handler! widget unmap-handler)
+  (set-fix-widget-focus-change-handler! widget focus-change-handler)
+  (set-fix-widget-visibility-notify-handler! widget visibility-notify-handler)
+  (set-fix-widget-key-press-handler! widget key-press-handler)
   widget)
 
-(define-method fix-layout-realize-callback ((widget <modeline-widget>))
-  (%trace ";(fix-layout-realize-callback <modeline-widget>) "widget"\n")
-  (let ((geometry (fix-layout-geometry widget)))
+(define-method fix-widget-realize-callback ((widget <modeline-widget>))
+  (%trace ";(fix-widget-realize-callback <modeline-widget>) "widget"\n")
+  (let ((geometry (fix-widget-geometry widget)))
     (if (or (not (fix-rect-width geometry))
            (not (fix-rect-height geometry)))
        ;; Unfortunately a widget can be realized before it is