Commit Graph

1391 Commits

Author SHA1 Message Date
Benjamin Otte
2a1650843d Revert "testgtk: Remove snapshot test"
This reverts commit 99c82af20a and fixes
up things to compile again. Of course, the snapshotting now uses
gtk_widget_draw() instead.
2010-10-05 23:22:55 +02:00
Michael Natterer
a472d1a400 tests: don't call gtk_widget_get_allocation() on NULL children 2010-10-05 13:05:56 +02:00
Javier Jardón
e141bd3287 testtext: Use gtk_widget_destroy() instead gtk_object_destroy() 2010-09-29 05:58:02 +02:00
Javier Jardón
b072ea220c Remove unneded casts
As gtk_adjustment_new() returns a GtkAdjustment* now

https://bugzilla.gnome.org/show_bug.cgi?id=630731
2010-09-29 01:18:10 +02:00
Javier Jardón
42f480a537 gtk_adjustment_new() should return a GtkAdjustment*
Fixes https://bugzilla.gnome.org/show_bug.cgi?id=630731
2010-09-29 01:18:10 +02:00
Benjamin Otte
bf81be51eb testgtk: Use gtk_widget_set_visual() 2010-09-28 19:11:46 +02:00
Tristan Van Berkom
7047502d84 Fix erroneous usage of height-for-width apis in gtk_widget_real_adjust_size_allocation().
When fitting a widget into its allocation, the second dimension
is always dependent on the first, so gtk_widget_get_preferred_size()
cannot be used directly (because we want the natural height for
the allocated width, not the natural height for the natural width,
which is generally a smaller height than the height-for-minimum-width
or height-for-allocated-width).

Added test to testadjustsize to ensure proper behaviour.
2010-09-27 21:15:16 +09:00
Tristan Van Berkom
e4a0a39a56 Fixing tests/ build for removal of GtkObject type. 2010-09-27 15:10:23 +09:00
Matthias Clasen
f53ad33994 Remove GtkObject completely 2010-09-26 22:18:19 -04:00
Javier Jardón
3b8184cfee Move classes that currently derive from GtkObject to GInitiallyUnowned 2010-09-26 22:18:13 -04:00
Benjamin Otte
f15860fb31 tests: Port testadjustsize to draw vfunc 2010-09-27 00:50:14 +02:00
Benjamin Otte
d9c9259861 Move GtkSizeRequest into GtkWidget
It doesn't make sense to keep them separate as GtkSizeRequest requires a
GtkWidget and GtkWidget implements GtkSizeRequest, so you can never have
one without the other.
It also makes the code a lot easier because no casts are required when
calling functions.

Also, the names would translate to gtk_widget_get_width() and people
agreed that this would be a too generic name, so a "preferred" was added
to the names.

So this patch moves the functions:
gtk_size_request_get_request_mode() => gtk_widget_get_request_mode()
gtk_size_request_get_width() => gtk_widget_get_preferred_width()
gtk_size_request_get_height() => gtk_widget_get_preferred_height()
gtk_size_request_get_size() => gtk_widget_get_preferred_size()
gtk_size_request_get_width_for_height() =>
  gtk_widget_get_preferred_width_for_height()
gtk_size_request_get_height_for_width() =>
  gtk_widget_get_preferred_height_for_width()
... and moves the corresponding vfuncs to the GtkWidgetClass.

The patch also renames the implementations of the vfuncs in widgets to
include the word "preferrred".
2010-09-26 15:11:45 +02:00
Benjamin Otte
aa70d351c4 tests: Get rid of gdk_drawable_get_size() usage in testwindows 2010-09-26 15:11:45 +02:00
Benjamin Otte
cdba1f6519 tests: Get rid of gdk_drawable_get_size() usage in offscreenbox 2010-09-26 15:11:45 +02:00
Benjamin Otte
15497825c0 testgtk: Get rid of gdk_drawable_get_size() usage 2010-09-26 15:11:44 +02:00
Benjamin Otte
1d3f6b30b0 API: Rename gtk_cairo_paint_*() to gtk_paint_*()
Large patch, but just renaming.
Indentation should still mostly be correct because I took care of
keeping the indentation for this function name.
2010-09-26 15:11:42 +02:00
Benjamin Otte
45836db7a5 test: Port offscreen test to draw vfunc 2010-09-26 15:11:42 +02:00
Benjamin Otte
e194bc14fd testgtk: Use draw signal in layout test 2010-09-26 15:11:42 +02:00
Benjamin Otte
5442f5b9f2 testgtk: Use draw signal in scrolling test 2010-09-26 15:11:42 +02:00
Benjamin Otte
0ab6956579 testgtk: Use draw signal in cursors example 2010-09-26 15:11:41 +02:00
Benjamin Otte
87940287aa testgtk: Remove non-existing property from frame constructor 2010-09-26 15:11:41 +02:00
Benjamin Otte
38c932ace6 testgtk: Use draw signal in gridded geometry example 2010-09-26 15:11:41 +02:00
Benjamin Otte
c42f6ff4bf testgtk: Make big windows test not use expose events
Instead, use gdk_window_set_background().
2010-09-26 15:11:41 +02:00
Benjamin Otte
e1571a5936 testgtk: Use draw signal in resize grips example 2010-09-26 15:11:41 +02:00
Benjamin Otte
ba21d3e687 tests: Use draw vfunc in print-editor 2010-09-26 15:11:41 +02:00
Benjamin Otte
e65b1cfd76 testoffscreen: Connect to draw signal 2010-09-26 15:11:41 +02:00
Benjamin Otte
9cd83da6dc tests: Use draw signal in testinput 2010-09-26 15:11:41 +02:00
Benjamin Otte
c6f28c3dbc testtooltips: Connect to draw signal 2010-09-26 15:11:41 +02:00
Benjamin Otte
07d0c0b921 testtooltips: Don't call gdk_window_get_pointer() in expose events 2010-09-26 15:11:41 +02:00
Benjamin Otte
b8ebcdd0e0 testgtk: Connect to draw signal in "rotated text" example 2010-09-26 15:11:41 +02:00
Benjamin Otte
7af767333e testgtk: Connect to draw signals in "composited window" example 2010-09-26 15:11:41 +02:00
Benjamin Otte
ec604d11ec testgtk: Connect to draw signal in alpha test
Test still behaves weird, no idea why though.
2010-09-26 15:11:41 +02:00
Benjamin Otte
dfd0ceab1c tests: Connect to draw signal in testimage 2010-09-26 15:11:40 +02:00
Benjamin Otte
f8b420783d tests: Connect to draw signal in testoffscreenwindow 2010-09-26 15:11:40 +02:00
Benjamin Otte
0ad2f57332 tests: Connect to draw signal in testellipsise
The test seems broken, not sure why.
2010-09-26 15:11:40 +02:00
Benjamin Otte
9c980372d2 testcairo: Connect to draw signal 2010-09-26 15:11:40 +02:00
Benjamin Otte
c85f91e14c tests: Remove ability to set backend from testfilechooser
There's no backends anymore
2010-09-26 15:11:35 +02:00
Benjamin Otte
fc52c9daf3 testgtk: Check visual, not colormap for RGBA availability 2010-09-26 15:11:32 +02:00
Benjamin Otte
d7ede44dae testgtk: gtk_widget_set_colormap() => gtk_window_set_visual() 2010-09-26 15:11:32 +02:00
Benjamin Otte
600f52321b tests: Don't set colormap when creating offscreen windows 2010-09-26 15:11:31 +02:00
Benjamin Otte
08e6fc11ad testgtk: Don't set colormap when creating GDK windows 2010-09-26 15:11:31 +02:00
Benjamin Otte
a38472c139 testgtk: No need to set a custom colourmap here 2010-09-26 15:11:31 +02:00
Benjamin Otte
c340fb7efd tests: No need to allocate colors anymore 2010-09-26 15:11:31 +02:00
Benjamin Otte
6607f2b794 API: Rename gdk_set_source_pixmap() to gdk_set_source_window()
That's what it's used for now.
2010-09-26 15:11:30 +02:00
Benjamin Otte
332652f702 API: Change offscreen windows to use a cairo_surface_t
This requires changes to all the offscreen surface getters that used to
return a GdkPixmap before.
2010-09-26 15:11:29 +02:00
Benjamin Otte
19bad9fecc tests: Convert testinput to use cairo_surface_t 2010-09-26 15:11:11 +02:00
Benjamin Otte
039e0c273a testoffscreen: Remove unused code 2010-09-26 15:11:11 +02:00
Benjamin Otte
99c82af20a testgtk: Remove snapshot test
gtk_widget_get_snapshot is on its way out.

The test can be added back once we have gtk_widget_draw(), but until
then, there's no way to take snapshots.
2010-09-26 15:04:02 +02:00
Benjamin Otte
806a7239ae widget: shape_combine_mask => shape_cobine_region
Replace gtk_widget_shape_combine_region() with
gtk_widget_shape_combine_mask() and
gtk_widget_input_shape_combine_region() with
gtk_widget_input_shape_combine_mask().
As GdkBitmap is going away, and the region equivalents already exist,
this seems like pretty much the default step to take.

Includes code to fix up the users.
2010-09-26 15:02:59 +02:00
Benjamin Otte
dceb149ca4 testgtk: Convert WM hints example to use gdk_window_set_icon_list()
gdk_window_set_icon() is about to go away.

Also removes the circles.xbm file and uses the oncluded openfile logo
instead.
2010-09-26 15:02:59 +02:00
Matthias Clasen
8578ff4b38 Remove gtk_notebook_set_window_creation_hook in testnotebookdnd.c 2010-09-24 11:53:20 -04:00
Matthias Clasen
3c19eea34b GtkNotebook: replace group by group_name
Dealing with bare pointers is problematic for language bindings,
using interned strings is much more straightforward and more than
good enough for what is needed here.

http://bugzilla.gnome.org/show_bug.cgi?id=630521
2010-09-24 11:13:30 -04:00
Javier Jardón
fb62d6105f Do not disable deprecation guards 2010-09-22 04:21:13 +02:00
Tristan Van Berkom
e976abe825 Split up GtkWrapBox:spreading property into two orientation specific properties.
Now GtkWrapBox has "horizontal-spreading" and "vertical-spreading" options,
before GtkWrapBox never spread out children across the opposing orientation
(i.e. it never grew "lines" larger then their natural width, they would
act as if set to GTK_WRAP_BOX_SPREAD_START, now they are completely configurable).
2010-09-21 22:00:54 +09:00
Owen W. Taylor
14e38da150 Only store error codes in inner-most X error trap
When an error occurs with nested traps in place, only the innermost
trap should have the error code stored in it; outer traps are
shielded by the inner trap.

https://bugzilla.gnome.org/show_bug.cgi?id=629608
2010-09-20 16:35:41 -04:00
Havoc Pennington
e32ab82069 Improve tests for X error traps, fix two bugs
* don't lose track of previous X error handler
  if nested traps are pushed
* free any remaining traps when display
  is finalized

Test will fail unless bug 630032 is closed so
gdk_display_close() works.

https://bugzilla.gnome.org/show_bug.cgi?id=630033
2010-09-18 23:03:31 -04:00
Matthias Clasen
4f3e5e6ebc Add some minimal test for X error traps 2010-09-18 18:18:36 -04:00
Matthias Clasen
2f78aa3024 Rename h/v-align to h/valign
And adjust the getters and setters to match. Also include some
documentation by Havoc Pennington about adjustment of size requests
and allocations.
2010-09-15 20:14:56 -04:00
Tristan Van Berkom
896e249e8f Added a default size of a magic number to testwrapbox.c
This was added to the test only for the sake of making it
easier to reproduce a bug with scrolled windows (bug 629778).

Expected behaviour: The vertical scrollbar should dissapear as soon
as the required height for the full allocation width (without any
vertical scrollbar) is small enough to not need a scrollbar.
2010-09-16 01:41:53 +09:00
Javier Jardón
b140884fec Use gtk_size_request_get_size() instead deprecated gtk_widget_size_request()
Fixes https://bugzilla.gnome.org/show_bug.cgi?id=629598

Signed-off-by: Javier Jardón <jjardon@gnome.org>
Signed-off-by: Tristan Van Berkom <tristanvb@openismus.com>
2010-09-15 03:02:58 +02:00
Matthias Clasen
b64e91adf0 Remove fill options from GtkWrapBox
GtkWidget alignment properties make this unnecessary in new containers.
2010-09-13 18:47:59 -04:00
Matthias Clasen
0e484a83d1 Remove padding from GtkWrapBox
GtkWidget margins make this unnecessary in new containers.
2010-09-13 18:47:58 -04:00
Javier Jardón
9e81022bf6 Use gtk_size_request_get_size() instead deprecated gtk_widget_get_child_requisition()
Fixes https://bugzilla.gnome.org/show_bug.cgi?id=629177
2010-09-13 21:26:01 +02:00
Tristan Van Berkom
96c3858b21 Make testwrapbox scrolled window scrollbars automatic.
Did this in the hope to reproduce infinite recursion bugs
with height-for-width in scrolled windows (see complex bgo #611740
for reference for now).
2010-09-14 02:32:36 +09:00
Havoc Pennington
1dc9451b57 Add padding and alignment tests to testadjustsize.c 2010-09-12 21:47:10 -04:00
Havoc Pennington
dc1940e99e Add testadjustsize test, to test new adjust size methods and related features
This will test size adjust, and interactions with other padding and border
2010-09-12 21:47:10 -04:00
Tor Lillqvist
dd36afc207 Don't use the same name for a function that used to be a variable
Rename the gtk_major_version() etc functions I introduced yesterday to
start with gtk_get. Avoids misleading results in client programs whose
developers that don't notice the change or the compiler warnings, and
when recompiling against gtk3 then use the function addresses as the
version numbers.
2010-09-09 11:06:26 +03:00
Colin Walters
913cdf3be7 GDK: Prefix key names with KEY_
The keysyms create a lot of potential namespace conflicts for
C, and are especially problematic for introspection, where we take
constants into the namespace, so GDK_Display conflicts with GdkDisplay.

For C application compatiblity, add gdkkeysyms-compat.h which uses
the old names.

Just one user in GTK+ continues to use gdkkeysyms-compat.h, which is
the gtkimcontextsimple.c, since porting that requires porting more
custom Perl code.
2010-09-08 18:51:44 -04:00
Tor Lillqvist
cb24bcc613 Turn the gtk version and age variables into functions
Having variables exported from a DLL is slightly painful and
potentially error-prone on Windows, so let's try get rid of them now
when we can. Starting with these.
2010-09-08 21:31:33 +03:00
Javier Jardón
4e6a665e61 tests: Use gtk_widget_set_size_request() instead gtk_widget_set_usize() 2010-09-08 18:39:36 +02:00
Benjamin Otte
fc46f2ca2f tests: Remove all code relating to the blink menu item 2010-09-03 13:38:29 +02:00
Matthias Clasen
18b47b6cd0 Remove blinking from status icons
This feature was just a bad idea.
2010-09-02 09:37:06 -04:00
Matthias Clasen
76b21033f9 Adapt tests to dialog api change 2010-09-02 09:31:54 -04:00
Tristan Van Berkom
68568cff66 Enhanced/Simplified GtkWrapBox api as per Havoc's comments.
Made an enum GtkWrapBoxPacking for the expand/fill horizontal/vertical
boolean options... changed xpadding/ypadding to be horizontal-padding
and vertical-padding for a more consistent api and better readablility.
2010-09-02 15:36:36 +09:00
Tristan Van Berkom
c9ccc7551b Some api changes for GtkWrapBox
Ammended documentation for GTK_WRAP_BOX_SPREAD_EVEN and renamed
GTK_WRAP_BOX_SPREAD_BEGIN -> GTK_WRAP_BOX_SPREAD_START.
2010-09-02 14:22:55 +09:00
Matthias Clasen
6b5672c199 Remove now unused GtkProgressBarOrientation enum 2010-09-01 23:30:21 -04:00
Matthias Clasen
3302f22da2 Adapt testgtk progressbar test to api changes 2010-09-01 23:26:19 -04:00
Tristan Van Berkom
bbf38a8ebd Fixing email address in copyright header for testwrapbox test. 2010-08-30 18:24:41 +09:00
Tristan Van Berkom
deaa351630 Added initial revision of GtkWrapBox container widget and test case. 2010-08-28 16:01:59 +09:00
Javier Jardón
72fad93587 tests/testsocket: Fix broken test
Fixes https://bugzilla.gnome.org/show_bug.cgi?id=627867
2010-08-24 23:49:21 +02:00
Javier Jardón
a0e0c9e89c tests/testgtk.c: Use accessor functions to access GtkWindow 2010-08-23 20:17:41 +02:00
Javier Jardón
c8afa3f000 tests/testxinerama.c: Use accessor functions to access GtkWidget 2010-08-22 18:31:12 +02:00
Javier Jardón
bd52a8541e tests/testwindows.c: Use accessor functions to access GtkWidget 2010-08-22 18:31:06 +02:00
Javier Jardón
42c71a1d4a tests/testtooltips.c: Use accessor functions to access GtkWidget 2010-08-22 18:30:58 +02:00
Javier Jardón
f332976871 tests/testsocket_common.c: Use accessor functions to access GtkWidget 2010-08-22 18:30:51 +02:00
Javier Jardón
b012f0f930 tests/testsocket.c: Use accessor functions to access GtkWidget 2010-08-22 18:30:44 +02:00
Javier Jardón
07e38c51e8 tests/testselection.c: Use accessor functions to access GtkWidget 2010-08-22 18:30:37 +02:00
Javier Jardón
1577a7d415 tests/testoffscreenwindow.c: Use accessor functions to access GtkWidget 2010-08-22 18:30:31 +02:00
Javier Jardón
26d837dd2f tests/testoffscreen.c: Use accessor functions to access GtkWidget 2010-08-22 18:30:23 +02:00
Javier Jardón
0059a30f0d tests/testinput.c: Use accessor functions to access GtkWidget 2010-08-22 18:30:17 +02:00
Javier Jardón
4a9c3bc214 tests/testiconview-keynav.c: Use accessor functions to access GtkWidget 2010-08-22 18:30:10 +02:00
Javier Jardón
252a8fc048 tests/testgtk.c: Use accessor functions to access GtkWidget 2010-08-22 18:30:03 +02:00
Javier Jardón
1b7b30bf31 tests/testframe.c: Use accessor functions to access GtkWidget 2010-08-22 18:29:56 +02:00
Javier Jardón
4210ec87b0 tests/testellipsise.c: Use accessor functions to access GtkWidget 2010-08-22 18:29:49 +02:00
Javier Jardón
067f418604 tests/testcairo.c: Use accessor functions to access GtkWidget 2010-08-22 18:29:42 +02:00
Javier Jardón
40dbb2deb2 tests/print-editor.c: Use accessor functions to access GtkWidget 2010-08-22 18:29:35 +02:00
Javier Jardón
5d48658f58 tests/gtkoffscreenbox.c: Use accessor functions to access GtkWidget 2010-08-22 18:29:28 +02:00
Javier Jardón
9016f0d9a6 Use standard icon names in demos and tests 2010-08-21 03:08:15 +02:00
Tristan Van Berkom
d73c11b549 Added test case to testheightforwidth.c to show GtkComboBox/GtkMenu wrapping in action 2010-08-18 20:01:28 -04:00
Benjamin Otte
dc7a8f9be7 tests: unbreak testwindows test
Delete code that was broken and also used the APIs I just removed.
2010-08-15 03:51:39 +02:00