45
* The slide positions are derived from FVMW sources, file fvmm/move_resize.c,
46
* to there added by Greg J. Badros, gjb@cs.washington.edu
49
static float posCFV[] = {.005,.01,.02,.03,.08,.18,.3,.45,.65,.80,.88,.93,.95,.97,.99,1.0};
50
/* 0 - ypos, 1 - height, 2 - xpos, 3 - width */
51
static gint posIV[4][16];
53
void generate_animation_positions(struct tilda_window_ *tw)
58
printf("generate_animation_positions(): %d\n",cfg_getint (tw->tc, "animation_orientation"));
61
gint last_pos_x = cfg_getint (tw->tc, "x_pos");
62
gint last_pos_y = cfg_getint (tw->tc, "y_pos");
63
gint last_width = cfg_getint (tw->tc, "max_width");
64
gint last_height = cfg_getint (tw->tc, "max_height");
68
switch (cfg_getint (tw->tc, "animation_orientation"))
70
case 3: /* right->left RIGHT */
71
/*posIV[3][i] = (gint)(posCFV[i]*last_width); */
72
/*posIV[2][i] = (gint)(last_pos_x+last_width-posIV[3][i]); */
73
posIV[3][i] = last_width;
74
posIV[2][i] = (gint)(last_pos_x+last_width-posCFV[i]*last_width);
75
posIV[1][i] = last_height;
76
posIV[0][i] = last_pos_y;
78
case 2: /* left->right LEFT */
79
/*posIV[3][i] = (gint)(posCFV[i]*last_width); */
80
/*posIV[2][i] = last_pos_x; */
81
posIV[3][i] = last_width;
82
posIV[2][i] = (gint)(last_pos_x-last_width+posCFV[i]*last_width);
83
posIV[1][i] = last_height;
84
posIV[0][i] = last_pos_y;
86
case 1: /* bottom->top BOTTOM */
87
posIV[3][i] = last_width;
88
posIV[2][i] = last_pos_x;
89
posIV[1][i] = (gint)(posCFV[i]*last_height);
90
posIV[0][i] = (gint)(last_pos_y+last_height-posIV[1][i]);
92
case 0: /* top->bottom TOP */
94
posIV[3][i] = last_width;
95
posIV[2][i] = last_pos_x;
96
posIV[1][i] = (gint)(posCFV[i]*last_height);
97
posIV[0][i] = last_pos_y;
43
102
void pull (struct tilda_window_ *tw)
46
110
static gint pos=0;
50
114
gdk_threads_enter();
54
118
if (gtk_window_is_active ((GtkWindow *) tw->window) == FALSE)
55
119
gtk_window_present ((GtkWindow *) tw->window);
57
121
gtk_widget_show ((GtkWidget *) tw->window);
59
if ((strcasecmp (tw->tc->s_pinned, "true")) == 0)
123
if (cfg_getbool (tw->tc, "pinned"))
60
124
gtk_window_stick (GTK_WINDOW (tw->window));
62
if ((strcasecmp (tw->tc->s_above, "true")) == 0)
126
if (cfg_getbool (tw->tc, "above"))
63
127
gtk_window_set_keep_above (GTK_WINDOW (tw->window), TRUE);
65
gtk_window_move ((GtkWindow *) tw->window, tw->tc->x_pos, tw->tc->y_pos);
66
gtk_window_resize ((GtkWindow *) tw->window, tw->tc->max_width, tw->tc->max_height);
129
if (cfg_getbool (tw->tc, ("animation")))
136
gtk_window_move ((GtkWindow *) tw->window, posIV[2][i], posIV[0][i]);
137
gtk_window_resize ((GtkWindow *) tw->window, posIV[3][i], posIV[1][i]);
141
usleep (cfg_getint (tw->tc, "slide_sleep_usec"));
146
gtk_window_move ((GtkWindow *) tw->window, cfg_getint (tw->tc, "x_pos"), cfg_getint (tw->tc, "y_pos"));
147
gtk_window_resize ((GtkWindow *) tw->window, cfg_getint (tw->tc, "max_width"), cfg_getint (tw->tc, "max_height"));
68
154
gdk_window_focus (tw->window->window, gtk_get_current_event_time ());
71
157
gdk_threads_leave();
75
161
gdk_threads_enter();
79
gtk_window_resize ((GtkWindow *) tw->window, tw->tc->min_width, tw->tc->min_height);
165
if (cfg_getbool (tw->tc, ("animation")))
168
for (i=15; i>=0; i--)
171
gtk_window_move ((GtkWindow *) tw->window, posIV[2][i], posIV[0][i]);
172
gtk_window_resize ((GtkWindow *) tw->window, posIV[3][i], posIV[1][i]);
176
usleep (cfg_getint (tw->tc, "slide_sleep_usec"));
181
gtk_window_resize ((GtkWindow *) tw->window, cfg_getint (tw->tc, "min_width"), cfg_getint (tw->tc, "min_height"));
80
188
gtk_widget_hide ((GtkWidget *) tw->window);