Feedback appreciated. I am now sorting based on the class first and
then looking at the title etc based on the other flags.
Now that I think about it both the Alphabetic and my version will
nullify the work of both CurrentAtEnd and IconifiedAtEnd. Is anyone
interested in more code bloat to take care of this?
I see in the WindowList function there is a mix between defining a
custom 'Bool' variable and using the flags with a bit mask. Any
feelings on standardizing on one or the other? We do only have 16
bits left.
This time I did not include a SortClassNameOff, but I see there are
'off' options for, NotAlphabetic NoGeometry NoGeometryWithInfo NoIcons
NoNormal NoSticky based on pervious posts I wonder if I should add
that option or remove the others.
--
+-+
| David Fries|
| [EMAIL PROTECTED]|
| http://fries.net/~david/pgp.txt |
+-+
Index: ChangeLog
===
RCS file: /home/cvs/fvwm/fvwm/ChangeLog,v
retrieving revision 1.1849
diff -u -r1.1849 ChangeLog
--- ChangeLog 2002/06/21 14:32:34 1.1849
+++ ChangeLog 2002/06/24 03:45:24
@@ -1,3 +1,10 @@
+2002-06-23 David Fries [EMAIL PROTECTED]
+
+ * fvwm/fvwm.1:
+ * fvwm/windowlist.c:
+ Added code to sort based on the class name of a window for
+ the WindowList function.
+
2002-06-21 Dan Espen [EMAIL PROTECTED]
* fvwm/fvwm.1 (Examples): Language check.
Index: NEWS
===
RCS file: /home/cvs/fvwm/fvwm/NEWS,v
retrieving revision 1.378
diff -u -r1.378 NEWS
--- NEWS2002/06/21 05:35:43 1.378
+++ NEWS2002/06/24 03:45:35
@@ -15,7 +15,7 @@
* Provided powerful perl library for creating FVWM modules in perl.
-* New WindowList option IconifiedtAtEnd.
+* New WindowList option IconifiedtAtEnd, SortClassName.
* Always display the current desk number in the FvwmPager window
title.
Index: fvwm/fvwm.1
===
RCS file: /home/cvs/fvwm/fvwm/fvwm/fvwm.1,v
retrieving revision 1.23
diff -u -r1.23 fvwm.1
--- fvwm/fvwm.1 2002/06/21 14:32:34 1.23
+++ fvwm/fvwm.1 2002/06/24 03:46:06
@@ -3876,6 +3876,7 @@
.IR IconifiedAtEnd ,
.IR UseIconName ,
.IR Alphabetic / NotAlphabetic ,
+.IR SortClassName ,
.IR NoHotkeys ,
.IR SelectOnRelease .
Index: fvwm/windowlist.c
===
RCS file: /home/cvs/fvwm/fvwm/fvwm/windowlist.c,v
retrieving revision 1.61
diff -u -r1.61 windowlist.c
--- fvwm/windowlist.c 2002/06/18 10:52:15 1.61
+++ fvwm/windowlist.c 2002/06/24 03:46:07
@@ -59,28 +59,15 @@
#define NO_DESK_SORT (16)
#define SHOW_ICONNAME (17)
#define SHOW_ALPHABETIC(18)
-#define SHOW_INFONOTGEO(19)
-#define NO_DESK_NUM(110)
-#define NO_CURRENT_DESK_TITLE (111)
-#define TITLE_FOR_ALL_DESKS(112)
-#define NO_NUM_IN_DESK_TITLE (113)
+#define SORT_CLASSNAME (19)
+#define SORT_REVERSE (110)
+#define SHOW_INFONOTGEO(111)
+#define NO_DESK_NUM(112)
+#define NO_CURRENT_DESK_TITLE (113)
+#define TITLE_FOR_ALL_DESKS(114)
+#define NO_NUM_IN_DESK_TITLE (115)
#define SHOW_EVERYTHING (SHOW_GEOMETRY | SHOW_ALLDESKS | SHOW_NORMAL |
SHOW_ICONIC | SHOW_STICKY)
-/* Function to compare window title names
- */
-static int globalFlags;
-static int winCompare(const FvwmWindow **a, const FvwmWindow **b)
-{
- if(globalFlags SHOW_ICONNAME)
-return strcasecmp((*a)-visible_icon_name,(*b)-visible_icon_name);
- else
-return strcasecmp((*a)-visible_name,(*b)-visible_name);
-}
-static int winCompareReverse(const FvwmWindow **a, const FvwmWindow **b)
-{
- return -winCompare(a, b);
-}
-
static char *get_desk_title(int desk, unsigned long flags, Bool is_top_title)
{
char *desk_name;
@@ -153,7 +140,6 @@
char *sor_keyname = sor_default_keyname;
/* Condition vars. */
Bool use_condition = False;
- Bool do_reverse_sort_order = False;
Bool current_at_end = False;
Bool iconified_at_end = False;
int ic = 0;
@@ -222,8 +208,10 @@
flags = ~SHOW_ALPHABETIC;
else if (StrEquals(tok,Alphabetic))
flags |= SHOW_ALPHABETIC;
+ else if (StrEquals(tok,SortClassName))
+ flags |= SORT_CLASSNAME;
else if (StrEquals(tok,ReverseOrder))
- do_reverse_sort_order = True;
+ flags |= SORT_REVERSE;
else if (StrEquals(tok,CurrentAtEnd))
current_at_end = True;
else if (StrEquals(tok,IconifiedAtEnd))
@@ -346,8 +334,6 @@
{
opts = get_menu_options(action, w, fw, eventp, NULL, NULL, mops);
}
- globalFlags = flags;
-
tlabel = get_desk_title(desk, flags, True);
mr = NewMenuRoot(tlabel);
@@ -388,7 +374,7 @@
}