Commit Graph

229 Commits

Author SHA1 Message Date
Benjamin Otte
05f2249d08 css: Make outline-offset a number property 2012-04-17 08:59:18 +02:00
Benjamin Otte
ac6d61f6bb cssvalue: Add GtkCssShadowsValue
This is necessary because shadows get treated differently from other
lists when transitioning.
2012-04-17 08:59:18 +02:00
Benjamin Otte
ca17270187 cssvalue: Make GtkCssShadowValue only hold one shadow
All the properties now are a GtkCssArrayValue of GtkCssSadowValue.
GtkCssArrayValue already does everything we want, so no need to
duplicate its funtionality.
2012-04-17 08:59:17 +02:00
Benjamin Otte
c5878e8f6f themingengine: Make _gtk_theming_engine_paint_spinner() args const 2012-04-17 08:59:17 +02:00
Benjamin Otte
31565139ba stylecontext: Convert _gtk_style_context_peek_property()
Take the property id instead of the name.
2012-04-17 08:59:15 +02:00
Benjamin Otte
b65d17dda8 cssvalue: Make border styles be their own value
... and add them via gtkcssenumvalue.[ch] which will be used for all
enums.
2012-04-17 08:59:14 +02:00
Benjamin Otte
58b6d492b8 cssvalue: Add a custom RGBA value
Note: custom CSS properties still use the default GtkCssValue and always
will.
So there is a difference in css values used between those, even though
they both carry a GdkRGBA payload.
2012-04-17 08:59:14 +02:00
Benjamin Otte
645309e98b shadow: Also rename files 2012-04-17 08:59:14 +02:00
Benjamin Otte
ec5c77a552 shadow: Rename to GtkCssShadowValue
I don't want to confuse css values with other stuff, so there.
2012-04-17 08:59:13 +02:00
Benjamin Otte
ccd443796c shadow: Make this a GtkCssValue 2012-04-17 08:59:13 +02:00
Benjamin Otte
281d094b42 theming: Use peek_property() calls to query shadows 2012-04-17 08:59:13 +02:00
Alexander Larsson
7603e6e473 css: Use GtkCssValues instead of GValue in the css machinery
Also, in places where we're computing a new CssValue based on an
old one, make sure that if nothing changes we're returning a reference
to the old one, rather than creating a new identical instance.
2012-03-08 11:03:57 +01:00
Javier Jardón
9d0febc9a6 Change FSF Address 2012-02-27 17:06:11 +00:00
Chun-wei Fan
72482c335d Bug 670499-gtkthemingengine.c: Include fallback-c89.c
This is due to the use of round and nearbyint() function, which are C99 functions...
2012-02-23 12:23:59 +08:00
Cosimo Cecchi
ae132c0a1a roundedbox: add _apply_border_radius() variations for engine/context
And make the base function just use the raw corner radii struct.
2012-02-14 16:36:56 -05:00
Cosimo Cecchi
4c61f1f663 themingengine: add a private _gtk_theming_engine_get_context()
We'll need this later.
2012-02-14 16:36:56 -05:00
Benjamin Otte
a63ff72406 css: Convert border-radius to GtkCssNumber
We can do % now, wohoo!
2012-02-02 03:14:00 +01:00
Benjamin Otte
82c2dad178 themingengine: Add a private function to query lengths 2012-02-02 03:14:00 +01:00
Benjamin Otte
7a00a95508 themingengine: Move border-image handling into render_frame_internal()
This fixes 2 bugs:
1) extensions didn't get border images
2) border-images caused outlines to not be drawn
2012-01-09 18:38:00 +01:00
Benjamin Otte
c15839f4be themingengine: Implement outline support 2012-01-09 18:38:00 +01:00
Benjamin Otte
68cfb80631 themingengine: Split out the border drawing function 2012-01-09 18:38:00 +01:00
Benjamin Otte
1b9e15485e themingengine: Implement 'dotted' and 'dashed' 2012-01-09 18:38:00 +01:00
Benjamin Otte
998055c835 css: Introduce GtkCssSide
... and use it.

This is basically an encoding of the order of sides in CSS. So when
parsing things, this is the way we parse things in.
2012-01-09 18:37:59 +01:00
Benjamin Otte
9e8e9a77b7 themingengine: Implement ridge and groove 2012-01-09 18:37:59 +01:00
Benjamin Otte
4ce34a8e13 themingengine: Redo color handling
Don't work on malloc()ed colors. Instead, use an array on the heap. This
makes it easier to copy the array.
2012-01-09 18:37:59 +01:00
Benjamin Otte
d21e7506e7 themingengine: Refactor drawing code
... and implement 'double' border-style as proof-of-concept.
2012-01-09 18:37:59 +01:00
Paolo Borelli
b8aea82743 Use the border-style subproperties for drawing
Use the newly introduced per-side property to draw frames.
2012-01-09 18:37:59 +01:00
Benjamin Otte
066f3be659 themingengine: Remove an optimization
We optimize the case later on, so no need to do it here.
2012-01-09 18:37:58 +01:00
Benjamin Otte
fce45757cb borderimage: Change memory management
Making it a on-stack object simplifies things a lot.
2012-01-09 18:37:58 +01:00
Benjamin Otte
84bc280440 borderimage: Add _gtk_border_image_new_for_context()
and use it.
2012-01-09 18:37:57 +01:00
Benjamin Otte
53b4fd69db themingengine: Add _gtk_theming_engine_peek_property()
This is useful for getting at computed values and allows accessing
images before the code autoconverts them to a cairo pattern.
2012-01-09 18:37:57 +01:00
Benjamin Otte
9181282d88 style: Remove GtkStylePropertyContext again
We need to solve this differently. I have no idea yet how, but I'll
invent something later.

This only affects win32 theming and that's broken anyway.
2012-01-09 18:37:56 +01:00
Benjamin Otte
8ab426e6d5 themingengine: Don't use GtkBorderRadius struct
use GtkBorderCornerRadius instead. Also, don't do NULL checks anymore,
the property is guaranteed to never return NULL.
2012-01-09 18:37:54 +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
Cosimo Cecchi
a7f3a9ff74 themingengine: split a GtkThemingBackground object
Allows easier modification and general sanity of the CSS background
rendering code.
2011-12-12 12:46:52 +01:00
Cosimo Cecchi
ae60f00ba4 themingengine: fix a typo 2011-11-29 10:52:03 -05:00
Cosimo Cecchi
41b56d87e7 themingengine: move code to make switch-case more clear
Code is more readable with the default case as the last one in the
switch block.
2011-11-29 10:52:02 -05:00
Alexander Larsson
eb44036346 Support border-image in theme_engine_render_frame_gap
This is similar to the normal frame rendering, but has a clip
region applied for the gap.
2011-11-28 10:05:29 +01:00
Alexander Larsson
75642d3af2 css: Always draw the bg color under the bg image 2011-11-25 16:14:20 +01:00
Alexander Larsson
8411f1a279 Implement background-clip and background-origin 2011-11-25 16:14:19 +01:00
Alexander Larsson
5e04549548 Render background image if set for checks and options
The default theme engine draws a fallback check/radio image, but
doesn't let you replace this. We now check if a background image
is set and if so render that instead of the default fallbacks.
2011-11-17 12:30:09 +01:00
Alexander Larsson
2cf3ff956a Actually pass in a StylePropertyContext when getting images
This is in preparation for getting size-dependent results back
with the win32 themes.
2011-11-17 12:27:23 +01:00
Alexander Larsson
c09148ca09 Add GtkStylePropertyContext and use it in when getting style properties
At the toplevel we have _gtk_theming_engine_get, which lets us pass
in a property context with (atm) the size to get the property for.
Then there is a lot of plumbing to push this down into the lower
layers of the style property code until finally hitting
the property resolvers.

I need this because I will be adding a property resolver for win32
theme parts, and they render differently depending on the size
(i.e. they don't scale linearly). The idea is that the code
to get the background properties will pass in the final size
and we will resolve the theme part specification to that particular
size.

If the old non-context calls are used we just hardcode a size
of 100x100.
2011-11-17 12:27:22 +01:00
Cosimo Cecchi
f9d16f3923 themingengine: set the cairo extend to PAD when we're stretching bg
This avoids artifacts around the borders due to bilinear filtering cairo
applies to the surface pattern when stretching it.

https://bugzilla.gnome.org/show_bug.cgi?id=663522
2011-11-08 12:41:28 -05:00
Marc-André Lureau
3b436eec6d css: start background-repeat
By default, a background image is stretched. Instead, it is worth to
have a tiled background.

This patch allows background surfaces to be repeated or not, and should
be compatible with future extensions and CSS.

https://bugzilla.gnome.org/show_bug.cgi?id=663522
2011-11-08 11:10:44 -05:00
Michael Natterer
2688ccdbc4 gtk: clean up the private horror
- add gtkmodulesprivate.h and move stuff there from gtkprivate.h
- add gtkprivate.c and move stuff there from gtkmain.c
- add gtkwin32.c and move stuff there from gtkmain.c
- don't redefine GTK_DATADIR and friends in gtkprivate.h
- have _gtk_get_datadir() and friends on all platforms
- remove the horrid hacks where gtkprivate.h can't be included,
  or must be included later due to redefinition of the compile-time
  directories
2011-10-22 23:53:55 +02:00
Cosimo Cecchi
39f0a60792 themingengine: remove unused variable 2011-09-06 15:01:09 -04:00
Cosimo Cecchi
f5e758bd60 themingengine: remove xthickness FIXME from gtk_render_line() code
The gtk_render_line() code has a FIXME (coming from the 2.x migration I
suppose) about using xthickness, and it actually hardcodes two lines of
different color instead of drawing a single one.
Since we don't support xthickness anymore, make gtk_render_line() do
what it says, i.e. just draw an 1px line colored with the current
color.

https://bugzilla.gnome.org/show_bug.cgi?id=657963
2011-09-02 15:11:53 -04:00
Benjamin Otte
47635a2434 themingengine: Return NULL for nonexistant theming engines
his also makes the function conform to its documentation.
2011-07-21 02:43:54 +02:00
Benjamin Otte
b0b287f7b5 themingengine: Use the default way of indicating privates 2011-07-21 02:43:54 +02:00