summaryrefslogtreecommitdiff
path: root/src/bin/e_stolen.c
diff options
context:
space:
mode:
authorCedric BAIL <cedric.bail@free.fr>2008-12-17 15:33:43 +0000
committerCedric BAIL <cedric.bail@free.fr>2008-12-17 15:33:43 +0000
commit773d102291f1341a5e11c5a05027ede526b8d600 (patch)
treef9f367ea2be603598d4264c7b8b699f3046da8f2 /src/bin/e_stolen.c
parente29866312c9e61ba192036c02fe8e612e91b111c (diff)
downloadenlightenment-773d102291f1341a5e11c5a05027ede526b8d600.tar.gz
This commit is huge. I did test it a lot on my computer, and it run fine here.
But is so big i fear i could have broken some piece of code. So report any wrong behaviour to me (cedric on #edevelop). So moving e17 and efreet to eina_hash. With a little efreet API break so they must come together. SVN revision: 38185
Diffstat (limited to 'src/bin/e_stolen.c')
-rw-r--r--src/bin/e_stolen.c24
1 files changed, 15 insertions, 9 deletions
diff --git a/src/bin/e_stolen.c b/src/bin/e_stolen.c
index 7b6614e11c..e7740df222 100644
--- a/src/bin/e_stolen.c
+++ b/src/bin/e_stolen.c
@@ -11,15 +11,15 @@ struct _E_Stolen_Window
int refcount;
};
-static Evas_Hash *_e_stolen_windows = NULL;
+static Eina_Hash *_e_stolen_windows = NULL;
/* externally accessible functions */
EAPI int
e_stolen_win_get(Ecore_X_Window win)
{
E_Stolen_Window *esw;
-
- esw = evas_hash_find(_e_stolen_windows, e_util_winid_str_get(win));
+
+ esw = eina_hash_find(_e_stolen_windows, e_util_winid_str_get(win));
if (esw) return 1;
return 0;
}
@@ -28,8 +28,8 @@ EAPI void
e_stolen_win_add(Ecore_X_Window win)
{
E_Stolen_Window *esw;
-
- esw = evas_hash_find(_e_stolen_windows, e_util_winid_str_get(win));
+
+ esw = eina_hash_find(_e_stolen_windows, e_util_winid_str_get(win));
if (esw)
{
esw->refcount++;
@@ -39,7 +39,8 @@ e_stolen_win_add(Ecore_X_Window win)
esw = E_NEW(E_Stolen_Window, 1);
esw->win = win;
esw->refcount = 1;
- _e_stolen_windows = evas_hash_add(_e_stolen_windows, e_util_winid_str_get(win), esw);
+ if (!_e_stolen_windows) _e_stolen_windows = eina_hash_string_superfast_new(NULL);
+ eina_hash_add(_e_stolen_windows, e_util_winid_str_get(win), esw);
}
return;
}
@@ -48,14 +49,19 @@ EAPI void
e_stolen_win_del(Ecore_X_Window win)
{
E_Stolen_Window *esw;
-
- esw = evas_hash_find(_e_stolen_windows, e_util_winid_str_get(win));
+
+ esw = eina_hash_find(_e_stolen_windows, e_util_winid_str_get(win));
if (esw)
{
esw->refcount--;
if (esw->refcount == 0)
{
- _e_stolen_windows = evas_hash_del(_e_stolen_windows, e_util_winid_str_get(win), esw);
+ eina_hash_del(_e_stolen_windows, e_util_winid_str_get(win), esw);
+ if (!eina_hash_population(_e_stolen_windows))
+ {
+ eina_hash_free(_e_stolen_windows);
+ _e_stolen_windows = NULL;
+ }
free(esw);
}
}