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)
|
and vlaad)
|
||||||
- Updated French translations (Antoine Hulin <antoine@origan.fdn.org>)
|
- Updated French translations (Antoine Hulin <antoine@origan.fdn.org>)
|
||||||
- Xinerama support for Solaris
|
- Xinerama support for Solaris
|
||||||
|
- Added global menu support (see NEWS)
|
||||||
|
|
||||||
Changes since version 0.80.1:
|
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
|
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
|
--- 0.80.0
|
||||||
|
|
||||||
Shading/Unshading windows using mouse wheel on their titlebar
|
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
|
#if 0
|
||||||
WMPropList*
|
WMPropList*
|
||||||
wDefaultsInit(int screen_number)
|
wDefaultsInit(int screen_number)
|
||||||
@@ -1068,6 +1140,7 @@ wReadStaticDefaults(WMPropList *dict)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
wDefaultsCheckDomains(void *foo)
|
wDefaultsCheckDomains(void *foo)
|
||||||
{
|
{
|
||||||
@@ -1199,6 +1272,7 @@ wDefaultsCheckDomains(void *foo)
|
|||||||
WMReleasePropList(WDRootMenu->dictionary);
|
WMReleasePropList(WDRootMenu->dictionary);
|
||||||
}
|
}
|
||||||
WDRootMenu->dictionary = dict;
|
WDRootMenu->dictionary = dict;
|
||||||
|
wDefaultsMergeGlobalMenus(WDRootMenu);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
wwarning(_("could not load domain %s from user defaults database"),
|
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);
|
WDDomain* wDefaultsInitDomain(char *domain, Bool requireDictionary);
|
||||||
|
|
||||||
|
void wDefaultsMergeGlobalMenus(WDDomain *menuDomain);
|
||||||
|
|
||||||
void wDefaultsDestroyDomain(WDDomain *domain);
|
void wDefaultsDestroyDomain(WDDomain *domain);
|
||||||
|
|
||||||
void wReadDefaults(WScreen *scr, WMPropList *new_dict);
|
void wReadDefaults(WScreen *scr, WMPropList *new_dict);
|
||||||
|
|||||||
@@ -1262,6 +1262,7 @@ readMenuFile(WScreen *scr, char *file_name)
|
|||||||
return menu;
|
return menu;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/************ Menu Configuration From Pipe *************/
|
/************ Menu Configuration From Pipe *************/
|
||||||
|
|
||||||
static WMenu*
|
static WMenu*
|
||||||
@@ -1668,7 +1669,7 @@ configureMenu(WScreen *scr, WMPropList *definition)
|
|||||||
if (!scr->root_menu || stat_buf.st_mtime > scr->root_menu->timestamp
|
if (!scr->root_menu || stat_buf.st_mtime > scr->root_menu->timestamp
|
||||||
/* if the pointer in WMRootMenu has changed */
|
/* if the pointer in WMRootMenu has changed */
|
||||||
|| WDRootMenu->timestamp > scr->root_menu->timestamp) {
|
|| WDRootMenu->timestamp > scr->root_menu->timestamp) {
|
||||||
|
|
||||||
if (menu_is_default) {
|
if (menu_is_default) {
|
||||||
wwarning(_("using default menu file \"%s\" as the menu referenced in WMRootMenu could not be found "),
|
wwarning(_("using default menu file \"%s\" as the menu referenced in WMRootMenu could not be found "),
|
||||||
path);
|
path);
|
||||||
@@ -1699,7 +1700,7 @@ configureMenu(WScreen *scr, WMPropList *definition)
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
mtitle = WMGetFromPLString(elem);
|
mtitle = WMGetFromPLString(elem);
|
||||||
|
|
||||||
menu = wMenuCreate(scr, mtitle, False);
|
menu = wMenuCreate(scr, mtitle, False);
|
||||||
menu->on_destroy = removeShortcutsForMenu;
|
menu->on_destroy = removeShortcutsForMenu;
|
||||||
|
|
||||||
@@ -1778,12 +1779,6 @@ configureMenu(WScreen *scr, WMPropList *definition)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
*----------------------------------------------------------------------
|
*----------------------------------------------------------------------
|
||||||
* OpenRootMenu--
|
* OpenRootMenu--
|
||||||
|
|||||||
@@ -902,6 +902,7 @@ StartUp(Bool defaultScreenOnly)
|
|||||||
wwarning(_("could not read domain \"%s\" from defaults database"),
|
wwarning(_("could not read domain \"%s\" from defaults database"),
|
||||||
"WMRootMenu");
|
"WMRootMenu");
|
||||||
}
|
}
|
||||||
|
wDefaultsMergeGlobalMenus(WDRootMenu);
|
||||||
|
|
||||||
WDWindowAttributes = wDefaultsInitDomain("WMWindowAttributes", True);
|
WDWindowAttributes = wDefaultsInitDomain("WMWindowAttributes", True);
|
||||||
if (!WDWindowAttributes->dictionary) {
|
if (!WDWindowAttributes->dictionary) {
|
||||||
|
|||||||
@@ -247,10 +247,9 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* the file of the system wide submenu to be forced into the main menu */
|
/* the file of the system wide submenu to be forced into the main menu */
|
||||||
/* remove the comments if you want it */
|
#define GLOBAL_PREAMBLE_MENU_FILE "GlobalMenu.pre"
|
||||||
/*
|
#define GLOBAL_EPILOGUE_MENU_FILE "GlobalMenu.post"
|
||||||
#define GLOBAL_SUBMENU_FILE PKGDATADIR"/GlobalMenu"
|
|
||||||
*/
|
|
||||||
|
|
||||||
/* pixmap path */
|
/* pixmap path */
|
||||||
#define DEF_PIXMAP_PATHS \
|
#define DEF_PIXMAP_PATHS \
|
||||||
|
|||||||
@@ -225,7 +225,7 @@ typedef struct WorkspaceNameData {
|
|||||||
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
hideWorkpaceName(void *data)
|
hideWorkspaceName(void *data)
|
||||||
{
|
{
|
||||||
WScreen *scr = (WScreen*)data;
|
WScreen *scr = (WScreen*)data;
|
||||||
|
|
||||||
@@ -246,7 +246,7 @@ hideWorkpaceName(void *data)
|
|||||||
Pixmap pix;
|
Pixmap pix;
|
||||||
|
|
||||||
scr->workspace_name_timer =
|
scr->workspace_name_timer =
|
||||||
WMAddTimerHandler(WORKSPACE_NAME_FADE_DELAY, hideWorkpaceName,
|
WMAddTimerHandler(WORKSPACE_NAME_FADE_DELAY, hideWorkspaceName,
|
||||||
scr);
|
scr);
|
||||||
|
|
||||||
RCombineImagesWithOpaqueness(img, scr->workspace_name_data->text,
|
RCombineImagesWithOpaqueness(img, scr->workspace_name_data->text,
|
||||||
@@ -289,7 +289,7 @@ showWorkspaceName(WScreen *scr, int workspace)
|
|||||||
XFlush(dpy);
|
XFlush(dpy);
|
||||||
}
|
}
|
||||||
scr->workspace_name_timer = WMAddTimerHandler(WORKSPACE_NAME_DELAY,
|
scr->workspace_name_timer = WMAddTimerHandler(WORKSPACE_NAME_DELAY,
|
||||||
hideWorkpaceName, scr);
|
hideWorkspaceName, scr);
|
||||||
|
|
||||||
if (scr->workspace_name_data) {
|
if (scr->workspace_name_data) {
|
||||||
RReleaseImage(scr->workspace_name_data->back);
|
RReleaseImage(scr->workspace_name_data->back);
|
||||||
@@ -425,7 +425,7 @@ erro:
|
|||||||
|
|
||||||
scr->workspace_name_timer = WMAddTimerHandler(WORKSPACE_NAME_DELAY +
|
scr->workspace_name_timer = WMAddTimerHandler(WORKSPACE_NAME_DELAY +
|
||||||
10*WORKSPACE_NAME_FADE_DELAY,
|
10*WORKSPACE_NAME_FADE_DELAY,
|
||||||
hideWorkpaceName, scr);
|
hideWorkspaceName, scr);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user