1
#if !defined(WINPREFS_H)
4
* Copyright (C) 1994-2000 The XFree86 Project, Inc. All Rights Reserved.
6
* Permission is hereby granted, free of charge, to any person obtaining
7
* a copy of this software and associated documentation files (the
8
* "Software"), to deal in the Software without restriction, including
9
* without limitation the rights to use, copy, modify, merge, publish,
10
* distribute, sublicense, and/or sell copies of the Software, and to
11
* permit persons to whom the Software is furnished to do so, subject to
12
* the following conditions:
14
* The above copyright notice and this permission notice shall be
15
* included in all copies or substantial portions of the Software.
17
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
18
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
19
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
20
* NONINFRINGEMENT. IN NO EVENT SHALL THE XFREE86 PROJECT BE LIABLE FOR
21
* ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
22
* CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
23
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
25
* Except as contained in this notice, the name of the XFree86 Project
26
* shall not be used in advertising or otherwise to promote the sale, use
27
* or other dealings in this Software without prior written authorization
28
* from the XFree86 Project.
30
* Authors: Earle F. Philhower, III
35
#include <X11/Xdefs.h>
39
/* Need to know how long paths can be... */
41
/* Xwindows redefines PATH_MAX to at least 1024 */
42
#include <X11/Xwindows.h>
45
#define NAME_MAX PATH_MAX
47
#define MENU_MAX 128 /* Maximum string length of a menu name or item */
48
#define PARAM_MAX (4*PATH_MAX) /* Maximum length of a parameter to a MENU */
51
/* Supported commands in a MENU {} statement */
52
typedef enum MENUCOMMANDTYPE
54
CMD_EXEC, /* /bin/sh -c the parameter */
55
CMD_MENU, /* Display a popup menu named param */
56
CMD_SEPARATOR, /* Menu separator */
57
CMD_ALWAYSONTOP, /* Toggle always-on-top mode */
58
CMD_RELOAD /* Reparse the .XWINRC file */
61
/* Where to place a system menu */
62
typedef enum MENUPOSITION
64
AT_START, /* Place menu at the top of the system menu */
65
AT_END /* Put it at the bottom of the menu (default) */
68
/* Menu item definitions */
69
typedef struct MENUITEM
71
char text[MENU_MAX+1]; /* To be displayed in menu */
72
MENUCOMMANDTYPE cmd; /* What should it do? */
73
char param[PARAM_MAX+1]; /* Any parameters? */
74
unsigned long commandID; /* Windows WM_COMMAND ID assigned at runtime */
77
/* A completely read in menu... */
78
typedef struct MENUPARSED
80
char menuName[MENU_MAX+1]; /* What's it called in the text? */
81
MENUITEM *menuItem; /* Array of items */
82
int menuItems; /* How big's the array? */
85
/* To map between a window and a system menu to add for it */
86
typedef struct SYSMENUITEM
88
char match[MENU_MAX+1]; /* String to look for to apply this sysmenu */
89
char menuName[MENU_MAX+1]; /* Which menu to show? Used to set *menu */
90
MENUPOSITION menuPos; /* Where to place it (ignored in root) */
93
/* To redefine icons for certain window types */
94
typedef struct ICONITEM
96
char match[MENU_MAX+1]; /* What string to search for? */
97
char iconFile[PATH_MAX+NAME_MAX+2]; /* Icon location, WIN32 path */
98
unsigned long hicon; /* LoadImage() result */
101
typedef struct WINPREFS
103
/* Menu information */
104
MENUPARSED *menu; /* Array of created menus */
105
int menuItems; /* How big? */
107
/* Taskbar menu settings */
108
char rootMenuName[MENU_MAX+1]; /* Menu for taskbar icon */
110
/* System menu addition menus */
111
SYSMENUITEM *sysMenu;
114
/* Which menu to add to unmatched windows? */
115
char defaultSysMenuName[MENU_MAX+1];
116
MENUPOSITION defaultSysMenuPos; /* Where to place it */
118
/* Icon information */
119
char iconDirectory[PATH_MAX+1]; /* Where do the .icos lie? (Win32 path) */
120
char defaultIconName[NAME_MAX+1]; /* Replacement for x.ico */
121
char trayIconName[NAME_MAX+1]; /* Replacement for tray icon */
126
/* Silent exit flag */
136
LoadPreferences(void);
139
SetupRootMenu (unsigned long hmenuRoot);
142
SetupSysMenu (unsigned long hwndIn);
145
HandleCustomWM_INITMENU(unsigned long hwndIn,
146
unsigned long hmenuIn);
149
HandleCustomWM_COMMAND (unsigned long hwndIn,
153
winIconIsOverride (unsigned hiconIn);
156
winOverrideIcon (unsigned long longpWin);
159
winTaskbarIcon(void);
162
winOverrideDefaultIcon(int size);