was wrokign on intl stuff but got distracted by optimising. will come back to

intl. optimised some code paths. e_place.c is evil. the smart place function
NEEDS speeding up. this may mean a re-think of how it works. not sure.


SVN revision: 14974
This commit is contained in:
Carsten Haitzler 2005-05-28 05:03:27 +00:00
parent d487bdcfc4
commit 63cd002807
4 changed files with 69 additions and 43 deletions

View File

@ -109,9 +109,12 @@ static void _e_border_move_update(E_Border *bd);
static int _e_border_cb_focus_fix(void *data);
static char *_e_border_winid_str_get(Ecore_X_Window win);
/* local subsystem globals */
static Evas_List *handlers = NULL;
static Evas_List *borders = NULL;
static Evas_Hash *borders_hash = NULL;
static E_Border *focused = NULL;
static E_Border *resize = NULL;
@ -354,7 +357,9 @@ e_border_new(E_Container *con, Ecore_X_Window win, int first_map)
bd->desk = e_desk_current_get(bd->zone);
e_container_border_add(bd);
borders = evas_list_append(borders, bd);
borders_hash = evas_hash_add(borders_hash, _e_border_winid_str_get(bd->client.win), bd);
borders_hash = evas_hash_add(borders_hash, _e_border_winid_str_get(bd->bg_win), bd);
borders_hash = evas_hash_add(borders_hash, _e_border_winid_str_get(bd->win), bd);
managed = 1;
ecore_x_window_prop_card32_set(win, E_ATOM_MANAGED, &managed, 1);
ecore_x_window_prop_card32_set(win, E_ATOM_CONTAINER, &bd->zone->container->num, 1);
@ -1138,58 +1143,24 @@ e_border_unstick(E_Border *bd)
E_Border *
e_border_find_by_client_window(Ecore_X_Window win)
{
Evas_List *l;
for (l = borders; l; l = l->next)
{
E_Border *bd;
bd = l->data;
if (bd->client.win == win)
{
if (!e_object_is_del(E_OBJECT(bd)))
return bd;
}
}
E_Border *bd;
bd = evas_hash_find(borders_hash, _e_border_winid_str_get(win));
if ((bd) && (!e_object_is_del(E_OBJECT(bd))))
return bd;
return NULL;
}
E_Border *
e_border_find_by_frame_window(Ecore_X_Window win)
{
Evas_List *l;
for (l = borders; l; l = l->next)
{
E_Border *bd;
bd = l->data;
if (bd->bg_win == win)
{
if (!e_object_is_del(E_OBJECT(bd)))
return bd;
}
}
return NULL;
return e_border_find_by_client_window(win);
}
E_Border *
e_border_find_by_window(Ecore_X_Window win)
{
Evas_List *l;
for (l = borders; l; l = l->next)
{
E_Border *bd;
bd = l->data;
if (bd->win == win)
{
if (!e_object_is_del(E_OBJECT(bd)))
return bd;
}
}
return NULL;
return e_border_find_by_client_window(win);
}
E_Border *
@ -1484,6 +1455,9 @@ _e_border_free(E_Border *bd)
ecore_x_window_del(bd->win);
e_container_border_remove(bd);
borders_hash = evas_hash_del(borders_hash, _e_border_winid_str_get(bd->client.win), bd);
borders_hash = evas_hash_del(borders_hash, _e_border_winid_str_get(bd->bg_win), bd);
borders_hash = evas_hash_del(borders_hash, _e_border_winid_str_get(bd->win), bd);
borders = evas_list_remove(borders, bd);
free(bd);
@ -4351,3 +4325,23 @@ _e_border_cb_focus_fix(void *data)
}
return 1;
}
static char *
_e_border_winid_str_get(Ecore_X_Window win)
{
const char *vals = "qWeRtYuIoP5-$&<~";
static char id[9];
unsigned int val;
val = (unsigned int)win;
id[0] = vals[(val >> 28) & 0xf];
id[1] = vals[(val >> 24) & 0xf];
id[2] = vals[(val >> 20) & 0xf];
id[3] = vals[(val >> 16) & 0xf];
id[4] = vals[(val >> 12) & 0xf];
id[5] = vals[(val >> 8) & 0xf];
id[6] = vals[(val >> 4) & 0xf];
id[7] = vals[(val ) & 0xf];
id[8] = 0;
return id;
}

View File

@ -71,9 +71,32 @@ e_intl_shutdown(void)
return 1;
}
/* FIXME: finish this */
static Evas_List *
_e_intl_dir_scan(char *dir)
{
Ecore_List *files;
char *file;
files = ecore_file_ls(dir);
if (!files) return NULL;
ecore_list_goto_first(files);
while ((file = ecore_list_current(files)))
{
free(file);
ecore_list_remove(files);
ecore_list_next(files);
}
return NULL;
}
void
e_intl_language_set(const char *lang)
{
/* 1 list ~/.e/e/locale contents */
/* 2 list LOCALE_DIR contents */
/* FIXME: determine if in user or system locale dir */
if (_e_intl_language) free(_e_intl_language);
if (!lang) lang = getenv("LANG");

View File

@ -566,7 +566,8 @@ _e_main_dirs_init(void)
"%s/.e/e/applications/restart",
"%s/.e/e/applications/trash",
"%s/.e/e/modules",
"%s/.e/e/config"
"%s/.e/e/config",
"%s/.e/e/locale"
};
int i;

View File

@ -65,6 +65,14 @@ e_place_zone_region_smart(E_Zone *zone, Evas_List *skiplist, int x, int y, int w
E_Border_List *bl;
E_Border *bd;
#if 0
/* DISABLE placement entirely for speed testing */
*rx = x;
*ry = y;
return 1;
#endif
/* FIXME: this NEEDS optimizing */
a_w = 2;
a_h = 2;
a_x = E_NEW(int, 2);