On 31/08/2007, Dominik Vogt <[EMAIL PROTECTED]> wrote:
> On Fri, Aug 31, 2007 at 11:26:03AM +0100, Thomas Adam wrote:
> > On 31/08/2007, Dominik Vogt <[EMAIL PROTECTED]> wrote:
> > > On Thu, Aug 30, 2007 at 09:32:15PM +0100, Thomas Adam wrote:
> > > 2) There is no NEWS entry for the new featur.
> >
> > I'll add one if it's something you think you'll add.
>
> I certainly will commit the patch.  Never liked that FvwmEvent
> stuff myself.

My mail server seems broken, so apologies if this email reaches the list twice.

Please see the file attached.   I think it addresses your comments.
The only annoyance was with the damn XML file.

-- Thomas Adam
Index: AUTHORS
===================================================================
RCS file: /home/cvs/fvwm/fvwm/AUTHORS,v
retrieving revision 1.126
diff -u -r1.126 AUTHORS
--- AUTHORS	15 Jul 2007 12:39:39 -0000	1.126
+++ AUTHORS	31 Aug 2007 22:28:18 -0000
@@ -12,6 +12,7 @@
 Thomas Adam:
 Window style !StickyStippledTitle (and hence StickyStippledTitle).
 Icon style StippledIconTitle and !StickyStippledIconTitle.
+StartShaded style option.
 
 Serge (gentoosiast) Koksharov:
 Documentation fixes, bug fixes.
Index: ChangeLog
===================================================================
RCS file: /home/cvs/fvwm/fvwm/ChangeLog,v
retrieving revision 1.2999
diff -u -r1.2999 ChangeLog
--- ChangeLog	30 Aug 2007 06:09:34 -0000	1.2999
+++ ChangeLog	31 Aug 2007 22:28:28 -0000
@@ -1,3 +1,8 @@
+2007-08-30 Thomas Adam <[EMAIL PROTECTED]>
+    * fvwm/style.c:
+    * fvwm/add_window.c:
+      Added new style option:  StartShaded.
+
 2007-08-30  Viktor Griph  <griph(at)student(dot)chalmers(dot)se>
 
 	* configure.ac:
Index: NEWS
===================================================================
RCS file: /home/cvs/fvwm/fvwm/NEWS,v
retrieving revision 1.720
diff -u -r1.720 NEWS
--- NEWS	29 Aug 2007 12:35:01 -0000	1.720
+++ NEWS	31 Aug 2007 22:28:29 -0000
@@ -6,6 +6,8 @@
 Changes in beta release 2.5.23 (unreleased)
 
 * New features:
+   - New Style command option:
+       StartShaded
 
 
 * Bug Fixes:
Index: doc/commands/Style.xml
===================================================================
RCS file: /home/cvs/fvwm/fvwm/doc/commands/Style.xml,v
retrieving revision 1.4
diff -u -r1.4 Style.xml
--- doc/commands/Style.xml	16 Jun 2007 12:38:46 -0000	1.4
+++ doc/commands/Style.xml	31 Aug 2007 22:28:31 -0000
@@ -87,6 +87,7 @@
 <emphasis remap='I'>IconFont</emphasis>,
 <emphasis remap='I'>StartsOnDesk</emphasis> / <emphasis remap='I'>StartsOnPage</emphasis> / <emphasis remap='I'>StartsAnyWhere</emphasis>,
 <emphasis remap='I'>StartsOnScreen</emphasis>,
+<emphasis remap='I'>StartShaded</emphasis> / <emphasis remap='I'>!StartShaded</emphasis>,
 <emphasis remap='I'>ManualPlacementHonorsStartsOnPage</emphasis> / <emphasis remap='I'>ManualPlacementIgnoresStartsOnPage</emphasis>,
 <emphasis remap='I'>CaptureHonorsStartsOnPage</emphasis> / <emphasis remap='I'>CaptureIgnoresStartsOnPage</emphasis>,
 <emphasis remap='I'>RecaptureHonorsStartsOnPage</emphasis> / <emphasis remap='I'>RecaptureIgnoresStartsOnPage</emphasis>,
@@ -1720,6 +1721,19 @@
 layer rather than the default
 <fvwmopt cmd="Style" opt="StartsRaised"/>.</para>
 
+<para><fvwmopt cmd="Style" opt="StartShaded"/>
+tells fvwm to shade the window.  An optional direction argument may be
+given, which can be one of
+"<fvwmopt cmd="WindowShade" opt="North"/>",
+"<fvwmopt cmd="WindowShade" opt="South"/>",
+"<fvwmopt cmd="WindowShade" opt="West"/>",
+"<fvwmopt cmd="WindowShade" opt="East"/>",
+"<fvwmopt cmd="WindowShade" opt="NorthWest"/>",
+"<fvwmopt cmd="WindowShade" opt="NorthEast"/>",
+"<fvwmopt cmd="WindowShade" opt="SouthWest"/>",
+"<fvwmopt cmd="WindowShade" opt="SouthEast"/>" or
+if no direction is given, the default is to shade to north.</para>
+
 <para><emphasis remap='I'>SkipMapping</emphasis>
 tells fvwm not to switch to the desk the window is on when it gets
 mapped initially (useful with
@@ -2173,5 +2187,4 @@
 
 </section>
 
-
 </section>
Index: fvwm/add_window.c
===================================================================
RCS file: /home/cvs/fvwm/fvwm/fvwm/add_window.c,v
retrieving revision 1.392
diff -u -r1.392 add_window.c
--- fvwm/add_window.c	7 Aug 2007 20:17:43 -0000	1.392
+++ fvwm/add_window.c	31 Aug 2007 22:28:34 -0000
@@ -2479,7 +2479,7 @@
 	GNOME_SetWinArea(fw);
 
 	/****** windowshade ******/
-	if (state_args.do_shade)
+	if (state_args.do_shade || SDO_START_SHADED(sflags))
 	{
 		rectangle big_g;
 		rectangle new_g;
@@ -2489,6 +2489,14 @@
 		{
 			state_args.shade_dir = GET_TITLE_DIR(fw);
 		}
+                
+                /* If we've set a style for StartShaded, ensure we override
+                 * the state for it here. -- TA.
+                 */
+                if (SGET_STARTS_SHADED_DIR(style) != DIR_NONE)
+                {
+                        state_args.shade_dir = SGET_STARTS_SHADED_DIR(style);
+                }
 		big_g = (IS_MAXIMIZED(fw)) ? fw->g.max : fw->g.frame;
 		new_g = big_g;
 		get_shaded_geometry_with_dir(
Index: fvwm/fvwm.h
===================================================================
RCS file: /home/cvs/fvwm/fvwm/fvwm/fvwm.h,v
retrieving revision 1.256
diff -u -r1.256 fvwm.h
--- fvwm/fvwm.h	3 Jun 2007 09:28:34 -0000	1.256
+++ fvwm/fvwm.h	31 Aug 2007 22:28:34 -0000
@@ -531,6 +531,8 @@
 	unsigned do_save_under : 1;
 	unsigned do_start_iconic : 1;
 	unsigned do_start_lowered : 1;
+ 	unsigned do_start_shaded : 1;
+ 	unsigned start_shaded_dir : 3;
 	unsigned has_border_width : 1;
 	unsigned has_color_back : 1;
 	unsigned has_color_fore : 1;
Index: fvwm/style.c
===================================================================
RCS file: /home/cvs/fvwm/fvwm/fvwm/style.c,v
retrieving revision 1.256
diff -u -r1.256 style.c
--- fvwm/style.c	3 Jun 2007 09:28:34 -0000	1.256
+++ fvwm/style.c	31 Aug 2007 22:28:37 -0000
@@ -585,6 +585,11 @@
 	{
 		SSET_LAYER(*merged_style, SGET_LAYER(*add_style));
 	}
+        if (add_style->flags.do_start_shaded)
+        {
+                SSET_STARTS_SHADED_DIR(*merged_style, 
+                                SGET_STARTS_SHADED_DIR(*add_style));
+        }
 	if (add_style->flags.use_colorset)
 	{
 		SSET_COLORSET(*merged_style, SGET_COLORSET(*add_style));
@@ -3784,6 +3789,35 @@
 			ps->flag_mask.do_start_lowered = 1;
 			ps->change_mask.do_start_lowered = 1;
 		}
+                else if (StrEquals(token, "StartShaded"))
+                {
+                        token = PeekToken(rest, &rest);
+
+                        if (token)
+                        {
+                                direction_t direction;
+
+                                direction = gravity_parse_dir_argument(token, 
+                                                &token, DIR_NONE );
+
+                                if (direction >= 0 && direction <= 
+                                                DIR_MINOR_MASK)
+                                {
+                                        SSET_STARTS_SHADED_DIR(*ps, direction);
+                                } else {
+                                        fvwm_msg(ERR,
+                                               "style_parse_one_style_option",
+                                               "Option: %s is not valid with"
+                                               " StartShaded", token);
+                                }
+                        } else {
+                                SSET_STARTS_SHADED_DIR(*ps, DIR_NONE);
+                        }
+
+                        ps->flags.do_start_shaded = on;
+                        ps->flag_mask.do_start_shaded = 1;
+                        ps->change_mask.do_start_shaded = 1;
+                }
 		else if (StrEquals(token, "SaveUnder"))
 		{
 			ps->flags.do_save_under = on;
Index: fvwm/style.h
===================================================================
RCS file: /home/cvs/fvwm/fvwm/fvwm/style.h,v
retrieving revision 1.87
diff -u -r1.87 style.h
--- fvwm/style.h	3 Jun 2007 09:28:34 -0000	1.87
+++ fvwm/style.h	31 Aug 2007 22:28:38 -0000
@@ -11,6 +11,8 @@
 	((sf)->do_save_under)
 #define SDO_START_LOWERED(sf) \
 	((sf)->do_start_lowered)
+#define SDO_START_SHADED(sf) \
+    ((sf)->do_start_shaded)
 #define SHAS_BORDER_WIDTH(sf) \
 	((sf)->has_border_width)
 #define SHAS_COLOR_BACK(sf) \
@@ -509,6 +511,10 @@
 	((s).start_screen)
 #define SSET_START_SCREEN(s,x) \
 	((s).start_screen = (x))
+#define SSET_STARTS_SHADED_DIR(s,x) \
+    ((s).flags.start_shaded_dir = (x))
+#define SGET_STARTS_SHADED_DIR(s) \
+    ((s).flags.start_shaded_dir)
 #define SGET_MIN_ICON_WIDTH(s) \
 	((s).min_icon_width)
 #define SSET_MIN_ICON_WIDTH(s,x) \

Reply via email to