Enlightenment CVS committal
Author : raster
Project : e17
Module : apps/entice
Dir : e17/apps/entice/src/bin
Modified Files:
buttons.c buttons.h entice.h event.c event.h fade.c fade.h
globals.h handler.c handler.h image.c image.h list.c list.h
main.c misc.c misc.h panel.c panel.h thumb.c
Log Message:
to ecore in SPLIT :)
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/entice/src/bin/buttons.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -3 -r1.5 -r1.6
--- buttons.c 16 Mar 2003 07:57:26 -0000 1.5
+++ buttons.c 9 Aug 2003 00:50:38 -0000 1.6
@@ -175,31 +175,36 @@
e_handle_resize();
}
-void
-e_slide_buttons_in(int v, void *data)
+int
+e_slide_buttons(void * data)
{
- /* int i; */
- static double start = 0.0;
- double duration = 0.5;
- double val;
- double px;
- int *force;
-
- force = (int *)data;
-
- if(buttons_active == active_force_out && !(force && *force))
- return;
-
- if(force && *force)
- buttons_active = active_force_in;
+ static double start;
+ double duration = 1.0; // soon-to-be-configurable time taken to slide
+ double val = 0.0;
+ double delay = 0.05; // soon-to-be-configurable time between frames
+ static enum active_state action;
+ static Ecore_Timer *timer = NULL;
+ int px;
+
+
+ if (data) { // not called by timer
+ if (!timer) { // we are starting afresh
+ start = get_time();
+ } else { // there is a slide already going on
+ start = 2*get_time() - duration - start;
+ ecore_timer_del(timer);
+ }
+ timer = ecore_timer_add(delay, e_slide_buttons, NULL);
+ action = *(enum active_state *)data;
+ buttons_active = action;
+ return 1;
+ } else
+ val = (get_time() - start) / duration;
+ if (val > 1.0) val = 1.0;
+ if (action == active_in || action == active_force_in)
+ px = win_w - (288 * sin(val * 0.5 * 3.141592654));
else
- buttons_active = active_in;
-
- if (v == 0)
- start = get_time();
- val = (get_time() - start) / duration;
-
- px = win_w - 288 - ((288 * sin(val * 0.5 * 3.141592654)) - 288);
+ px = win_w - (288 * sin((1.0 - val) * 0.5 * 3.141592654));
evas_object_move(o_bt_prev, px + 0, 0);
evas_object_move(o_bt_next, px + 32, 0);
@@ -211,55 +216,23 @@
evas_object_move(o_bt_delete, px + 224, 0);
evas_object_move(o_bt_close, px + 256, 0);
- if (val < 1.0)
- ecore_add_event_timer("e_slide_buttons()", 0.05, e_slide_buttons_in,
- v + 1, force);
+ if (val < 0.99) // keep going
+ return 1;
+ else { // stick a fork in us, we're done
+ timer = NULL;
+ return 0;
+ }
}
void
-e_slide_buttons_out(int v, void *data)
+show_buttons(void *data, Evas * e, Evas_Object * obj, void *event_info)
{
- /* int i; */
- static double start = 0.0;
- double duration = 0.5;
- double val;
- double px;
- int *force;
-
- force = (int *)data;
-
- if(buttons_active == active_force_in && !(force && *force))
- return;
-
- if (v == 0)
- start = get_time();
- val = (get_time() - start) / duration;
-
- px = win_w - 288 - ((288 * sin((1.0 - val) * 0.5 * 3.141592654)) - 288);
-
- evas_object_move(o_bt_prev, px + 0, 0);
- evas_object_move(o_bt_next, px + 32, 0);
- evas_object_move(o_bt_zoom_normal, px + 64, 0);
- evas_object_move(o_bt_zoom_in, px + 96, 0);
- evas_object_move(o_bt_zoom_out, px + 128, 0);
- evas_object_move(o_bt_expand, px + 160, 0);
- evas_object_move(o_bt_full, px + 192, 0);
- evas_object_move(o_bt_delete, px + 224, 0);
- evas_object_move(o_bt_close, px + 256, 0);
-
- if (val < 1.0)
- ecore_add_event_timer("e_slide_buttons()", 0.05, e_slide_buttons_out,
- v + 1, force);
- else
- if(force && *force)
- buttons_active = active_force_out;
- else
- buttons_active = active_out;
+ enum active_state command = active_in;
+ e_slide_buttons(&command);
}
-void
-show_buttons(void *data, Evas * e, Evas_Object * obj, void *event_info)
+void hide_buttons(void *data, Evas *e, Evas_Object *obj, void *event_info)
{
- if (buttons_active == active_out || buttons_active == active_force_out)
- e_slide_buttons_in(0, NULL);
+ enum active_state command = active_out;
+ e_slide_buttons(&command);
}
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/entice/src/bin/buttons.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -3 -r1.3 -r1.4
--- buttons.h 14 Feb 2003 09:55:29 -0000 1.3
+++ buttons.h 9 Aug 2003 00:50:38 -0000 1.4
@@ -51,10 +51,10 @@
void bt_zoom_out_up(void *data, Evas * e, Evas_Object * obj,
void *event_info);
-void e_slide_buttons_in(int v, void *data);
-void e_slide_buttons_out(int v, void *data);
-
+int e_slide_buttons(void *data);
void show_buttons(void *data, Evas * e, Evas_Object * obj,
+ void *event_info);
+void hide_buttons(void *data, Evas * e, Evas_Object * obj,
void *event_info);
#endif /* __BUTTONS_H__ */
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/entice/src/bin/entice.h,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -3 -r1.4 -r1.5
--- entice.h 16 Mar 2003 07:57:27 -0000 1.4
+++ entice.h 9 Aug 2003 00:50:38 -0000 1.5
@@ -12,7 +12,11 @@
#include <Evas.h>
#include <Ecore.h>
+#include <Ecore_X.h>
+#include <Ecore_Evas.h>
+#define X_DISPLAY_MISSING
#include <Imlib2.h>
+#undef X_DISPLAY_MISSING
#include <config.h>
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/entice/src/bin/event.c,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -3 -r1.14 -r1.15
--- event.c 1 Jun 2003 02:26:34 -0000 1.14
+++ event.c 9 Aug 2003 00:50:38 -0000 1.15
@@ -1,6 +1,6 @@
#include "entice.h"
-void
+int
e_idle(void *data)
{
if (need_thumbs)
@@ -74,110 +74,125 @@
e_fix_icons();
}
evas_render(evas);
+ return 1;
}
-void
-e_window_expose(Ecore_Event * ev)
+/* legacy code
+int
+e_window_damage(void* data, int ev_type, Ecore_Event * ev)
{
- Ecore_Event_Window_Expose *e;
+ Ecore_X_Event_Window_Damage *e;
- e = (Ecore_Event_Window_Expose *) ev->event;
+ e = (Ecore_X_Event_Window_Damage *) ev;
if (e->win != ewin)
- return;
+ return 1;
evas_damage_rectangle_add(evas, e->x, e->y, e->w, e->h);
+ return 1;
}
-void
-e_mouse_move(Ecore_Event * ev)
+int
+e_mouse_move(void* data, int ev_type, Ecore_Event * ev)
{
- Ecore_Event_Mouse_Move *e;
+ Ecore_X_Event_Mouse_Move *e;
- e = (Ecore_Event_Mouse_Move *) ev->event;
+ e = (Ecore_X_Event_Mouse_Move *) ev;
if (e->win != ewin)
- return;
+ return 1;
evas_event_feed_mouse_move(evas, e->x, e->y);
+ return 1;
}
-void
-e_mouse_down(Ecore_Event * ev)
+int
+e_mouse_down(void* data, int ev_type, Ecore_Event * ev)
{
- Ecore_Event_Mouse_Down *e;
+ Ecore_X_Event_Mouse_Button_Down *e;
- e = (Ecore_Event_Mouse_Down *) ev->event;
+ e = (Ecore_X_Event_Mouse_Button_Down *) ev;
if (e->win != ewin)
- return;
+ return 1;
evas_event_feed_mouse_move(evas, e->x, e->y);
evas_event_feed_mouse_down(evas, e->button);
+ return 1;
}
-void
-e_mouse_up(Ecore_Event * ev)
+int
+e_mouse_up(void* data, int ev_type, Ecore_Event * ev)
{
- Ecore_Event_Mouse_Up *e;
+ Ecore_X_Event_Mouse_Button_Up *e;
- e = (Ecore_Event_Mouse_Up *) ev->event;
+ e = (Ecore_X_Event_Mouse_Button_Up *) ev;
if (e->win != ewin)
- return;
+ return 1;
evas_event_feed_mouse_move(evas, e->x, e->y);
evas_event_feed_mouse_up(evas, e->button);
+ return 1;
}
-void
-e_window_configure(Ecore_Event * ev)
+int
+e_window_configure(void* data, int ev_type, Ecore_Event * ev)
{
- Ecore_Event_Window_Configure *e;
+ Ecore_X_Event_Window_Configure *e;
+ enum active_state command;
- e = (Ecore_Event_Window_Configure *) ev->event;
+ e = (Ecore_X_Event_Window_Configure *) ev;
if (e->win == main_win)
{
win_w = e->w;
win_h = e->h;
- if (e->wm_generated)
+ if (e->from_wm)
{
win_x = e->x;
win_y = e->y;
}
- ecore_window_resize(ewin, win_w, win_h);
+ ecore_evas_resize(ecore_evas, win_w, win_h);
evas_output_viewport_set(evas, 0, 0, win_w, win_h);
evas_output_size_set(evas, win_w, win_h);
e_handle_resize();
- if (panel_active == active_in)
- e_slide_panel_out(0, NULL);
+ if (panel_active == active_in) {
+ command = active_out;
+ e_slide_panel(&command);
+ }
if (buttons_active == active_in)
- e_slide_buttons_out(0, NULL);
+ command = active_out;
+ e_slide_buttons(&command);
}
+ return 1;
+}
+*/
+void
+e_window_resize(Ecore_Evas *ee)
+{
+ e_handle_resize();
}
void
-e_key_down(Ecore_Event * ev)
+e_key_down(void* data, Evas * unused, Evas_Object *obj, void *event_info)
{
- Ecore_Event_Key_Down *e;
+ Evas_Event_Key_Down *e;
- e = ev->event;
- if (e->win != ewin)
- return;
+ e = event_info;
- if (!strcmp(e->key, "n"))
+ if (!strcmp(e->keyname, "n"))
{
scale = 1.0;
e_handle_resize();
}
- else if ((!strcmp(e->symbol, "minus")) ||
- (!strcmp(e->key, "o")))
+ else if ((!strcmp(e->keyname, "minus")) ||
+ (!strcmp(e->keyname, "o")))
{
scale += 0.5;
e_handle_resize();
}
- else if ((!strcmp(e->symbol, "plus")) ||
- (!strcmp(e->key, "equal")) ||
- (!strcmp(e->key, "i")))
+ else if ((!strcmp(e->keyname, "plus")) ||
+ (!strcmp(e->keyname, "equal")) ||
+ (!strcmp(e->keyname, "i")))
{
scale -= 0.5;
if (scale < 0.5)
scale = 0.5;
e_handle_resize();
}
- else if (!strcmp(e->symbol, "w"))
+ else if (!strcmp(e->keyname, "w"))
{
int w, h;
@@ -194,134 +209,137 @@
e_handle_resize();
}
}
- else if (!strcmp(e->symbol, "f"))
+ else if (!strcmp(e->keyname, "f"))
{
e_toggle_fullscreen();
}
- else if (!strcmp(e->symbol, "i"))
+ else if (!strcmp(e->keyname, "i"))
{
- e_fade_info_in(0, NULL);
+ e_fade_info_in(NULL);
}
- else if (!strcmp(e->symbol, "?"))
+ else if (!strcmp(e->keyname, "?"))
{
/* FIXME: display help */
}
- else if (!strcmp(e->symbol, "q"))
+ else if (!strcmp(e->keyname, "q"))
{
exit(0);
}
- else if (!strcmp(e->symbol, "r"))
+ else if (!strcmp(e->keyname, "r"))
{
e_rotate_r_current_image();
}
- else if (!strcmp(e->symbol, "l"))
+ else if (!strcmp(e->keyname, "l"))
{
e_rotate_l_current_image();
}
- else if (!strcmp(e->symbol, "h"))
+ else if (!strcmp(e->keyname, "h"))
{
e_flip_h_current_image();
}
- else if (!strcmp(e->symbol, "v"))
+ else if (!strcmp(e->keyname, "v"))
{
e_flip_v_current_image();
}
- else if (!strcmp(e->symbol, "p"))
+ else if (!strcmp(e->keyname, "p"))
{
- int force = 1;
if (panel_active == active_in || panel_active == active_force_in) {
+ enum active_state command = active_out;
panel_active = active_in;
- e_slide_panel_out(0, NULL);
+ e_slide_panel(&command);
}
else {
- e_slide_panel_in(0, &force);
+ enum active_state command = active_in;
+ e_slide_panel(&command);
}
}
- else if (!strcmp(e->symbol, "b"))
+ else if (!strcmp(e->keyname, "b"))
{
- int force = 1;
if (buttons_active == active_in || buttons_active == active_force_in) {
+ enum active_state command = active_out;
buttons_active = active_in;
- e_slide_buttons_out(0, NULL);
+ e_slide_buttons(&command);
}
else {
- e_slide_buttons_in(0, &force);
+ enum active_state command = active_in;
+ e_slide_buttons(&command);
}
}
- else if (!strcmp(e->symbol, "d"))
+ else if (!strcmp(e->keyname, "d"))
{
e_delete_current_image();
}
- else if (!strcmp(e->symbol, "s"))
+ else if (!strcmp(e->keyname, "s"))
{
e_save_current_image();
}
- else if (!strcmp(e->symbol, "t"))
+ else if (!strcmp(e->keyname, "t"))
{
e_turntable_l_current_image();
}
- else if (!strcmp(e->symbol, "e"))
+ else if (!strcmp(e->keyname, "e"))
{
e_size_match();
}
- else if (!strcmp(e->symbol, "Escape"))
+ else if (!strcmp(e->keyname, "Escape"))
{
exit(0);
}
- else if (!strcmp(e->symbol, "Return"))
+ else if (!strcmp(e->keyname, "Return"))
{
e_display_current_image();
}
- else if (!strcmp(e->symbol, "space"))
+ else if (!strcmp(e->keyname, "space"))
{
e_load_next_image();
}
- else if (!strcmp(e->symbol, "BackSpace"))
+ else if (!strcmp(e->keyname, "BackSpace"))
{
e_load_prev_image();
}
- else if (!strcmp(e->symbol, "Up"))
+ else if (!strcmp(e->keyname, "Up"))
{
icon_y += 8;
e_fix_icons();
}
- else if (!strcmp(e->symbol, "Down"))
+ else if (!strcmp(e->keyname, "Down"))
{
icon_y -= 8;
e_fix_icons();
}
+ return;
}
void
-e_key_up(Ecore_Event * ev)
+e_key_up(void* data, Evas *unused, Evas_Object *obj, void* event_info)
{
- Ecore_Event_Key_Down *e;
+ Evas_Event_Key_Up *e;
- e = ev->event;
- if (e->win != ewin)
- return;
- if (!strcmp(e->symbol, "t"))
+ e = event_info;
+
+ if (!strcmp(e->keyname, "t"))
{
e_turntable_r_current_image();
}
+ return;
}
-
-void
-e_property(Ecore_Event * ev)
+/*
+int
+e_property(void* data, int ev_type, Ecore_Event * ev)
{
- Ecore_Event_Window_Property *e;
- Atom a_entice_newfiles = 0;
+ Ecore_X_Event_Window_Property *e;
+ Ecore_X_Atom a_entice_newfiles = 0, xa_string;
char *files;
int size;
- e = (Ecore_Event_Window_Property *) ev->event;
+ e = (Ecore_X_Event_Window_Property *) ev;
if (e->win != main_win)
- return;
- if (!a_entice_newfiles)
- a_entice_newfiles = ecore_atom_get("_ENTICE_NEWFILES");
+ return 1;
+ a_entice_newfiles = ecore_atom_get("_ENTICE_NEWFILES");
if (e->atom != a_entice_newfiles)
- return;
- files = ecore_window_property_get(e->win, e->atom, XA_STRING, &size);
+ return 1;
+ xa_string = ecore_x_atom_get("XA_STRING");
+ files = ecore_x_window_prop_property_get(e->win, e->atom, xa_string, &size);
if (files)
{
char file[4096], *p, *pp;
@@ -388,4 +406,6 @@
e_fix_icons();
e_display_current_image();
}
+ return 1;
}
+*/
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/entice/src/bin/event.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -3 -r1.3 -r1.4
--- event.h 16 Feb 2003 09:35:15 -0000 1.3
+++ event.h 9 Aug 2003 00:50:38 -0000 1.4
@@ -3,26 +3,27 @@
/* callbacks for evas handling */
/* when the event queue goes idle call this */
-void e_idle(void *data);
+int e_idle(void *data);
/* when the window gets exposed call this */
-void e_window_expose(Ecore_Event * ev);
+int e_window_damage(void* data, int ev_type, Ecore_Event *ev);
/* when the mouse moves in the window call this */
-void e_mouse_move(Ecore_Event * ev);
+int e_mouse_move(void* data, int ev_type, Ecore_Event *ev);
/* when a mouse button goes down in the window call this */
-void e_mouse_down(Ecore_Event * ev);
+int e_mouse_down(void* data, int ev_type, Ecore_Event *ev);
/* when a mouse button is released in the window call this */
-void e_mouse_up(Ecore_Event * ev);
+int e_mouse_up(void* data, int ev_type, Ecore_Event *ev);
+void e_window_resize(Ecore_Evas *ee);
/* when the window gets moved or resized */
-void e_window_configure(Ecore_Event * ev);
+//int e_window_configure(void* data, int ev_type, Ecore_Event *ev);
/* when a key gets pressed */
-void e_key_down(Ecore_Event * ev);
-void e_key_up(Ecore_Event * ev);
-void e_property(Ecore_Event * ev);
+void e_key_down(void* data, Evas *e, Evas_Object *ev, void *event_info);
+void e_key_up(void* data, Evas *e, Evas_Object *ev, void *event_info);
+//int e_property(void* data, int ev_type, Ecore_Event *ev);
#endif /* __EVENT_H__ */
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/entice/src/bin/fade.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -3 -r1.4 -r1.5
--- fade.c 14 Feb 2003 09:55:29 -0000 1.4
+++ fade.c 9 Aug 2003 00:50:38 -0000 1.5
@@ -1,15 +1,20 @@
#include "entice.h"
-void
-e_fade_info_in(int v, void *data)
+Ecore_Timer * fade_timer;
+
+int
+e_fade_info_in(void *data)
{
int i, j;
+ static int v=0;
static double start = 0.0;
double duration = 0.5;
double val;
- if (v == 0)
+ if (v == 0) {
start = get_time();
+ fade_timer = ecore_timer_add(0.05, e_fade_info_in, data);
+ }
val = (get_time() - start) / duration;
if (val > 1.0)
val = 1.0;
@@ -40,23 +45,28 @@
}
}
- if (val < 1.0)
- ecore_add_event_timer("e_fade_info_in()", 0.05, e_fade_info_in, v + 1,
- data);
- else
- e_fade_info_out(0, NULL);
+ if (val < 1.0) {
+ v++;
+ return 1;
+ } else {
+ v = 0;
+ return 0;
+ }
}
-void
-e_fade_info_out(int v, void *data)
+int
+e_fade_info_out(void *data)
{
int i, j;
+ static int v = 0;
static double start = 0.0;
double duration = 8.0;
double val;
- if (v == 0)
+ if (v == 0) {
start = get_time();
+ fade_timer = ecore_timer_add(0.05, e_fade_info_out, data);
+ }
val = (get_time() - start) / duration;
if (val > 1.0)
val = 1.0;
@@ -91,21 +101,28 @@
}
}
- if (val < 1.0)
- ecore_add_event_timer("e_fade_info_in()", 0.05, e_fade_info_out, v + 1,
- NULL);
+ if (val > 0.0) {
+ v++;
+ return 1;
+ } else {
+ v = 0;
+ return 0;
+ }
}
-void
-e_fade_scroller_in(int v, void *data)
+int
+e_fade_scroller_in(void *data)
{
/* int i; */
+ static int v = 0;
static double start = 0.0;
double duration = 0.5;
double val;
- if (v == 0)
+ if (v == 0) {
start = get_time();
+ fade_timer = ecore_timer_add(0.05, e_fade_scroller_in, data);
+ }
val = (get_time() - start) / duration;
if (val > 1.0)
val = 1.0;
@@ -114,318 +131,382 @@
evas_object_color_set(o_mini_image, 255, 255, 255, (val * 255));
evas_object_color_set(o_mini_select, 255, 255, 255, (val * 255));
- if (val < 1.0)
- ecore_add_event_timer("e_fade_logo_in()", 0.05, e_fade_scroller_in, v + 1,
- data);
+ if (val < 1.0) {
+ v++;
+ return 1;
+ } else {
+ v = 0;
+ return 0;
+ }
if (data)
- e_fade_scroller_out(0, NULL);
+ e_fade_scroller_out(NULL);
}
-void
-e_fade_trash_in(int v, void *data)
+int
+e_fade_scroller_out(void *data)
{
+ /* int i; */
+ static int v = 0;
static double start = 0.0;
- double duration = 0.5;
+ double duration = 2.0;
double val;
- if (v == 0)
+ if (v == 0) {
start = get_time();
+ fade_timer = ecore_timer_add(0.05, e_fade_scroller_out, data);
+ }
val = (get_time() - start) / duration;
if (val > 1.0)
val = 1.0;
+ val = 1.0 - val;
+ if (o_mini_image)
+ evas_object_color_set(o_mini_image, 255, 255, 255, (val * 255));
+ evas_object_color_set(o_mini_select, 255, 255, 255, (val * 255));
- evas_object_color_set(o_trash, 255, 255, 255, (val * 175));
- evas_object_color_set(o_trash_can, 255, 255, 255, (val * 255));
-
- if (val < 1.0)
- ecore_add_event_timer("e_fade_trash_in()", 0.02, e_fade_trash_in, v + 1,
- NULL);
+ if (val > 0.0) {
+ v++;
+ return 1;
+ } else {
+ v = 0;
+ return 0;
+ }
}
-void
-e_fade_trash_out(int v, void *data)
+int
+e_fade_trash_in(void *data)
{
+ static int v = 0;
static double start = 0.0;
double duration = 0.5;
double val;
- if (v == 0)
+ if (v == 0) {
start = get_time();
+ fade_timer = ecore_timer_add(0.05, e_fade_trash_in, data);
+ }
val = (get_time() - start) / duration;
if (val > 1.0)
val = 1.0;
- val = 1.0 - val;
evas_object_color_set(o_trash, 255, 255, 255, (val * 175));
evas_object_color_set(o_trash_can, 255, 255, 255, (val * 255));
- if (val > 0.0)
- ecore_add_event_timer("e_fade_trash_out()", 0.02, e_fade_trash_out, v + 1,
- NULL);
+ if (val < 1.0) {
+ v++;
+ return 1;
+ } else {
+ v = 0;
+ return 0;
+ }
}
-void
-e_fade_scroller_out(int v, void *data)
+int
+e_fade_trash_out(void *data)
{
- /* int i; */
+ static int v = 0;
static double start = 0.0;
- double duration = 2.0;
+ double duration = 0.5;
double val;
- if (v == 0)
+ if (v == 0) {
start = get_time();
+ fade_timer = ecore_timer_add(0.05, e_fade_trash_out, data);
+ }
val = (get_time() - start) / duration;
if (val > 1.0)
val = 1.0;
val = 1.0 - val;
- if (o_mini_image)
- evas_object_color_set(o_mini_image, 255, 255, 255, (val * 255));
- evas_object_color_set(o_mini_select, 255, 255, 255, (val * 255));
- if (val < 1.0)
- ecore_add_event_timer("e_fade_logo_in()", 0.05, e_fade_scroller_out,
- v + 1, NULL);
+ evas_object_color_set(o_trash, 255, 255, 255, (val * 175));
+ evas_object_color_set(o_trash_can, 255, 255, 255, (val * 255));
+
+ if (val > 0.0) {
+ v++;
+ return 1;
+ } else {
+ v = 0;
+ return 0;
+ }
}
-void
-e_fade_logo_in(int v, void *data)
+int
+e_fade_logo_in(void *data)
{
/* int i; */
+ static int v = 0;
static double start = 0.0;
double duration = 1.0;
double val;
- if (v == 0)
+ if (v == 0) {
start = get_time();
+ fade_timer = ecore_timer_add(0.05, e_fade_logo_in, data);
+ }
val = (get_time() - start) / duration;
evas_object_color_set(o_logo, 255, 255, 255, (val * 255));
- if (val < 1.0)
- ecore_add_event_timer("e_fade_logo_in()", 0.05, e_fade_logo_in, v + 1,
- NULL);
+ if (val < 1.0) {
+ v++;
+ return 1;
+ } else {
+ v = 0;
+ return 0;
+ }
}
-void
-e_fade_l_arrow_in(int v, void *data)
+int
+e_fade_l_arrow_in(void *data)
{
/* int i; */
+ static int v = 0;
static double start = 0.0;
double duration = 0.5;
double val;
if (arrow_l == 2)
- return;
- if (v == 0)
+ return 0;
+ if (v == 0) {
start = get_time();
+ fade_timer = ecore_timer_add(0.05, e_fade_l_arrow_in, data);
+ }
val = (get_time() - start) / duration;
evas_object_color_set(o_arrow_l, 255, 255, 255, (int)(val * 255));
- if (val < 1.0)
- {
- ecore_add_event_timer("e_fade_l_arrow_in()", 0.05, e_fade_l_arrow_in,
- v + 1, NULL);
- arrow_l = 1;
- }
- else
+ if (val < 1.0) {
+ arrow_l = 1;
+ v++;
+ evas_object_show(o_arrow_l);
+ return 1;
+ } else {
arrow_l = 2;
- evas_object_show(o_arrow_l);
+ v = 0;
+ evas_object_show(o_arrow_l);
+ return 0;
+ }
}
-void
-e_fade_l_arrow_out(int v, void *data)
+int
+e_fade_l_arrow_out(void *data)
{
/* int i; */
+ static int v = 0;
static double start = 0.0;
double duration = 0.5;
double val;
if (arrow_l == 0)
- return;
- if (v == 0)
+ return 0;
+ if (v == 0) {
start = get_time();
+ fade_timer = ecore_timer_add(0.05, e_fade_l_arrow_out, data);
+ }
val = (get_time() - start) / duration;
evas_object_color_set(o_arrow_l, 255, 255, 255, ((1.0 - val) * 255));
if (val < 1.0)
{
- ecore_add_event_timer("e_fade_l_arrow_out()", 0.05, e_fade_l_arrow_out,
- v + 1, NULL);
arrow_l = 1;
+ v++;
+ return 1;
}
else
{
evas_object_hide(o_arrow_l);
arrow_l = 0;
+ return 0;
}
}
-void
-e_fade_r_arrow_in(int v, void *data)
+int
+e_fade_r_arrow_in(void *data)
{
/* int i; */
+ static int v = 0;
static double start = 0.0;
double duration = 0.5;
double val;
if (arrow_r == 2)
- return;
- if (v == 0)
+ return 0;
+ if (v == 0) {
start = get_time();
+ fade_timer = ecore_timer_add(0.05, e_fade_r_arrow_in, data);
+ }
val = (get_time() - start) / duration;
evas_object_color_set(o_arrow_r, 255, 255, 255, (int)(val * 255));
- if (val < 1.0)
- {
- ecore_add_event_timer("e_fade_r_arrow_in()", 0.05, e_fade_r_arrow_in,
- v + 1, NULL);
- arrow_r = 1;
- }
- else
+ if (val < 1.0) {
+ v++;
+ arrow_r = 1;
+ evas_object_show(o_arrow_r);
+ return 1;
+ } else {
arrow_r = 2;
- evas_object_show(o_arrow_r);
+ v = 0;
+ evas_object_show(o_arrow_r);
+ return 0;
+ }
}
-void
-e_fade_r_arrow_out(int v, void *data)
+int
+e_fade_r_arrow_out(void *data)
{
/* int i; */
+ static int v = 0;
static double start = 0.0;
double duration = 0.5;
double val;
if (arrow_r == 0)
- return;
- if (v == 0)
+ return 0;
+ if (v == 0) {
start = get_time();
+ fade_timer = ecore_timer_add(0.05, e_fade_r_arrow_out, data);
+ }
val = (get_time() - start) / duration;
evas_object_color_set(o_arrow_r, 255, 255, 255, ((1.0 - val) * 255));
- if (val < 1.0)
- {
- ecore_add_event_timer("e_fade_r_arrow_out()", 0.05, e_fade_r_arrow_out,
- v + 1, NULL);
- arrow_r = 1;
- }
- else
- {
- evas_object_hide(o_arrow_r);
- arrow_r = 0;
- }
+ if (val < 1.0) {
+ v++;
+ arrow_r = 1;
+ return 1;
+ } else {
+ evas_object_hide(o_arrow_r);
+ arrow_r = 0;
+ v = 0;
+ return 0;
+ }
}
-void
-e_fade_t_arrow_in(int v, void *data)
+int
+e_fade_t_arrow_in(void *data)
{
/* int i; */
+ static int v = 0;
static double start = 0.0;
double duration = 0.5;
double val;
if (arrow_t == 2)
- return;
- if (v == 0)
+ return 0;
+ if (v == 0) {
start = get_time();
+ fade_timer = ecore_timer_add(0.05, e_fade_t_arrow_in, data);
+ }
val = (get_time() - start) / duration;
evas_object_color_set(o_arrow_t, 255, 255, 255, (int)(val * 255));
- if (val < 1.0)
- {
- ecore_add_event_timer("e_fade_t_arrow_in()", 0.05, e_fade_t_arrow_in,
- v + 1, NULL);
- arrow_t = 1;
- }
- else
+ if (val < 1.0) {
+ v++;
+ arrow_t = 1;
+ evas_object_show(o_arrow_t);
+ return 1;
+ } else {
+ v = 0;
arrow_t = 2;
- evas_object_show(o_arrow_t);
+ evas_object_show(o_arrow_t);
+ return 0;
+ }
}
-void
-e_fade_t_arrow_out(int v, void *data)
+int
+e_fade_t_arrow_out(void *data)
{
/* int i; */
+ static int v = 0;
static double start = 0.0;
double duration = 0.5;
double val;
if (arrow_t == 0)
- return;
- if (v == 0)
+ return 0;
+ if (v == 0) {
start = get_time();
+ fade_timer = ecore_timer_add(0.05, e_fade_t_arrow_out, data);
+ }
val = (get_time() - start) / duration;
evas_object_color_set(o_arrow_t, 255, 255, 255, ((1.0 - val) * 255));
- if (val < 1.0)
- {
- ecore_add_event_timer("e_fade_t_arrow_out()", 0.05, e_fade_t_arrow_out,
- v + 1, NULL);
- arrow_t = 1;
- }
- else
- {
- evas_object_hide(o_arrow_t);
- arrow_t = 0;
- }
+ if (val < 1.0) {
+ v++;
+ arrow_t = 1;
+ return 1;
+ } else {
+ evas_object_hide(o_arrow_t);
+ arrow_t = 0;
+ v = 0;
+ return 0;
+ }
}
-void
-e_fade_b_arrow_in(int v, void *data)
+int
+e_fade_b_arrow_in(void *data)
{
/* int i; */
+ static int v = 0;
static double start = 0.0;
double duration = 0.5;
double val;
if (arrow_b == 2)
- return;
- if (v == 0)
+ return 0;
+ if (v == 0) {
start = get_time();
+ fade_timer = ecore_timer_add(0.05, e_fade_b_arrow_in, data);
+ }
val = (get_time() - start) / duration;
evas_object_color_set(o_arrow_b, 255, 255, 255, (int)(val * 255));
- if (val < 1.0)
- {
- ecore_add_event_timer("e_fade_b_arrow_in()", 0.05, e_fade_b_arrow_in,
- v + 1, NULL);
- arrow_b = 1;
- }
- else
+ if (val < 1.0) {
+ arrow_b = 1;
+ v++;
+ evas_object_show(o_arrow_b);
+ return 1;
+ } else {
arrow_b = 2;
- evas_object_show(o_arrow_b);
+ v = 0;
+ evas_object_show(o_arrow_b);
+ return 0;
+ }
}
-void
-e_fade_b_arrow_out(int v, void *data)
+int
+e_fade_b_arrow_out(void *data)
{
/* int i; */
+ static int v = 0;
static double start = 0.0;
double duration = 0.5;
double val;
if (arrow_b == 0)
- return;
- if (v == 0)
+ return 0;
+ if (v == 0) {
start = get_time();
+ fade_timer = ecore_timer_add(0.05, e_fade_b_arrow_out, data);
+ }
val = (get_time() - start) / duration;
evas_object_color_set(o_arrow_b, 255, 255, 255, ((1.0 - val) * 255));
if (val < 1.0)
{
- ecore_add_event_timer("e_fade_b_arrow_out()", 0.05, e_fade_b_arrow_out,
- v + 1, NULL);
arrow_b = 1;
+ v++;
+ return 1;
}
else
{
evas_object_hide(o_arrow_b);
arrow_b = 0;
+ return 0;
}
}
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/entice/src/bin/fade.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -3 -r1.3 -r1.4
--- fade.h 5 Feb 2003 05:45:45 -0000 1.3
+++ fade.h 9 Aug 2003 00:50:38 -0000 1.4
@@ -1,27 +1,27 @@
#ifndef __FADE_H__
#define __FADE_H__
-void e_fade_info_in(int v, void *data);
-void e_fade_info_out(int v, void *data);
+int e_fade_info_in(void *data);
+int e_fade_info_out(void *data);
-void e_fade_scroller_in(int v, void *data);
-void e_fade_scroller_out(int v, void *data);
+int e_fade_scroller_in(void *data);
+int e_fade_scroller_out(void *data);
-void e_fade_trash_in(int v, void *data);
-void e_fade_trash_out(int v, void *data);
+int e_fade_trash_in(void *data);
+int e_fade_trash_out(void *data);
-void e_fade_logo_in(int v, void *data);
+int e_fade_logo_in(void *data);
-void e_fade_l_arrow_in(int v, void *data);
-void e_fade_l_arrow_out(int v, void *data);
+int e_fade_l_arrow_in(void *data);
+int e_fade_l_arrow_out(void *data);
-void e_fade_r_arrow_in(int v, void *data);
-void e_fade_r_arrow_out(int v, void *data);
+int e_fade_r_arrow_in(void *data);
+int e_fade_r_arrow_out(void *data);
-void e_fade_t_arrow_in(int v, void *data);
-void e_fade_t_arrow_out(int v, void *data);
+int e_fade_t_arrow_in(void *data);
+int e_fade_t_arrow_out(void *data);
-void e_fade_b_arrow_in(int v, void *data);
-void e_fade_b_arrow_out(int v, void *data);
+int e_fade_b_arrow_in(void *data);
+int e_fade_b_arrow_out(void *data);
#endif /* __FADE_H__ */
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/entice/src/bin/globals.h,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -3 -r1.6 -r1.7
--- globals.h 16 Mar 2003 07:57:27 -0000 1.6
+++ globals.h 9 Aug 2003 00:50:38 -0000 1.7
@@ -40,6 +40,7 @@
extern Image *generating_image;
extern Evas *evas;
+extern Ecore_Evas *ecore_evas;
extern int render_method;
extern int max_colors;
extern int smoothness;
@@ -47,8 +48,8 @@
extern int win_h;
extern int win_x;
extern int win_y;
-extern Window main_win;
-extern Window ewin;
+extern Ecore_X_Window main_win;
+extern Ecore_X_Window ewin;
extern int icon_x;
extern int icon_y;
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/entice/src/bin/handler.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -3 -r1.5 -r1.6
--- handler.c 14 Feb 2003 09:55:29 -0000 1.5
+++ handler.c 9 Aug 2003 00:50:38 -0000 1.6
@@ -9,28 +9,28 @@
evas_object_geometry_get(o_image, &ix, &iy, &iw, &ih);
if (ix < 0)
- e_fade_l_arrow_in(0, NULL);
+ e_fade_l_arrow_in(NULL);
else
- e_fade_l_arrow_out(0, NULL);
+ e_fade_l_arrow_out(NULL);
if (iy < 0)
- e_fade_t_arrow_in(0, NULL);
+ e_fade_t_arrow_in(NULL);
else
- e_fade_t_arrow_out(0, NULL);
+ e_fade_t_arrow_out(NULL);
if (iw + ix > win_w)
- e_fade_r_arrow_in(0, NULL);
+ e_fade_r_arrow_in(NULL);
else
- e_fade_r_arrow_out(0, NULL);
+ e_fade_r_arrow_out(NULL);
if (ih + iy > win_h)
- e_fade_b_arrow_in(0, NULL);
+ e_fade_b_arrow_in(NULL);
else
- e_fade_b_arrow_out(0, NULL);
+ e_fade_b_arrow_out(NULL);
}
else
{
- e_fade_l_arrow_out(0, NULL);
- e_fade_r_arrow_out(0, NULL);
- e_fade_t_arrow_out(0, NULL);
- e_fade_b_arrow_out(0, NULL);
+ e_fade_l_arrow_out(NULL);
+ e_fade_r_arrow_out(NULL);
+ e_fade_t_arrow_out(NULL);
+ e_fade_b_arrow_out(NULL);
}
}
@@ -39,6 +39,7 @@
{
int w, h;
+ ecore_evas_geometry_get(ecore_evas, NULL, NULL, &win_w, &win_h);
evas_object_move(o_bg, 0, 0);
evas_object_resize(o_bg, win_w, win_h);
evas_object_layer_set(o_bg, 0);
@@ -46,42 +47,39 @@
evas_object_image_size_get(o_logo, &w, &h);
evas_object_move(o_logo, (win_w - w) / 2, (win_h - h) / 2);
evas_object_resize(o_logo, w, h);
- evas_object_layer_set(o_logo, 100);
+ evas_object_layer_set(o_logo, 80);
evas_object_image_size_get(o_panel, &w, NULL);
- if (!panel_active)
+ if (panel_active == active_out || panel_active == active_force_out)
evas_object_move(o_panel, -w, 0);
evas_object_resize(o_panel, w, win_h);
- evas_object_layer_set(o_panel, 200);
+ evas_object_layer_set(o_panel, 240);
evas_object_layer_set(o_panel_arrow_u, 250);
evas_object_layer_set(o_panel_arrow_d, 250);
evas_object_move(o_showpanel, 0, 0);
evas_object_resize(o_showpanel, 64, win_h);
- if (panel_active)
- evas_object_layer_set(o_showpanel, 180);
- else
- evas_object_layer_set(o_showpanel, 1000);
- {
- double px = 0;
-
- if (buttons_active)
- px = win_w - 288;
- else
- px = win_w;
- evas_object_move(o_bt_prev, px + 0, 0);
- evas_object_move(o_bt_next, px + 32, 0);
- evas_object_move(o_bt_zoom_normal, px + 64, 0);
- evas_object_move(o_bt_zoom_in, px + 96, 0);
- evas_object_move(o_bt_zoom_out, px + 128, 0);
- evas_object_move(o_bt_expand, px + 160, 0);
- evas_object_move(o_bt_full, px + 192, 0);
- evas_object_move(o_bt_delete, px + 224, 0);
- evas_object_move(o_bt_close, px + 256, 0);
+ evas_object_layer_set(o_showpanel, 300);
+ evas_object_repeat_events_set(o_showpanel, 1);
+ evas_object_move(o_hidepanel, 128, 0);
+ evas_object_resize(o_hidepanel, win_w - 128, win_h);
+ evas_object_layer_set(o_hidepanel, 400);
+ // make sure buttons aren't left hanging mid-window
+ if (buttons_active == active_out || buttons_active == active_force_out) {
+ evas_object_move(o_bt_prev, win_w + 0, 0);
+ evas_object_move(o_bt_next, win_w + 32, 0);
+ evas_object_move(o_bt_zoom_normal, win_w + 64, 0);
+ evas_object_move(o_bt_zoom_in, win_w + 96, 0);
+ evas_object_move(o_bt_zoom_out, win_w + 128, 0);
+ evas_object_move(o_bt_expand, win_w + 160, 0);
+ evas_object_move(o_bt_full, win_w + 192, 0);
+ evas_object_move(o_bt_delete, win_w + 224, 0);
+ evas_object_move(o_bt_close, win_w + 256, 0);
}
- evas_object_move(o_showbuttons, win_w - 256, 0);
- evas_object_resize(o_showbuttons, 256, 32);
- evas_object_layer_set(o_showbuttons, 1100);
+ evas_object_move(o_showbuttons, win_w - 288, 0);
+ evas_object_resize(o_showbuttons, 288, 32);
+ evas_object_layer_set(o_showbuttons, 1500);
+ evas_object_repeat_events_set(o_showbuttons, 1);
evas_object_layer_set(o_bt_close, 1300);
evas_object_layer_set(o_bt_delete, 1300);
evas_object_layer_set(o_bt_expand, 1300);
@@ -92,10 +90,6 @@
evas_object_layer_set(o_bt_zoom_normal, 1300);
evas_object_layer_set(o_bt_zoom_out, 1300);
- evas_object_move(o_hidepanel, 128, 0);
- evas_object_resize(o_hidepanel, win_w - 128, win_h);
- evas_object_layer_set(o_hidepanel, 1000);
-
if (o_image)
{
int sx, sy, mx, my, pw, ph;
@@ -125,6 +119,23 @@
}
else
sy = 0;
+
+ evas_object_move(o_image,
+ sx + ((win_w - w) / 2), sy + ((win_h - h) / 2));
+ evas_object_image_fill_set(o_image, 0, 0, w, h);
+ evas_object_resize(o_image, w, h);
+ evas_object_layer_set(o_image, 100);
+
+ scroll_sx = sx;
+ scroll_sy = sy;
+
+ if ((win_w <= w) && (win_h <= h) &&
+ (!evas_object_image_alpha_get(o_image)))
+ evas_object_hide(o_bg);
+ else
+ evas_object_show(o_bg);
+ evas_object_hide(o_logo);
+
if (o_trash)
{
int dw, dh, r;
@@ -183,27 +194,12 @@
evas_object_show(o_mini_image);
evas_object_show(o_mini_select);
}
- evas_object_move(o_image,
- sx + ((win_w - w) / 2), sy + ((win_h - h) / 2));
- evas_object_image_fill_set(o_image, 0, 0, w, h);
- evas_object_resize(o_image, w, h);
- evas_object_layer_set(o_image, 100);
-
- scroll_sx = sx;
- scroll_sy = sy;
-
- if ((win_w <= w) && (win_h <= h) &&
- (!evas_object_image_alpha_get(o_image)))
- evas_object_hide(o_bg);
- else
- evas_object_show(o_bg);
- evas_object_hide(o_logo);
}
else
{
evas_object_show(o_bg);
evas_object_show(o_logo);
- e_fade_logo_in(0, NULL);
+ e_fade_logo_in(NULL);
}
evas_object_image_size_get(o_arrow_l, &w, &h);
evas_object_move(o_arrow_l, 0, (win_h - h) / 2);
@@ -219,9 +215,9 @@
evas_object_layer_set(o_arrow_b, 230);
e_handle_arrows();
- e_scroll_list(0, NULL);
+ e_scroll_list(NULL);
}
-
+/* XXX
void
e_handle_dnd(void)
{
@@ -237,3 +233,4 @@
}
return;
}
+*/
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/entice/src/bin/handler.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -3 -r1.3 -r1.4
--- handler.h 5 Feb 2003 05:45:45 -0000 1.3
+++ handler.h 9 Aug 2003 00:50:38 -0000 1.4
@@ -4,5 +4,5 @@
void e_handle_arrows(void);
void e_handle_resize(void);
-void e_handle_dnd(void);
+// void e_handle_dnd(void);
#endif /* __HANDLER_H__ */
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/entice/src/bin/image.c,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -3 -r1.13 -r1.14
--- image.c 24 Apr 2003 06:13:33 -0000 1.13
+++ image.c 9 Aug 2003 00:50:38 -0000 1.14
@@ -2,6 +2,9 @@
#define DEFAULT_FORMAT "png"
+int turntable_rotation = 0;
+
+/* XXX
void
image_add_from_dnd(char *item)
{
@@ -45,11 +48,15 @@
e_display_current_image();
return;
}
-
+*/
void
image_create_list(int argc, char **argv)
{
int i;
+ if (argc==2 && e_file_is_dir(argv[1])) {
+ image_create_list_dir(argv[1]);
+ return;
+ }
for (i = 1; i < argc; i++)
{
@@ -99,10 +106,12 @@
/* CS */
/* printf("%s\n",dent->d_name); */
-
- im = e_image_new(dent->d_name);
- images = evas_list_append(images, im);
-
+ if (e_file_is_dir(dent->d_name)) {
+ // do nothing for now: FIXME
+ } else {
+ im = e_image_new(dent->d_name);
+ images = evas_list_append(images, im);
+ }
/* CS */
/* printf("%p\n",images); */
}
@@ -287,8 +296,8 @@
e_turntable_reset();
e_handle_resize();
e_fix_icons();
- e_scroll_list(0, NULL);
- e_fade_scroller_in(0, (void *)1);
+ e_scroll_list(NULL);
+ e_fade_scroller_in((void *)1);
}
@@ -366,8 +375,8 @@
e_turntable_reset();
e_handle_resize();
e_fix_icons();
- e_scroll_list(0, NULL);
- e_fade_scroller_in(0, (void *)1);
+ e_scroll_list(NULL);
+ e_fade_scroller_in((void *)1);
}
@@ -445,7 +454,7 @@
}
static void
-e_turntable_object_next(Evas_Object *obj, int rotation)
+e_turntable_object_next(Evas_Object *obj)
{
int w;
int h;
@@ -456,7 +465,7 @@
e_turntable_object_init(obj);
- if (rotation == 1) {
+ if (turntable_rotation == 1) {
if(++turntable_image_no >= TURNTABLE_COUNT) {
turntable_image_no = 0;
}
@@ -467,7 +476,7 @@
}
}
- /* Get image data from Imblib */
+ /* Get image data from Imlib */
imlib_context_set_image(turntable_image[turntable_image_no]);
image_data = imlib_image_get_data_for_reading_only();
w = imlib_image_get_width();
@@ -481,19 +490,19 @@
}
-static void
-e_turntable_object(int rotation, Evas_Object *obj)
+int
+e_turntable_object(void *data)
{
+ Evas_Object* obj;
+ obj = (Evas_Object *) data;
if (turntable_image_no < 0)
- return;
+ return 0;
- e_turntable_object_next(obj, rotation);
- ecore_add_event_timer("e_turntable_object()",
- (double)60/(double)33/(double)TURNTABLE_COUNT,
- e_turntable_object, rotation, o_image);
+ e_turntable_object_next(obj);
/* Update Display */
e_handle_resize();
+ return 1;
}
static void
@@ -508,8 +517,8 @@
if (turntable_image_no < 0 && w * h * 4 > 1048576)
return;
- e_turntable_object_init(o_image);
- e_turntable_object(rotation, o_image);
+ turntable_rotation = rotation;
+ ecore_timer_add((double) 60 / (double) 33 / (double) TURNTABLE_COUNT,
e_turntable_object, (void *) o_image);
}
@@ -703,7 +712,7 @@
*txt_info[1] = '\0';
sprintf(title, "Entice (Error Loading): %s",
((Image *) (current_image->data))->file);
- ecore_window_set_title(main_win, title);
+ ecore_evas_title_set(ecore_evas, title);
evas_object_del(o_image);
o_image = NULL;
}
@@ -715,16 +724,16 @@
sprintf(txt_info[0], "File: %s",
((Image *) (current_image->data))->file);
sprintf(txt_info[1], "Size: %ix%i", w, h);
- e_fade_info_in(0, NULL);
+ e_fade_info_in(NULL);
sprintf(title, "Entice: %s",
((Image *) (current_image->data))->file);
- ecore_window_set_title(main_win, title);
+ ecore_evas_title_set(ecore_evas, title);
}
}
else
{
- ecore_window_set_title(main_win, "Entice (No Image)");
+ ecore_evas_title_set(ecore_evas, "Entice (No Image)");
{
evas_object_del(o_image);
o_image = NULL;
@@ -740,8 +749,8 @@
}
e_handle_resize();
e_fix_icons();
- e_scroll_list(0, NULL);
- e_fade_scroller_in(0, (void *)1);
+ e_scroll_list(NULL);
+ e_fade_scroller_in((void *)1);
}
void
@@ -755,7 +764,7 @@
down_y = ev->output.y;
down_sx = scroll_x;
down_sy = scroll_y;
- e_fade_scroller_in(0, NULL);
+ e_fade_scroller_in(NULL);
}
void
@@ -769,7 +778,7 @@
{
scroll_x = scroll_sx;
scroll_y = scroll_sy;
- e_fade_scroller_out(0, NULL);
+ e_fade_scroller_out(NULL);
return;
}
if ((obj == o_showpanel) && (panel_active))
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/entice/src/bin/image.h,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -3 -r1.10 -r1.11
--- image.h 16 Mar 2003 06:08:52 -0000 1.10
+++ image.h 9 Aug 2003 00:50:38 -0000 1.11
@@ -1,7 +1,7 @@
#ifndef __IMAGE_H__
#define __IMAGE_H__
-void image_add_from_dnd(char *item);
+// void image_add_from_dnd(char *item);
void image_create_list(int argc, char **argv);
void image_create_list_dir(char *dir);
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/entice/src/bin/list.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -3 -r1.3 -r1.4
--- list.c 5 Feb 2003 05:45:45 -0000 1.3
+++ list.c 9 Aug 2003 00:50:38 -0000 1.4
@@ -1,9 +1,15 @@
#include "entice.h"
-void
-e_scroll_list(int v, void *data)
+int scroll_up_counter = 0;
+Ecore_Timer * scroll_up_timer = NULL;
+int scroll_down_counter = 0;
+Ecore_Timer * scroll_down_timer = NULL;
+
+int
+e_scroll_list(void *data)
{
int dd, d, fp;
+ static int v = 0;
fp = (int)focus_pos - (win_h / 2);
dd = d = fp + icon_y;
@@ -11,9 +17,12 @@
dd = -dd;
icon_y -= (d / 4);
e_fix_icons();
- if (dd > 3)
- ecore_add_event_timer("e_scroll_list()", 0.05, e_scroll_list, v + 1,
- NULL);
+ if (dd > 3) {
+ if (v == 0)
+ ecore_timer_add(0.05, e_scroll_list, data);
+ return 1;
+ }
+ return 0;
}
void
@@ -66,8 +75,8 @@
if (!dragging)
{
dragging = 1;
- e_list_item_zoom(-1, data);
- e_fade_trash_in(0, (void *)1);
+ e_list_item_zoom(NULL);
+ e_fade_trash_in((void *)1);
}
evas_object_image_size_get(icon_drag, &iw, &ih);
@@ -94,7 +103,7 @@
if (dragging)
{
- e_fade_trash_out(0, NULL);
+ e_fade_trash_out(NULL);
dragging = 0;
}
@@ -122,7 +131,7 @@
evas_object_geometry_get(o_trash, &x, &y, &w, &h);
if ((ev->cur.output.x > (int)x) && (ev->cur.output.y > (int)y))
{
- e_list_item_zoom(-1, data);
+ e_list_item_zoom(NULL);
image_delete(im);
e_display_current_image();
}
@@ -134,33 +143,36 @@
}
}
-void
-e_list_item_zoom(int v, void *data)
+int
+e_list_item_zoom(void *data)
{
+ static int v = 0;
Evas_List *l;
Image *im;
static Evas_Object *zo = NULL;
static double t_start = 0.0;
double t;
- l = data;
- im = l->data;
- if (v == -1)
+ if (data == NULL)
{
evas_object_del(zo);
zo = NULL;
return;
}
+
+ l = data;
+ im = l->data;
if (v == 0)
{
- t_start = ecore_get_time();
+ t_start = ecore_time_get();
+ ecore_timer_add(0.02, e_list_item_zoom, data);
if ((im->thumb) && (im->file))
{
zo = evas_object_image_add(evas);
evas_object_image_file_set(zo, im->thumb, NULL);
}
}
- t = (ecore_get_time() - t_start) * 2;
+ t = (ecore_time_get() - t_start) * 2;
if (t > 1.0)
t = 1.0;
if (zo)
@@ -181,9 +193,13 @@
evas_object_show(zo);
}
- if (t < 1.0)
- ecore_add_event_timer("e_list_item_zoom()", 0.02, e_list_item_zoom, v + 1,
- data);
+ if (t < 1.0) {
+ v++;
+ return 1;
+ } else {
+ v = 0;
+ return 0;
+ }
}
void
@@ -197,10 +213,10 @@
txt_info[0][0] = '\0';
txt_info[1][0] = '\0';
sprintf(txt_info[0], "Directory: %s", im->file);
- e_fade_info_in(0, NULL);
+ e_fade_info_in(NULL);
}
else
- e_list_item_zoom(0, data);
+ e_list_item_zoom(data);
}
void
@@ -211,64 +227,68 @@
if (e_file_is_dir(im->file))
{
- e_fade_info_out(0, NULL);
+ e_fade_info_out(NULL);
}
else
- e_list_item_zoom(-1, data);
+ e_list_item_zoom(NULL);
}
-void
-e_list_scroll_up_timer(int v, void *data)
+int
+e_list_scroll_up_timer(void *data)
{
int vv;
- vv = v / 5;
+ vv = scroll_up_counter++ / 5;
if (vv > 15)
vv = 15;
icon_y -= 1 + vv;
e_fix_icons();
- ecore_add_event_timer("e_list_scroll_up_timer()", 0.02,
- e_list_scroll_up_timer, v + 1, NULL);
+ return 1;
}
-void
-e_list_scroll_down_timer(int v, void *data)
+int
+e_list_scroll_down_timer(void *data)
{
int vv;
- vv = v / 5;
+ vv = scroll_down_counter++ / 5;
if (vv > 15)
vv = 15;
icon_y += 1 + vv;
e_fix_icons();
- ecore_add_event_timer("e_list_scroll_down_timer()", 0.02,
- e_list_scroll_down_timer, v + 1, NULL);
+ return 1;
}
void
list_scroll_up(void *data, Evas * e, Evas_Object * obj, void *event_info)
{
- e_list_scroll_down_timer(0, NULL);
+ scroll_down_counter = 0;
+ e_list_scroll_down_timer(NULL);
+ scroll_down_timer = ecore_timer_add(0.02, e_list_scroll_down_timer, NULL);
evas_object_image_file_set(obj, IM "list_arrow_u_2.png", NULL);
}
void
list_scroll_up_up(void *data, Evas * e, Evas_Object * obj, void *event_info)
{
- ecore_del_event_timer("e_list_scroll_down_timer()");
+ ecore_timer_del(scroll_down_timer);
+ scroll_down_timer = NULL;
evas_object_image_file_set(obj, IM "list_arrow_u_1.png", NULL);
}
void
list_scroll_down(void *data, Evas * e, Evas_Object * obj, void *event_info)
{
- e_list_scroll_up_timer(0, NULL);
+ scroll_up_counter = 0;
+ e_list_scroll_up_timer(NULL);
+ scroll_up_timer = ecore_timer_add(0.02, e_list_scroll_up_timer, NULL);
evas_object_image_file_set(obj, IM "list_arrow_d_2.png", NULL);
}
void
list_scroll_down_up(void *data, Evas * e, Evas_Object * obj, void *event_info)
{
- ecore_del_event_timer("e_list_scroll_up_timer()");
+ ecore_timer_del(scroll_up_timer);
+ scroll_up_timer = NULL;
evas_object_image_file_set(obj, IM "list_arrow_d_1.png", NULL);
}
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/entice/src/bin/list.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -3 -r1.3 -r1.4
--- list.h 5 Feb 2003 05:45:45 -0000 1.3
+++ list.h 9 Aug 2003 00:50:38 -0000 1.4
@@ -1,7 +1,7 @@
#ifndef __LIST_H__
#define __LIST_H__
-void e_scroll_list(int v, void *data);
+int e_scroll_list(void *data);
void e_list_item_drag(void *data, Evas * e, Evas_Object * obj,
void *event_info);
@@ -10,15 +10,15 @@
void e_list_item_select(void *data, Evas * e, Evas_Object * obj,
void *event_info);
-void e_list_item_zoom(int v, void *data);
+int e_list_item_zoom(void *data);
void e_list_item_in(void *data, Evas * e, Evas_Object * obj,
void *event_info);
void e_list_item_out(void *data, Evas * e, Evas_Object * obj,
void *event_info);
-void e_list_scroll_up_timer(int v, void *data);
-void e_list_scroll_down_timer(int v, void *data);
+int e_list_scroll_up_timer(void *data);
+int e_list_scroll_down_timer(void *data);
void list_scroll_up(void *data, Evas * e, Evas_Object * obj,
void *event_info);
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/entice/src/bin/main.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -3 -r1.6 -r1.7
--- main.c 16 Mar 2003 07:57:27 -0000 1.6
+++ main.c 9 Aug 2003 00:50:38 -0000 1.7
@@ -39,13 +39,14 @@
Image *generating_image = NULL;
Evas *evas;
+Ecore_Evas *ecore_evas;
int render_method = 0;
int max_colors = MAX_EVAS_COLORS;
int smoothness = 1;
int win_w = W, win_h = H;
int win_x = 0, win_y = 0;
-Window main_win;
-Window ewin;
+Ecore_X_Window main_win;
+Ecore_X_Window ewin;
int icon_x = 0;
int icon_y = 0;
@@ -66,24 +67,26 @@
char **dnd_files = NULL;
/*****************************************************************************/
-
-Window
-find_current_rep(Window win, Atom atom)
+/*
+Ecore_X_Window
+find_current_rep(Ecore_X_Window win, Ecore_X_Atom atom)
{
- Window *wlist;
+ Ecore_X_Window *wlist;
int i, n;
+ Ecore_X_Atom string;
wlist = ecore_window_get_children(win, &n);
if (wlist)
{
+ string = ecore_x_atom_get("XA_STRING");
for (i = 0; i < n; i++)
{
void *data;
int size;
- Window w;
+ Ecore_X_Window w;
w = wlist[i];
- data = ecore_window_property_get(w, atom, XA_STRING, &size);
+ data = ecore_x_window_prop_property_get(w, atom, string, &size);
if (data)
{
free(data);
@@ -92,7 +95,7 @@
}
else
{
- Window ww;
+ Ecore_X_Window ww;
ww = find_current_rep(w, atom);
if (ww)
@@ -110,20 +113,21 @@
void
find_current(void)
{
- Atom a_entice;
- Atom a_entice_newfiles;
- Window win;
+ Ecore_X_Atom a_entice;
+ Ecore_X_Atom a_entice_newfiles;
+ Ecore_X_Atom string;
+ Ecore_X_Window win;
Evas_List *l;
int size;
char *files;
if (!images)
return;
- a_entice = ecore_atom_get("_ENTICE_APP_WINDOW");
+ a_entice = ecore_x_atom_get("_ENTICE_APP_WINDOW");
win = find_current_rep(0, a_entice);
if (!win)
return;
- a_entice_newfiles = ecore_atom_get("_ENTICE_NEWFILES");
+ a_entice_newfiles = ecore_x_atom_get("_ENTICE_NEWFILES");
size = 0;
for (l = images; l; l = l->next)
{
@@ -142,14 +146,20 @@
strcat(files, im->file);
strcat(files, "\n");
}
- ecore_window_property_set(win, a_entice_newfiles, XA_STRING, 8, files, size);
+ string = ecore_x_atom_get("XA_STRING");
+ ecore_x_window_prop_property_set(win, a_entice_newfiles, string, 8, files, size);
ecore_sync();
ecore_sync();
exit(0);
}
-
+*/
/*****************************************************************************/
+static int main_signal_exit(void *data, int ev_type, void *ev)
+{
+ ecore_main_loop_quit();
+}
+
int
main(int argc, char **argv)
{
@@ -203,8 +213,15 @@
}
else
image_create_list(argc, argv);
+ /* initialise Ecore */
+ if (!ecore_init()) {
+ printf("Maximal evil: unable to init Ecore!\n");
+ return -1;
+ }
+ ecore_event_handler_add(ECORE_EVENT_SIGNAL_EXIT, main_signal_exit, NULL);
+
/* init X */
- if (!ecore_display_init(NULL))
+ if (!ecore_evas_init())
{
if (getenv("DISPLAY"))
{
@@ -218,15 +235,9 @@
printf("Exit.\n");
exit(-1);
}
- /* setup handlers for system signals */
- ecore_event_signal_init();
- /* setup the event filter */
- ecore_event_filter_init();
- /* setup the X event internals */
- ecore_event_x_init();
/* find if another entice is running... if it is .. message it. */
- find_current();
+ //find_current(); // XXX
/* program does its data setup here */
setup();
@@ -236,10 +247,11 @@
icon_x = -100;
e_fix_icons();
/* call the animator once to start it up */
- e_fade_logo_in(0, NULL);
- e_fade_scroller_in(0, (void *)1);
+ e_fade_logo_in(NULL);
+ e_fade_scroller_in((void *)1);
/* and now loop forever handling events */
- ecore_event_loop();
-
+ ecore_main_loop_begin();
+ ecore_evas_shutdown();
+ ecore_shutdown();
return(0);
}
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/entice/src/bin/misc.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -3 -r1.9 -r1.10
--- misc.c 28 May 2003 06:55:35 -0000 1.9
+++ misc.c 9 Aug 2003 00:50:38 -0000 1.10
@@ -1,5 +1,6 @@
#include "entice.h"
#include <Evas_Engine_Software_X11.h>
+#include <limits.h>
double
get_time(void)
@@ -27,51 +28,47 @@
void
setup(void)
{
- Window win;
int i, j;
- Atom a_entice;
+ Ecore_X_Atom a_entice;
char string[] = "entice";
- /* setup callbacks for events */
- ecore_event_filter_handler_add(ECORE_EVENT_WINDOW_EXPOSE, e_window_expose);
- ecore_event_filter_handler_add(ECORE_EVENT_MOUSE_MOVE, e_mouse_move);
- ecore_event_filter_handler_add(ECORE_EVENT_MOUSE_DOWN, e_mouse_down);
- ecore_event_filter_handler_add(ECORE_EVENT_MOUSE_UP, e_mouse_up);
- ecore_event_filter_handler_add(ECORE_EVENT_WINDOW_CONFIGURE,
- e_window_configure);
- ecore_event_filter_handler_add(ECORE_EVENT_KEY_DOWN, e_key_down);
- ecore_event_filter_handler_add(ECORE_EVENT_KEY_UP, e_key_up);
- ecore_event_filter_handler_add(ECORE_EVENT_WINDOW_PROPERTY, e_property);
-
- ecore_event_filter_handler_add(ECORE_EVENT_DND_DROP, e_dnd_drop);
- ecore_event_filter_handler_add(ECORE_EVENT_DND_DROP_REQUEST,
- e_dnd_drop_request);
+ /* setup callbacks for events legacy code *
+ ecore_event_handler_add(ECORE_X_EVENT_WINDOW_DAMAGE, e_window_damage, NULL);
+ ecore_event_handler_add(ECORE_X_EVENT_MOUSE_MOVE, e_mouse_move, NULL);
+ ecore_event_handler_add(ECORE_X_EVENT_MOUSE_BUTTON_DOWN, e_mouse_down, NULL);
+ ecore_event_handler_add(ECORE_X_EVENT_MOUSE_BUTTON_UP, e_mouse_up, NULL);
+ ecore_event_handler_add(ECORE_X_EVENT_WINDOW_CONFIGURE,
+ e_window_configure, NULL);
+ ecore_event_handler_add(ECORE_X_EVENT_KEY_DOWN, e_key_down, NULL);
+ ecore_event_handler_add(ECORE_X_EVENT_KEY_UP, e_key_up, NULL);
+ */
+/* ecore_event_handler_add(ECORE_X_EVENT_WINDOW_PROPERTY, e_property, NULL);
+
+ ecore_event_handler_add(ECORE_X_EVENT_DND_DROP, e_dnd_drop, NULL);
+ ecore_event_handler_add(ECORE_X_EVENT_DND_DROP_REQUEST,
+ e_dnd_drop_request, NULL);
+ */
/* handler for when the event queue goes idle */
- ecore_event_filter_idle_handler_add(e_idle, NULL);
+ ecore_idler_add(e_idle, NULL);
/* create a 400x300 toplevel window */
- win = ecore_window_new(0, 0, 0, win_w, win_h);
- ecore_window_set_events(win, XEV_CONFIGURE | XEV_PROPERTY | XEV_KEY);
- ecore_window_set_name_class(win, "Entice", "Main");
- ecore_window_set_min_size(win, 256, 128);
- ecore_window_set_max_size(win, 8000, 8000);
- a_entice = ecore_atom_get("_ENTICE_APP_WINDOW");
- ecore_window_property_set(win, a_entice, XA_STRING, 8, string, 6);
- ecore_window_dnd_advertise(win);
- main_win = win;
- win = ecore_window_new(main_win, 0, 0, win_w, win_h);
- ecore_window_set_events(win,
- XEV_EXPOSE | XEV_BUTTON | XEV_MOUSE_MOVE | XEV_KEY);
- ewin = win;
-
- /* create a 400x300 evas rendering in software - conveience function that */
- /* also creates the window for us in the right colormap & visual */
- evas = evas_new();
+ ecore_evas = ecore_evas_software_x11_new(NULL, 0, 0, 0, win_w, win_h);
+ ecore_evas_callback_resize_set(ecore_evas, e_window_resize);
+ // main_win = ecore_evas_software_x11_window_get(ecore_evas);
+ // ecore_window_set_events(win, XEV_CONFIGURE | XEV_PROPERTY | XEV_KEY);
+ ecore_evas_name_class_set(ecore_evas, "Entice", "Main");
+ ecore_evas_size_min_set(ecore_evas, 256, 128);
+ ecore_evas_size_max_set(ecore_evas, 8000, 8000);
+ a_entice = ecore_x_atom_get("_ENTICE_APP_WINDOW");
+ ecore_evas_title_set(ecore_evas, string);
+ /*ecore_window_dnd_advertise(main_win); XXX */
+ evas = ecore_evas_get(ecore_evas);
evas_output_method_set(evas, render_method);
evas_output_size_set(evas, win_w, win_h);
evas_output_viewport_set(evas, 0, 0, win_w, win_h);
evas_font_path_append(evas, FONT_DIRECTORY);
evas_font_cache_set(evas, MAX_FONT_CACHE);
evas_image_cache_set(evas, MAX_IMAGE_CACHE);
+ /*
{
Evas_Engine_Info_Software_X11 *einfo;
@@ -80,8 +77,8 @@
{
Display *disp;
- /* the following is specific to the engine */
- disp = ecore_display_get();
+ * the following is specific to the engine *
+ disp = ecore_x_display_get();
einfo->info.display = disp;
einfo->info.visual = DefaultVisual(disp, DefaultScreen(disp));
einfo->info.colormap = DefaultColormap(disp, DefaultScreen(disp));
@@ -92,10 +89,8 @@
}
evas_engine_info_set(evas, (Evas_Engine_Info *) einfo);
}
- ecore_window_show(ewin);
- /* show the toplevel */
- ecore_window_show(main_win);
-
+ */
+ ecore_evas_show(ecore_evas);
/* now... create objects in the evas */
o_bg = e_newim(evas, IM "bg.png");
@@ -172,15 +167,17 @@
evas_object_show(o_trash);
- e_slide_panel_out(0, NULL);
- e_slide_buttons_out(0, NULL);
+ //e_slide_panel_out(NULL);
+ //e_slide_buttons_out(NULL);
evas_object_event_callback_add(o_showpanel, EVAS_CALLBACK_MOUSE_IN,
show_panel, NULL);
- evas_object_event_callback_add(o_hidepanel, EVAS_CALLBACK_MOUSE_IN,
+ evas_object_event_callback_add(o_showpanel, EVAS_CALLBACK_MOUSE_OUT,
hide_panel, NULL);
evas_object_event_callback_add(o_showbuttons, EVAS_CALLBACK_MOUSE_IN,
show_buttons, NULL);
+ evas_object_event_callback_add(o_showbuttons, EVAS_CALLBACK_MOUSE_OUT,
+ hide_buttons, NULL);
evas_object_event_callback_add(o_logo, EVAS_CALLBACK_MOUSE_DOWN, next_image,
NULL);
evas_object_event_callback_add(o_logo, EVAS_CALLBACK_MOUSE_UP, next_image_up,
@@ -189,6 +186,9 @@
NULL);
evas_object_event_callback_add(o_bg, EVAS_CALLBACK_MOUSE_UP, next_image_up,
NULL);
+ evas_object_event_callback_add(o_bg, EVAS_CALLBACK_KEY_DOWN, e_key_down, NULL);
+ evas_object_event_callback_add(o_bg, EVAS_CALLBACK_KEY_UP, e_key_up, NULL);
+ evas_object_focus_set(o_bg, 1);
evas_object_event_callback_add(o_hidepanel, EVAS_CALLBACK_MOUSE_DOWN,
next_image, NULL);
evas_object_event_callback_add(o_hidepanel, EVAS_CALLBACK_MOUSE_UP,
@@ -291,7 +291,11 @@
void
e_mkdirs(char *path)
{
- char ss[1024];
+#ifdef PATH_MAX
+ char ss[PATH_MAX];
+#else
+ char ss[4096];
+#endif
int i, ii;
i = 0;
@@ -311,12 +315,12 @@
}
}
-void
-e_child(Ecore_Event * ev)
+int
+e_child(void * data, int ev_type, Ecore_Event * ev)
{
- Ecore_Event_Child *e;
+ Ecore_Event_Exe_Exit *e;
- e = (Ecore_Event_Child *) ev->event;
+ e = (Ecore_Event_Exe_Exit *) ev;
if (generating_image)
{
if (generating_image->generator == e->pid)
@@ -325,6 +329,7 @@
generating_image = NULL;
}
}
+ return 1;
}
static int full = 0;
@@ -332,69 +337,36 @@
void
e_toggle_fullscreen(void)
{
- static Window win = 0;
- static int pw = W, ph = H;
+ static Ecore_X_Window win = 0;
+ static int pw = W, ph = H, px = 0, py = 0;
+ enum active_state command;
if (!full)
{
- int rw, rh;
-
- ecore_sync();
- ecore_window_get_geometry(ewin, NULL, NULL, &pw, &ph);
- ecore_window_get_geometry(0, NULL, NULL, &rw, &rh);
- win = ecore_window_override_new(0, 0, 0, rw, rh);
- ecore_window_hide(ewin);
- ecore_window_reparent(ewin, win, 0, 0);
- ecore_window_resize(ewin, rw, rh);
- ecore_window_show(ewin);
- ecore_window_show(win);
- ecore_keyboard_grab(ewin);
- ecore_grab_mouse(ewin, 1, 0);
- ecore_window_resize(ewin, rw, rh);
+ ecore_evas_geometry_get(ecore_evas, &px, &py, &pw, &ph);
full = 1;
- if ((!ecore_grab_window_get()) || (!ecore_keyboard_grab_window_get()))
- {
- printf("bleh\n");
- e_toggle_fullscreen();
- return;
- }
- win_w = rw;
- win_h = rh;
- evas_output_viewport_set(evas, 0, 0, win_w, win_h);
- evas_output_size_set(evas, win_w, win_h);
- e_handle_resize();
- if (panel_active == active_in || panel_active == active_force_in) {
- e_slide_panel_out(0, NULL);
- }
- else {
- e_slide_panel_in(0, NULL);
- }
+ ecore_evas_fullscreen_set(ecore_evas, full);
+ ecore_x_window_size_get(0, &win_w, &win_h);
+ ecore_evas_resize(ecore_evas, win_w, win_h);
}
else
{
- ecore_sync();
- ecore_pointer_ungrab(CurrentTime);
- ecore_keyboard_ungrab();
+ full = 0;
+ ecore_evas_fullscreen_set(ecore_evas, full);
+ ecore_evas_move_resize(ecore_evas, px, py, pw, ph);
win_w = pw;
win_h = ph;
- ecore_window_hide(ewin);
- ecore_window_resize(ewin, win_w, win_h);
- ecore_window_reparent(ewin, main_win, 0, 0);
- ecore_window_show(ewin);
- evas_output_viewport_set(evas, 0, 0, win_w, win_h);
- evas_output_size_set(evas, win_w, win_h);
- e_handle_resize();
- if (panel_active == active_in || panel_active == active_force_in) {
- e_slide_panel_out(0, NULL);
- }
- else {
- e_slide_panel_in(0, NULL);
- }
- if (win)
- ecore_window_destroy(win);
- win = 0;
- full = 0;
}
+ e_handle_resize();
+ /*
+ if (panel_active == active_in || panel_active == active_force_in) {
+ command = active_out;
+ }
+ else {
+ command = active_in;
+ }
+ e_slide_panel(&command);
+ */
}
void
@@ -460,6 +432,7 @@
evas_object_image_border_set(o_list_select, 4, 4, 4, 4);
}
+/* XXX
void
e_dnd_drop_request(Ecore_Event * ev)
{
@@ -509,7 +482,7 @@
dnd_num_files = 0;
return;
}
-
+*/
void
e_size_match(void)
{
@@ -518,6 +491,7 @@
double w, h;
evas_object_geometry_get(o_image, NULL, NULL, &w, &h);
- ecore_window_resize(main_win, w, h);
+ //ecore_x_window_resize(main_win, w, h);
+ ecore_evas_resize(ecore_evas, w, h);
}
}
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/entice/src/bin/misc.h,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -3 -r1.4 -r1.5
--- misc.h 28 May 2003 06:55:35 -0000 1.4
+++ misc.h 9 Aug 2003 00:50:38 -0000 1.5
@@ -6,15 +6,15 @@
void setup(void);
void e_mkdirs(char *path);
-void e_child(Ecore_Event * ev);
-void e_toggle_fullscreen(void);
+int e_child(void* data, int ev_type, Ecore_Event * ev);
+// void e_toggle_fullscreen(void);
void e_fix_icons(void);
/* drag and drop functions - might need to move these */
-void e_dnd_drop_request(Ecore_Event * ev);
+/* void e_dnd_drop_request(Ecore_Event * ev);
void e_dnd_drop(Ecore_Event * ev);
void e_dnd_drop_request_free(void);
-
+*/
void e_size_match(void);
#endif /* __MISC_H__ */
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/entice/src/bin/panel.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -3 -r1.3 -r1.4
--- panel.c 16 Mar 2003 07:57:27 -0000 1.3
+++ panel.c 9 Aug 2003 00:50:38 -0000 1.4
@@ -1,99 +1,84 @@
#include "entice.h"
-void
-e_slide_panel_in(int v, void *data)
-{
- /* int i; */
- static double start = 0.0;
- double duration = 0.5;
- double val;
- double px;
- int w;
- int *force;
-
- force = (int *)data;
+Ecore_Timer *panel_slide = NULL;
- if(panel_active == active_force_out && !(force && *force))
- return;
-
- if(force && *force)
- panel_active = active_force_in;
- else
- panel_active = active_in;
+int
+e_slide_panel(void * data)
+{
+ static double start;
+ double duration = 0.5; // soon-to-be-configurable time taken to slide
+ double val = 0.0;
+ double delay = 0.05; // soon-to-be-configurable time between frames
+ static enum active_state action;
+ static Ecore_Timer *timer = NULL;
+ int px, w;
+
+
+ if (data) { // not called by timer
+ if (!timer) { // we are starting afresh
+ start = get_time();
+ } else { // there is a slide already going on
+ start = 2*get_time() - duration - start;
+ ecore_timer_del(timer);
+ }
+ action = *(enum active_state *)data;
+ panel_active = action;
+ timer = ecore_timer_add(delay, e_slide_panel, NULL);
+ return 1;
+ } else
- if (v == 0)
- evas_object_layer_set(o_showpanel, 180);
- if (v == 0)
- start = get_time();
val = (get_time() - start) / duration;
+ if (val > 1.0) val = 1.0;
evas_object_image_size_get(o_panel, &w, NULL);
- px = (w * sin(val * 0.5 * 3.141592654)) - w;
+ if (action == active_in || action == active_force_in)
+ px = (w * sin(val * 0.5 * 3.141592654)) - w;
+ else
+ px = (w * sin((1.0 - val) * 0.5 * 3.141592654)) - w;
+
evas_object_move(o_panel, px, 0);
evas_object_move(o_panel_arrow_u, px, 0);
evas_object_move(o_panel_arrow_d, px, win_h - 32);
- icon_x = (int)px;
+ icon_x = px;
e_fix_icons();
- if (val < 1.0)
- ecore_add_event_timer("e_slide_panel()", 0.05, e_slide_panel_in, v + 1,
- force);
+ if (val < 0.99) // keep going
+ return 1;
+ else { // stick a fork in us, we're done
+ timer = NULL;
+ return 0;
+ }
}
-void
-e_slide_panel_out(int v, void *data)
+int
+e_slide_panel_in(void* data)
{
- /* int i; */
- static double start = 0.0;
- double duration = 0.5;
- double val;
- double px;
- int w;
- int *force;
-
- force = (int *)data;
-
- if(panel_active == active_force_in && !(force && *force))
- return;
-
- if (v == 0)
- evas_object_layer_set(o_showpanel, 1000);
- if (v == 0)
- start = get_time();
- val = (get_time() - start) / duration;
-
- evas_object_image_size_get(o_panel, &w, NULL);
- px = (w * sin((1.0 - val) * 0.5 * 3.141592654)) - w;
- evas_object_move(o_panel, px, 0);
- evas_object_move(o_panel_arrow_u, px, 0);
- evas_object_move(o_panel_arrow_d, px, win_h - 32);
-
- icon_x = px;
- e_fix_icons();
+ enum active_state command = active_in;
+ printf("obsolete call to e_slide_panel_in");
+ e_slide_panel(&command);
+ return 1;
+}
- if (val < 1.0)
- ecore_add_event_timer("e_slide_panel()", 0.05, e_slide_panel_out, v + 1,
- force);
- else
- if(force && *force)
- panel_active = active_force_out;
- else
- panel_active = active_out;
+int
+e_slide_panel_out(void* data)
+{
+ enum active_state command = active_out;
+ printf("obsolete call to e_slide_panel_out");
+ e_slide_panel(&command);
+ return 1;
}
void
show_panel(void *data, Evas * e, Evas_Object * obj, void *event_info)
{
- if (!panel_active)
- e_slide_panel_in(0, NULL);
+ enum active_state command = active_in;
+ e_slide_panel(&command);
}
void
hide_panel(void *data, Evas * e, Evas_Object * obj, void *event_info)
{
- if (panel_active)
- e_slide_panel_out(0, NULL);
- if (buttons_active)
- e_slide_buttons_out(0, NULL);
+ enum active_state command = active_out;
+ e_slide_panel(&command);
}
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/entice/src/bin/panel.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -3 -r1.2 -r1.3
--- panel.h 5 Feb 2003 05:45:45 -0000 1.2
+++ panel.h 9 Aug 2003 00:50:38 -0000 1.3
@@ -1,8 +1,9 @@
#ifndef __PANEL_H__
#define __PANEL_H__
-void e_slide_panel_in(int v, void *data);
-void e_slide_panel_out(int v, void *data);
+int e_slide_panel(void *data);
+int e_slide_panel_in(void *data);
+int e_slide_panel_out(void *data);
void show_panel(void *data, Evas * e, Evas_Object * obj,
void *event_info);
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/entice/src/bin/thumb.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -3 -r1.3 -r1.4
--- thumb.c 5 Feb 2003 05:45:45 -0000 1.3
+++ thumb.c 9 Aug 2003 00:50:38 -0000 1.4
@@ -1,4 +1,5 @@
#include "entice.h"
+#include <limits.h>
void
e_do_thumb(char *file, char *thumb)
@@ -55,7 +56,11 @@
e_generate_thumb(Image * im)
{
static int initted = 0;
+#ifdef PATH_MAX
+ char buf[PATH_MAX];
+#else
char buf[4096];
+#endif
if (generating_image)
return;
@@ -64,7 +69,7 @@
if (!initted)
{
- ecore_event_filter_handler_add(ECORE_EVENT_CHILD, e_child);
+ ecore_event_handler_add(ECORE_EVENT_EXE_EXIT, e_child, NULL);
initted = 1;
}
sprintf(buf, "%s/.entice/thumbs/%s._.png", e_file_home(), im->file);
-------------------------------------------------------
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/01
_______________________________________________
enlightenment-cvs mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs