aboutsummaryrefslogtreecommitdiffstats
path: root/legacy/elementary/src/lib/elm_win.c
diff options
context:
space:
mode:
authorCarsten Haitzler <raster@rasterman.com>2009-12-01 11:03:14 +0000
committerCarsten Haitzler <raster@rasterman.com>2009-12-01 11:03:14 +0000
commit07eee5720e1785c4a86b78043a41434cc0616b4a (patch)
treed45059050c4e6b4ae7a1ae1d75d99e62ccf655a1 /legacy/elementary/src/lib/elm_win.c
parentformatting (diff)
downloadefl-07eee5720e1785c4a86b78043a41434cc0616b4a.tar.gz
use all dem cursor api's... and module it up bro
SVN revision: 44088
Diffstat (limited to 'legacy/elementary/src/lib/elm_win.c')
-rw-r--r--legacy/elementary/src/lib/elm_win.c31
1 files changed, 31 insertions, 0 deletions
diff --git a/legacy/elementary/src/lib/elm_win.c b/legacy/elementary/src/lib/elm_win.c
index 66cb21747c..d1a62c3dfe 100644
--- a/legacy/elementary/src/lib/elm_win.c
+++ b/legacy/elementary/src/lib/elm_win.c
@@ -17,10 +17,14 @@ struct _Elm_Win
Elm_Win_Keyboard_Mode kbdmode;
Eina_Bool autodel : 1;
int *autodel_clear, rot;
+ struct {
+ int x, y;
+ } screen;
};
static void _elm_win_obj_callback_del(void *data, Evas *e, Evas_Object *obj, void *event_info);
static void _elm_win_obj_intercept_show(void *data, Evas_Object *obj);
+static void _elm_win_move(Ecore_Evas *ee);
static void _elm_win_resize(Ecore_Evas *ee);
static void _elm_win_delete_request(Ecore_Evas *ee);
static void _elm_win_resize_job(void *data);
@@ -34,6 +38,21 @@ static void _elm_win_subobj_callback_changed_size_hints(void *data, Evas *e, Eva
static Eina_List *_elm_win_list = NULL;
static void
+_elm_win_move(Ecore_Evas *ee)
+{
+ Evas_Object *obj = ecore_evas_object_associate_get(ee);
+ Elm_Win *win;
+ int x, y;
+ if (strcmp(elm_widget_type_get(obj), "win")) return;
+ win = elm_widget_data_get(obj);
+ if (!win) return;
+ ecore_evas_geometry_get(ee, &x, &y, NULL, NULL);
+ win->screen.x = x;
+ win->screen.y = y;
+ evas_object_smart_callback_call(win->win_obj, "moved", NULL);
+}
+
+static void
_elm_win_resize(Ecore_Evas *ee)
{
Evas_Object *obj = ecore_evas_object_associate_get(ee);
@@ -387,6 +406,7 @@ elm_win_add(Evas_Object *parent, const char *name, Elm_Win_Type type)
ecore_evas_callback_resize_set(win->ee, _elm_win_resize);
ecore_evas_callback_focus_in_set(win->ee, _elm_win_focus_in);
ecore_evas_callback_focus_out_set(win->ee, _elm_win_focus_out);
+ ecore_evas_callback_move_set(win->ee, _elm_win_move);
evas_image_cache_set(win->evas, (_elm_config->image_cache * 1024));
evas_font_cache_set(win->evas, (_elm_config->font_cache * 1024));
EINA_LIST_FOREACH(_elm_config->font_dirs, l, fontpath)
@@ -788,6 +808,17 @@ elm_win_keyboard_win_set(Evas_Object *obj, Eina_Bool is_keyboard)
#endif
}
+EAPI void
+elm_win_screen_position_get(Evas_Object *obj, int *x, int *y)
+{
+ Elm_Win *win;
+ if (strcmp(elm_widget_type_get(obj), "win")) return;
+ win = elm_widget_data_get(obj);
+ if (!win) return;
+ if (x) *x = win->screen.x;
+ if (y) *y = win->screen.y;
+}
+
typedef struct _Widget_Data Widget_Data;
struct _Widget_Data