Commit Graph

14086 Commits

Author SHA1 Message Date
Matthias Clasen
8143ce69eb GtkApplication: Add window-added/-removed signals
This is useful to let unrelated parts of an application (or
plugins) learn about the windows of an application. Based
on a patch by Matt Barnes,
https://bugzilla.gnome.org/show_bug.cgi?id=641087
2011-05-31 19:12:13 -04:00
Matthias Clasen
75390b2d60 Sort GtkApplication windows by most-recently-focused
Based on a patch by Matt Barnes,
https://bugzilla.gnome.org/show_bug.cgi?id=624539
2011-05-31 18:28:55 -04:00
Javier Jardón
fb9e4c2c37 all: avoid boxed structs copying where possible (and 2)
Use the GtkStyleContext accessors for boxed properties where possible,
to reduce allocations.
2011-05-31 19:18:11 +02:00
Javier Jardón
e5c7daa828 tests: avoid boxed structs copying where possible
Use the GtkStyleContext accessors for boxed properties where possible,
to reduce allocations.
2011-05-31 19:12:24 +02:00
Carlos Garnacho
20433efbfa gtkcssprovider: Free shorthand border GValues in the right place
The call to gtk_border_free() within unpack_border() felt completely
in the wrong place, as the border actually pertains to the GValue
being unpacked. Plus, the GValue itself was also being leaked.
2011-05-30 19:29:22 +02:00
Carlos Garnacho
2c8e01dc80 gtkcssprovider: plug several leaks
In finalize(), clear all rulesets.
In parse_declaration(), Free the GValue under unhandled error situations.
In gtk_css_provider_load_internal(), Do not leak the file contents.
2011-05-30 19:26:28 +02:00
Carlos Garnacho
de4ca3ae13 gtkstyleproperty: Plug two leaks
In rgba_value_parse(), unref the symbolic color once we've resolved it.
In gradient_value_parse(), take the GtkGradient so we leave no dangling
references.
2011-05-30 19:21:42 +02:00
Carlos Garnacho
b68172b2c6 gtkstyleproperties: zero GValue out before using G_VALUE_COLLECT_INIT()
Fixes invalid reads in valgrind
2011-05-30 19:18:41 +02:00
Carlos Garnacho
747dc65c2c gtkcssprovider: Use g_slice_dup() to copy GValues around
GValues stored in GtkCssRulesets are gslice managed, so don't
g_memdup() GValues from shorthand properties. This fixes
memory corruptions when reloading contents in a GtkCssProvider.
2011-05-30 19:13:36 +02:00
Benjamin Otte
3500063bc1 liststore: Replace macro with an inline function
Also remove a duplicate check in gtk_list_store_iter_is_valid().

gcc was complaining about "comparison always true" when using the macro.
2011-05-27 16:11:10 +02:00
Benjamin Otte
0b653abcd4 styleproperties: Remove unused priv variables 2011-05-27 16:11:10 +02:00
Benjamin Otte
c5af8c7e3a treeview: Remove unused variables
... and all the code doing complex computations to assign values to
them.
2011-05-27 16:11:10 +02:00
Benjamin Otte
c1b2cbcf50 button: Remove unused variables 2011-05-27 16:11:10 +02:00
Benjamin Otte
d1a8d73871 css: Constify path argument to _css_selector_matches()
It should have been const all the time, but I assumed widgetpath code
wasn't properly const. PEBKAC.
2011-05-27 16:11:09 +02:00
Benjamin Otte
f4b7b287b9 widgetpath: Make includes absolute
Just like everywhere else
2011-05-27 16:11:09 +02:00
Benjamin Otte
f6ffd6df8a menuitem: Remove unused variable
Seriously, can't people compile with -Werror? Broke with
5f2ef59d69
2011-05-27 16:11:09 +02:00
Benjamin Otte
7b94a6ff2f styleproperty: Fix memleak in unpacking code 2011-05-27 16:11:09 +02:00
Benjamin Otte
f4e730e718 menuitem: Fix copy/paste error
Thanks to Kalev Lember for noticing this one.
2011-05-27 16:11:09 +02:00
Matthias Clasen
9fd0458f1c Simplify GtkLockButton
Now it is actually just a button, which makes things simpler
and is closer to what the designers want.
2011-05-25 20:19:08 -04:00
Benjamin Otte
5f2ef59d69 menuitem: Position submenus properly
Now that we can actually query the menu's size, don't query the
preferred minimum size and hope it's correct, but use its actual size.
2011-05-25 04:49:12 +02:00
Benjamin Otte
067dc19177 menu: Realize window before positioning
We want the menu realized so we know the size it's allocating to itself.
And we need that size to position the menu properly.
This is best visible on right-to-left.
2011-05-25 04:48:20 +02:00
Benjamin Otte
8cfcb2c123 paned: More fixes to keep windows in sync with widgets
Fixes sidebar in evince not showing up. This was caused by the
visiblility of the widget changing and the paned not fixing its child
window's visibility accordingly.
2011-05-25 04:27:15 +02:00
Kjell Ahlstedt
2ebe1ef6f2 bgo#642929 - Don't infinite-loop in GTK_FILE_CHOOSER_ACTION_CREATE_FOLDER
If the user pressed Enter to confirm the file chooser while the filename entry
was empty, then gtk_file_chooser_default_should_respond() would go back and forth
between the cases for handling the filename entry and the file list.
2011-05-23 15:02:00 -05:00
Benjamin Otte
7de5a4e08d cssprovider: Don't convert widget style properties to CSS
They are still CSS, so converting them is wrong.
2011-05-23 15:56:09 +02:00
Benjamin Otte
7836df29cb cssprovider: Use right hash table when printing
If the CSS provider had widget style properties, printing them would
crash since 82b340f6f0
2011-05-23 15:56:09 +02:00
Benjamin Otte
97a8ff80cc window: Only draw resize grip if its window exists
Don't rely on priv->resize_grip_visible as the code comment in the
variable declaration indicates.
This fixes warnings with GtkPlug, which can cause resize_grip_visible to
be TRUE but grid_window to be NULL - running tests/teststatusicon
reproduces this.

This broke with 7ef113ce56
2011-05-23 15:56:09 +02:00
Matthias Clasen
f30efa7759 Remove unused function attributes from symbol files 2011-05-22 23:39:48 -04:00
Benjamin Otte
4c6721d096 cssparser: Fix typo where we used "uint" for a type
Interestingly this works for gcc, but breaks on MSVC.
2011-05-22 06:07:45 +02:00
Benjamin Otte
21236cf270 style: Make margin a shorthand
... and add the real properties:
- margin-top
- margin-left
- margin-bottom
- margin-right
2011-05-22 05:56:12 +02:00
Benjamin Otte
a35aa96149 style: Make padding a shorthand
... and add the real properties:
- padding-top
- padding-left
- padding-bottom
- padding-right
2011-05-22 05:56:12 +02:00
Benjamin Otte
962ecc6fa5 shadow: Redo shadow implementation for rotations
The shadows went bonkers when the labels were rotated
2011-05-22 05:56:12 +02:00
Benjamin Otte
ec34c4bd83 themingeninge: Handle translations properly
We want to keep the location of where to render, but transform th
context by the pango transform.
2011-05-22 05:56:12 +02:00
Benjamin Otte
03fbb1f34f label: Account for y-translation when rotating 2011-05-22 05:56:11 +02:00
Benjamin Otte
f5c7cefcca style: Convert border-width to a shorthand
Add the corresponding properties it refers to, too:
- border-top-width
- border-left-width
- border-bottom-width
- border-right-width
2011-05-22 05:56:11 +02:00
Benjamin Otte
42a4bd1c5b style: Add support for shorthand properties
Shorthand properties are basically the same a in CSS. For storage in
style properties or the CSS provider, they are unpacked into the real
values, so it is possible to partially override them.

No properties are yet converted to the new world yet, this is just the
code for supporting them.
2011-05-22 01:25:17 +02:00
Benjamin Otte
70e654f1a5 stylepropertis: Use set_by_property() in set_valist()
... instead of duplicating code. This causes an extra g_value_copy().
If that turns out to be a performance issue, we can invent something
that handles this (like passing a gboolean take_value).

The reason for this duplication deletion is that we want to complicate
the setting code to handle shorthands by unpacking them and storing the
separate values.
2011-05-22 01:25:16 +02:00
Benjamin Otte
73c39f5b16 styleproperties: Add _gtk_style_properties_set_property_by_property()
... as a replacement for _gtk_style_properties_set_property_by_pspec().
We'll need that to handle shorthands.
2011-05-22 01:25:16 +02:00
Benjamin Otte
b67ae42ecd styleproperties: Use peek_property() in get_valist() 2011-05-22 01:23:43 +02:00
Benjamin Otte
0a368fe622 styleproperties: Validate values when setting them
Note that validation is not necessary when resolving, because all values
are valid for those cases.
2011-05-22 01:23:36 +02:00
Benjamin Otte
e7db090620 styleproperties: Remove needless check 2011-05-21 22:49:43 +02:00
Benjamin Otte
b889f499a7 styleproperties: Use peek_property in get_property
... instead of duplicating the code.
2011-05-21 22:49:43 +02:00
Benjamin Otte
5f5cc79623 styleproperties: Adapt _gtk_style_properties_peek_property()
Optionally return the GtkStyleProperty that was looked up. This feature
isn't used yet, but will soon be.
2011-05-21 22:49:43 +02:00
Benjamin Otte
727a839d71 styleproperties: Move the style property handling code
... from gtkstyleproperties.c to gtkstyleproperty.c
2011-05-21 22:49:43 +02:00
Benjamin Otte
5eca8f8275 css: Rename gtkcssstrfuncs file to gtkstyleproperty
The idea is to handle the style property registering etc in this file
instead of the styleproperties file. The next commits will move those
files.
2011-05-21 22:49:43 +02:00
Benjamin Otte
e64b220791 stringfuncs: Remove _gtk_css_parse_url() from header
No code changes, just moving the function in the c file so it doesn't
need to be forward-declared.
2011-05-21 22:49:43 +02:00
Benjamin Otte
548a1302ee cssprovider: Use _gtk_style_property_lookup()
This way we get the actual data node and can use it.
2011-05-21 22:49:43 +02:00
Benjamin Otte
777a6846db styleproperties: Put gtk_style_property_lookup() in private header 2011-05-21 22:49:43 +02:00
Benjamin Otte
0f211f78a5 styleproperties: Class ref no longer necessary
Now that we initialize the pspecs on-demand, we can avoid the class ref.
2011-05-21 22:49:43 +02:00
Benjamin Otte
85e900b522 styleproperties: Init the default properties when they're needed
Instead of initing the default style properties in the class_init
func of the style properties, init them when they are first needed -
when they are queried or when new ones are registered.

That way, they will always be available.
2011-05-21 22:49:42 +02:00
Benjamin Otte
a2200e8971 styleproperties: constify gtk_style_property_lookup() 2011-05-21 22:49:42 +02:00