Commit Graph

11020 Commits

Author SHA1 Message Date
Matthias Clasen
3e91238071 Add new api to gtk.symbols 2010-09-15 13:49:00 -04:00
Matthias Clasen
38e09dcbb1 Use gint instead of in for local consistency 2010-09-15 13:22:51 -04:00
Tor Lillqvist
57e0b9a979 Fix build on Windows
No idea of the widget embedding crack has worked in recent versions,
even less now. But at least it now compiles.
2010-09-15 14:19:40 +03:00
Tristan Van Berkom
1110375f24 spinner: Dont inherit from GtkDrawingArea part 2.
Seems commit 7b42d4feda makes
GtkSpinner a direct subclass of GtkWidget but forgets to
update the header file to include gtkwidget.h instead and
declare the instance and class structures properly (assuming
this was just a missed file in the commit).
2010-09-15 16:52:29 +09:00
Javier Jardón
f5a06df3dc spinner: timeout should add/remove in map/unmap, not realize/unrealize.
Otherwise hiding the spinner won't stop it
2010-09-15 04:00:55 +02:00
Javier Jardón
8345760fdb gtkentry: remove unnneded check in map/unmap functions 2010-09-15 03:28:24 +02:00
Javier Jardón
e3a8e29a6c Add deprecation guards for gtk_widget_size_request() 2010-09-15 03:14:34 +02: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
Tristan Van Berkom
8bfb1e0ab8 Fixed GtkSizeGroups to adjust both minimum and natural requisitions
Originally the GtkSizeRequestIface patches left GtkSizeGroup working
only by bumping the minimum sizes - this commit fixes size groups to take
both minimum and natural requests into account.
2010-09-15 04:04:02 +09:00
Javier Jardón
ab4ba69cc8 Add deprecation guards for gtk_cell_view_get_size_of_row() 2010-09-14 20:40:34 +02:00
Benjamin Otte
7b42d4feda spinner: Don't inherit from drawing area
A drawing area is not meant to be subclassed from. It also doesn't
provide any feature a spinner would need either.
2010-09-14 01:28:01 +02:00
Benjamin Otte
032d3f0ada spinner: Implement the size request interface
Doing size requests in expose is broken.
2010-09-14 01:25:07 +02:00
Benjamin Otte
c22b80949d spinner: Move G_DEFINE_TYPE() below function definitions
Also remove redundant double definition.
2010-09-14 01:19:48 +02:00
Benjamin Otte
419e1548ab wrapbox: Lookie, an unused variable 2010-09-14 01:17:17 +02:00
Benjamin Otte
5ba6295a10 spinner: Define desired size at top of file
No magic numbers in the code please
2010-09-14 01:09:53 +02:00
Matthias Clasen
ff29972a48 GtkWrapBox: let GtkContainer handle border width 2010-09-13 18:47:59 -04: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
Matthias Clasen
8204fe6036 GtkBox: let GtkContainer handle border width 2010-09-13 18:47:58 -04:00
Javier Jardón
97ffc36540 Add deprecation guards for gtk_widget_get_child_requisition() 2010-09-13 22:37:11 +02:00
Milan Bouchet-Valat
e02252cdd6 bgo#486839 - Fix path bar size group in the file chooser
Since the location button is hidden in save mode, we need to add the
path bar to the size group too. The location button still has to be in
the group though, because it's larger than the path bar (when
shown). Instead of using the recent/search icons, add their hboxes so
that themed widget spacings don't introduce variations.
2010-09-13 14:57:23 -05: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
153bfacde0 Fixed GtkWrapBox to allocate variable row AND column heights when in ALIGNED mode
With this new approach at request and allocate time, the average child size
is used to determine a good guess at how many columns will fit the box
width; afterwards extra columns are appended and checked to fit.
Then the row heights are calculated based on height-for-width of each
child in the row which now may have individual widths.
2010-09-14 02:32:36 +09:00
Tristan Van Berkom
a79637f081 Changed GtkWrapBox code to avoid a growing GArray of a known size. 2010-09-14 02:32:36 +09:00
Kristian Rietveld
a79d6676ac Update gtkstyle.c to account for removal of row-ending-details
The detail strings now have more "detail" by default, so gtkstyle.c
needed to be updated to properly handle this.  Tests like testtreeview,
testtreesort now have proper background drawing again.

This strncmp trick was the best I could think of so quickly, if anybody
has an idea to do this in a better way, let me know.
2010-09-13 17:13:21 +02:00
Kristian Rietveld
ecaa37529c Mark declaration of symbol _gtk_text_unknown_char_utf8 as extern
So that the symbol is not re-created each time the header is included.
The symbol is defined in gtktexttypes.c already.
2010-09-13 16:47:14 +02:00
Kristian Rietveld
31cd439385 Use accessor functions to access GtkWidget 2010-09-13 16:39:55 +02:00
Kristian Rietveld
0fc5433753 Update for GDK key name changes 2010-09-13 16:27:08 +02:00
Havoc Pennington
474f80442a Add margin and alignment properties to GtkWidget
h-align = START,END,CENTER,FILL
v-align = START,END,CENTER,FILL
margin-left,right,top,bottom
margin

These should obsolete all such similar properties on
layout containers, GtkMisc, GtkAlignment, GtkContainer::border-width

Margin is outside the size request.
If margin were not outside the set_size_request() it would not work the
same way as container-supplied (child property) padding.

Conceptually set_size_request() forces the value from the subclass
(the original unadjusted request) and then we go on to adjust
the request further by adding the margin.
2010-09-12 21:47:10 -04:00
Havoc Pennington
85735112d7 GtkButton: let GtkContainer handle border width 2010-09-12 21:47:10 -04:00
Havoc Pennington
daebca19da add gtk_container_class_handle_border_width() so subclasses can ignore border_width
A subclass calls gtk_container_class_handle_border_width()
in its class_init

This marks the subclass as expecting GtkContainer to deal with
border width automatically, which GtkContainer then does.
2010-09-12 21:47:10 -04:00
Havoc Pennington
cd2a19a68d GtkWidget: add adjust_size_request adjust_size_allocation virtual funcs
Use these new methods to handle set_size_request (aka aux_info)
inside gtkwidget.c, instead of having external code mess with it.

The virtual functions can be used for other purposes in the
future. For example, GtkContainer::border_width could be
automatically implemented for all container subclasses.
2010-09-12 21:47:10 -04:00
Havoc Pennington
9debfe243f Use _gtk_widget_get_aux_info_or_defaults() when possible in gtkwidget.c
Did not update uses in other files because the plan is to
get rid of those other uses anyhow. So don't want to make
this function available in the header.
2010-09-12 21:47:10 -04:00
Havoc Pennington
cf68c2636a add _gtk_widget_get_aux_info_or_defaults()
This is better than peeking aux info then testing != NULL
in several ways:
- it returns const aux info so if we don't create we can't write
- it ensures that the default we assume if aux_info is NULL is
  the same as the default we set if we've created the aux info
- it avoids typing in != NULL checks
2010-09-12 21:47:10 -04:00
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