forked from enlightenment/enlightenment
RIP!
No more epplet support. It should once again compile regardless of whether ferite is used or not. SVN revision: 5981
This commit is contained in:
parent
a21dcda8c8
commit
a7e397198d
|
@ -18,18 +18,12 @@ ferite_c = e_ferite_gen_core.c \
|
|||
e_ferite_gen_header.h \
|
||||
e_ferite_gen_e.c \
|
||||
e_ferite_gen_Border.c \
|
||||
e_ferite_gen_Epplet.c \
|
||||
e_ferite_gen_Ebits.c \
|
||||
e_ferite_gen_EvasObject.c \
|
||||
e_ferite.h e_ferite.c
|
||||
|
||||
BUILT_SOURCES = e_ferite_gen_core.c \
|
||||
e_ferite_gen_header.h \
|
||||
e_ferite_gen_e.c \
|
||||
e_ferite_gen_Border.c \
|
||||
e_ferite_gen_Epplet.c \
|
||||
e_ferite_gen_Ebits.c \
|
||||
e_ferite_gen_EvasObject.c
|
||||
e_ferite_gen_Border.c
|
||||
|
||||
# Yes, blank because we don't want it to supply
|
||||
# it's own build rule.
|
||||
|
@ -57,7 +51,6 @@ enlightenment_SOURCES = \
|
|||
desktops.h desktops.c \
|
||||
embed.c embed.h \
|
||||
entry.h entry.c \
|
||||
epplet.h epplet.c \
|
||||
exec.h exec.c \
|
||||
focus.h focus.c \
|
||||
file.h file.c \
|
||||
|
|
564
src/e_ferite.fec
564
src/e_ferite.fec
|
@ -6,16 +6,11 @@ header %{
|
|||
|
||||
#include "desktops.h"
|
||||
#include "border.h"
|
||||
#include "epplet.h"
|
||||
#include "debug.h"
|
||||
#include "globals.h"
|
||||
#include "observer.h"
|
||||
#include "file.h"
|
||||
|
||||
#define BorderObj ((E_Border *)(self->odata))
|
||||
#define BitsObj ((Ebits_Object)self->odata)
|
||||
#define EppObj ((E_Epplet *)(self->odata))
|
||||
#define EvasObj ((Evas_Object_Wrapper *)(self->odata))
|
||||
|
||||
%}
|
||||
|
||||
|
@ -173,562 +168,3 @@ namespace e {
|
|||
%}
|
||||
}
|
||||
|
||||
class EvasObject
|
||||
{
|
||||
function EvasObject(object epp)
|
||||
%{
|
||||
EvasObj = NEW(Evas_Object_Wrapper, 1);
|
||||
ZERO(EvasObj, Evas_Object_Wrapper, 1);
|
||||
|
||||
EvasObj->epp = (E_Epplet *)(epp->odata);
|
||||
EvasObj->evas = EvasObj->epp->view->evas;
|
||||
|
||||
EvasObj->epp->evas_objects = evas_list_append(EvasObj->epp->evas_objects, EvasObj);
|
||||
|
||||
%}
|
||||
|
||||
function Destructor()
|
||||
%{
|
||||
%}
|
||||
|
||||
function addImage(string file)
|
||||
%{
|
||||
char buf[PATH_MAX];
|
||||
|
||||
if (EvasObj->evas && EvasObj->epp)
|
||||
{
|
||||
snprintf(buf, PATH_MAX, "%s%s", EvasObj->epp->view->dir, file);
|
||||
EvasObj->obj = evas_add_image_from_file(EvasObj->evas, file);
|
||||
}
|
||||
ffree(file);
|
||||
%}
|
||||
|
||||
function addRectangle()
|
||||
%{
|
||||
if (EvasObj->evas)
|
||||
EvasObj->obj = evas_add_rectangle(EvasObj->evas);
|
||||
%}
|
||||
|
||||
function addText(string font, number size, string text)
|
||||
%{
|
||||
if (EvasObj->evas)
|
||||
{
|
||||
evas_font_add_path(EvasObj->evas, EvasObj->epp->dir);
|
||||
EvasObj->obj = evas_add_text(EvasObj->evas, font, (long)size, text);
|
||||
}
|
||||
ffree(font);
|
||||
ffree(text);
|
||||
%}
|
||||
|
||||
function setImageFile(string path)
|
||||
%{
|
||||
if (EvasObj->evas && EvasObj->obj)
|
||||
evas_set_image_file(EvasObj->evas, EvasObj->obj, path);
|
||||
ffree(path);
|
||||
%}
|
||||
|
||||
function setText(string text)
|
||||
%{
|
||||
if (EvasObj->evas && EvasObj->obj)
|
||||
evas_set_text(EvasObj->evas, EvasObj->obj, text);
|
||||
ffree(text);
|
||||
%}
|
||||
|
||||
function move(number x, number y)
|
||||
%{
|
||||
if (EvasObj->evas && EvasObj->obj)
|
||||
evas_move(EvasObj->evas, EvasObj->obj, x, y);
|
||||
%}
|
||||
|
||||
function resize(number w, number h)
|
||||
%{
|
||||
if (EvasObj->evas && EvasObj->obj)
|
||||
evas_resize(EvasObj->evas, EvasObj->obj, w, h);
|
||||
%}
|
||||
|
||||
function resizeF(number w, number h)
|
||||
%{
|
||||
if (EvasObj->evas && EvasObj->obj)
|
||||
{
|
||||
evas_resize(EvasObj->evas, EvasObj->obj, w, h);
|
||||
evas_set_image_fill(EvasObj->evas, EvasObj->obj, 0, 0, w, h);
|
||||
}
|
||||
%}
|
||||
|
||||
function setLayer(number l)
|
||||
%{
|
||||
if (EvasObj->evas && EvasObj->obj)
|
||||
evas_set_layer(EvasObj->evas, EvasObj->obj, l);
|
||||
%}
|
||||
|
||||
function show()
|
||||
%{
|
||||
if (EvasObj->evas && EvasObj->obj)
|
||||
evas_show(EvasObj->evas, EvasObj->obj);
|
||||
%}
|
||||
|
||||
function hide()
|
||||
%{
|
||||
if (EvasObj->evas && EvasObj->obj)
|
||||
evas_hide(EvasObj->evas, EvasObj->obj);
|
||||
%}
|
||||
|
||||
function setColor(number r, number g, number b, number a)
|
||||
%{
|
||||
if (EvasObj->evas && EvasObj->obj)
|
||||
evas_set_color(EvasObj->evas, EvasObj->obj, (long)r, (long)g, (long)b, (long)a);
|
||||
%}
|
||||
|
||||
|
||||
function setImageFill(number x, number y, number w, number h)
|
||||
%{
|
||||
if (EvasObj->evas && EvasObj->obj)
|
||||
evas_set_image_fill(EvasObj->evas, EvasObj->obj, x, y, w, h);
|
||||
%}
|
||||
|
||||
function setImageBorder(number l, number r, number t, number b)
|
||||
%{
|
||||
if (EvasObj->evas && EvasObj->obj)
|
||||
evas_set_image_border(EvasObj->evas, EvasObj->obj, l, r, t, b);
|
||||
%}
|
||||
|
||||
function getX()
|
||||
%{
|
||||
double x;
|
||||
if (EvasObj->evas && EvasObj->obj)
|
||||
{
|
||||
evas_get_geometry(EvasObj->evas, EvasObj->obj, &x, NULL, NULL, NULL);
|
||||
FE_RETURN_DOUBLE(x);
|
||||
}
|
||||
%}
|
||||
|
||||
function getY()
|
||||
%{
|
||||
double y;
|
||||
if (EvasObj->evas && EvasObj->obj)
|
||||
{
|
||||
evas_get_geometry(EvasObj->evas, EvasObj->obj, NULL, &y, NULL, NULL);
|
||||
FE_RETURN_DOUBLE(y);
|
||||
}
|
||||
%}
|
||||
|
||||
function getW()
|
||||
%{
|
||||
double w;
|
||||
if (EvasObj->evas && EvasObj->obj)
|
||||
{
|
||||
evas_get_geometry(EvasObj->evas, EvasObj->obj, NULL, NULL, &w, NULL);
|
||||
FE_RETURN_DOUBLE(w);
|
||||
}
|
||||
%}
|
||||
|
||||
function getH()
|
||||
%{
|
||||
double h;
|
||||
if (EvasObj->evas && EvasObj->obj)
|
||||
{
|
||||
evas_get_geometry(EvasObj->evas, EvasObj->obj, NULL, NULL, NULL, &h);
|
||||
FE_RETURN_DOUBLE(h);
|
||||
}
|
||||
%}
|
||||
|
||||
function setCallback(string type, string func, object data)
|
||||
%{
|
||||
E_Epplet_CB_Info *cb;
|
||||
|
||||
cb = e_epplet_cb_new(script, func, data, self);
|
||||
|
||||
D("check for callback type\n");
|
||||
if(!strcmp(type, "CALLBACK_MOUSE_DOWN"))
|
||||
{
|
||||
D("mouse down cb!\n");
|
||||
evas_callback_add(EvasObj->evas, EvasObj->obj, CALLBACK_MOUSE_DOWN,
|
||||
e_epplet_evas_cb, cb);
|
||||
}
|
||||
|
||||
else if(!strcmp(type, "CALLBACK_MOUSE_UP"))
|
||||
{
|
||||
D("mouse up cb!\n");
|
||||
evas_callback_add(EvasObj->evas, EvasObj->obj, CALLBACK_MOUSE_UP,
|
||||
e_epplet_evas_cb, cb);
|
||||
}
|
||||
|
||||
else if(!strcmp(type, "CALLBACK_MOUSE_MOVE"))
|
||||
{
|
||||
D("mouse move cb!\n");
|
||||
evas_callback_add(EvasObj->evas, EvasObj->obj, CALLBACK_MOUSE_MOVE,
|
||||
e_epplet_evas_cb, cb);
|
||||
}
|
||||
|
||||
ffree(func);
|
||||
ffree(type);
|
||||
%}
|
||||
|
||||
}
|
||||
|
||||
class Ebits
|
||||
{
|
||||
|
||||
function Ebits(string file, object epp)
|
||||
%{
|
||||
char buf[PATH_MAX];
|
||||
|
||||
snprintf(buf, PATH_MAX, "%s/.e_epplets/%s/%s", ((E_Epplet *)(epp->odata))->view->dir, ((E_Epplet *)(epp->odata))->name, file);
|
||||
D("adding ebits: %s\n", buf);
|
||||
BitsObj = NULL;
|
||||
BitsObj = ebits_load(buf);
|
||||
|
||||
((E_Epplet *)(epp->odata))->ebits = evas_list_append(((E_Epplet *)(epp->odata))->ebits, BitsObj);
|
||||
/*
|
||||
if (BitsObj)
|
||||
D("bits loaded\n");
|
||||
else
|
||||
D("ERROR: bits not found\n");
|
||||
*/
|
||||
ffree(file);
|
||||
%}
|
||||
|
||||
function Destructor()
|
||||
%{
|
||||
/* FIXME: if i leave this in, the bits get freed and removed before you can
|
||||
see them. I guess it just needs to be called when the epplet itself is
|
||||
destroyed */
|
||||
/*
|
||||
ebits_free(BitsObj);
|
||||
*/
|
||||
%}
|
||||
|
||||
function free()
|
||||
%{
|
||||
if(BitsObj)
|
||||
ebits_free(BitsObj);
|
||||
%}
|
||||
|
||||
function show()
|
||||
%{
|
||||
if(BitsObj)
|
||||
ebits_show(BitsObj);
|
||||
%}
|
||||
|
||||
function hide()
|
||||
%{
|
||||
if(BitsObj)
|
||||
ebits_hide(BitsObj);
|
||||
%}
|
||||
|
||||
function raise()
|
||||
%{
|
||||
if(BitsObj)
|
||||
ebits_raise(BitsObj);
|
||||
%}
|
||||
|
||||
function lower()
|
||||
%{
|
||||
if(BitsObj)
|
||||
ebits_lower(BitsObj);
|
||||
%}
|
||||
|
||||
function move(number x, number y)
|
||||
%{
|
||||
if(BitsObj)
|
||||
ebits_move(BitsObj, x, y);
|
||||
%}
|
||||
|
||||
function resize(number w, number h)
|
||||
%{
|
||||
if(BitsObj)
|
||||
ebits_resize(BitsObj, w, h);
|
||||
%}
|
||||
|
||||
function setLayer(number l)
|
||||
%{
|
||||
if(BitsObj)
|
||||
ebits_set_layer(BitsObj, l);
|
||||
%}
|
||||
|
||||
function setState(string bitName, string state)
|
||||
%{
|
||||
if(BitsObj)
|
||||
ebits_set_named_bit_state(BitsObj, bitName, state);
|
||||
ffree(bitName);
|
||||
ffree(state);
|
||||
%}
|
||||
/*
|
||||
function getNamedBitGeometry(string bitName, number x, number y, number w, number h)
|
||||
%{
|
||||
double xx, yy, ww, hh;
|
||||
ebits_get_named_bit_geometry(BitsObj, bitName, &xx, &yy, &ww, &hh);
|
||||
|
||||
x = xx;
|
||||
y = yy;
|
||||
w = ww;
|
||||
h = hh;
|
||||
%}
|
||||
*/
|
||||
|
||||
function getNamedBitGeometryX(string bitName)
|
||||
%{
|
||||
double x;
|
||||
if(BitsObj)
|
||||
ebits_get_named_bit_geometry(BitsObj, bitName, &x, NULL, NULL, NULL);
|
||||
ffree(bitName);
|
||||
FE_RETURN_DOUBLE(x);
|
||||
%}
|
||||
|
||||
function getNamedBitGeometryY(string bitName)
|
||||
%{
|
||||
double y;
|
||||
if(BitsObj)
|
||||
ebits_get_named_bit_geometry(BitsObj, bitName, NULL, &y, NULL, NULL);
|
||||
ffree(bitName);
|
||||
FE_RETURN_DOUBLE(y);
|
||||
%}
|
||||
|
||||
function getNamedBitGeometryW(string bitName)
|
||||
%{
|
||||
double w;
|
||||
if(BitsObj)
|
||||
ebits_get_named_bit_geometry(BitsObj, bitName, NULL, NULL, &w, NULL);
|
||||
ffree(bitName);
|
||||
FE_RETURN_DOUBLE(w);
|
||||
%}
|
||||
|
||||
function getNamedBitGeometryH(string bitName)
|
||||
%{
|
||||
double h;
|
||||
if(BitsObj)
|
||||
ebits_get_named_bit_geometry(BitsObj, bitName, NULL, NULL, NULL, &h);
|
||||
ffree(bitName);
|
||||
FE_RETURN_DOUBLE(h);
|
||||
%}
|
||||
|
||||
function setCallback(string bitClass, string func, object data)
|
||||
%{
|
||||
E_Epplet_CB_Info *cb;
|
||||
|
||||
cb = e_epplet_cb_new(script, func, data, NULL);
|
||||
|
||||
if(BitsObj)
|
||||
ebits_set_classed_bit_callback(BitsObj, bitClass, CALLBACK_MOUSE_DOWN,
|
||||
e_epplet_bits_cb, cb);
|
||||
|
||||
ffree(bitClass);
|
||||
ffree(func);
|
||||
%}
|
||||
}
|
||||
|
||||
class Epplet
|
||||
{
|
||||
|
||||
object ui;
|
||||
|
||||
function Epplet()
|
||||
%{
|
||||
char buf[PATH_MAX];
|
||||
/* FeriteVariable *ui;
|
||||
FeriteVariable **params;*/
|
||||
|
||||
EppObj = e_epplet_new(script);
|
||||
#if 0
|
||||
/* FIXME: this is not complete, object creation doesn't work for some reason??? */
|
||||
D("epplet created\n");
|
||||
/* if ui.bits.db exists, make it the ui */
|
||||
snprintf(buf, PATH_MAX, "%sui.bits.db", EppObj->dir);
|
||||
if (e_file_exists(buf))
|
||||
{
|
||||
EppObj->ui = ebits_load(buf);
|
||||
ebits_add_to_evas(EppObj->ui, EppObj->view->evas);
|
||||
|
||||
/* ui = __ferite_get_variable_from_hash(script, self->variables, "ui");*/
|
||||
params = __ferite_create_parameter_list_from_data(script, "so", "ui.bits.db", self);
|
||||
ui = __ferite_new_object( script, __ferite_find_class(script, script->mainns, "Ebits"), params );
|
||||
__ferite_delete_parameter_list(script, params);
|
||||
D("object created, name: %s\n", ui->name);
|
||||
|
||||
/*FIXME: how do i set an object's data?*/
|
||||
}
|
||||
#endif
|
||||
|
||||
/* if layout.bits.db exists, make it the layout */
|
||||
snprintf(buf, PATH_MAX, "%slayout.bits.db", EppObj->dir);
|
||||
if (e_file_exists(buf))
|
||||
{
|
||||
double x, y, w, h;
|
||||
|
||||
EppObj->layout = ebits_load(buf);
|
||||
ebits_add_to_evas(EppObj->layout, EppObj->view->evas);
|
||||
ebits_move(EppObj->layout, 0, 0);
|
||||
ebits_resize(EppObj->layout, EppObj->view->size.w, EppObj->view->size.h);
|
||||
ebits_get_named_bit_geometry(EppObj->layout, EppObj->name,
|
||||
&x, &y, &w, &h);
|
||||
|
||||
EppObj->current.x = x;
|
||||
EppObj->current.y = y;
|
||||
EppObj->current.w = w;
|
||||
EppObj->current.h = h;
|
||||
}
|
||||
%}
|
||||
|
||||
function setBits(object ebits)
|
||||
%{
|
||||
EppObj->ui = ((Ebits_Object)ebits->odata);
|
||||
|
||||
if(EppObj->ui && EppObj->view)
|
||||
{
|
||||
ebits_add_to_evas(EppObj->ui, EppObj->view->evas);
|
||||
e_epplet_set_common_callbacks(EppObj);
|
||||
D("bits added to view\n");
|
||||
D("view dir: %s\n", EppObj->view->dir);
|
||||
}
|
||||
else
|
||||
{
|
||||
D("ERROR: no bits or no view, can't add bits to view evas\n");
|
||||
}
|
||||
|
||||
%}
|
||||
|
||||
function move(number x, number y)
|
||||
%{
|
||||
D("in epp.move\n");
|
||||
EppObj->current.x = x;
|
||||
EppObj->current.y = y;
|
||||
|
||||
D("moving epplet: %f, %f\n", x, y);
|
||||
|
||||
if (EppObj->ui)
|
||||
ebits_move(EppObj->ui, EppObj->current.x, EppObj->current.y);
|
||||
%}
|
||||
|
||||
function resize(number w, number h)
|
||||
%{
|
||||
EppObj->current.w = w;
|
||||
EppObj->current.h = h;
|
||||
if (EppObj->ui)
|
||||
ebits_resize(EppObj->ui, EppObj->current.w, EppObj->current.h);
|
||||
%}
|
||||
|
||||
function getX()
|
||||
%{
|
||||
FE_RETURN_DOUBLE(EppObj->current.x);
|
||||
%}
|
||||
|
||||
function getY()
|
||||
%{
|
||||
FE_RETURN_DOUBLE(EppObj->current.y);
|
||||
%}
|
||||
|
||||
function getW()
|
||||
%{
|
||||
FE_RETURN_DOUBLE(EppObj->current.w);
|
||||
%}
|
||||
|
||||
function getH()
|
||||
%{
|
||||
FE_RETURN_DOUBLE(EppObj->current.h);
|
||||
%}
|
||||
|
||||
function display()
|
||||
%{
|
||||
int mw, mh;
|
||||
D("in display()\n");
|
||||
if(EppObj->view && EppObj->ui)
|
||||
{
|
||||
ebits_show(EppObj->ui);
|
||||
|
||||
ebits_get_min_size(EppObj->ui, &mw, &mh);
|
||||
if ( EppObj->current.w < mw ) EppObj->current.w = mw;
|
||||
if ( EppObj->current.h < mh ) EppObj->current.h = mh;
|
||||
|
||||
ebits_get_max_size(EppObj->ui, &mw, &mh);
|
||||
if ( EppObj->current.w > mw ) EppObj->current.w = mw;
|
||||
if ( EppObj->current.h > mh ) EppObj->current.h = mh;
|
||||
|
||||
if (EppObj->current.x > (EppObj->view->size.w - EppObj->current.w))
|
||||
EppObj->current.x = EppObj->view->size.w - EppObj->current.w;
|
||||
if (EppObj->current.y > (EppObj->view->size.h - EppObj->current.h))
|
||||
EppObj->current.y = EppObj->view->size.h - EppObj->current.h;
|
||||
|
||||
ebits_set_layer(EppObj->ui, 12000);
|
||||
ebits_resize(EppObj->ui, EppObj->current.w, EppObj->current.h);
|
||||
ebits_move(EppObj->ui, EppObj->current.x, EppObj->current.y);
|
||||
}
|
||||
%}
|
||||
|
||||
/*
|
||||
function getBits()
|
||||
%{
|
||||
FE_RETURN_VAR(EppObj->fbits);
|
||||
%}
|
||||
*/
|
||||
|
||||
function getViewW()
|
||||
%{
|
||||
FE_RETURN_LONG(EppObj->view->size.w);
|
||||
%}
|
||||
|
||||
function getViewH()
|
||||
%{
|
||||
FE_RETURN_LONG(EppObj->view->size.h);
|
||||
%}
|
||||
|
||||
function getEppletDir()
|
||||
%{
|
||||
char buf[PATH_MAX], *retval;
|
||||
|
||||
printf("getting dir:\n");
|
||||
snprintf(buf, PATH_MAX, "%s/.e_epplets/%s/", EppObj->view->dir, EppObj->name);
|
||||
printf("%s\n", buf);
|
||||
retval = (char *)buf;
|
||||
FE_RETURN_STR(retval, 0);
|
||||
%}
|
||||
|
||||
function addTimer(string name, number time, string func, number val, object data)
|
||||
%{
|
||||
char buf[PATH_MAX];
|
||||
E_Epplet_CB_Info *cb;
|
||||
|
||||
cb = e_epplet_cb_new(script, func, data, NULL);
|
||||
snprintf(buf, PATH_MAX, "%s:%s", EppObj->name, name);
|
||||
ecore_add_event_timer(buf, (double)time, e_epplet_timer_func, val, cb);
|
||||
ffree(func);
|
||||
%}
|
||||
|
||||
function delTimer(string name)
|
||||
%{
|
||||
char buf[PATH_MAX];
|
||||
|
||||
snprintf(buf, PATH_MAX, "%s:%s", EppObj->name, name);
|
||||
ecore_del_event_timer(buf);
|
||||
ffree(name);
|
||||
%}
|
||||
|
||||
function addDesktopObserver(string func_name, object data)
|
||||
%{
|
||||
E_Epplet_Observer *obs;
|
||||
|
||||
obs = e_epplet_observer_new(script, func_name, data, "DESKTOP_SWITCH");
|
||||
e_epplet_observer_register_desktops(obs);
|
||||
ffree(func_name);
|
||||
%}
|
||||
|
||||
/*
|
||||
function addIconifyObserver(string func_name, object data)
|
||||
%{
|
||||
E_Epplet_Observer *obs;
|
||||
|
||||
obs = e_epplet_observer_new(script, func_name, data, "ICONIFY");
|
||||
e_epplet_observer_register_borders(obs);
|
||||
ffree(func_name);
|
||||
%}
|
||||
|
||||
function addUnconifyObserver(string func_name, object data)
|
||||
%{
|
||||
E_Epplet_Observer *obs;
|
||||
|
||||
obs = e_epplet_observer_new(script, func_name, data, "UNICONIFY");
|
||||
e_epplet_observer_register_borders(obs);
|
||||
ffree(func_name);
|
||||
%}
|
||||
*/
|
||||
}
|
||||
|
||||
|
|
|
@ -11,7 +11,6 @@
|
|||
#include "file.h"
|
||||
#include "util.h"
|
||||
#include "icons.h"
|
||||
#include "epplet.h"
|
||||
#include "e_view_model.h"
|
||||
#include "e_view_machine.h"
|
||||
#include "e_file.h"
|
||||
|
@ -1803,7 +1802,7 @@ e_view_realize(E_View *v)
|
|||
}
|
||||
|
||||
e_view_bg_reload(v);
|
||||
e_epplet_load_from_layout(v);
|
||||
/* e_epplet_load_from_layout(v);*/
|
||||
v->changed = 1;
|
||||
D_RETURN;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue