Commit Graph

11036 Commits

Author SHA1 Message Date
Havoc Pennington
c29f0a1392 Fix more SizeRequest implementations to avoid recursive calls to wrapper API
GtkFrame, GtkComboBox, GtkExpander, GtkMenu, GtkWrapBox

These are all the examples I could find so far.

https://bugzilla.gnome.org/show_bug.cgi?id=628829
2010-09-12 21:47:10 -04:00
Havoc Pennington
8960d64cc6 Warn about recursively calling size req wrappers on the same object and orientation
We are not re-entrant and there is no reason for widgets to
do this, most likely they'll just get unexpected bugs because
the wrappers may modify the request.

Computing the request should logically rely only on the
widget itself, not on any adjustments caused by set_size_request,
size groups, and so forth.

https://bugzilla.gnome.org/show_bug.cgi?id=628829
2010-09-12 21:47:09 -04:00
Havoc Pennington
cf6eb47758 default impls of width_for_height,hfw should chain directly not use wrapper API
In GtkBin and GtkWidget we tried to provide handy defaults that
call get_width if there's no get_width_for_height and
get_height for get_height_for_width.

However, they used the wrapper API on GtkSizeRequest instead of
chaining directly to the other method implementation.

This could result in all kinds of surprising behavior, for example,
get_width_for_height() would now already include the effects of set_size_request().

If nothing else it's inefficient. But it's just conceptually wrong,
because to chain to another implementation, we should call the other
implementation, not call a wrapper around the other implementation
(when we're already inside a previous invocation of the wrapper,
i.e. compute_size_for_orientation() ends up reinvoking itself
in the same orientation on the same object which it pretty
likely isn't intending to do)

https://bugzilla.gnome.org/show_bug.cgi?id=628829
2010-09-12 21:47:09 -04:00
Havoc Pennington
b3079c0d18 Use gint16 for GtkBorder
32K of border ought to be enough for any pixel dimensions. At least
until screens are so huge we start using doubles.

This saves a nice 64 bits of space when we have a GtkBorder
stored somewhere.

Signed integers are used to avoid surprising unsigned math
issues. Just search GTK's whole git log from inception
for "unsigned" if you want to find any number of commits
fixing signed/unsigned bugs.

https://bugzilla.gnome.org/show_bug.cgi?id=629387
2010-09-12 21:47:09 -04:00
Javier Jardón
7e520d908a Fix some compilation warnings
GScanner token field is declared as GTokenType instead a guint
See Glib bug: https://bugzilla.gnome.org/show_bug.cgi?id=627890

Fixes https://bugzilla.gnome.org/show_bug.cgi?id=627962
2010-09-13 03:28:36 +02:00
Benjamin Otte
66e860b5d1 style: Fix drawing of insensitive text
When writing the original code I erroneously assumed that the current
point of the cairo context would be saved by cairo_save/restore(), but
of course the current point is part of the path and therefor isn't
saved.

Also do a cairo_new_path() before rendering any text so that we are sure
the text ends up at the right spot.
2010-09-12 16:00:05 +02:00
Javier Jardón
d3661589f4 gtk/gtkwidget.c: Use accessor functions to access GtkWindowGroup 2010-09-11 04:25:41 +02:00
Javier Jardón
ab248d7ca3 Revert "gtk/gtkmain.c: Use accessor functions to access GtkWindowGroup"
This reverts commit 65b9fc3e5b.
2010-09-11 04:24:54 +02:00
Javier Jardón
65b9fc3e5b gtk/gtkmain.c: Use accessor functions to access GtkWindowGroup 2010-09-11 03:34:01 +02:00
Javier Jardón
6eae25e0b0 GtkWindow: move public members to private structure
Signed-off-by: Christian Dywan <christian@twotoasts.de>
2010-09-11 02:22:28 +02:00
Matthias Clasen
149b84dacf Really stop exporting text-related variables 2010-09-09 22:11:36 -04:00
Tristan Van Berkom
a6a036ce22 Adding note to docs of gtk_widget_set_window()
gtk_widget_set_window() does not add a reference to the
owned window... this is an exception to most gtk_foo_set_bar()
functions where as it acts as if it were named gtk_widget_take_window().

Adding note to the docs to avoid people giving the window to the
widget and naturally proceeding to unref the window.
2010-09-10 03:25:21 +09:00
Benjamin Otte
6624da6393 widget: Fix SEGV when no focus widget exists 2010-09-09 18:10:04 +02:00
Tristan Van Berkom
73ea777c33 Fixed GtkTextView & GtkIconView to consult it's true previous size request
Fixed issues in my previous patch for bug 626939 removing GtkRequisition
cache: these widgets monitor the previous requested size and decide whether
to queue a resize when the content changes based on it's prior request.
2010-09-09 17:19:18 +09:00
Tristan Van Berkom
843be48572 Moved GtkSizeRequest cache to GtkWidget->priv
Now that we have a private data installed directly on
the GtkWidget instance it makes no sense to cache the size
requests on widget qdata. This change will generally make
GTK+ memory less fragmented as well as significantly speed
up the size request process.
2010-09-09 17:19:18 +09:00
Tor Lillqvist
f76fddb8a7 Use accessor functions in Win32-only code 2010-09-09 11:09:55 +03: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
Matthias Clasen
3bd93e5bfd Remove GtkItem
With the demise of GtkList and GtkTree, it has GtkMenuItem as sole
derived class, and is not really adding any value as a separate class.
Its few useful features have been merged into GtkMenuItem.

Bug 629104
2010-09-08 23:38:09 -04:00
Javier Jardón
72ac2175e2 gtk/gtkhandlebox.c: Do not use gdk_window_get_deskrelative_origin()
This completes commit bd277fad50
2010-09-09 02:26:43 +02: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
Mike Gorse
8fb5bc2583 Remove a duplicate variable
Bug#629110: gtk_spinner_accessible_get_type always returns null
2010-09-08 17:55:28 -04:00
Javier Jardón
a76d198508 GtkWidget: Move public members to private structure 2010-09-08 21:28:16 +02:00
Javier Jardón
efaed1b8f1 gtk/gtknotebook.c: use accessor functions to access GtkWidget 2010-09-08 21:13:04 +02:00
Javier Jardón
f8cfb895ed gtk/gtkarrow.c: use accessor functions to access GtkWidget 2010-09-08 21:13:04 +02:00
Javier Jardón
d9e7680735 gtk/gtkpathbar.c: use accessor functions to access GtkWidget 2010-09-08 21:13:04 +02:00
Javier Jardón
a338d5dea5 gtk/gtkruler.c: use accessor functions to access GtkWidget 2010-09-08 21:13:04 +02:00
Javier Jardón
e4dc454f59 gtk/gtkseparator.c: use accessor functions to access GtkWidget 2010-09-08 21:13:04 +02:00
Javier Jardón
50ef420378 gtk/gtkhandlebox.c: use accessor functions to access GtkWidget 2010-09-08 21:13:04 +02:00
Javier Jardón
89e8f79f07 gtk/gtkiconview.c: use accessor functions to access GtkWidget 2010-09-08 21:13:04 +02:00
Javier Jardón
a48d28848e gtk/gtkimage.c: use accessor functions to access GtkWidget 2010-09-08 21:13:03 +02:00
Javier Jardón
ec2f2c3daf gtk/gtkmenu.c: use accessor functions to access GtkWidget 2010-09-08 21:13:03 +02:00
Javier Jardón
0993bc4d1c gtk/gtkmisc.c: use accessor functions to access GtkWidget 2010-09-08 21:13:03 +02:00
Javier Jardón
29044f0f0e gtk/gtkspinbutton.c: use accessor functions to access GtkWidget 2010-09-08 21:13:03 +02:00
Javier Jardón
5533264958 gtk/gtktextview.c: use accessor functions to access GtkWidget 2010-09-08 21:13:03 +02:00
Javier Jardón
d05d713068 gtk/gtktreeview.c: use accessor functions to access GtkWidget 2010-09-08 21:13:03 +02:00
Javier Jardón
2d0a655201 gtk/gtkwindow.c: Fix warning
Cast to GtkSizeRequest

This was added in
commit b654afcb48
2010-09-08 21:13:03 +02:00
Tor Lillqvist
87141cf4c8 Get rid of the rest of variables exported from libgtk
Especially the gtk_*_type ones in gtktexttypes.h were mentioned in
gtk.symbols presumably by accident. That header isn't even installed,
so no way can they be supposed to be public.

gtk_text_attr_appearance_type is from the installed but "semi-private"
gtktextlayout.h, so drop that one too from gtk.symbols for now.

The use of gtk_text_unknown_char_utf8 is bit of a mess. Code in a few
files knew implicitly that it is three bytes. Define a symbolic name
for the length of it instead. Add an exported function
gtk_text_unknown_char_utf8_gtk_tests_only() that returns a pointer to
it just for the sake of gtk/tests/textbuffer.c. Prefix the variable
with an underscore.

I doubt the usefulness of the test_utf8() in textbuffer.c. If it could
be dropped, gtk_text_unknown_char_utf8_gtk_tests_only() could be
dropped, too.
2010-09-08 21:31:34 +03:00
Tor Lillqvist
801875b805 Replace gtk_debug_flags with getter and setter functions
Preferrably should be made just into a local variable for libgtk like
_gdk_debug_flags for libgdk. But for now used by
gtk/tests/textbuffer.c and modules/printbackends/cups/gtkprintbackendcups.c.
2010-09-08 21:31:34 +03: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
b654afcb48 gtk/gtkwindow.c: Use gtk_size_request_get_size() instead gtk_widget_get_requisition() 2010-09-08 19:40:51 +02:00
Tristan Van Berkom
9934007420 Completely removed requisition cache from GtkWidget instance structure.
Since we have a new mechanism for requesting sizes: GtkSizeRequestIface;
it makes no sense to maintain this cache on the GtkWidget structure...
removing the requisition cache however does not break the old "size-request"
signal which is there for backwards compatability reasons.

In any case widget->requisition should not have been accessed,
gtk_widget_get_child_requisition() would have been the correct way
to consult the cache.

This commit also deprecates the newly added gtk_widget_get_requisition()
API and makes it fallback on gtk_size_request_get_size().
2010-09-08 18:50:24 +02:00
Javier Jardón
bc366cef52 gtknotebook: Do not mention deprecated API 2010-09-08 17:46:11 +02:00
Javier Jardón
4a5e0a35b9 gtksocket: Remove mention to gtk_socket_steal() deprecated function 2010-09-08 17:14:37 +02:00
Colin Walters
319bc22c5c gtk.symbols: Update expected ABI 2010-09-07 14:17:10 -04:00
John (J5) Palmieri
c78a23bdca add annotations for tranfer and scope so that methods are exported by GI 2010-09-07 13:50:40 -04:00
John (J5) Palmieri
eeaf576316 add array annotation to gtk_builder_add_objects_from_string 2010-09-07 12:06:29 -04:00
John (J5) Palmieri
8a210673fb add gtk_radio_button_join_group method for bindings
* this mirrors the committed change for gtk_radio_action_join_group in
  commit 85b53969b2
* Due to object ownership issues it is impossible to correctly use
  get_group/set_group from a GI binding
* join_group is safer because at the binding level it works with individual
  GtkRadioButton objects and not with the list of objects that gets
  modified in the library

https://bugzilla.gnome.org/show_bug.cgi?id=628935
2010-09-07 10:41:40 -04:00
Tristan Van Berkom
278957a5a4 Removed x/y/x_set/y_set from GtkWidgetAuxInfo
These members of GtkWidgetAuxData can no longer be set after
the removal of deprecated gtk_widget_set_uposition(), now removed
these members completely and removed the access to them from
gtk_widget_size_allocate().
2010-09-07 16:21:44 +09:00
Tristan Van Berkom
d5278b5994 Removed _gtk_window_reposition()
_gtk_window_reposition() was only some extra confusing code, internally
it only calls the public API gtk_window_move()... replaced calls to
_gtk_window_reposition() with direct calls to gtk_window_move() and
removed the redundant internal API (probably there only for some historical
reason).
2010-09-07 15:45:15 +09:00
Havoc Pennington
c50db9c208 Use a bitfield for Widget::private_flags, ::state, ::saved_state
This recovers 10 bits, since state and saved_state as uint8 both
wasted 5 bits. Now we can add 10 more flags.

Also, a possible future patch could just do 1-bit bitfields
for the private flags instead of using manual bit twiddling.

https://bugzilla.gnome.org/show_bug.cgi?id=628884
2010-09-07 00:13:11 -04:00
Matthias Clasen
3c5f9fd1a2 Remove use of ::has-separator property 2010-09-06 00:26:17 -04:00
Matthias Clasen
2f966e8418 Remove some unused enums
The GtkAnchorType and GtkVisibility enums are not used anywhere,
so remove them.
2010-09-05 23:55:47 -04:00
Havoc Pennington
88a90b8abb Warn if a widget requests minimum size > natural size
Since this makes no sense and there's no reason we should
have to check for it elsewhere just in case some widget is
busted.

https://bugzilla.gnome.org/show_bug.cgi?id=628808
2010-09-05 21:46:22 -04:00
Havoc Pennington
d7d940c71e Add more "reserved for expansion" fields to GtkWidgetClass
Only 3 were left. 3.x cycle may need more.

https://bugzilla.gnome.org/show_bug.cgi?id=628807
2010-09-05 21:42:35 -04:00
Murray Cumming
08ddea5069 GtkStatusIcon: Remove get/set_blinking() declarations from header.
This was apparently forgotten in
commit 18b47b6cd0 .
2010-09-04 13:18:09 +02:00
Benjamin Otte
d8f3a162c8 style: Use gtk_widget_get_state() for the entry background
New code sets the entry background to GTK_STATE_ACTIVE when it has focus
and the active color in the default theme looks rather bad.
2010-09-03 17:14:17 +02:00
Benjamin Otte
78ccc74879 entry: Use the same state for the flat box of text area and icons 2010-09-03 17:01:06 +02:00
Benjamin Otte
9c2eca5b06 range: Unused variable 2010-09-03 13:39:10 +02:00
Benjamin Otte
3685db091d window: Use brackets to silence gcc 2010-09-03 13:38:55 +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
d433a60611 Remove separators from dialogs
It seems more reasonable to remove this feature than to keep fighting
off every separator that pops up by accident in a dialog.
2010-09-02 09:14:20 -04:00
Matthias Clasen
ece148eec0 Remove ::state-hint use
This use of the property was overlooked when it was removed.
We now always behave as if state-hint == TRUE.
2010-09-02 08:59:27 -04:00
Fridrich Štrba
31b709d08a Export one needed symbol 2010-09-02 10:24:34 +02: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
Tristan Van Berkom
f2279d5e51 Fixed GtkNotebook to not consult GtkWidget->requisition directly
GtkNotebook was filling widget->requisition directly at "size-request"
time instead of filling in the *requsition argument, also (more importantly)
at size_allocate time GtkNotebook was consulting the action widget's
widget->requisition directly instead of safely calling
gtk_widget_get_child_requisition(). This commit closes bgo #628068.
2010-09-02 13:50:27 +09:00
Matthias Clasen
6b5672c199 Remove now unused GtkProgressBarOrientation enum 2010-09-01 23:30:21 -04:00
Matthias Clasen
0ff6aedca0 Convert GtkCellRendererProgress to a GtkOrientable
And add an inverted property to it, too.
2010-09-01 23:27:00 -04:00
Matthias Clasen
4230f7998b Make GtkProgressBar implement GtkOrientable
This also means that gtk_progress_bar_[sg]et_orientation are
gone.
2010-09-01 23:25:22 -04:00
Matthias Clasen
c3a19a4a14 Split the GtkProgressBar::orientation property
We splict the orientation property into a GtkOrientation and a
'inverted' boolean, the same way that GtkRange is set up.
2010-09-01 23:24:20 -04:00
Matthias Clasen
e4af3782d3 Rename GtkIconView::orientation property
Rename the ::orientation property of GtkIconView to item-orientation,
which is both clearer and avoids the conflict with the orientation
property of GtkOrientable implementations.
2010-09-01 23:03:48 -04:00
Matthias Clasen
1956cf8d28 Remove GtkRange::activate-slider
This was a style property to let theme engines 'opt-in' to more
correct behaviour while maintaining compatibility with existing
themes. GTK+ 3 engines are expected to handle the more correct
behaviour.
2010-09-01 22:09:44 -04:00
Matthias Clasen
d28af9cbb9 Remove GtkRange::stepper-position-details
This was a style property to let theme engines 'opt-in' to more
correct behaviour while maintaining compatibility with existing
themes. GTK+ 3 engines are expected to handle the more correct
behaviour.
2010-09-01 21:48:44 -04:00
Matthias Clasen
658f99b8ee Remove GtkRange::trough-side-details
This was a style property to let theme engines 'opt-in' to more
correct behaviour while maintaining compatibility with existing
themes. GTK+ 3 engines are expected to handle the more correct
behaviour.
2010-09-01 21:30:47 -04:00
Matthias Clasen
095fb1afe4 Remove GtkTreeView::row-ending-details
This was a style property to let theme engines 'opt-in' to more
    correct behaviour while maintaining compatibility with existing
    themes. GTK+ 3 engines are expected to handle the more correct
    behaviour.
2010-09-01 20:58:39 -04:00
Matthias Clasen
399580f9e1 Remove GtkEntry::state-hint
This was a style property to let theme engines 'opt-in' to more
correct behaviour while maintaining compatibility with existing
themes. GTK+ 3 engines are expected to handle the more correct
behaviour.
2010-09-01 20:21:21 -04:00
Matthias Clasen
15ea566813 Wrap box assimilation
Some coding style cleanups, rename Priv to Private, add docs
2010-09-01 20:03:30 -04:00
Matthias Clasen
7670b13d19 Update GtkButtonBox docs 2010-09-01 19:15:59 -04:00
Javier Jardón
6e5d65c9af gtkscale: move documentation to inline comments 2010-09-01 20:37:39 +02:00
Javier Jardón
5484211c90 gtktexttagtable: move documentation to inline comments 2010-09-01 20:37:39 +02:00
Javier Jardón
7eadf45888 gtktypeutils: move documentation to inline comments 2010-09-01 20:37:39 +02:00
Javier Jardón
a47e5483b6 gtkimcontextsimple: move documentation to inline comments 2010-09-01 20:37:39 +02:00
Javier Jardón
3a752e03a8 gtkimmulticontext: move documentation to inline comments 2010-09-01 20:37:39 +02:00
Colin Walters
787df491f3 Add correct namespace prefix to ColorSelectionPrivate
gobject-introspection is now more strict about garbage in public headers.
2010-09-01 13:16:37 -04:00
Carl-Anton Ingmarsson
38fad43129 docs: Further fix GtkStock documentation
Some icons were left out from the
commit 9688665334

https://bugzilla.gnome.org/show_bug.cgi?id=628308

Signed-off-by: Javier Jardón <jjardon@gnome.org>
2010-09-01 17:43:59 +02:00
Stefan Kost
9074f74c6f container: use priv in last commit
container->focus_child to container->priv->focus_child
2010-09-01 17:33:33 +03:00
Stefan Kost
94420f7110 widget: more details on gtk_widget_grab_focus docs
Tell that widget needs to be mapped and realized.
2010-09-01 16:59:00 +03:00
Stefan Kost
267a2156d8 container: clarify the docs
Hightlight more that focus_child is a container internal thing and suggest
what application developers most likely were looking for instead.
2010-09-01 16:59:00 +03:00
Stefan Kost
b00b1c33a3 container: don't leak the focus_child ref count
gtk_conatiner_set_focus_child() takes a ref. Release the ref in _destroy().
Fixes #414712.
2010-09-01 16:59:00 +03:00
Matthias Clasen
9688665334 Fix GtkStock documentation
After the big icon rename, all the links in the docs have to
be updated, and we need to copy the right icons.
2010-09-01 00:14:45 -04:00
Colin Walters
b04b1b2e84 introspection: Update to new scanner API
* Add --warn-all
* Drop unnecessary  of --strip-prefix; for GdkX11, use --symbol-prefix

https://bugzilla.gnome.org/show_bug.cgi?id=628160
2010-08-31 16:21:08 -04:00
Javier Jardón
213f8e2f1b gtk/gtkwindow: use accessor functions to access GtkWidget 2010-08-31 02:51:36 +02:00
Javier Jardón
1a980d0be6 gtk/gtkplug.c: Use accessor functions to access GtkWindow 2010-08-31 02:51:36 +02:00
Javier Jardón
304b1a1f56 Added _gtk_widget_get_wmclass() internal function
Needed by GtkPlug
2010-08-31 02:51:36 +02:00
Javier Jardón
cc06f3dde6 GtkScrolledWindow: move public members to private structure 2010-08-31 01:34:02 +02:00
Tor Lillqvist
4491bdbb9d Drop Win32 DLL ABI compatibility cruft
No need for that any longer as we are changing DLL name.
2010-08-30 14:57:48 +03:00
Tristan Van Berkom
972f617b77 Fixed GtkToolPalette realize() vfunc.
It seems with latest GSEAL work for widget->window access a
call to gtk_widget_set_window() was missed (added the window
assignment and now the palette shows up in Glade again).
2010-08-30 18:25:14 +09:00
Philip Withnall
ba158a24fe Miscellaneous property string fixes 2010-08-29 19:00:14 +01:00
Javier Jardón
f84707d6f9 Add gtk_calendar_day_is_marked() function
The marked state of calendar day is not accessible

Fixes https://bugzilla.gnome.org/show_bug.cgi?id=627028
2010-08-29 19:14:24 +02:00
Daiki Ueno
6afa615690 Fix typo in GtkIMContextClass doc. 2010-08-29 19:01:30 +02:00