summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Reveman <davidr@novell.com>2008-03-10 09:58:01 -0400
committerDavid Reveman <davidr@novell.com>2008-03-10 12:18:42 -0400
commit19b65643beb1e1a4614496fb03aee404574b0bee (patch)
treefba0f456ec7551d5f0db9ea903bff52fd4efccb6
parent9555d78a73c5d4220c634037adc6cffbc413e74f (diff)
Remove all old display options.
-rw-r--r--include/compiz/core.h74
-rw-r--r--src/display.c353
-rw-r--r--src/plugin.c4
3 files changed, 2 insertions, 429 deletions
diff --git a/include/compiz/core.h b/include/compiz/core.h
index 6f1e4d66..69905754 100644
--- a/include/compiz/core.h
+++ b/include/compiz/core.h
@@ -784,64 +784,6 @@ compObjectFreePrivateIndex (const CompObjectType *type,
/* display.c */
-#define COMP_DISPLAY_OPTION_CLOSE_WINDOW_KEY 0
-#define COMP_DISPLAY_OPTION_CLOSE_WINDOW_BUTTON 1
-#define COMP_DISPLAY_OPTION_MAIN_MENU_KEY 2
-#define COMP_DISPLAY_OPTION_RUN_DIALOG_KEY 3
-#define COMP_DISPLAY_OPTION_COMMAND0 4
-#define COMP_DISPLAY_OPTION_COMMAND1 5
-#define COMP_DISPLAY_OPTION_COMMAND2 6
-#define COMP_DISPLAY_OPTION_COMMAND3 7
-#define COMP_DISPLAY_OPTION_COMMAND4 8
-#define COMP_DISPLAY_OPTION_COMMAND5 9
-#define COMP_DISPLAY_OPTION_COMMAND6 10
-#define COMP_DISPLAY_OPTION_COMMAND7 11
-#define COMP_DISPLAY_OPTION_COMMAND8 12
-#define COMP_DISPLAY_OPTION_COMMAND9 13
-#define COMP_DISPLAY_OPTION_COMMAND10 14
-#define COMP_DISPLAY_OPTION_COMMAND11 15
-#define COMP_DISPLAY_OPTION_RUN_COMMAND0_KEY 16
-#define COMP_DISPLAY_OPTION_RUN_COMMAND1_KEY 17
-#define COMP_DISPLAY_OPTION_RUN_COMMAND2_KEY 18
-#define COMP_DISPLAY_OPTION_RUN_COMMAND3_KEY 19
-#define COMP_DISPLAY_OPTION_RUN_COMMAND4_KEY 20
-#define COMP_DISPLAY_OPTION_RUN_COMMAND5_KEY 21
-#define COMP_DISPLAY_OPTION_RUN_COMMAND6_KEY 22
-#define COMP_DISPLAY_OPTION_RUN_COMMAND7_KEY 23
-#define COMP_DISPLAY_OPTION_RUN_COMMAND8_KEY 24
-#define COMP_DISPLAY_OPTION_RUN_COMMAND9_KEY 25
-#define COMP_DISPLAY_OPTION_RUN_COMMAND10_KEY 26
-#define COMP_DISPLAY_OPTION_RUN_COMMAND11_KEY 27
-#define COMP_DISPLAY_OPTION_SLOW_ANIMATIONS_KEY 28
-#define COMP_DISPLAY_OPTION_RAISE_WINDOW_KEY 29
-#define COMP_DISPLAY_OPTION_RAISE_WINDOW_BUTTON 30
-#define COMP_DISPLAY_OPTION_LOWER_WINDOW_KEY 31
-#define COMP_DISPLAY_OPTION_LOWER_WINDOW_BUTTON 32
-#define COMP_DISPLAY_OPTION_UNMAXIMIZE_WINDOW_KEY 33
-#define COMP_DISPLAY_OPTION_MINIMIZE_WINDOW_KEY 34
-#define COMP_DISPLAY_OPTION_MINIMIZE_WINDOW_BUTTON 35
-#define COMP_DISPLAY_OPTION_MAXIMIZE_WINDOW_KEY 36
-#define COMP_DISPLAY_OPTION_MAXIMIZE_WINDOW_HORZ_KEY 37
-#define COMP_DISPLAY_OPTION_MAXIMIZE_WINDOW_VERT_KEY 38
-#define COMP_DISPLAY_OPTION_OPACITY_INCREASE_BUTTON 39
-#define COMP_DISPLAY_OPTION_OPACITY_DECREASE_BUTTON 40
-#define COMP_DISPLAY_OPTION_SCREENSHOT 41
-#define COMP_DISPLAY_OPTION_RUN_SCREENSHOT_KEY 42
-#define COMP_DISPLAY_OPTION_WINDOW_SCREENSHOT 43
-#define COMP_DISPLAY_OPTION_RUN_WINDOW_SCREENSHOT_KEY 44
-#define COMP_DISPLAY_OPTION_WINDOW_MENU_BUTTON 45
-#define COMP_DISPLAY_OPTION_WINDOW_MENU_KEY 46
-#define COMP_DISPLAY_OPTION_SHOW_DESKTOP_KEY 47
-#define COMP_DISPLAY_OPTION_SHOW_DESKTOP_EDGE 48
-#define COMP_DISPLAY_OPTION_TOGGLE_WINDOW_MAXIMIZED_KEY 49
-#define COMP_DISPLAY_OPTION_TOGGLE_WINDOW_MAXIMIZED_BUTTON 50
-#define COMP_DISPLAY_OPTION_TOGGLE_WINDOW_MAXIMIZED_HORZ_KEY 51
-#define COMP_DISPLAY_OPTION_TOGGLE_WINDOW_MAXIMIZED_VERT_KEY 52
-#define COMP_DISPLAY_OPTION_TOGGLE_WINDOW_SHADED_KEY 53
-#define COMP_DISPLAY_OPTION_TERMINAL 54
-#define COMP_DISPLAY_OPTION_RUN_TERMINAL_KEY 55
-#define COMP_DISPLAY_OPTION_NUM 56
-
typedef void (*HandleEventProc) (CompDisplay *display,
XEvent *event);
@@ -1166,8 +1108,6 @@ struct _CompDisplay {
CompModEntryHandle lastModEntryHandle;
CompTimeoutHandle setModEntriesHandle;
- CompOption opt[COMP_DISPLAY_OPTION_NUM];
-
CompTimeoutHandle autoRaiseHandle;
Window autoRaiseWindow;
@@ -1199,17 +1139,6 @@ allocateDisplayPrivateIndex (void);
void
freeDisplayPrivateIndex (int index);
-CompOption *
-getDisplayOptions (CompPlugin *plugin,
- CompDisplay *display,
- int *count);
-
-Bool
-setDisplayOption (CompPlugin *plugin,
- CompDisplay *display,
- const char *name,
- const CompOptionValue *value);
-
void
compLogMessage (CompDisplay *d,
const char *componentName,
@@ -3535,9 +3464,6 @@ typedef struct _CompMetadataObjectInfo {
int nOptionInfo;
} CompMetadataObjectInfo;
-extern const CompMetadataOptionInfo
-coreDisplayOptionInfo[COMP_DISPLAY_OPTION_NUM];
-
Bool
compInitPluginMetadataFromInfo (CompMetadata *metadata,
const char *plugin,
diff --git a/src/display.c b/src/display.c
index cda4c7ab..69bd8261 100644
--- a/src/display.c
+++ b/src/display.c
@@ -480,341 +480,6 @@ removeScreen (CompDisplay *display,
return TRUE;
}
-static Bool
-unmaximize (CompDisplay *d,
- CompAction *action,
- CompActionState state,
- CompOption *option,
- int nOption)
-{
- CompWindow *w;
- Window xid;
-
- xid = getIntOptionNamed (option, nOption, "window", 0);
-
- w = findTopLevelWindowAtDisplay (d, xid);
- if (w)
- maximizeWindow (w, 0);
-
- return TRUE;
-}
-
-static Bool
-minimize (CompDisplay *d,
- CompAction *action,
- CompActionState state,
- CompOption *option,
- int nOption)
-{
- CompWindow *w;
- Window xid;
-
- xid = getIntOptionNamed (option, nOption, "window", 0);
-
- w = findTopLevelWindowAtDisplay (d, xid);
- if (w)
- minimizeWindow (w);
-
- return TRUE;
-}
-
-static Bool
-maximize (CompDisplay *d,
- CompAction *action,
- CompActionState state,
- CompOption *option,
- int nOption)
-{
- CompWindow *w;
- Window xid;
-
- xid = getIntOptionNamed (option, nOption, "window", 0);
-
- w = findTopLevelWindowAtDisplay (d, xid);
- if (w)
- maximizeWindow (w, MAXIMIZE_STATE);
-
- return TRUE;
-}
-
-static Bool
-maximizeHorizontally (CompDisplay *d,
- CompAction *action,
- CompActionState state,
- CompOption *option,
- int nOption)
-{
- CompWindow *w;
- Window xid;
-
- xid = getIntOptionNamed (option, nOption, "window", 0);
-
- w = findTopLevelWindowAtDisplay (d, xid);
- if (w)
- maximizeWindow (w, w->state | CompWindowStateMaximizedHorzMask);
-
- return TRUE;
-}
-
-static Bool
-maximizeVertically (CompDisplay *d,
- CompAction *action,
- CompActionState state,
- CompOption *option,
- int nOption)
-{
- CompWindow *w;
- Window xid;
-
- xid = getIntOptionNamed (option, nOption, "window", 0);
-
- w = findTopLevelWindowAtDisplay (d, xid);
- if (w)
- maximizeWindow (w, w->state | CompWindowStateMaximizedVertMask);
-
- return TRUE;
-}
-
-static void
-changeWindowOpacity (CompWindow *w,
- int direction)
-{
- CompScreen *s = w->screen;
- int step, opacity;
-
- if (w->attrib.override_redirect)
- return;
-
- if (w->type & CompWindowTypeDesktopMask)
- return;
-
- step = (0xff * s->data.opacityStep) / 100;
-
- w->opacityFactor = w->opacityFactor + step * direction;
- if (w->opacityFactor > 0xff)
- {
- w->opacityFactor = 0xff;
- }
- else if (w->opacityFactor < step)
- {
- w->opacityFactor = step;
- }
-
- opacity = (w->opacity * w->opacityFactor) / 0xff;
- if (opacity != w->paint.opacity)
- {
- w->paint.opacity = opacity;
- addWindowDamage (w);
- }
-}
-
-static Bool
-increaseOpacity (CompDisplay *d,
- CompAction *action,
- CompActionState state,
- CompOption *option,
- int nOption)
-{
- CompWindow *w;
- Window xid;
-
- xid = getIntOptionNamed (option, nOption, "window", 0);
-
- w = findTopLevelWindowAtDisplay (d, xid);
- if (w)
- changeWindowOpacity (w, 1);
-
- return TRUE;
-}
-
-static Bool
-decreaseOpacity (CompDisplay *d,
- CompAction *action,
- CompActionState state,
- CompOption *option,
- int nOption)
-{
- CompWindow *w;
- Window xid;
-
- xid = getIntOptionNamed (option, nOption, "window", 0);
-
- w = findTopLevelWindowAtDisplay (d, xid);
- if (w)
- changeWindowOpacity (w, -1);
-
- return TRUE;
-}
-
-static Bool
-toggleMaximized (CompDisplay *d,
- CompAction *action,
- CompActionState state,
- CompOption *option,
- int nOption)
-{
- CompWindow *w;
- Window xid;
-
- xid = getIntOptionNamed (option, nOption, "window", 0);
-
- w = findTopLevelWindowAtDisplay (d, xid);
- if (w)
- {
- if ((w->state & MAXIMIZE_STATE) == MAXIMIZE_STATE)
- maximizeWindow (w, 0);
- else
- maximizeWindow (w, MAXIMIZE_STATE);
- }
-
- return TRUE;
-}
-
-static Bool
-toggleMaximizedHorizontally (CompDisplay *d,
- CompAction *action,
- CompActionState state,
- CompOption *option,
- int nOption)
-{
- CompWindow *w;
- Window xid;
-
- xid = getIntOptionNamed (option, nOption, "window", 0);
-
- w = findTopLevelWindowAtDisplay (d, xid);
- if (w)
- maximizeWindow (w, w->state ^ CompWindowStateMaximizedHorzMask);
-
- return TRUE;
-}
-
-static Bool
-toggleMaximizedVertically (CompDisplay *d,
- CompAction *action,
- CompActionState state,
- CompOption *option,
- int nOption)
-{
- CompWindow *w;
- Window xid;
-
- xid = getIntOptionNamed (option, nOption, "window", 0);
-
- w = findTopLevelWindowAtDisplay (d, xid);
- if (w)
- maximizeWindow (w, w->state ^ CompWindowStateMaximizedVertMask);
-
- return TRUE;
-}
-
-static Bool
-shade (CompDisplay *d,
- CompAction *action,
- CompActionState state,
- CompOption *option,
- int nOption)
-{
- CompWindow *w;
- Window xid;
-
- xid = getIntOptionNamed (option, nOption, "window", 0);
-
- w = findTopLevelWindowAtDisplay (d, xid);
- if (w && (w->actions & CompWindowActionShadeMask))
- {
- w->state ^= CompWindowStateShadedMask;
- updateWindowAttributes (w, CompStackingUpdateModeNone);
- }
-
- return TRUE;
-}
-
-const CompMetadataOptionInfo coreDisplayOptionInfo[COMP_DISPLAY_OPTION_NUM] = {
- { "close_window_key", "key", 0, 0, 0 },
- { "close_window_button", "button", 0, 0, 0 },
- { "main_menu_key", "key", 0, 0, 0 },
- { "run_key", "key", 0, 0, 0 },
- { "command0", "string", 0, 0, 0 },
- { "command1", "string", 0, 0, 0 },
- { "command2", "string", 0, 0, 0 },
- { "command3", "string", 0, 0, 0 },
- { "command4", "string", 0, 0, 0 },
- { "command5", "string", 0, 0, 0 },
- { "command6", "string", 0, 0, 0 },
- { "command7", "string", 0, 0, 0 },
- { "command8", "string", 0, 0, 0 },
- { "command9", "string", 0, 0, 0 },
- { "command10", "string", 0, 0, 0 },
- { "command11", "string", 0, 0, 0 },
- { "run_command0_key", "key", 0, 0, 0 },
- { "run_command1_key", "key", 0, 0, 0 },
- { "run_command2_key", "key", 0, 0, 0 },
- { "run_command3_key", "key", 0, 0, 0 },
- { "run_command4_key", "key", 0, 0, 0 },
- { "run_command5_key", "key", 0, 0, 0 },
- { "run_command6_key", "key", 0, 0, 0 },
- { "run_command7_key", "key", 0, 0, 0 },
- { "run_command8_key", "key", 0, 0, 0 },
- { "run_command9_key", "key", 0, 0, 0 },
- { "run_command10_key", "key", 0, 0, 0 },
- { "run_command11_key", "key", 0, 0, 0 },
- { "slow_animations_key", "key", 0, 0, 0 },
- { "raise_window_key", "key", 0, 0, 0 },
- { "raise_window_button", "button", 0, 0, 0 },
- { "lower_window_key", "key", 0, 0, 0 },
- { "lower_window_button", "button", 0, 0, 0 },
- { "unmaximize_window_key", "key", 0, unmaximize, 0 },
- { "minimize_window_key", "key", 0, minimize, 0 },
- { "minimize_window_button", "button", 0, minimize, 0 },
- { "maximize_window_key", "key", 0, maximize, 0 },
- { "maximize_window_horizontally_key", "key", 0, maximizeHorizontally, 0 },
- { "maximize_window_vertically_key", "key", 0, maximizeVertically, 0 },
- { "opacity_increase_button", "button", 0, increaseOpacity, 0 },
- { "opacity_decrease_button", "button", 0, decreaseOpacity, 0 },
- { "command_screenshot", "string", 0, 0, 0 },
- { "run_command_screenshot_key", "key", 0, 0, 0 },
- { "command_window_screenshot", "string", 0, 0, 0 },
- { "run_command_window_screenshot_key", "key", 0, 0, 0 },
- { "window_menu_button", "button", 0, 0, 0 },
- { "window_menu_key", "key", 0, 0, 0 },
- { "show_desktop_key", "key", 0, 0, 0 },
- { "show_desktop_edge", "edge", 0, 0, 0 },
- { "toggle_window_maximized_key", "key", 0, toggleMaximized, 0 },
- { "toggle_window_maximized_button", "button", 0, toggleMaximized, 0 },
- { "toggle_window_maximized_horizontally_key", "key", 0,
- toggleMaximizedHorizontally, 0 },
- { "toggle_window_maximized_vertically_key", "key", 0,
- toggleMaximizedVertically, 0 },
- { "toggle_window_shaded_key", "key", 0, shade, 0 },
- { "command_terminal", "string", 0, 0, 0 },
- { "run_command_terminal_key", "key", 0, 0, 0 }
-};
-
-CompOption *
-getDisplayOptions (CompPlugin *plugin,
- CompDisplay *display,
- int *count)
-{
- *count = N_ELEMENTS (display->opt);
- return display->opt;
-}
-
-Bool
-setDisplayOption (CompPlugin *plugin,
- CompDisplay *display,
- const char *name,
- const CompOptionValue *value)
-{
- CompOption *o;
-
- o = compFindOption (display->opt, N_ELEMENTS (display->opt), name, NULL);
- if (!o)
- return FALSE;
-
- return compSetDisplayOption (display, o, value);
-}
-
static void
addTimeout (CompTimeout *timeout)
{
@@ -1842,15 +1507,6 @@ addScreenActions (CompScreen *s)
CompPlugin *p;
int i;
- for (i = 0; i < COMP_DISPLAY_OPTION_NUM; i++)
- {
- if (!isActionOption (&s->display->opt[i]))
- continue;
-
- if (s->display->opt[i].value.action.state & CompActionStateAutoGrab)
- addScreenAction (s, &s->display->opt[i].value.action);
- }
-
for (p = getPlugins (); p; p = p->next)
{
CompOption *option;
@@ -2085,13 +1741,6 @@ addDisplayOld (CompCore *c,
d->connection = XGetXCBConnection (dpy);
- if (!compInitDisplayOptionsFromMetadata (d,
- &coreMetadata,
- coreDisplayOptionInfo,
- d->opt,
- COMP_DISPLAY_OPTION_NUM))
- return FALSE;
-
#ifdef DEBUG
XSynchronize (dpy, TRUE);
#endif
@@ -2497,8 +2146,6 @@ removeDisplayOld (CompCore *c,
free (d->hostName);
- compFiniDisplayOptions (d, d->opt, COMP_DISPLAY_OPTION_NUM);
-
if (d->screenInfo)
XFree (d->screenInfo);
diff --git a/src/plugin.c b/src/plugin.c
index 5c0d051d..63d3cf16 100644
--- a/src/plugin.c
+++ b/src/plugin.c
@@ -59,7 +59,7 @@ coreGetObjectOptions (CompPlugin *plugin,
{
static GetPluginObjectOptionsProc dispTab[] = {
(GetPluginObjectOptionsProc) 0, /* GetCoreOptions */
- (GetPluginObjectOptionsProc) getDisplayOptions,
+ (GetPluginObjectOptionsProc) 0, /* GetDisplayOptions */
(GetPluginObjectOptionsProc) 0 /* GetScreenOptions */
};
@@ -75,7 +75,7 @@ coreSetObjectOption (CompPlugin *plugin,
{
static SetPluginObjectOptionProc dispTab[] = {
(SetPluginObjectOptionProc) 0, /* SetCoreOption */
- (SetPluginObjectOptionProc) setDisplayOption,
+ (SetPluginObjectOptionProc) 0, /* SetDisplayOption */
(SetPluginObjectOptionProc) 0 /* SetScreenOption */
};