summaryrefslogtreecommitdiff
path: root/gtk/gtksizerequest.c
Commit message (Collapse)AuthorAgeFilesLines
* Don't use g_print for debug outputMatthias Clasen2016-02-281-11/+17
| | | | | | The g_print documentation explicitly says not to do this, since g_print is meant to be redirected by applications. Instead use g_message for logging that can be triggered via GTK_DEBUG.
* Fix indentationMatthias Clasen2016-02-051-3/+3
| | | | gcc 6 complains about this.
* widget: Add a resize_needed flagBenjamin Otte2015-10-281-0/+2
| | | | | | | | | ... and API to set and unset it. It is set when gtk_widget_queue_resize() is called. It is unset when gtk_widget_get_preferred_width/height() is called. So far it is not used.
* size request: Avoid unnecessary reffingMatthias Clasen2015-09-231-4/+0
| | | | | | There is no particular reason why we should have to ref the widgets if they are in a size group - we are not reffing them in the simple case either.
* Remove type check from gtk_widget_get_request_modeMatthias Clasen2015-09-121-3/+1
|
* size request: Redo the recursion checksMatthias Clasen2015-09-091-6/+5
| | | | | Use G_ENABLE_CONSISTENCY checks for the recursion checks in gtksizerequest.c
* Move GtkWidgetPrivate to gtkwidgetprivate.hMatthias Clasen2015-09-071-1/+1
| | | | | This lets us use inlined getters for members in there, avoiding the type checks in the public getters.
* Docs: Remove all entities and turn off sgml modeMatthias Clasen2014-02-091-5/+5
| | | | | With all element markup gone, it is time to turn off sgml mode, and get rid of entities as well.
* docs: use proper apostropheWilliam Jon McCann2014-02-071-7/+7
| | | | https://wiki.gnome.org/Design/OS/Typography
* Docs: Don't use note elementsMatthias Clasen2014-02-021-9/+8
| | | | In most cases, the text itself makes the message clear enough.
* docs: fix name of function to use for baseline alignmentWilliam Jon McCann2014-01-211-1/+1
|
* widget: make gtk_widget_compute_size_for_orientation() staticBenjamin Otte2013-05-111-39/+39
| | | | It's not used anywhere outside of gtksizerequest.c anymore.
* API: Don't export gtk_widget_preferred_size_and_baseline()Benjamin Otte2013-05-111-11/+9
| | | | | | | | gtk_widget_preferred_size() is only useful if you want to quickly port a widget from GTK2 sizing code to GTK3 but does not properly work with height-for-width as used in GTK. So we don't want to encourage people to use it. In particular we want people to convert to height-for-width before adding baseline support to their widgets.
* widget: Adapt _gtk_widget_get_preferred_size_for_size()Benjamin Otte2013-05-011-9/+22
| | | | ... for baseline support byu taking two extra (possible NULL) arguments.
* Handle non-baseline supporting subclasses overriding baseline supporting classesAlexander Larsson2013-04-231-6/+53
| | | | | | | | | | | If a subclass (say a child of GtkButton) overrides the non-baseline size request methods we need to call these, rather than the new get_height_and_baseline_for_width method. In order to handle this we make the default for this method to be NULL, and instead check at runtime which method to call. If any non-baseline vfunc has changed in a class but the baseline one hasn't, then we can't use the baseline one.
* Initial support for baselinesAlexander Larsson2013-04-231-49/+197
| | | | | | | | | | | | | | | | | | | | | | This modifies the size machinery in order to allow baseline support. We add a new widget vfunc get_preferred_height_and_baseline_for_width which queries the normal height_for_width (or non-for-width if width is -1) and additionally returns optional (-1 means "no baseline") baselines for the minimal and natural heights. We also add a new gtk_widget_size_allocate_with_baseline() which baseline-aware containers can use to allocate children with a specific baseline, either one inherited from the parent, or one introduced due to requested baseline alignment in the container itself. size_allocate_with_baseline() works just like a normal size allocation, except the baseline gets recorded so that the child can access it via gtk_widget_get_allocated_baseline() when it aligns itself. There are also adjust_baseline_request/allocation similar to the allocation adjustment, and we extend the size request cache to also store the baselines.
* sizerequest: Split out a common functionBenjamin Otte2013-04-221-0/+23
|
* style: Add missing deprecation markersBenjamin Otte2013-04-021-0/+2
| | | | | | | | Some functions in gtkstyle.h were overlooked when we added the GDK_DEPRECATED macros. Also add IGNORE_DEPRECATIONS to the few remaining callers of those functions.
* widget: Allow invisible toplevels to do sizing operationsBenjamin Otte2013-01-241-1/+1
| | | | | | | | | | | | This is a quickfix to keep things working. It turns out GtkWindow assumes it can do sizing operations while not being visible, or while in the process of show()ing/hide()ing itself. And commit b495ce54 broke these operations. Figuring this properly requires some more thinking and restructuring on my part, so for now we relax the requirement of visiblility enough for these things to start working again.
* sizerequest: Make invisible widgets return a 0x0 size.Benjamin Otte2013-01-081-0/+9
|
* sizerequest: Optimize CONSTANT_SIZE betterBenjamin Otte2012-11-141-2/+5
| | | | | | | | We can set for_size to -1 earlier than we did. Doing so makes sure we only cache one value (as we should in the first place). In GTK 3.6, this worked properly, but with Previously, this check was moved further up to avoid interacting with size groups. But after recent refactorings, size groups are handled way earlier anyway.
* sizerequest: Use GtkOrientationBenjamin Otte2012-11-141-22/+20
| | | | | | ... instead of GtkSizeGroupMode. Orientation is what we're interested in after all. When we need a GtkSizeGroupMode, we can do the translation where we need it.
* sizerequestcache: Move lookup functionBenjamin Otte2012-11-141-71/+12
| | | | ...and clean up its API.
* sizerequestcache: Move commit functionBenjamin Otte2012-11-141-111/+5
|
* widget: Get rid of unused flagsBenjamin Otte2012-11-141-5/+0
| | | | | Now that we clear the cache immediately, there's no need anymore to track if a request has been queued.
* sizerequest: Cache the request modeBenjamin Otte2012-11-141-20/+12
| | | | | ... in the GtkSizeRequestCache. That way, we only need to query it once, and can remove the caching code from GtkContainer.
* sizerequestcache: Make clear_cache clear all the cacheBenjamin Otte2012-11-141-5/+3
|
* sizerequestcache: Move functionsBenjamin Otte2012-11-141-48/+2
| | | | ... into the sizerequestcache.c file.
* sizerequest: Split out size request cache code into separate headerBenjamin Otte2012-11-141-0/+1
|
* sizerequest: do not derefence NULL pointersStefano Facchini2012-11-041-2/+5
|
* sizerequest: Restructure codeBenjamin Otte2012-11-041-92/+58
| | | | | Make the compute_size_request() function take into account size groups itself instead of doing a weird "bump_requisition" call.
* sizerequest: Move sizegroups function to different source fileBenjamin Otte2012-11-041-5/+68
|
* sizerequest: Move optimizationBenjamin Otte2012-11-041-30/+14
| | | | | | With size groups now doing hfw, doing the optimization for CONSTANT_SIZE was done too early. Size groups need to know that it's a hfw request, so the other widgets in the size group get the correct behavior.
* sizerequest: Export _gtk_widget_compute_size_for_orientation()Benjamin Otte2012-11-041-25/+52
| | | | | and add an "ignore_size_groups" flag to it. This way we can use it for size group shenanigans.
* sizerequest: Cache sizes without size groupsBenjamin Otte2012-11-041-9/+6
| | | | | | We compute on-demand for size groups anyway, so we can (in theory, this patch doesn't do that yet) get around costly cache blowing when invalidating single widgets of a size group this way.
* sizegroup: Handle hfw in size groupsBenjamin Otte2012-11-041-0/+1
|
* sizerequest: Improve warning messageBenjamin Otte2012-05-071-2/+12
| | | | Actually print out the function we're warning about
* Change FSF AddressJavier Jardón2012-02-271-3/+1
|
* Move deprecated gtkwidget style api to gtkstyleMatthias Clasen2011-11-021-0/+1
|
* sizerequest: return CONSTANT_SIZE in return_if_fail()Benjamin Otte2011-04-141-1/+1
|
* Fixed bug in GtkSizeRequest code where the cache is not reset properlyTristan Van Berkom2011-04-041-1/+2
| | | | Fixes this bug https://bugzilla.gnome.org/show_bug.cgi?id=646500
* widget: Emit initial style-set signal in the same situations as GTK2Benjamin Otte2011-03-271-0/+2
| | | | | | | | | | | | This ensures that widgets that aren't ported and rely on the style-set signal being emitted work as well as before. They should not rely on style-set being emitted however. Note that this function is a no-op if the initial style has been set already and is very cheap if it has not been set yet. It only becomes relevant if the resulting style actually gets used. https://bugzilla.gnome.org/show_bug.cgi?id=639584
* Fixed possible segmentation fault while freeing size request caches.Tristan Van Berkom2011-03-251-1/+1
|
* Cache heights-for-range-of-widths instead of height for every width.Tristan Van Berkom2011-03-251-169/+242
| | | | | | | | | | | | | This patch optimizes window resizes by assuming that if a widget has the same height at a width of 50 as with a width of 150, the height for width 100 will also be the same. The patch also further optimizes the cache allocator, now there are 2 pointer arrays of up to a maximum of 5 requests, the arrays will only be allocated if a request is ever made in that orientation and the array will be sparse until each request is made (i.e. if a label can only wrap to 3 lines, there will only be 3 out of a possible 5 SizeRequest structures allocated to cache it).
* Reduce memory consumption of the size request cache.Tristan Van Berkom2011-03-251-54/+114
| | | | | | This patch makes contextual height-for-width request caching optional (the contextual cache is not allocated for widgets that report GTK_SIZE_REQUEST_CONSTANT_SIZE).
* Added GTK_SIZE_REQUEST_CONSTANT_SIZE to GtkSizeRequestModeTristan Van Berkom2011-03-251-8/+32
| | | | | | | The constant size request mode defines a request mode where height-for-width geometry is unneeded, thus optimizing GTK+ by reducing the overall amount of requests that need to be performed and cached while resizing an interface.
* Add default class implementation of gtk_widget_get_request_mode().Tristan Van Berkom2011-01-281-8/+1
| | | | | | | Instead of checking if klass->get_request_mode is != NULL from the gtk_widget_get_request_mode() api, this allows classes to trust that there is a default implementation and chain up (specifically added this for gtkmm wrapper objects).
* Remove unneeded/deprecated call from size requisition codeCarlos Garnacho2011-01-041-2/+0
|
* Removed checks in gtksizerequest.cTristan Van Berkom2010-12-291-16/+0
| | | | | | | | | Checks were in place to ensure that widgets never request taller or wider than screen size. This was there to test a theory about scrolled window children functioning correctly with dynamic content however it breaks GtkViewport children which can generally return a value taller than screen height intentionally, GtkViewport uses this value to update the adjustments.
* size-request: Clamp size requests to screen sizeBenjamin Otte2010-12-151-0/+16
| | | | | | | Size requests should only ever need to return the screen's width/height and max. This way, potentially large widgets (tree view or icon view) don't need to do so many computations, but can stop when their computed size has reached the screen size.