file selector is resizable now - cleaned up some unfinisehd code to make it


			
			
				devs/princeamd/enlightenment-0.17-elive
			
			
		
Carsten Haitzler 17 years ago
parent 854874e713
commit 9eef59377f
  1. 9
      src/bin/e_bg.c
  2. 114
      src/bin/e_border.c
  3. 2
      src/bin/e_border.h
  4. 26
      src/bin/e_box.c
  5. 13
      src/bin/e_dialog.c
  6. 4
      src/bin/e_eap_editor.c
  7. 32
      src/bin/e_file_dialog.c
  8. 5
      src/bin/e_fileman_smart.c
  9. 7
      src/bin/e_scrollframe.c
  10. 1
      src/bin/e_scrollframe.h
  11. 10
      src/bin/e_widget_framelist.c
  12. 2
      src/bin/e_widget_framelist.h
  13. 4
      src/bin/e_widget_list.c
  14. 2
      src/bin/e_widget_table.c
  15. 2
      src/bin/e_widget_table.h
  16. 3
      src/bin/e_win.c

@ -30,13 +30,12 @@ e_bg_zone_update(E_Zone *zone, E_Bg_Transition transition)
E_Desk *desk;
cfbg = l->data;
if ((cfbg->container >= 0) &&
(zone->container->num != cfbg->container)) continue;
if ((cfbg->zone >= 0) &&
(zone->num != cfbg->zone)) continue;
if ((cfbg->container >= 0) && (zone->container->num != cfbg->container)) continue;
if ((cfbg->zone >= 0) && (zone->num != cfbg->zone)) continue;
desk = e_desk_current_get(zone);
if (!desk) continue;
if ((cfbg->desk_x != desk->x) || (cfbg->desk_y != desk->y)) continue;
if ((cfbg->desk_x >= 0) && (cfbg->desk_x != desk->x)) continue;
if ((cfbg->desk_y >= 0) && (cfbg->desk_y != desk->y)) continue;
entries = edje_file_collection_list(cfbg->file);
if (entries)
{

@ -2068,7 +2068,9 @@ e_border_act_kill_begin(E_Border *bd)
_e_border_cb_kill_timer, bd);
}
else
ecore_x_kill(bd->client.win);
{
if (!bd->internal) ecore_x_kill(bd->client.win);
}
e_border_hide(bd, 0);
}
@ -5094,7 +5096,10 @@ _e_border_eval(E_Border *bd)
evas_obscured_clear(bd->bg_evas);
ecore_x_window_move_resize(bd->win, bd->x, bd->y, bd->w, bd->h);
ecore_x_window_move_resize(bd->event_win, 0, 0, bd->w, bd->h);
ecore_x_window_move_resize(bd->client.win, 0, 0, bd->client.w, bd->client.h);
if (bd->internal_ecore_evas)
ecore_evas_move_resize(bd->internal_ecore_evas, 0, 0, bd->client.w, bd->client.h);
else
ecore_x_window_move_resize(bd->client.win, 0, 0, bd->client.w, bd->client.h);
ecore_evas_move_resize(bd->bg_ecore_evas, 0, 0, bd->w, bd->h);
evas_object_resize(bd->bg_object, bd->w, bd->h);
e_container_shape_resize(bd->shape, bd->w, bd->h);
@ -5116,22 +5121,50 @@ _e_border_eval(E_Border *bd)
if (bd->shading)
{
if (bd->shade.dir == E_DIRECTION_UP)
ecore_x_window_move_resize(bd->client.win, 0,
bd->h - (bd->client_inset.t + bd->client_inset.b) -
bd->client.h,
bd->client.w, bd->client.h);
{
if (bd->internal_ecore_evas)
ecore_evas_move_resize(bd->internal_ecore_evas, 0,
bd->h - (bd->client_inset.t + bd->client_inset.b) -
bd->client.h,
bd->client.w, bd->client.h);
else
ecore_x_window_move_resize(bd->client.win, 0,
bd->h - (bd->client_inset.t + bd->client_inset.b) -
bd->client.h,
bd->client.w, bd->client.h);
}
else if (bd->shade.dir == E_DIRECTION_LEFT)
ecore_x_window_move_resize(bd->client.win,
bd->w - (bd->client_inset.l + bd->client_inset.r) -
bd->client.h,
0, bd->client.w, bd->client.h);
{
if (bd->internal_ecore_evas)
ecore_evas_move_resize(bd->internal_ecore_evas,
bd->w - (bd->client_inset.l + bd->client_inset.r) -
bd->client.h,
0, bd->client.w, bd->client.h);
else
ecore_x_window_move_resize(bd->client.win,
bd->w - (bd->client_inset.l + bd->client_inset.r) -
bd->client.h,
0, bd->client.w, bd->client.h);
}
else
{
if (bd->internal_ecore_evas)
ecore_evas_move_resize(bd->internal_ecore_evas, 0, 0,
bd->client.w, bd->client.h);
else
ecore_x_window_move_resize(bd->client.win, 0, 0,
bd->client.w, bd->client.h);
}
}
else
{
if (bd->internal_ecore_evas)
ecore_evas_move_resize(bd->internal_ecore_evas, 0, 0,
bd->client.w, bd->client.h);
else
ecore_x_window_move_resize(bd->client.win, 0, 0,
bd->client.w, bd->client.h);
}
else
ecore_x_window_move_resize(bd->client.win, 0, 0,
bd->client.w, bd->client.h);
ecore_evas_move_resize(bd->bg_ecore_evas, 0, 0, bd->w, bd->h);
evas_object_resize(bd->bg_object, bd->w, bd->h);
e_container_shape_resize(bd->shape, bd->w, bd->h);
@ -5154,7 +5187,10 @@ _e_border_eval(E_Border *bd)
evas_obscured_clear(bd->bg_evas);
ecore_x_window_move_resize(bd->event_win, 0, 0, bd->w, bd->h);
ecore_x_window_resize(bd->win, bd->w, bd->h);
ecore_x_window_move_resize(bd->client.win, 0, 0, bd->client.w, bd->client.h);
if (bd->internal_ecore_evas)
ecore_evas_move_resize(bd->internal_ecore_evas, 0, 0, bd->client.w, bd->client.h);
else
ecore_x_window_move_resize(bd->client.win, 0, 0, bd->client.w, bd->client.h);
ecore_evas_move_resize(bd->bg_ecore_evas, 0, 0, bd->w, bd->h);
evas_object_resize(bd->bg_object, bd->w, bd->h);
e_container_shape_resize(bd->shape, bd->w, bd->h);
@ -5175,22 +5211,50 @@ _e_border_eval(E_Border *bd)
if (bd->shading)
{
if (bd->shade.dir == E_DIRECTION_UP)
ecore_x_window_move_resize(bd->client.win, 0,
bd->h - (bd->client_inset.t + bd->client_inset.b) -
bd->client.h,
bd->client.w, bd->client.h);
{
if (bd->internal_ecore_evas)
ecore_evas_move_resize(bd->internal_ecore_evas, 0,
bd->h - (bd->client_inset.t + bd->client_inset.b) -
bd->client.h,
bd->client.w, bd->client.h);
else
ecore_x_window_move_resize(bd->client.win, 0,
bd->h - (bd->client_inset.t + bd->client_inset.b) -
bd->client.h,
bd->client.w, bd->client.h);
}
else if (bd->shade.dir == E_DIRECTION_LEFT)
ecore_x_window_move_resize(bd->client.win,
bd->w - (bd->client_inset.l + bd->client_inset.r) -
bd->client.h,
0, bd->client.w, bd->client.h);
{
if (bd->internal_ecore_evas)
ecore_evas_move_resize(bd->internal_ecore_evas,
bd->w - (bd->client_inset.l + bd->client_inset.r) -
bd->client.h,
0, bd->client.w, bd->client.h);
else
ecore_x_window_move_resize(bd->client.win,
bd->w - (bd->client_inset.l + bd->client_inset.r) -
bd->client.h,
0, bd->client.w, bd->client.h);
}
else
{
if (bd->internal_ecore_evas)
ecore_evas_move_resize(bd->internal_ecore_evas, 0, 0,
bd->client.w, bd->client.h);
else
ecore_x_window_move_resize(bd->client.win, 0, 0,
bd->client.w, bd->client.h);
}
}
else
{
if (bd->internal_ecore_evas)
ecore_evas_move_resize(bd->internal_ecore_evas, 0, 0,
bd->client.w, bd->client.h);
else
ecore_x_window_move_resize(bd->client.win, 0, 0,
bd->client.w, bd->client.h);
}
else
ecore_x_window_move_resize(bd->client.win, 0, 0,
bd->client.w, bd->client.h);
ecore_evas_move_resize(bd->bg_ecore_evas, 0, 0, bd->w, bd->h);
evas_object_resize(bd->bg_object, bd->w, bd->h);
e_container_shape_resize(bd->shape, bd->w, bd->h);

@ -331,6 +331,8 @@ struct _E_Border
unsigned int lock_life : 1; /*DONE*/
unsigned int internal : 1;
Ecore_Evas *internal_ecore_evas;
double ping;
unsigned char changed : 1;

@ -387,7 +387,7 @@ _e_box_smart_reconfigure(E_Smart_Data *sd)
{
Evas_Coord x, y, w, h, xx, yy;
Evas_List *l;
int minw, minh;
int minw, minh, wdif, hdif;
int count, expand;
if (!sd->changed) return;
@ -432,15 +432,17 @@ _e_box_smart_reconfigure(E_Smart_Data *sd)
{
if (sd->horizontal)
{
x += (w - minw) / 2;
x += (double)(w - minw) * sd->align.x;
w = minw;
}
else
{
y += (h - minh) / 2;
y += (double)(h - minh) * sd->align.y;
h = minh;
}
}
wdif = w - minw;
hdif = h - minh;
xx = x;
yy = y;
for (l = sd->items; l; l = l->next)
@ -472,10 +474,16 @@ _e_box_smart_reconfigure(E_Smart_Data *sd)
}
else
{
/* FIXME: not done - this is fucked atm */
Evas_Coord ww, hh, ow, oh;
ww = bi->min.w;
if ((expand > 0) && (bi->expand_w))
{
if (expand == 1) ow = wdif;
else ow = (w - minw) / expand;
wdif -= ow;
ww += ow;
}
hh = h;
ow = bi->min.w;
if (bi->fill_w) ow = ww;
@ -512,11 +520,17 @@ _e_box_smart_reconfigure(E_Smart_Data *sd)
}
else
{
/* FIXME: not done - this is fucked atm */
Evas_Coord ww, hh, ow, oh;
ww = w;
hh = bi->min.h;
if ((expand > 0) && (bi->expand_h))
{
if (expand == 1) oh = hdif;
else oh = (h - minh) / expand;
hdif -= oh;
hh += oh;
}
ow = bi->min.w;
if (bi->expand_w) ow = ww;
if ((bi->max.w >= 0) && (bi->max.w < ow)) ow = bi->max.w;
@ -630,6 +644,8 @@ _e_box_smart_add(Evas_Object *obj)
sd->y = 0;
sd->w = 0;
sd->h = 0;
sd->align.x = 0.5;
sd->align.y = 0.5;
sd->clip = evas_object_rectangle_add(evas_object_evas_get(obj));
evas_object_smart_member_add(sd->clip, obj);
evas_object_move(sd->clip, -100004, -100004);

@ -7,6 +7,7 @@
static void _e_dialog_free(E_Dialog *dia);
static void _e_dialog_del_func_cb(void *data, E_Dialog *dia);
static void _e_dialog_cb_delete(E_Win *win);
static void _e_dialog_cb_resize(E_Win *win);
static void _e_dialog_cb_key_down(void *data, Evas *e, Evas_Object *obj, void *event);
static void _e_dialog_cb_wid_on_focus(void *data, Evas_Object *obj);
@ -40,6 +41,7 @@ e_dialog_new(E_Container *con)
}
ecore_x_netwm_window_type_set(dia->win->evas_win, ECORE_X_WINDOW_TYPE_DIALOG);
e_win_delete_callback_set(dia->win, _e_dialog_cb_delete);
e_win_resize_callback_set(dia->win, _e_dialog_cb_resize);
dia->win->data = dia;
e_win_name_class_set(dia->win, "E", "_dialog");
o = edje_object_add(e_win_evas_get(dia->win));
@ -79,7 +81,7 @@ e_dialog_button_add(E_Dialog *dia, char *label, char *icon, void (*func) (void *
if (!func) func = _e_dialog_del_func_cb;
o = e_widget_button_add(e_win_evas_get(dia->win), label, icon, func, data, dia);
e_widget_list_object_append(dia->box_object, o, 1, 1, 0.5);
e_widget_list_object_append(dia->box_object, o, 1, 0, 0.5);
dia->buttons = evas_list_append(dia->buttons, o);
}
@ -277,6 +279,15 @@ _e_dialog_cb_delete(E_Win *win)
e_object_del(E_OBJECT(dia));
}
static void
_e_dialog_cb_resize(E_Win *win)
{
E_Dialog *dia;
dia = win->data;
evas_object_resize(dia->bg_object, dia->win->w, dia->win->h);
}
static void
_e_dialog_cb_wid_on_focus(void *data, Evas_Object *obj)
{

@ -211,7 +211,7 @@ _e_eap_edit_basic_create_widgets(E_Config_Dialog *cfd, Evas *evas, void *data)
eap = editor->eap;
//ol = e_widget_list_add(evas, 0, 1);
ol = e_widget_table_add(evas, _("Settings"), 0);
ol = e_widget_table_add(evas, 0);
o = e_widget_frametable_add(evas, _("Icon"), 0);
@ -272,7 +272,7 @@ _e_eap_edit_advanced_create_widgets(E_Config_Dialog *cfd, Evas *evas, void *data
editor = cfdata->editor;
eap = editor->eap;
//ol = e_widget_table_add(evas, _("Advanced"), 0);
//ol = e_widget_table_add(evas, 0);
ol = _e_eap_edit_basic_create_widgets(cfd, evas, data);
o = e_widget_frametable_add(evas, _("General"), 0);

@ -18,7 +18,7 @@ e_file_dialog_new(E_Container *con)
Evas_Coord w, h, ew, eh;
E_Manager *man;
Evas *evas;
Evas_Object *table, *ol, *fm;
Evas_Object *list, *ol, *fm;
if (!con)
{
@ -46,31 +46,16 @@ e_file_dialog_new(E_Container *con)
ol = e_widget_list_add(evas, 0, 1);
table = e_widget_frametable_add(evas, "Places", 0);
e_widget_frametable_object_append(table, e_widget_button_add(evas, strdup("Home"), "fileman/home", NULL,
NULL, NULL),
0, 0, 1, 1, 1, 0, 1, 0);
e_widget_frametable_object_append(table, e_widget_button_add(evas, strdup("Desktop"), "fileman/desktop", NULL,
NULL, NULL),
0, 1, 1, 1, 1, 0, 1, 0);
e_widget_frametable_object_append(table, e_widget_button_add(evas, strdup("Icons"), "fileman/folder", NULL,
NULL, NULL),
0, 2, 1, 1, 1, 0, 1, 0);
e_widget_list_object_append(ol, table, 1, 1, 0.0);
table = e_widget_table_add(evas, "Select File", 0);
list = e_widget_framelist_add(evas, "Places", 0);
e_widget_framelist_content_align_set(list, 0.5, 0.0);
e_widget_framelist_object_append(list, e_widget_button_add(evas, strdup("Home"), "fileman/home", NULL, NULL, NULL));
e_widget_framelist_object_append(list, e_widget_button_add(evas, strdup("Desktop"), "fileman/desktop", NULL, NULL, NULL));
e_widget_framelist_object_append(list, e_widget_button_add(evas, strdup("Icons"), "fileman/folder", NULL, NULL, NULL));
e_widget_list_object_append(ol, list, 1, 0, 0.0);
fm = e_widget_fileman_add(evas, &(dia->file));
e_widget_table_object_append(table, fm, 0, 0, 4, 4, 1, 1, 1, 1);
e_widget_fileman_select_callback_add(fm, _e_file_dialog_file_select_cb, dia);
e_widget_list_object_append(ol, table, 1, 1, 0.0);
e_widget_list_object_append(ol, fm, 1, 1, 0.0);
e_widget_min_size_get(ol, &w, &h);
e_dialog_content_set(dia->dia, ol, w, h);
@ -85,6 +70,7 @@ void
e_file_dialog_show(E_File_Dialog *dia)
{
e_dialog_show(dia->dia);
e_win_size_max_set(dia->dia->win, 9999, 9999);
}
void

@ -1546,6 +1546,11 @@ _e_fm_dir_monitor_cb(void *data, Ecore_File_Monitor *ecore_file_monitor,
icon = E_NEW(E_Fm_Icon, 1);
if (!icon) break;
icon->file = e_fm_file_new(path);
if (!icon->file)
{
free(icon);
return;
}
icon->icon_object = e_fm_icon_add(sd->evas);
icon->sd = sd;
e_icon_layout_freeze(sd->layout);

@ -193,6 +193,13 @@ e_scrollframe_child_pos_get(Evas_Object *obj, Evas_Coord *x, Evas_Coord *y)
sd->pan_func.get(sd->pan_obj, x, y);
}
void
e_scrollframe_child_region_show(Evas_Object *obj, Evas_Coord x, Evas_Coord y, Evas_Coord w, Evas_Coord h)
{
API_ENTRY return;
/* FIXME: do this code */
}
void
e_scrollframe_child_viewport_size_get(Evas_Object *obj, Evas_Coord *w, Evas_Coord *h)
{

@ -20,6 +20,7 @@ EAPI void e_scrollframe_extern_pan_set (Evas_Object *obj, Evas_Object *
EAPI void e_scrollframe_custom_theme_set (Evas_Object *obj, char *custom_category, char *custom_group);
EAPI void e_scrollframe_child_pos_set (Evas_Object *obj, Evas_Coord x, Evas_Coord y);
EAPI void e_scrollframe_child_pos_get (Evas_Object *obj, Evas_Coord *x, Evas_Coord *y);
EAPI void e_scrollframe_child_region_show (Evas_Object *obj, Evas_Coord x, Evas_Coord y, Evas_Coord w, Evas_Coord h);
EAPI void e_scrollframe_child_viewport_size_get (Evas_Object *obj, Evas_Coord *w, Evas_Coord *h);
EAPI void e_scrollframe_step_size_set (Evas_Object *obj, Evas_Coord x, Evas_Coord y);
EAPI void e_scrollframe_step_size_get (Evas_Object *obj, Evas_Coord *x, Evas_Coord *y);

@ -76,6 +76,16 @@ e_widget_framelist_object_append(Evas_Object *obj, Evas_Object *sobj)
evas_object_show(sobj);
}
void
e_widget_framelist_content_align_set(Evas_Object *obj, double halign, double valign)
{
E_Widget_Data *wd;
wd = e_widget_data_get(obj);
e_box_align_set(wd->o_box, halign, valign);
}
static void
_e_wid_del_hook(Evas_Object *obj)
{

@ -8,7 +8,7 @@
EAPI Evas_Object *e_widget_framelist_add(Evas *evas, char *label, int horiz);
EAPI void e_widget_framelist_object_append(Evas_Object *obj, Evas_Object *sobj);
EAPI void e_widget_framelist_content_align_set(Evas_Object *obj, double halign, double valign);
#endif
#endif

@ -50,7 +50,7 @@ e_widget_list_object_append(Evas_Object *obj, Evas_Object *sobj, int fill, int e
if (e_box_orientation_get(wd->o_box) == 1)
e_box_pack_options_set(sobj,
1, fill, /* fill */
0, expand, /* expand */
expand, expand, /* expand */
0.5, align, /* align */
mw, mh, /* min */
99999, 99999 /* max */
@ -58,7 +58,7 @@ e_widget_list_object_append(Evas_Object *obj, Evas_Object *sobj, int fill, int e
else
e_box_pack_options_set(sobj,
fill, 1, /* fill */
expand, 0, /* expand */
expand, expand, /* expand */
align, 0.5, /* align */
mw, mh, /* min */
99999, 99999 /* max */

@ -15,7 +15,7 @@ static void _e_wid_del_hook(Evas_Object *obj);
/* externally accessible functions */
Evas_Object *
e_widget_table_add(Evas *evas, char *label, int homogenous)
e_widget_table_add(Evas *evas, int homogenous)
{
Evas_Object *obj, *o;
E_Widget_Data *wd;

@ -6,7 +6,7 @@
#ifndef E_WIDGET_TABLE_H
#define E_WIDGET_TABLE_H
EAPI Evas_Object *e_widget_table_add(Evas *evas, char *label, int homogenous);
EAPI Evas_Object *e_widget_table_add(Evas *evas, int homogenous);
EAPI void e_widget_table_object_append(Evas_Object *obj, Evas_Object *sobj, int col, int row, int colspan, int rowspan, int fill_w, int fill_h, int expand_w, int expand_h);
#endif

@ -45,7 +45,7 @@ e_win_new(E_Container *con)
win->container = con;
win->engine = e_canvas_engine_decide(e_config->evas_engine_win);
win->ecore_evas = e_canvas_new(e_config->evas_engine_win, con->manager->root,
0, 0, 1, 1, 0, 0,
0, 0, 1, 1, 1, 0,
&(win->evas_win), NULL);
e_canvas_add(win->ecore_evas);
ecore_evas_data_set(win->ecore_evas, "E_Win", win);
@ -87,6 +87,7 @@ e_win_show(E_Win *win)
if (!win->placed)
win->border->re_manage = 0;
win->border->internal = 1;
win->border->internal_ecore_evas = win->ecore_evas;
if (win->engine == E_EVAS_ENGINE_GL_X11)
{
ecore_evas_gl_x11_extra_event_window_add(win->ecore_evas, win->border->win);

Loading…
Cancel
Save