summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcornelius <cornelius@d7aaf104-2d23-0410-ae22-9d23157bf5a3>2007-02-13 04:11:35 +0000
committercornelius <cornelius@d7aaf104-2d23-0410-ae22-9d23157bf5a3>2007-02-13 04:11:35 +0000
commit30bb4f323f3a0029bf46db3a36b1c23ed9dc1bad (patch)
tree17470c02f52dc6731199804889161c8623df28ee
parent239e667ffc0f8da6b41e85c7be5c66a042336f6f (diff)
downloadmarex-dev-30bb4f323f3a0029bf46db3a36b1c23ed9dc1bad.tar.gz
marex-dev-30bb4f323f3a0029bf46db3a36b1c23ed9dc1bad.tar.bz2
animation: simple zoom curvature setting for now
git-svn-id: file:///beryl/trunk@4011 d7aaf104-2d23-0410-ae22-9d23157bf5a3
-rw-r--r--beryl-plugins/src/animation.c67
1 files changed, 48 insertions, 19 deletions
diff --git a/beryl-plugins/src/animation.c b/beryl-plugins/src/animation.c
index 425af18..b7c1500 100644
--- a/beryl-plugins/src/animation.c
+++ b/beryl-plugins/src/animation.c
@@ -346,6 +346,11 @@ modelInitObjects(Model * model, int x, int y, int width, int height);
#define ANIM_SIDEKICK_NUM_ROTATIONS_MAX 5.0
#define ANIM_SIDEKICK_NUM_ROTATIONS_PRECISION 0.01
+#define ANIM_ZOOM_CURVATURE_DEFAULT 0.5
+#define ANIM_ZOOM_CURVATURE_MIN 0
+#define ANIM_ZOOM_CURVATURE_MAX 1.0
+#define ANIM_ZOOM_CURVATURE_PRECISION 0.05
+
#define ANIM_MINIMIZE_DURATION_DEFAULT 0.2
#define ANIM_MINIMIZE_DURATION_MIN 0.1
#define ANIM_MINIMIZE_DURATION_MAX 10
@@ -1159,7 +1164,6 @@ typedef enum
ANIM_SCREEN_OPTION_ROLLUP_FIXED_INTERIOR,
// Misc. settings
ANIM_SCREEN_OPTION_ALL_RANDOM,
- ANIM_SCREEN_OPTION_ZOOM_FROM_CENTER,
ANIM_SCREEN_OPTION_DISABLE_PP_FX,
ANIM_SCREEN_OPTION_TIME_STEP,
ANIM_SCREEN_OPTION_TIME_STEP_INTENSE,
@@ -1207,6 +1211,8 @@ typedef enum
ANIM_SCREEN_OPTION_MAGIC_LAMP3_WAVE_AMP_MAX,
ANIM_SCREEN_OPTION_MAGIC_LAMP3_CREATE_START_WIDTH,
ANIM_SCREEN_OPTION_SIDEKICK_NUM_ROTATIONS,
+ ANIM_SCREEN_OPTION_ZOOM_CURVATURE,
+ ANIM_SCREEN_OPTION_ZOOM_FROM_CENTER,
ANIM_SCREEN_OPTION_NUM
} AnimScreenOptions;
@@ -2354,12 +2360,13 @@ static void fxZoomModelStep(CompScreen * s, CompWindow * w, float time)
float yDiff = fabs(winCenter.y - iconCenter.y);
float xMaxSig;
float yMaxSig;
- float sigDiff = 0.25;
+ float sigDiff =
+ 0.5 * as->opt[ANIM_SCREEN_OPTION_ZOOM_CURVATURE].value.f;
if (aw->curAnimEffect == AnimEffectSidekick)
sigDiff = 0;
- if (yDiff > xDiff)
+ if (yDiff > xDiff / 1.4) // prefer y axis more for the curved motion
{
xMaxSig = DECEL_SIG_DEF_END;
yMaxSig = DECEL_SIG_DEF_END + sigDiff;
@@ -5590,6 +5597,12 @@ animSetScreenOption(CompScreen * screen, char *name, CompOptionValue * value)
return TRUE;
}
break;
+ case ANIM_SCREEN_OPTION_ZOOM_CURVATURE:
+ if (compSetFloatOption(o, value))
+ {
+ return TRUE;
+ }
+ break;
case ANIM_SCREEN_OPTION_ZOOM_FROM_CENTER:
if (compSetStringOption(o, value))
{
@@ -6317,21 +6330,6 @@ static void animScreenInitOptions(AnimScreen * as)
o->rest.f.max = ANIM_CURVED_FOLD_AMP_MAX;
o->rest.f.precision = ANIM_CURVED_FOLD_AMP_PRECISION;
- o = &as->opt[ANIM_SCREEN_OPTION_ZOOM_FROM_CENTER];
- o->name = "zoom_from_center";
- o->group = N_("Misc. Settings");
- o->subGroup = N_("");
- o->advanced = False;
- o->shortDesc = N_("Zoom from Center");
- o->longDesc =
- N_
- ("Zoom from center when playing the Zoom and Sidekick animations.");
- o->displayHints = "";
- o->type = CompOptionTypeString;
- o->value.s = strdup(zoomFromCenterOption[ANIM_ZOOM_FROM_CENTER_DEFAULT]);
- o->rest.s.string = zoomFromCenterOption;
- o->rest.s.nString = 4;
-
o = &as->opt[ANIM_SCREEN_OPTION_TIME_STEP];
o->name = "time_step";
o->group = N_("Misc. Settings");
@@ -6634,7 +6632,7 @@ static void animScreenInitOptions(AnimScreen * as)
o = &as->opt[ANIM_SCREEN_OPTION_SIDEKICK_NUM_ROTATIONS];
o->name = "sidekick_num_rotations";
- o->group = N_("Sidekick");
+ o->group = N_("Zoom/Sidekick");
o->subGroup = N_("");
o->advanced = False;
o->shortDesc = N_("Sidekick Number of Rotations");
@@ -6648,6 +6646,37 @@ static void animScreenInitOptions(AnimScreen * as)
o->rest.f.max = ANIM_SIDEKICK_NUM_ROTATIONS_MAX;
o->rest.f.precision = ANIM_SIDEKICK_NUM_ROTATIONS_PRECISION;
+ o = &as->opt[ANIM_SCREEN_OPTION_ZOOM_FROM_CENTER];
+ o->name = "zoom_from_center";
+ o->group = N_("Zoom/Sidekick");
+ o->subGroup = N_("");
+ o->advanced = False;
+ o->shortDesc = N_("Zoom from Center");
+ o->longDesc =
+ N_
+ ("Zoom from center when playing the Zoom and Sidekick animations.");
+ o->displayHints = "";
+ o->type = CompOptionTypeString;
+ o->value.s = strdup(zoomFromCenterOption[ANIM_ZOOM_FROM_CENTER_DEFAULT]);
+ o->rest.s.string = zoomFromCenterOption;
+ o->rest.s.nString = 4;
+
+ o = &as->opt[ANIM_SCREEN_OPTION_ZOOM_CURVATURE];
+ o->name = "zoom_curvature";
+ o->group = N_("Zoom/Sidekick");
+ o->subGroup = N_("");
+ o->advanced = False;
+ o->shortDesc = N_("Zoom Curvature");
+ o->longDesc =
+ N_
+ ("The amount of curvedness of the zoom motion.");
+ o->displayHints = "";
+ o->type = CompOptionTypeFloat;
+ o->value.f = ANIM_ZOOM_CURVATURE_DEFAULT;
+ o->rest.f.min = ANIM_ZOOM_CURVATURE_MIN;
+ o->rest.f.max = ANIM_ZOOM_CURVATURE_MAX;
+ o->rest.f.precision = ANIM_ZOOM_CURVATURE_PRECISION;
+
// Minimize
o = &as->opt[ANIM_SCREEN_OPTION_MINIMIZE_EFFECT];