Merge lp:~albyrock87/awn/awn-lucido into lp:awn/0.4
- awn-lucido
- Merge into trunk
Status: | Superseded |
---|---|
Proposed branch: | lp:~albyrock87/awn/awn-lucido |
Merge into: | lp:awn/0.4 |
Diff against target: |
1384 lines (+1087/-13) 12 files modified
awn-settings/awn-settings.ui (+34/-0) awn-settings/awnDefs.py.in (+1/-0) awn-settings/awnSettings.py.in (+6/-1) data/avant-window-navigator.schema-ini.in.in (+7/-1) src/Makefile.am (+2/-0) src/awn-background-flat.c (+10/-6) src/awn-background-lucido.c (+839/-0) src/awn-background-lucido.h (+71/-0) src/awn-background.c (+91/-4) src/awn-background.h (+16/-0) src/awn-defines.h (+1/-0) src/awn-panel.c (+9/-1) |
To merge this branch: | bzr merge lp:~albyrock87/awn/awn-lucido |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Michal Hruby (community) | Needs Fixing | ||
Alberto Aldegheri | Abstain | ||
Review via email: mp+26383@code.launchpad.net |
This proposal supersedes a proposal from 2010-05-27.
This proposal has been superseded by a proposal from 2010-05-31.
Commit message
Description of the change
This is a rewrite of awn-style-lucido.
Implemented a new style, features:
- Stripe-style
- The number of stripes changes dynamically depends on "expanders"
- If you set stripe-width>0, you can manually set the stripe position and width
- Fixed all-orientation cairo "translate"
- custom curved style if panel is not expanded
- speedup code for draw background only when need (otherwise repaint last surface)
:)
Alberto Aldegheri (albyrock87) wrote : Posted in a previous version of this proposal | # |
Michal Hruby (mhr3) wrote : Posted in a previous version of this proposal | # |
> WTF!!!
>
> Why BZR removes 'po/avant-
> file?????
There's a bug in the build system, make clean removes it, please revert the change.
Also there are a lot of lines which break our coding conventions, I know it might sound trivial, but for the review process it makes it easier to read the code. Fix please.
Alberto Aldegheri (albyrock87) wrote : Posted in a previous version of this proposal | # |
> > WTF!!!
> >
> > Why BZR removes 'po/avant-
> > file?????
>
> There's a bug in the build system, make clean removes it, please revert the
> change.
> Also there are a lot of lines which break our coding conventions, I know it
> might sound trivial, but for the review process it makes it easier to read the
> code. Fix please.
'po/avant-
Conding style fixes :)
Default Stripe-Width = 0 (enables auto-stripe)
moonbeam (rcryderman) wrote : Posted in a previous version of this proposal | # |
Seems to be leaking:
revision: 707.
After leaving it running 12-24 hours.
mapped: 1539380K writeable/private: 1297488K shared: 816K
Alberto Aldegheri (albyrock87) wrote : Posted in a previous version of this proposal | # |
> Seems to be leaking:
>
> revision: 707.
>
> After leaving it running 12-24 hours.
>
> mapped: 1539380K writeable/private: 1297488K shared: 816K
I'm very sorry for that :'(
Now it's fixed (rev 710) :)
Michal Hruby (mhr3) wrote : Posted in a previous version of this proposal | # |
Thanks for the style fixes. Here are my comments:
1) When using cairo methods, please use doubles directly, don't have the compiler do it ( cairo_scale (cr, 1, -1) => cairo_scale (cr, 1., -1.) )
2) You're using the expander detection quite often, move it to a function (at least the g_object_get() + gtk_container_
3) Get rid of "g_list_free (i)", it could cause problems.
4) Since you introduced the helper surface, it'd be nice to integrate it properly into the background base class and have a "cached-drawing" property that will control whether the surface is used (default TRUE). (you'll get an extra point if you provide some statistics on how often is helps)
5) The stripe-width spin is put on a strange place in awn-settings, please try to rearrange it, so that it fits nicely.
Alberto Aldegheri (albyrock87) wrote : Posted in a previous version of this proposal | # |
> Thanks for the style fixes. Here are my comments:
>
> 1) When using cairo methods, please use doubles directly, don't have the
> compiler do it ( cairo_scale (cr, 1, -1) => cairo_scale (cr, 1., -1.) )
> 2) You're using the expander detection quite often, move it to a function (at
> least the g_object_get() + gtk_container_
> 3) Get rid of "g_list_free (i)", it could cause problems.
> 4) Since you introduced the helper surface, it'd be nice to integrate it
> properly into the background base class and have a "cached-drawing" property
> that will control whether the surface is used (default TRUE). (you'll get an
> extra point if you provide some statistics on how often is helps)
> 5) The stripe-width spin is put on a strange place in awn-settings, please try
> to rearrange it, so that it fits nicely.
I'm working on this.
For now I can tell you that (in lucido style), times are:
- use helper surface: ~0ms
- redraw surface: ~10ms
If you hover an icon and then run away with your mouse with bounce effect, you get about 20 redraw (during animation):
- using helper surface: ~1ms
- not using helper surface: 20*10 = 200ms
Time calculated with:
#include <time.h>
clock_t start, end;
double elapsed;
start = clock();
... /* Do the work. */
end = clock();
elapsed = ((double) (end - start)) / (((double)
Alberto Aldegheri (albyrock87) wrote : Posted in a previous version of this proposal | # |
> Thanks for the style fixes. Here are my comments:
>
> 1) When using cairo methods, please use doubles directly, don't have the
> compiler do it ( cairo_scale (cr, 1, -1) => cairo_scale (cr, 1., -1.) )
> 2) You're using the expander detection quite often, move it to a function (at
> least the g_object_get() + gtk_container_
> 3) Get rid of "g_list_free (i)", it could cause problems.
> 4) Since you introduced the helper surface, it'd be nice to integrate it
> properly into the background base class and have a "cached-drawing" property
> that will control whether the surface is used (default TRUE). (you'll get an
> extra point if you provide some statistics on how often is helps)
> 5) The stripe-width spin is put on a strange place in awn-settings, please try
> to rearrange it, so that it fits nicely.
Ok, What do you think about?
Some statistic? mh..
On any animation's step on every icon, you get background refreshed. (with cache in O(1) time)
The same for any expose event.
However, if you want to see how often is the redraw, you can put a:
fprintf (stderr, "I'm redrawing the bg \n");
on awn-background.c row 701
You will see that the redraw is rare, then the performance gain is very often :)
Alberto Aldegheri (albyrock87) wrote : Posted in a previous version of this proposal | # |
Resubmitting :)
PS: i've checked for mem-leaks this time, and I have not found any mem-leak.
Michal Hruby (mhr3) wrote : Posted in a previous version of this proposal | # |
As a side note, the "Resubmit" is for reviewers when they want you to resubmit the proposal, when you want to resubmit it, there's the "Resubmit proposal" link on top of this page.
1) Please revert the 1210-1220, this should go into background's finalize method.
2) It seems that awn_background_
3) Also why is 1190-1192 necessary?
Alberto Aldegheri (albyrock87) wrote : Posted in a previous version of this proposal | # |
> As a side note, the "Resubmit" is for reviewers when they want you to resubmit
> the proposal, when you want to resubmit it, there's the "Resubmit proposal"
> link on top of this page.
I'm sorry, but I'm new in Lauchpad&Bzr :P
> 1) Please revert the 1210-1220, this should go into background's finalize
> method.
Done :)
> 2) It seems that awn_background_
> is not necessary to be exposed in the .h files. Please make it a static method
> and use the virtual klass->
awn_background_
Moved awn_background_
> 3) Also why is 1190-1192 necessary?
Because when you move panel position from bottom to top, or left to right, width&height doesn't change. So we need to notify background to redraw itself.
Michal Hruby (mhr3) wrote : Posted in a previous version of this proposal | # |
> > 2) It seems that awn_background_
> variant)
> > is not necessary to be exposed in the .h files. Please make it a static
> method
> > and use the virtual klass->
> awn_background_
> used in awn-background-
It still doesn't have to be in the .h, you can use >>>
AWN_BACKGROUND_
> > 3) Also why is 1190-1192 necessary?
> Because when you move panel position from bottom to top, or left to right,
> width&height doesn't change. So we need to notify background to redraw itself.
Ok, but please make a method for it (awn_background
Alberto Aldegheri (albyrock87) wrote : Posted in a previous version of this proposal | # |
> > > 2) It seems that awn_background_
> > variant)
> > > is not necessary to be exposed in the .h files. Please make it a static
> > method
> > > and use the virtual klass->
> > awn_background_
> is
> > used in awn-background-
>
> It still doesn't have to be in the .h, you can use >>>
> AWN_BACKGROUND_
> ()
Done, thank you :)
> > > 3) Also why is 1190-1192 necessary?
> > Because when you move panel position from bottom to top, or left to right,
> > width&height doesn't change. So we need to notify background to redraw
> itself.
>
> Ok, but please make a method for it (awn_background
> public variables is really unfortunate in the background class.
You're right, done
Michal Hruby (mhr3) wrote : Posted in a previous version of this proposal | # |
Sorry for late reply, been bit busy lately...
Lines 450 and 534 will cause a crash if there are no applets setup, fix pls.
Michal Hruby (mhr3) wrote : Posted in a previous version of this proposal | # |
Also it'd be nice to use private structure for the 'expw' variable, don't expose it.
Michal Hruby (mhr3) wrote : Posted in a previous version of this proposal | # |
Few more observations:
1) Backgrounds don't redraw properly when monitor_align is changed.
2) There are some issues with padding (no refresh) when curviness is being changed.
3) Incomplete redraw when second expander is added to the panel.
Michal Hruby (mhr3) wrote : Posted in a previous version of this proposal | # |
And one more: On bottom orientation (expanded panel) the pixels on x == 0 have incorrect color.
Alberto Aldegheri (albyrock87) wrote : Posted in a previous version of this proposal | # |
> 3) Incomplete redraw when second expander is added to the panel.
I need help with this.
The way to fix this problem is call a redraw of all applets when an applet gets added/removed.
But I don't know how to do that.
Alberto Aldegheri (albyrock87) wrote : Posted in a previous version of this proposal | # |
Ok, all done.
I've found a way to fix:
> 3) Incomplete redraw when second expander is added to the panel.
Resubmitting :)
Alberto Aldegheri (albyrock87) : | # |
Alberto Aldegheri (albyrock87) wrote : | # |
Noes!! There's a bug with a special configuration, i'll fix soon :(
Alberto Aldegheri (albyrock87) wrote : | # |
> Noes!! There's a bug with a special configuration, i'll fix soon :(
Ok, done :)
Michal Hruby (mhr3) wrote : | # |
Sorry, but additions in 714 are completely redundant - please take a look for example at Edgy code...
1) There's no need for extra signal in awn-panel, if you need panel to ask you again for padding emit the "padding-changed" signal (using awn_background_
2) There's no need for "property-changed", this is implemented automatically for every property which is registered using g_object_
Michal Hruby (mhr3) wrote : | # |
And I also have one question - what is the rationale behind using curviness instead of corner_radius?
Alberto Aldegheri (albyrock87) wrote : | # |
> And I also have one question - what is the rationale behind using curviness
> instead of corner_radius?
Because Lucido consists in curves:
- curves symmetry
- curviness
Lucido's boundary rect has no rounded corners.
Alberto Aldegheri (albyrock87) wrote : | # |
How can I remove myself from reviewers? :D
Michal Hruby (mhr3) wrote : | # |
Good question... Change it to Abstain?!
Alberto Aldegheri (albyrock87) wrote : | # |
Tanks Michal! ;)
However, Lucido seems to be ready now :)
Michal Hruby (mhr3) wrote : | # |
Looking at the latest changes, shouldn't you monitor also changes to "expand" property and emit padding-changed?
Alberto Aldegheri (albyrock87) wrote : | # |
I think that "expand" already refreshes padding. So there's no need to observ "expand"..
Michal Hruby (mhr3) wrote : | # |
I see, you derive from FLAT background, and it monitors expand property. Is this really intentional?
Alberto Aldegheri (albyrock87) wrote : | # |
Haha!
Great! No, that was not intentional :P
It was intentional for some methods, but not for monitor expand :P
Michal Hruby (mhr3) wrote : | # |
Which methods exactly? It seems to me that Lucido should be derived directly from AwnBackground, not Flat...
Alberto Aldegheri (albyrock87) wrote : | # |
For the shape mask, and initally for the padding method, but after i must reimplement that for use curviness in not-expanded mode..
Alberto Aldegheri (albyrock87) wrote : | # |
review: Needs Fixing?
In what? I don't understand, do you want that i change the parent to AwnBackground?
Michal Hruby (mhr3) wrote : | # |
Oh sorry, we didn't understand each other... Yes, please change the base class to AwnBackground and implement correct version of get_shape_mask.
Alberto Aldegheri (albyrock87) wrote : | # |
I understand that my english is not so good :D
I'll do the job soon then I resubmit :)
- 703. By Michal Hruby
-
Merge Lucido style from <lp:~albyrock87/awn/awn-lucido>
- 704. By Michal Hruby
-
* awn-settings/
awn-settings. ui:
* awn-settings/awnDefs. py.in:
* awn-settings/awnSettings. py.in:
* data/avant-window- navigator. schema- ini.in. in:
* src/awn-background- floaty. c:
* src/awn-background- lucido. c:
* src/awn-background. c:
* src/awn-background. h:
* src/awn-defines.h:
Stop misusing curviness in Floaty, don't use it in Lucido either. - 705. By Michal Hruby
-
Merge Lucido changes from <lp:~albyrock87/awn/awn-lucido>
- 706. By Alberto <alby@CASA>
-
FixTo:(0.5 pixel line not colored)
- 707. By Alberto <alby@CASA>
-
Merge from trunk
- 708. By Alberto <alby@CASA>
-
First version of separator-lucido
- 709. By Alberto <alby@CASA>
-
Stripe Width deleted
- 710. By Alberto <alby@CASA>
-
Draw bugfix
- 711. By Alberto <alby@CASA>
-
Draw bugfix number 2
- 712. By Alberto <alby@CASA>
-
Ops, removing test code
- 713. By Alberto <alby@CASA>
-
Better hi-light pattern
- 714. By Alberto <alby@CASA>
-
SEP_WIDTH to SEP_SIZE
- 715. By Alberto <alby@CASA>
-
Fix to expanded+align background position
- 716. By Alberto <alby@CASA>
-
Ops, fix mem leak
- 717. By Alberto <alby@CASA>
-
Fix: Refresh bug in expanded+
align+no- expanders - 718. By Alberto <alby@CASA>
-
Test version on separators.
- 719. By Alberto <alby@CASA>
-
ops
- 720. By Alberto <alby@CASA>
-
Fix to a bug when changing corner radius
- 721. By Alberto <alby@alby-laptop>
-
Some fixes and code restyle
- 722. By Alberto <alby@CASA>
-
Revert all animation changes for getting back stability. Animation -for now and for me- cant work. Feel free to fork rev 721.
- 723. By Alberto <alby@CASA>
-
Merge with lp:awn
- 724. By Alberto <alby@CASA>
-
Minor code restyling
- 725. By Alberto <alby@CASA>
-
Bug fixes for separators in first position. Restyle of docklet-mode.
- 726. By Alberto <alby@CASA>
-
For simil-3D lovers: Now 3D angle acts on lucido too.
- 727. By Alberto <alby@CASA>
-
Fix to shape mask
- 728. By Alberto <alby@CASA>
-
Bug fixes to an old bug in cairo-utils: rounded_rect. Rect explode if radius is bigger than available space. Consecutive fix to highlights. Simplify and speedup to Edgy code. Bugfix to 3D style, not listening on corner-radius changes. Fix on Lucdio shape mask.
- 729. By Alberto <alby@CASA>
-
3D style rewritten. Now full customizable.
- 730. By Alberto <alby@CASA>
-
I hate when I forget things.
- 731. By Alberto <alby@CASA>
-
Add thickness to 3D style.
- 732. By Alberto <alby@CASA>
-
Better padding
- 733. By Alberto <alby@CASA>
-
Better painting
- 734. By Alberto <alby@CASA>
-
Other drawing adjust for glass looking
- 735. By Alberto <alby@CASA>
-
Cleanups
- 736. By Alberto <alby@CASA>
-
Thickness set to 7px
- 737. By Alberto <alby@CASA>
-
Better drawing. Thinner and more defined border. Improved padding.
- 738. By Alberto <alby@CASA>
-
s(e)(i)x is better :P
- 739. By Alberto <alby@CASA>
-
Thickness in 3D style, replacing floaty offset. Removed Lucido 3D style. Lucido now uses Curves Symmetry too.
- 740. By Alberto <alby@CASA>
-
Animation added to Lucido. There are some minor glitches sometime...
- 741. By Alberto <alby@CASA>
-
A little speedup
- 742. By Alberto <alby@CASA>
-
Shit. I've forgot this.
- 743. By Alberto <alby@CASA>
-
More consistent with other style engines
- 744. By Alberto <alby@CASA>
-
Huge speedup and cleanup. Fixed an old bug. Now listening on applets position change.
- 745. By Alberto <alby@CASA>
-
Too much cleanup. Now works on expanded mode too.
- 746. By Alberto <alby@CASA>
-
Fix to 3D background padding
- 747. By Alberto <alby@CASA>
-
Rewrite of lucido path code. Bugs fixed and curves symmetry fully working.
- 748. By Alberto <alby@CASA>
-
Emit applets refreshed on docklet mode changed too.
- 749. By Alberto <alby@CASA>
-
Good looking start :)
- 750. By Alberto <alby@CASA>
-
Little fixes
- 751. By Alberto <alby@CASA>
-
Merged from lp:awn
- 752. By Alberto <alby@CASA>
-
Get and Set for separator new properties. Added awn_panel_
get_docklet_ mode to panel, removed the similar method in awn-applet-manager, because it returns -wrong- (updated too late) values. - 753. By Alberto <alby@CASA>
-
I made an error while editing awn-panel.c, reverted that error.
- 754. By Alberto <alby@CASA>
-
Reverted changes on debian/changelog
- 755. By Alberto <alby@CASA>
-
Last fix to 3D edges when corner radius > height
- 756. By Alberto <alby@CASA>
-
I had removed too much things :P
- 757. By Alberto <alby@CASA>
-
There was a drawing bug when corner radius = 0, fixed.
- 758. By Alberto <alby@CASA>
-
Merge with lp:awn rev 713
- 759. By Alberto <alby@CASA>
-
Fixed 3065, sorry michal
- 760. By Alberto <alby@CASA>
-
Fixed Edgy. Auto invalidate bg on changed signal.
- 761. By Alberto <alby@CASA>
-
Revert changes to flat
- 762. By Alberto <alby@CASA>
-
Better start animation. Fix to Criticals on lucido start. Pot Updated with make check.
- 763. By Alberto <alby@CASA>
-
Fixes to bug #608927
- 764. By Alberto <alby@CASA>
-
Avoid merge problems with gutted-core-icons branch
- 765. By Alberto <alby@CASA>
-
Patch for bug #608927
- 766. By Alberto <alby@CASA>
-
Remove unused refresh method from awnClass.py. A little fix to a translation string.
Unmerged revisions
Preview Diff
1 | === modified file 'awn-settings/awn-settings.ui' | |||
2 | --- awn-settings/awn-settings.ui 2010-03-08 12:50:07 +0000 | |||
3 | +++ awn-settings/awn-settings.ui 2010-05-31 11:01:08 +0000 | |||
4 | @@ -908,6 +908,22 @@ | |||
5 | 908 | </packing> | 908 | </packing> |
6 | 909 | </child> | 909 | </child> |
7 | 910 | <child> | 910 | <child> |
8 | 911 | <object class="GtkSpinButton" id="theme_stripe_width"> | ||
9 | 912 | <property name="visible">True</property> | ||
10 | 913 | <property name="can_focus">True</property> | ||
11 | 914 | <property name="invisible_char">●</property> | ||
12 | 915 | <property name="adjustment">adj_stripe_width</property> | ||
13 | 916 | <property name="digits">2</property> | ||
14 | 917 | </object> | ||
15 | 918 | <packing> | ||
16 | 919 | <property name="left_attach">5</property> | ||
17 | 920 | <property name="right_attach">6</property> | ||
18 | 921 | <property name="top_attach">8</property> | ||
19 | 922 | <property name="bottom_attach">9</property> | ||
20 | 923 | <property name="x_options"></property> | ||
21 | 924 | </packing> | ||
22 | 925 | </child> | ||
23 | 926 | <child> | ||
24 | 911 | <object class="GtkSpinButton" id="theme_angle"> | 927 | <object class="GtkSpinButton" id="theme_angle"> |
25 | 912 | <property name="visible">True</property> | 928 | <property name="visible">True</property> |
26 | 913 | <property name="can_focus">True</property> | 929 | <property name="can_focus">True</property> |
27 | @@ -964,6 +980,20 @@ | |||
28 | 964 | </packing> | 980 | </packing> |
29 | 965 | </child> | 981 | </child> |
30 | 966 | <child> | 982 | <child> |
31 | 983 | <object class="GtkLabel" id="label_stripe"> | ||
32 | 984 | <property name="visible">True</property> | ||
33 | 985 | <property name="xalign">0</property> | ||
34 | 986 | <property name="xpad">0</property> | ||
35 | 987 | <property name="label" translatable="yes">Stripe Width</property> | ||
36 | 988 | </object> | ||
37 | 989 | <packing> | ||
38 | 990 | <property name="left_attach">3</property> | ||
39 | 991 | <property name="right_attach">5</property> | ||
40 | 992 | <property name="top_attach">8</property> | ||
41 | 993 | <property name="bottom_attach">9</property> | ||
42 | 994 | </packing> | ||
43 | 995 | </child> | ||
44 | 996 | <child> | ||
45 | 967 | <object class="GtkLabel" id="label49"> | 997 | <object class="GtkLabel" id="label49"> |
46 | 968 | <property name="visible">True</property> | 998 | <property name="visible">True</property> |
47 | 969 | <property name="xalign">0</property> | 999 | <property name="xalign">0</property> |
48 | @@ -3406,6 +3436,10 @@ | |||
49 | 3406 | <property name="upper">1</property> | 3436 | <property name="upper">1</property> |
50 | 3407 | <property name="step_increment">0.01</property> | 3437 | <property name="step_increment">0.01</property> |
51 | 3408 | </object> | 3438 | </object> |
52 | 3439 | <object class="GtkAdjustment" id="adj_stripe_width"> | ||
53 | 3440 | <property name="upper">1</property> | ||
54 | 3441 | <property name="step_increment">0.01</property> | ||
55 | 3442 | </object> | ||
56 | 3409 | <object class="GtkAdjustment" id="adj_radius"> | 3443 | <object class="GtkAdjustment" id="adj_radius"> |
57 | 3410 | <property name="upper">100</property> | 3444 | <property name="upper">100</property> |
58 | 3411 | <property name="step_increment">1</property> | 3445 | <property name="step_increment">1</property> |
59 | 3412 | 3446 | ||
60 | === modified file 'awn-settings/awnDefs.py.in' | |||
61 | --- awn-settings/awnDefs.py.in 2010-04-29 14:58:51 +0000 | |||
62 | +++ awn-settings/awnDefs.py.in 2010-05-31 11:01:08 +0000 | |||
63 | @@ -86,6 +86,7 @@ | |||
64 | 86 | PANEL_ANGLE = "panel_angle" #float | 86 | PANEL_ANGLE = "panel_angle" #float |
65 | 87 | CURVINESS = "curviness" #float | 87 | CURVINESS = "curviness" #float |
66 | 88 | CURVES_SYMMETRY = "curves_symmetry" #float | 88 | CURVES_SYMMETRY = "curves_symmetry" #float |
67 | 89 | STRIPE_WIDTH = "stripe_width" #float | ||
68 | 89 | TOOLTIP_FONT_NAME = "tooltip_font_name" #string | 90 | TOOLTIP_FONT_NAME = "tooltip_font_name" #string |
69 | 90 | TOOLTIP_FONT_COLOR = "tooltip_font_color" #string | 91 | TOOLTIP_FONT_COLOR = "tooltip_font_color" #string |
70 | 91 | TOOLTIP_BG_COLOR = "tooltip_bg_color" #string | 92 | TOOLTIP_BG_COLOR = "tooltip_bg_color" #string |
71 | 92 | 93 | ||
72 | === modified file 'awn-settings/awnSettings.py.in' | |||
73 | --- awn-settings/awnSettings.py.in 2010-05-28 08:09:17 +0000 | |||
74 | +++ awn-settings/awnSettings.py.in 2010-05-31 11:01:08 +0000 | |||
75 | @@ -141,7 +141,8 @@ | |||
76 | 141 | #setup style mode | 141 | #setup style mode |
77 | 142 | dropdown = self.wTree.get_object("stylecombo") | 142 | dropdown = self.wTree.get_object("stylecombo") |
78 | 143 | self.create_dropdown(dropdown, [_("None"), _("Flat"), _("3d"), | 143 | self.create_dropdown(dropdown, [_("None"), _("Flat"), _("3d"), |
80 | 144 | _("Curved"), _("Edgy"), _("Floaty")]) | 144 | _("Curved"), _("Edgy"), _("Floaty"), |
81 | 145 | _("Lucido")]) | ||
82 | 145 | 146 | ||
83 | 146 | #setup behaviour combo | 147 | #setup behaviour combo |
84 | 147 | dropdown = self.wTree.get_object("behaviorcombo") | 148 | dropdown = self.wTree.get_object("behaviorcombo") |
85 | @@ -578,6 +579,7 @@ | |||
86 | 578 | 579 | ||
87 | 579 | curviness = gobject.property(type=int, default=10) | 580 | curviness = gobject.property(type=int, default=10) |
88 | 580 | curves_symmetry = gobject.property(type=float, default=0) | 581 | curves_symmetry = gobject.property(type=float, default=0) |
89 | 582 | stripe_width = gobject.property(type=float, default=0) | ||
90 | 581 | angle = gobject.property(type=int, default=45) | 583 | angle = gobject.property(type=int, default=45) |
91 | 582 | radius = gobject.property(type=int, default=10) | 584 | radius = gobject.property(type=int, default=10) |
92 | 583 | gtk_theme_mode = gobject.property(type=bool, default=False) | 585 | gtk_theme_mode = gobject.property(type=bool, default=False) |
93 | @@ -727,6 +729,7 @@ | |||
94 | 727 | (defs.THEME, defs.PANEL_ANGLE, 'float', sizes), | 729 | (defs.THEME, defs.PANEL_ANGLE, 'float', sizes), |
95 | 728 | (defs.THEME, defs.CURVINESS, 'float', sizes), | 730 | (defs.THEME, defs.CURVINESS, 'float', sizes), |
96 | 729 | (defs.THEME, defs.CURVES_SYMMETRY, 'float', sizes), | 731 | (defs.THEME, defs.CURVES_SYMMETRY, 'float', sizes), |
97 | 732 | (defs.THEME, defs.STRIPE_WIDTH, 'float', sizes), | ||
98 | 730 | (defs.THEME, defs.TOOLTIP_FONT_NAME, 'str', icon), | 733 | (defs.THEME, defs.TOOLTIP_FONT_NAME, 'str', icon), |
99 | 731 | (defs.THEME, defs.TOOLTIP_FONT_COLOR, 'str', icon), | 734 | (defs.THEME, defs.TOOLTIP_FONT_COLOR, 'str', icon), |
100 | 732 | (defs.THEME, defs.TOOLTIP_BG_COLOR, 'str', icon), | 735 | (defs.THEME, defs.TOOLTIP_BG_COLOR, 'str', icon), |
101 | @@ -823,6 +826,8 @@ | |||
102 | 823 | "curviness", "theme_curviness"), | 826 | "curviness", "theme_curviness"), |
103 | 824 | (self.client, defs.THEME, defs.CURVES_SYMMETRY, | 827 | (self.client, defs.THEME, defs.CURVES_SYMMETRY, |
104 | 825 | "curves-symmetry", "theme_symmetry"), | 828 | "curves-symmetry", "theme_symmetry"), |
105 | 829 | (self.client, defs.THEME, defs.STRIPE_WIDTH, | ||
106 | 830 | "stripe-width", "theme_stripe_width"), | ||
107 | 826 | (self.client, defs.THEME, defs.PANEL_ANGLE, | 831 | (self.client, defs.THEME, defs.PANEL_ANGLE, |
108 | 827 | "angle", "theme_angle"), | 832 | "angle", "theme_angle"), |
109 | 828 | (self.client, defs.THEME, defs.CORNER_RADIUS, | 833 | (self.client, defs.THEME, defs.CORNER_RADIUS, |
110 | 829 | 834 | ||
111 | === modified file 'data/avant-window-navigator.schema-ini.in.in' | |||
112 | --- data/avant-window-navigator.schema-ini.in.in 2010-03-09 20:20:25 +0000 | |||
113 | +++ data/avant-window-navigator.schema-ini.in.in 2010-05-31 11:01:08 +0000 | |||
114 | @@ -159,7 +159,7 @@ | |||
115 | 159 | [panel/style] | 159 | [panel/style] |
116 | 160 | type = integer | 160 | type = integer |
117 | 161 | default = 1 | 161 | default = 1 |
119 | 162 | _description=The style of the bar. (none=0, flat bar=1, 3d bar=2, curved bar=3, edgy=4, floaty=5) | 162 | _description=The style of the bar. (none=0, flat bar=1, 3d bar=2, curved bar=3, edgy=4, floaty=5,lucido=6) |
120 | 163 | 163 | ||
121 | 164 | [panels/panel_list] | 164 | [panels/panel_list] |
122 | 165 | type = list-integer | 165 | type = list-integer |
123 | @@ -227,6 +227,12 @@ | |||
124 | 227 | _description=The curviness of the panel in Curves mode. | 227 | _description=The curviness of the panel in Curves mode. |
125 | 228 | per_instance = false | 228 | per_instance = false |
126 | 229 | 229 | ||
127 | 230 | [theme/stripe_width] | ||
128 | 231 | type = float | ||
129 | 232 | default = 0.0 | ||
130 | 233 | _description=The width of the stripe in Lucido mode. | ||
131 | 234 | per_instance = false | ||
132 | 235 | |||
133 | 230 | [theme/dialog_gtk_mode] | 236 | [theme/dialog_gtk_mode] |
134 | 231 | type = boolean | 237 | type = boolean |
135 | 232 | default = true | 238 | default = true |
136 | 233 | 239 | ||
137 | === modified file 'src/Makefile.am' | |||
138 | --- src/Makefile.am 2010-03-24 23:24:19 +0000 | |||
139 | +++ src/Makefile.am 2010-05-31 11:01:08 +0000 | |||
140 | @@ -41,6 +41,8 @@ | |||
141 | 41 | awn-background-edgy.h \ | 41 | awn-background-edgy.h \ |
142 | 42 | awn-background-floaty.c \ | 42 | awn-background-floaty.c \ |
143 | 43 | awn-background-floaty.h \ | 43 | awn-background-floaty.h \ |
144 | 44 | awn-background-lucido.c \ | ||
145 | 45 | awn-background-lucido.h \ | ||
146 | 44 | awn-defines.h \ | 46 | awn-defines.h \ |
147 | 45 | $(builddir)/awn-marshal.c \ | 47 | $(builddir)/awn-marshal.c \ |
148 | 46 | $(builddir)/awn-marshal.h \ | 48 | $(builddir)/awn-marshal.h \ |
149 | 47 | 49 | ||
150 | === modified file 'src/awn-background-flat.c' | |||
151 | --- src/awn-background-flat.c 2010-03-07 18:38:07 +0000 | |||
152 | +++ src/awn-background-flat.c 2010-05-31 11:01:08 +0000 | |||
153 | @@ -324,20 +324,24 @@ | |||
154 | 324 | switch (position) | 324 | switch (position) |
155 | 325 | { | 325 | { |
156 | 326 | case GTK_POS_RIGHT: | 326 | case GTK_POS_RIGHT: |
158 | 327 | cairo_translate (cr, x, y+height); | 327 | cairo_translate (cr, 0., y + height); |
159 | 328 | cairo_scale (cr, 1., -1.); | ||
160 | 329 | cairo_translate (cr, x, height); | ||
161 | 328 | cairo_rotate (cr, M_PI * 1.5); | 330 | cairo_rotate (cr, M_PI * 1.5); |
162 | 329 | temp = width; | 331 | temp = width; |
164 | 330 | width = height; height = temp; | 332 | width = height; |
165 | 333 | height = temp; | ||
166 | 331 | break; | 334 | break; |
167 | 332 | case GTK_POS_LEFT: | 335 | case GTK_POS_LEFT: |
169 | 333 | cairo_translate (cr, x+width, y); | 336 | cairo_translate (cr, x + width, y); |
170 | 334 | cairo_rotate (cr, M_PI * 0.5); | 337 | cairo_rotate (cr, M_PI * 0.5); |
171 | 335 | temp = width; | 338 | temp = width; |
173 | 336 | width = height; height = temp; | 339 | width = height; |
174 | 340 | height = temp; | ||
175 | 337 | break; | 341 | break; |
176 | 338 | case GTK_POS_TOP: | 342 | case GTK_POS_TOP: |
179 | 339 | cairo_translate (cr, x+width, y+height); | 343 | cairo_translate (cr, x, y + height); |
180 | 340 | cairo_rotate (cr, M_PI); | 344 | cairo_scale (cr, 1., -1.); |
181 | 341 | break; | 345 | break; |
182 | 342 | default: | 346 | default: |
183 | 343 | cairo_translate (cr, x, y); | 347 | cairo_translate (cr, x, y); |
184 | 344 | 348 | ||
185 | === added file 'src/awn-background-lucido.c' | |||
186 | --- src/awn-background-lucido.c 1970-01-01 00:00:00 +0000 | |||
187 | +++ src/awn-background-lucido.c 2010-05-31 11:01:08 +0000 | |||
188 | @@ -0,0 +1,839 @@ | |||
189 | 1 | /* | ||
190 | 2 | * Copyright (C) 2009 Michal Hruby <michal.mhr@gmail.com> | ||
191 | 3 | * | ||
192 | 4 | * This program is free software; you can redistribute it and/or modify | ||
193 | 5 | * it under the terms of the GNU General Public License as published by | ||
194 | 6 | * the Free Software Foundation; either version 2 of the License, or | ||
195 | 7 | * (at your option) any later version. | ||
196 | 8 | * | ||
197 | 9 | * This program is distributed in the hope that it will be useful, | ||
198 | 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
199 | 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
200 | 12 | * GNU General Public License for more details. | ||
201 | 13 | * | ||
202 | 14 | * You should have received a copy of the GNU General Public License | ||
203 | 15 | * along with this program; if not, write to the Free Software | ||
204 | 16 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. | ||
205 | 17 | * | ||
206 | 18 | * Author : Alberto Aldegheri <albyrock87+dev@gmail.com> | ||
207 | 19 | * Thanks to: Matt <sharkbaitbobby@gmail.com> | ||
208 | 20 | * for the code section to analyze expanders | ||
209 | 21 | * | ||
210 | 22 | */ | ||
211 | 23 | |||
212 | 24 | #include "config.h" | ||
213 | 25 | |||
214 | 26 | #include <gdk/gdk.h> | ||
215 | 27 | #include <libawn/awn-cairo-utils.h> | ||
216 | 28 | #include <math.h> | ||
217 | 29 | |||
218 | 30 | #include "awn-applet-manager.h" | ||
219 | 31 | #include "awn-background-lucido.h" | ||
220 | 32 | #include "awn-separator.h" | ||
221 | 33 | |||
222 | 34 | G_DEFINE_TYPE (AwnBackgroundLucido, awn_background_lucido, AWN_TYPE_BACKGROUND) | ||
223 | 35 | |||
224 | 36 | #define AWN_BACKGROUND_LUCIDO_GET_PRIVATE(obj) ( \ | ||
225 | 37 | G_TYPE_INSTANCE_GET_PRIVATE (obj, AWN_TYPE_BACKGROUND_LUCIDO, \ | ||
226 | 38 | AwnBackgroundLucidoPrivate)) | ||
227 | 39 | |||
228 | 40 | struct _AwnBackgroundLucidoPrivate | ||
229 | 41 | { | ||
230 | 42 | gint expw; | ||
231 | 43 | gint expn; | ||
232 | 44 | }; | ||
233 | 45 | |||
234 | 46 | static void awn_background_lucido_draw (AwnBackground *bg, | ||
235 | 47 | cairo_t *cr, | ||
236 | 48 | GtkPositionType position, | ||
237 | 49 | GdkRectangle *area); | ||
238 | 50 | |||
239 | 51 | static void awn_background_lucido_get_shape_mask (AwnBackground *bg, | ||
240 | 52 | cairo_t *cr, | ||
241 | 53 | GtkPositionType position, | ||
242 | 54 | GdkRectangle *area); | ||
243 | 55 | |||
244 | 56 | static void awn_background_lucido_padding_request (AwnBackground *bg, | ||
245 | 57 | GtkPositionType position, | ||
246 | 58 | guint *padding_top, | ||
247 | 59 | guint *padding_bottom, | ||
248 | 60 | guint *padding_left, | ||
249 | 61 | guint *padding_right); | ||
250 | 62 | |||
251 | 63 | static gboolean | ||
252 | 64 | awn_background_lucido_get_needs_redraw (AwnBackground *bg, | ||
253 | 65 | GtkPositionType position, | ||
254 | 66 | GdkRectangle *area); | ||
255 | 67 | |||
256 | 68 | static void | ||
257 | 69 | awn_background_lucido_curviness_changed (AwnBackground *bg) | ||
258 | 70 | { | ||
259 | 71 | gboolean expand = FALSE; | ||
260 | 72 | g_object_get (bg->panel, "expand", &expand, NULL); | ||
261 | 73 | |||
262 | 74 | if (!expand) | ||
263 | 75 | awn_background_emit_padding_changed (bg); | ||
264 | 76 | } | ||
265 | 77 | |||
266 | 78 | static void | ||
267 | 79 | awn_background_lucido_expand_changed (AwnBackground *bg) | ||
268 | 80 | { | ||
269 | 81 | awn_background_emit_padding_changed (bg); | ||
270 | 82 | } | ||
271 | 83 | |||
272 | 84 | static void | ||
273 | 85 | awn_background_lucido_align_changed (AwnBackground *bg) | ||
274 | 86 | { | ||
275 | 87 | awn_background_emit_padding_changed (bg); | ||
276 | 88 | } | ||
277 | 89 | |||
278 | 90 | static void | ||
279 | 91 | awn_background_lucido_constructed (GObject *object) | ||
280 | 92 | { | ||
281 | 93 | G_OBJECT_CLASS (awn_background_lucido_parent_class)->constructed (object); | ||
282 | 94 | |||
283 | 95 | AwnBackground *bg = AWN_BACKGROUND (object); | ||
284 | 96 | gpointer monitor = NULL; | ||
285 | 97 | |||
286 | 98 | g_signal_connect_swapped (bg, "notify::curviness", | ||
287 | 99 | G_CALLBACK (awn_background_lucido_curviness_changed), | ||
288 | 100 | object); | ||
289 | 101 | |||
290 | 102 | g_return_if_fail (bg->panel); | ||
291 | 103 | |||
292 | 104 | g_signal_connect_swapped (bg->panel, "notify::expand", | ||
293 | 105 | G_CALLBACK (awn_background_lucido_expand_changed), | ||
294 | 106 | object); | ||
295 | 107 | |||
296 | 108 | g_object_get (bg->panel, "monitor", &monitor, NULL); | ||
297 | 109 | |||
298 | 110 | g_return_if_fail (monitor); | ||
299 | 111 | |||
300 | 112 | g_signal_connect_swapped (monitor, "notify::monitor-align", | ||
301 | 113 | G_CALLBACK (awn_background_lucido_align_changed), | ||
302 | 114 | object); | ||
303 | 115 | } | ||
304 | 116 | |||
305 | 117 | static void | ||
306 | 118 | awn_background_lucido_dispose (GObject *object) | ||
307 | 119 | { | ||
308 | 120 | gpointer monitor = NULL; | ||
309 | 121 | if (AWN_BACKGROUND (object)->panel) | ||
310 | 122 | g_object_get (AWN_BACKGROUND (object)->panel, "monitor", &monitor, NULL); | ||
311 | 123 | |||
312 | 124 | if (monitor) | ||
313 | 125 | g_signal_handlers_disconnect_by_func (monitor, | ||
314 | 126 | G_CALLBACK (awn_background_lucido_align_changed), object); | ||
315 | 127 | |||
316 | 128 | g_signal_handlers_disconnect_by_func (AWN_BACKGROUND (object)->panel, | ||
317 | 129 | G_CALLBACK (awn_background_lucido_expand_changed), object); | ||
318 | 130 | |||
319 | 131 | g_signal_handlers_disconnect_by_func (AWN_BACKGROUND (object), | ||
320 | 132 | G_CALLBACK (awn_background_lucido_curviness_changed), object); | ||
321 | 133 | |||
322 | 134 | G_OBJECT_CLASS (awn_background_lucido_parent_class)->dispose (object); | ||
323 | 135 | } | ||
324 | 136 | |||
325 | 137 | static void | ||
326 | 138 | awn_background_lucido_class_init (AwnBackgroundLucidoClass *klass) | ||
327 | 139 | { | ||
328 | 140 | AwnBackgroundClass *bg_class = AWN_BACKGROUND_CLASS (klass); | ||
329 | 141 | |||
330 | 142 | GObjectClass *obj_class = G_OBJECT_CLASS (klass); | ||
331 | 143 | obj_class->constructed = awn_background_lucido_constructed; | ||
332 | 144 | obj_class->dispose = awn_background_lucido_dispose; | ||
333 | 145 | |||
334 | 146 | bg_class->draw = awn_background_lucido_draw; | ||
335 | 147 | bg_class->padding_request = awn_background_lucido_padding_request; | ||
336 | 148 | bg_class->get_shape_mask = awn_background_lucido_get_shape_mask; | ||
337 | 149 | bg_class->get_input_shape_mask = awn_background_lucido_get_shape_mask; | ||
338 | 150 | bg_class->get_needs_redraw = awn_background_lucido_get_needs_redraw; | ||
339 | 151 | |||
340 | 152 | g_type_class_add_private (obj_class, sizeof (AwnBackgroundLucidoPrivate)); | ||
341 | 153 | } | ||
342 | 154 | |||
343 | 155 | static void | ||
344 | 156 | awn_background_lucido_init (AwnBackgroundLucido *bg) | ||
345 | 157 | { | ||
346 | 158 | |||
347 | 159 | } | ||
348 | 160 | |||
349 | 161 | AwnBackground * | ||
350 | 162 | awn_background_lucido_new (DesktopAgnosticConfigClient *client, | ||
351 | 163 | AwnPanel *panel) | ||
352 | 164 | { | ||
353 | 165 | AwnBackground *bg; | ||
354 | 166 | |||
355 | 167 | bg = g_object_new (AWN_TYPE_BACKGROUND_LUCIDO, | ||
356 | 168 | "client", client, | ||
357 | 169 | "panel", panel, | ||
358 | 170 | NULL); | ||
359 | 171 | return bg; | ||
360 | 172 | } | ||
361 | 173 | |||
362 | 174 | /* | ||
363 | 175 | * Drawing functions | ||
364 | 176 | */ | ||
365 | 177 | static void | ||
366 | 178 | _line_from_to ( cairo_t *cr, | ||
367 | 179 | gfloat *xs, | ||
368 | 180 | gfloat *ys, | ||
369 | 181 | gfloat xf, | ||
370 | 182 | gfloat yf) | ||
371 | 183 | { | ||
372 | 184 | if ( *xs==xf || *ys==yf ) /* Vertical/Horizontal line */ | ||
373 | 185 | cairo_line_to (cr, xf, yf); | ||
374 | 186 | else | ||
375 | 187 | { /* Oblique */ | ||
376 | 188 | gfloat xm = ( *xs + xf ) / 2.0; | ||
377 | 189 | cairo_curve_to (cr, xm, *ys, xm, yf, xf, yf); | ||
378 | 190 | } | ||
379 | 191 | *xs = xf; | ||
380 | 192 | *ys = yf; | ||
381 | 193 | } | ||
382 | 194 | |||
383 | 195 | static GList* | ||
384 | 196 | _get_applet_widgets (AwnBackground* bg) | ||
385 | 197 | { | ||
386 | 198 | AwnAppletManager *manager = NULL; | ||
387 | 199 | g_object_get (bg->panel, "applet-manager", &manager, NULL); | ||
388 | 200 | |||
389 | 201 | return gtk_container_get_children (GTK_CONTAINER (manager)); | ||
390 | 202 | } | ||
391 | 203 | |||
392 | 204 | /** | ||
393 | 205 | * _create_path_lucido: | ||
394 | 206 | * @bg: The background pointer | ||
395 | 207 | * @position: The position of the bar | ||
396 | 208 | * @cairo_t: The cairo context | ||
397 | 209 | * @y: The top left coordinate of the "bar rect" - default = 0 | ||
398 | 210 | * @w: The width of the bar | ||
399 | 211 | * @h: The height of the bar | ||
400 | 212 | * @stripe: The width of the stripe (0.0-1.0). Zero for auto-stripe. | ||
401 | 213 | * @d: The width of each curve in the path | ||
402 | 214 | * @dc: The width of the external curves in non-expanded&auto mode | ||
403 | 215 | * @symmetry: The symmetry of the stripe when @stripe > 0 | ||
404 | 216 | * @internal: If Zero, creates the path for the stripe | ||
405 | 217 | * @expanded: If Zero, the bar is not expanded | ||
406 | 218 | * | ||
407 | 219 | * This function creates paths on which the bar will be drawn. | ||
408 | 220 | * In atuo-stripe, it searchs for expanders applet, each expander | ||
409 | 221 | * equals to one curve. | ||
410 | 222 | * If the first widget is an expander, start from bottom-left, | ||
411 | 223 | * otherwise start from top-left | ||
412 | 224 | */ | ||
413 | 225 | |||
414 | 226 | static void | ||
415 | 227 | _create_path_lucido ( AwnBackground* bg, | ||
416 | 228 | GtkPositionType position, | ||
417 | 229 | cairo_t* cr, | ||
418 | 230 | gfloat x, | ||
419 | 231 | gfloat y, | ||
420 | 232 | gfloat w, | ||
421 | 233 | gfloat h, | ||
422 | 234 | gfloat stripe, | ||
423 | 235 | gfloat d, | ||
424 | 236 | gfloat dc, | ||
425 | 237 | gfloat symmetry, | ||
426 | 238 | gboolean internal, | ||
427 | 239 | gboolean expanded, | ||
428 | 240 | gfloat align) | ||
429 | 241 | { | ||
430 | 242 | cairo_new_path (cr); | ||
431 | 243 | |||
432 | 244 | gfloat lx = x; | ||
433 | 245 | gfloat ly = y; | ||
434 | 246 | gfloat y3 = y + h; | ||
435 | 247 | gfloat y2 = y3 - 5; | ||
436 | 248 | |||
437 | 249 | if (stripe > 0) | ||
438 | 250 | { | ||
439 | 251 | if (expanded) | ||
440 | 252 | { | ||
441 | 253 | stripe = (w * stripe); /* now stripe = non-stripe */ | ||
442 | 254 | if (internal) | ||
443 | 255 | { | ||
444 | 256 | /* Manual-Stripe & Expanded & Internal */ | ||
445 | 257 | lx = stripe * symmetry; | ||
446 | 258 | cairo_move_to (cr, lx, ly); | ||
447 | 259 | _line_from_to (cr, &lx, &ly, lx+d, y2); | ||
448 | 260 | _line_from_to (cr, &lx, &ly, w-stripe * (1. - symmetry) - d, y2); | ||
449 | 261 | _line_from_to (cr, &lx, &ly, w-stripe * (1. - symmetry), y); | ||
450 | 262 | cairo_close_path (cr); | ||
451 | 263 | } | ||
452 | 264 | else | ||
453 | 265 | { | ||
454 | 266 | /* Manual-Stripe & Expanded & External */ | ||
455 | 267 | ly = y3; | ||
456 | 268 | cairo_move_to (cr, lx, ly); | ||
457 | 269 | _line_from_to (cr, &lx, &ly, lx, y); | ||
458 | 270 | _line_from_to (cr, &lx, &ly, stripe * symmetry, y); | ||
459 | 271 | _line_from_to (cr, &lx, &ly, stripe * symmetry + d, y2); | ||
460 | 272 | _line_from_to (cr, &lx, &ly, w - stripe * (1. - symmetry) - d, y2); | ||
461 | 273 | _line_from_to (cr, &lx, &ly, w - stripe * (1. - symmetry), y); | ||
462 | 274 | _line_from_to (cr, &lx, &ly, w, y); | ||
463 | 275 | _line_from_to (cr, &lx, &ly, w, y3); | ||
464 | 276 | cairo_close_path (cr); | ||
465 | 277 | } | ||
466 | 278 | } | ||
467 | 279 | else | ||
468 | 280 | { | ||
469 | 281 | if (stripe == 1.) | ||
470 | 282 | { | ||
471 | 283 | _create_path_lucido (bg, position, cr, x, y, w, h, 0., | ||
472 | 284 | d, dc, 0., internal, expanded, align); | ||
473 | 285 | return; | ||
474 | 286 | } | ||
475 | 287 | stripe = ((w - dc * 2) * stripe); /* now stripe = non-stripe */ | ||
476 | 288 | if (internal) | ||
477 | 289 | { | ||
478 | 290 | /* Manual-Stripe & Not-Expanded & Internal */ | ||
479 | 291 | lx = stripe * symmetry + dc; | ||
480 | 292 | cairo_move_to (cr, lx, ly); | ||
481 | 293 | _line_from_to (cr, &lx, &ly, lx + d, y2); | ||
482 | 294 | _line_from_to (cr, &lx, &ly, w - stripe * (1.- symmetry) - dc - d, y2); | ||
483 | 295 | _line_from_to (cr, &lx, &ly, w - stripe * (1.- symmetry) - dc, y); | ||
484 | 296 | cairo_close_path (cr); | ||
485 | 297 | } | ||
486 | 298 | else | ||
487 | 299 | { | ||
488 | 300 | /* Manual-Stripe & Not-Expanded & External */ | ||
489 | 301 | ly = y3; | ||
490 | 302 | cairo_move_to (cr, lx, ly); | ||
491 | 303 | _line_from_to (cr, &lx, &ly, lx+dc, y); | ||
492 | 304 | _line_from_to (cr, &lx, &ly, stripe * symmetry + dc, y); | ||
493 | 305 | _line_from_to (cr, &lx, &ly, stripe * symmetry + d + dc, y2); | ||
494 | 306 | _line_from_to (cr, &lx, &ly, w-stripe * (1. - symmetry) - dc - d, y2); | ||
495 | 307 | _line_from_to (cr, &lx, &ly, w-stripe * (1. - symmetry) - dc, y); | ||
496 | 308 | _line_from_to (cr, &lx, &ly, w-dc, y); | ||
497 | 309 | _line_from_to (cr, &lx, &ly, w, y3); | ||
498 | 310 | cairo_close_path(cr); | ||
499 | 311 | } | ||
500 | 312 | } | ||
501 | 313 | } | ||
502 | 314 | else | ||
503 | 315 | { | ||
504 | 316 | gint exps_found = 0; | ||
505 | 317 | gfloat curx = 0.0; | ||
506 | 318 | |||
507 | 319 | if (expanded) | ||
508 | 320 | { | ||
509 | 321 | if (internal) | ||
510 | 322 | { | ||
511 | 323 | /* Auto-Stripe & Expanded & Internal */ | ||
512 | 324 | GList *widgets = _get_applet_widgets (bg); | ||
513 | 325 | GList *i = widgets; | ||
514 | 326 | GtkWidget *widget = NULL; | ||
515 | 327 | |||
516 | 328 | /* analyze first widget*/ | ||
517 | 329 | if (i) | ||
518 | 330 | { | ||
519 | 331 | widget = GTK_WIDGET (i->data); | ||
520 | 332 | |||
521 | 333 | /* if first widget is an expander or align==0 || 1*/ | ||
522 | 334 | if ( (widget && GTK_IS_IMAGE (widget) && !AWN_IS_SEPARATOR (widget) ) || | ||
523 | 335 | ( align == 0. || align == 1. ) ) | ||
524 | 336 | { | ||
525 | 337 | /* start from bottom */ | ||
526 | 338 | lx = curx; | ||
527 | 339 | ly = y; | ||
528 | 340 | cairo_move_to (cr, lx, ly); | ||
529 | 341 | _line_from_to (cr, &lx, &ly, lx, y2); | ||
530 | 342 | ++exps_found; | ||
531 | 343 | if (align != 0. && align != 1.) | ||
532 | 344 | i = i->next; | ||
533 | 345 | } | ||
534 | 346 | } | ||
535 | 347 | /* else start from top */ | ||
536 | 348 | |||
537 | 349 | for (; i; i = i->next) | ||
538 | 350 | { | ||
539 | 351 | widget = GTK_WIDGET (i->data); | ||
540 | 352 | |||
541 | 353 | if (!GTK_IS_IMAGE (widget) || AWN_IS_SEPARATOR (widget)) | ||
542 | 354 | { | ||
543 | 355 | /* if not expander continue */ | ||
544 | 356 | continue; | ||
545 | 357 | } | ||
546 | 358 | /* expander found */ | ||
547 | 359 | switch (position) | ||
548 | 360 | { | ||
549 | 361 | case GTK_POS_BOTTOM: | ||
550 | 362 | case GTK_POS_TOP: | ||
551 | 363 | curx = widget->allocation.x; | ||
552 | 364 | if (exps_found % 2 != 0) | ||
553 | 365 | curx += widget->allocation.width; | ||
554 | 366 | break; | ||
555 | 367 | default: | ||
556 | 368 | curx = widget->allocation.y; | ||
557 | 369 | if ( exps_found % 2 != 0) | ||
558 | 370 | curx += widget->allocation.height; | ||
559 | 371 | break; | ||
560 | 372 | } | ||
561 | 373 | if (curx < 0) | ||
562 | 374 | continue; | ||
563 | 375 | |||
564 | 376 | if (exps_found == 0) | ||
565 | 377 | { | ||
566 | 378 | /* this is the first expander */ | ||
567 | 379 | lx = curx; | ||
568 | 380 | cairo_move_to (cr, lx, ly); | ||
569 | 381 | _line_from_to (cr, &lx, &ly, curx + d, y2); | ||
570 | 382 | } | ||
571 | 383 | else | ||
572 | 384 | { | ||
573 | 385 | if (exps_found % 2 != 0) | ||
574 | 386 | { | ||
575 | 387 | /* odd expander - curve at the end of expander */ | ||
576 | 388 | _line_from_to (cr, &lx, &ly, curx - d, y2); | ||
577 | 389 | if (i->next == NULL) | ||
578 | 390 | _line_from_to (cr, &lx, &ly, curx, y2); | ||
579 | 391 | _line_from_to (cr, &lx, &ly, curx, y); | ||
580 | 392 | } | ||
581 | 393 | else | ||
582 | 394 | { | ||
583 | 395 | /* even expander - curve at the start of expander */ | ||
584 | 396 | _line_from_to (cr, &lx, &ly, curx, y); | ||
585 | 397 | _line_from_to (cr, &lx, &ly, curx + d, y2); | ||
586 | 398 | /* else the last widget is an expander */ | ||
587 | 399 | } | ||
588 | 400 | } | ||
589 | 401 | |||
590 | 402 | ++exps_found; | ||
591 | 403 | } | ||
592 | 404 | g_list_free (widgets); | ||
593 | 405 | |||
594 | 406 | _line_from_to (cr, &lx, &ly, w, ly); | ||
595 | 407 | |||
596 | 408 | if (exps_found % 2 != 0) | ||
597 | 409 | _line_from_to (cr, &lx, &ly, lx, y); | ||
598 | 410 | |||
599 | 411 | cairo_close_path (cr); | ||
600 | 412 | } | ||
601 | 413 | else | ||
602 | 414 | { | ||
603 | 415 | /* Auto-Stripe & Expanded & External */ | ||
604 | 416 | |||
605 | 417 | GList *widgets = _get_applet_widgets (bg); | ||
606 | 418 | GList *i = widgets; | ||
607 | 419 | GtkWidget *widget = NULL; | ||
608 | 420 | |||
609 | 421 | /* analyze first widget*/ | ||
610 | 422 | if (i) | ||
611 | 423 | { | ||
612 | 424 | widget = GTK_WIDGET (i->data); | ||
613 | 425 | |||
614 | 426 | ly = y3; | ||
615 | 427 | cairo_move_to (cr, lx, ly); | ||
616 | 428 | |||
617 | 429 | /* if first widget is an expander or align==0 || 1*/ | ||
618 | 430 | if ( (widget && GTK_IS_IMAGE (widget) && !AWN_IS_SEPARATOR (widget) ) || | ||
619 | 431 | ( align == 0. || align == 1. ) ) | ||
620 | 432 | { | ||
621 | 433 | /* start from bottom */ | ||
622 | 434 | _line_from_to (cr, &lx, &ly, lx, y2); | ||
623 | 435 | ++exps_found; | ||
624 | 436 | if (align != 0. && align != 1.) | ||
625 | 437 | i = i->next; | ||
626 | 438 | } | ||
627 | 439 | else | ||
628 | 440 | { | ||
629 | 441 | /* start from top */ | ||
630 | 442 | _line_from_to (cr, &lx, &ly, lx, y); | ||
631 | 443 | } | ||
632 | 444 | } | ||
633 | 445 | |||
634 | 446 | for (; i; i = i->next) | ||
635 | 447 | { | ||
636 | 448 | widget = GTK_WIDGET (i->data); | ||
637 | 449 | |||
638 | 450 | if (!GTK_IS_IMAGE (widget) || AWN_IS_SEPARATOR (widget)) | ||
639 | 451 | { | ||
640 | 452 | /* if not expander continue */ | ||
641 | 453 | continue; | ||
642 | 454 | } | ||
643 | 455 | /* expander found */ | ||
644 | 456 | switch (position) | ||
645 | 457 | { | ||
646 | 458 | case GTK_POS_BOTTOM: | ||
647 | 459 | case GTK_POS_TOP: | ||
648 | 460 | curx = widget->allocation.x; | ||
649 | 461 | if (exps_found % 2 != 0) | ||
650 | 462 | curx += widget->allocation.width; | ||
651 | 463 | break; | ||
652 | 464 | default: | ||
653 | 465 | curx = widget->allocation.y; | ||
654 | 466 | if (exps_found % 2 != 0) | ||
655 | 467 | curx += widget->allocation.height; | ||
656 | 468 | break; | ||
657 | 469 | } | ||
658 | 470 | if (curx < 0) | ||
659 | 471 | continue; | ||
660 | 472 | |||
661 | 473 | if (exps_found % 2 != 0) | ||
662 | 474 | { | ||
663 | 475 | _line_from_to (cr, &lx, &ly, curx - d, y2); | ||
664 | 476 | if (i->next != NULL) | ||
665 | 477 | _line_from_to (cr, &lx, &ly, curx, y); | ||
666 | 478 | } | ||
667 | 479 | else | ||
668 | 480 | { | ||
669 | 481 | _line_from_to (cr, &lx, &ly, curx, y); | ||
670 | 482 | _line_from_to (cr, &lx, &ly, curx + d, y2); | ||
671 | 483 | } | ||
672 | 484 | ++exps_found; | ||
673 | 485 | } | ||
674 | 486 | g_list_free (widgets); | ||
675 | 487 | |||
676 | 488 | _line_from_to (cr, &lx, &ly, w, ly); | ||
677 | 489 | _line_from_to (cr, &lx, &ly, lx, y3); | ||
678 | 490 | |||
679 | 491 | cairo_close_path (cr); | ||
680 | 492 | } | ||
681 | 493 | } | ||
682 | 494 | else | ||
683 | 495 | { | ||
684 | 496 | if (internal) | ||
685 | 497 | { | ||
686 | 498 | /* Auto-Stripe & Not-Expanded & Internal */ | ||
687 | 499 | /* no-path */ | ||
688 | 500 | } | ||
689 | 501 | else | ||
690 | 502 | { | ||
691 | 503 | /* Auto-Stripe & Not-Expanded & External */ | ||
692 | 504 | ly = y3; | ||
693 | 505 | cairo_move_to (cr, lx, ly); | ||
694 | 506 | |||
695 | 507 | if (align == 0.) | ||
696 | 508 | _line_from_to (cr, &lx, &ly, lx , y); | ||
697 | 509 | else | ||
698 | 510 | _line_from_to (cr, &lx, &ly, lx + dc, y); | ||
699 | 511 | |||
700 | 512 | if (align == 1.) | ||
701 | 513 | _line_from_to (cr, &lx, &ly, w, y); | ||
702 | 514 | else | ||
703 | 515 | _line_from_to (cr, &lx, &ly, w - dc, y); | ||
704 | 516 | |||
705 | 517 | _line_from_to (cr, &lx, &ly, w, y3); | ||
706 | 518 | cairo_close_path (cr); | ||
707 | 519 | } | ||
708 | 520 | } | ||
709 | 521 | } | ||
710 | 522 | } | ||
711 | 523 | |||
712 | 524 | static void | ||
713 | 525 | draw_top_bottom_background (AwnBackground* bg, | ||
714 | 526 | GtkPositionType position, | ||
715 | 527 | cairo_t* cr, | ||
716 | 528 | gint width, | ||
717 | 529 | gint height) | ||
718 | 530 | { | ||
719 | 531 | cairo_pattern_t *pat = NULL; | ||
720 | 532 | cairo_pattern_t *pat_hi = NULL; | ||
721 | 533 | |||
722 | 534 | /* Make sure the bar gets drawn on the 0.5 pixels (for sharp edges) */ | ||
723 | 535 | cairo_translate (cr, 0.5, 0.5); | ||
724 | 536 | |||
725 | 537 | /* Basic set-up */ | ||
726 | 538 | cairo_set_line_width (cr, 1.0); | ||
727 | 539 | cairo_set_operator (cr, CAIRO_OPERATOR_OVER); | ||
728 | 540 | |||
729 | 541 | if(gtk_widget_is_composited (GTK_WIDGET (bg->panel) ) == FALSE) | ||
730 | 542 | { | ||
731 | 543 | goto paint_lines; | ||
732 | 544 | } | ||
733 | 545 | |||
734 | 546 | gboolean expand = FALSE; | ||
735 | 547 | g_object_get (bg->panel, "expand", &expand, NULL); | ||
736 | 548 | |||
737 | 549 | gfloat align = awn_background_get_panel_alignment (AWN_BACKGROUND (bg)); | ||
738 | 550 | |||
739 | 551 | /* create internal path */ | ||
740 | 552 | _create_path_lucido (bg, position, cr, -1.0, 0., width, height, | ||
741 | 553 | bg->stripe_width, bg->curviness, | ||
742 | 554 | bg->curviness, bg->curves_symmetry, | ||
743 | 555 | 1, expand, align); | ||
744 | 556 | |||
745 | 557 | /* Draw internal pattern if needed */ | ||
746 | 558 | if (bg->enable_pattern && bg->pattern) | ||
747 | 559 | { | ||
748 | 560 | /* Prepare pattern */ | ||
749 | 561 | pat = cairo_pattern_create_for_surface (bg->pattern); | ||
750 | 562 | cairo_pattern_set_extend (pat, CAIRO_EXTEND_REPEAT); | ||
751 | 563 | /* Draw */ | ||
752 | 564 | cairo_save (cr); | ||
753 | 565 | cairo_clip_preserve (cr); | ||
754 | 566 | cairo_set_source (cr, pat); | ||
755 | 567 | cairo_paint (cr); | ||
756 | 568 | cairo_restore (cr); | ||
757 | 569 | cairo_pattern_destroy (pat); | ||
758 | 570 | } | ||
759 | 571 | |||
760 | 572 | /* Prepare the internal background */ | ||
761 | 573 | pat = cairo_pattern_create_linear (0, 0, 0, height); | ||
762 | 574 | awn_cairo_pattern_add_color_stop_color (pat, 0.0, bg->border_color); | ||
763 | 575 | awn_cairo_pattern_add_color_stop_color (pat, 1.0, bg->hilight_color); | ||
764 | 576 | |||
765 | 577 | /* Draw the internal background gradient */ | ||
766 | 578 | cairo_save (cr); | ||
767 | 579 | cairo_clip_preserve (cr); | ||
768 | 580 | cairo_set_source (cr, pat); | ||
769 | 581 | cairo_paint (cr); | ||
770 | 582 | cairo_restore (cr); | ||
771 | 583 | cairo_pattern_destroy (pat); | ||
772 | 584 | |||
773 | 585 | /* Prepare external background gradient*/ | ||
774 | 586 | pat = cairo_pattern_create_linear (0, 0, 0, height); | ||
775 | 587 | awn_cairo_pattern_add_color_stop_color (pat, 0.0, bg->g_step_1); | ||
776 | 588 | awn_cairo_pattern_add_color_stop_color (pat, 1.0, bg->g_step_2); | ||
777 | 589 | |||
778 | 590 | /* create external path */ | ||
779 | 591 | _create_path_lucido (bg, position, cr, -1.0, 0., width, height, | ||
780 | 592 | bg->stripe_width, bg->curviness, | ||
781 | 593 | bg->curviness, bg->curves_symmetry, | ||
782 | 594 | 0, expand, align); | ||
783 | 595 | |||
784 | 596 | /* Draw the external background */ | ||
785 | 597 | cairo_save (cr); | ||
786 | 598 | cairo_clip_preserve (cr); | ||
787 | 599 | cairo_set_source (cr, pat); | ||
788 | 600 | cairo_paint (cr); | ||
789 | 601 | cairo_restore (cr); | ||
790 | 602 | cairo_pattern_destroy (pat); | ||
791 | 603 | |||
792 | 604 | /* Draw the hi-light */ | ||
793 | 605 | pat_hi = cairo_pattern_create_linear (0, 0, 0, (height / 3.0)); | ||
794 | 606 | awn_cairo_pattern_add_color_stop_color (pat_hi, 0.0, bg->g_histep_1); | ||
795 | 607 | awn_cairo_pattern_add_color_stop_color (pat_hi, 1.0, bg->g_histep_2); | ||
796 | 608 | |||
797 | 609 | if (expand) | ||
798 | 610 | { | ||
799 | 611 | cairo_new_path (cr); | ||
800 | 612 | cairo_rectangle (cr, 0, 0, width, (height / 3.0)); | ||
801 | 613 | } | ||
802 | 614 | |||
803 | 615 | cairo_set_source (cr, pat_hi); | ||
804 | 616 | cairo_fill (cr); | ||
805 | 617 | cairo_pattern_destroy (pat_hi); | ||
806 | 618 | |||
807 | 619 | return; | ||
808 | 620 | /* if not composited */ | ||
809 | 621 | paint_lines: | ||
810 | 622 | |||
811 | 623 | /* Internal border */ | ||
812 | 624 | awn_cairo_set_source_color (cr, bg->hilight_color); | ||
813 | 625 | cairo_rectangle (cr, 1, 1, width - 3, height + 3); | ||
814 | 626 | cairo_stroke (cr); | ||
815 | 627 | |||
816 | 628 | /* External border */ | ||
817 | 629 | awn_cairo_set_source_color (cr, bg->border_color); | ||
818 | 630 | cairo_rectangle (cr, 1, 1, width - 1, height + 3); | ||
819 | 631 | cairo_stroke (cr); | ||
820 | 632 | } | ||
821 | 633 | |||
822 | 634 | |||
823 | 635 | static | ||
824 | 636 | void awn_background_lucido_padding_request (AwnBackground *bg, | ||
825 | 637 | GtkPositionType position, | ||
826 | 638 | guint *padding_top, | ||
827 | 639 | guint *padding_bottom, | ||
828 | 640 | guint *padding_left, | ||
829 | 641 | guint *padding_right) | ||
830 | 642 | { | ||
831 | 643 | #define TOP_PADDING 2 | ||
832 | 644 | gboolean expand = FALSE; | ||
833 | 645 | g_object_get (bg->panel, "expand", &expand, NULL); | ||
834 | 646 | gint side_padding = expand ? 0 : bg->curviness; | ||
835 | 647 | gint zero_padding = 0; | ||
836 | 648 | |||
837 | 649 | gfloat align = awn_background_get_panel_alignment (bg); | ||
838 | 650 | if (awn_background_do_rtl_swap (bg)) | ||
839 | 651 | { | ||
840 | 652 | if (align <= 0.0 || align >= 1.0) | ||
841 | 653 | { | ||
842 | 654 | zero_padding = side_padding; | ||
843 | 655 | side_padding = 0; | ||
844 | 656 | } | ||
845 | 657 | } | ||
846 | 658 | |||
847 | 659 | switch (position) | ||
848 | 660 | { | ||
849 | 661 | case GTK_POS_TOP: | ||
850 | 662 | *padding_top = 0; | ||
851 | 663 | *padding_bottom = TOP_PADDING; | ||
852 | 664 | *padding_left = align == 0.0 ? zero_padding : side_padding; | ||
853 | 665 | *padding_right = align == 1.0 ? zero_padding : side_padding; | ||
854 | 666 | break; | ||
855 | 667 | case GTK_POS_BOTTOM: | ||
856 | 668 | *padding_top = TOP_PADDING; | ||
857 | 669 | *padding_bottom = 0; | ||
858 | 670 | *padding_left = align == 0.0 ? zero_padding : side_padding; | ||
859 | 671 | *padding_right = align == 1.0 ? zero_padding : side_padding; | ||
860 | 672 | break; | ||
861 | 673 | case GTK_POS_LEFT: | ||
862 | 674 | *padding_top = align == 0.0 ? zero_padding : side_padding; | ||
863 | 675 | *padding_bottom = align == 1.0 ? zero_padding : side_padding; | ||
864 | 676 | *padding_left = 0; | ||
865 | 677 | *padding_right = TOP_PADDING; | ||
866 | 678 | break; | ||
867 | 679 | case GTK_POS_RIGHT: | ||
868 | 680 | *padding_top = align == 0.0 ? zero_padding : side_padding; | ||
869 | 681 | *padding_bottom = align == 1.0 ? zero_padding : side_padding; | ||
870 | 682 | *padding_left = TOP_PADDING; | ||
871 | 683 | *padding_right = 0; | ||
872 | 684 | break; | ||
873 | 685 | default: | ||
874 | 686 | break; | ||
875 | 687 | } | ||
876 | 688 | } | ||
877 | 689 | |||
878 | 690 | |||
879 | 691 | |||
880 | 692 | static void | ||
881 | 693 | awn_background_lucido_draw (AwnBackground *bg, | ||
882 | 694 | cairo_t *cr, | ||
883 | 695 | GtkPositionType position, | ||
884 | 696 | GdkRectangle *area) | ||
885 | 697 | { | ||
886 | 698 | gint temp; | ||
887 | 699 | gint x = area->x, y = area->y; | ||
888 | 700 | gint width = area->width, height = area->height; | ||
889 | 701 | cairo_save (cr); | ||
890 | 702 | |||
891 | 703 | switch (position) | ||
892 | 704 | { | ||
893 | 705 | case GTK_POS_RIGHT: | ||
894 | 706 | cairo_translate (cr, 0., y + height); | ||
895 | 707 | cairo_scale (cr, 1., -1.); | ||
896 | 708 | cairo_translate (cr, x, height); | ||
897 | 709 | cairo_rotate (cr, M_PI * 1.5); | ||
898 | 710 | temp = width; | ||
899 | 711 | width = height; | ||
900 | 712 | height = temp; | ||
901 | 713 | break; | ||
902 | 714 | case GTK_POS_LEFT: | ||
903 | 715 | cairo_translate (cr, x + width, y); | ||
904 | 716 | cairo_rotate (cr, M_PI * 0.5); | ||
905 | 717 | temp = width; | ||
906 | 718 | width = height; | ||
907 | 719 | height = temp; | ||
908 | 720 | break; | ||
909 | 721 | case GTK_POS_TOP: | ||
910 | 722 | cairo_translate (cr, x, y + height); | ||
911 | 723 | cairo_scale (cr, 1., -1.); | ||
912 | 724 | break; | ||
913 | 725 | default: | ||
914 | 726 | cairo_translate (cr, x, y); | ||
915 | 727 | break; | ||
916 | 728 | } | ||
917 | 729 | |||
918 | 730 | draw_top_bottom_background (bg, position, cr, width, height); | ||
919 | 731 | |||
920 | 732 | cairo_restore (cr); | ||
921 | 733 | } | ||
922 | 734 | |||
923 | 735 | static gboolean | ||
924 | 736 | awn_background_lucido_get_needs_redraw (AwnBackground *bg, | ||
925 | 737 | GtkPositionType position, | ||
926 | 738 | GdkRectangle *area) | ||
927 | 739 | { | ||
928 | 740 | /* Check default needs redraw */ | ||
929 | 741 | gboolean nr = AWN_BACKGROUND_CLASS (awn_background_lucido_parent_class)-> | ||
930 | 742 | get_needs_redraw (bg, position, area); | ||
931 | 743 | if (nr) | ||
932 | 744 | return TRUE; | ||
933 | 745 | |||
934 | 746 | /* Check expanders positions & sizes changed */ | ||
935 | 747 | GList *widgets = _get_applet_widgets (bg); | ||
936 | 748 | GList *i = widgets; | ||
937 | 749 | GtkWidget *widget = NULL; | ||
938 | 750 | gint wcheck = 0; | ||
939 | 751 | gint ncheck = 0; | ||
940 | 752 | |||
941 | 753 | for (; i; i = i->next) | ||
942 | 754 | { | ||
943 | 755 | widget = GTK_WIDGET (i->data); | ||
944 | 756 | |||
945 | 757 | if (!GTK_IS_IMAGE (widget) || AWN_IS_SEPARATOR (widget)) | ||
946 | 758 | { | ||
947 | 759 | /* if not expander continue */ | ||
948 | 760 | continue; | ||
949 | 761 | } | ||
950 | 762 | switch (position) | ||
951 | 763 | { | ||
952 | 764 | case GTK_POS_BOTTOM: | ||
953 | 765 | case GTK_POS_TOP: | ||
954 | 766 | wcheck += (widget->allocation.x * 3) / 2 + widget->allocation.width; | ||
955 | 767 | break; | ||
956 | 768 | default: | ||
957 | 769 | wcheck += (widget->allocation.y * 3 ) / 2 + widget->allocation.height; | ||
958 | 770 | break; | ||
959 | 771 | } | ||
960 | 772 | ++ncheck; | ||
961 | 773 | } | ||
962 | 774 | g_list_free (widgets); | ||
963 | 775 | |||
964 | 776 | AwnBackgroundLucido *lbg = NULL; | ||
965 | 777 | lbg = AWN_BACKGROUND_LUCIDO (bg); | ||
966 | 778 | AwnBackgroundLucidoPrivate *priv; | ||
967 | 779 | priv = AWN_BACKGROUND_LUCIDO_GET_PRIVATE (lbg); | ||
968 | 780 | if (priv->expn != ncheck) | ||
969 | 781 | { | ||
970 | 782 | priv->expn = ncheck; | ||
971 | 783 | /* used to refresh bar */ | ||
972 | 784 | awn_background_emit_padding_changed (bg); | ||
973 | 785 | } | ||
974 | 786 | if (priv->expw != wcheck) | ||
975 | 787 | { | ||
976 | 788 | priv->expw = wcheck; | ||
977 | 789 | return TRUE; | ||
978 | 790 | } | ||
979 | 791 | return FALSE; | ||
980 | 792 | } | ||
981 | 793 | |||
982 | 794 | static void | ||
983 | 795 | awn_background_lucido_get_shape_mask (AwnBackground *bg, | ||
984 | 796 | cairo_t *cr, | ||
985 | 797 | GtkPositionType position, | ||
986 | 798 | GdkRectangle *area) | ||
987 | 799 | { | ||
988 | 800 | gint temp; | ||
989 | 801 | gint x = area->x, y = area->y; | ||
990 | 802 | gint width = area->width, height = area->height; | ||
991 | 803 | gfloat align = 0.5; | ||
992 | 804 | gboolean expand = FALSE; | ||
993 | 805 | |||
994 | 806 | cairo_save (cr); | ||
995 | 807 | |||
996 | 808 | align = awn_background_get_panel_alignment (bg); | ||
997 | 809 | g_object_get (bg->panel, "expand", &expand, NULL); | ||
998 | 810 | |||
999 | 811 | switch (position) | ||
1000 | 812 | { | ||
1001 | 813 | case GTK_POS_RIGHT: | ||
1002 | 814 | cairo_translate (cr, x, y+height); | ||
1003 | 815 | cairo_rotate (cr, M_PI * 1.5); | ||
1004 | 816 | temp = width; | ||
1005 | 817 | width = height; height = temp; | ||
1006 | 818 | break; | ||
1007 | 819 | case GTK_POS_LEFT: | ||
1008 | 820 | cairo_translate (cr, x+width, y); | ||
1009 | 821 | cairo_rotate (cr, M_PI * 0.5); | ||
1010 | 822 | temp = width; | ||
1011 | 823 | width = height; height = temp; | ||
1012 | 824 | break; | ||
1013 | 825 | case GTK_POS_TOP: | ||
1014 | 826 | cairo_translate (cr, x+width, y+height); | ||
1015 | 827 | cairo_rotate (cr, M_PI); | ||
1016 | 828 | break; | ||
1017 | 829 | default: | ||
1018 | 830 | cairo_translate (cr, x, y); | ||
1019 | 831 | break; | ||
1020 | 832 | } | ||
1021 | 833 | |||
1022 | 834 | cairo_rectangle (cr, 0, 0, width, height + 2); | ||
1023 | 835 | cairo_fill (cr); | ||
1024 | 836 | |||
1025 | 837 | cairo_restore (cr); | ||
1026 | 838 | } | ||
1027 | 839 | /* vim: set et ts=2 sts=2 sw=2 : */ | ||
1028 | 0 | 840 | ||
1029 | === added file 'src/awn-background-lucido.h' | |||
1030 | --- src/awn-background-lucido.h 1970-01-01 00:00:00 +0000 | |||
1031 | +++ src/awn-background-lucido.h 2010-05-31 11:01:08 +0000 | |||
1032 | @@ -0,0 +1,71 @@ | |||
1033 | 1 | /* | ||
1034 | 2 | * Copyright (C) 2009 Michal Hruby <michal.mhr@gmail.com> | ||
1035 | 3 | * | ||
1036 | 4 | * This program is free software; you can redistribute it and/or modify | ||
1037 | 5 | * it under the terms of the GNU General Public License as published by | ||
1038 | 6 | * the Free Software Foundation; either version 2 of the License, or | ||
1039 | 7 | * (at your option) any later version. | ||
1040 | 8 | * | ||
1041 | 9 | * This program is distributed in the hope that it will be useful, | ||
1042 | 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
1043 | 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
1044 | 12 | * GNU General Public License for more details. | ||
1045 | 13 | * | ||
1046 | 14 | * You should have received a copy of the GNU General Public License | ||
1047 | 15 | * along with this program; if not, write to the Free Software | ||
1048 | 16 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. | ||
1049 | 17 | * | ||
1050 | 18 | * Author : Alberto Aldegheri <albyrock87+dev@gmail.com> | ||
1051 | 19 | */ | ||
1052 | 20 | |||
1053 | 21 | #ifndef _AWN_BACKGROUND_LUCIDO_H | ||
1054 | 22 | #define _AWN_BACKGROUND_LUCIDO_H | ||
1055 | 23 | |||
1056 | 24 | #include <glib.h> | ||
1057 | 25 | #include <glib-object.h> | ||
1058 | 26 | #include <gtk/gtk.h> | ||
1059 | 27 | |||
1060 | 28 | #include "awn-background.h" | ||
1061 | 29 | |||
1062 | 30 | G_BEGIN_DECLS | ||
1063 | 31 | |||
1064 | 32 | #define AWN_TYPE_BACKGROUND_LUCIDO (awn_background_lucido_get_type()) | ||
1065 | 33 | |||
1066 | 34 | #define AWN_BACKGROUND_LUCIDO(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), AWN_TYPE_BACKGROUND_LUCIDO, \ | ||
1067 | 35 | AwnBackgroundLucido)) | ||
1068 | 36 | |||
1069 | 37 | #define AWN_BACKGROUND_LUCIDO_CLASS(obj) (G_TYPE_CHECK_CLASS_CAST ((obj), AWN_BACKGROUND_LUCIDO, \ | ||
1070 | 38 | AwnBackgroundLucidoClass)) | ||
1071 | 39 | |||
1072 | 40 | #define AWN_IS_BACKGROUND_LUCIDO(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), AWN_TYPE_BACKGROUND_LUCIDO)) | ||
1073 | 41 | |||
1074 | 42 | #define AWN_IS_BACKGROUND_LUCIDO_CLASS(obj) (G_TYPE_CHECK_CLASS_TYPE ((obj), \ | ||
1075 | 43 | AWN_TYPE_BACKGROUND_LUCIDO)) | ||
1076 | 44 | |||
1077 | 45 | #define AWN_BACKGROUND_LUCIDO_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), \ | ||
1078 | 46 | AWN_TYPE_BACKGROUND_LUCIDO, AwnBackgroundLucidoClass)) | ||
1079 | 47 | |||
1080 | 48 | typedef struct _AwnBackgroundLucido AwnBackgroundLucido; | ||
1081 | 49 | typedef struct _AwnBackgroundLucidoClass AwnBackgroundLucidoClass; | ||
1082 | 50 | typedef struct _AwnBackgroundLucidoPrivate AwnBackgroundLucidoPrivate; | ||
1083 | 51 | |||
1084 | 52 | struct _AwnBackgroundLucido | ||
1085 | 53 | { | ||
1086 | 54 | AwnBackground parent; | ||
1087 | 55 | AwnBackgroundLucidoPrivate *priv; | ||
1088 | 56 | }; | ||
1089 | 57 | |||
1090 | 58 | struct _AwnBackgroundLucidoClass | ||
1091 | 59 | { | ||
1092 | 60 | AwnBackgroundClass parent_class; | ||
1093 | 61 | }; | ||
1094 | 62 | |||
1095 | 63 | GType awn_background_lucido_get_type (void) G_GNUC_CONST; | ||
1096 | 64 | |||
1097 | 65 | AwnBackground * awn_background_lucido_new (DesktopAgnosticConfigClient *client, | ||
1098 | 66 | AwnPanel *panel); | ||
1099 | 67 | |||
1100 | 68 | G_END_DECLS | ||
1101 | 69 | |||
1102 | 70 | #endif /* _AWN_BACKGROUND_LUCIDO_H */ | ||
1103 | 71 | |||
1104 | 0 | 72 | ||
1105 | === modified file 'src/awn-background.c' | |||
1106 | --- src/awn-background.c 2010-04-08 15:38:05 +0000 | |||
1107 | +++ src/awn-background.c 2010-05-31 11:01:08 +0000 | |||
1108 | @@ -58,7 +58,8 @@ | |||
1109 | 58 | PROP_CORNER_RADIUS, | 58 | PROP_CORNER_RADIUS, |
1110 | 59 | PROP_PANEL_ANGLE, | 59 | PROP_PANEL_ANGLE, |
1111 | 60 | PROP_CURVINESS, | 60 | PROP_CURVINESS, |
1113 | 61 | PROP_CURVES_SYMEMETRY | 61 | PROP_CURVES_SYMEMETRY, |
1114 | 62 | PROP_STRIPE_WIDTH | ||
1115 | 62 | }; | 63 | }; |
1116 | 63 | 64 | ||
1117 | 64 | enum | 65 | enum |
1118 | @@ -90,6 +91,10 @@ | |||
1119 | 90 | GtkPositionType position, | 91 | GtkPositionType position, |
1120 | 91 | GdkRectangle *area); | 92 | GdkRectangle *area); |
1121 | 92 | 93 | ||
1122 | 94 | static gboolean awn_background_get_needs_redraw (AwnBackground *bg, | ||
1123 | 95 | GtkPositionType position, | ||
1124 | 96 | GdkRectangle *area); | ||
1125 | 97 | |||
1126 | 93 | static AwnPathType awn_background_path_default (AwnBackground *bg, | 98 | static AwnPathType awn_background_path_default (AwnBackground *bg, |
1127 | 94 | gfloat *offset_mod); | 99 | gfloat *offset_mod); |
1128 | 95 | 100 | ||
1129 | @@ -186,6 +191,11 @@ | |||
1130 | 186 | object, "curves-symmetry", TRUE, | 191 | object, "curves-symmetry", TRUE, |
1131 | 187 | DESKTOP_AGNOSTIC_CONFIG_BIND_METHOD_FALLBACK, | 192 | DESKTOP_AGNOSTIC_CONFIG_BIND_METHOD_FALLBACK, |
1132 | 188 | NULL); | 193 | NULL); |
1133 | 194 | desktop_agnostic_config_client_bind (bg->client, | ||
1134 | 195 | AWN_GROUP_THEME, AWN_THEME_STRIPE_WIDTH, | ||
1135 | 196 | object, "stripe-width", TRUE, | ||
1136 | 197 | DESKTOP_AGNOSTIC_CONFIG_BIND_METHOD_FALLBACK, | ||
1137 | 198 | NULL); | ||
1138 | 189 | } | 199 | } |
1139 | 190 | 200 | ||
1140 | 191 | static void | 201 | static void |
1141 | @@ -342,12 +352,15 @@ | |||
1142 | 342 | case PROP_CURVES_SYMEMETRY: | 352 | case PROP_CURVES_SYMEMETRY: |
1143 | 343 | bg->curves_symmetry = g_value_get_float (value); | 353 | bg->curves_symmetry = g_value_get_float (value); |
1144 | 344 | break; | 354 | break; |
1145 | 355 | case PROP_STRIPE_WIDTH: | ||
1146 | 356 | bg->stripe_width = g_value_get_float (value); | ||
1147 | 357 | break; | ||
1148 | 345 | 358 | ||
1149 | 346 | default: | 359 | default: |
1150 | 347 | G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); | 360 | G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); |
1151 | 348 | return; | 361 | return; |
1152 | 349 | } | 362 | } |
1154 | 350 | 363 | awn_background_invalidate (bg); | |
1155 | 351 | g_signal_emit (object, _bg_signals[CHANGED], 0); | 364 | g_signal_emit (object, _bg_signals[CHANGED], 0); |
1156 | 352 | } | 365 | } |
1157 | 353 | 366 | ||
1158 | @@ -380,6 +393,12 @@ | |||
1159 | 380 | if (bg->hilight_color) g_object_unref (bg->hilight_color); | 393 | if (bg->hilight_color) g_object_unref (bg->hilight_color); |
1160 | 381 | if (bg->sep_color) g_object_unref (bg->sep_color); | 394 | if (bg->sep_color) g_object_unref (bg->sep_color); |
1161 | 382 | 395 | ||
1162 | 396 | if (bg->helper_surface != NULL) | ||
1163 | 397 | { | ||
1164 | 398 | cairo_surface_finish (bg->helper_surface); | ||
1165 | 399 | cairo_surface_destroy (bg->helper_surface); | ||
1166 | 400 | } | ||
1167 | 401 | |||
1168 | 383 | G_OBJECT_CLASS (awn_background_parent_class)->finalize (object); | 402 | G_OBJECT_CLASS (awn_background_parent_class)->finalize (object); |
1169 | 384 | } | 403 | } |
1170 | 385 | 404 | ||
1171 | @@ -398,6 +417,7 @@ | |||
1172 | 398 | klass->get_input_shape_mask = awn_background_mask_none; | 417 | klass->get_input_shape_mask = awn_background_mask_none; |
1173 | 399 | klass->get_path_type = awn_background_path_default; | 418 | klass->get_path_type = awn_background_path_default; |
1174 | 400 | klass->get_strut_offsets = NULL; | 419 | klass->get_strut_offsets = NULL; |
1175 | 420 | klass->get_needs_redraw = awn_background_get_needs_redraw; | ||
1176 | 401 | 421 | ||
1177 | 402 | /* Object properties */ | 422 | /* Object properties */ |
1178 | 403 | g_object_class_install_property (obj_class, | 423 | g_object_class_install_property (obj_class, |
1179 | @@ -575,6 +595,15 @@ | |||
1180 | 575 | 0.0, 1.0, 0.5, | 595 | 0.0, 1.0, 0.5, |
1181 | 576 | G_PARAM_READWRITE | G_PARAM_CONSTRUCT | | 596 | G_PARAM_READWRITE | G_PARAM_CONSTRUCT | |
1182 | 577 | G_PARAM_STATIC_STRINGS)); | 597 | G_PARAM_STATIC_STRINGS)); |
1183 | 598 | |||
1184 | 599 | g_object_class_install_property (obj_class, | ||
1185 | 600 | PROP_STRIPE_WIDTH, | ||
1186 | 601 | g_param_spec_float ("stripe-width", | ||
1187 | 602 | "Stripe Width", | ||
1188 | 603 | "The width of the stripe", | ||
1189 | 604 | 0.0, 1.0, 0.0, | ||
1190 | 605 | G_PARAM_READWRITE | G_PARAM_CONSTRUCT | | ||
1191 | 606 | G_PARAM_STATIC_STRINGS)); | ||
1192 | 578 | 607 | ||
1193 | 579 | /* Add signals to the class */ | 608 | /* Add signals to the class */ |
1194 | 580 | _bg_signals[CHANGED] = | 609 | _bg_signals[CHANGED] = |
1195 | @@ -650,6 +679,11 @@ | |||
1196 | 650 | bg->border_color = NULL; | 679 | bg->border_color = NULL; |
1197 | 651 | bg->hilight_color = NULL; | 680 | bg->hilight_color = NULL; |
1198 | 652 | bg->sep_color = NULL; | 681 | bg->sep_color = NULL; |
1199 | 682 | bg->needs_redraw = TRUE; | ||
1200 | 683 | bg->helper_surface = NULL; | ||
1201 | 684 | bg->cache_enabled = TRUE; | ||
1202 | 685 | bg->last_height = 0; | ||
1203 | 686 | bg->last_width = 0; | ||
1204 | 653 | } | 687 | } |
1205 | 654 | 688 | ||
1206 | 655 | void | 689 | void |
1207 | @@ -664,8 +698,40 @@ | |||
1208 | 664 | 698 | ||
1209 | 665 | klass = AWN_BACKGROUND_GET_CLASS (bg); | 699 | klass = AWN_BACKGROUND_GET_CLASS (bg); |
1210 | 666 | g_return_if_fail (klass->draw != NULL); | 700 | g_return_if_fail (klass->draw != NULL); |
1213 | 667 | 701 | ||
1214 | 668 | klass->draw (bg, cr, position, area); | 702 | /* Check if background caching is enabled - TRUE by default */ |
1215 | 703 | if (bg->cache_enabled) | ||
1216 | 704 | { | ||
1217 | 705 | g_return_if_fail (klass->get_needs_redraw != NULL); | ||
1218 | 706 | cairo_save (cr); | ||
1219 | 707 | |||
1220 | 708 | /* Check if background needs to be redrawn */ | ||
1221 | 709 | if (klass->get_needs_redraw (bg, position, area)) | ||
1222 | 710 | { | ||
1223 | 711 | /* Free last surface */ | ||
1224 | 712 | if (bg->helper_surface != NULL) | ||
1225 | 713 | { | ||
1226 | 714 | cairo_surface_finish (bg->helper_surface); | ||
1227 | 715 | cairo_surface_destroy (bg->helper_surface); | ||
1228 | 716 | } | ||
1229 | 717 | /* Create new surface */ | ||
1230 | 718 | bg->helper_surface = cairo_image_surface_create (CAIRO_FORMAT_ARGB32, | ||
1231 | 719 | area->x + area->width, | ||
1232 | 720 | area->y + area->height); | ||
1233 | 721 | cairo_t* temp_cr = cairo_create (bg->helper_surface); | ||
1234 | 722 | /* Draw background on temp cairo_t */ | ||
1235 | 723 | klass->draw (bg, temp_cr, position, area); | ||
1236 | 724 | cairo_destroy (temp_cr); | ||
1237 | 725 | } | ||
1238 | 726 | /* Paint saved surface */ | ||
1239 | 727 | cairo_set_source_surface (cr, bg->helper_surface, 0., 0.); | ||
1240 | 728 | cairo_paint(cr); | ||
1241 | 729 | cairo_restore (cr); | ||
1242 | 730 | } | ||
1243 | 731 | else | ||
1244 | 732 | { | ||
1245 | 733 | klass->draw (bg, cr, position, area); | ||
1246 | 734 | } | ||
1247 | 669 | } | 735 | } |
1248 | 670 | 736 | ||
1249 | 671 | void | 737 | void |
1250 | @@ -1009,4 +1075,25 @@ | |||
1251 | 1009 | return AWN_PATH_LINEAR; | 1075 | return AWN_PATH_LINEAR; |
1252 | 1010 | } | 1076 | } |
1253 | 1011 | 1077 | ||
1254 | 1078 | static gboolean awn_background_get_needs_redraw (AwnBackground *bg, | ||
1255 | 1079 | GtkPositionType position, | ||
1256 | 1080 | GdkRectangle *area) | ||
1257 | 1081 | { | ||
1258 | 1082 | if (bg->needs_redraw == 1 || | ||
1259 | 1083 | bg->last_height != area->height || | ||
1260 | 1084 | bg->last_width != area->width) | ||
1261 | 1085 | { | ||
1262 | 1086 | bg->needs_redraw = 0; | ||
1263 | 1087 | bg->last_height = area->height; | ||
1264 | 1088 | bg->last_width = area->width; | ||
1265 | 1089 | return TRUE; | ||
1266 | 1090 | } | ||
1267 | 1091 | return FALSE; | ||
1268 | 1092 | } | ||
1269 | 1093 | |||
1270 | 1094 | void awn_background_invalidate (AwnBackground *bg) | ||
1271 | 1095 | { | ||
1272 | 1096 | bg->needs_redraw = 1; | ||
1273 | 1097 | } | ||
1274 | 1098 | |||
1275 | 1012 | /* vim: set et ts=2 sts=2 sw=2 : */ | 1099 | /* vim: set et ts=2 sts=2 sw=2 : */ |
1276 | 1013 | 1100 | ||
1277 | === modified file 'src/awn-background.h' | |||
1278 | --- src/awn-background.h 2010-03-07 18:38:07 +0000 | |||
1279 | +++ src/awn-background.h 2010-05-31 11:01:08 +0000 | |||
1280 | @@ -76,6 +76,15 @@ | |||
1281 | 76 | gfloat pattern_alpha; | 76 | gfloat pattern_alpha; |
1282 | 77 | GdkPixbuf *pattern_original; | 77 | GdkPixbuf *pattern_original; |
1283 | 78 | cairo_surface_t *pattern; | 78 | cairo_surface_t *pattern; |
1284 | 79 | |||
1285 | 80 | /* Speedup code. | ||
1286 | 81 | * We can save the bg and redraw only when properties changes | ||
1287 | 82 | */ | ||
1288 | 83 | gboolean cache_enabled; | ||
1289 | 84 | gboolean needs_redraw; | ||
1290 | 85 | cairo_surface_t* helper_surface; | ||
1291 | 86 | gint last_height; | ||
1292 | 87 | gint last_width; | ||
1293 | 79 | 88 | ||
1294 | 80 | /* FIXME: | 89 | /* FIXME: |
1295 | 81 | * These two should ultimately go somewhere else (once we do multiple panels) | 90 | * These two should ultimately go somewhere else (once we do multiple panels) |
1296 | @@ -89,6 +98,7 @@ | |||
1297 | 89 | gint panel_angle; | 98 | gint panel_angle; |
1298 | 90 | gfloat curviness; | 99 | gfloat curviness; |
1299 | 91 | gfloat curves_symmetry; | 100 | gfloat curves_symmetry; |
1300 | 101 | gfloat stripe_width; | ||
1301 | 92 | 102 | ||
1302 | 93 | /* private */ | 103 | /* private */ |
1303 | 94 | guint changed; | 104 | guint changed; |
1304 | @@ -129,6 +139,10 @@ | |||
1305 | 129 | GdkRectangle *area, | 139 | GdkRectangle *area, |
1306 | 130 | gint *strut, | 140 | gint *strut, |
1307 | 131 | gint *strut_start, gint *strut_end); | 141 | gint *strut_start, gint *strut_end); |
1308 | 142 | |||
1309 | 143 | gboolean (*get_needs_redraw) (AwnBackground *bg, | ||
1310 | 144 | GtkPositionType position, | ||
1311 | 145 | GdkRectangle *area); | ||
1312 | 132 | 146 | ||
1313 | 133 | /*< signals >*/ | 147 | /*< signals >*/ |
1314 | 134 | void (*changed) (AwnBackground *bg); | 148 | void (*changed) (AwnBackground *bg); |
1315 | @@ -142,6 +156,8 @@ | |||
1316 | 142 | GtkPositionType position, | 156 | GtkPositionType position, |
1317 | 143 | GdkRectangle *area); | 157 | GdkRectangle *area); |
1318 | 144 | 158 | ||
1319 | 159 | void awn_background_invalidate (AwnBackground *bg); | ||
1320 | 160 | |||
1321 | 145 | void awn_background_padding_request (AwnBackground *bg, | 161 | void awn_background_padding_request (AwnBackground *bg, |
1322 | 146 | GtkPositionType position, | 162 | GtkPositionType position, |
1323 | 147 | guint *padding_top, | 163 | guint *padding_top, |
1324 | 148 | 164 | ||
1325 | === modified file 'src/awn-defines.h' | |||
1326 | --- src/awn-defines.h 2010-02-06 13:34:02 +0000 | |||
1327 | +++ src/awn-defines.h 2010-05-31 11:01:08 +0000 | |||
1328 | @@ -87,6 +87,7 @@ | |||
1329 | 87 | #define AWN_THEME_PANEL_ANGLE "panel_angle" | 87 | #define AWN_THEME_PANEL_ANGLE "panel_angle" |
1330 | 88 | #define AWN_THEME_CURVINESS "curviness" | 88 | #define AWN_THEME_CURVINESS "curviness" |
1331 | 89 | #define AWN_THEME_CURVES_SYMMETRY "curves_symmetry" | 89 | #define AWN_THEME_CURVES_SYMMETRY "curves_symmetry" |
1332 | 90 | #define AWN_THEME_STRIPE_WIDTH "stripe_width" | ||
1333 | 90 | 91 | ||
1334 | 91 | #endif /*_HAVE_AWN_DEFINES_H */ | 92 | #endif /*_HAVE_AWN_DEFINES_H */ |
1335 | 92 | 93 | ||
1336 | 93 | 94 | ||
1337 | === modified file 'src/awn-panel.c' | |||
1338 | --- src/awn-panel.c 2010-05-29 17:17:22 +0000 | |||
1339 | +++ src/awn-panel.c 2010-05-31 11:01:08 +0000 | |||
1340 | @@ -43,6 +43,7 @@ | |||
1341 | 43 | #include "awn-background-3d.h" | 43 | #include "awn-background-3d.h" |
1342 | 44 | #include "awn-background-curves.h" | 44 | #include "awn-background-curves.h" |
1343 | 45 | #include "awn-background-edgy.h" | 45 | #include "awn-background-edgy.h" |
1344 | 46 | #include "awn-background-lucido.h" | ||
1345 | 46 | #include "awn-background-floaty.h" | 47 | #include "awn-background-floaty.h" |
1346 | 47 | #include "awn-defines.h" | 48 | #include "awn-defines.h" |
1347 | 48 | #include "awn-marshal.h" | 49 | #include "awn-marshal.h" |
1348 | @@ -222,6 +223,7 @@ | |||
1349 | 222 | STYLE_EDGY, | 223 | STYLE_EDGY, |
1350 | 223 | STYLE_FLOATY, | 224 | STYLE_FLOATY, |
1351 | 224 | 225 | ||
1352 | 226 | STYLE_LUCIDO, | ||
1353 | 225 | STYLE_LAST | 227 | STYLE_LAST |
1354 | 226 | }; | 228 | }; |
1355 | 227 | 229 | ||
1356 | @@ -1075,6 +1077,9 @@ | |||
1357 | 1075 | } | 1077 | } |
1358 | 1076 | 1078 | ||
1359 | 1077 | awn_panel_queue_masks_update (panel); | 1079 | awn_panel_queue_masks_update (panel); |
1360 | 1080 | |||
1361 | 1081 | if (priv->bg) | ||
1362 | 1082 | awn_background_invalidate (priv->bg); | ||
1363 | 1078 | } | 1083 | } |
1364 | 1079 | 1084 | ||
1365 | 1080 | static | 1085 | static |
1366 | @@ -1760,7 +1765,7 @@ | |||
1367 | 1760 | obj_class->finalize = awn_panel_finalize; | 1765 | obj_class->finalize = awn_panel_finalize; |
1368 | 1761 | obj_class->get_property = awn_panel_get_property; | 1766 | obj_class->get_property = awn_panel_get_property; |
1369 | 1762 | obj_class->set_property = awn_panel_set_property; | 1767 | obj_class->set_property = awn_panel_set_property; |
1371 | 1763 | 1768 | ||
1372 | 1764 | cont_class->add = awn_panel_add; | 1769 | cont_class->add = awn_panel_add; |
1373 | 1765 | 1770 | ||
1374 | 1766 | wid_class->expose_event = awn_panel_expose; | 1771 | wid_class->expose_event = awn_panel_expose; |
1375 | @@ -3179,6 +3184,9 @@ | |||
1376 | 3179 | case STYLE_EDGY: | 3184 | case STYLE_EDGY: |
1377 | 3180 | priv->bg = awn_background_edgy_new (priv->client, panel); | 3185 | priv->bg = awn_background_edgy_new (priv->client, panel); |
1378 | 3181 | break; | 3186 | break; |
1379 | 3187 | case STYLE_LUCIDO: | ||
1380 | 3188 | priv->bg = awn_background_lucido_new (priv->client, panel); | ||
1381 | 3189 | break; | ||
1382 | 3182 | case STYLE_FLOATY: | 3190 | case STYLE_FLOATY: |
1383 | 3183 | priv->bg = awn_background_floaty_new (priv->client, panel); | 3191 | priv->bg = awn_background_floaty_new (priv->client, panel); |
1384 | 3184 | break; | 3192 | break; |
WTF!!!
Why BZR removes 'po/avant- window- navigator. pot' if i've never touched that file?????