Benjamin Otte
f5fafb18c9
css: 'transparent' is a valid color everywhere
2012-01-09 18:37:53 +01:00
Benjamin Otte
36e1bcac3c
css: No longer expose internal properties
...
... in gtk_style_properties_lookup_property(). Those properties will
soon stop having pspecs or even being gettable and settable, so better
not tell anyone about it.
2012-01-09 18:37:53 +01:00
Benjamin Otte
73a632a4ae
css: Handle custom properties in a custom object
...
This way we can also get rid of the hack where we required modifying the
pspec after creation, as the name is now a separate property.
2012-01-09 18:37:53 +01:00
Benjamin Otte
55a38f4746
shorthand: Remove a bunch of unused functionality
...
- The unset func is no longer used
- Shorthands can't be printed
- property_parse funcs and initial values aren't used
2012-01-09 18:37:53 +01:00
Benjamin Otte
674485a138
styleproperties: Implement unsetting directly
...
With subproperties, there's no need anymore for custom unset functions.
2012-01-09 18:37:53 +01:00
Benjamin Otte
341a738dc6
styleproperty: Move member variables
...
These variables are only relevant for style properties, but not for
shorthands, so put them there.
2012-01-09 18:37:53 +01:00
Benjamin Otte
d9c5d37e56
shorthand: shorthands can't be inherited
...
... so remove the flag handling.
2012-01-09 18:37:52 +01:00
Benjamin Otte
544d210a61
css: Move a bunch of functions
...
... from GtkStyleProperty to GtkCssStyleProperty.
2012-01-09 18:37:52 +01:00
Benjamin Otte
0a3ac5efbc
styleproperty: Move id handling
...
only real style properties can have an id, so let
GtkCssStylePropertyClass handle it.
2012-01-09 18:37:52 +01:00
Benjamin Otte
edb8bf4b1d
styleproperty: Add gtk_style_property_assign()
2012-01-09 18:37:52 +01:00
Benjamin Otte
c9dc9d5a88
styleproperties: Use _gtk_style_property_get_value_type()
...
... and check the case where the property is not get/settable.
2012-01-09 18:37:52 +01:00
Benjamin Otte
7a4bbc8f35
styleproperty: Add GtkStyleProperty::value-type
2012-01-09 18:37:52 +01:00
Benjamin Otte
7a76694780
styleproperty: Use _gtk_style_property_get_name()
2012-01-09 18:37:52 +01:00
Benjamin Otte
2128b356b2
shorthand: Add a property for all subproperties
2012-01-09 18:37:52 +01:00
Benjamin Otte
4383701e25
styleproperty: unconstify
...
GtkStyleProperty is a real GObject now, so treat it like one and don't
use const.
2012-01-09 18:37:52 +01:00
Benjamin Otte
a3a580d53e
styleproperty: Remove unuse args from register()
...
Those arguments are only relevant for shorthands.
2012-01-09 18:37:52 +01:00
Benjamin Otte
927b922208
styleproperty: Add custom registration func for shorthands
2012-01-09 18:37:52 +01:00
Benjamin Otte
d4344164ac
styleproperty: Move shorthand declarations to new file
2012-01-09 18:37:52 +01:00
Benjamin Otte
6b386dc574
styleproperty: border image is not a generic conversion thingy
2012-01-09 18:37:52 +01:00
Benjamin Otte
4e79ed7f4f
styleproperty: Add a name property
...
And move the properties array to GtkStylePropertyClass.
Also add some docs.
2012-01-09 18:37:52 +01:00
Benjamin Otte
81b2bb0ade
styleproperty: Get rid of _gtk_style_property_is_shorthand()
...
Use GTK_IS_CSS_SHORTHAND_PROPERTY() instead now that we have it.
2012-01-09 18:37:51 +01:00
Benjamin Otte
f9485241b1
styleproperty: Split into shorthand and real style properties
2012-01-09 18:37:51 +01:00
Benjamin Otte
78dc75a350
styleproperty: Make this an object
2012-01-09 18:37:51 +01:00
Benjamin Otte
3e24b5dbbe
styleproperty: Add _gtk_style_property_query()
...
This way, we only need to export one function, not 3.
2012-01-09 18:37:51 +01:00
Benjamin Otte
2573e72f49
styleproperties: Add _gtk_style_properties_peek_property()
2012-01-09 18:37:51 +01:00
Benjamin Otte
38e1c0a2d6
styleproperties: Remove unused function from private header
...
_gtk_style_properties_resolve_property() was added erroneously in
c09148ca09
but was never implemented.
2012-01-09 18:37:51 +01:00
Benjamin Otte
4da493402d
css: 'none' is not a value background-repeat
2012-01-09 18:37:51 +01:00
Benjamin Otte
6fdf6ba68f
css: Remove generic 'none' handling
...
Includes updated tests.
Who could have thought that our tests were broken. Ooops.
2012-01-09 18:37:51 +01:00
Benjamin Otte
7d353fbccf
win32: Fix CSS for 'none' value going away
...
We want colors to be 'transparent' and not 'none'.
2012-01-09 18:37:51 +01:00
Benjamin Otte
c77dba2767
styleproperty: Add custom 'none' handling
...
The generic 'none' handling needs to go, because 'none' is not a valid
value most of the time.
2012-01-09 18:37:51 +01:00
Benjamin Otte
57379adb3c
css: Add generic support for 'inherit' and 'initial'
...
CSS3 says they work for every property, so here we go.
2012-01-09 18:37:51 +01:00
Benjamin Otte
a6ac53e2a9
css: Change prototype of _gtk_css_selector_matches()
...
Passing the length of the widget path that is relevant is not necessary
anymore, it was only useful for inheritance. Instead, we now pass the
state flags and let the selector do the state matching for us.
2012-01-09 18:37:50 +01:00
Benjamin Otte
a3225fdd42
cssprovider: Remove has_inherit flag from rulesets
...
It's not used anymore
2012-01-09 18:37:50 +01:00
Benjamin Otte
40a7618d2a
cssprovider: Don't do inheritance anymore
...
Its' done in GtkCssLookup with the help of GtkStyleContext::parent now.
2012-01-09 18:37:50 +01:00
Benjamin Otte
fbedcdaf7d
css: Make CSS resolving work according to spec
...
See inline code comments taken from
http://dev.w3.org/csswg/css3-cascade/#cascade
This now respects the special values "inherit" and "initial" properly.
Note that those values cannot be parsed yet. This will be added in a
future commit.
2012-01-09 18:37:50 +01:00
Benjamin Otte
5a815e2159
styleproperty: Add _gtk_style_property_get_initial_value()
2012-01-09 18:37:50 +01:00
Benjamin Otte
242893a031
css: Pass the parent context to _gtk_css_lookup_resolve()
...
This way, we can resolve inherit properties.
2012-01-09 18:37:50 +01:00
Benjamin Otte
0ac519e8a1
widget: Set parent style context
2012-01-09 18:37:50 +01:00
Benjamin Otte
b50d2b74d7
API: Add GtkStyleContext::parent
...
We need this for proper support of CSS inherit.
2012-01-09 18:37:50 +01:00
Benjamin Otte
aa4925480d
styleproperty: Pass initial value explicitly
2012-01-09 18:37:50 +01:00
Benjamin Otte
4d15186e67
css: Add GtkCssSpecialValue
2012-01-09 18:37:50 +01:00
Benjamin Otte
6dd50c6cca
css: Add some docs to GtkCssLookup
...
In particular, document which parts of the CSS value querying we're
doing here.
2012-01-09 18:37:50 +01:00
Benjamin Otte
ba5e7012b1
css: Redo StyleProvider interface
...
We now use the GtkStleProviderPrivate interface, which hopefully is
faster and more conformant to CSS. Long term, it definitely should be
both.
I would have liked to split this up into multiple commits, but couldn't
find a way.
2012-01-09 18:37:50 +01:00
Benjamin Otte
38a9b28a0e
styleproperties: Add a hacky function to redirect color lookups
...
This will soon be necessary.
FIXME: Make sure this gets removed again.
2012-01-09 18:37:49 +01:00
Benjamin Otte
c048aac1d9
symboliccolor: Add _gtk_symbolic_color_resolve_full()
2012-01-09 18:37:49 +01:00
Benjamin Otte
899a381d31
stylecontext: Separate properties by states
...
We don't want to mix states the wrong way. And the current approach does
that.
2012-01-09 18:37:49 +01:00
Benjamin Otte
a488d2184a
stylecontext: Pass state to style data lookup function
2012-01-09 18:37:49 +01:00
Benjamin Otte
cdb3f05bf1
css: Add _gtk_style_property_get_count()
2012-01-09 18:37:49 +01:00
Benjamin Otte
54d2b9dbc2
cssprovider: Keep a bitmask for the properties
...
That way we can easily tell wich properties are in use.
2012-01-09 18:37:49 +01:00
Benjamin Otte
eb38591c91
css: Add _gtk_style_property_get_id()
2012-01-09 18:37:49 +01:00
Benjamin Otte
f6cf447cad
styleproperty: Assign a unique id to every styleproperty
2012-01-09 18:37:49 +01:00
Benjamin Otte
eddd36d1d9
tests: Add tests for GtkBitmask
2012-01-09 18:37:49 +01:00
Benjamin Otte
45b9193290
gtk: Add GtkBitmask
...
The CSS code likes to have that very much.
2012-01-09 18:37:49 +01:00
Stefan Sauer
f7d3ca46f7
gtkscale: fix bogus compare func
...
The GtkScaleMark values are gdouble, a simple a-b compare func would fail for
values with the same integer value. This breaks the sorting and causes random
marker label placement.
2012-01-09 18:33:11 +01:00
Rui Matos
052c6e0681
scrolledwindow: Render the background so that it can be styled
2012-01-09 16:45:44 +00:00
Rui Matos
09979513b2
window: Stop setting state flags on the style context for drawing
...
This also removes setting the FOCUSED state flag when
gtk_window_has_toplevel_focus() since this effect can now be done with the new
WINDOW_UNFOCUSED flag instead which actually works better regarding X grabs
and modal windows.
2012-01-09 16:45:44 +00:00
Rui Matos
440663f3fe
treeview: Use the widget state flags as a base for drawing expanders
2012-01-09 16:45:44 +00:00
Rui Matos
2972236fdb
treeview: Stop setting state flags on the style context for drawing
2012-01-09 16:45:44 +00:00
Rui Matos
76485b8670
trayicon-x11: Stop setting state flags on the style context for drawing
2012-01-09 16:45:44 +00:00
Rui Matos
8bb0773535
toolitemgroup: Use the widget state flags as a base for drawing
2012-01-09 16:45:44 +00:00
Rui Matos
4011326388
toolbar: Stop setting state flags on the style context for drawing
2012-01-09 16:45:44 +00:00
Rui Matos
a1f72eb06c
Revert "button: Stop setting state flags on the style context for drawing"
...
Setting state flags is actually needed here since this function is called by
GtkButton subclasses which add their specific state flags as a parameter.
This reverts commit e868b8d6ea
.
2012-01-09 16:45:44 +00:00
Rui Matos
2efa658a41
textdisplay: Use the widget state flags as a base for drawing
2012-01-09 16:45:44 +00:00
Rui Matos
b203ea2f93
spinner: Stop setting state flags on the style context for drawing
2012-01-09 16:45:44 +00:00
Rui Matos
e9549a7514
spinbutton: Use the widget state flags as a base for drawing
2012-01-09 16:45:43 +00:00
Rui Matos
9118ccb02d
separator: Stop setting state flags on the style context for drawing
2012-01-09 16:31:11 +00:00
Rui Matos
95caabac03
scale: Stop setting state flags on the style context for drawing
2012-01-09 16:31:11 +00:00
Rui Matos
b2f5959147
range: Use the widget state flags as a base for drawing
2012-01-09 16:31:11 +00:00
Rui Matos
6dd0bd5536
radiobutton: Use the widget state flags as a base for drawing
2012-01-09 16:31:11 +00:00
Rob Bradford
4007449a58
application: Correct the fallback definition for gtk_application_end_session
...
The function definition used a pointer to the enum value rather than the enum
itself.
This broke the build on platforms that don't have an implmentation of these
functions.
2012-01-09 15:09:27 +00:00
Ryan Lortie
cf2590d673
GtkButton: do not allow both types of actions
...
Only allow one of 'action-name' or 'related-action' to be set.
https://bugzilla.gnome.org/show_bug.cgi?id=667394
2012-01-09 15:02:10 +01:00
Ryan Lortie
88ec007b98
Add new GtkActionable interface
...
This is the interface for GtkWidgets that can be associated with an
action on a GtkAppicationWindow or associated GtkApplication.
It essentially features 'action-name' and 'action-target' properties
with some associated convenience API.
This interface is implemented by GtkButton and GtkToolButton.
https://bugzilla.gnome.org/show_bug.cgi?id=667394
2012-01-09 15:02:06 +01:00
Murray Cumming
395bf54b8e
gtkmain.h: Used GDK_DEPRECATED
...
If we use just G_GNUC_DEPRECATED then it cannot be disabled by
an ifdef.
2012-01-09 14:20:49 +01:00
Matthias Clasen
69a529572d
Revert "GtkWindow: new API to store state in GSettings"
...
This reverts commit 730765de91
.
This needs more thought, committing it on the same day as filing
the bug was premature.
2012-01-09 00:53:53 -05:00
Matthias Clasen
2ef4621e05
Fix up symbol lists
2012-01-09 00:31:20 -05:00
Matthias Clasen
f3533e4fc2
Fix the gtk_application_end_session implementation
...
We were passing the wrong flags, causing the meaning of
the request_confirmation parameter to be inverted.
2012-01-08 02:16:26 -05:00
Matthias Clasen
d2ed87fbdc
Fix doc build
2012-01-07 21:47:42 -05:00
Matthias Clasen
f78696f3d0
GtkApplication: only allow quit_response when it make sense
...
This check was present in the OS X implementation, but it
makes sense in the D-Bus implementation as well.
2012-01-07 20:01:23 -05:00
Matthias Clasen
00d5214695
Remove some debug spew
2012-01-07 19:55:20 -05:00
Matthias Clasen
bb957e5389
GtkApplication: Add OS X implementation from EggSMClient
2012-01-07 19:52:14 -05:00
Paolo Borelli
7c8130dada
Change param name to make gtk-doc happy.
2012-01-07 18:06:59 +01:00
Benjamin Otte
f6d2f4fa8d
application: return a value
2012-01-07 15:56:26 +01:00
Martin Pitt
700a334d87
gtkapplication.c: Fix syntax error
...
Previous commit accidentally removed the closing } from
gtk_application_end_session(). Add it back to unbreak the build.
2012-01-07 10:04:18 +01:00
Matthias Clasen
916009b5d6
Add a trivial implementation of the new apis
...
For non-X11, this is just a placeholder until we get around
to moving the EggSMClient implementations over.
2012-01-07 03:20:56 -05:00
Matthias Clasen
48872705f0
Document the new apis
2012-01-07 03:20:56 -05:00
Matthias Clasen
3142d13972
Add gtk_application_end_session
...
This function allows applications to request that
the user session be ended by logout/shutdown/reboot.
2012-01-07 03:20:56 -05:00
Matthias Clasen
bdd7e15c84
GtkApplication: Add an inhibit api
...
This lets applications block logout and similar actions ahead
of time. Currently only implemented for D-Bus, but Windows has
very similar API since Vista.
2012-01-07 03:20:56 -05:00
Matthias Clasen
3133791302
GtkApplication: Add logout notification
...
This is fairly basic, allowing applications to learn when
the session manager is about to end the session, and possibly
block this. The only implementation at this point is using the
org.gnome.SessionManager D-Bus interface of gnome-session. It should
be straightforward to port the EggSMClient implementations for
Windows and OS X.
2012-01-07 03:20:56 -05:00
Ryan Lortie
730765de91
GtkWindow: new API to store state in GSettings
...
https://bugzilla.gnome.org/show_bug.cgi?id=667438
2012-01-06 16:18:48 -05:00
Ryan Lortie
d47c3ac9e4
GtkBuilder: support parsing GVariant properties
...
https://bugzilla.gnome.org/show_bug.cgi?id=667394
2012-01-06 16:18:48 -05:00
Zeeshan Ali (Khattak)
1996618569
gtkspinbutton: Don't hilight buttons when !editable
...
Don't hilight the buttons on mouse over when 'editable' property is set to
'FALSE.
https://bugzilla.gnome.org/show_bug.cgi?id=667229
2012-01-06 18:35:37 +02:00
Matthias Clasen
7df5cf2a3a
GtkApplication: Rename a member for clarity
...
'session' is a bit ambiguous (and GtkApplication may grow session
management support at some point), so rename the bus connection
to 'session_bus'.
2012-01-05 23:53:40 -05:00
Matthias Clasen
c74ac08143
Another attempt at fixing menu positioning corner cases
...
The code for moving the menu into monitor / workarea was duplicated,
once for the push-in scenario and once for without. The problem with
the second case is that we've stored the menu position before adjusting
it. That made us remember an out-of-monitor position that then later
triggered _another_ copy of this code in the size-request implementation.
Unify this to only have one copy of code, and only store the menu
position after adjusting it to be inside the monitor. This fixes both
statusicon menus that get popped up from the panel, outside the workarea,
to not have scroll arrows, and the gedit language menu which was not
placed in the monitor at all after the initial workarea commit.
As a side-effect of this change, we now make large scrolling menus
occupy the full height of the workarea. Before this change, we were
keeping either the top or bottom edge put while shrinking the menu
to fit in the monitor.
https://bugzilla.gnome.org/show_bug.cgi?id=667249
2012-01-05 23:30:41 -05:00
Benjamin Otte
00e84f1cdb
label: Avoid deprecation warning
2012-01-06 05:23:43 +01:00
Benjamin Otte
42d0a6de23
label: Actually mark visited labels as visited
...
A recalculate will clear the labels and compute them again, which will
clear the information if something was visited...
2012-01-06 05:23:43 +01:00
Benjamin Otte
d6bb8a63aa
label: Make attr_list_merge() use sane merging rules
...
Instead of "attribute with later start index wins, make sure the
attribute list that is merged from takes precedence. This now gives the
multiple attribute lists we use in the label an order:
1) gtk_label_set_attributes()
These attributes override everything. It's what the function's there
for after all.
2) markup of label
Other user-specified attributes come next.
3) attributes for links
When we apply custom attributes on parts of the text, we put them
last. We don't want to mess with what the user does. Also, we change
color and underline, so we usually have something to show.
2012-01-06 05:23:42 +01:00
Benjamin Otte
e78e4d8dd8
label: Rename variable
...
The effective attributes aren't that anymore. They're now just the
attributes from the parsed markup.
2012-01-06 05:23:42 +01:00
Benjamin Otte
f1c9a3e633
label: Don't excessively recalculate
...
We don't merge attributes anymore, so no need to call the function that
used to do this job.
2012-01-06 05:23:42 +01:00
Benjamin Otte
396b177e3b
label: Redo attribute application
...
- Don't compute link color attributes until layout creation
This is useful as a performance enhancement, because we don't have to
lookup the property after setting the text, so multiple markup sets
don't cost style lookups.
- Don't merge attrs into effective_attrs
We do this when applying link colors now. Keeping them separate allows
invalidating them separately.
2012-01-06 05:23:42 +01:00
Benjamin Otte
15ac572822
ilabel: Redo gtk_label_get_link_colors()
...
Don't pass out an allocated color, assign it instead. Gets rid of having
to call gdk_color_free() all the time.
2012-01-06 05:23:42 +01:00