2009-03-30 06:34:32 -07:00
|
|
|
#include "e.h"
|
|
|
|
#include "e_mod_main.h"
|
|
|
|
|
2009-03-30 23:22:55 -07:00
|
|
|
// FIXME:
|
2009-06-26 08:11:03 -07:00
|
|
|
// need choice after add (file, gradient, online source)
|
|
|
|
// need delete select mode
|
|
|
|
// need after select on delete an ok/cancel if file or "ok to remove whole online source" if online
|
2009-04-04 07:37:07 -07:00
|
|
|
// need to make "exchange" wallpapers have a different look
|
2010-09-08 16:59:07 -07:00
|
|
|
// bug: animated wp doesn't workon first show
|
2009-06-26 08:11:03 -07:00
|
|
|
// need to be able to "type name to search/filter"
|
2009-03-30 23:22:55 -07:00
|
|
|
|
2009-03-30 06:34:32 -07:00
|
|
|
typedef struct _Info Info;
|
|
|
|
typedef struct _Smart_Data Smart_Data;
|
|
|
|
typedef struct _Item Item;
|
|
|
|
|
|
|
|
struct _Info
|
|
|
|
{
|
2010-08-01 10:59:31 -07:00
|
|
|
E_Win *win;
|
2009-03-30 06:34:32 -07:00
|
|
|
Evas_Object *bg, *preview, *mini, *button, *box, *sframe, *span;
|
2013-01-23 02:18:46 -08:00
|
|
|
Eina_Stringshare *bg_file;
|
2010-08-01 10:59:31 -07:00
|
|
|
int iw, ih;
|
|
|
|
Eina_List *dirs;
|
|
|
|
char *curdir;
|
2012-04-30 00:07:33 -07:00
|
|
|
Eina_Iterator *dir;
|
2009-03-30 06:34:32 -07:00
|
|
|
Ecore_Idler *idler;
|
2010-08-01 10:59:31 -07:00
|
|
|
int scans;
|
compositor rewrite / charlie-foxtrot situation
huge fustercluck commit because there wasn't really a way to separate out the changes. better to just rip it all out at once.
* compositor and window management completely rewritten. this was the goal for E19, but it pretty much required everything existing to be scrapped since it wasn't optimized, streamlined, or sensible. now instead of having the compositor strapped to the window manager like an outboard motor, it's housed more like an automobile engine.
** various comp structs have been merged into other places (eg. E_Comp_Zone is now just part of E_Zone where applicable), leading to a large deduplication of attributes
** awful E_Comp_Win is totally dead, having been replaced with e_comp_object smart objects which work just like normal canvas objects
** protocol-specific window management and compositor functionality is now kept exclusively in backend files
** e_pixmap api provides generic client finding and rendering api
** screen/xinerama screens are now provided directly by compositor on startup and re-set on change
** e_comp_render_update finally replaced with eina_tiler
** wayland compositor no longer creates X windows
** compositor e_layout removed entirely
* e_container is gone. this was made unnecessary in E18, but I kept it to avoid having too much code churn in one release. its sole purpose was to catch some events and handle window stacking, both of which are now just done by the compositor infra
* e_manager is just for screensaver and keybind stuff now, possibly remove later?
* e_border is gone along with a lot of its api. e_client has replaced it, and e_client has been rewritten completely; some parts may be similar, but the design now relies upon having a functional compositor
** window configuration/focus functions are all removed. all windows are now managed solely with evas_object_X functions on the "frame" member of a client, just as any other canvas object can be managed.
*** do NOT set interceptors on a client's comp_object. seriously.
* startup order rewritten: compositor now starts much earlier, other things just use attrs and members of the compositor
* ecore_x_pointer_xy_get usage replaced with ecore_evas_pointer_xy_get
* e_popup is totally gone, existing usage replaced by e_comp_object_util_add where applicable, otherwise just placed normally on the canvas
* deskmirror is (more) broken for now
* illume is totally fucked
* Ecore_X_Window replaced with Ecore_Window in most cases
* edge binding XWindows replaced with regular canvas objects
* some E_Win functionality has changed such that delete callbacks are now correctly called in ALL cases. various dialogs have been updated to not crash as a result
comp files and descriptions:
e_comp.c - overall compositor functions, rendering/update loop, shape cutting
e_comp_x.c - X window management and compositor functionality
e_comp_wl.c - Wayland surface management and compositor functionality
e_comp_canvas.c - general compositor canvas functions and utilities
e_comp_object.c - E_Client->frame member for managing clients as Evas_Objects, utility functions for adding objects to the compositor rendering systems
additional authors: ivan.briano@intel.com
feature: new compositor
removal: e_border, e_container, e_popup
2014-01-14 17:19:12 -08:00
|
|
|
int man_num, zone_num, desk_x, desk_y;
|
2010-08-01 10:59:31 -07:00
|
|
|
int use_theme_bg;
|
|
|
|
int mode;
|
2009-03-30 06:34:32 -07:00
|
|
|
};
|
|
|
|
|
|
|
|
struct _Smart_Data
|
|
|
|
{
|
2010-08-01 10:59:31 -07:00
|
|
|
Eina_List *items;
|
2009-03-30 06:34:32 -07:00
|
|
|
Ecore_Idle_Enterer *idle_enter;
|
|
|
|
Ecore_Animator *animator;
|
2009-03-31 05:20:35 -07:00
|
|
|
Ecore_Timer *seltimer;
|
2010-08-01 10:59:31 -07:00
|
|
|
Info *info;
|
|
|
|
Evas_Coord x, y, w, h;
|
|
|
|
Evas_Coord cx, cy, cw, ch;
|
|
|
|
Evas_Coord sx, sy;
|
|
|
|
int id_num;
|
|
|
|
int sort_num;
|
|
|
|
double seltime;
|
|
|
|
double selmove;
|
|
|
|
Eina_Bool selin : 1;
|
|
|
|
Eina_Bool selout : 1;
|
|
|
|
Eina_Bool jump2hi : 1;
|
2009-03-30 06:34:32 -07:00
|
|
|
};
|
|
|
|
|
|
|
|
struct _Item
|
|
|
|
{
|
|
|
|
Evas_Object *obj;
|
|
|
|
Evas_Coord x, y, w, h;
|
2013-01-23 02:18:46 -08:00
|
|
|
Eina_Stringshare *file;
|
2009-04-18 06:52:41 -07:00
|
|
|
char *sort_id;
|
2009-03-30 06:34:32 -07:00
|
|
|
Evas_Object *frame, *image;
|
2009-06-17 06:46:54 -07:00
|
|
|
Eina_Bool selected : 1;
|
|
|
|
Eina_Bool have_thumb : 1;
|
|
|
|
Eina_Bool do_thumb : 1;
|
|
|
|
Eina_Bool remote : 1;
|
|
|
|
Eina_Bool theme : 1;
|
|
|
|
Eina_Bool visible : 1;
|
2009-07-06 02:43:58 -07:00
|
|
|
Eina_Bool hilighted : 1;
|
2009-03-30 06:34:32 -07:00
|
|
|
};
|
|
|
|
|
2009-03-30 23:51:12 -07:00
|
|
|
static Info *global_info = NULL;
|
2009-03-30 06:34:32 -07:00
|
|
|
|
|
|
|
static void _e_smart_reconfigure(Evas_Object *obj);
|
2012-07-09 02:09:02 -07:00
|
|
|
static Eina_Bool _e_smart_reconfigure_do(void *data);
|
2010-08-01 10:59:31 -07:00
|
|
|
static void _thumb_gen(void *data, Evas_Object *obj, void *event_info);
|
|
|
|
static void _item_down(void *data, Evas *e, Evas_Object *obj, void *event_info);
|
|
|
|
static void _item_up(void *data, Evas *e, Evas_Object *obj, void *event_info);
|
|
|
|
static int _sort_cb(const void *d1, const void *d2);
|
|
|
|
static void _scan(Info *info);
|
2009-03-30 06:34:32 -07:00
|
|
|
|
|
|
|
static void
|
|
|
|
_pan_set(Evas_Object *obj, Evas_Coord x, Evas_Coord y)
|
|
|
|
{
|
|
|
|
Smart_Data *sd = evas_object_smart_data_get(obj);
|
2010-08-01 10:59:31 -07:00
|
|
|
|
2009-03-30 06:34:32 -07:00
|
|
|
if (x > (sd->cw - sd->w)) x = sd->cw - sd->w;
|
|
|
|
if (y > (sd->ch - sd->h)) y = sd->ch - sd->h;
|
|
|
|
if (x < 0) x = 0;
|
|
|
|
if (y < 0) y = 0;
|
|
|
|
if ((sd->cx == x) && (sd->cy == y)) return;
|
|
|
|
sd->cx = x;
|
|
|
|
sd->cy = y;
|
|
|
|
_e_smart_reconfigure(obj);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_pan_get(Evas_Object *obj, Evas_Coord *x, Evas_Coord *y)
|
|
|
|
{
|
|
|
|
Smart_Data *sd = evas_object_smart_data_get(obj);
|
2010-08-01 10:59:31 -07:00
|
|
|
|
2009-03-30 06:34:32 -07:00
|
|
|
if (x) *x = sd->cx;
|
|
|
|
if (y) *y = sd->cy;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_pan_max_get(Evas_Object *obj, Evas_Coord *x, Evas_Coord *y)
|
|
|
|
{
|
|
|
|
Smart_Data *sd = evas_object_smart_data_get(obj);
|
2010-07-31 16:08:10 -07:00
|
|
|
|
2009-03-30 06:34:32 -07:00
|
|
|
if (x)
|
|
|
|
{
|
|
|
|
if (sd->w < sd->cw) *x = sd->cw - sd->w;
|
|
|
|
else *x = 0;
|
|
|
|
}
|
|
|
|
if (y)
|
|
|
|
{
|
|
|
|
if (sd->h < sd->ch) *y = sd->ch - sd->h;
|
|
|
|
else *y = 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_pan_child_size_get(Evas_Object *obj, Evas_Coord *w, Evas_Coord *h)
|
|
|
|
{
|
|
|
|
Smart_Data *sd = evas_object_smart_data_get(obj);
|
2010-07-31 16:08:10 -07:00
|
|
|
|
2009-03-30 06:34:32 -07:00
|
|
|
if (w) *w = sd->cw;
|
|
|
|
if (h) *h = sd->ch;
|
|
|
|
}
|
|
|
|
|
2010-06-24 09:19:12 -07:00
|
|
|
static Eina_Bool
|
2009-03-30 06:34:32 -07:00
|
|
|
_e_smart_reconfigure_do(void *data)
|
|
|
|
{
|
|
|
|
Evas_Object *obj = data;
|
|
|
|
Smart_Data *sd = evas_object_smart_data_get(obj);
|
|
|
|
Eina_List *l;
|
|
|
|
Item *it;
|
|
|
|
int iw, redo = 0, changed = 0;
|
2009-05-14 09:37:07 -07:00
|
|
|
static int recursion = 0;
|
2009-09-03 09:32:48 -07:00
|
|
|
Evas_Coord x, y, xx, yy, ww, hh, mw, mh, ox, oy, dd;
|
2012-07-10 05:05:22 -07:00
|
|
|
Evas_Coord vw, vh;
|
2010-08-01 10:59:31 -07:00
|
|
|
Evas *evas;
|
2009-05-14 07:28:44 -07:00
|
|
|
|
2010-06-24 09:19:12 -07:00
|
|
|
if (!sd) return ECORE_CALLBACK_CANCEL;
|
2009-03-30 06:34:32 -07:00
|
|
|
if (sd->cx > (sd->cw - sd->w)) sd->cx = sd->cw - sd->w;
|
|
|
|
if (sd->cy > (sd->ch - sd->h)) sd->cy = sd->ch - sd->h;
|
|
|
|
if (sd->cx < 0) sd->cx = 0;
|
|
|
|
if (sd->cy < 0) sd->cy = 0;
|
2010-07-31 16:08:10 -07:00
|
|
|
|
2009-03-30 06:34:32 -07:00
|
|
|
iw = sd->w / 4;
|
2010-07-31 16:08:10 -07:00
|
|
|
if (iw > (120 * e_scale)) iw = (120 * e_scale);
|
2009-03-30 06:34:32 -07:00
|
|
|
else
|
|
|
|
{
|
2010-07-31 16:08:10 -07:00
|
|
|
if (iw < (60 * e_scale)) iw = (sd->w / 3);
|
|
|
|
if (iw < (60 * e_scale)) iw = (sd->w / 2);
|
2009-03-30 06:34:32 -07:00
|
|
|
if (iw < (60 * e_scale)) iw = sd->w;
|
|
|
|
}
|
|
|
|
x = 0;
|
|
|
|
y = 0;
|
|
|
|
ww = iw;
|
2009-03-30 23:51:12 -07:00
|
|
|
hh = (sd->info->ih * iw) / (sd->info->iw);
|
2009-03-30 06:34:32 -07:00
|
|
|
mw = mh = 0;
|
2010-08-01 10:59:31 -07:00
|
|
|
|
|
|
|
evas = evas_object_evas_get(obj);
|
2012-07-10 05:05:22 -07:00
|
|
|
evas_output_viewport_get(evas, NULL, NULL, &vw, &vh);
|
|
|
|
|
2009-03-30 06:34:32 -07:00
|
|
|
EINA_LIST_FOREACH(sd->items, l, it)
|
|
|
|
{
|
|
|
|
if (x > (sd->w - ww))
|
|
|
|
{
|
|
|
|
x = 0;
|
|
|
|
y += hh;
|
|
|
|
}
|
|
|
|
it->x = x;
|
|
|
|
it->y = y;
|
|
|
|
it->w = ww;
|
|
|
|
it->h = hh;
|
|
|
|
if (it->selected)
|
|
|
|
{
|
|
|
|
sd->sx = it->x + (it->w / 2);
|
|
|
|
sd->sy = it->y + (it->h / 2);
|
|
|
|
}
|
2010-01-15 11:36:00 -08:00
|
|
|
if ((x + ww) > mw) mw = x + ww;
|
2009-03-30 06:34:32 -07:00
|
|
|
if ((y + hh) > mh) mh = y + hh;
|
|
|
|
x += ww;
|
|
|
|
}
|
|
|
|
if ((mw != sd->cw) || (mh != sd->ch))
|
|
|
|
{
|
|
|
|
sd->cw = mw;
|
|
|
|
sd->ch = mh;
|
|
|
|
if (sd->cx > (sd->cw - sd->w))
|
|
|
|
{
|
|
|
|
sd->cx = sd->cw - sd->w;
|
|
|
|
redo = 1;
|
|
|
|
}
|
|
|
|
if (sd->cy > (sd->ch - sd->h))
|
|
|
|
{
|
|
|
|
sd->cy = sd->ch - sd->h;
|
|
|
|
redo = 1;
|
|
|
|
}
|
|
|
|
if (sd->cx < 0)
|
|
|
|
{
|
|
|
|
sd->cx = 0;
|
|
|
|
redo = 1;
|
|
|
|
}
|
|
|
|
if (sd->cy < 0)
|
|
|
|
{
|
|
|
|
sd->cy = 0;
|
|
|
|
redo = 1;
|
|
|
|
}
|
2009-05-14 09:37:07 -07:00
|
|
|
if (redo)
|
|
|
|
{
|
|
|
|
recursion = 1;
|
|
|
|
_e_smart_reconfigure_do(obj);
|
|
|
|
recursion = 0;
|
|
|
|
}
|
2009-03-30 06:34:32 -07:00
|
|
|
changed = 1;
|
|
|
|
}
|
2010-07-31 16:08:10 -07:00
|
|
|
|
2009-03-30 06:34:32 -07:00
|
|
|
ox = 0;
|
|
|
|
if (sd->w > sd->cw) ox = (sd->w - sd->cw) / 2;
|
|
|
|
oy = 0;
|
|
|
|
if (sd->h > sd->ch) oy = (sd->h - sd->ch) / 2;
|
|
|
|
|
|
|
|
EINA_LIST_FOREACH(sd->items, l, it)
|
2012-08-01 23:11:10 -07:00
|
|
|
{
|
2012-07-10 05:05:22 -07:00
|
|
|
Evas_Coord dx, dy;
|
2010-07-31 16:08:10 -07:00
|
|
|
|
2009-03-30 06:34:32 -07:00
|
|
|
dx = dy = 0;
|
2010-07-31 16:08:10 -07:00
|
|
|
if ((sd->sx >= 0) && (sd->selmove > 0.0)
|
2012-08-01 23:11:10 -07:00
|
|
|
|
2009-03-30 06:34:32 -07:00
|
|
|
/* &&
|
|
|
|
((it->x + it->w) > sd->cx) &&
|
|
|
|
((it->x) < (sd->cx + sd->w)) &&
|
|
|
|
((it->y + it->h) > sd->cy) &&
|
|
|
|
((it->y) < (sd->cy + sd->h))
|
|
|
|
*/
|
|
|
|
)
|
|
|
|
{
|
2009-09-03 09:32:48 -07:00
|
|
|
double a, d;
|
2009-03-30 06:34:32 -07:00
|
|
|
int sum = 0;
|
|
|
|
char *p;
|
2010-07-31 16:08:10 -07:00
|
|
|
|
2009-03-30 06:34:32 -07:00
|
|
|
// -----0X0+++++
|
|
|
|
dx = (it->x + (it->w / 2)) - sd->sx;
|
|
|
|
dy = (it->y + (it->h / 2)) - sd->sy;
|
|
|
|
if (dx > 0)
|
|
|
|
{
|
|
|
|
// |/
|
|
|
|
// +--
|
|
|
|
if (dy < 0)
|
|
|
|
a = -atan(-(double)dy / (double)dx);
|
|
|
|
// +--
|
2009-09-03 09:32:48 -07:00
|
|
|
/* |\ */
|
2009-03-30 06:34:32 -07:00
|
|
|
else
|
|
|
|
a = atan((double)dy / (double)dx);
|
|
|
|
}
|
|
|
|
else if (dx == 0)
|
|
|
|
{
|
|
|
|
// |
|
|
|
|
// +
|
|
|
|
if (dy < 0) a = -M_PI / 2;
|
|
|
|
// +
|
|
|
|
// |
|
|
|
|
else a = M_PI / 2;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
// \|
|
|
|
|
// --+
|
|
|
|
if (dy < 0)
|
|
|
|
a = -M_PI + atan((double)dy / (double)dx);
|
|
|
|
// --+
|
|
|
|
// /|
|
|
|
|
else
|
|
|
|
a = M_PI - atan(-(double)dy / (double)dx);
|
|
|
|
}
|
|
|
|
d = sqrt((double)(dx * dx) + (double)(dy * dy));
|
2009-04-05 09:10:50 -07:00
|
|
|
|
|
|
|
sum = 0;
|
|
|
|
if (it->file)
|
|
|
|
{
|
|
|
|
for (p = (char *)it->file; *p; p++) sum += (int)(*p);
|
|
|
|
}
|
2009-03-30 06:34:32 -07:00
|
|
|
sum = (sum & 0xff) - 128;
|
|
|
|
a = a + ((double)sum / 1024.0);
|
|
|
|
xx = sd->sx - sd->cx + ox;
|
|
|
|
yy = sd->sy - sd->cy + oy;
|
|
|
|
if (xx < (sd->w / 2)) dx = sd->w - xx;
|
|
|
|
else dx = xx;
|
|
|
|
if (yy < (sd->h / 2)) dy = sd->h - yy;
|
|
|
|
else dy = yy;
|
|
|
|
dd = dx - d;
|
|
|
|
if (dy > dx) dd = dy - d;
|
|
|
|
if (dd < 0) dd = 0;
|
|
|
|
dy = sin(a) * sd->selmove * (dd * 0.9);
|
|
|
|
dx = cos(a) * sd->selmove * (dd * 0.9);
|
|
|
|
}
|
|
|
|
xx = sd->x - sd->cx + it->x + ox;
|
|
|
|
yy = sd->y - sd->cy + it->y + oy;
|
|
|
|
if (E_INTERSECTS(xx, yy, it->w, it->h, 0, 0, vw, vh))
|
|
|
|
{
|
|
|
|
if (!it->have_thumb)
|
|
|
|
{
|
|
|
|
if (!it->do_thumb)
|
|
|
|
{
|
|
|
|
e_thumb_icon_begin(it->image);
|
2009-06-17 06:46:54 -07:00
|
|
|
it->do_thumb = EINA_TRUE;
|
2009-03-30 06:34:32 -07:00
|
|
|
}
|
|
|
|
}
|
2009-05-07 06:27:11 -07:00
|
|
|
else
|
|
|
|
{
|
|
|
|
if (!it->frame)
|
|
|
|
{
|
2010-08-01 10:59:31 -07:00
|
|
|
it->frame = edje_object_add(evas);
|
2009-05-07 06:27:11 -07:00
|
|
|
if (it->theme)
|
|
|
|
e_theme_edje_object_set(it->frame, "base/theme/widgets",
|
|
|
|
"e/conf/wallpaper/main/mini-theme");
|
|
|
|
else if (it->remote)
|
|
|
|
e_theme_edje_object_set(it->frame, "base/theme/widgets",
|
|
|
|
"e/conf/wallpaper/main/mini-remote");
|
|
|
|
else
|
|
|
|
e_theme_edje_object_set(it->frame, "base/theme/widgets",
|
|
|
|
"e/conf/wallpaper/main/mini");
|
2009-07-06 02:43:58 -07:00
|
|
|
if (it->hilighted)
|
2009-08-17 00:55:25 -07:00
|
|
|
{
|
|
|
|
edje_object_signal_emit(it->frame, "e,state,selected", "e");
|
|
|
|
evas_object_raise(it->frame);
|
|
|
|
}
|
2009-05-07 06:27:11 -07:00
|
|
|
evas_object_event_callback_add(it->frame, EVAS_CALLBACK_MOUSE_DOWN,
|
|
|
|
_item_down, it);
|
|
|
|
evas_object_event_callback_add(it->frame, EVAS_CALLBACK_MOUSE_UP,
|
|
|
|
_item_up, it);
|
2010-07-31 16:08:10 -07:00
|
|
|
|
2009-05-07 06:27:11 -07:00
|
|
|
evas_object_smart_member_add(it->frame, obj);
|
|
|
|
evas_object_clip_set(it->frame, evas_object_clip_get(obj));
|
2010-08-01 10:59:31 -07:00
|
|
|
it->image = e_thumb_icon_add(evas);
|
2009-05-07 06:27:11 -07:00
|
|
|
edje_object_part_swallow(it->frame, "e.swallow.content", it->image);
|
|
|
|
evas_object_smart_callback_add(it->image, "e_thumb_gen", _thumb_gen, it);
|
|
|
|
if (it->theme)
|
|
|
|
{
|
2010-07-31 16:08:10 -07:00
|
|
|
const char *f;
|
|
|
|
|
|
|
|
f = e_theme_edje_file_get("base/theme/backgrounds",
|
|
|
|
"e/desktop/background");
|
2012-08-01 23:11:10 -07:00
|
|
|
e_thumb_icon_file_set(it->image, f,
|
2010-07-31 16:08:10 -07:00
|
|
|
"e/desktop/background");
|
2009-05-07 06:27:11 -07:00
|
|
|
}
|
|
|
|
else
|
2012-08-01 23:11:10 -07:00
|
|
|
e_thumb_icon_file_set(it->image, it->file,
|
2010-07-31 16:08:10 -07:00
|
|
|
"e/desktop/background");
|
2012-08-01 23:11:10 -07:00
|
|
|
e_thumb_icon_size_set(it->image, sd->info->iw,
|
2010-07-31 16:08:10 -07:00
|
|
|
sd->info->ih);
|
2009-05-07 06:27:11 -07:00
|
|
|
evas_object_show(it->image);
|
2010-07-31 16:08:10 -07:00
|
|
|
|
2009-05-07 06:27:11 -07:00
|
|
|
e_thumb_icon_begin(it->image);
|
|
|
|
}
|
|
|
|
}
|
2010-07-31 16:08:10 -07:00
|
|
|
evas_object_move(it->frame, xx + dx, yy + dy);
|
2009-05-07 06:27:11 -07:00
|
|
|
evas_object_resize(it->frame, it->w, it->h);
|
|
|
|
evas_object_show(it->frame);
|
2009-06-17 06:46:54 -07:00
|
|
|
it->visible = EINA_TRUE;
|
2009-03-30 06:34:32 -07:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2009-05-07 06:27:11 -07:00
|
|
|
if (it->have_thumb)
|
|
|
|
{
|
|
|
|
if (it->do_thumb)
|
|
|
|
{
|
|
|
|
e_thumb_icon_end(it->image);
|
2009-06-17 06:46:54 -07:00
|
|
|
it->do_thumb = EINA_FALSE;
|
2009-05-07 06:27:11 -07:00
|
|
|
}
|
|
|
|
evas_object_del(it->image);
|
|
|
|
it->image = NULL;
|
|
|
|
evas_object_del(it->frame);
|
|
|
|
it->frame = NULL;
|
|
|
|
}
|
2009-06-17 06:46:54 -07:00
|
|
|
it->visible = EINA_FALSE;
|
2012-08-01 23:11:10 -07:00
|
|
|
/*
|
2009-03-30 06:34:32 -07:00
|
|
|
if (it->have_thumb)
|
|
|
|
{
|
|
|
|
if (it->do_thumb)
|
|
|
|
{
|
|
|
|
e_thumb_icon_end(it->image);
|
2009-06-17 06:46:54 -07:00
|
|
|
it->do_thumb = EINA_FALSE;
|
2009-03-30 06:34:32 -07:00
|
|
|
}
|
|
|
|
evas_object_del(it->image);
|
2009-06-17 06:46:54 -07:00
|
|
|
it->have_thumb = EINA_FALSE;
|
2010-08-01 10:59:31 -07:00
|
|
|
it->image = e_thumb_icon_add(evas);
|
2009-03-30 06:34:32 -07:00
|
|
|
edje_object_part_swallow(it->frame, "e.swallow.content", it->image);
|
|
|
|
evas_object_smart_callback_add(it->image, "e_thumb_gen", _thumb_gen, it);
|
2009-04-05 09:10:50 -07:00
|
|
|
if (it->theme)
|
|
|
|
{
|
|
|
|
const char *f = e_theme_edje_file_get("base/theme/backgrounds",
|
|
|
|
"e/desktop/background");
|
|
|
|
e_thumb_icon_file_set(it->image, f, "e/desktop/background");
|
|
|
|
}
|
|
|
|
else
|
|
|
|
e_thumb_icon_file_set(it->image, it->file, "e/desktop/background");
|
2009-03-30 23:51:12 -07:00
|
|
|
e_thumb_icon_size_set(it->image, sd->info->iw, sd->info->ih);
|
2009-03-30 06:34:32 -07:00
|
|
|
evas_object_show(it->image);
|
|
|
|
edje_object_signal_emit(it->frame, "e,action,thumb,ungen", "e");
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2009-04-18 06:52:41 -07:00
|
|
|
if (it->sort_id)
|
2009-03-30 06:34:32 -07:00
|
|
|
{
|
2009-04-18 06:52:41 -07:00
|
|
|
if (it->do_thumb)
|
|
|
|
{
|
|
|
|
e_thumb_icon_end(it->image);
|
|
|
|
it->do_thumb = 0;
|
|
|
|
}
|
2009-03-30 06:34:32 -07:00
|
|
|
}
|
|
|
|
}
|
2009-05-07 06:27:11 -07:00
|
|
|
*/
|
2009-03-30 06:34:32 -07:00
|
|
|
}
|
|
|
|
}
|
2010-07-31 16:08:10 -07:00
|
|
|
|
2009-03-30 06:34:32 -07:00
|
|
|
if (changed)
|
|
|
|
evas_object_smart_callback_call(obj, "changed", NULL);
|
2009-05-14 09:37:07 -07:00
|
|
|
if (recursion == 0) sd->idle_enter = NULL;
|
2010-06-24 09:19:12 -07:00
|
|
|
return ECORE_CALLBACK_CANCEL;
|
2009-03-30 06:34:32 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_e_smart_reconfigure(Evas_Object *obj)
|
|
|
|
{
|
|
|
|
Smart_Data *sd = evas_object_smart_data_get(obj);
|
2010-07-31 16:08:10 -07:00
|
|
|
|
2009-03-30 06:34:32 -07:00
|
|
|
if (sd->idle_enter) return;
|
|
|
|
sd->idle_enter = ecore_idle_enterer_before_add(_e_smart_reconfigure_do, obj);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_e_smart_add(Evas_Object *obj)
|
|
|
|
{
|
|
|
|
Smart_Data *sd = calloc(1, sizeof(Smart_Data));
|
2010-07-31 16:08:10 -07:00
|
|
|
|
2009-03-30 06:34:32 -07:00
|
|
|
if (!sd) return;
|
2010-12-22 14:28:58 -08:00
|
|
|
|
2009-03-30 06:34:32 -07:00
|
|
|
sd->sx = sd->sy = -1;
|
|
|
|
evas_object_smart_data_set(obj, sd);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_e_smart_del(Evas_Object *obj)
|
|
|
|
{
|
|
|
|
Smart_Data *sd = evas_object_smart_data_get(obj);
|
2009-04-18 06:52:41 -07:00
|
|
|
Item *it;
|
2010-07-31 16:08:10 -07:00
|
|
|
|
2009-03-31 05:20:35 -07:00
|
|
|
if (sd->seltimer)
|
|
|
|
ecore_timer_del(sd->seltimer);
|
2009-03-30 06:34:32 -07:00
|
|
|
if (sd->idle_enter)
|
|
|
|
ecore_idle_enterer_del(sd->idle_enter);
|
|
|
|
if (sd->animator)
|
|
|
|
ecore_animator_del(sd->animator);
|
2009-04-18 06:52:41 -07:00
|
|
|
// sd->info is just referenced
|
|
|
|
// sd->child_obj is unused
|
|
|
|
EINA_LIST_FREE(sd->items, it)
|
|
|
|
{
|
|
|
|
if (it->frame) evas_object_del(it->frame);
|
|
|
|
if (it->image) evas_object_del(it->image);
|
2013-01-23 02:18:46 -08:00
|
|
|
eina_stringshare_del(it->file);
|
2009-04-18 06:52:41 -07:00
|
|
|
free(it->sort_id);
|
|
|
|
free(it);
|
|
|
|
}
|
2009-03-30 06:34:32 -07:00
|
|
|
free(sd);
|
2009-05-14 07:28:44 -07:00
|
|
|
evas_object_smart_data_set(obj, NULL);
|
2009-03-30 06:34:32 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_e_smart_move(Evas_Object *obj, Evas_Coord x, Evas_Coord y)
|
|
|
|
{
|
|
|
|
Smart_Data *sd = evas_object_smart_data_get(obj);
|
2010-07-31 16:08:10 -07:00
|
|
|
|
2009-03-30 06:34:32 -07:00
|
|
|
sd->x = x;
|
|
|
|
sd->y = y;
|
|
|
|
_e_smart_reconfigure(obj);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_e_smart_resize(Evas_Object *obj, Evas_Coord w, Evas_Coord h)
|
|
|
|
{
|
|
|
|
Smart_Data *sd = evas_object_smart_data_get(obj);
|
2010-07-31 16:08:10 -07:00
|
|
|
|
2009-03-30 06:34:32 -07:00
|
|
|
sd->w = w;
|
|
|
|
sd->h = h;
|
|
|
|
_e_smart_reconfigure(obj);
|
|
|
|
evas_object_smart_callback_call(obj, "changed", NULL);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2010-08-19 10:07:27 -07:00
|
|
|
_e_smart_show(Evas_Object *obj __UNUSED__)
|
2009-03-30 06:34:32 -07:00
|
|
|
{
|
2009-09-03 09:32:48 -07:00
|
|
|
// Smart_Data *sd = evas_object_smart_data_get(obj);
|
2009-04-18 06:52:41 -07:00
|
|
|
// evas_object_show(sd->child_obj);
|
2009-03-30 06:34:32 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2010-08-19 10:07:27 -07:00
|
|
|
_e_smart_hide(Evas_Object *obj __UNUSED__)
|
2009-03-30 06:34:32 -07:00
|
|
|
{
|
2009-09-03 09:32:48 -07:00
|
|
|
// Smart_Data *sd = evas_object_smart_data_get(obj);
|
2009-04-18 06:52:41 -07:00
|
|
|
// evas_object_hide(sd->child_obj);
|
2009-03-30 06:34:32 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2010-08-19 10:07:27 -07:00
|
|
|
_e_smart_color_set(Evas_Object *obj __UNUSED__, int r __UNUSED__, int g __UNUSED__, int b __UNUSED__, int a __UNUSED__)
|
2009-03-30 06:34:32 -07:00
|
|
|
{
|
2009-09-03 09:32:48 -07:00
|
|
|
// Smart_Data *sd = evas_object_smart_data_get(obj);
|
2009-04-18 06:52:41 -07:00
|
|
|
// evas_object_color_set(sd->child_obj, r, g, b, a);
|
2009-03-30 06:34:32 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2010-08-19 10:07:27 -07:00
|
|
|
_e_smart_clip_set(Evas_Object *obj __UNUSED__, Evas_Object * clip __UNUSED__)
|
2009-03-30 06:34:32 -07:00
|
|
|
{
|
2009-09-03 09:32:48 -07:00
|
|
|
// Smart_Data *sd = evas_object_smart_data_get(obj);
|
2009-04-18 06:52:41 -07:00
|
|
|
// evas_object_clip_set(sd->child_obj, clip);
|
2009-03-30 06:34:32 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2010-08-19 10:07:27 -07:00
|
|
|
_e_smart_clip_unset(Evas_Object *obj __UNUSED__)
|
2009-03-30 06:34:32 -07:00
|
|
|
{
|
2009-09-03 09:32:48 -07:00
|
|
|
// Smart_Data *sd = evas_object_smart_data_get(obj);
|
2009-04-18 06:52:41 -07:00
|
|
|
// evas_object_clip_unset(sd->child_obj);
|
2009-03-30 06:34:32 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
static Evas_Object *
|
|
|
|
_pan_add(Evas *evas)
|
|
|
|
{
|
|
|
|
static Evas_Smart *smart = NULL;
|
|
|
|
static const Evas_Smart_Class sc =
|
|
|
|
{
|
|
|
|
"wp_pan",
|
|
|
|
EVAS_SMART_CLASS_VERSION,
|
|
|
|
_e_smart_add,
|
|
|
|
_e_smart_del,
|
|
|
|
_e_smart_move,
|
|
|
|
_e_smart_resize,
|
|
|
|
_e_smart_show,
|
|
|
|
_e_smart_hide,
|
|
|
|
_e_smart_color_set,
|
|
|
|
_e_smart_clip_set,
|
|
|
|
_e_smart_clip_unset,
|
|
|
|
NULL,
|
|
|
|
NULL,
|
|
|
|
NULL,
|
2012-08-01 23:11:10 -07:00
|
|
|
NULL,
|
|
|
|
NULL,
|
|
|
|
NULL,
|
2009-03-30 06:34:32 -07:00
|
|
|
NULL
|
|
|
|
};
|
|
|
|
smart = evas_smart_class_new(&sc);
|
|
|
|
return evas_object_smart_add(evas, smart);
|
|
|
|
}
|
|
|
|
|
2009-03-30 23:51:12 -07:00
|
|
|
static void
|
|
|
|
_pan_info_set(Evas_Object *obj, Info *info)
|
|
|
|
{
|
|
|
|
Smart_Data *sd = evas_object_smart_data_get(obj);
|
2010-07-31 16:08:10 -07:00
|
|
|
|
2009-03-30 23:51:12 -07:00
|
|
|
sd->info = info;
|
|
|
|
}
|
|
|
|
|
2010-06-24 09:19:12 -07:00
|
|
|
static Eina_Bool
|
2009-03-30 06:34:32 -07:00
|
|
|
_sel_anim(void *data)
|
|
|
|
{
|
|
|
|
Evas_Object *obj = data;
|
|
|
|
Smart_Data *sd = evas_object_smart_data_get(obj);
|
|
|
|
double t = ecore_loop_time_get() - sd->seltime;
|
|
|
|
double len = 1.0;
|
|
|
|
double p = t / len;
|
|
|
|
double d;
|
2010-07-31 16:08:10 -07:00
|
|
|
|
2009-03-30 06:34:32 -07:00
|
|
|
if (p > 1.0) p = 1.0;
|
|
|
|
if (!sd->selin)
|
|
|
|
{
|
|
|
|
d = (p * 2) - 1.0;
|
|
|
|
if (d > 0.0)
|
|
|
|
{
|
|
|
|
d = 1.0 - d;
|
|
|
|
d = d * d * d;
|
|
|
|
d = 1.0 - d;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
d = -1.0 - d;
|
|
|
|
d = d * d * d;
|
|
|
|
d = -1.0 - d;
|
|
|
|
}
|
|
|
|
d = (1.0 + d) / 2.0;
|
|
|
|
sd->selmove = d;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
d = ((1.0 - p) * 2) - 1.0;
|
|
|
|
if (d > 0.0)
|
|
|
|
{
|
|
|
|
d = 1.0 - d;
|
|
|
|
d = d * d * d;
|
|
|
|
d = 1.0 - d;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
d = -1.0 - d;
|
|
|
|
d = d * d * d;
|
|
|
|
d = -1.0 - d;
|
|
|
|
}
|
|
|
|
d = (1.0 + d) / 2.0;
|
|
|
|
sd->selmove = d;
|
|
|
|
}
|
|
|
|
_e_smart_reconfigure(obj);
|
|
|
|
if (p == 1.0)
|
|
|
|
{
|
2009-03-30 23:22:55 -07:00
|
|
|
if (sd->selout)
|
2009-03-30 06:34:32 -07:00
|
|
|
{
|
2009-06-17 06:46:54 -07:00
|
|
|
sd->selin = EINA_TRUE;
|
|
|
|
sd->selout = EINA_FALSE;
|
2009-03-30 06:34:32 -07:00
|
|
|
sd->seltime = ecore_loop_time_get();
|
2010-06-24 09:19:12 -07:00
|
|
|
return ECORE_CALLBACK_RENEW;
|
2009-03-30 06:34:32 -07:00
|
|
|
}
|
2009-06-17 06:46:54 -07:00
|
|
|
sd->selout = EINA_FALSE;
|
|
|
|
sd->selin = EINA_FALSE;
|
2009-03-30 06:34:32 -07:00
|
|
|
sd->animator = NULL;
|
2010-06-24 09:19:12 -07:00
|
|
|
return ECORE_CALLBACK_CANCEL;
|
2009-03-30 06:34:32 -07:00
|
|
|
}
|
2010-06-24 09:19:12 -07:00
|
|
|
return ECORE_CALLBACK_RENEW;
|
2009-03-30 06:34:32 -07:00
|
|
|
}
|
|
|
|
|
2010-06-24 09:19:12 -07:00
|
|
|
static Eina_Bool
|
2009-03-31 05:20:35 -07:00
|
|
|
_sel_timer(void *data)
|
|
|
|
{
|
|
|
|
Evas_Object *obj = data;
|
|
|
|
Smart_Data *sd = evas_object_smart_data_get(obj);
|
2010-07-31 16:08:10 -07:00
|
|
|
|
2009-03-31 05:20:35 -07:00
|
|
|
if (!sd->animator)
|
|
|
|
{
|
|
|
|
sd->seltime = ecore_time_get();
|
|
|
|
sd->animator = ecore_animator_add(_sel_anim, obj);
|
2009-06-17 06:46:54 -07:00
|
|
|
sd->selin = EINA_FALSE;
|
2009-03-31 05:20:35 -07:00
|
|
|
}
|
|
|
|
sd->seltimer = NULL;
|
2010-06-24 09:19:12 -07:00
|
|
|
return ECORE_CALLBACK_CANCEL;
|
2009-03-31 05:20:35 -07:00
|
|
|
}
|
|
|
|
|
2009-07-06 02:43:58 -07:00
|
|
|
static void
|
2010-08-19 10:07:27 -07:00
|
|
|
_pan_unhilight(Evas_Object *obj __UNUSED__, Item *it)
|
2009-07-06 02:43:58 -07:00
|
|
|
{
|
2009-09-03 09:32:48 -07:00
|
|
|
// Smart_Data *sd = evas_object_smart_data_get(obj);
|
2009-07-06 02:43:58 -07:00
|
|
|
if (!it->hilighted) return;
|
|
|
|
it->hilighted = 0;
|
|
|
|
if (it->frame)
|
2010-08-01 10:59:31 -07:00
|
|
|
edje_object_signal_emit(it->frame, "e,state,unselected", "e");
|
2009-07-06 02:43:58 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2010-08-19 10:07:27 -07:00
|
|
|
_pan_hilight(Evas_Object *obj __UNUSED__, Item *it)
|
2009-07-06 02:43:58 -07:00
|
|
|
{
|
|
|
|
Eina_List *l;
|
|
|
|
Item *it2;
|
|
|
|
Smart_Data *sd = evas_object_smart_data_get(obj);
|
2010-07-31 16:08:10 -07:00
|
|
|
|
2009-07-06 02:43:58 -07:00
|
|
|
if (it->hilighted) return;
|
|
|
|
EINA_LIST_FOREACH(sd->items, l, it2)
|
|
|
|
{
|
|
|
|
if (it2->hilighted)
|
|
|
|
{
|
|
|
|
_pan_unhilight(obj, it2);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
it->hilighted = 1;
|
|
|
|
if (it->frame)
|
2009-08-17 00:55:25 -07:00
|
|
|
{
|
|
|
|
edje_object_signal_emit(it->frame, "e,state,selected", "e");
|
|
|
|
evas_object_raise(it->frame);
|
|
|
|
}
|
2009-07-06 02:43:58 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2009-03-30 06:34:32 -07:00
|
|
|
static void
|
|
|
|
_pan_sel(Evas_Object *obj, Item *it)
|
|
|
|
{
|
|
|
|
Smart_Data *sd = evas_object_smart_data_get(obj);
|
2010-07-31 16:08:10 -07:00
|
|
|
|
2009-03-30 23:22:55 -07:00
|
|
|
if (sd->selmove > 0.0) return;
|
2009-03-30 06:34:32 -07:00
|
|
|
edje_object_signal_emit(it->frame, "e,state,selected", "e");
|
2012-08-01 23:11:10 -07:00
|
|
|
evas_object_raise(it->frame);
|
2009-03-30 06:34:32 -07:00
|
|
|
if (!it->selected)
|
|
|
|
{
|
|
|
|
Eina_List *l;
|
|
|
|
Item *it2;
|
2009-03-30 23:22:55 -07:00
|
|
|
|
2009-03-30 06:34:32 -07:00
|
|
|
EINA_LIST_FOREACH(sd->items, l, it2)
|
|
|
|
{
|
|
|
|
if (it2->selected) it2->selected = 0;
|
|
|
|
}
|
2009-06-17 06:46:54 -07:00
|
|
|
it->selected = EINA_TRUE;
|
2013-01-23 02:18:46 -08:00
|
|
|
eina_stringshare_del(sd->info->bg_file);
|
2009-03-30 23:51:12 -07:00
|
|
|
evas_object_hide(sd->info->mini);
|
2009-04-05 09:10:50 -07:00
|
|
|
if (it->file)
|
|
|
|
{
|
2009-06-27 06:27:37 -07:00
|
|
|
char *name = NULL, *p;
|
2010-07-31 16:08:10 -07:00
|
|
|
|
2009-04-05 09:10:50 -07:00
|
|
|
sd->info->use_theme_bg = 0;
|
2013-01-23 02:18:46 -08:00
|
|
|
sd->info->bg_file = eina_stringshare_ref(it->file);
|
2009-04-05 09:10:50 -07:00
|
|
|
edje_object_file_set(sd->info->mini, sd->info->bg_file,
|
|
|
|
"e/desktop/background");
|
2009-06-27 06:27:37 -07:00
|
|
|
p = strrchr(sd->info->bg_file, '/');
|
|
|
|
if (p)
|
|
|
|
{
|
|
|
|
p++;
|
2013-01-23 02:14:09 -08:00
|
|
|
name = strdupa(p);
|
2009-06-27 06:27:37 -07:00
|
|
|
p = strrchr(name, '.');
|
|
|
|
if (p) *p = 0;
|
|
|
|
}
|
|
|
|
edje_object_part_text_set(sd->info->bg, "e.text.filename", name);
|
2009-04-05 09:10:50 -07:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
const char *f = e_theme_edje_file_get("base/theme/backgrounds",
|
|
|
|
"e/desktop/background");
|
2010-07-31 16:08:10 -07:00
|
|
|
|
|
|
|
edje_object_file_set(sd->info->mini, f, "e/desktop/background");
|
2009-04-05 09:10:50 -07:00
|
|
|
sd->info->use_theme_bg = 1;
|
|
|
|
sd->info->bg_file = NULL;
|
2012-08-01 23:11:10 -07:00
|
|
|
edje_object_part_text_set(sd->info->bg, "e.text.filename",
|
2010-07-31 16:08:10 -07:00
|
|
|
_("Theme Wallpaper"));
|
2009-04-05 09:10:50 -07:00
|
|
|
}
|
2009-03-30 23:51:12 -07:00
|
|
|
evas_object_show(sd->info->mini);
|
2009-03-30 06:34:32 -07:00
|
|
|
}
|
2009-03-31 05:47:10 -07:00
|
|
|
if (sd->seltimer) ecore_timer_del(sd->seltimer);
|
|
|
|
sd->seltimer = ecore_timer_add(0.2, _sel_timer, obj);
|
2009-03-30 06:34:32 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2009-03-30 23:22:55 -07:00
|
|
|
_pan_sel_up(Evas_Object *obj)
|
2009-03-30 06:34:32 -07:00
|
|
|
{
|
|
|
|
Smart_Data *sd = evas_object_smart_data_get(obj);
|
2010-07-31 16:08:10 -07:00
|
|
|
|
2009-03-30 23:24:54 -07:00
|
|
|
if (sd->selmove == 0.0) return;
|
2009-03-30 06:34:32 -07:00
|
|
|
if (!sd->animator)
|
|
|
|
{
|
|
|
|
sd->seltime = ecore_loop_time_get();
|
|
|
|
sd->animator = ecore_animator_add(_sel_anim, obj);
|
2009-06-17 06:46:54 -07:00
|
|
|
sd->selin = EINA_TRUE;
|
2009-03-30 06:34:32 -07:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if (sd->selin) return;
|
2009-06-17 06:46:54 -07:00
|
|
|
sd->selout = EINA_TRUE;
|
2009-03-30 06:34:32 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2009-04-18 06:52:41 -07:00
|
|
|
static int
|
|
|
|
_sort_cb(const void *d1, const void *d2)
|
|
|
|
{
|
2009-09-03 09:32:48 -07:00
|
|
|
const Item *it1 = d1, *it2 = d2;
|
2010-07-31 16:08:10 -07:00
|
|
|
|
2009-07-06 02:43:58 -07:00
|
|
|
if ((!it1->sort_id) || (!it2->sort_id)) return 0;
|
2009-04-18 06:52:41 -07:00
|
|
|
return strcmp(it1->sort_id, it2->sort_id);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_item_sort(Item *it)
|
|
|
|
{
|
|
|
|
Evas_Object *obj = it->obj;
|
|
|
|
Smart_Data *sd = evas_object_smart_data_get(obj);
|
2009-07-06 02:43:58 -07:00
|
|
|
int num, dosort = 0;
|
2010-07-31 16:08:10 -07:00
|
|
|
|
2009-04-18 06:52:41 -07:00
|
|
|
sd->id_num++;
|
2009-06-27 04:42:46 -07:00
|
|
|
sd->info->scans--;
|
2009-04-18 06:52:41 -07:00
|
|
|
num = eina_list_count(sd->items);
|
2009-07-06 02:43:58 -07:00
|
|
|
// if (sd->sort_num < sd->id_num)
|
|
|
|
// {
|
|
|
|
// sd->sort_num = sd->id_num + 10;
|
|
|
|
// dosort = 1;
|
|
|
|
// }
|
|
|
|
if ((sd->id_num == num) || (dosort))
|
2009-04-18 06:52:41 -07:00
|
|
|
{
|
|
|
|
sd->items = eina_list_sort(sd->items, num, _sort_cb);
|
2009-07-06 02:43:58 -07:00
|
|
|
_e_smart_reconfigure_do(obj);
|
|
|
|
if (sd->jump2hi)
|
|
|
|
{
|
|
|
|
Eina_List *l;
|
|
|
|
Item *it2 = NULL;
|
2010-07-31 16:08:10 -07:00
|
|
|
|
2009-07-06 02:43:58 -07:00
|
|
|
EINA_LIST_FOREACH(sd->items, l, it2)
|
|
|
|
{
|
|
|
|
if (it2->hilighted) break;
|
|
|
|
it2 = NULL;
|
|
|
|
}
|
|
|
|
if (it2)
|
2009-08-17 00:55:25 -07:00
|
|
|
e_scrollframe_child_region_show(sd->info->sframe,
|
2010-07-31 16:08:10 -07:00
|
|
|
it2->x, it2->y, it2->w, it2->h);
|
2009-07-06 02:43:58 -07:00
|
|
|
sd->jump2hi = 1;
|
|
|
|
}
|
2009-04-18 06:52:41 -07:00
|
|
|
}
|
2009-06-27 04:42:46 -07:00
|
|
|
if (sd->info->scans == 0)
|
2010-07-31 16:08:10 -07:00
|
|
|
edje_object_signal_emit(sd->info->bg, "e,state,busy,off", "e");
|
2009-04-18 06:52:41 -07:00
|
|
|
}
|
|
|
|
|
2009-03-30 06:34:32 -07:00
|
|
|
static void
|
2010-08-19 10:07:27 -07:00
|
|
|
_thumb_gen(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
|
2009-03-30 06:34:32 -07:00
|
|
|
{
|
|
|
|
Item *it = data;
|
2010-07-31 16:08:10 -07:00
|
|
|
|
2009-03-30 06:34:32 -07:00
|
|
|
edje_object_signal_emit(it->frame, "e,action,thumb,gen", "e");
|
2009-04-18 06:52:41 -07:00
|
|
|
if (!it->sort_id)
|
|
|
|
{
|
|
|
|
const char *id = e_thumb_sort_id_get(it->image);
|
2010-07-31 16:08:10 -07:00
|
|
|
|
2009-04-18 06:52:41 -07:00
|
|
|
if (id)
|
|
|
|
{
|
|
|
|
it->sort_id = strdup(id);
|
|
|
|
_item_sort(it);
|
|
|
|
}
|
|
|
|
}
|
2009-06-17 06:46:54 -07:00
|
|
|
it->have_thumb = EINA_TRUE;
|
2009-05-07 06:27:11 -07:00
|
|
|
if (!it->visible)
|
|
|
|
{
|
|
|
|
if (it->do_thumb)
|
|
|
|
{
|
|
|
|
e_thumb_icon_end(it->image);
|
2009-06-17 06:46:54 -07:00
|
|
|
it->do_thumb = EINA_FALSE;
|
2009-05-07 06:27:11 -07:00
|
|
|
}
|
|
|
|
evas_object_del(it->image);
|
|
|
|
it->image = NULL;
|
|
|
|
evas_object_del(it->frame);
|
|
|
|
it->frame = NULL;
|
|
|
|
}
|
2009-03-30 06:34:32 -07:00
|
|
|
}
|
|
|
|
|
2012-08-01 23:11:10 -07:00
|
|
|
static void
|
2010-08-19 10:07:27 -07:00
|
|
|
_item_down(void *data __UNUSED__, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
|
2009-03-30 06:34:32 -07:00
|
|
|
{
|
2009-09-03 09:32:48 -07:00
|
|
|
// Evas_Event_Mouse_Down *ev = event_info;
|
|
|
|
// Item *it = data;
|
2009-03-30 06:34:32 -07:00
|
|
|
// _pan_sel(it->obj, it);
|
|
|
|
}
|
2012-08-01 23:11:10 -07:00
|
|
|
|
|
|
|
static void
|
2010-08-19 10:07:27 -07:00
|
|
|
_item_up(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info)
|
2009-03-30 06:34:32 -07:00
|
|
|
{
|
|
|
|
Evas_Event_Mouse_Up *ev = event_info;
|
|
|
|
Item *it = data;
|
2010-07-31 16:08:10 -07:00
|
|
|
|
2009-03-30 06:34:32 -07:00
|
|
|
if (ev->button == 1)
|
|
|
|
{
|
|
|
|
if (!(ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD))
|
|
|
|
{
|
2009-07-06 02:43:58 -07:00
|
|
|
_pan_hilight(it->obj, it);
|
2009-03-30 06:34:32 -07:00
|
|
|
_pan_sel(it->obj, it);
|
|
|
|
// FIXME: select image!!!
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2012-08-01 23:11:10 -07:00
|
|
|
|
2009-03-30 06:34:32 -07:00
|
|
|
static void
|
2009-06-17 06:46:54 -07:00
|
|
|
_pan_file_add(Evas_Object *obj, const char *file, Eina_Bool remote, Eina_Bool theme)
|
2009-03-30 06:34:32 -07:00
|
|
|
{
|
|
|
|
Smart_Data *sd = evas_object_smart_data_get(obj);
|
|
|
|
Item *it = calloc(1, sizeof(Item));
|
2010-08-01 10:59:31 -07:00
|
|
|
Evas *evas;
|
2010-07-31 16:08:10 -07:00
|
|
|
|
2009-06-27 04:42:46 -07:00
|
|
|
if (!it) return;
|
2010-08-01 10:59:31 -07:00
|
|
|
evas = evas_object_evas_get(obj);
|
2009-03-30 06:34:32 -07:00
|
|
|
sd->items = eina_list_append(sd->items, it);
|
|
|
|
it->obj = obj;
|
2009-04-05 09:10:50 -07:00
|
|
|
it->remote = remote;
|
|
|
|
it->theme = theme;
|
2009-03-30 06:34:32 -07:00
|
|
|
it->file = eina_stringshare_add(file);
|
2010-08-01 10:59:31 -07:00
|
|
|
it->frame = edje_object_add(evas);
|
2009-04-05 09:10:50 -07:00
|
|
|
if (it->theme)
|
|
|
|
e_theme_edje_object_set(it->frame, "base/theme/widgets",
|
|
|
|
"e/conf/wallpaper/main/mini-theme");
|
|
|
|
else if (it->remote)
|
|
|
|
e_theme_edje_object_set(it->frame, "base/theme/widgets",
|
|
|
|
"e/conf/wallpaper/main/mini-remote");
|
|
|
|
else
|
|
|
|
e_theme_edje_object_set(it->frame, "base/theme/widgets",
|
|
|
|
"e/conf/wallpaper/main/mini");
|
2009-07-06 02:43:58 -07:00
|
|
|
if (it->hilighted)
|
2009-08-17 00:55:25 -07:00
|
|
|
{
|
|
|
|
edje_object_signal_emit(it->frame, "e,state,selected", "e");
|
|
|
|
evas_object_raise(it->frame);
|
|
|
|
}
|
2009-03-30 06:34:32 -07:00
|
|
|
evas_object_event_callback_add(it->frame, EVAS_CALLBACK_MOUSE_DOWN,
|
|
|
|
_item_down, it);
|
|
|
|
evas_object_event_callback_add(it->frame, EVAS_CALLBACK_MOUSE_UP,
|
|
|
|
_item_up, it);
|
2010-07-31 16:08:10 -07:00
|
|
|
|
2009-03-30 06:34:32 -07:00
|
|
|
evas_object_smart_member_add(it->frame, obj);
|
|
|
|
evas_object_clip_set(it->frame, evas_object_clip_get(obj));
|
|
|
|
evas_object_show(it->frame);
|
2010-08-01 10:59:31 -07:00
|
|
|
it->image = e_thumb_icon_add(evas);
|
2009-03-30 06:34:32 -07:00
|
|
|
edje_object_part_swallow(it->frame, "e.swallow.content", it->image);
|
|
|
|
evas_object_smart_callback_add(it->image, "e_thumb_gen", _thumb_gen, it);
|
2009-04-05 09:10:50 -07:00
|
|
|
if (it->theme)
|
|
|
|
{
|
|
|
|
const char *f = e_theme_edje_file_get("base/theme/backgrounds",
|
|
|
|
"e/desktop/background");
|
2010-07-31 16:08:10 -07:00
|
|
|
|
2009-04-05 09:10:50 -07:00
|
|
|
e_thumb_icon_file_set(it->image, f, "e/desktop/background");
|
|
|
|
}
|
|
|
|
else
|
|
|
|
e_thumb_icon_file_set(it->image, it->file, "e/desktop/background");
|
2009-03-30 23:51:12 -07:00
|
|
|
e_thumb_icon_size_set(it->image, sd->info->iw, sd->info->ih);
|
2009-03-30 06:34:32 -07:00
|
|
|
evas_object_show(it->image);
|
2010-07-31 16:08:10 -07:00
|
|
|
|
2009-04-18 06:52:41 -07:00
|
|
|
e_thumb_icon_begin(it->image);
|
|
|
|
it->do_thumb = 1;
|
2009-03-30 06:34:32 -07:00
|
|
|
// e_thumb_icon_begin(it->image);
|
2009-04-18 06:52:41 -07:00
|
|
|
|
2009-07-06 02:43:58 -07:00
|
|
|
if (it->theme)
|
|
|
|
{
|
|
|
|
if (sd->info->use_theme_bg)
|
|
|
|
{
|
|
|
|
_pan_hilight(it->obj, it);
|
2012-08-01 23:11:10 -07:00
|
|
|
edje_object_part_text_set(sd->info->bg, "e.text.filename",
|
2010-07-31 16:08:10 -07:00
|
|
|
_("Theme Wallpaper"));
|
2009-07-06 02:43:58 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if (sd->info->bg_file)
|
|
|
|
{
|
|
|
|
int match = 0;
|
2010-07-31 16:08:10 -07:00
|
|
|
|
2013-01-23 02:18:46 -08:00
|
|
|
if (sd->info->bg_file == it->file) match = 1;
|
2009-07-06 02:43:58 -07:00
|
|
|
if (!match)
|
|
|
|
{
|
|
|
|
const char *p1, *p2;
|
2010-07-31 16:08:10 -07:00
|
|
|
|
2009-07-06 02:43:58 -07:00
|
|
|
p1 = ecore_file_file_get(sd->info->bg_file);
|
|
|
|
p2 = ecore_file_file_get(it->file);
|
|
|
|
if (!strcmp(p1, p2)) match = 1;
|
|
|
|
}
|
|
|
|
if (match)
|
|
|
|
{
|
|
|
|
char *name = NULL, *p;
|
|
|
|
|
|
|
|
sd->jump2hi = 1;
|
|
|
|
_pan_hilight(it->obj, it);
|
|
|
|
p = strrchr(sd->info->bg_file, '/');
|
|
|
|
if (p)
|
|
|
|
{
|
|
|
|
p++;
|
2013-01-23 02:18:46 -08:00
|
|
|
name = strdupa(p);
|
2009-07-06 02:43:58 -07:00
|
|
|
p = strrchr(name, '.');
|
|
|
|
if (p) *p = 0;
|
|
|
|
}
|
|
|
|
edje_object_part_text_set(sd->info->bg, "e.text.filename", name);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2009-03-30 06:34:32 -07:00
|
|
|
_e_smart_reconfigure(obj);
|
|
|
|
}
|
|
|
|
|
|
|
|
////////
|
|
|
|
|
|
|
|
static void
|
|
|
|
_resize(E_Win *wn)
|
|
|
|
{
|
2009-03-30 23:51:12 -07:00
|
|
|
Info *info = wn->data;
|
2010-08-01 10:59:31 -07:00
|
|
|
|
2009-03-30 23:51:12 -07:00
|
|
|
evas_object_resize(info->bg, wn->w, wn->h);
|
2009-03-30 06:34:32 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2010-08-19 10:07:27 -07:00
|
|
|
_delete(E_Win *wn __UNUSED__)
|
2009-03-30 06:34:32 -07:00
|
|
|
{
|
2014-02-14 12:49:38 -08:00
|
|
|
e_object_del(E_OBJECT(global_info->win));
|
2009-03-30 06:34:32 -07:00
|
|
|
}
|
|
|
|
|
2009-03-30 23:22:55 -07:00
|
|
|
static void
|
2010-08-19 10:07:27 -07:00
|
|
|
_bg_clicked(void *data, Evas_Object *obj __UNUSED__, const char *emission __UNUSED__, const char *source __UNUSED__)
|
2009-03-30 23:22:55 -07:00
|
|
|
{
|
2009-03-30 23:51:12 -07:00
|
|
|
Info *info = data;
|
2010-08-01 10:59:31 -07:00
|
|
|
|
2009-03-30 23:22:55 -07:00
|
|
|
_pan_sel_up(info->span);
|
|
|
|
}
|
|
|
|
|
2009-03-30 06:34:32 -07:00
|
|
|
static void
|
2012-08-01 23:11:10 -07:00
|
|
|
_apply(void *data, void *data2 __UNUSED__)
|
2009-03-30 06:34:32 -07:00
|
|
|
{
|
2009-03-30 23:51:12 -07:00
|
|
|
Info *info = data;
|
2010-07-31 16:08:10 -07:00
|
|
|
|
2009-04-05 09:10:50 -07:00
|
|
|
if (info->mode == 0)
|
2009-03-30 06:34:32 -07:00
|
|
|
{
|
2009-04-05 09:10:50 -07:00
|
|
|
/* all desktops */
|
2009-03-30 06:34:32 -07:00
|
|
|
while (e_config->desktop_backgrounds)
|
|
|
|
{
|
|
|
|
E_Config_Desktop_Background *cfbg;
|
2010-07-31 16:08:10 -07:00
|
|
|
|
2009-03-30 06:34:32 -07:00
|
|
|
cfbg = e_config->desktop_backgrounds->data;
|
compositor rewrite / charlie-foxtrot situation
huge fustercluck commit because there wasn't really a way to separate out the changes. better to just rip it all out at once.
* compositor and window management completely rewritten. this was the goal for E19, but it pretty much required everything existing to be scrapped since it wasn't optimized, streamlined, or sensible. now instead of having the compositor strapped to the window manager like an outboard motor, it's housed more like an automobile engine.
** various comp structs have been merged into other places (eg. E_Comp_Zone is now just part of E_Zone where applicable), leading to a large deduplication of attributes
** awful E_Comp_Win is totally dead, having been replaced with e_comp_object smart objects which work just like normal canvas objects
** protocol-specific window management and compositor functionality is now kept exclusively in backend files
** e_pixmap api provides generic client finding and rendering api
** screen/xinerama screens are now provided directly by compositor on startup and re-set on change
** e_comp_render_update finally replaced with eina_tiler
** wayland compositor no longer creates X windows
** compositor e_layout removed entirely
* e_container is gone. this was made unnecessary in E18, but I kept it to avoid having too much code churn in one release. its sole purpose was to catch some events and handle window stacking, both of which are now just done by the compositor infra
* e_manager is just for screensaver and keybind stuff now, possibly remove later?
* e_border is gone along with a lot of its api. e_client has replaced it, and e_client has been rewritten completely; some parts may be similar, but the design now relies upon having a functional compositor
** window configuration/focus functions are all removed. all windows are now managed solely with evas_object_X functions on the "frame" member of a client, just as any other canvas object can be managed.
*** do NOT set interceptors on a client's comp_object. seriously.
* startup order rewritten: compositor now starts much earlier, other things just use attrs and members of the compositor
* ecore_x_pointer_xy_get usage replaced with ecore_evas_pointer_xy_get
* e_popup is totally gone, existing usage replaced by e_comp_object_util_add where applicable, otherwise just placed normally on the canvas
* deskmirror is (more) broken for now
* illume is totally fucked
* Ecore_X_Window replaced with Ecore_Window in most cases
* edge binding XWindows replaced with regular canvas objects
* some E_Win functionality has changed such that delete callbacks are now correctly called in ALL cases. various dialogs have been updated to not crash as a result
comp files and descriptions:
e_comp.c - overall compositor functions, rendering/update loop, shape cutting
e_comp_x.c - X window management and compositor functionality
e_comp_wl.c - Wayland surface management and compositor functionality
e_comp_canvas.c - general compositor canvas functions and utilities
e_comp_object.c - E_Client->frame member for managing clients as Evas_Objects, utility functions for adding objects to the compositor rendering systems
additional authors: ivan.briano@intel.com
feature: new compositor
removal: e_border, e_container, e_popup
2014-01-14 17:19:12 -08:00
|
|
|
e_bg_del(cfbg->manager, cfbg->zone, cfbg->desk_x, cfbg->desk_y);
|
2009-03-30 06:34:32 -07:00
|
|
|
}
|
|
|
|
if ((info->use_theme_bg) || (!info->bg_file))
|
|
|
|
e_bg_default_set(NULL);
|
|
|
|
else
|
|
|
|
e_bg_default_set(info->bg_file);
|
2009-04-05 09:10:50 -07:00
|
|
|
}
|
|
|
|
else if (info->mode == 1)
|
|
|
|
{
|
|
|
|
/* specific desk */
|
compositor rewrite / charlie-foxtrot situation
huge fustercluck commit because there wasn't really a way to separate out the changes. better to just rip it all out at once.
* compositor and window management completely rewritten. this was the goal for E19, but it pretty much required everything existing to be scrapped since it wasn't optimized, streamlined, or sensible. now instead of having the compositor strapped to the window manager like an outboard motor, it's housed more like an automobile engine.
** various comp structs have been merged into other places (eg. E_Comp_Zone is now just part of E_Zone where applicable), leading to a large deduplication of attributes
** awful E_Comp_Win is totally dead, having been replaced with e_comp_object smart objects which work just like normal canvas objects
** protocol-specific window management and compositor functionality is now kept exclusively in backend files
** e_pixmap api provides generic client finding and rendering api
** screen/xinerama screens are now provided directly by compositor on startup and re-set on change
** e_comp_render_update finally replaced with eina_tiler
** wayland compositor no longer creates X windows
** compositor e_layout removed entirely
* e_container is gone. this was made unnecessary in E18, but I kept it to avoid having too much code churn in one release. its sole purpose was to catch some events and handle window stacking, both of which are now just done by the compositor infra
* e_manager is just for screensaver and keybind stuff now, possibly remove later?
* e_border is gone along with a lot of its api. e_client has replaced it, and e_client has been rewritten completely; some parts may be similar, but the design now relies upon having a functional compositor
** window configuration/focus functions are all removed. all windows are now managed solely with evas_object_X functions on the "frame" member of a client, just as any other canvas object can be managed.
*** do NOT set interceptors on a client's comp_object. seriously.
* startup order rewritten: compositor now starts much earlier, other things just use attrs and members of the compositor
* ecore_x_pointer_xy_get usage replaced with ecore_evas_pointer_xy_get
* e_popup is totally gone, existing usage replaced by e_comp_object_util_add where applicable, otherwise just placed normally on the canvas
* deskmirror is (more) broken for now
* illume is totally fucked
* Ecore_X_Window replaced with Ecore_Window in most cases
* edge binding XWindows replaced with regular canvas objects
* some E_Win functionality has changed such that delete callbacks are now correctly called in ALL cases. various dialogs have been updated to not crash as a result
comp files and descriptions:
e_comp.c - overall compositor functions, rendering/update loop, shape cutting
e_comp_x.c - X window management and compositor functionality
e_comp_wl.c - Wayland surface management and compositor functionality
e_comp_canvas.c - general compositor canvas functions and utilities
e_comp_object.c - E_Client->frame member for managing clients as Evas_Objects, utility functions for adding objects to the compositor rendering systems
additional authors: ivan.briano@intel.com
feature: new compositor
removal: e_border, e_container, e_popup
2014-01-14 17:19:12 -08:00
|
|
|
e_bg_del(info->man_num, info->zone_num, info->desk_x, info->desk_y);
|
|
|
|
e_bg_add(info->man_num, info->zone_num, info->desk_x, info->desk_y,
|
2010-08-01 10:59:31 -07:00
|
|
|
info->bg_file);
|
2009-04-05 09:10:50 -07:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
Eina_List *dlist = NULL, *l;
|
|
|
|
E_Config_Desktop_Background *cfbg;
|
2010-07-31 16:08:10 -07:00
|
|
|
|
2009-04-05 09:10:50 -07:00
|
|
|
/* this screen */
|
|
|
|
EINA_LIST_FOREACH(e_config->desktop_backgrounds, l, cfbg)
|
|
|
|
{
|
|
|
|
if (cfbg->zone == info->zone_num)
|
|
|
|
dlist = eina_list_append(dlist, cfbg);
|
|
|
|
}
|
|
|
|
EINA_LIST_FREE(dlist, cfbg)
|
compositor rewrite / charlie-foxtrot situation
huge fustercluck commit because there wasn't really a way to separate out the changes. better to just rip it all out at once.
* compositor and window management completely rewritten. this was the goal for E19, but it pretty much required everything existing to be scrapped since it wasn't optimized, streamlined, or sensible. now instead of having the compositor strapped to the window manager like an outboard motor, it's housed more like an automobile engine.
** various comp structs have been merged into other places (eg. E_Comp_Zone is now just part of E_Zone where applicable), leading to a large deduplication of attributes
** awful E_Comp_Win is totally dead, having been replaced with e_comp_object smart objects which work just like normal canvas objects
** protocol-specific window management and compositor functionality is now kept exclusively in backend files
** e_pixmap api provides generic client finding and rendering api
** screen/xinerama screens are now provided directly by compositor on startup and re-set on change
** e_comp_render_update finally replaced with eina_tiler
** wayland compositor no longer creates X windows
** compositor e_layout removed entirely
* e_container is gone. this was made unnecessary in E18, but I kept it to avoid having too much code churn in one release. its sole purpose was to catch some events and handle window stacking, both of which are now just done by the compositor infra
* e_manager is just for screensaver and keybind stuff now, possibly remove later?
* e_border is gone along with a lot of its api. e_client has replaced it, and e_client has been rewritten completely; some parts may be similar, but the design now relies upon having a functional compositor
** window configuration/focus functions are all removed. all windows are now managed solely with evas_object_X functions on the "frame" member of a client, just as any other canvas object can be managed.
*** do NOT set interceptors on a client's comp_object. seriously.
* startup order rewritten: compositor now starts much earlier, other things just use attrs and members of the compositor
* ecore_x_pointer_xy_get usage replaced with ecore_evas_pointer_xy_get
* e_popup is totally gone, existing usage replaced by e_comp_object_util_add where applicable, otherwise just placed normally on the canvas
* deskmirror is (more) broken for now
* illume is totally fucked
* Ecore_X_Window replaced with Ecore_Window in most cases
* edge binding XWindows replaced with regular canvas objects
* some E_Win functionality has changed such that delete callbacks are now correctly called in ALL cases. various dialogs have been updated to not crash as a result
comp files and descriptions:
e_comp.c - overall compositor functions, rendering/update loop, shape cutting
e_comp_x.c - X window management and compositor functionality
e_comp_wl.c - Wayland surface management and compositor functionality
e_comp_canvas.c - general compositor canvas functions and utilities
e_comp_object.c - E_Client->frame member for managing clients as Evas_Objects, utility functions for adding objects to the compositor rendering systems
additional authors: ivan.briano@intel.com
feature: new compositor
removal: e_border, e_container, e_popup
2014-01-14 17:19:12 -08:00
|
|
|
e_bg_del(cfbg->manager, cfbg->zone, cfbg->desk_x, cfbg->desk_y);
|
|
|
|
e_bg_add(info->man_num, info->zone_num, -1, -1, info->bg_file);
|
2009-03-30 06:34:32 -07:00
|
|
|
}
|
|
|
|
e_bg_update();
|
|
|
|
e_config_save_queue();
|
2012-08-01 23:11:10 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_close(void *data __UNUSED__, void *data2 __UNUSED__)
|
|
|
|
{
|
2014-02-14 12:49:38 -08:00
|
|
|
e_object_del(E_OBJECT(global_info->win));
|
2009-03-30 06:34:32 -07:00
|
|
|
}
|
|
|
|
|
2012-08-01 23:11:10 -07:00
|
|
|
static void
|
|
|
|
_ok(void *data, void *data2 __UNUSED__)
|
|
|
|
{
|
|
|
|
_apply(data, data2);
|
2014-02-14 12:19:03 -08:00
|
|
|
e_object_del(E_OBJECT(global_info->win));
|
2012-08-01 23:11:10 -07:00
|
|
|
}
|
|
|
|
|
2009-04-18 06:52:41 -07:00
|
|
|
static void
|
2010-08-19 10:07:27 -07:00
|
|
|
_wp_add(void *data, void *data2 __UNUSED__)
|
2009-04-18 06:52:41 -07:00
|
|
|
{
|
|
|
|
Info *info = data;
|
2010-08-01 10:59:31 -07:00
|
|
|
|
2009-08-17 00:55:25 -07:00
|
|
|
edje_object_signal_emit(info->bg, "e,action,panel,hide", "e");
|
2009-04-18 06:52:41 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2010-08-19 10:07:27 -07:00
|
|
|
_wp_delete(void *data, void *data2 __UNUSED__)
|
2009-04-18 06:52:41 -07:00
|
|
|
{
|
|
|
|
Info *info = data;
|
2010-08-01 10:59:31 -07:00
|
|
|
|
2009-08-17 00:55:25 -07:00
|
|
|
edje_object_signal_emit(info->bg, "e,action,panel,hide", "e");
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2010-08-19 10:07:27 -07:00
|
|
|
_wp_changed(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
|
2009-08-17 00:55:25 -07:00
|
|
|
{
|
|
|
|
Info *info = data;
|
2010-08-01 10:59:31 -07:00
|
|
|
|
2009-08-17 00:55:25 -07:00
|
|
|
edje_object_signal_emit(info->bg, "e,action,panel,hide", "e");
|
2009-04-18 06:52:41 -07:00
|
|
|
}
|
|
|
|
|
2010-06-24 09:19:12 -07:00
|
|
|
static Eina_Bool
|
2009-03-30 06:34:32 -07:00
|
|
|
_idler(void *data)
|
|
|
|
{
|
2012-04-30 00:07:33 -07:00
|
|
|
Eina_File_Direct_Info *st;
|
2009-03-30 23:51:12 -07:00
|
|
|
Info *info = data;
|
2010-07-31 16:08:10 -07:00
|
|
|
|
2009-03-30 06:34:32 -07:00
|
|
|
if (!info->dir)
|
|
|
|
{
|
|
|
|
info->idler = NULL;
|
2010-06-24 09:19:12 -07:00
|
|
|
return ECORE_CALLBACK_CANCEL;
|
2009-03-30 06:34:32 -07:00
|
|
|
}
|
2012-04-30 00:07:33 -07:00
|
|
|
if (!eina_iterator_next(info->dir, (void**) &st))
|
2009-03-30 06:34:32 -07:00
|
|
|
{
|
2012-12-21 13:31:13 -08:00
|
|
|
E_FREE(info->curdir);
|
2012-04-30 00:07:33 -07:00
|
|
|
eina_iterator_free(info->dir);
|
2009-03-30 06:34:32 -07:00
|
|
|
info->dir = NULL;
|
|
|
|
info->idler = NULL;
|
2009-03-30 23:51:12 -07:00
|
|
|
_scan(info);
|
2010-06-24 09:19:12 -07:00
|
|
|
return ECORE_CALLBACK_CANCEL;
|
2009-03-30 06:34:32 -07:00
|
|
|
}
|
2012-04-30 00:07:33 -07:00
|
|
|
if ((st->path[st->name_start]) == '.')
|
2010-06-24 09:19:12 -07:00
|
|
|
return ECORE_CALLBACK_RENEW;
|
2012-04-30 00:07:33 -07:00
|
|
|
if (st->type == EINA_FILE_DIR)
|
2009-03-30 06:34:32 -07:00
|
|
|
{
|
2012-04-30 00:07:33 -07:00
|
|
|
info->dirs = eina_list_append(info->dirs, strdup(st->path));
|
2010-06-24 09:19:12 -07:00
|
|
|
return ECORE_CALLBACK_RENEW;
|
2009-03-30 06:34:32 -07:00
|
|
|
}
|
2009-06-27 04:42:46 -07:00
|
|
|
info->scans++;
|
2012-04-30 00:07:33 -07:00
|
|
|
_pan_file_add(info->span, st->path, 0, 0);
|
2010-07-31 16:08:10 -07:00
|
|
|
|
2009-03-30 06:34:32 -07:00
|
|
|
e_util_wakeup();
|
2010-06-24 09:19:12 -07:00
|
|
|
return ECORE_CALLBACK_RENEW;
|
2009-03-30 06:34:32 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2009-03-30 23:51:12 -07:00
|
|
|
_scan(Info *info)
|
2009-03-30 06:34:32 -07:00
|
|
|
{
|
|
|
|
if (info->dirs)
|
|
|
|
{
|
2009-06-27 04:42:46 -07:00
|
|
|
if (info->scans <= 0)
|
|
|
|
{
|
|
|
|
info->scans = 0;
|
|
|
|
edje_object_signal_emit(info->bg, "e,state,busy,on", "e");
|
2012-08-01 23:11:10 -07:00
|
|
|
edje_object_part_text_set(info->bg, "e.text.busy_label",
|
2010-07-31 16:08:10 -07:00
|
|
|
_("Loading files..."));
|
2009-06-27 04:42:46 -07:00
|
|
|
}
|
2012-12-21 13:31:13 -08:00
|
|
|
free(info->curdir);
|
2009-03-30 06:34:32 -07:00
|
|
|
info->curdir = info->dirs->data;
|
|
|
|
info->dirs = eina_list_remove_list(info->dirs, info->dirs);
|
2012-04-30 00:07:33 -07:00
|
|
|
if (!info->dir) info->dir = eina_file_stat_ls(info->curdir);
|
2009-03-30 23:51:12 -07:00
|
|
|
info->idler = ecore_idler_add(_idler, info);
|
2009-03-30 06:34:32 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2009-03-30 23:51:12 -07:00
|
|
|
Info *
|
compositor rewrite / charlie-foxtrot situation
huge fustercluck commit because there wasn't really a way to separate out the changes. better to just rip it all out at once.
* compositor and window management completely rewritten. this was the goal for E19, but it pretty much required everything existing to be scrapped since it wasn't optimized, streamlined, or sensible. now instead of having the compositor strapped to the window manager like an outboard motor, it's housed more like an automobile engine.
** various comp structs have been merged into other places (eg. E_Comp_Zone is now just part of E_Zone where applicable), leading to a large deduplication of attributes
** awful E_Comp_Win is totally dead, having been replaced with e_comp_object smart objects which work just like normal canvas objects
** protocol-specific window management and compositor functionality is now kept exclusively in backend files
** e_pixmap api provides generic client finding and rendering api
** screen/xinerama screens are now provided directly by compositor on startup and re-set on change
** e_comp_render_update finally replaced with eina_tiler
** wayland compositor no longer creates X windows
** compositor e_layout removed entirely
* e_container is gone. this was made unnecessary in E18, but I kept it to avoid having too much code churn in one release. its sole purpose was to catch some events and handle window stacking, both of which are now just done by the compositor infra
* e_manager is just for screensaver and keybind stuff now, possibly remove later?
* e_border is gone along with a lot of its api. e_client has replaced it, and e_client has been rewritten completely; some parts may be similar, but the design now relies upon having a functional compositor
** window configuration/focus functions are all removed. all windows are now managed solely with evas_object_X functions on the "frame" member of a client, just as any other canvas object can be managed.
*** do NOT set interceptors on a client's comp_object. seriously.
* startup order rewritten: compositor now starts much earlier, other things just use attrs and members of the compositor
* ecore_x_pointer_xy_get usage replaced with ecore_evas_pointer_xy_get
* e_popup is totally gone, existing usage replaced by e_comp_object_util_add where applicable, otherwise just placed normally on the canvas
* deskmirror is (more) broken for now
* illume is totally fucked
* Ecore_X_Window replaced with Ecore_Window in most cases
* edge binding XWindows replaced with regular canvas objects
* some E_Win functionality has changed such that delete callbacks are now correctly called in ALL cases. various dialogs have been updated to not crash as a result
comp files and descriptions:
e_comp.c - overall compositor functions, rendering/update loop, shape cutting
e_comp_x.c - X window management and compositor functionality
e_comp_wl.c - Wayland surface management and compositor functionality
e_comp_canvas.c - general compositor canvas functions and utilities
e_comp_object.c - E_Client->frame member for managing clients as Evas_Objects, utility functions for adding objects to the compositor rendering systems
additional authors: ivan.briano@intel.com
feature: new compositor
removal: e_border, e_container, e_popup
2014-01-14 17:19:12 -08:00
|
|
|
wp_browser_new(E_Comp *comp)
|
2009-03-30 06:34:32 -07:00
|
|
|
{
|
2009-03-30 23:51:12 -07:00
|
|
|
Info *info;
|
|
|
|
E_Win *win;
|
2009-03-30 06:34:32 -07:00
|
|
|
E_Zone *zone;
|
|
|
|
E_Desk *desk;
|
|
|
|
const E_Config_Desktop_Background *cfbg;
|
|
|
|
Evas_Coord mw, mh;
|
2009-06-27 04:42:46 -07:00
|
|
|
Evas_Object *o, *o2, *ob;
|
2009-04-04 07:15:08 -07:00
|
|
|
E_Radio_Group *rg;
|
2012-08-01 23:11:10 -07:00
|
|
|
char buf[PATH_MAX];
|
2010-07-31 16:08:10 -07:00
|
|
|
|
2009-03-30 06:34:32 -07:00
|
|
|
info = calloc(1, sizeof(Info));
|
2009-03-30 23:51:12 -07:00
|
|
|
if (!info) return NULL;
|
2010-07-31 16:08:10 -07:00
|
|
|
|
compositor rewrite / charlie-foxtrot situation
huge fustercluck commit because there wasn't really a way to separate out the changes. better to just rip it all out at once.
* compositor and window management completely rewritten. this was the goal for E19, but it pretty much required everything existing to be scrapped since it wasn't optimized, streamlined, or sensible. now instead of having the compositor strapped to the window manager like an outboard motor, it's housed more like an automobile engine.
** various comp structs have been merged into other places (eg. E_Comp_Zone is now just part of E_Zone where applicable), leading to a large deduplication of attributes
** awful E_Comp_Win is totally dead, having been replaced with e_comp_object smart objects which work just like normal canvas objects
** protocol-specific window management and compositor functionality is now kept exclusively in backend files
** e_pixmap api provides generic client finding and rendering api
** screen/xinerama screens are now provided directly by compositor on startup and re-set on change
** e_comp_render_update finally replaced with eina_tiler
** wayland compositor no longer creates X windows
** compositor e_layout removed entirely
* e_container is gone. this was made unnecessary in E18, but I kept it to avoid having too much code churn in one release. its sole purpose was to catch some events and handle window stacking, both of which are now just done by the compositor infra
* e_manager is just for screensaver and keybind stuff now, possibly remove later?
* e_border is gone along with a lot of its api. e_client has replaced it, and e_client has been rewritten completely; some parts may be similar, but the design now relies upon having a functional compositor
** window configuration/focus functions are all removed. all windows are now managed solely with evas_object_X functions on the "frame" member of a client, just as any other canvas object can be managed.
*** do NOT set interceptors on a client's comp_object. seriously.
* startup order rewritten: compositor now starts much earlier, other things just use attrs and members of the compositor
* ecore_x_pointer_xy_get usage replaced with ecore_evas_pointer_xy_get
* e_popup is totally gone, existing usage replaced by e_comp_object_util_add where applicable, otherwise just placed normally on the canvas
* deskmirror is (more) broken for now
* illume is totally fucked
* Ecore_X_Window replaced with Ecore_Window in most cases
* edge binding XWindows replaced with regular canvas objects
* some E_Win functionality has changed such that delete callbacks are now correctly called in ALL cases. various dialogs have been updated to not crash as a result
comp files and descriptions:
e_comp.c - overall compositor functions, rendering/update loop, shape cutting
e_comp_x.c - X window management and compositor functionality
e_comp_wl.c - Wayland surface management and compositor functionality
e_comp_canvas.c - general compositor canvas functions and utilities
e_comp_object.c - E_Client->frame member for managing clients as Evas_Objects, utility functions for adding objects to the compositor rendering systems
additional authors: ivan.briano@intel.com
feature: new compositor
removal: e_border, e_container, e_popup
2014-01-14 17:19:12 -08:00
|
|
|
zone = e_zone_current_get(comp);
|
2009-03-30 23:51:12 -07:00
|
|
|
desk = e_desk_current_get(zone);
|
compositor rewrite / charlie-foxtrot situation
huge fustercluck commit because there wasn't really a way to separate out the changes. better to just rip it all out at once.
* compositor and window management completely rewritten. this was the goal for E19, but it pretty much required everything existing to be scrapped since it wasn't optimized, streamlined, or sensible. now instead of having the compositor strapped to the window manager like an outboard motor, it's housed more like an automobile engine.
** various comp structs have been merged into other places (eg. E_Comp_Zone is now just part of E_Zone where applicable), leading to a large deduplication of attributes
** awful E_Comp_Win is totally dead, having been replaced with e_comp_object smart objects which work just like normal canvas objects
** protocol-specific window management and compositor functionality is now kept exclusively in backend files
** e_pixmap api provides generic client finding and rendering api
** screen/xinerama screens are now provided directly by compositor on startup and re-set on change
** e_comp_render_update finally replaced with eina_tiler
** wayland compositor no longer creates X windows
** compositor e_layout removed entirely
* e_container is gone. this was made unnecessary in E18, but I kept it to avoid having too much code churn in one release. its sole purpose was to catch some events and handle window stacking, both of which are now just done by the compositor infra
* e_manager is just for screensaver and keybind stuff now, possibly remove later?
* e_border is gone along with a lot of its api. e_client has replaced it, and e_client has been rewritten completely; some parts may be similar, but the design now relies upon having a functional compositor
** window configuration/focus functions are all removed. all windows are now managed solely with evas_object_X functions on the "frame" member of a client, just as any other canvas object can be managed.
*** do NOT set interceptors on a client's comp_object. seriously.
* startup order rewritten: compositor now starts much earlier, other things just use attrs and members of the compositor
* ecore_x_pointer_xy_get usage replaced with ecore_evas_pointer_xy_get
* e_popup is totally gone, existing usage replaced by e_comp_object_util_add where applicable, otherwise just placed normally on the canvas
* deskmirror is (more) broken for now
* illume is totally fucked
* Ecore_X_Window replaced with Ecore_Window in most cases
* edge binding XWindows replaced with regular canvas objects
* some E_Win functionality has changed such that delete callbacks are now correctly called in ALL cases. various dialogs have been updated to not crash as a result
comp files and descriptions:
e_comp.c - overall compositor functions, rendering/update loop, shape cutting
e_comp_x.c - X window management and compositor functionality
e_comp_wl.c - Wayland surface management and compositor functionality
e_comp_canvas.c - general compositor canvas functions and utilities
e_comp_object.c - E_Client->frame member for managing clients as Evas_Objects, utility functions for adding objects to the compositor rendering systems
additional authors: ivan.briano@intel.com
feature: new compositor
removal: e_border, e_container, e_popup
2014-01-14 17:19:12 -08:00
|
|
|
info->man_num = comp->num;
|
2012-02-14 20:35:18 -08:00
|
|
|
info->zone_num = zone->num;
|
2009-03-30 06:34:32 -07:00
|
|
|
info->desk_x = desk->x;
|
|
|
|
info->desk_y = desk->y;
|
2009-04-05 09:10:50 -07:00
|
|
|
info->mode = 0;
|
compositor rewrite / charlie-foxtrot situation
huge fustercluck commit because there wasn't really a way to separate out the changes. better to just rip it all out at once.
* compositor and window management completely rewritten. this was the goal for E19, but it pretty much required everything existing to be scrapped since it wasn't optimized, streamlined, or sensible. now instead of having the compositor strapped to the window manager like an outboard motor, it's housed more like an automobile engine.
** various comp structs have been merged into other places (eg. E_Comp_Zone is now just part of E_Zone where applicable), leading to a large deduplication of attributes
** awful E_Comp_Win is totally dead, having been replaced with e_comp_object smart objects which work just like normal canvas objects
** protocol-specific window management and compositor functionality is now kept exclusively in backend files
** e_pixmap api provides generic client finding and rendering api
** screen/xinerama screens are now provided directly by compositor on startup and re-set on change
** e_comp_render_update finally replaced with eina_tiler
** wayland compositor no longer creates X windows
** compositor e_layout removed entirely
* e_container is gone. this was made unnecessary in E18, but I kept it to avoid having too much code churn in one release. its sole purpose was to catch some events and handle window stacking, both of which are now just done by the compositor infra
* e_manager is just for screensaver and keybind stuff now, possibly remove later?
* e_border is gone along with a lot of its api. e_client has replaced it, and e_client has been rewritten completely; some parts may be similar, but the design now relies upon having a functional compositor
** window configuration/focus functions are all removed. all windows are now managed solely with evas_object_X functions on the "frame" member of a client, just as any other canvas object can be managed.
*** do NOT set interceptors on a client's comp_object. seriously.
* startup order rewritten: compositor now starts much earlier, other things just use attrs and members of the compositor
* ecore_x_pointer_xy_get usage replaced with ecore_evas_pointer_xy_get
* e_popup is totally gone, existing usage replaced by e_comp_object_util_add where applicable, otherwise just placed normally on the canvas
* deskmirror is (more) broken for now
* illume is totally fucked
* Ecore_X_Window replaced with Ecore_Window in most cases
* edge binding XWindows replaced with regular canvas objects
* some E_Win functionality has changed such that delete callbacks are now correctly called in ALL cases. various dialogs have been updated to not crash as a result
comp files and descriptions:
e_comp.c - overall compositor functions, rendering/update loop, shape cutting
e_comp_x.c - X window management and compositor functionality
e_comp_wl.c - Wayland surface management and compositor functionality
e_comp_canvas.c - general compositor canvas functions and utilities
e_comp_object.c - E_Client->frame member for managing clients as Evas_Objects, utility functions for adding objects to the compositor rendering systems
additional authors: ivan.briano@intel.com
feature: new compositor
removal: e_border, e_container, e_popup
2014-01-14 17:19:12 -08:00
|
|
|
cfbg = e_bg_config_get(comp->num, zone->num, desk->x, desk->y);
|
2009-03-30 06:34:32 -07:00
|
|
|
if (cfbg)
|
|
|
|
{
|
compositor rewrite / charlie-foxtrot situation
huge fustercluck commit because there wasn't really a way to separate out the changes. better to just rip it all out at once.
* compositor and window management completely rewritten. this was the goal for E19, but it pretty much required everything existing to be scrapped since it wasn't optimized, streamlined, or sensible. now instead of having the compositor strapped to the window manager like an outboard motor, it's housed more like an automobile engine.
** various comp structs have been merged into other places (eg. E_Comp_Zone is now just part of E_Zone where applicable), leading to a large deduplication of attributes
** awful E_Comp_Win is totally dead, having been replaced with e_comp_object smart objects which work just like normal canvas objects
** protocol-specific window management and compositor functionality is now kept exclusively in backend files
** e_pixmap api provides generic client finding and rendering api
** screen/xinerama screens are now provided directly by compositor on startup and re-set on change
** e_comp_render_update finally replaced with eina_tiler
** wayland compositor no longer creates X windows
** compositor e_layout removed entirely
* e_container is gone. this was made unnecessary in E18, but I kept it to avoid having too much code churn in one release. its sole purpose was to catch some events and handle window stacking, both of which are now just done by the compositor infra
* e_manager is just for screensaver and keybind stuff now, possibly remove later?
* e_border is gone along with a lot of its api. e_client has replaced it, and e_client has been rewritten completely; some parts may be similar, but the design now relies upon having a functional compositor
** window configuration/focus functions are all removed. all windows are now managed solely with evas_object_X functions on the "frame" member of a client, just as any other canvas object can be managed.
*** do NOT set interceptors on a client's comp_object. seriously.
* startup order rewritten: compositor now starts much earlier, other things just use attrs and members of the compositor
* ecore_x_pointer_xy_get usage replaced with ecore_evas_pointer_xy_get
* e_popup is totally gone, existing usage replaced by e_comp_object_util_add where applicable, otherwise just placed normally on the canvas
* deskmirror is (more) broken for now
* illume is totally fucked
* Ecore_X_Window replaced with Ecore_Window in most cases
* edge binding XWindows replaced with regular canvas objects
* some E_Win functionality has changed such that delete callbacks are now correctly called in ALL cases. various dialogs have been updated to not crash as a result
comp files and descriptions:
e_comp.c - overall compositor functions, rendering/update loop, shape cutting
e_comp_x.c - X window management and compositor functionality
e_comp_wl.c - Wayland surface management and compositor functionality
e_comp_canvas.c - general compositor canvas functions and utilities
e_comp_object.c - E_Client->frame member for managing clients as Evas_Objects, utility functions for adding objects to the compositor rendering systems
additional authors: ivan.briano@intel.com
feature: new compositor
removal: e_border, e_container, e_popup
2014-01-14 17:19:12 -08:00
|
|
|
if ((cfbg->manager >= 0) && (cfbg->zone >= 0))
|
2009-03-30 06:34:32 -07:00
|
|
|
{
|
2010-07-31 16:08:10 -07:00
|
|
|
if ((cfbg->desk_x >= 0) && (cfbg->desk_y >= 0))
|
2009-04-05 09:10:50 -07:00
|
|
|
info->mode = 1;
|
|
|
|
else
|
|
|
|
info->mode = 2;
|
2009-03-30 06:34:32 -07:00
|
|
|
}
|
2013-01-23 02:18:46 -08:00
|
|
|
info->bg_file = eina_stringshare_ref(cfbg->file);
|
2009-03-30 06:34:32 -07:00
|
|
|
}
|
|
|
|
if ((!info->bg_file) && (e_config->desktop_default_background))
|
2013-01-23 02:18:46 -08:00
|
|
|
info->bg_file = eina_stringshare_ref(e_config->desktop_default_background);
|
2009-03-30 06:34:32 -07:00
|
|
|
else
|
2010-07-31 16:08:10 -07:00
|
|
|
info->use_theme_bg = 1;
|
|
|
|
|
|
|
|
info->iw = (120 * e_scale);
|
2009-05-07 06:27:11 -07:00
|
|
|
info->ih = (zone->h * info->iw) / (zone->w);
|
2010-07-31 16:08:10 -07:00
|
|
|
|
compositor rewrite / charlie-foxtrot situation
huge fustercluck commit because there wasn't really a way to separate out the changes. better to just rip it all out at once.
* compositor and window management completely rewritten. this was the goal for E19, but it pretty much required everything existing to be scrapped since it wasn't optimized, streamlined, or sensible. now instead of having the compositor strapped to the window manager like an outboard motor, it's housed more like an automobile engine.
** various comp structs have been merged into other places (eg. E_Comp_Zone is now just part of E_Zone where applicable), leading to a large deduplication of attributes
** awful E_Comp_Win is totally dead, having been replaced with e_comp_object smart objects which work just like normal canvas objects
** protocol-specific window management and compositor functionality is now kept exclusively in backend files
** e_pixmap api provides generic client finding and rendering api
** screen/xinerama screens are now provided directly by compositor on startup and re-set on change
** e_comp_render_update finally replaced with eina_tiler
** wayland compositor no longer creates X windows
** compositor e_layout removed entirely
* e_container is gone. this was made unnecessary in E18, but I kept it to avoid having too much code churn in one release. its sole purpose was to catch some events and handle window stacking, both of which are now just done by the compositor infra
* e_manager is just for screensaver and keybind stuff now, possibly remove later?
* e_border is gone along with a lot of its api. e_client has replaced it, and e_client has been rewritten completely; some parts may be similar, but the design now relies upon having a functional compositor
** window configuration/focus functions are all removed. all windows are now managed solely with evas_object_X functions on the "frame" member of a client, just as any other canvas object can be managed.
*** do NOT set interceptors on a client's comp_object. seriously.
* startup order rewritten: compositor now starts much earlier, other things just use attrs and members of the compositor
* ecore_x_pointer_xy_get usage replaced with ecore_evas_pointer_xy_get
* e_popup is totally gone, existing usage replaced by e_comp_object_util_add where applicable, otherwise just placed normally on the canvas
* deskmirror is (more) broken for now
* illume is totally fucked
* Ecore_X_Window replaced with Ecore_Window in most cases
* edge binding XWindows replaced with regular canvas objects
* some E_Win functionality has changed such that delete callbacks are now correctly called in ALL cases. various dialogs have been updated to not crash as a result
comp files and descriptions:
e_comp.c - overall compositor functions, rendering/update loop, shape cutting
e_comp_x.c - X window management and compositor functionality
e_comp_wl.c - Wayland surface management and compositor functionality
e_comp_canvas.c - general compositor canvas functions and utilities
e_comp_object.c - E_Client->frame member for managing clients as Evas_Objects, utility functions for adding objects to the compositor rendering systems
additional authors: ivan.briano@intel.com
feature: new compositor
removal: e_border, e_container, e_popup
2014-01-14 17:19:12 -08:00
|
|
|
win = e_win_new(comp);
|
2009-03-30 06:34:32 -07:00
|
|
|
if (!win)
|
|
|
|
{
|
2013-01-23 02:18:46 -08:00
|
|
|
eina_stringshare_del(info->bg_file);
|
|
|
|
free(info);
|
2009-03-30 23:51:12 -07:00
|
|
|
return NULL;
|
2009-03-30 06:34:32 -07:00
|
|
|
}
|
2009-03-30 23:51:12 -07:00
|
|
|
info->win = win;
|
|
|
|
win->data = info;
|
2010-07-31 16:08:10 -07:00
|
|
|
|
2009-04-13 07:56:38 -07:00
|
|
|
e_user_dir_concat_static(buf, "backgrounds");
|
2009-03-30 06:34:32 -07:00
|
|
|
info->dirs = eina_list_append(info->dirs, strdup(buf));
|
2009-04-13 07:56:38 -07:00
|
|
|
e_prefix_data_concat_static(buf, "data/backgrounds");
|
2009-03-30 06:34:32 -07:00
|
|
|
info->dirs = eina_list_append(info->dirs, strdup(buf));
|
2010-07-31 16:08:10 -07:00
|
|
|
|
2009-04-08 01:30:13 -07:00
|
|
|
e_win_title_set(win, _("Wallpaper Settings"));
|
2009-09-21 13:36:35 -07:00
|
|
|
e_win_name_class_set(win, "E", "_config::appearance/wallpaper2");
|
2009-03-30 06:34:32 -07:00
|
|
|
e_win_resize_callback_set(win, _resize);
|
|
|
|
e_win_delete_callback_set(win, _delete);
|
|
|
|
|
compositor rewrite / charlie-foxtrot situation
huge fustercluck commit because there wasn't really a way to separate out the changes. better to just rip it all out at once.
* compositor and window management completely rewritten. this was the goal for E19, but it pretty much required everything existing to be scrapped since it wasn't optimized, streamlined, or sensible. now instead of having the compositor strapped to the window manager like an outboard motor, it's housed more like an automobile engine.
** various comp structs have been merged into other places (eg. E_Comp_Zone is now just part of E_Zone where applicable), leading to a large deduplication of attributes
** awful E_Comp_Win is totally dead, having been replaced with e_comp_object smart objects which work just like normal canvas objects
** protocol-specific window management and compositor functionality is now kept exclusively in backend files
** e_pixmap api provides generic client finding and rendering api
** screen/xinerama screens are now provided directly by compositor on startup and re-set on change
** e_comp_render_update finally replaced with eina_tiler
** wayland compositor no longer creates X windows
** compositor e_layout removed entirely
* e_container is gone. this was made unnecessary in E18, but I kept it to avoid having too much code churn in one release. its sole purpose was to catch some events and handle window stacking, both of which are now just done by the compositor infra
* e_manager is just for screensaver and keybind stuff now, possibly remove later?
* e_border is gone along with a lot of its api. e_client has replaced it, and e_client has been rewritten completely; some parts may be similar, but the design now relies upon having a functional compositor
** window configuration/focus functions are all removed. all windows are now managed solely with evas_object_X functions on the "frame" member of a client, just as any other canvas object can be managed.
*** do NOT set interceptors on a client's comp_object. seriously.
* startup order rewritten: compositor now starts much earlier, other things just use attrs and members of the compositor
* ecore_x_pointer_xy_get usage replaced with ecore_evas_pointer_xy_get
* e_popup is totally gone, existing usage replaced by e_comp_object_util_add where applicable, otherwise just placed normally on the canvas
* deskmirror is (more) broken for now
* illume is totally fucked
* Ecore_X_Window replaced with Ecore_Window in most cases
* edge binding XWindows replaced with regular canvas objects
* some E_Win functionality has changed such that delete callbacks are now correctly called in ALL cases. various dialogs have been updated to not crash as a result
comp files and descriptions:
e_comp.c - overall compositor functions, rendering/update loop, shape cutting
e_comp_x.c - X window management and compositor functionality
e_comp_wl.c - Wayland surface management and compositor functionality
e_comp_canvas.c - general compositor canvas functions and utilities
e_comp_object.c - E_Client->frame member for managing clients as Evas_Objects, utility functions for adding objects to the compositor rendering systems
additional authors: ivan.briano@intel.com
feature: new compositor
removal: e_border, e_container, e_popup
2014-01-14 17:19:12 -08:00
|
|
|
// bg + manager
|
2009-03-30 23:51:12 -07:00
|
|
|
info->bg = edje_object_add(info->win->evas);
|
2009-03-30 06:34:32 -07:00
|
|
|
e_theme_edje_object_set(info->bg, "base/theme/widgets",
|
|
|
|
"e/conf/wallpaper/main/window");
|
2009-03-30 23:22:55 -07:00
|
|
|
edje_object_signal_callback_add(info->bg, "e,action,click", "e",
|
2009-03-30 23:51:12 -07:00
|
|
|
_bg_clicked, info);
|
2009-03-30 06:34:32 -07:00
|
|
|
|
2009-03-30 23:51:12 -07:00
|
|
|
info->box = e_widget_list_add(info->win->evas, 1, 1);
|
2010-07-31 16:08:10 -07:00
|
|
|
|
2012-08-01 23:11:10 -07:00
|
|
|
// ok button
|
|
|
|
info->button = e_widget_button_add(info->win->evas, _("OK"), NULL,
|
2009-03-30 23:51:12 -07:00
|
|
|
_ok, info, NULL);
|
2009-03-30 06:34:32 -07:00
|
|
|
evas_object_show(info->button);
|
|
|
|
e_widget_list_object_append(info->box, info->button, 1, 0, 0.5);
|
2010-07-31 16:08:10 -07:00
|
|
|
|
2012-08-01 23:11:10 -07:00
|
|
|
// apply button
|
|
|
|
info->button = e_widget_button_add(info->win->evas, _("Apply"), NULL,
|
|
|
|
_apply, info, NULL);
|
|
|
|
evas_object_show(info->button);
|
|
|
|
e_widget_list_object_append(info->box, info->button, 1, 0, 0.5);
|
|
|
|
|
|
|
|
// close button
|
|
|
|
info->button = e_widget_button_add(info->win->evas, _("Close"), NULL,
|
|
|
|
_close, info, NULL);
|
|
|
|
evas_object_show(info->button);
|
|
|
|
e_widget_list_object_append(info->box, info->button, 1, 0, 0.5);
|
|
|
|
|
2009-09-01 06:34:42 -07:00
|
|
|
e_widget_size_min_get(info->box, &mw, &mh);
|
2014-06-07 09:29:17 -07:00
|
|
|
evas_object_size_hint_min_set(info->box, mw, mh);
|
2009-03-30 06:34:32 -07:00
|
|
|
edje_object_part_swallow(info->bg, "e.swallow.buttons", info->box);
|
|
|
|
evas_object_show(info->box);
|
|
|
|
|
|
|
|
// preview
|
2009-03-30 23:51:12 -07:00
|
|
|
info->preview = e_livethumb_add(info->win->evas);
|
2009-03-30 06:34:32 -07:00
|
|
|
e_livethumb_vsize_set(info->preview, zone->w, zone->h);
|
2012-08-01 23:11:10 -07:00
|
|
|
edje_extern_object_aspect_set(info->preview, EDJE_ASPECT_CONTROL_NEITHER,
|
2010-07-31 16:08:10 -07:00
|
|
|
zone->w, zone->h);
|
2009-03-30 06:34:32 -07:00
|
|
|
edje_object_part_swallow(info->bg, "e.swallow.preview", info->preview);
|
|
|
|
evas_object_show(info->preview);
|
2010-07-31 16:08:10 -07:00
|
|
|
|
2009-03-30 06:34:32 -07:00
|
|
|
info->mini = edje_object_add(e_livethumb_evas_get(info->preview));
|
|
|
|
e_livethumb_thumb_set(info->preview, info->mini);
|
|
|
|
evas_object_show(info->mini);
|
|
|
|
if (info->bg_file)
|
|
|
|
edje_object_file_set(info->mini, info->bg_file, "e/desktop/background");
|
|
|
|
else
|
|
|
|
{
|
|
|
|
const char *f = e_theme_edje_file_get("base/theme/backgrounds",
|
|
|
|
"e/desktop/background");
|
2010-07-31 16:08:10 -07:00
|
|
|
|
2009-03-30 06:34:32 -07:00
|
|
|
edje_object_file_set(info->mini, f, "e/desktop/background");
|
|
|
|
}
|
2010-07-31 16:08:10 -07:00
|
|
|
|
2009-03-30 06:34:32 -07:00
|
|
|
// scrolled thumbs
|
2009-03-30 23:51:12 -07:00
|
|
|
info->span = _pan_add(info->win->evas);
|
|
|
|
_pan_info_set(info->span, info);
|
2010-07-31 16:08:10 -07:00
|
|
|
|
2009-03-30 06:34:32 -07:00
|
|
|
// the scrollframe holding the scrolled thumbs
|
2009-03-30 23:51:12 -07:00
|
|
|
info->sframe = e_scrollframe_add(info->win->evas);
|
2009-03-30 06:34:32 -07:00
|
|
|
e_scrollframe_custom_theme_set(info->sframe, "base/theme/widgets",
|
|
|
|
"e/conf/wallpaper/main/scrollframe");
|
|
|
|
e_scrollframe_extern_pan_set(info->sframe, info->span,
|
2012-08-01 23:11:10 -07:00
|
|
|
_pan_set, _pan_get, _pan_max_get,
|
2009-03-30 06:34:32 -07:00
|
|
|
_pan_child_size_get);
|
|
|
|
edje_object_part_swallow(info->bg, "e.swallow.list", info->sframe);
|
|
|
|
evas_object_show(info->sframe);
|
|
|
|
evas_object_show(info->span);
|
2010-07-31 16:08:10 -07:00
|
|
|
|
2009-06-27 04:42:46 -07:00
|
|
|
ob = e_widget_list_add(info->win->evas, 0, 1);
|
2009-04-04 07:15:08 -07:00
|
|
|
|
2009-06-27 04:42:46 -07:00
|
|
|
o = e_widget_list_add(info->win->evas, 1, 0);
|
2010-07-31 16:08:10 -07:00
|
|
|
|
2009-04-04 07:15:08 -07:00
|
|
|
rg = e_widget_radio_group_new(&(info->mode));
|
|
|
|
o2 = e_widget_radio_add(info->win->evas, _("All Desktops"), 0, rg);
|
2009-08-17 00:55:25 -07:00
|
|
|
evas_object_smart_callback_add(o2, "changed", _wp_changed, info);
|
2009-06-27 04:42:46 -07:00
|
|
|
e_widget_list_object_append(o, o2, 1, 0, 0.5);
|
compositor rewrite / charlie-foxtrot situation
huge fustercluck commit because there wasn't really a way to separate out the changes. better to just rip it all out at once.
* compositor and window management completely rewritten. this was the goal for E19, but it pretty much required everything existing to be scrapped since it wasn't optimized, streamlined, or sensible. now instead of having the compositor strapped to the window manager like an outboard motor, it's housed more like an automobile engine.
** various comp structs have been merged into other places (eg. E_Comp_Zone is now just part of E_Zone where applicable), leading to a large deduplication of attributes
** awful E_Comp_Win is totally dead, having been replaced with e_comp_object smart objects which work just like normal canvas objects
** protocol-specific window management and compositor functionality is now kept exclusively in backend files
** e_pixmap api provides generic client finding and rendering api
** screen/xinerama screens are now provided directly by compositor on startup and re-set on change
** e_comp_render_update finally replaced with eina_tiler
** wayland compositor no longer creates X windows
** compositor e_layout removed entirely
* e_container is gone. this was made unnecessary in E18, but I kept it to avoid having too much code churn in one release. its sole purpose was to catch some events and handle window stacking, both of which are now just done by the compositor infra
* e_manager is just for screensaver and keybind stuff now, possibly remove later?
* e_border is gone along with a lot of its api. e_client has replaced it, and e_client has been rewritten completely; some parts may be similar, but the design now relies upon having a functional compositor
** window configuration/focus functions are all removed. all windows are now managed solely with evas_object_X functions on the "frame" member of a client, just as any other canvas object can be managed.
*** do NOT set interceptors on a client's comp_object. seriously.
* startup order rewritten: compositor now starts much earlier, other things just use attrs and members of the compositor
* ecore_x_pointer_xy_get usage replaced with ecore_evas_pointer_xy_get
* e_popup is totally gone, existing usage replaced by e_comp_object_util_add where applicable, otherwise just placed normally on the canvas
* deskmirror is (more) broken for now
* illume is totally fucked
* Ecore_X_Window replaced with Ecore_Window in most cases
* edge binding XWindows replaced with regular canvas objects
* some E_Win functionality has changed such that delete callbacks are now correctly called in ALL cases. various dialogs have been updated to not crash as a result
comp files and descriptions:
e_comp.c - overall compositor functions, rendering/update loop, shape cutting
e_comp_x.c - X window management and compositor functionality
e_comp_wl.c - Wayland surface management and compositor functionality
e_comp_canvas.c - general compositor canvas functions and utilities
e_comp_object.c - E_Client->frame member for managing clients as Evas_Objects, utility functions for adding objects to the compositor rendering systems
additional authors: ivan.briano@intel.com
feature: new compositor
removal: e_border, e_container, e_popup
2014-01-14 17:19:12 -08:00
|
|
|
e_widget_disabled_set(o2, (e_util_comp_desk_count_get(comp) < 2));
|
2009-04-04 07:15:08 -07:00
|
|
|
evas_object_show(o2);
|
2010-07-31 16:08:10 -07:00
|
|
|
|
2009-04-04 07:15:08 -07:00
|
|
|
o2 = e_widget_radio_add(info->win->evas, _("This Desktop"), 1, rg);
|
2009-08-17 00:55:25 -07:00
|
|
|
evas_object_smart_callback_add(o2, "changed", _wp_changed, info);
|
2009-06-27 04:42:46 -07:00
|
|
|
e_widget_list_object_append(o, o2, 1, 0, 0.5);
|
2009-04-04 07:15:08 -07:00
|
|
|
evas_object_show(o2);
|
2010-07-31 16:08:10 -07:00
|
|
|
|
2009-04-04 07:15:08 -07:00
|
|
|
o2 = e_widget_radio_add(info->win->evas, _("This Screen"), 2, rg);
|
2009-08-17 00:55:25 -07:00
|
|
|
evas_object_smart_callback_add(o2, "changed", _wp_changed, info);
|
2009-06-27 04:42:46 -07:00
|
|
|
e_widget_list_object_append(o, o2, 1, 0, 0.5);
|
compositor rewrite / charlie-foxtrot situation
huge fustercluck commit because there wasn't really a way to separate out the changes. better to just rip it all out at once.
* compositor and window management completely rewritten. this was the goal for E19, but it pretty much required everything existing to be scrapped since it wasn't optimized, streamlined, or sensible. now instead of having the compositor strapped to the window manager like an outboard motor, it's housed more like an automobile engine.
** various comp structs have been merged into other places (eg. E_Comp_Zone is now just part of E_Zone where applicable), leading to a large deduplication of attributes
** awful E_Comp_Win is totally dead, having been replaced with e_comp_object smart objects which work just like normal canvas objects
** protocol-specific window management and compositor functionality is now kept exclusively in backend files
** e_pixmap api provides generic client finding and rendering api
** screen/xinerama screens are now provided directly by compositor on startup and re-set on change
** e_comp_render_update finally replaced with eina_tiler
** wayland compositor no longer creates X windows
** compositor e_layout removed entirely
* e_container is gone. this was made unnecessary in E18, but I kept it to avoid having too much code churn in one release. its sole purpose was to catch some events and handle window stacking, both of which are now just done by the compositor infra
* e_manager is just for screensaver and keybind stuff now, possibly remove later?
* e_border is gone along with a lot of its api. e_client has replaced it, and e_client has been rewritten completely; some parts may be similar, but the design now relies upon having a functional compositor
** window configuration/focus functions are all removed. all windows are now managed solely with evas_object_X functions on the "frame" member of a client, just as any other canvas object can be managed.
*** do NOT set interceptors on a client's comp_object. seriously.
* startup order rewritten: compositor now starts much earlier, other things just use attrs and members of the compositor
* ecore_x_pointer_xy_get usage replaced with ecore_evas_pointer_xy_get
* e_popup is totally gone, existing usage replaced by e_comp_object_util_add where applicable, otherwise just placed normally on the canvas
* deskmirror is (more) broken for now
* illume is totally fucked
* Ecore_X_Window replaced with Ecore_Window in most cases
* edge binding XWindows replaced with regular canvas objects
* some E_Win functionality has changed such that delete callbacks are now correctly called in ALL cases. various dialogs have been updated to not crash as a result
comp files and descriptions:
e_comp.c - overall compositor functions, rendering/update loop, shape cutting
e_comp_x.c - X window management and compositor functionality
e_comp_wl.c - Wayland surface management and compositor functionality
e_comp_canvas.c - general compositor canvas functions and utilities
e_comp_object.c - E_Client->frame member for managing clients as Evas_Objects, utility functions for adding objects to the compositor rendering systems
additional authors: ivan.briano@intel.com
feature: new compositor
removal: e_border, e_container, e_popup
2014-01-14 17:19:12 -08:00
|
|
|
if (!(e_util_comp_zone_number_get(0, 1) ||
|
|
|
|
(e_util_comp_zone_number_get(1, 0))))
|
2010-07-31 16:08:10 -07:00
|
|
|
e_widget_disabled_set(o2, EINA_TRUE);
|
2009-04-04 07:15:08 -07:00
|
|
|
evas_object_show(o2);
|
2010-07-31 16:08:10 -07:00
|
|
|
|
2009-06-27 04:42:46 -07:00
|
|
|
e_widget_list_object_append(ob, o, 1, 0, 0.5);
|
|
|
|
evas_object_show(o);
|
2010-07-31 16:08:10 -07:00
|
|
|
|
2009-06-27 04:42:46 -07:00
|
|
|
o = e_widget_list_add(info->win->evas, 1, 0);
|
2010-07-31 16:08:10 -07:00
|
|
|
|
2012-08-01 23:11:10 -07:00
|
|
|
o2 = e_widget_button_add(info->win->evas, _("Add"), NULL,
|
2009-06-27 04:42:46 -07:00
|
|
|
_wp_add, info, NULL);
|
|
|
|
e_widget_list_object_append(o, o2, 1, 0, 0.5);
|
2009-04-18 06:52:41 -07:00
|
|
|
evas_object_show(o2);
|
2010-07-31 16:08:10 -07:00
|
|
|
|
2012-08-01 23:11:10 -07:00
|
|
|
o2 = e_widget_button_add(info->win->evas, _("Delete"), NULL,
|
2009-06-27 04:42:46 -07:00
|
|
|
_wp_delete, info, NULL);
|
|
|
|
e_widget_list_object_append(o, o2, 1, 0, 0.5);
|
2009-04-18 06:52:41 -07:00
|
|
|
evas_object_show(o2);
|
2010-07-31 16:08:10 -07:00
|
|
|
|
2009-06-27 04:42:46 -07:00
|
|
|
e_widget_list_object_append(ob, o, 1, 0, 0.5);
|
2009-04-04 07:15:08 -07:00
|
|
|
evas_object_show(o);
|
2010-07-31 16:08:10 -07:00
|
|
|
|
2009-09-01 06:34:42 -07:00
|
|
|
e_widget_size_min_get(ob, &mw, &mh);
|
2014-06-07 09:29:17 -07:00
|
|
|
evas_object_size_hint_min_set(ob, mw, mh);
|
2009-06-27 04:42:46 -07:00
|
|
|
edje_object_part_swallow(info->bg, "e.swallow.extras", ob);
|
|
|
|
evas_object_show(ob);
|
2009-03-30 06:34:32 -07:00
|
|
|
|
|
|
|
// min size calc
|
|
|
|
edje_object_size_min_calc(info->bg, &mw, &mh);
|
|
|
|
e_win_size_min_set(win, mw, mh);
|
|
|
|
if ((zone->w / 4) > mw) mw = (zone->w / 4);
|
|
|
|
if ((zone->h / 4) > mh) mh = (zone->h / 4);
|
|
|
|
e_win_resize(win, mw, mh);
|
|
|
|
e_win_centered_set(win, 1);
|
|
|
|
e_win_show(win);
|
compositor rewrite / charlie-foxtrot situation
huge fustercluck commit because there wasn't really a way to separate out the changes. better to just rip it all out at once.
* compositor and window management completely rewritten. this was the goal for E19, but it pretty much required everything existing to be scrapped since it wasn't optimized, streamlined, or sensible. now instead of having the compositor strapped to the window manager like an outboard motor, it's housed more like an automobile engine.
** various comp structs have been merged into other places (eg. E_Comp_Zone is now just part of E_Zone where applicable), leading to a large deduplication of attributes
** awful E_Comp_Win is totally dead, having been replaced with e_comp_object smart objects which work just like normal canvas objects
** protocol-specific window management and compositor functionality is now kept exclusively in backend files
** e_pixmap api provides generic client finding and rendering api
** screen/xinerama screens are now provided directly by compositor on startup and re-set on change
** e_comp_render_update finally replaced with eina_tiler
** wayland compositor no longer creates X windows
** compositor e_layout removed entirely
* e_container is gone. this was made unnecessary in E18, but I kept it to avoid having too much code churn in one release. its sole purpose was to catch some events and handle window stacking, both of which are now just done by the compositor infra
* e_manager is just for screensaver and keybind stuff now, possibly remove later?
* e_border is gone along with a lot of its api. e_client has replaced it, and e_client has been rewritten completely; some parts may be similar, but the design now relies upon having a functional compositor
** window configuration/focus functions are all removed. all windows are now managed solely with evas_object_X functions on the "frame" member of a client, just as any other canvas object can be managed.
*** do NOT set interceptors on a client's comp_object. seriously.
* startup order rewritten: compositor now starts much earlier, other things just use attrs and members of the compositor
* ecore_x_pointer_xy_get usage replaced with ecore_evas_pointer_xy_get
* e_popup is totally gone, existing usage replaced by e_comp_object_util_add where applicable, otherwise just placed normally on the canvas
* deskmirror is (more) broken for now
* illume is totally fucked
* Ecore_X_Window replaced with Ecore_Window in most cases
* edge binding XWindows replaced with regular canvas objects
* some E_Win functionality has changed such that delete callbacks are now correctly called in ALL cases. various dialogs have been updated to not crash as a result
comp files and descriptions:
e_comp.c - overall compositor functions, rendering/update loop, shape cutting
e_comp_x.c - X window management and compositor functionality
e_comp_wl.c - Wayland surface management and compositor functionality
e_comp_canvas.c - general compositor canvas functions and utilities
e_comp_object.c - E_Client->frame member for managing clients as Evas_Objects, utility functions for adding objects to the compositor rendering systems
additional authors: ivan.briano@intel.com
feature: new compositor
removal: e_border, e_container, e_popup
2014-01-14 17:19:12 -08:00
|
|
|
e_win_client_icon_set(win, "preferences-desktop-wallpaper");
|
2009-03-30 06:34:32 -07:00
|
|
|
|
2009-03-30 23:51:12 -07:00
|
|
|
evas_object_resize(info->bg, info->win->w, info->win->h);
|
2009-03-30 06:34:32 -07:00
|
|
|
evas_object_show(info->bg);
|
2009-04-05 09:10:50 -07:00
|
|
|
|
|
|
|
// add theme bg
|
|
|
|
_pan_file_add(info->span, NULL, 0, 1);
|
2010-07-31 16:08:10 -07:00
|
|
|
|
2009-03-30 23:51:12 -07:00
|
|
|
_scan(info);
|
|
|
|
return info;
|
2009-03-30 06:34:32 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2009-03-30 23:51:12 -07:00
|
|
|
wp_broser_free(Info *info)
|
2009-03-30 06:34:32 -07:00
|
|
|
{
|
2009-03-31 05:20:35 -07:00
|
|
|
char *s;
|
2010-07-31 16:08:10 -07:00
|
|
|
|
2009-03-30 23:51:12 -07:00
|
|
|
if (!info) return;
|
2014-02-14 12:19:03 -08:00
|
|
|
if (info->win) e_object_del(E_OBJECT(info->win));
|
2012-04-30 00:07:33 -07:00
|
|
|
if (info->dir) eina_iterator_free(info->dir);
|
2013-01-23 02:18:46 -08:00
|
|
|
eina_stringshare_del(info->bg_file);
|
2009-03-31 05:20:35 -07:00
|
|
|
free(info->curdir);
|
2012-08-01 23:11:10 -07:00
|
|
|
EINA_LIST_FREE(info->dirs, s)
|
2010-08-01 10:59:31 -07:00
|
|
|
free(s);
|
2009-03-31 05:20:35 -07:00
|
|
|
if (info->idler) ecore_idler_del(info->idler);
|
2009-03-30 06:34:32 -07:00
|
|
|
// del other stuff
|
2012-12-21 13:31:13 -08:00
|
|
|
E_FREE(info);
|
2009-03-30 23:51:12 -07:00
|
|
|
}
|
|
|
|
|
2009-09-03 09:32:48 -07:00
|
|
|
E_Config_Dialog *
|
compositor rewrite / charlie-foxtrot situation
huge fustercluck commit because there wasn't really a way to separate out the changes. better to just rip it all out at once.
* compositor and window management completely rewritten. this was the goal for E19, but it pretty much required everything existing to be scrapped since it wasn't optimized, streamlined, or sensible. now instead of having the compositor strapped to the window manager like an outboard motor, it's housed more like an automobile engine.
** various comp structs have been merged into other places (eg. E_Comp_Zone is now just part of E_Zone where applicable), leading to a large deduplication of attributes
** awful E_Comp_Win is totally dead, having been replaced with e_comp_object smart objects which work just like normal canvas objects
** protocol-specific window management and compositor functionality is now kept exclusively in backend files
** e_pixmap api provides generic client finding and rendering api
** screen/xinerama screens are now provided directly by compositor on startup and re-set on change
** e_comp_render_update finally replaced with eina_tiler
** wayland compositor no longer creates X windows
** compositor e_layout removed entirely
* e_container is gone. this was made unnecessary in E18, but I kept it to avoid having too much code churn in one release. its sole purpose was to catch some events and handle window stacking, both of which are now just done by the compositor infra
* e_manager is just for screensaver and keybind stuff now, possibly remove later?
* e_border is gone along with a lot of its api. e_client has replaced it, and e_client has been rewritten completely; some parts may be similar, but the design now relies upon having a functional compositor
** window configuration/focus functions are all removed. all windows are now managed solely with evas_object_X functions on the "frame" member of a client, just as any other canvas object can be managed.
*** do NOT set interceptors on a client's comp_object. seriously.
* startup order rewritten: compositor now starts much earlier, other things just use attrs and members of the compositor
* ecore_x_pointer_xy_get usage replaced with ecore_evas_pointer_xy_get
* e_popup is totally gone, existing usage replaced by e_comp_object_util_add where applicable, otherwise just placed normally on the canvas
* deskmirror is (more) broken for now
* illume is totally fucked
* Ecore_X_Window replaced with Ecore_Window in most cases
* edge binding XWindows replaced with regular canvas objects
* some E_Win functionality has changed such that delete callbacks are now correctly called in ALL cases. various dialogs have been updated to not crash as a result
comp files and descriptions:
e_comp.c - overall compositor functions, rendering/update loop, shape cutting
e_comp_x.c - X window management and compositor functionality
e_comp_wl.c - Wayland surface management and compositor functionality
e_comp_canvas.c - general compositor canvas functions and utilities
e_comp_object.c - E_Client->frame member for managing clients as Evas_Objects, utility functions for adding objects to the compositor rendering systems
additional authors: ivan.briano@intel.com
feature: new compositor
removal: e_border, e_container, e_popup
2014-01-14 17:19:12 -08:00
|
|
|
wp_conf_show(E_Comp *comp, const char *params __UNUSED__)
|
2009-03-30 23:51:12 -07:00
|
|
|
{
|
|
|
|
if (global_info)
|
|
|
|
{
|
|
|
|
e_win_show(global_info->win);
|
|
|
|
e_win_raise(global_info->win);
|
|
|
|
}
|
compositor rewrite / charlie-foxtrot situation
huge fustercluck commit because there wasn't really a way to separate out the changes. better to just rip it all out at once.
* compositor and window management completely rewritten. this was the goal for E19, but it pretty much required everything existing to be scrapped since it wasn't optimized, streamlined, or sensible. now instead of having the compositor strapped to the window manager like an outboard motor, it's housed more like an automobile engine.
** various comp structs have been merged into other places (eg. E_Comp_Zone is now just part of E_Zone where applicable), leading to a large deduplication of attributes
** awful E_Comp_Win is totally dead, having been replaced with e_comp_object smart objects which work just like normal canvas objects
** protocol-specific window management and compositor functionality is now kept exclusively in backend files
** e_pixmap api provides generic client finding and rendering api
** screen/xinerama screens are now provided directly by compositor on startup and re-set on change
** e_comp_render_update finally replaced with eina_tiler
** wayland compositor no longer creates X windows
** compositor e_layout removed entirely
* e_container is gone. this was made unnecessary in E18, but I kept it to avoid having too much code churn in one release. its sole purpose was to catch some events and handle window stacking, both of which are now just done by the compositor infra
* e_manager is just for screensaver and keybind stuff now, possibly remove later?
* e_border is gone along with a lot of its api. e_client has replaced it, and e_client has been rewritten completely; some parts may be similar, but the design now relies upon having a functional compositor
** window configuration/focus functions are all removed. all windows are now managed solely with evas_object_X functions on the "frame" member of a client, just as any other canvas object can be managed.
*** do NOT set interceptors on a client's comp_object. seriously.
* startup order rewritten: compositor now starts much earlier, other things just use attrs and members of the compositor
* ecore_x_pointer_xy_get usage replaced with ecore_evas_pointer_xy_get
* e_popup is totally gone, existing usage replaced by e_comp_object_util_add where applicable, otherwise just placed normally on the canvas
* deskmirror is (more) broken for now
* illume is totally fucked
* Ecore_X_Window replaced with Ecore_Window in most cases
* edge binding XWindows replaced with regular canvas objects
* some E_Win functionality has changed such that delete callbacks are now correctly called in ALL cases. various dialogs have been updated to not crash as a result
comp files and descriptions:
e_comp.c - overall compositor functions, rendering/update loop, shape cutting
e_comp_x.c - X window management and compositor functionality
e_comp_wl.c - Wayland surface management and compositor functionality
e_comp_canvas.c - general compositor canvas functions and utilities
e_comp_object.c - E_Client->frame member for managing clients as Evas_Objects, utility functions for adding objects to the compositor rendering systems
additional authors: ivan.briano@intel.com
feature: new compositor
removal: e_border, e_container, e_popup
2014-01-14 17:19:12 -08:00
|
|
|
global_info = wp_browser_new(comp);
|
2009-09-03 09:32:48 -07:00
|
|
|
|
|
|
|
return NULL;
|
2009-03-30 23:51:12 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
wp_conf_hide(void)
|
|
|
|
{
|
|
|
|
if (global_info)
|
|
|
|
{
|
|
|
|
wp_broser_free(global_info);
|
|
|
|
global_info = NULL;
|
|
|
|
}
|
2009-03-30 06:34:32 -07:00
|
|
|
}
|