Commit Graph

269 Commits

Author SHA1 Message Date
Cosimo Cecchi
4118e13596 container: fix wrong branching logic
If the resize mode of the container was GTK_RESIZE_IMMEDIATE we would
also fall trough to the next case in the switch, and always throw an
assertion.
2012-04-18 12:12:32 -04:00
Benjamin Otte
04c85a5b3b container: Redo style validation handling
Instead of using 1 global queue for both resizes and style validation,
use 2 queues. This makes the code a lot simpler and fixes a bug where we
could accidentally stop restylying for very delayed restyles.
2012-04-17 08:59:23 +02:00
Benjamin Otte
17ccbe4843 container: needs_resize is a container flag, not a widget flag
The widget flag is alloc_needed, needs_resize is used for "is queued
into the container resize queue".
2012-04-17 08:59:23 +02:00
Benjamin Otte
97dc45f8a5 container: Split out a function 2012-04-17 08:59:22 +02:00
Benjamin Otte
090f30c559 container: Remove duplicated flag
GtkContainer::need_resize and GtkWidget::alloc_needed are the same
thing.
2012-04-17 08:59:22 +02:00
Benjamin Otte
8bda7442c8 container: Simplify code
This code should not have any functional changes and just be simpler.
2012-04-17 08:59:21 +02:00
Benjamin Otte
29fbfcb8f5 stylecontext: Pass time to style_context_validate()
This way, we can ensure that every style context uses the same timestamp
for whatever they do.
2012-04-17 08:59:21 +02:00
Benjamin Otte
33f111a47c widget: Don't cache widget paths all the time
Add an internal API that allows GtkStyleContext to create a widget path
for the widget and with that bypassing gtk_widget_get_path() and that
  function caching the path.
2012-04-17 08:59:21 +02:00
Benjamin Otte
585a1fae4f stylecontext: Really queue style changes
Instead of instantly applying a new style, just mark the context as
invalid. Only apply the new style at layout time.
2012-04-17 08:59:10 +02:00
Benjamin Otte
461803e407 gtk: Get gtkwidgetpath.h includes out of the public headers
and include them in the C files instead.
2012-03-19 02:26:16 +01:00
Benjamin Otte
2353d60b8a types: Move GtkAdustment declaration to gtktypes.h
... and make all the headers to not include gtkadjustment.h anymore. Of
course, also include it in the source files instead.
2012-03-03 19:45:03 +01:00
Javier Jardón
9d0febc9a6 Change FSF Address 2012-02-27 17:06:11 +00:00
Javier Jardón
0853ce3077 Use G_VALUE_INIT
Instead of an explicit { 0, } when declaring the variable.
2011-10-15 16:45:16 +01:00
Javier Jardón
b0a7db76fb Replace some references to the GtkTable, use GtkGrid instead 2011-09-29 12:38:49 +01:00
Benjamin Otte
aebd859ef9 toolbar: Fix widget path creation code
- Ensure arrow button is always included
- Invalidate list when direction changes
2011-09-27 05:37:14 +02:00
Benjamin Otte
276a9d7567 container: Warn if an invalid widget path is created
This makes it quite a bit easier to debug things.
2011-09-27 05:37:14 +02:00
Matthias Clasen
5ff8fe6971 Documentation fixes
Mostly making sure that return values and varargs don't loose
their docs.
2011-09-25 21:04:49 -04:00
Matthias Clasen
91bfe9f0c0 Make gtk_container_remove work for assistants 2011-07-11 23:12:55 -04:00
Matthias Clasen
bf70fbb696 Drop an unneeded include 2011-07-11 23:12:55 -04:00
Matthias Clasen
89e57c6978 Convert GailContainer to GtkContainerAccessible 2011-07-05 16:08:57 -04:00
Matthias Clasen
29e6646292 docs: fix parameter name mismatches 2011-06-07 19:30:51 -04:00
Javier Jardón
7b0d77def5 gtkcontainer: Move private functions to private header
https://bugzilla.gnome.org/show_bug.cgi?id=651707
2011-06-06 12:10:29 +01:00
Benjamin Otte
a6daba5e78 API: Change semantics of gtk_container_get_child_path()
Include the child widget path in the returned path now. This allows
customizing the path of the current widgets - like adding flags to child
widgets (and maybe siblings in the future).
2011-06-02 02:03:50 +02:00
Matthias Clasen
e244e5050b Silently allow child properties on grandchildren
This commit simply removes some child->parent == container checks,
to add some flexibility for containers with 'inner structure'.
If these checks are considered useful, we can bring them back
with a is_child vfunc that allows container implementations to
decided who they consider legitimate child.
2011-05-06 14:29:47 -04:00
Matthias Clasen
deb271d355 Add gtk_container_child_notify
This is a variant of gtk_widget_child_notify() that takes an
explicit container, instead of relying on widget->parent to
be the correct container to use.
2011-05-06 14:29:14 -04:00
Tristan Van Berkom
887142f1f5 Added GTK_SIZE_REQUEST_CONSTANT_SIZE to GtkSizeRequestMode
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.
2011-03-25 18:42:07 +09:00
John (J5) Palmieri
3938d3c2e4 [gi] add Virtual annotation for gtk_container_forall vfunc 2011-03-16 10:42:24 -04:00
Murray Cumming
f91c04e284 Minor documentation improvements
Mostly correcting it's to its and changing some , to .
2011-02-23 10:26:21 +01:00
Javier Jardón
db97f8660a Use faster new G_VALUE_COLLECT_INIT variant instead G_VALUE_COLLECT
Fixes https://bugzilla.gnome.org/show_bug.cgi?id=641621
2011-02-07 13:14:47 +00:00
Tristan Van Berkom
fb3e221559 Fixed GtkContainer buildable implementation to set packing properties explicitly set to "" (i.e. explicitly set to nothing). 2011-02-02 15:22:31 +09:00
Tristan Van Berkom
5ebc6f4df2 Fixed GtkContainer to parse <packing> property text accumulatively. 2011-01-26 23:55:01 +09:00
Matthias Clasen
d9fcc4c630 Silence new gcc warnings
gcc 4.6.0 has started to warn about set-but-unused variables.
So don't do that, then.
2011-01-23 21:51:38 -05:00
Pavel Holejsovsky
2fb1c06402 [GI] Add missing (out) and (array) annotations 2011-01-20 13:57:20 +01:00
Pavel Holejsovsky
2f0d40335b [GI] Add missing (transfer) annotations 2011-01-20 13:57:18 +01:00
Pavel Holejsovsky
9b88eb356d [GI] Add missing (scope) annotations 2011-01-20 13:57:15 +01:00
Colin Walters
890e4511aa GtkContainer: make "handle_border_width" member private
Otherwise in introspection we get a naming conflict between the
structure member and the method.

http://bugzilla.gnome.org/show_bug.cgi?id=639325
2011-01-14 09:29:33 -05:00
Matthias Clasen
98440ad031 Remove gtktypeutils altogether
Based on patches by Javier Jardón.

https://bugzilla.gnome.org/show_bug.cgi?id=629955
2011-01-04 14:51:19 -05:00
Havoc Pennington
b67c5af55b Add invariant that a child is unmapped if parent is unmapped
Requires fixes to GtkContainer and GtkWindow to unmap their
children, rather than just withdrawing or hiding the container
window.

Requires fix to GtkHandleBox to chain up to GtkContainer unmap.

Historically we avoided these unmaps for efficiency reasons,
but these days it's a bigger problem that there's no way
for child widgets to know that one of their ancestors has
become unmapped.
2010-12-20 12:58:04 -05:00
Tristan Van Berkom
fc5cabba90 Added minimum size parameter to GtkWidgetClass->adjust_size_allocation.
This allows us to add a check before executing
->get_preferred_height_for_width() to ensure we always
request for at least the minimum required size (and lets
us remove the warning in gtkcontainer.c telling implementors
to do this check manually from thier container implementations).
2010-12-07 23:47:40 +09:00
Carlos Garnacho
f62583d30c GtkContainer: Also copy permanent container's classes on get_path_for_child()
This makes inheritance work for the simplest cases when style is defined
for classes.
2010-12-04 15:39:18 +01:00
Carlos Garnacho
a79626b7fb Add theming docs
Both API and file format is documented, there's still missing
a migration doc though.
2010-12-04 15:38:21 +01:00
Carlos Garnacho
88b78953b6 GtkContainer: Add method to get the GtkWidgetPath for a child.
This is now used throughout in order to have the full path for a given widget,
including intermediate named regions, the default implementation just returns
the GtkContainer's path copy, no intermediate regions between.
2010-12-04 15:38:19 +01:00
Chun-wei Fan
76dc9e6b53 gtk: fix C99-style variable declarations in various sources 2010-11-10 10:08:14 +08:00
Murray Cumming
d1829ecd74 GtkWidget/GtkContainer: Slight fixes to geometry-management docs.
Replace it's with its in several places.
Replace some , with .
Replace some ; with .
Fix some plurals.
Other minor corrections.
2010-11-04 16:37:54 +01:00
Tristan Van Berkom
d26ac6421b Fixed problems with combination of height-for-width apis and
alignment/margin vfuncs adjust_size_request/allocation

Now get_height_for_width() will internally update the for_width
before passing it to the real height_for_width() vfunc, allowing
margins and extra space for alignments to be stripped, thus requesting
sufficient height for greater than natural widths (and also accounting
for margins properly). Test case adjusted in testadjustsize to ensure
proper behavior.
2010-10-23 00:11:37 +09:00
Benjamin Otte
5e8baa5f63 container: Fix typo that caused madness
Interestingly, this typo has been causing madness since 2 months, but
Mitch complained only today.
2010-10-21 15:31:07 +02:00
Emmanuele Bassi
2cc059a0e7 Split off gtkprivate.h
The gtkprivate.h header contains GtkWidget-specific private symbols that
are not useful except in a handful of cases. Basically everything
includes gtkprivate.h for the GTK_PARAM_* macros.

https://bugzilla.gnome.org/show_bug.cgi?id=632539
2010-10-20 10:34:26 +01:00
Matthias Clasen
d1a9d764a8 Remove gtk_widget_hide_all()
it's useless and a trap for programmers

https://bugzilla.gnome.org/show_bug.cgi?id=438318
2010-10-19 19:31:38 +02:00
Matthias Clasen
921f069269 Remove the outdated faq
It mainly contains information that is already covered in the
API docs, or is outdated, or refers to no longer existing widgets.
2010-10-19 18:22:08 +02:00
Havoc Pennington
031856eb33 Add horizontal and vertical expand flags, compute_expand() to GtkWidget
GtkWidget now has flags for horizontal and vertical expand, and
a compute_expand() method. compute_expand() is used by containers
to set a default expand flag. (If a widget has expand set explicitly,
it always overrides the results of compute_expand.)

GtkContainer has a default implementation of compute_expand which
simply walks over all child widgets and sets expand=TRUE
if any child is expanding.

The overall effect is that you only have to set expand on
leaf nodes in the widget tree, while previously you had to
set expand all the way up the tree as you packed every
container. Also, now containers need not have their own child
properties for expand.

For old containers which do have "expand" child properties,
they should override compute_expand and include the child
properties in whether the container is expand=TRUE.
Also, the old container should use
"child_prop_expand || gtk_widget_compute_expand()" everywhere
it previously used simply "child_prop_expand"

https://bugzilla.gnome.org/show_bug.cgi?id=628902
2010-10-13 10:40:07 -04:00