forked from enlightenment/enlightenment
parent
36bb6c0019
commit
d017f50c20
|
@ -20,6 +20,7 @@ main.c \
|
|||
menu.c \
|
||||
menudb.c \
|
||||
resist.c \
|
||||
shelf.c \
|
||||
util.c \
|
||||
view.c \
|
||||
e.h
|
||||
|
|
14
src/e.h
14
src/e.h
|
@ -132,6 +132,7 @@ typedef struct _E_Rect E_Rect;
|
|||
typedef struct _E_Active_Action_Timer E_Active_Action_Timer;
|
||||
typedef struct _E_View E_View;
|
||||
typedef struct _E_Icon E_Icon;
|
||||
typedef struct _E_Shelf E_Shelf;
|
||||
typedef struct _E_Background E_Background;
|
||||
typedef struct _E_Menu E_Menu;
|
||||
typedef struct _E_Menu_Item E_Menu_Item;
|
||||
|
@ -344,6 +345,7 @@ struct _E_View
|
|||
int monitor_id;
|
||||
|
||||
Evas_List icons;
|
||||
Evas_List shelves;
|
||||
|
||||
int changed;
|
||||
};
|
||||
|
@ -356,6 +358,9 @@ struct _E_Icon
|
|||
|
||||
E_View *view;
|
||||
|
||||
char *shelf_name;
|
||||
E_Shelf *shelf;
|
||||
|
||||
struct {
|
||||
int x, y, w, h;
|
||||
struct {
|
||||
|
@ -384,6 +389,15 @@ struct _E_Icon
|
|||
int changed;
|
||||
};
|
||||
|
||||
struct _E_Shelf
|
||||
{
|
||||
OBJ_PROPERTIES;
|
||||
|
||||
char *name;
|
||||
|
||||
int x, int y, int w, int h;
|
||||
};
|
||||
|
||||
struct _E_Background
|
||||
{
|
||||
OBJ_PROPERTIES;
|
||||
|
|
68
src/icons.c
68
src/icons.c
|
@ -1,5 +1,46 @@
|
|||
#include "e.h"
|
||||
|
||||
static void e_icon_in_cb(void *_data, Evas _e, Evas_Object _o, int _b, int _x, int _y);
|
||||
static void e_icon_out_cb(void *_data, Evas _e, Evas_Object _o, int _b, int _x, int _y);
|
||||
static void e_icon_down_cb(void *_data, Evas _e, Evas_Object _o, int _b, int _x, int _y);
|
||||
static void e_icon_up_cb(void *_data, Evas _e, Evas_Object _o, int _b, int _x, int _y);
|
||||
|
||||
static void
|
||||
e_icon_in_cb(void *_data, Evas _e, Evas_Object _o, int _b, int _x, int _y)
|
||||
{
|
||||
E_Icon *icon;
|
||||
|
||||
icon = _data;
|
||||
e_icon_set_icon(icon, PACKAGE_DATA_DIR"/data/icons/directory/default.db:/icon/selected");
|
||||
}
|
||||
|
||||
static void
|
||||
e_icon_out_cb(void *_data, Evas _e, Evas_Object _o, int _b, int _x, int _y)
|
||||
{
|
||||
E_Icon *icon;
|
||||
|
||||
icon = _data;
|
||||
e_icon_set_icon(icon, PACKAGE_DATA_DIR"/data/icons/directory/default.db:/icon/normal");
|
||||
}
|
||||
|
||||
static void
|
||||
e_icon_down_cb(void *_data, Evas _e, Evas_Object _o, int _b, int _x, int _y)
|
||||
{
|
||||
E_Icon *icon;
|
||||
|
||||
icon = _data;
|
||||
e_icon_set_icon(icon, PACKAGE_DATA_DIR"/data/icons/directory/default.db:/icon/clicked");
|
||||
}
|
||||
|
||||
static void
|
||||
e_icon_up_cb(void *_data, Evas _e, Evas_Object _o, int _b, int _x, int _y)
|
||||
{
|
||||
E_Icon *icon;
|
||||
|
||||
icon = _data;
|
||||
e_icon_set_icon(icon, PACKAGE_DATA_DIR"/data/icons/directory/default.db:/icon/selected");
|
||||
}
|
||||
|
||||
void
|
||||
e_icon_free(E_Icon *icon)
|
||||
{
|
||||
|
@ -29,6 +70,20 @@ e_icon_calulcate_geometry(E_Icon *icon)
|
|||
void
|
||||
e_icon_realize(E_Icon *icon)
|
||||
{
|
||||
icon->obj.sel1 = evas_add_rectangle(icon->view->evas);
|
||||
icon->obj.sel2 = evas_add_rectangle(icon->view->evas);
|
||||
evas_set_layer(icon->view->evas, icon->obj.sel1, 11);
|
||||
evas_set_layer(icon->view->evas, icon->obj.sel2, 11);
|
||||
evas_set_color(icon->view->evas, icon->obj.sel1, 0, 0, 0, 0);
|
||||
evas_set_color(icon->view->evas, icon->obj.sel2, 0, 0, 0, 0);
|
||||
evas_callback_add(icon->view->evas, icon->obj.sel1, CALLBACK_MOUSE_IN, e_icon_in_cb, icon);
|
||||
evas_callback_add(icon->view->evas, icon->obj.sel1, CALLBACK_MOUSE_OUT, e_icon_out_cb, icon);
|
||||
evas_callback_add(icon->view->evas, icon->obj.sel1, CALLBACK_MOUSE_DOWN, e_icon_down_cb, icon);
|
||||
evas_callback_add(icon->view->evas, icon->obj.sel1, CALLBACK_MOUSE_UP, e_icon_up_cb, icon);
|
||||
evas_callback_add(icon->view->evas, icon->obj.sel2, CALLBACK_MOUSE_IN, e_icon_in_cb, icon);
|
||||
evas_callback_add(icon->view->evas, icon->obj.sel2, CALLBACK_MOUSE_OUT, e_icon_out_cb, icon);
|
||||
evas_callback_add(icon->view->evas, icon->obj.sel2, CALLBACK_MOUSE_DOWN, e_icon_down_cb, icon);
|
||||
evas_callback_add(icon->view->evas, icon->obj.sel2, CALLBACK_MOUSE_UP, e_icon_up_cb, icon);
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -36,8 +91,12 @@ e_icon_unrealize(E_Icon *icon)
|
|||
{
|
||||
if (icon->obj.icon) evas_del_object(icon->view->evas, icon->obj.icon);
|
||||
if (icon->obj.filename) evas_del_object(icon->view->evas, icon->obj.filename);
|
||||
if (icon->obj.sel1) evas_del_object(icon->view->evas, icon->obj.sel1);
|
||||
if (icon->obj.sel2) evas_del_object(icon->view->evas, icon->obj.sel2);
|
||||
icon->obj.icon = NULL;
|
||||
icon->obj.filename = NULL;
|
||||
icon->obj.sel1 = NULL;
|
||||
icon->obj.sel2 = NULL;
|
||||
if (icon->view) icon->view->changed = 1;
|
||||
}
|
||||
|
||||
|
@ -138,8 +197,11 @@ e_icon_update(E_Icon *icon)
|
|||
fy = icon->current.y + ih;
|
||||
evas_move(icon->view->evas, icon->obj.icon, icon->current.x, icon->current.y);
|
||||
evas_move(icon->view->evas, icon->obj.filename, fx, fy);
|
||||
evas_move(icon->view->evas, icon->obj.sel1, icon->current.x, icon->current.y);
|
||||
evas_resize(icon->view->evas, icon->obj.sel1, iw, ih);
|
||||
evas_move(icon->view->evas, icon->obj.sel2, fx, fy);
|
||||
evas_resize(icon->view->evas, icon->obj.sel2, tw, th);
|
||||
evas_set_color(icon->view->evas, icon->obj.filename, 0, 0, 0, 255);
|
||||
printf("create filename (%s %i %i)\n", icon->file, fx, fy);
|
||||
}
|
||||
if (icon->current.visible != icon->previous.visible)
|
||||
{
|
||||
|
@ -147,11 +209,15 @@ e_icon_update(E_Icon *icon)
|
|||
{
|
||||
evas_show(icon->view->evas, icon->obj.icon);
|
||||
evas_show(icon->view->evas, icon->obj.filename);
|
||||
evas_show(icon->view->evas, icon->obj.sel1);
|
||||
evas_show(icon->view->evas, icon->obj.sel2);
|
||||
}
|
||||
else
|
||||
{
|
||||
evas_hide(icon->view->evas, icon->obj.icon);
|
||||
evas_hide(icon->view->evas, icon->obj.filename);
|
||||
evas_hide(icon->view->evas, icon->obj.sel1);
|
||||
evas_hide(icon->view->evas, icon->obj.sel2);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
#include "e.h"
|
Loading…
Reference in New Issue