Enlightenment CVS committal
Author : moom
Project : e17
Module : proto
Dir : e17/proto/etk/src/engines/ecore_fb
Modified Files:
ecore_fb.c
Log Message:
* The Ecore_FB engine uses ecore_evas_cursor_set() to display the mouse
cursor. turran was right :)
===================================================================
RCS file: /cvs/e/e17/proto/etk/src/engines/ecore_fb/ecore_fb.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -3 -r1.4 -r1.5
--- ecore_fb.c 2 Aug 2006 22:08:10 -0000 1.4
+++ ecore_fb.c 3 Aug 2006 01:35:46 -0000 1.5
@@ -16,15 +16,10 @@
#include "etk_utils.h"
#include "config.h"
-#include "Etk_Engine_Ecore_Evas.h"
#include "Etk_Engine_Ecore_Fb.h"
#define POINTER_SIZE 64
-/* fb data */
-int fb_width = 0;
-int fb_height = 0;
-
/* TODO: prop notify ? */
/* Engine specific data for Etk_Window
@@ -52,7 +47,6 @@
/* Handlers and callbacks */
static int _mouse_move_handler(void *data, int ev_type, void *ev);
-
static void _window_realized_cb(Etk_Object *object, void *data);
static void _window_titlebar_mouse_down_cb(void *data, Evas_Object *obj, const
char *emission, const char *source);
static void _window_titlebar_mouse_up_cb(void *data, Evas_Object *obj, const
char *emission, const char *source);
@@ -131,7 +125,8 @@
static Ecore_Evas *_ecore_evas = NULL;
static Evas *_evas = NULL;
static Evas_Object *_background_object = NULL;
-static Evas_Object *_pointer_object = NULL;
+static int _fb_width = 0;
+static int _fb_height = 0;
static Etk_Window *_drag_window = NULL;
static int _drag_offset_x = 0;
@@ -158,51 +153,39 @@
char *filename;
char device_path[PATH_MAX];
- if (!ecore_evas_init())
+ if (!ecore_fb_init(NULL))
{
- ETK_WARNING("Ecore_Evas initialization failed!");
+ ETK_WARNING("Ecore_Fb initialization failed!");
return ETK_FALSE;
}
- if (!ecore_fb_init(NULL))
+ if (!ecore_evas_init())
{
- ETK_WARNING("Ecore_Fb initialization failed!");
+ ETK_WARNING("Ecore_Evas initialization failed!");
return ETK_FALSE;
}
- /* needed for the pointer */
ecore_event_handler_add(ECORE_FB_EVENT_MOUSE_MOVE, _mouse_move_handler,
NULL);
- ecore_fb_size_get(&fb_width, &fb_height);
+ ecore_fb_size_get(&_fb_width, &_fb_height);
+
/* Create the evas where all the windows will be drawn */
- _ecore_evas = ecore_evas_fb_new(NULL, 0, fb_width, fb_height);
- if(!_ecore_evas)
+ _ecore_evas = ecore_evas_fb_new(NULL, 0, _fb_width, _fb_height);
+ if (!_ecore_evas)
{
- ETK_WARNING("Ecore_Evas_Fb initialization failed!");
+ ETK_WARNING("Unable to create a FB Ecore_Evas");
return ETK_FALSE;
}
if (!(_evas = ecore_evas_get(_ecore_evas)))
{
- ETK_WARNING("Unable to create a FB evas");
+ ETK_WARNING("Unable to create a FB Evas");
return ETK_FALSE;
}
- ecore_evas_show(_ecore_evas);
- #if 0
- ecore_evas_ignore_events_set(_ecore_evas, 1);
- evas_event_feed_mouse_in(_evas, ecore_time_get(), NULL);
- #endif
+ ecore_evas_cursor_set(_ecore_evas, PACKAGE_DATA_DIR
"/pointers/default_pointer.png", 1000, 32, 32);
+ ecore_evas_show(_ecore_evas);
/* Create the background */
_background_object = etk_theme_object_load(_evas,
etk_theme_widget_theme_get(), "wm_background");
- evas_object_resize(_background_object, fb_width, fb_height);
+ evas_object_resize(_background_object, _fb_width, _fb_height);
evas_object_show(_background_object);
-
- /* Create the mouse pointer */
- _pointer_object = evas_object_image_add(_evas);
- evas_object_image_file_set(_pointer_object, PACKAGE_DATA_DIR
"/pointers/default_pointer.png", NULL);
- evas_object_image_fill_set(_pointer_object, 0, 0, POINTER_SIZE,
POINTER_SIZE);
- evas_object_pass_events_set(_pointer_object, 1);
- evas_object_move(_pointer_object, fb_width - (POINTER_SIZE / 2), fb_height
- (POINTER_SIZE / 2));
- evas_object_resize(_pointer_object, POINTER_SIZE, POINTER_SIZE);
- evas_object_show(_pointer_object);
return ETK_TRUE;
}
@@ -214,7 +197,6 @@
_ecore_evas = NULL;
_evas = NULL;
_background_object = NULL;
- _pointer_object = NULL;
_drag_window = NULL;
ecore_evas_shutdown();
@@ -382,8 +364,6 @@
edje_object_signal_callback_add(engine_data->border, "mouse,down,1*",
"titlebar", _window_titlebar_mouse_down_cb, window);
edje_object_signal_callback_add(engine_data->border, "mouse,up,1*",
"titlebar", _window_titlebar_mouse_up_cb, window);
-
- evas_object_raise(_pointer_object);
}
/* Called when the titlebar of the window is pressed */
@@ -407,9 +387,6 @@
/* Move the window to drag */
if (_drag_window)
etk_window_move(_drag_window, event->x - _drag_offset_x, event->y -
_drag_offset_y);
-
- evas_object_move(_pointer_object, event->x - (POINTER_SIZE / 2), event->y -
(POINTER_SIZE / 2));
- evas_event_feed_mouse_move(_evas, event->x, event->y, ecore_time_get(),
NULL);
return 1;
}
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
enlightenment-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs