Enlightenment CVS committal
Author : handyande
Project : misc
Module : engage
Dir : misc/engage/src
Modified Files:
dock.c engage.h icon.c userconfig.c
Log Message:
Huston, we have embedded animations :)
===================================================================
RCS file: /cvsroot/enlightenment/misc/engage/src/dock.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -3 -r1.7 -r1.8
--- dock.c 30 Jun 2004 09:49:59 -0000 1.7
+++ dock.c 3 Aug 2004 20:41:18 -0000 1.8
@@ -23,7 +23,7 @@
int y;
int i;
- dock.icons = dock.applnks = dock.dicons = dock.minwins = NULL;
+ dock.icons = dock.applnks = dock.dicons = dock.sysicons = dock.minwins = NULL;
dock.state = unzoomed;
dock.zoom = 1.0;
dock.x = 400.0;
@@ -33,7 +33,7 @@
}
pic2[0] = options.bg_fore;
- for (i = 0; i < 4; i++) {
+ for (i = 0; i < 5; i++) {
dock.background[i] = evas_object_image_add(evas);
if (options.mode == OM_ONTOP)
evas_object_image_alpha_set(dock.background[i], 0);
@@ -83,6 +83,8 @@
}
if (dock.dicons || dock.minwins)
width += options.spacing + 1.0; // separator
+ if (dock.sysicons)
+ width += options.spacing + 1.0; // another spacer
}
#define POSITION(__icons) \
@@ -106,6 +108,10 @@
x += 1.0 + 0.5 * options.spacing;
POSITION(dock.dicons);
POSITION(dock.minwins);
+ x += 0.5 * options.spacing;
+ dock.middle2_pos = x;
+ x += 1.0 + 0.5 * options.spacing;
+ POSITION(dock.sysicons);
dock.left_pos = 0.5 * (options.width - width) - 1.0;
dock.right_pos = 0.5 * (options.width - width) + width + 1.0;
@@ -157,8 +163,8 @@
// positions the background pieces
{
- double left_end_disp, right_end_disp, middle_disp;
- double dummy, middle;
+ double left_end_disp, right_end_disp, middle_disp, middle2_disp;
+ double dummy, middle, middle2;
zoom_function((dock.left_pos - dock.x) / (options.size + options.spacing),
&dummy, &left_end_disp);
@@ -166,9 +172,12 @@
&dummy, &right_end_disp);
zoom_function((dock.middle_pos - dock.x) / (options.size + options.spacing),
&dummy, &middle_disp);
+ zoom_function((dock.middle2_pos - dock.x)/ (options.size + options.spacing),
+ &dummy, &middle2_disp);
dock.left_end = left_end_disp + dock.x;
dock.right_end = right_end_disp + dock.x;
middle = middle_disp + dock.x;
+ middle2 = middle2_disp + dock.x;
evas_object_move(dock.background[OD_BG_LEFT], dock.left_end,
options.height - options.size - 2.0 * options.arrow_size);
@@ -181,6 +190,13 @@
evas_object_show(dock.background[OD_BG_MIDDLE]);
} else
evas_object_hide(dock.background[OD_BG_MIDDLE]);
+ if (dock.sysicons) {
+ evas_object_move(dock.background[OD_BG_MIDDLE2], middle2,
+ options.height - options.size -
+ 2.0 * options.arrow_size);
+ evas_object_show(dock.background[OD_BG_MIDDLE2]);
+ } else
+ evas_object_hide(dock.background[OD_BG_MIDDLE2]);
evas_object_image_fill_set(dock.background[OD_BG_FILL], 0.0, 0.0,
dock.right_end - dock.left_end - 1.0,
options.size + 2.0 * options.arrow_size);
@@ -250,6 +266,15 @@
}
void
+od_dock_add_sysicon(OD_Icon * sysicon)
+{
+ dock.icons = evas_list_append(dock.icons, sysicon);
+ dock.sysicons = evas_list_append(dock.sysicons, sysicon);
+ sysicon->state |= OD_ICON_STATE_USEABLE;
+ sysicon->appear_timer = ecore_timer_add(0.05, od_dock_icon_appear, sysicon);
+}
+
+void
od_dock_add_minwin(OD_Icon * minwin)
{
dock.icons = evas_list_append(dock.icons, minwin);
@@ -360,6 +385,9 @@
case docked_icon:
dock.dicons = evas_list_remove(dock.dicons, icon);
break;
+ case system_icon:
+ dock.sysicons = evas_list_remove(dock.sysicons, icon);
+ break;
case minimised_window:
dock.minwins = evas_list_remove(dock.minwins, icon);
break;
===================================================================
RCS file: /cvsroot/enlightenment/misc/engage/src/engage.h,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -3 -r1.15 -r1.16
--- engage.h 26 Jul 2004 20:52:28 -0000 1.15
+++ engage.h 3 Aug 2004 20:41:19 -0000 1.16
@@ -100,13 +100,14 @@
#define OD_BG_RIGHT 1
#define OD_BG_FILL 2
#define OD_BG_MIDDLE 3
+#define OD_BG_MIDDLE2 4
struct _OD_Dock {
- Evas_List *icons, *applnks, *dicons, *minwins;
+ Evas_List *icons, *applnks, *dicons, *minwins, *sysicons;
enum { unzoomed, zooming, zoomed, unzooming } state;
double zoom;
double x; // current pointer x position
- Evas_Object *background[4]; // left, right, background, middle, see above
- double left_pos, right_pos, middle_pos; // positions of the vertical
bars
+ Evas_Object *background[5]; // left, right, background, middle, see above
+ double left_pos, right_pos, middle_pos, middle2_pos; // positions of
the vertical bars
double left_end, right_end; // full extent, used for testing for
"in"-ness of mouse pointer
};
@@ -123,7 +124,7 @@
double scale;
double start_time;
Ecore_Timer *appear_timer;
- enum { application_link, docked_icon, minimised_window } type;
+ enum { application_link, docked_icon, minimised_window, system_icon } type;
union {
struct {
char *command;
===================================================================
RCS file: /cvsroot/enlightenment/misc/engage/src/icon.c,v
retrieving revision 1.32
retrieving revision 1.33
diff -u -3 -r1.32 -r1.33
--- icon.c 21 Jun 2004 15:39:22 -0000 1.32
+++ icon.c 3 Aug 2004 20:41:19 -0000 1.33
@@ -19,7 +19,7 @@
Evas_List *icon_paths = NULL;
static OD_Icon *od_icon_new(const char *winclass, const char *name,
- const char *icon_path);
+ const char *icon_path, int type);
static void od_icon_mapping_get(const char *winclass, char **name, char
**icon_name); // DON'T free returned
static char *od_icon_path_get(const char *icon_name);
static void od_icon_edje_app_cb(void *data, Evas_Object * obj,
@@ -41,14 +41,8 @@
od_icon_mapping_get(winclass, &name, &icon_name);
icon_path = od_icon_path_get(icon_name);
- ret = od_icon_new(winclass, name, icon_path);
+ ret = od_icon_new(winclass, name, icon_path, application_link);
-#if 0
- fprintf(stderr,
- "new applnk: name=\"%s\" winclass=\"%s\" icon_path=\"%s\" command=\"%s\"\n",
- name, winclass, icon_path, command);
-#endif
- ret->type = application_link;
ret->data.applnk.command = strdup(command);
ret->data.applnk.winclass = strdup(winclass);
ret->data.applnk.count = 0;
@@ -60,19 +54,23 @@
od_icon_new_dicon(const char *command, const char *name, const char *icon_name)
{
char *icon_path = od_icon_path_get(icon_name);
- OD_Icon *ret = od_icon_new(name, name, icon_path);
+ OD_Icon *ret = od_icon_new(name, name, icon_path, docked_icon);
-#if 0
- fprintf(stderr, "new dicon: name=\"%s\" icon_path=\"%s\" command=\"%s\"\n",
- name, icon_path, command);
-#endif
- ret->type = docked_icon;
ret->data.applnk.command = strdup(command);
free(icon_path);
return ret;
}
OD_Icon *
+od_icon_new_sysicon(const char *name, const char *icon_name)
+{
+ OD_Icon *ret = od_icon_new(name, name, icon_name, system_icon);
+
+ return ret;
+}
+
+
+OD_Icon *
od_icon_new_minwin(Ecore_X_Window win)
{
OD_Icon *ret = NULL;
@@ -86,17 +84,14 @@
od_icon_mapping_get(winclass, &name, &icon_name);
icon_path = od_icon_path_get(icon_name);
- if ((ret = od_icon_new(winclass, title, icon_path))) {
+ if ((ret = od_icon_new(winclass, title, icon_path, minimised_window))) {
#ifdef HAVE_IMLIB
if (options.grab_min_icons != 0)
od_icon_grab(ret, win);
#endif
- ret->type = minimised_window;
ret->data.minwin.window = win;
}
-#if 0
- fprintf(stderr, "new minwin: icon_path=\"%s\"\n", icon_path);
-#endif
+
if (winclass)
free(winclass);
if (title)
@@ -208,6 +203,13 @@
evas_object_del(pic);
pic = NULL;
}
+
+ /* if the icon file is an eet we have a sysicon */
+ if (in->type == system_icon) {
+ if (path)
+ free(path);
+ path = strdup(icon_file);
+ }
if (edje_object_file_set(icon, path, "Main") > 0) {
#if 0
@@ -298,7 +300,8 @@
}
OD_Icon *
-od_icon_new(const char *winclass, const char *name, const char *icon_file)
+od_icon_new(const char *winclass, const char *name, const char *icon_file,
+ int type)
{
OD_Icon *ret = NULL;
@@ -312,6 +315,7 @@
ret->name = strdup(name);
ret->icon_file = strdup(icon_file);
ret->icon = edje_object_add(evas);
+ ret->type = type;
od_icon_reload(ret);
if (ret->icon) {
===================================================================
RCS file: /cvsroot/enlightenment/misc/engage/src/userconfig.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -3 -r1.3 -r1.4
--- userconfig.c 25 Apr 2004 20:00:21 -0000 1.3
+++ userconfig.c 3 Aug 2004 20:41:19 -0000 1.4
@@ -3,6 +3,7 @@
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
+#include <dirent.h>
#include "engage.h"
@@ -81,6 +82,43 @@
free(line);
}
+static void
+userconfig_sysicons_load(void)
+{
+ char path[PATH_MAX];
+ struct dirent *next;
+ DIR *dp;
+ char *file_title, *file_path;
+ int title_len;
+
+ snprintf(path, PATH_MAX, "%s/.e/apps/engage/sysicons", getenv("HOME"));
+ dp = opendir((const char *) path);
+
+ if (!dp)
+ return;
+ while (next = readdir(dp)) {
+ if (!strstr(next->d_name + strlen(next->d_name) - 4, ".eet"))
+ continue;
+
+ file_path = malloc(strlen(path) + strlen(next->d_name) + 2); // 2 = / + \0
+ strcpy(file_path, path);
+ strcat(file_path, "/");
+ strcat(file_path, next->d_name);
+
+ title_len = strlen(next->d_name) - 4;
+ file_title = malloc(title_len + 1);
+ strncpy(file_title, next->d_name, title_len);
+ *(file_title + title_len) = '\0';
+
+ od_dock_add_sysicon(od_icon_new_sysicon(file_title, file_path));
+
+ free(file_path);
+ free(file_title);
+ }
+ closedir(dp);
+
+}
+
int
userconfig_load()
{
@@ -97,6 +135,8 @@
userconfig_applinks_load(fd);
fclose(fd);
}
+
+ userconfig_sysicons_load();
/* nothing special */
return (0);
}
-------------------------------------------------------
This SF.Net email is sponsored by OSTG. Have you noticed the changes on
Linux.com, ITManagersJournal and NewsForge in the past few weeks? Now,
one more big change to announce. We are now OSTG- Open Source Technology
Group. Come see the changes on the new OSTG site. www.ostg.com
_______________________________________________
enlightenment-cvs mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs