mirror of
https://github.com/gryf/wmaker.git
synced 2025-12-19 20:38:08 +01:00
fixed silly typo in workspace.c
added system wide menu configuration
This commit is contained in:
@@ -85,6 +85,7 @@ Changes since version 0.80.2:
|
||||
and vlaad)
|
||||
- Updated French translations (Antoine Hulin <antoine@origan.fdn.org>)
|
||||
- Xinerama support for Solaris
|
||||
- Added global menu support (see NEWS)
|
||||
|
||||
Changes since version 0.80.1:
|
||||
.............................
|
||||
|
||||
23
NEWS
23
NEWS
@@ -31,6 +31,29 @@ configuration (read the details in README.antialiasing). Else you may get
|
||||
unepleasant results in the look of your screen :P
|
||||
|
||||
|
||||
Global Submenus
|
||||
---------------
|
||||
|
||||
Global menus allow for system wide menus that are added to every users
|
||||
application menus. They are located in /usr/etc/WindowMaker/,
|
||||
/usr/local/etc/WindowMaker or whatever is your sysconf directory
|
||||
for WindowMaker. There are 2 files:
|
||||
|
||||
GlobalMenu.pre, which is added to the beginning of the menu and
|
||||
GlobalMenu.post, which is added to the end of the menu.
|
||||
|
||||
These are to be proplist format menus, for example:
|
||||
|
||||
(("Foobar", EXEC, foobar),
|
||||
("Blabla", EXEC, blabla))
|
||||
|
||||
or, in case you want a submenu:
|
||||
|
||||
(("Submenu",
|
||||
("Foobar", EXEC, foobar),
|
||||
("Blabla", EXEC, blabla)))
|
||||
|
||||
|
||||
--- 0.80.0
|
||||
|
||||
Shading/Unshading windows using mouse wheel on their titlebar
|
||||
|
||||
@@ -932,6 +932,78 @@ readGlobalDomain(char *domainName, Bool requireDictionary)
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#if defined(GLOBAL_PREAMBLE_MENU_FILE) || defined(GLOBAL_EPILOGUE_MENU_FILE)
|
||||
static void prependMenu(WMPropList *destarr, WMPropList *array)
|
||||
{
|
||||
WMPropList *item;
|
||||
int i;
|
||||
|
||||
for (i=0; i<WMGetPropListItemCount(array); i++) {
|
||||
item = WMGetFromPLArray(array, i);
|
||||
if (item)
|
||||
WMInsertInPLArray(destarr, i+1, item);
|
||||
}
|
||||
}
|
||||
|
||||
static void appendMenu(WMPropList *destarr, WMPropList *array)
|
||||
{
|
||||
WMPropList *item;
|
||||
int i;
|
||||
|
||||
for (i=0; i<WMGetPropListItemCount(array); i++) {
|
||||
item = WMGetFromPLArray(array, i);
|
||||
if (item)
|
||||
WMAddToPLArray(destarr, item);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
void wDefaultsMergeGlobalMenus(WDDomain *menuDomain)
|
||||
{
|
||||
WMPropList *menu = menuDomain->dictionary;
|
||||
WMPropList *submenu;
|
||||
|
||||
if (!menu || !WMIsPLArray(menu))
|
||||
return;
|
||||
|
||||
#ifdef GLOBAL_PREAMBLE_MENU_FILE
|
||||
submenu = WMReadPropListFromFile(SYSCONFDIR"/WindowMaker/"GLOBAL_PREAMBLE_MENU_FILE);
|
||||
|
||||
if (submenu && !WMIsPLArray(submenu)) {
|
||||
wwarning(_("invalid global menu file %s"),
|
||||
GLOBAL_PREAMBLE_MENU_FILE);
|
||||
WMReleasePropList(submenu);
|
||||
submenu = NULL;
|
||||
}
|
||||
if (submenu) {
|
||||
prependMenu(menu, submenu);
|
||||
WMReleasePropList(submenu);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef GLOBAL_EPILOGUE_MENU_FILE
|
||||
submenu = WMReadPropListFromFile(SYSCONFDIR"/WindowMaker/"GLOBAL_EPILOGUE_MENU_FILE);
|
||||
|
||||
if (submenu && !WMIsPLArray(submenu)) {
|
||||
wwarning(_("invalid global menu file %s"),
|
||||
GLOBAL_EPILOGUE_MENU_FILE);
|
||||
WMReleasePropList(submenu);
|
||||
submenu = NULL;
|
||||
}
|
||||
if (submenu) {
|
||||
appendMenu(menu, submenu);
|
||||
WMReleasePropList(submenu);
|
||||
}
|
||||
#endif
|
||||
|
||||
menuDomain->dictionary = menu;
|
||||
}
|
||||
|
||||
|
||||
#if 0
|
||||
WMPropList*
|
||||
wDefaultsInit(int screen_number)
|
||||
@@ -1068,6 +1140,7 @@ wReadStaticDefaults(WMPropList *dict)
|
||||
}
|
||||
|
||||
|
||||
|
||||
void
|
||||
wDefaultsCheckDomains(void *foo)
|
||||
{
|
||||
@@ -1199,6 +1272,7 @@ wDefaultsCheckDomains(void *foo)
|
||||
WMReleasePropList(WDRootMenu->dictionary);
|
||||
}
|
||||
WDRootMenu->dictionary = dict;
|
||||
wDefaultsMergeGlobalMenus(WDRootMenu);
|
||||
}
|
||||
} else {
|
||||
wwarning(_("could not load domain %s from user defaults database"),
|
||||
|
||||
@@ -36,6 +36,8 @@ WMPropList* wDefaultsInit(int screen_number);
|
||||
|
||||
WDDomain* wDefaultsInitDomain(char *domain, Bool requireDictionary);
|
||||
|
||||
void wDefaultsMergeGlobalMenus(WDDomain *menuDomain);
|
||||
|
||||
void wDefaultsDestroyDomain(WDDomain *domain);
|
||||
|
||||
void wReadDefaults(WScreen *scr, WMPropList *new_dict);
|
||||
|
||||
@@ -1262,6 +1262,7 @@ readMenuFile(WScreen *scr, char *file_name)
|
||||
return menu;
|
||||
}
|
||||
|
||||
|
||||
/************ Menu Configuration From Pipe *************/
|
||||
|
||||
static WMenu*
|
||||
@@ -1778,12 +1779,6 @@ configureMenu(WScreen *scr, WMPropList *definition)
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/*
|
||||
*----------------------------------------------------------------------
|
||||
* OpenRootMenu--
|
||||
|
||||
@@ -902,6 +902,7 @@ StartUp(Bool defaultScreenOnly)
|
||||
wwarning(_("could not read domain \"%s\" from defaults database"),
|
||||
"WMRootMenu");
|
||||
}
|
||||
wDefaultsMergeGlobalMenus(WDRootMenu);
|
||||
|
||||
WDWindowAttributes = wDefaultsInitDomain("WMWindowAttributes", True);
|
||||
if (!WDWindowAttributes->dictionary) {
|
||||
|
||||
@@ -247,10 +247,9 @@
|
||||
#endif
|
||||
|
||||
/* the file of the system wide submenu to be forced into the main menu */
|
||||
/* remove the comments if you want it */
|
||||
/*
|
||||
#define GLOBAL_SUBMENU_FILE PKGDATADIR"/GlobalMenu"
|
||||
*/
|
||||
#define GLOBAL_PREAMBLE_MENU_FILE "GlobalMenu.pre"
|
||||
#define GLOBAL_EPILOGUE_MENU_FILE "GlobalMenu.post"
|
||||
|
||||
|
||||
/* pixmap path */
|
||||
#define DEF_PIXMAP_PATHS \
|
||||
|
||||
@@ -225,7 +225,7 @@ typedef struct WorkspaceNameData {
|
||||
|
||||
|
||||
static void
|
||||
hideWorkpaceName(void *data)
|
||||
hideWorkspaceName(void *data)
|
||||
{
|
||||
WScreen *scr = (WScreen*)data;
|
||||
|
||||
@@ -246,7 +246,7 @@ hideWorkpaceName(void *data)
|
||||
Pixmap pix;
|
||||
|
||||
scr->workspace_name_timer =
|
||||
WMAddTimerHandler(WORKSPACE_NAME_FADE_DELAY, hideWorkpaceName,
|
||||
WMAddTimerHandler(WORKSPACE_NAME_FADE_DELAY, hideWorkspaceName,
|
||||
scr);
|
||||
|
||||
RCombineImagesWithOpaqueness(img, scr->workspace_name_data->text,
|
||||
@@ -289,7 +289,7 @@ showWorkspaceName(WScreen *scr, int workspace)
|
||||
XFlush(dpy);
|
||||
}
|
||||
scr->workspace_name_timer = WMAddTimerHandler(WORKSPACE_NAME_DELAY,
|
||||
hideWorkpaceName, scr);
|
||||
hideWorkspaceName, scr);
|
||||
|
||||
if (scr->workspace_name_data) {
|
||||
RReleaseImage(scr->workspace_name_data->back);
|
||||
@@ -425,7 +425,7 @@ erro:
|
||||
|
||||
scr->workspace_name_timer = WMAddTimerHandler(WORKSPACE_NAME_DELAY +
|
||||
10*WORKSPACE_NAME_FADE_DELAY,
|
||||
hideWorkpaceName, scr);
|
||||
hideWorkspaceName, scr);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user