Thu Nov 4 18:39:32 PST 1999
(KainX) Several new features for E-Slides and some new icons. SVN revision: 1179
This commit is contained in:
parent
19eec1c40e
commit
26f82eb3a2
|
@ -254,3 +254,10 @@ E-Slides, a slideshow epplet. This is just the initial version; more features
|
|||
coming soon. :-)
|
||||
|
||||
Also some API additions/bugfixes.
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
|
||||
Thu Nov 4 18:39:32 PST 1999
|
||||
(KainX)
|
||||
|
||||
Several new features for E-Slides and some new icons.
|
||||
|
|
Binary file not shown.
Binary file not shown.
|
@ -15,15 +15,18 @@
|
|||
#define BEGMATCH(a, b) (!strncasecmp((a), (b), (sizeof(b) - 1)))
|
||||
#define NONULL(x) ((x) ? (x) : (""))
|
||||
|
||||
Epplet_gadget close_button, picture;
|
||||
Epplet_gadget close_button, play_button, pause_button, prev_button, next_button, zoom_button, picture;
|
||||
ImlibImage *im = NULL;
|
||||
unsigned long idx = 0, image_cnt = 0;
|
||||
double delay = 5.0;
|
||||
char **filenames = NULL, *path;
|
||||
unsigned char paused = 0;
|
||||
|
||||
static char **dirscan(char *dir, unsigned long *num);
|
||||
static void change_image(void *data);
|
||||
static void close_cb(void *data);
|
||||
static void zoom_cb(void *data);
|
||||
static void play_cb(void *data);
|
||||
static void in_cb(void *data, Window w);
|
||||
static void out_cb(void *data, Window w);
|
||||
|
||||
|
@ -99,13 +102,23 @@ dirscan(char *dir, unsigned long *num)
|
|||
static void
|
||||
change_image(void *data) {
|
||||
|
||||
/* Test-load each image to make sure it's a valid image file. */
|
||||
for (; ((filenames[idx] == NULL) || ((im = Imlib_load_image(Epplet_get_imlib_data(), filenames[idx])) == NULL)); idx++) {
|
||||
/* It isn't, so NULL out its name. */
|
||||
filenames[idx] = NULL;
|
||||
}
|
||||
Imlib_destroy_image(Epplet_get_imlib_data(), im); /* Destroy the image, but keep it in cache. */
|
||||
|
||||
Epplet_change_image(picture, 42, 42, filenames[idx]);
|
||||
idx++;
|
||||
if (idx == image_cnt) {
|
||||
idx = 0;
|
||||
}
|
||||
|
||||
Epplet_timer(change_image, NULL, delay, "TIMER");
|
||||
Epplet_remove_timer("CHANGE_IMAGE");
|
||||
if (!paused) {
|
||||
Epplet_timer(change_image, NULL, delay, "CHANGE_IMAGE");
|
||||
}
|
||||
return;
|
||||
data = NULL;
|
||||
}
|
||||
|
@ -119,10 +132,60 @@ close_cb(void *data) {
|
|||
data = NULL;
|
||||
}
|
||||
|
||||
static void
|
||||
zoom_cb(void *data) {
|
||||
|
||||
return;
|
||||
data = NULL;
|
||||
}
|
||||
|
||||
static void
|
||||
play_cb(void *data) {
|
||||
|
||||
int op = (int) data;
|
||||
|
||||
switch (op) {
|
||||
case -1:
|
||||
/* Previous image */
|
||||
idx -= 2;
|
||||
change_image(NULL);
|
||||
break;
|
||||
case 0:
|
||||
/* Pause */
|
||||
Epplet_remove_timer("CHANGE_IMAGE");
|
||||
paused = 1;
|
||||
Epplet_gadget_hide(pause_button);
|
||||
Epplet_gadget_show(play_button);
|
||||
break;
|
||||
case 1:
|
||||
/* Play */
|
||||
paused = 0;
|
||||
Epplet_gadget_hide(play_button);
|
||||
Epplet_gadget_show(pause_button);
|
||||
change_image(NULL);
|
||||
break;
|
||||
case 2:
|
||||
/* Next image */
|
||||
change_image(NULL);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
static void
|
||||
in_cb(void *data, Window w) {
|
||||
|
||||
Epplet_gadget_show(close_button);
|
||||
Epplet_gadget_show(zoom_button);
|
||||
Epplet_gadget_show(prev_button);
|
||||
Epplet_gadget_show(next_button);
|
||||
if (paused) {
|
||||
Epplet_gadget_show(play_button);
|
||||
} else {
|
||||
Epplet_gadget_show(pause_button);
|
||||
}
|
||||
return;
|
||||
data = NULL;
|
||||
w = (Window) 0;
|
||||
|
@ -132,6 +195,11 @@ static void
|
|||
out_cb(void *data, Window w) {
|
||||
|
||||
Epplet_gadget_hide(close_button);
|
||||
Epplet_gadget_hide(zoom_button);
|
||||
Epplet_gadget_hide(prev_button);
|
||||
Epplet_gadget_hide(next_button);
|
||||
Epplet_gadget_hide(play_button);
|
||||
Epplet_gadget_hide(pause_button);
|
||||
return;
|
||||
data = NULL;
|
||||
w = (Window) 0;
|
||||
|
@ -164,7 +232,7 @@ main(int argc, char **argv) {
|
|||
prio = getpriority(PRIO_PROCESS, getpid());
|
||||
setpriority(PRIO_PROCESS, getpid(), prio + 10);
|
||||
atexit(Epplet_cleanup);
|
||||
Epplet_Init("E-Slides", "0.1", "Enlightenment Slideshow Epplet", 3, 3, argc, argv, 0);
|
||||
Epplet_Init("E-Slides", "0.2", "Enlightenment Slideshow Epplet", 3, 3, argc, argv, 0);
|
||||
Epplet_load_config();
|
||||
parse_config();
|
||||
filenames = dirscan(path, &image_cnt);
|
||||
|
@ -177,7 +245,12 @@ main(int argc, char **argv) {
|
|||
}
|
||||
chdir(path);
|
||||
|
||||
close_button = Epplet_create_button(NULL, NULL, 2, 2, 0, 0, "CLOSE", 0, NULL, close_cb, NULL);
|
||||
close_button = Epplet_create_button(NULL, NULL, 3, 3, 0, 0, "CLOSE", 0, NULL, close_cb, NULL);
|
||||
zoom_button = Epplet_create_button(NULL, NULL, 33, 3, 0, 0, "EJECT", 0, NULL, zoom_cb, NULL);
|
||||
prev_button = Epplet_create_button(NULL, NULL, 3, 33, 0, 0, "PREVIOUS", 0, NULL, play_cb, (void *) (-1));
|
||||
play_button = Epplet_create_button(NULL, NULL, 18, 33, 0, 0, "PLAY", 0, NULL, play_cb, (void *) (1));
|
||||
pause_button = Epplet_create_button(NULL, NULL, 18, 33, 0, 0, "PAUSE", 0, NULL, play_cb, (void *) (0));
|
||||
next_button = Epplet_create_button(NULL, NULL, 33, 33, 0, 0, "NEXT", 0, NULL, play_cb, (void *) (2));
|
||||
picture = Epplet_create_image(3, 3, 42, 42, "/dev/null");
|
||||
Epplet_show();
|
||||
|
||||
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -97,7 +97,8 @@ E-ScreenShoot.ABOUT/E_ScreenShoot_cloak.png
|
|||
|
||||
ICONS = \
|
||||
E-Load.icon E-Clock.icon E-Net.icon E-Cpu.icon E-Power.icon E-Biff.icon \
|
||||
Emix.icon E-NetFlame.icon E-ScreenShoot.icon
|
||||
Emix.icon E-NetFlame.icon E-ScreenShoot.icon E-Slides.icon E-Disk.icon \
|
||||
E-MemWatch.icon E-Sys.icon E-Time.icon
|
||||
|
||||
IMAGES =\
|
||||
E-Clock-Image.png E-Power-Bat-0.png E-Power-Bat-10.png E-Power-Bat-20.png \
|
||||
|
|
Loading…
Reference in New Issue