]> Pileus Git - ~andy/gtk/commitdiff
allow shrinking the image window to test that we clip to allocation.
authorHavoc Pennington <hp@redhat.com>
Wed, 18 Apr 2001 19:56:48 +0000 (19:56 +0000)
committerHavoc Pennington <hp@src.gnome.org>
Wed, 18 Apr 2001 19:56:48 +0000 (19:56 +0000)
2001-04-18  Havoc Pennington  <hp@redhat.com>

* tests/testgtk.c (create_image): allow shrinking the image window
to test that we clip to allocation.

* gtk/gtkimage.c (gtk_image_expose): clip to allocation,
#9845

* gtk/gtkenums.h: move GtkWrapMode in here, #50472

ChangeLog
ChangeLog.pre-2-0
ChangeLog.pre-2-10
ChangeLog.pre-2-2
ChangeLog.pre-2-4
ChangeLog.pre-2-6
ChangeLog.pre-2-8
gtk/gtkenums.h
gtk/gtkimage.c
gtk/gtktexttag.h
tests/testgtk.c

index 8b6a4c326929879c0cebe8015c947777386f7508..6a0b4c146a7818fdf34a8ba6a5ed8e7dbe371891 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2001-04-18  Havoc Pennington  <hp@redhat.com>
+
+       * tests/testgtk.c (create_image): allow shrinking the image window
+       to test that we clip to allocation.
+
+       * gtk/gtkimage.c (gtk_image_expose): clip to allocation,
+       #9845
+
+       * gtk/gtkenums.h: move GtkWrapMode in here, #50472
+
 Wed Apr 18 14:23:14 2001  Owen Taylor  <otaylor@redhat.com>
 
        * gdk/x11/gdkimage-x11.c (gdk_image_new): Try changing
index 8b6a4c326929879c0cebe8015c947777386f7508..6a0b4c146a7818fdf34a8ba6a5ed8e7dbe371891 100644 (file)
@@ -1,3 +1,13 @@
+2001-04-18  Havoc Pennington  <hp@redhat.com>
+
+       * tests/testgtk.c (create_image): allow shrinking the image window
+       to test that we clip to allocation.
+
+       * gtk/gtkimage.c (gtk_image_expose): clip to allocation,
+       #9845
+
+       * gtk/gtkenums.h: move GtkWrapMode in here, #50472
+
 Wed Apr 18 14:23:14 2001  Owen Taylor  <otaylor@redhat.com>
 
        * gdk/x11/gdkimage-x11.c (gdk_image_new): Try changing
index 8b6a4c326929879c0cebe8015c947777386f7508..6a0b4c146a7818fdf34a8ba6a5ed8e7dbe371891 100644 (file)
@@ -1,3 +1,13 @@
+2001-04-18  Havoc Pennington  <hp@redhat.com>
+
+       * tests/testgtk.c (create_image): allow shrinking the image window
+       to test that we clip to allocation.
+
+       * gtk/gtkimage.c (gtk_image_expose): clip to allocation,
+       #9845
+
+       * gtk/gtkenums.h: move GtkWrapMode in here, #50472
+
 Wed Apr 18 14:23:14 2001  Owen Taylor  <otaylor@redhat.com>
 
        * gdk/x11/gdkimage-x11.c (gdk_image_new): Try changing
index 8b6a4c326929879c0cebe8015c947777386f7508..6a0b4c146a7818fdf34a8ba6a5ed8e7dbe371891 100644 (file)
@@ -1,3 +1,13 @@
+2001-04-18  Havoc Pennington  <hp@redhat.com>
+
+       * tests/testgtk.c (create_image): allow shrinking the image window
+       to test that we clip to allocation.
+
+       * gtk/gtkimage.c (gtk_image_expose): clip to allocation,
+       #9845
+
+       * gtk/gtkenums.h: move GtkWrapMode in here, #50472
+
 Wed Apr 18 14:23:14 2001  Owen Taylor  <otaylor@redhat.com>
 
        * gdk/x11/gdkimage-x11.c (gdk_image_new): Try changing
index 8b6a4c326929879c0cebe8015c947777386f7508..6a0b4c146a7818fdf34a8ba6a5ed8e7dbe371891 100644 (file)
@@ -1,3 +1,13 @@
+2001-04-18  Havoc Pennington  <hp@redhat.com>
+
+       * tests/testgtk.c (create_image): allow shrinking the image window
+       to test that we clip to allocation.
+
+       * gtk/gtkimage.c (gtk_image_expose): clip to allocation,
+       #9845
+
+       * gtk/gtkenums.h: move GtkWrapMode in here, #50472
+
 Wed Apr 18 14:23:14 2001  Owen Taylor  <otaylor@redhat.com>
 
        * gdk/x11/gdkimage-x11.c (gdk_image_new): Try changing
index 8b6a4c326929879c0cebe8015c947777386f7508..6a0b4c146a7818fdf34a8ba6a5ed8e7dbe371891 100644 (file)
@@ -1,3 +1,13 @@
+2001-04-18  Havoc Pennington  <hp@redhat.com>
+
+       * tests/testgtk.c (create_image): allow shrinking the image window
+       to test that we clip to allocation.
+
+       * gtk/gtkimage.c (gtk_image_expose): clip to allocation,
+       #9845
+
+       * gtk/gtkenums.h: move GtkWrapMode in here, #50472
+
 Wed Apr 18 14:23:14 2001  Owen Taylor  <otaylor@redhat.com>
 
        * gdk/x11/gdkimage-x11.c (gdk_image_new): Try changing
index 8b6a4c326929879c0cebe8015c947777386f7508..6a0b4c146a7818fdf34a8ba6a5ed8e7dbe371891 100644 (file)
@@ -1,3 +1,13 @@
+2001-04-18  Havoc Pennington  <hp@redhat.com>
+
+       * tests/testgtk.c (create_image): allow shrinking the image window
+       to test that we clip to allocation.
+
+       * gtk/gtkimage.c (gtk_image_expose): clip to allocation,
+       #9845
+
+       * gtk/gtkenums.h: move GtkWrapMode in here, #50472
+
 Wed Apr 18 14:23:14 2001  Owen Taylor  <otaylor@redhat.com>
 
        * gdk/x11/gdkimage-x11.c (gdk_image_new): Try changing
index 43e290f286ffbc626101748909204093f43cc8f0..1758048ffdc87dd2e464fa93293b049951caa190 100644 (file)
@@ -363,6 +363,14 @@ typedef enum
   GTK_WINDOW_POPUP
 } GtkWindowType;
 
+/* Text wrap */
+typedef enum
+{
+  GTK_WRAP_NONE,
+  GTK_WRAP_CHAR,
+  GTK_WRAP_WORD
+} GtkWrapMode;
+
 /* How to sort */
 typedef enum
 {
index 03f5fe0b6882d6d0dab9bd81a4551b35fa1b7b77..81f0debc188ceed40ef69e3b06b255466533f1a4 100644 (file)
@@ -790,9 +790,9 @@ gtk_image_expose (GtkWidget      *widget,
 
       area = event->area;
       
-      if (gdk_rectangle_intersect (&image_bound, &area, &intersection))
+      if (gdk_rectangle_intersect (&area, &widget->allocation, &area) &&
+          gdk_rectangle_intersect (&image_bound, &area, &image_bound))
         {
-
           switch (image->storage_type)
             {
             case GTK_IMAGE_PIXMAP:
index 5d5678359791da5b9ce32d7cb91878e5e824a703..ea30059b75cccb862ab024f49c4206f82321adeb 100644 (file)
@@ -12,13 +12,6 @@ typedef struct _GtkTextIter GtkTextIter;
 typedef struct _GtkTextBTreeNode GtkTextBTreeNode;
 typedef struct _GtkTextTagTable GtkTextTagTable;
 
-typedef enum
-{
-  GTK_WRAP_NONE,
-  GTK_WRAP_CHAR,
-  GTK_WRAP_WORD
-} GtkWrapMode;
-
 typedef struct _GtkTextAttributes GtkTextAttributes;
 
 #define GTK_TYPE_TEXT_TAG            (gtk_text_tag_get_type ())
index 6e149dc5dc16508a66c7552b9c02930a4d1c77a8..335024b8d21f5723ca2c1cffe3168c1bbcbf6af3 100644 (file)
@@ -2758,6 +2758,10 @@ create_image (void)
       GdkBitmap *mask;
         
       window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
+      /* this is bogus for testing drawing when allocation < request,
+       * don't copy into real code
+       */
+      gtk_window_set_policy (GTK_WINDOW (window), TRUE, TRUE, FALSE);
       
       gtk_signal_connect (GTK_OBJECT (window), "destroy",
                          GTK_SIGNAL_FUNC(gtk_widget_destroyed),