diff options
author | David Reveman <davidr@novell.com> | 2007-04-06 14:51:18 -0400 |
---|---|---|
committer | David Reveman <davidr@novell.com> | 2007-04-06 14:51:18 -0400 |
commit | 0e1439a59486750f514b6fd7c2c941778503a9e8 (patch) | |
tree | 5068b15c4af36526bf20f3d2fb90eeac20510a93 /plugins | |
parent | 8175c02550d491c0339192b251253ec3b8b0f69a (diff) |
Reduce code by using compSetOption.
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/annotate.c | 11 | ||||
-rw-r--r-- | plugins/decoration.c | 21 | ||||
-rw-r--r-- | plugins/fade.c | 8 | ||||
-rw-r--r-- | plugins/minimize.c | 7 | ||||
-rw-r--r-- | plugins/move.c | 9 | ||||
-rw-r--r-- | plugins/place.c | 12 | ||||
-rw-r--r-- | plugins/scale.c | 9 | ||||
-rw-r--r-- | plugins/screenshot.c | 9 | ||||
-rw-r--r-- | plugins/switcher.c | 14 | ||||
-rw-r--r-- | plugins/wobbly.c | 25 | ||||
-rw-r--r-- | plugins/zoom.c | 5 |
11 files changed, 25 insertions, 105 deletions
diff --git a/plugins/annotate.c b/plugins/annotate.c index 63e2968e..4a29a07a 100644 --- a/plugins/annotate.c +++ b/plugins/annotate.c @@ -874,16 +874,9 @@ annoSetDisplayOption (CompPlugin *plugin, if (setDisplayAction (display, o, value)) return TRUE; break; - case ANNO_DISPLAY_OPTION_FILL_COLOR: - case ANNO_DISPLAY_OPTION_STROKE_COLOR: - if (compSetColorOption (o, value)) - return TRUE; - break; - case ANNO_DISPLAY_OPTION_LINE_WIDTH: - case ANNO_DISPLAY_OPTION_STROKE_WIDTH: - if (compSetFloatOption (o, value)) - return TRUE; default: + if (compSetOption (o, value)) + return TRUE; break; } diff --git a/plugins/decoration.c b/plugins/decoration.c index da810d03..5870eb2f 100644 --- a/plugins/decoration.c +++ b/plugins/decoration.c @@ -1078,20 +1078,6 @@ decorSetDisplayOption (CompPlugin *plugin, return FALSE; switch (index) { - case DECOR_DISPLAY_OPTION_SHADOW_RADIUS: - case DECOR_DISPLAY_OPTION_SHADOW_OPACITY: - if (compSetFloatOption (o, value)) - return TRUE; - break; - case DECOR_DISPLAY_OPTION_SHADOW_COLOR: - if (compSetColorOption (o, value)) - return TRUE; - break; - case DECOR_DISPLAY_OPTION_SHADOW_OFFSET_X: - case DECOR_DISPLAY_OPTION_SHADOW_OFFSET_Y: - if (compSetIntOption (o, value)) - return TRUE; - break; case DECOR_DISPLAY_OPTION_COMMAND: if (compSetStringOption (o, value)) { @@ -1115,10 +1101,6 @@ decorSetDisplayOption (CompPlugin *plugin, return TRUE; } break; - case DECOR_DISPLAY_OPTION_MIPMAP: - if (compSetBoolOption (o, value)) - return TRUE; - break; case DECOR_DISPLAY_OPTION_DECOR_MATCH: case DECOR_DISPLAY_OPTION_SHADOW_MATCH: if (compSetMatchOption (o, value)) @@ -1130,7 +1112,10 @@ decorSetDisplayOption (CompPlugin *plugin, for (w = s->windows; w; w = w->next) decorWindowUpdate (w, TRUE); } + break; default: + if (compSetOption (o, value)) + return TRUE; break; } diff --git a/plugins/fade.c b/plugins/fade.c index 20c26ca2..55e8cbe3 100644 --- a/plugins/fade.c +++ b/plugins/fade.c @@ -163,13 +163,9 @@ fadeSetScreenOption (CompPlugin *plugin, return TRUE; } break; - case FADE_SCREEN_OPTION_VISUAL_BELL: - case FADE_SCREEN_OPTION_FULLSCREEN_VISUAL_BELL: - case FADE_SCREEN_OPTION_MINIMIZE_OPEN_CLOSE: - if (compSetBoolOption (o, value)) - return TRUE; - break; default: + if (compSetOption (o, value)) + return TRUE; break; } diff --git a/plugins/minimize.c b/plugins/minimize.c index 9fa91840..be86d9ba 100644 --- a/plugins/minimize.c +++ b/plugins/minimize.c @@ -163,10 +163,6 @@ minSetScreenOption (CompPlugin *plugin, return TRUE; } break; - case MIN_SCREEN_OPTION_WINDOW_MATCH: - if (compSetMatchOption (o, value)) - return TRUE; - break; case MIN_SCREEN_OPTION_SHADE_RESISTANCE: if (compSetIntOption (o, value)) { @@ -177,7 +173,10 @@ minSetScreenOption (CompPlugin *plugin, return TRUE; } + break; default: + if (compSetOption (o, value)) + return TRUE; break; } diff --git a/plugins/move.c b/plugins/move.c index 7c0b822d..4ba589c0 100644 --- a/plugins/move.c +++ b/plugins/move.c @@ -808,14 +808,9 @@ moveSetDisplayOption (CompPlugin *plugin, return TRUE; } break; - case MOVE_DISPLAY_OPTION_CONSTRAIN_Y: - if (compSetBoolOption (o, value)) - return TRUE; - break; - case MOVE_DISPLAY_OPTION_SNAPOFF_MAXIMIZED: - if (compSetBoolOption (o, value)) - return TRUE; default: + if (compSetOption (o, value)) + return TRUE; break; } diff --git a/plugins/place.c b/plugins/place.c index c44d90c1..98b7745d 100644 --- a/plugins/place.c +++ b/plugins/place.c @@ -200,10 +200,6 @@ placeSetScreenOption (CompPlugin *plugin, return FALSE; switch (index) { - case PLACE_SCREEN_OPTION_WORKAROUND: - if (compSetBoolOption (o, value)) - return TRUE; - break; case PLACE_SCREEN_OPTION_MODE: if (compSetStringOption (o, value)) { @@ -223,13 +219,9 @@ placeSetScreenOption (CompPlugin *plugin, return TRUE; } break; - case PLACE_SCREEN_OPTION_POSITION_X_VALUES: - case PLACE_SCREEN_OPTION_POSITION_Y_VALUES: - case PLACE_SCREEN_OPTION_VIEWPORT_X_VALUES: - case PLACE_SCREEN_OPTION_VIEWPORT_Y_VALUES: - if (compSetOptionList (o, value)) - return TRUE; default: + if (compSetOption (o, value)) + return TRUE; break; } diff --git a/plugins/scale.c b/plugins/scale.c index 378c416d..16061891 100644 --- a/plugins/scale.c +++ b/plugins/scale.c @@ -274,10 +274,6 @@ scaleSetScreenOption (CompPlugin *plugin, return TRUE; } break; - case SCALE_SCREEN_OPTION_WINDOW_MATCH: - if (compSetMatchOption (o, value)) - return TRUE; - break; case SCALE_SCREEN_OPTION_DARKEN_BACK: if (compSetBoolOption (o, value)) { @@ -307,10 +303,9 @@ scaleSetScreenOption (CompPlugin *plugin, } } break; - case SCALE_SCREEN_OPTION_HOVER_TIME: - if (compSetIntOption (o, value)) - return TRUE; default: + if (compSetOption (o, value)) + return TRUE; break; } diff --git a/plugins/screenshot.c b/plugins/screenshot.c index c2cdd59c..2e06d544 100644 --- a/plugins/screenshot.c +++ b/plugins/screenshot.c @@ -443,14 +443,9 @@ shotSetDisplayOption (CompPlugin *plugin, if (setDisplayAction (display, o, value)) return TRUE; break; - case SHOT_DISPLAY_OPTION_DIR: - if (compSetStringOption (o, value)) - return TRUE; - break; - case SHOT_DISPLAY_OPTION_LAUNCH_APP: - if (compSetStringOption (o, value)) - return TRUE; default: + if (compSetOption (o, value)) + return TRUE; break; } diff --git a/plugins/switcher.c b/plugins/switcher.c index 66caa5a7..0fee6dd7 100644 --- a/plugins/switcher.c +++ b/plugins/switcher.c @@ -274,17 +274,6 @@ switchSetScreenOption (CompPlugin *plugin, return TRUE; } break; - case SWITCH_SCREEN_OPTION_WINDOW_MATCH: - if (compSetMatchOption (o, value)) - return TRUE; - break; - case SWITCH_SCREEN_OPTION_MIPMAP: - case SWITCH_SCREEN_OPTION_ICON: - case SWITCH_SCREEN_OPTION_MINIMIZED: - case SWITCH_SCREEN_OPTION_AUTO_ROTATE: - if (compSetBoolOption (o, value)) - return TRUE; - break; case SWITCH_SCREEN_OPTION_SATURATION: if (compSetIntOption (o, value)) { @@ -329,7 +318,10 @@ switchSetScreenOption (CompPlugin *plugin, return TRUE; } + break; default: + if (compSetOption (o, value)) + return TRUE; break; } diff --git a/plugins/wobbly.c b/plugins/wobbly.c index 5bf669d1..ef7fe9ad 100644 --- a/plugins/wobbly.c +++ b/plugins/wobbly.c @@ -276,19 +276,6 @@ wobblySetScreenOption (CompPlugin *plugin, return FALSE; switch (index) { - case WOBBLY_SCREEN_OPTION_FRICTION: - case WOBBLY_SCREEN_OPTION_SPRING_K: - if (compSetFloatOption (o, value)) - return TRUE; - break; - case WOBBLY_SCREEN_OPTION_GRID_RESOLUTION: - if (compSetIntOption (o, value)) - return TRUE; - break; - case WOBBLY_SCREEN_OPTION_MIN_GRID_SIZE: - if (compSetIntOption (o, value)) - return TRUE; - break; case WOBBLY_SCREEN_OPTION_MAP_EFFECT: if (compSetStringOption (o, value)) { @@ -319,17 +306,9 @@ wobblySetScreenOption (CompPlugin *plugin, } } break; - case WOBBLY_SCREEN_OPTION_MAP_WINDOW_MATCH: - case WOBBLY_SCREEN_OPTION_FOCUS_WINDOW_MATCH: - case WOBBLY_SCREEN_OPTION_MOVE_WINDOW_MATCH: - case WOBBLY_SCREEN_OPTION_GRAB_WINDOW_MATCH: - if (compSetMatchOption (o, value)) - return TRUE; - break; - case WOBBLY_SCREEN_OPTION_MAXIMIZE_EFFECT: - if (compSetBoolOption (o, value)) - return TRUE; default: + if (compSetOption (o, value)) + return TRUE; break; } diff --git a/plugins/zoom.c b/plugins/zoom.c index ce344035..9bb55a88 100644 --- a/plugins/zoom.c +++ b/plugins/zoom.c @@ -204,10 +204,9 @@ zoomSetScreenOption (CompPlugin *plugin, return TRUE; } break; - case ZOOM_SCREEN_OPTION_FILTER_LINEAR: - if (compSetBoolOption (o, value)) - return TRUE; default: + if (compSetOption (o, value)) + return TRUE; break; } |