Awn

Merge lp:~albyrock87/awn/awn-lucido into lp:awn/0.4

Proposed by Alberto Aldegheri
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
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.

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)

:)

To post a comment you must log in.
Revision history for this message
Alberto Aldegheri (albyrock87) wrote : Posted in a previous version of this proposal

WTF!!!

Why BZR removes 'po/avant-window-navigator.pot' if i've never touched that file?????

Revision history for this message
Michal Hruby (mhr3) wrote : Posted in a previous version of this proposal

> WTF!!!
>
> Why BZR removes 'po/avant-window-navigator.pot' if i've never touched that
> 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.

review: Needs Fixing (coding-conventions)
Revision history for this message
Alberto Aldegheri (albyrock87) wrote : Posted in a previous version of this proposal

> > WTF!!!
> >
> > Why BZR removes 'po/avant-window-navigator.pot' if i've never touched that
> > 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-window-navigator.pot' -> restored from rev 699
Conding style fixes :)
Default Stripe-Width = 0 (enables auto-stripe)

review: Needs Resubmitting
Revision history for this message
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

Revision history for this message
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) :)

Revision history for this message
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_get_children() )
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.

review: Needs Fixing (code review)
Revision history for this message
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_get_children() )
> 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)CLOCKS_PER_SEC) / 1000.0 );

Revision history for this message
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_get_children() )
> 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 :)

Revision history for this message
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.

review: Needs Resubmitting
Revision history for this message
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_get_needs_redraw (and also the lucido variant) is not necessary to be exposed in the .h files. Please make it a static method and use the virtual klass->get_needs_redraw to call it.
3) Also why is 1190-1192 necessary?

review: Needs Fixing
Revision history for this message
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_get_needs_redraw (and also the lucido variant)
> is not necessary to be exposed in the .h files. Please make it a static method
> and use the virtual klass->get_needs_redraw to call it.
awn_background_get_needs_redraw needs to be in awn-background.h because it is used in awn-background-lucido.c @ awn_background_lucido_get_needs_redraw.

Moved awn_background_lucido_get_needs_redraw into .c

> 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.

Revision history for this message
Michal Hruby (mhr3) wrote : Posted in a previous version of this proposal

> > 2) It seems that awn_background_get_needs_redraw (and also the lucido
> variant)
> > is not necessary to be exposed in the .h files. Please make it a static
> method
> > and use the virtual klass->get_needs_redraw to call it.
> awn_background_get_needs_redraw needs to be in awn-background.h because it is
> used in awn-background-lucido.c @ awn_background_lucido_get_needs_redraw.

It still doesn't have to be in the .h, you can use >>>
AWN_BACKGROUND_CLASS (awn_background_lucido_parent_class)-> get_needs_redraw ()

> > 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_invalidate), the usage of public variables is really unfortunate in the background class.

review: Needs Fixing
Revision history for this message
Alberto Aldegheri (albyrock87) wrote : Posted in a previous version of this proposal

> > > 2) It seems that awn_background_get_needs_redraw (and also the lucido
> > variant)
> > > is not necessary to be exposed in the .h files. Please make it a static
> > method
> > > and use the virtual klass->get_needs_redraw to call it.
> > awn_background_get_needs_redraw needs to be in awn-background.h because it
> is
> > used in awn-background-lucido.c @ awn_background_lucido_get_needs_redraw.
>
> It still doesn't have to be in the .h, you can use >>>
> AWN_BACKGROUND_CLASS (awn_background_lucido_parent_class)-> get_needs_redraw
> ()

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_invalidate), the usage of
> public variables is really unfortunate in the background class.

You're right, done

Revision history for this message
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.

review: Needs Fixing (code-review)
Revision history for this message
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.

Revision history for this message
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.

Revision history for this message
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.

Revision history for this message
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.

review: Needs Information
Revision history for this message
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 :)

Revision history for this message
Alberto Aldegheri (albyrock87) :
review: Approve
Revision history for this message
Alberto Aldegheri (albyrock87) wrote :

Noes!! There's a bug with a special configuration, i'll fix soon :(

Revision history for this message
Alberto Aldegheri (albyrock87) wrote :

> Noes!! There's a bug with a special configuration, i'll fix soon :(
Ok, done :)

Revision history for this message
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_emit_padding_changed).
2) There's no need for "property-changed", this is implemented automatically for every property which is registered using g_object_class_install_property. The only thing you need to do is connect to the "notify" signal of the object with detail id set to the property name. (see src/awn-background-edgy.c:146)

review: Needs Fixing (code-review)
Revision history for this message
Michal Hruby (mhr3) wrote :

And I also have one question - what is the rationale behind using curviness instead of corner_radius?

Revision history for this message
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.

Revision history for this message
Alberto Aldegheri (albyrock87) wrote :

How can I remove myself from reviewers? :D

review: Approve
Revision history for this message
Michal Hruby (mhr3) wrote :

Good question... Change it to Abstain?!

Revision history for this message
Alberto Aldegheri (albyrock87) wrote :

Tanks Michal! ;)

However, Lucido seems to be ready now :)

review: Abstain
Revision history for this message
Michal Hruby (mhr3) wrote :

Looking at the latest changes, shouldn't you monitor also changes to "expand" property and emit padding-changed?

Revision history for this message
Alberto Aldegheri (albyrock87) wrote :

I think that "expand" already refreshes padding. So there's no need to observ "expand"..

Revision history for this message
Michal Hruby (mhr3) wrote :

I see, you derive from FLAT background, and it monitors expand property. Is this really intentional?

Revision history for this message
Alberto Aldegheri (albyrock87) wrote :

Haha!

Great! No, that was not intentional :P

It was intentional for some methods, but not for monitor expand :P

Revision history for this message
Michal Hruby (mhr3) wrote :

Which methods exactly? It seems to me that Lucido should be derived directly from AwnBackground, not Flat...

Revision history for this message
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..

Revision history for this message
Michal Hruby (mhr3) wrote :

Yep :)

review: Needs Fixing
Revision history for this message
Alberto Aldegheri (albyrock87) wrote :

review: Needs Fixing?

In what? I don't understand, do you want that i change the parent to AwnBackground?

Revision history for this message
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.

Revision history for this message
Alberto Aldegheri (albyrock87) wrote :

I understand that my english is not so good :D

I'll do the job soon then I resubmit :)

lp:~albyrock87/awn/awn-lucido updated
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

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'awn-settings/awn-settings.ui'
--- awn-settings/awn-settings.ui 2010-03-08 12:50:07 +0000
+++ awn-settings/awn-settings.ui 2010-05-31 11:01:08 +0000
@@ -908,6 +908,22 @@
908 </packing>908 </packing>
909 </child>909 </child>
910 <child>910 <child>
911 <object class="GtkSpinButton" id="theme_stripe_width">
912 <property name="visible">True</property>
913 <property name="can_focus">True</property>
914 <property name="invisible_char">&#x25CF;</property>
915 <property name="adjustment">adj_stripe_width</property>
916 <property name="digits">2</property>
917 </object>
918 <packing>
919 <property name="left_attach">5</property>
920 <property name="right_attach">6</property>
921 <property name="top_attach">8</property>
922 <property name="bottom_attach">9</property>
923 <property name="x_options"></property>
924 </packing>
925 </child>
926 <child>
911 <object class="GtkSpinButton" id="theme_angle">927 <object class="GtkSpinButton" id="theme_angle">
912 <property name="visible">True</property>928 <property name="visible">True</property>
913 <property name="can_focus">True</property>929 <property name="can_focus">True</property>
@@ -964,6 +980,20 @@
964 </packing>980 </packing>
965 </child>981 </child>
966 <child>982 <child>
983 <object class="GtkLabel" id="label_stripe">
984 <property name="visible">True</property>
985 <property name="xalign">0</property>
986 <property name="xpad">0</property>
987 <property name="label" translatable="yes">Stripe Width</property>
988 </object>
989 <packing>
990 <property name="left_attach">3</property>
991 <property name="right_attach">5</property>
992 <property name="top_attach">8</property>
993 <property name="bottom_attach">9</property>
994 </packing>
995 </child>
996 <child>
967 <object class="GtkLabel" id="label49">997 <object class="GtkLabel" id="label49">
968 <property name="visible">True</property>998 <property name="visible">True</property>
969 <property name="xalign">0</property>999 <property name="xalign">0</property>
@@ -3406,6 +3436,10 @@
3406 <property name="upper">1</property>3436 <property name="upper">1</property>
3407 <property name="step_increment">0.01</property>3437 <property name="step_increment">0.01</property>
3408 </object>3438 </object>
3439 <object class="GtkAdjustment" id="adj_stripe_width">
3440 <property name="upper">1</property>
3441 <property name="step_increment">0.01</property>
3442 </object>
3409 <object class="GtkAdjustment" id="adj_radius">3443 <object class="GtkAdjustment" id="adj_radius">
3410 <property name="upper">100</property>3444 <property name="upper">100</property>
3411 <property name="step_increment">1</property>3445 <property name="step_increment">1</property>
34123446
=== modified file 'awn-settings/awnDefs.py.in'
--- awn-settings/awnDefs.py.in 2010-04-29 14:58:51 +0000
+++ awn-settings/awnDefs.py.in 2010-05-31 11:01:08 +0000
@@ -86,6 +86,7 @@
86PANEL_ANGLE = "panel_angle" #float86PANEL_ANGLE = "panel_angle" #float
87CURVINESS = "curviness" #float87CURVINESS = "curviness" #float
88CURVES_SYMMETRY = "curves_symmetry" #float88CURVES_SYMMETRY = "curves_symmetry" #float
89STRIPE_WIDTH = "stripe_width" #float
89TOOLTIP_FONT_NAME = "tooltip_font_name" #string90TOOLTIP_FONT_NAME = "tooltip_font_name" #string
90TOOLTIP_FONT_COLOR = "tooltip_font_color" #string91TOOLTIP_FONT_COLOR = "tooltip_font_color" #string
91TOOLTIP_BG_COLOR = "tooltip_bg_color" #string92TOOLTIP_BG_COLOR = "tooltip_bg_color" #string
9293
=== modified file 'awn-settings/awnSettings.py.in'
--- awn-settings/awnSettings.py.in 2010-05-28 08:09:17 +0000
+++ awn-settings/awnSettings.py.in 2010-05-31 11:01:08 +0000
@@ -141,7 +141,8 @@
141 #setup style mode141 #setup style mode
142 dropdown = self.wTree.get_object("stylecombo")142 dropdown = self.wTree.get_object("stylecombo")
143 self.create_dropdown(dropdown, [_("None"), _("Flat"), _("3d"),143 self.create_dropdown(dropdown, [_("None"), _("Flat"), _("3d"),
144 _("Curved"), _("Edgy"), _("Floaty")])144 _("Curved"), _("Edgy"), _("Floaty"),
145 _("Lucido")])
145146
146 #setup behaviour combo147 #setup behaviour combo
147 dropdown = self.wTree.get_object("behaviorcombo")148 dropdown = self.wTree.get_object("behaviorcombo")
@@ -578,6 +579,7 @@
578 579
579 curviness = gobject.property(type=int, default=10)580 curviness = gobject.property(type=int, default=10)
580 curves_symmetry = gobject.property(type=float, default=0)581 curves_symmetry = gobject.property(type=float, default=0)
582 stripe_width = gobject.property(type=float, default=0)
581 angle = gobject.property(type=int, default=45)583 angle = gobject.property(type=int, default=45)
582 radius = gobject.property(type=int, default=10)584 radius = gobject.property(type=int, default=10)
583 gtk_theme_mode = gobject.property(type=bool, default=False)585 gtk_theme_mode = gobject.property(type=bool, default=False)
@@ -727,6 +729,7 @@
727 (defs.THEME, defs.PANEL_ANGLE, 'float', sizes),729 (defs.THEME, defs.PANEL_ANGLE, 'float', sizes),
728 (defs.THEME, defs.CURVINESS, 'float', sizes),730 (defs.THEME, defs.CURVINESS, 'float', sizes),
729 (defs.THEME, defs.CURVES_SYMMETRY, 'float', sizes),731 (defs.THEME, defs.CURVES_SYMMETRY, 'float', sizes),
732 (defs.THEME, defs.STRIPE_WIDTH, 'float', sizes),
730 (defs.THEME, defs.TOOLTIP_FONT_NAME, 'str', icon),733 (defs.THEME, defs.TOOLTIP_FONT_NAME, 'str', icon),
731 (defs.THEME, defs.TOOLTIP_FONT_COLOR, 'str', icon),734 (defs.THEME, defs.TOOLTIP_FONT_COLOR, 'str', icon),
732 (defs.THEME, defs.TOOLTIP_BG_COLOR, 'str', icon),735 (defs.THEME, defs.TOOLTIP_BG_COLOR, 'str', icon),
@@ -823,6 +826,8 @@
823 "curviness", "theme_curviness"),826 "curviness", "theme_curviness"),
824 (self.client, defs.THEME, defs.CURVES_SYMMETRY,827 (self.client, defs.THEME, defs.CURVES_SYMMETRY,
825 "curves-symmetry", "theme_symmetry"),828 "curves-symmetry", "theme_symmetry"),
829 (self.client, defs.THEME, defs.STRIPE_WIDTH,
830 "stripe-width", "theme_stripe_width"),
826 (self.client, defs.THEME, defs.PANEL_ANGLE,831 (self.client, defs.THEME, defs.PANEL_ANGLE,
827 "angle", "theme_angle"),832 "angle", "theme_angle"),
828 (self.client, defs.THEME, defs.CORNER_RADIUS,833 (self.client, defs.THEME, defs.CORNER_RADIUS,
829834
=== modified file 'data/avant-window-navigator.schema-ini.in.in'
--- data/avant-window-navigator.schema-ini.in.in 2010-03-09 20:20:25 +0000
+++ data/avant-window-navigator.schema-ini.in.in 2010-05-31 11:01:08 +0000
@@ -159,7 +159,7 @@
159[panel/style]159[panel/style]
160type = integer160type = integer
161default = 1161default = 1
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)
163163
164[panels/panel_list]164[panels/panel_list]
165type = list-integer165type = list-integer
@@ -227,6 +227,12 @@
227_description=The curviness of the panel in Curves mode.227_description=The curviness of the panel in Curves mode.
228per_instance = false228per_instance = false
229229
230[theme/stripe_width]
231type = float
232default = 0.0
233_description=The width of the stripe in Lucido mode.
234per_instance = false
235
230[theme/dialog_gtk_mode]236[theme/dialog_gtk_mode]
231type = boolean237type = boolean
232default = true238default = true
233239
=== modified file 'src/Makefile.am'
--- src/Makefile.am 2010-03-24 23:24:19 +0000
+++ src/Makefile.am 2010-05-31 11:01:08 +0000
@@ -41,6 +41,8 @@
41 awn-background-edgy.h \41 awn-background-edgy.h \
42 awn-background-floaty.c \42 awn-background-floaty.c \
43 awn-background-floaty.h \43 awn-background-floaty.h \
44 awn-background-lucido.c \
45 awn-background-lucido.h \
44 awn-defines.h \46 awn-defines.h \
45 $(builddir)/awn-marshal.c \47 $(builddir)/awn-marshal.c \
46 $(builddir)/awn-marshal.h \48 $(builddir)/awn-marshal.h \
4749
=== modified file 'src/awn-background-flat.c'
--- src/awn-background-flat.c 2010-03-07 18:38:07 +0000
+++ src/awn-background-flat.c 2010-05-31 11:01:08 +0000
@@ -324,20 +324,24 @@
324 switch (position)324 switch (position)
325 {325 {
326 case GTK_POS_RIGHT:326 case GTK_POS_RIGHT:
327 cairo_translate (cr, x, y+height);327 cairo_translate (cr, 0., y + height);
328 cairo_scale (cr, 1., -1.);
329 cairo_translate (cr, x, height);
328 cairo_rotate (cr, M_PI * 1.5);330 cairo_rotate (cr, M_PI * 1.5);
329 temp = width;331 temp = width;
330 width = height; height = temp;332 width = height;
333 height = temp;
331 break;334 break;
332 case GTK_POS_LEFT:335 case GTK_POS_LEFT:
333 cairo_translate (cr, x+width, y);336 cairo_translate (cr, x + width, y);
334 cairo_rotate (cr, M_PI * 0.5);337 cairo_rotate (cr, M_PI * 0.5);
335 temp = width;338 temp = width;
336 width = height; height = temp;339 width = height;
340 height = temp;
337 break;341 break;
338 case GTK_POS_TOP:342 case GTK_POS_TOP:
339 cairo_translate (cr, x+width, y+height);343 cairo_translate (cr, x, y + height);
340 cairo_rotate (cr, M_PI);344 cairo_scale (cr, 1., -1.);
341 break;345 break;
342 default:346 default:
343 cairo_translate (cr, x, y);347 cairo_translate (cr, x, y);
344348
=== added file 'src/awn-background-lucido.c'
--- src/awn-background-lucido.c 1970-01-01 00:00:00 +0000
+++ src/awn-background-lucido.c 2010-05-31 11:01:08 +0000
@@ -0,0 +1,839 @@
1/*
2 * Copyright (C) 2009 Michal Hruby <michal.mhr@gmail.com>
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
17 *
18 * Author : Alberto Aldegheri <albyrock87+dev@gmail.com>
19 * Thanks to: Matt <sharkbaitbobby@gmail.com>
20 * for the code section to analyze expanders
21 *
22 */
23
24#include "config.h"
25
26#include <gdk/gdk.h>
27#include <libawn/awn-cairo-utils.h>
28#include <math.h>
29
30#include "awn-applet-manager.h"
31#include "awn-background-lucido.h"
32#include "awn-separator.h"
33
34G_DEFINE_TYPE (AwnBackgroundLucido, awn_background_lucido, AWN_TYPE_BACKGROUND)
35
36#define AWN_BACKGROUND_LUCIDO_GET_PRIVATE(obj) ( \
37 G_TYPE_INSTANCE_GET_PRIVATE (obj, AWN_TYPE_BACKGROUND_LUCIDO, \
38 AwnBackgroundLucidoPrivate))
39
40struct _AwnBackgroundLucidoPrivate
41{
42 gint expw;
43 gint expn;
44};
45
46static void awn_background_lucido_draw (AwnBackground *bg,
47 cairo_t *cr,
48 GtkPositionType position,
49 GdkRectangle *area);
50
51static void awn_background_lucido_get_shape_mask (AwnBackground *bg,
52 cairo_t *cr,
53 GtkPositionType position,
54 GdkRectangle *area);
55
56static void awn_background_lucido_padding_request (AwnBackground *bg,
57 GtkPositionType position,
58 guint *padding_top,
59 guint *padding_bottom,
60 guint *padding_left,
61 guint *padding_right);
62
63static gboolean
64awn_background_lucido_get_needs_redraw (AwnBackground *bg,
65 GtkPositionType position,
66 GdkRectangle *area);
67
68static void
69awn_background_lucido_curviness_changed (AwnBackground *bg)
70{
71 gboolean expand = FALSE;
72 g_object_get (bg->panel, "expand", &expand, NULL);
73
74 if (!expand)
75 awn_background_emit_padding_changed (bg);
76}
77
78static void
79awn_background_lucido_expand_changed (AwnBackground *bg)
80{
81 awn_background_emit_padding_changed (bg);
82}
83
84static void
85awn_background_lucido_align_changed (AwnBackground *bg)
86{
87 awn_background_emit_padding_changed (bg);
88}
89
90static void
91awn_background_lucido_constructed (GObject *object)
92{
93 G_OBJECT_CLASS (awn_background_lucido_parent_class)->constructed (object);
94
95 AwnBackground *bg = AWN_BACKGROUND (object);
96 gpointer monitor = NULL;
97
98 g_signal_connect_swapped (bg, "notify::curviness",
99 G_CALLBACK (awn_background_lucido_curviness_changed),
100 object);
101
102 g_return_if_fail (bg->panel);
103
104 g_signal_connect_swapped (bg->panel, "notify::expand",
105 G_CALLBACK (awn_background_lucido_expand_changed),
106 object);
107
108 g_object_get (bg->panel, "monitor", &monitor, NULL);
109
110 g_return_if_fail (monitor);
111
112 g_signal_connect_swapped (monitor, "notify::monitor-align",
113 G_CALLBACK (awn_background_lucido_align_changed),
114 object);
115}
116
117static void
118awn_background_lucido_dispose (GObject *object)
119{
120 gpointer monitor = NULL;
121 if (AWN_BACKGROUND (object)->panel)
122 g_object_get (AWN_BACKGROUND (object)->panel, "monitor", &monitor, NULL);
123
124 if (monitor)
125 g_signal_handlers_disconnect_by_func (monitor,
126 G_CALLBACK (awn_background_lucido_align_changed), object);
127
128 g_signal_handlers_disconnect_by_func (AWN_BACKGROUND (object)->panel,
129 G_CALLBACK (awn_background_lucido_expand_changed), object);
130
131 g_signal_handlers_disconnect_by_func (AWN_BACKGROUND (object),
132 G_CALLBACK (awn_background_lucido_curviness_changed), object);
133
134 G_OBJECT_CLASS (awn_background_lucido_parent_class)->dispose (object);
135}
136
137static void
138awn_background_lucido_class_init (AwnBackgroundLucidoClass *klass)
139{
140 AwnBackgroundClass *bg_class = AWN_BACKGROUND_CLASS (klass);
141
142 GObjectClass *obj_class = G_OBJECT_CLASS (klass);
143 obj_class->constructed = awn_background_lucido_constructed;
144 obj_class->dispose = awn_background_lucido_dispose;
145
146 bg_class->draw = awn_background_lucido_draw;
147 bg_class->padding_request = awn_background_lucido_padding_request;
148 bg_class->get_shape_mask = awn_background_lucido_get_shape_mask;
149 bg_class->get_input_shape_mask = awn_background_lucido_get_shape_mask;
150 bg_class->get_needs_redraw = awn_background_lucido_get_needs_redraw;
151
152 g_type_class_add_private (obj_class, sizeof (AwnBackgroundLucidoPrivate));
153}
154
155static void
156awn_background_lucido_init (AwnBackgroundLucido *bg)
157{
158
159}
160
161AwnBackground *
162awn_background_lucido_new (DesktopAgnosticConfigClient *client,
163 AwnPanel *panel)
164{
165 AwnBackground *bg;
166
167 bg = g_object_new (AWN_TYPE_BACKGROUND_LUCIDO,
168 "client", client,
169 "panel", panel,
170 NULL);
171 return bg;
172}
173
174/*
175 * Drawing functions
176 */
177static void
178_line_from_to ( cairo_t *cr,
179 gfloat *xs,
180 gfloat *ys,
181 gfloat xf,
182 gfloat yf)
183{
184 if ( *xs==xf || *ys==yf ) /* Vertical/Horizontal line */
185 cairo_line_to (cr, xf, yf);
186 else
187 { /* Oblique */
188 gfloat xm = ( *xs + xf ) / 2.0;
189 cairo_curve_to (cr, xm, *ys, xm, yf, xf, yf);
190 }
191 *xs = xf;
192 *ys = yf;
193}
194
195static GList*
196_get_applet_widgets (AwnBackground* bg)
197{
198 AwnAppletManager *manager = NULL;
199 g_object_get (bg->panel, "applet-manager", &manager, NULL);
200
201 return gtk_container_get_children (GTK_CONTAINER (manager));
202}
203
204/**
205 * _create_path_lucido:
206 * @bg: The background pointer
207 * @position: The position of the bar
208 * @cairo_t: The cairo context
209 * @y: The top left coordinate of the "bar rect" - default = 0
210 * @w: The width of the bar
211 * @h: The height of the bar
212 * @stripe: The width of the stripe (0.0-1.0). Zero for auto-stripe.
213 * @d: The width of each curve in the path
214 * @dc: The width of the external curves in non-expanded&auto mode
215 * @symmetry: The symmetry of the stripe when @stripe > 0
216 * @internal: If Zero, creates the path for the stripe
217 * @expanded: If Zero, the bar is not expanded
218 *
219 * This function creates paths on which the bar will be drawn.
220 * In atuo-stripe, it searchs for expanders applet, each expander
221 * equals to one curve.
222 * If the first widget is an expander, start from bottom-left,
223 * otherwise start from top-left
224 */
225
226static void
227_create_path_lucido ( AwnBackground* bg,
228 GtkPositionType position,
229 cairo_t* cr,
230 gfloat x,
231 gfloat y,
232 gfloat w,
233 gfloat h,
234 gfloat stripe,
235 gfloat d,
236 gfloat dc,
237 gfloat symmetry,
238 gboolean internal,
239 gboolean expanded,
240 gfloat align)
241{
242 cairo_new_path (cr);
243
244 gfloat lx = x;
245 gfloat ly = y;
246 gfloat y3 = y + h;
247 gfloat y2 = y3 - 5;
248
249 if (stripe > 0)
250 {
251 if (expanded)
252 {
253 stripe = (w * stripe); /* now stripe = non-stripe */
254 if (internal)
255 {
256 /* Manual-Stripe & Expanded & Internal */
257 lx = stripe * symmetry;
258 cairo_move_to (cr, lx, ly);
259 _line_from_to (cr, &lx, &ly, lx+d, y2);
260 _line_from_to (cr, &lx, &ly, w-stripe * (1. - symmetry) - d, y2);
261 _line_from_to (cr, &lx, &ly, w-stripe * (1. - symmetry), y);
262 cairo_close_path (cr);
263 }
264 else
265 {
266 /* Manual-Stripe & Expanded & External */
267 ly = y3;
268 cairo_move_to (cr, lx, ly);
269 _line_from_to (cr, &lx, &ly, lx, y);
270 _line_from_to (cr, &lx, &ly, stripe * symmetry, y);
271 _line_from_to (cr, &lx, &ly, stripe * symmetry + d, y2);
272 _line_from_to (cr, &lx, &ly, w - stripe * (1. - symmetry) - d, y2);
273 _line_from_to (cr, &lx, &ly, w - stripe * (1. - symmetry), y);
274 _line_from_to (cr, &lx, &ly, w, y);
275 _line_from_to (cr, &lx, &ly, w, y3);
276 cairo_close_path (cr);
277 }
278 }
279 else
280 {
281 if (stripe == 1.)
282 {
283 _create_path_lucido (bg, position, cr, x, y, w, h, 0.,
284 d, dc, 0., internal, expanded, align);
285 return;
286 }
287 stripe = ((w - dc * 2) * stripe); /* now stripe = non-stripe */
288 if (internal)
289 {
290 /* Manual-Stripe & Not-Expanded & Internal */
291 lx = stripe * symmetry + dc;
292 cairo_move_to (cr, lx, ly);
293 _line_from_to (cr, &lx, &ly, lx + d, y2);
294 _line_from_to (cr, &lx, &ly, w - stripe * (1.- symmetry) - dc - d, y2);
295 _line_from_to (cr, &lx, &ly, w - stripe * (1.- symmetry) - dc, y);
296 cairo_close_path (cr);
297 }
298 else
299 {
300 /* Manual-Stripe & Not-Expanded & External */
301 ly = y3;
302 cairo_move_to (cr, lx, ly);
303 _line_from_to (cr, &lx, &ly, lx+dc, y);
304 _line_from_to (cr, &lx, &ly, stripe * symmetry + dc, y);
305 _line_from_to (cr, &lx, &ly, stripe * symmetry + d + dc, y2);
306 _line_from_to (cr, &lx, &ly, w-stripe * (1. - symmetry) - dc - d, y2);
307 _line_from_to (cr, &lx, &ly, w-stripe * (1. - symmetry) - dc, y);
308 _line_from_to (cr, &lx, &ly, w-dc, y);
309 _line_from_to (cr, &lx, &ly, w, y3);
310 cairo_close_path(cr);
311 }
312 }
313 }
314 else
315 {
316 gint exps_found = 0;
317 gfloat curx = 0.0;
318
319 if (expanded)
320 {
321 if (internal)
322 {
323 /* Auto-Stripe & Expanded & Internal */
324 GList *widgets = _get_applet_widgets (bg);
325 GList *i = widgets;
326 GtkWidget *widget = NULL;
327
328 /* analyze first widget*/
329 if (i)
330 {
331 widget = GTK_WIDGET (i->data);
332
333 /* if first widget is an expander or align==0 || 1*/
334 if ( (widget && GTK_IS_IMAGE (widget) && !AWN_IS_SEPARATOR (widget) ) ||
335 ( align == 0. || align == 1. ) )
336 {
337 /* start from bottom */
338 lx = curx;
339 ly = y;
340 cairo_move_to (cr, lx, ly);
341 _line_from_to (cr, &lx, &ly, lx, y2);
342 ++exps_found;
343 if (align != 0. && align != 1.)
344 i = i->next;
345 }
346 }
347 /* else start from top */
348
349 for (; i; i = i->next)
350 {
351 widget = GTK_WIDGET (i->data);
352
353 if (!GTK_IS_IMAGE (widget) || AWN_IS_SEPARATOR (widget))
354 {
355 /* if not expander continue */
356 continue;
357 }
358 /* expander found */
359 switch (position)
360 {
361 case GTK_POS_BOTTOM:
362 case GTK_POS_TOP:
363 curx = widget->allocation.x;
364 if (exps_found % 2 != 0)
365 curx += widget->allocation.width;
366 break;
367 default:
368 curx = widget->allocation.y;
369 if ( exps_found % 2 != 0)
370 curx += widget->allocation.height;
371 break;
372 }
373 if (curx < 0)
374 continue;
375
376 if (exps_found == 0)
377 {
378 /* this is the first expander */
379 lx = curx;
380 cairo_move_to (cr, lx, ly);
381 _line_from_to (cr, &lx, &ly, curx + d, y2);
382 }
383 else
384 {
385 if (exps_found % 2 != 0)
386 {
387 /* odd expander - curve at the end of expander */
388 _line_from_to (cr, &lx, &ly, curx - d, y2);
389 if (i->next == NULL)
390 _line_from_to (cr, &lx, &ly, curx, y2);
391 _line_from_to (cr, &lx, &ly, curx, y);
392 }
393 else
394 {
395 /* even expander - curve at the start of expander */
396 _line_from_to (cr, &lx, &ly, curx, y);
397 _line_from_to (cr, &lx, &ly, curx + d, y2);
398 /* else the last widget is an expander */
399 }
400 }
401
402 ++exps_found;
403 }
404 g_list_free (widgets);
405
406 _line_from_to (cr, &lx, &ly, w, ly);
407
408 if (exps_found % 2 != 0)
409 _line_from_to (cr, &lx, &ly, lx, y);
410
411 cairo_close_path (cr);
412 }
413 else
414 {
415 /* Auto-Stripe & Expanded & External */
416
417 GList *widgets = _get_applet_widgets (bg);
418 GList *i = widgets;
419 GtkWidget *widget = NULL;
420
421 /* analyze first widget*/
422 if (i)
423 {
424 widget = GTK_WIDGET (i->data);
425
426 ly = y3;
427 cairo_move_to (cr, lx, ly);
428
429 /* if first widget is an expander or align==0 || 1*/
430 if ( (widget && GTK_IS_IMAGE (widget) && !AWN_IS_SEPARATOR (widget) ) ||
431 ( align == 0. || align == 1. ) )
432 {
433 /* start from bottom */
434 _line_from_to (cr, &lx, &ly, lx, y2);
435 ++exps_found;
436 if (align != 0. && align != 1.)
437 i = i->next;
438 }
439 else
440 {
441 /* start from top */
442 _line_from_to (cr, &lx, &ly, lx, y);
443 }
444 }
445
446 for (; i; i = i->next)
447 {
448 widget = GTK_WIDGET (i->data);
449
450 if (!GTK_IS_IMAGE (widget) || AWN_IS_SEPARATOR (widget))
451 {
452 /* if not expander continue */
453 continue;
454 }
455 /* expander found */
456 switch (position)
457 {
458 case GTK_POS_BOTTOM:
459 case GTK_POS_TOP:
460 curx = widget->allocation.x;
461 if (exps_found % 2 != 0)
462 curx += widget->allocation.width;
463 break;
464 default:
465 curx = widget->allocation.y;
466 if (exps_found % 2 != 0)
467 curx += widget->allocation.height;
468 break;
469 }
470 if (curx < 0)
471 continue;
472
473 if (exps_found % 2 != 0)
474 {
475 _line_from_to (cr, &lx, &ly, curx - d, y2);
476 if (i->next != NULL)
477 _line_from_to (cr, &lx, &ly, curx, y);
478 }
479 else
480 {
481 _line_from_to (cr, &lx, &ly, curx, y);
482 _line_from_to (cr, &lx, &ly, curx + d, y2);
483 }
484 ++exps_found;
485 }
486 g_list_free (widgets);
487
488 _line_from_to (cr, &lx, &ly, w, ly);
489 _line_from_to (cr, &lx, &ly, lx, y3);
490
491 cairo_close_path (cr);
492 }
493 }
494 else
495 {
496 if (internal)
497 {
498 /* Auto-Stripe & Not-Expanded & Internal */
499 /* no-path */
500 }
501 else
502 {
503 /* Auto-Stripe & Not-Expanded & External */
504 ly = y3;
505 cairo_move_to (cr, lx, ly);
506
507 if (align == 0.)
508 _line_from_to (cr, &lx, &ly, lx , y);
509 else
510 _line_from_to (cr, &lx, &ly, lx + dc, y);
511
512 if (align == 1.)
513 _line_from_to (cr, &lx, &ly, w, y);
514 else
515 _line_from_to (cr, &lx, &ly, w - dc, y);
516
517 _line_from_to (cr, &lx, &ly, w, y3);
518 cairo_close_path (cr);
519 }
520 }
521 }
522}
523
524static void
525draw_top_bottom_background (AwnBackground* bg,
526 GtkPositionType position,
527 cairo_t* cr,
528 gint width,
529 gint height)
530{
531 cairo_pattern_t *pat = NULL;
532 cairo_pattern_t *pat_hi = NULL;
533
534 /* Make sure the bar gets drawn on the 0.5 pixels (for sharp edges) */
535 cairo_translate (cr, 0.5, 0.5);
536
537 /* Basic set-up */
538 cairo_set_line_width (cr, 1.0);
539 cairo_set_operator (cr, CAIRO_OPERATOR_OVER);
540
541 if(gtk_widget_is_composited (GTK_WIDGET (bg->panel) ) == FALSE)
542 {
543 goto paint_lines;
544 }
545
546 gboolean expand = FALSE;
547 g_object_get (bg->panel, "expand", &expand, NULL);
548
549 gfloat align = awn_background_get_panel_alignment (AWN_BACKGROUND (bg));
550
551 /* create internal path */
552 _create_path_lucido (bg, position, cr, -1.0, 0., width, height,
553 bg->stripe_width, bg->curviness,
554 bg->curviness, bg->curves_symmetry,
555 1, expand, align);
556
557 /* Draw internal pattern if needed */
558 if (bg->enable_pattern && bg->pattern)
559 {
560 /* Prepare pattern */
561 pat = cairo_pattern_create_for_surface (bg->pattern);
562 cairo_pattern_set_extend (pat, CAIRO_EXTEND_REPEAT);
563 /* Draw */
564 cairo_save (cr);
565 cairo_clip_preserve (cr);
566 cairo_set_source (cr, pat);
567 cairo_paint (cr);
568 cairo_restore (cr);
569 cairo_pattern_destroy (pat);
570 }
571
572 /* Prepare the internal background */
573 pat = cairo_pattern_create_linear (0, 0, 0, height);
574 awn_cairo_pattern_add_color_stop_color (pat, 0.0, bg->border_color);
575 awn_cairo_pattern_add_color_stop_color (pat, 1.0, bg->hilight_color);
576
577 /* Draw the internal background gradient */
578 cairo_save (cr);
579 cairo_clip_preserve (cr);
580 cairo_set_source (cr, pat);
581 cairo_paint (cr);
582 cairo_restore (cr);
583 cairo_pattern_destroy (pat);
584
585 /* Prepare external background gradient*/
586 pat = cairo_pattern_create_linear (0, 0, 0, height);
587 awn_cairo_pattern_add_color_stop_color (pat, 0.0, bg->g_step_1);
588 awn_cairo_pattern_add_color_stop_color (pat, 1.0, bg->g_step_2);
589
590 /* create external path */
591 _create_path_lucido (bg, position, cr, -1.0, 0., width, height,
592 bg->stripe_width, bg->curviness,
593 bg->curviness, bg->curves_symmetry,
594 0, expand, align);
595
596 /* Draw the external background */
597 cairo_save (cr);
598 cairo_clip_preserve (cr);
599 cairo_set_source (cr, pat);
600 cairo_paint (cr);
601 cairo_restore (cr);
602 cairo_pattern_destroy (pat);
603
604 /* Draw the hi-light */
605 pat_hi = cairo_pattern_create_linear (0, 0, 0, (height / 3.0));
606 awn_cairo_pattern_add_color_stop_color (pat_hi, 0.0, bg->g_histep_1);
607 awn_cairo_pattern_add_color_stop_color (pat_hi, 1.0, bg->g_histep_2);
608
609 if (expand)
610 {
611 cairo_new_path (cr);
612 cairo_rectangle (cr, 0, 0, width, (height / 3.0));
613 }
614
615 cairo_set_source (cr, pat_hi);
616 cairo_fill (cr);
617 cairo_pattern_destroy (pat_hi);
618
619 return;
620 /* if not composited */
621paint_lines:
622
623 /* Internal border */
624 awn_cairo_set_source_color (cr, bg->hilight_color);
625 cairo_rectangle (cr, 1, 1, width - 3, height + 3);
626 cairo_stroke (cr);
627
628 /* External border */
629 awn_cairo_set_source_color (cr, bg->border_color);
630 cairo_rectangle (cr, 1, 1, width - 1, height + 3);
631 cairo_stroke (cr);
632}
633
634
635static
636void awn_background_lucido_padding_request (AwnBackground *bg,
637 GtkPositionType position,
638 guint *padding_top,
639 guint *padding_bottom,
640 guint *padding_left,
641 guint *padding_right)
642{
643 #define TOP_PADDING 2
644 gboolean expand = FALSE;
645 g_object_get (bg->panel, "expand", &expand, NULL);
646 gint side_padding = expand ? 0 : bg->curviness;
647 gint zero_padding = 0;
648
649 gfloat align = awn_background_get_panel_alignment (bg);
650 if (awn_background_do_rtl_swap (bg))
651 {
652 if (align <= 0.0 || align >= 1.0)
653 {
654 zero_padding = side_padding;
655 side_padding = 0;
656 }
657 }
658
659 switch (position)
660 {
661 case GTK_POS_TOP:
662 *padding_top = 0;
663 *padding_bottom = TOP_PADDING;
664 *padding_left = align == 0.0 ? zero_padding : side_padding;
665 *padding_right = align == 1.0 ? zero_padding : side_padding;
666 break;
667 case GTK_POS_BOTTOM:
668 *padding_top = TOP_PADDING;
669 *padding_bottom = 0;
670 *padding_left = align == 0.0 ? zero_padding : side_padding;
671 *padding_right = align == 1.0 ? zero_padding : side_padding;
672 break;
673 case GTK_POS_LEFT:
674 *padding_top = align == 0.0 ? zero_padding : side_padding;
675 *padding_bottom = align == 1.0 ? zero_padding : side_padding;
676 *padding_left = 0;
677 *padding_right = TOP_PADDING;
678 break;
679 case GTK_POS_RIGHT:
680 *padding_top = align == 0.0 ? zero_padding : side_padding;
681 *padding_bottom = align == 1.0 ? zero_padding : side_padding;
682 *padding_left = TOP_PADDING;
683 *padding_right = 0;
684 break;
685 default:
686 break;
687 }
688}
689
690
691
692static void
693awn_background_lucido_draw (AwnBackground *bg,
694 cairo_t *cr,
695 GtkPositionType position,
696 GdkRectangle *area)
697{
698 gint temp;
699 gint x = area->x, y = area->y;
700 gint width = area->width, height = area->height;
701 cairo_save (cr);
702
703 switch (position)
704 {
705 case GTK_POS_RIGHT:
706 cairo_translate (cr, 0., y + height);
707 cairo_scale (cr, 1., -1.);
708 cairo_translate (cr, x, height);
709 cairo_rotate (cr, M_PI * 1.5);
710 temp = width;
711 width = height;
712 height = temp;
713 break;
714 case GTK_POS_LEFT:
715 cairo_translate (cr, x + width, y);
716 cairo_rotate (cr, M_PI * 0.5);
717 temp = width;
718 width = height;
719 height = temp;
720 break;
721 case GTK_POS_TOP:
722 cairo_translate (cr, x, y + height);
723 cairo_scale (cr, 1., -1.);
724 break;
725 default:
726 cairo_translate (cr, x, y);
727 break;
728 }
729
730 draw_top_bottom_background (bg, position, cr, width, height);
731
732 cairo_restore (cr);
733}
734
735static gboolean
736awn_background_lucido_get_needs_redraw (AwnBackground *bg,
737 GtkPositionType position,
738 GdkRectangle *area)
739{
740 /* Check default needs redraw */
741 gboolean nr = AWN_BACKGROUND_CLASS (awn_background_lucido_parent_class)->
742 get_needs_redraw (bg, position, area);
743 if (nr)
744 return TRUE;
745
746 /* Check expanders positions & sizes changed */
747 GList *widgets = _get_applet_widgets (bg);
748 GList *i = widgets;
749 GtkWidget *widget = NULL;
750 gint wcheck = 0;
751 gint ncheck = 0;
752
753 for (; i; i = i->next)
754 {
755 widget = GTK_WIDGET (i->data);
756
757 if (!GTK_IS_IMAGE (widget) || AWN_IS_SEPARATOR (widget))
758 {
759 /* if not expander continue */
760 continue;
761 }
762 switch (position)
763 {
764 case GTK_POS_BOTTOM:
765 case GTK_POS_TOP:
766 wcheck += (widget->allocation.x * 3) / 2 + widget->allocation.width;
767 break;
768 default:
769 wcheck += (widget->allocation.y * 3 ) / 2 + widget->allocation.height;
770 break;
771 }
772 ++ncheck;
773 }
774 g_list_free (widgets);
775
776 AwnBackgroundLucido *lbg = NULL;
777 lbg = AWN_BACKGROUND_LUCIDO (bg);
778 AwnBackgroundLucidoPrivate *priv;
779 priv = AWN_BACKGROUND_LUCIDO_GET_PRIVATE (lbg);
780 if (priv->expn != ncheck)
781 {
782 priv->expn = ncheck;
783 /* used to refresh bar */
784 awn_background_emit_padding_changed (bg);
785 }
786 if (priv->expw != wcheck)
787 {
788 priv->expw = wcheck;
789 return TRUE;
790 }
791 return FALSE;
792}
793
794static void
795awn_background_lucido_get_shape_mask (AwnBackground *bg,
796 cairo_t *cr,
797 GtkPositionType position,
798 GdkRectangle *area)
799{
800 gint temp;
801 gint x = area->x, y = area->y;
802 gint width = area->width, height = area->height;
803 gfloat align = 0.5;
804 gboolean expand = FALSE;
805
806 cairo_save (cr);
807
808 align = awn_background_get_panel_alignment (bg);
809 g_object_get (bg->panel, "expand", &expand, NULL);
810
811 switch (position)
812 {
813 case GTK_POS_RIGHT:
814 cairo_translate (cr, x, y+height);
815 cairo_rotate (cr, M_PI * 1.5);
816 temp = width;
817 width = height; height = temp;
818 break;
819 case GTK_POS_LEFT:
820 cairo_translate (cr, x+width, y);
821 cairo_rotate (cr, M_PI * 0.5);
822 temp = width;
823 width = height; height = temp;
824 break;
825 case GTK_POS_TOP:
826 cairo_translate (cr, x+width, y+height);
827 cairo_rotate (cr, M_PI);
828 break;
829 default:
830 cairo_translate (cr, x, y);
831 break;
832 }
833
834 cairo_rectangle (cr, 0, 0, width, height + 2);
835 cairo_fill (cr);
836
837 cairo_restore (cr);
838}
839/* vim: set et ts=2 sts=2 sw=2 : */
0840
=== added file 'src/awn-background-lucido.h'
--- src/awn-background-lucido.h 1970-01-01 00:00:00 +0000
+++ src/awn-background-lucido.h 2010-05-31 11:01:08 +0000
@@ -0,0 +1,71 @@
1/*
2 * Copyright (C) 2009 Michal Hruby <michal.mhr@gmail.com>
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
17 *
18 * Author : Alberto Aldegheri <albyrock87+dev@gmail.com>
19*/
20
21#ifndef _AWN_BACKGROUND_LUCIDO_H
22#define _AWN_BACKGROUND_LUCIDO_H
23
24#include <glib.h>
25#include <glib-object.h>
26#include <gtk/gtk.h>
27
28#include "awn-background.h"
29
30G_BEGIN_DECLS
31
32#define AWN_TYPE_BACKGROUND_LUCIDO (awn_background_lucido_get_type())
33
34#define AWN_BACKGROUND_LUCIDO(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), AWN_TYPE_BACKGROUND_LUCIDO, \
35 AwnBackgroundLucido))
36
37#define AWN_BACKGROUND_LUCIDO_CLASS(obj) (G_TYPE_CHECK_CLASS_CAST ((obj), AWN_BACKGROUND_LUCIDO, \
38 AwnBackgroundLucidoClass))
39
40#define AWN_IS_BACKGROUND_LUCIDO(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), AWN_TYPE_BACKGROUND_LUCIDO))
41
42#define AWN_IS_BACKGROUND_LUCIDO_CLASS(obj) (G_TYPE_CHECK_CLASS_TYPE ((obj), \
43 AWN_TYPE_BACKGROUND_LUCIDO))
44
45#define AWN_BACKGROUND_LUCIDO_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), \
46 AWN_TYPE_BACKGROUND_LUCIDO, AwnBackgroundLucidoClass))
47
48typedef struct _AwnBackgroundLucido AwnBackgroundLucido;
49typedef struct _AwnBackgroundLucidoClass AwnBackgroundLucidoClass;
50typedef struct _AwnBackgroundLucidoPrivate AwnBackgroundLucidoPrivate;
51
52struct _AwnBackgroundLucido
53{
54 AwnBackground parent;
55 AwnBackgroundLucidoPrivate *priv;
56};
57
58struct _AwnBackgroundLucidoClass
59{
60 AwnBackgroundClass parent_class;
61};
62
63GType awn_background_lucido_get_type (void) G_GNUC_CONST;
64
65AwnBackground * awn_background_lucido_new (DesktopAgnosticConfigClient *client,
66 AwnPanel *panel);
67
68G_END_DECLS
69
70#endif /* _AWN_BACKGROUND_LUCIDO_H */
71
072
=== modified file 'src/awn-background.c'
--- src/awn-background.c 2010-04-08 15:38:05 +0000
+++ src/awn-background.c 2010-05-31 11:01:08 +0000
@@ -58,7 +58,8 @@
58 PROP_CORNER_RADIUS,58 PROP_CORNER_RADIUS,
59 PROP_PANEL_ANGLE,59 PROP_PANEL_ANGLE,
60 PROP_CURVINESS,60 PROP_CURVINESS,
61 PROP_CURVES_SYMEMETRY61 PROP_CURVES_SYMEMETRY,
62 PROP_STRIPE_WIDTH
62};63};
6364
64enum 65enum
@@ -90,6 +91,10 @@
90 GtkPositionType position,91 GtkPositionType position,
91 GdkRectangle *area);92 GdkRectangle *area);
9293
94static gboolean awn_background_get_needs_redraw (AwnBackground *bg,
95 GtkPositionType position,
96 GdkRectangle *area);
97
93static AwnPathType awn_background_path_default (AwnBackground *bg,98static AwnPathType awn_background_path_default (AwnBackground *bg,
94 gfloat *offset_mod);99 gfloat *offset_mod);
95100
@@ -186,6 +191,11 @@
186 object, "curves-symmetry", TRUE,191 object, "curves-symmetry", TRUE,
187 DESKTOP_AGNOSTIC_CONFIG_BIND_METHOD_FALLBACK,192 DESKTOP_AGNOSTIC_CONFIG_BIND_METHOD_FALLBACK,
188 NULL);193 NULL);
194 desktop_agnostic_config_client_bind (bg->client,
195 AWN_GROUP_THEME, AWN_THEME_STRIPE_WIDTH,
196 object, "stripe-width", TRUE,
197 DESKTOP_AGNOSTIC_CONFIG_BIND_METHOD_FALLBACK,
198 NULL);
189}199}
190200
191static void201static void
@@ -342,12 +352,15 @@
342 case PROP_CURVES_SYMEMETRY:352 case PROP_CURVES_SYMEMETRY:
343 bg->curves_symmetry = g_value_get_float (value);353 bg->curves_symmetry = g_value_get_float (value);
344 break;354 break;
355 case PROP_STRIPE_WIDTH:
356 bg->stripe_width = g_value_get_float (value);
357 break;
345358
346 default:359 default:
347 G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);360 G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
348 return;361 return;
349 }362 }
350363 awn_background_invalidate (bg);
351 g_signal_emit (object, _bg_signals[CHANGED], 0);364 g_signal_emit (object, _bg_signals[CHANGED], 0);
352}365}
353366
@@ -380,6 +393,12 @@
380 if (bg->hilight_color) g_object_unref (bg->hilight_color);393 if (bg->hilight_color) g_object_unref (bg->hilight_color);
381 if (bg->sep_color) g_object_unref (bg->sep_color);394 if (bg->sep_color) g_object_unref (bg->sep_color);
382395
396 if (bg->helper_surface != NULL)
397 {
398 cairo_surface_finish (bg->helper_surface);
399 cairo_surface_destroy (bg->helper_surface);
400 }
401
383 G_OBJECT_CLASS (awn_background_parent_class)->finalize (object);402 G_OBJECT_CLASS (awn_background_parent_class)->finalize (object);
384}403}
385404
@@ -398,6 +417,7 @@
398 klass->get_input_shape_mask = awn_background_mask_none;417 klass->get_input_shape_mask = awn_background_mask_none;
399 klass->get_path_type = awn_background_path_default;418 klass->get_path_type = awn_background_path_default;
400 klass->get_strut_offsets = NULL;419 klass->get_strut_offsets = NULL;
420 klass->get_needs_redraw = awn_background_get_needs_redraw;
401421
402 /* Object properties */422 /* Object properties */
403 g_object_class_install_property (obj_class,423 g_object_class_install_property (obj_class,
@@ -575,6 +595,15 @@
575 0.0, 1.0, 0.5,595 0.0, 1.0, 0.5,
576 G_PARAM_READWRITE | G_PARAM_CONSTRUCT |596 G_PARAM_READWRITE | G_PARAM_CONSTRUCT |
577 G_PARAM_STATIC_STRINGS));597 G_PARAM_STATIC_STRINGS));
598
599 g_object_class_install_property (obj_class,
600 PROP_STRIPE_WIDTH,
601 g_param_spec_float ("stripe-width",
602 "Stripe Width",
603 "The width of the stripe",
604 0.0, 1.0, 0.0,
605 G_PARAM_READWRITE | G_PARAM_CONSTRUCT |
606 G_PARAM_STATIC_STRINGS));
578607
579 /* Add signals to the class */608 /* Add signals to the class */
580 _bg_signals[CHANGED] = 609 _bg_signals[CHANGED] =
@@ -650,6 +679,11 @@
650 bg->border_color = NULL;679 bg->border_color = NULL;
651 bg->hilight_color = NULL;680 bg->hilight_color = NULL;
652 bg->sep_color = NULL;681 bg->sep_color = NULL;
682 bg->needs_redraw = TRUE;
683 bg->helper_surface = NULL;
684 bg->cache_enabled = TRUE;
685 bg->last_height = 0;
686 bg->last_width = 0;
653}687}
654688
655void 689void
@@ -664,8 +698,40 @@
664 698
665 klass = AWN_BACKGROUND_GET_CLASS (bg);699 klass = AWN_BACKGROUND_GET_CLASS (bg);
666 g_return_if_fail (klass->draw != NULL);700 g_return_if_fail (klass->draw != NULL);
667701
668 klass->draw (bg, cr, position, area);702 /* Check if background caching is enabled - TRUE by default */
703 if (bg->cache_enabled)
704 {
705 g_return_if_fail (klass->get_needs_redraw != NULL);
706 cairo_save (cr);
707
708 /* Check if background needs to be redrawn */
709 if (klass->get_needs_redraw (bg, position, area))
710 {
711 /* Free last surface */
712 if (bg->helper_surface != NULL)
713 {
714 cairo_surface_finish (bg->helper_surface);
715 cairo_surface_destroy (bg->helper_surface);
716 }
717 /* Create new surface */
718 bg->helper_surface = cairo_image_surface_create (CAIRO_FORMAT_ARGB32,
719 area->x + area->width,
720 area->y + area->height);
721 cairo_t* temp_cr = cairo_create (bg->helper_surface);
722 /* Draw background on temp cairo_t */
723 klass->draw (bg, temp_cr, position, area);
724 cairo_destroy (temp_cr);
725 }
726 /* Paint saved surface */
727 cairo_set_source_surface (cr, bg->helper_surface, 0., 0.);
728 cairo_paint(cr);
729 cairo_restore (cr);
730 }
731 else
732 {
733 klass->draw (bg, cr, position, area);
734 }
669}735}
670736
671void 737void
@@ -1009,4 +1075,25 @@
1009 return AWN_PATH_LINEAR;1075 return AWN_PATH_LINEAR;
1010}1076}
10111077
1078static gboolean awn_background_get_needs_redraw (AwnBackground *bg,
1079 GtkPositionType position,
1080 GdkRectangle *area)
1081{
1082 if (bg->needs_redraw == 1 ||
1083 bg->last_height != area->height ||
1084 bg->last_width != area->width)
1085 {
1086 bg->needs_redraw = 0;
1087 bg->last_height = area->height;
1088 bg->last_width = area->width;
1089 return TRUE;
1090 }
1091 return FALSE;
1092}
1093
1094void awn_background_invalidate (AwnBackground *bg)
1095{
1096 bg->needs_redraw = 1;
1097}
1098
1012/* vim: set et ts=2 sts=2 sw=2 : */1099/* vim: set et ts=2 sts=2 sw=2 : */
10131100
=== modified file 'src/awn-background.h'
--- src/awn-background.h 2010-03-07 18:38:07 +0000
+++ src/awn-background.h 2010-05-31 11:01:08 +0000
@@ -76,6 +76,15 @@
76 gfloat pattern_alpha;76 gfloat pattern_alpha;
77 GdkPixbuf *pattern_original;77 GdkPixbuf *pattern_original;
78 cairo_surface_t *pattern;78 cairo_surface_t *pattern;
79
80 /* Speedup code.
81 * We can save the bg and redraw only when properties changes
82 */
83 gboolean cache_enabled;
84 gboolean needs_redraw;
85 cairo_surface_t* helper_surface;
86 gint last_height;
87 gint last_width;
7988
80 /* FIXME:89 /* FIXME:
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)
@@ -89,6 +98,7 @@
89 gint panel_angle;98 gint panel_angle;
90 gfloat curviness;99 gfloat curviness;
91 gfloat curves_symmetry;100 gfloat curves_symmetry;
101 gfloat stripe_width;
92102
93 /* private */103 /* private */
94 guint changed;104 guint changed;
@@ -129,6 +139,10 @@
129 GdkRectangle *area,139 GdkRectangle *area,
130 gint *strut,140 gint *strut,
131 gint *strut_start, gint *strut_end);141 gint *strut_start, gint *strut_end);
142
143 gboolean (*get_needs_redraw) (AwnBackground *bg,
144 GtkPositionType position,
145 GdkRectangle *area);
132146
133 /*< signals >*/147 /*< signals >*/
134 void (*changed) (AwnBackground *bg);148 void (*changed) (AwnBackground *bg);
@@ -142,6 +156,8 @@
142 GtkPositionType position,156 GtkPositionType position,
143 GdkRectangle *area);157 GdkRectangle *area);
144158
159void awn_background_invalidate (AwnBackground *bg);
160
145void awn_background_padding_request (AwnBackground *bg,161void awn_background_padding_request (AwnBackground *bg,
146 GtkPositionType position,162 GtkPositionType position,
147 guint *padding_top,163 guint *padding_top,
148164
=== modified file 'src/awn-defines.h'
--- src/awn-defines.h 2010-02-06 13:34:02 +0000
+++ src/awn-defines.h 2010-05-31 11:01:08 +0000
@@ -87,6 +87,7 @@
87#define AWN_THEME_PANEL_ANGLE "panel_angle"87#define AWN_THEME_PANEL_ANGLE "panel_angle"
88#define AWN_THEME_CURVINESS "curviness"88#define AWN_THEME_CURVINESS "curviness"
89#define AWN_THEME_CURVES_SYMMETRY "curves_symmetry"89#define AWN_THEME_CURVES_SYMMETRY "curves_symmetry"
90#define AWN_THEME_STRIPE_WIDTH "stripe_width"
9091
91#endif /*_HAVE_AWN_DEFINES_H */92#endif /*_HAVE_AWN_DEFINES_H */
9293
9394
=== modified file 'src/awn-panel.c'
--- src/awn-panel.c 2010-05-29 17:17:22 +0000
+++ src/awn-panel.c 2010-05-31 11:01:08 +0000
@@ -43,6 +43,7 @@
43#include "awn-background-3d.h"43#include "awn-background-3d.h"
44#include "awn-background-curves.h"44#include "awn-background-curves.h"
45#include "awn-background-edgy.h"45#include "awn-background-edgy.h"
46#include "awn-background-lucido.h"
46#include "awn-background-floaty.h"47#include "awn-background-floaty.h"
47#include "awn-defines.h"48#include "awn-defines.h"
48#include "awn-marshal.h"49#include "awn-marshal.h"
@@ -222,6 +223,7 @@
222 STYLE_EDGY,223 STYLE_EDGY,
223 STYLE_FLOATY,224 STYLE_FLOATY,
224225
226 STYLE_LUCIDO,
225 STYLE_LAST227 STYLE_LAST
226};228};
227229
@@ -1075,6 +1077,9 @@
1075 }1077 }
10761078
1077 awn_panel_queue_masks_update (panel);1079 awn_panel_queue_masks_update (panel);
1080
1081 if (priv->bg)
1082 awn_background_invalidate (priv->bg);
1078}1083}
10791084
1080static1085static
@@ -1760,7 +1765,7 @@
1760 obj_class->finalize = awn_panel_finalize;1765 obj_class->finalize = awn_panel_finalize;
1761 obj_class->get_property = awn_panel_get_property;1766 obj_class->get_property = awn_panel_get_property;
1762 obj_class->set_property = awn_panel_set_property;1767 obj_class->set_property = awn_panel_set_property;
1763 1768
1764 cont_class->add = awn_panel_add;1769 cont_class->add = awn_panel_add;
1765 1770
1766 wid_class->expose_event = awn_panel_expose;1771 wid_class->expose_event = awn_panel_expose;
@@ -3179,6 +3184,9 @@
3179 case STYLE_EDGY:3184 case STYLE_EDGY:
3180 priv->bg = awn_background_edgy_new (priv->client, panel);3185 priv->bg = awn_background_edgy_new (priv->client, panel);
3181 break;3186 break;
3187 case STYLE_LUCIDO:
3188 priv->bg = awn_background_lucido_new (priv->client, panel);
3189 break;
3182 case STYLE_FLOATY:3190 case STYLE_FLOATY:
3183 priv->bg = awn_background_floaty_new (priv->client, panel);3191 priv->bg = awn_background_floaty_new (priv->client, panel);
3184 break;3192 break;

Subscribers

People subscribed via source and target branches