2005-06-09 21:18:24 -07:00
|
|
|
/*
|
|
|
|
* vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2
|
|
|
|
*/
|
2003-09-23 01:09:32 -07:00
|
|
|
#ifndef _ECORE_EVAS_PRIVATE_H
|
|
|
|
#define _ECORE_EVAS_PRIVATE_H
|
|
|
|
|
2005-09-05 03:17:08 -07:00
|
|
|
#include "Ecore_Data.h"
|
|
|
|
|
2004-03-16 21:14:13 -08:00
|
|
|
#include <sys/types.h>
|
|
|
|
#include <sys/stat.h>
|
|
|
|
#include <fcntl.h>
|
2004-10-20 10:51:29 -07:00
|
|
|
|
|
|
|
#ifndef WIN32
|
2004-03-16 21:14:13 -08:00
|
|
|
#include <sys/mman.h>
|
2004-10-20 10:51:29 -07:00
|
|
|
#endif
|
2004-03-16 21:14:13 -08:00
|
|
|
|
2003-09-23 01:09:32 -07:00
|
|
|
#include <Evas.h>
|
|
|
|
|
|
|
|
#define ECORE_MAGIC_EVAS 0x76543211
|
|
|
|
|
2005-10-15 03:37:37 -07:00
|
|
|
#ifndef BUILD_ECORE_DIRECTFB
|
|
|
|
#undef BUILD_ECORE_EVAS_DIRECTFB
|
|
|
|
#endif
|
|
|
|
|
2003-09-23 01:09:32 -07:00
|
|
|
#ifdef BUILD_ECORE_X
|
Here is ecore_x with XCB backend.
* The XCB backend is disabled by default during the
configuration. To enable it, add --enable-ecore-x-xcb. See the
messages that configure displays when it finishes.
* The way XCB is detected, and used in src/lib/ecore_x/Makefile.am
should be improved
* Any program that uses ecore_evas does not need to be modified.
Any program that uses ecore_x may need some changes. That is,
adding some functions (_prefetch and _fetch ones). No other
change is needed. See the documention of any _get functions, as
these are the ones that need those functions.
* There are some missing parts, especially everything that involves
the keyboard, as porting Xlib functions related to strings (utf8
stuff, XKeysymToString, etc...) is an horror. So keyboard events
are not working yet.
* I tried to write as much documentation as I could. But there is
certainly some missing doc here and there.
there are certainly other things that I have forgotten.
Improvements of that backend:
* the creation of an ecore_evas is faster. Especially when done over
an ssh connection (on my computer, 7-10s with Xlib, 1.5s with XCB,
over an ssh)
* A Window Manager should be more responsive. But it's not tomorrow
that e17 will use it :)
Have fun !
SVN revision: 29500
2007-04-13 10:15:19 -07:00
|
|
|
# include "Ecore_X.h"
|
|
|
|
# ifdef HAVE_ECORE_X_XCB
|
|
|
|
# include <Evas_Engine_Software_Xcb.h>
|
|
|
|
# include <xcb/xcb.h>
|
|
|
|
# ifdef ECORE_XCB_RENDER
|
|
|
|
# include <xcb/render.h>
|
|
|
|
# endif
|
|
|
|
# ifdef BUILD_ECORE_EVAS_XRENDER
|
|
|
|
# include <Evas_Engine_XRender_Xcb.h>
|
|
|
|
# endif
|
|
|
|
# else
|
|
|
|
# include <Evas_Engine_Software_X11.h>
|
|
|
|
# include <X11/Xlib.h>
|
|
|
|
# include <X11/Xutil.h>
|
|
|
|
# ifdef ECORE_XRENDER
|
|
|
|
# include <X11/extensions/Xrender.h>
|
|
|
|
# endif
|
|
|
|
# ifdef BUILD_ECORE_EVAS_GL
|
|
|
|
# include <Evas_Engine_GL_X11.h>
|
|
|
|
# endif
|
|
|
|
# ifdef BUILD_ECORE_EVAS_XRENDER
|
|
|
|
# include <Evas_Engine_XRender_X11.h>
|
|
|
|
# endif
|
2007-06-21 15:49:36 -07:00
|
|
|
# ifdef BUILD_ECORE_EVAS_X11_16
|
|
|
|
# include <Evas_Engine_Software_16_X11.h>
|
|
|
|
# endif
|
Here is ecore_x with XCB backend.
* The XCB backend is disabled by default during the
configuration. To enable it, add --enable-ecore-x-xcb. See the
messages that configure displays when it finishes.
* The way XCB is detected, and used in src/lib/ecore_x/Makefile.am
should be improved
* Any program that uses ecore_evas does not need to be modified.
Any program that uses ecore_x may need some changes. That is,
adding some functions (_prefetch and _fetch ones). No other
change is needed. See the documention of any _get functions, as
these are the ones that need those functions.
* There are some missing parts, especially everything that involves
the keyboard, as porting Xlib functions related to strings (utf8
stuff, XKeysymToString, etc...) is an horror. So keyboard events
are not working yet.
* I tried to write as much documentation as I could. But there is
certainly some missing doc here and there.
there are certainly other things that I have forgotten.
Improvements of that backend:
* the creation of an ecore_evas is faster. Especially when done over
an ssh connection (on my computer, 7-10s with Xlib, 1.5s with XCB,
over an ssh)
* A Window Manager should be more responsive. But it's not tomorrow
that e17 will use it :)
Have fun !
SVN revision: 29500
2007-04-13 10:15:19 -07:00
|
|
|
# endif /* HAVE_ECORE_X_XCB */
|
2003-09-23 01:09:32 -07:00
|
|
|
#endif
|
2003-12-15 21:54:46 -08:00
|
|
|
#ifdef BUILD_ECORE_EVAS_FB
|
2003-09-23 01:09:32 -07:00
|
|
|
#include <Evas_Engine_FB.h>
|
|
|
|
#endif
|
2005-10-15 03:37:37 -07:00
|
|
|
#ifdef BUILD_ECORE_EVAS_DIRECTFB
|
|
|
|
#include <Evas_Engine_DirectFB.h>
|
|
|
|
#include "Ecore_DirectFB.h"
|
|
|
|
#endif
|
2005-01-08 10:40:32 -08:00
|
|
|
#ifdef BUILD_ECORE_EVAS_BUFFER
|
|
|
|
#include <Evas_Engine_Buffer.h>
|
|
|
|
#endif
|
2003-09-23 01:09:32 -07:00
|
|
|
|
2007-06-16 20:41:43 -07:00
|
|
|
#define IDLE_FLUSH_TIME 0.5
|
|
|
|
|
2003-09-23 01:09:32 -07:00
|
|
|
typedef struct _Ecore_Evas Ecore_Evas;
|
|
|
|
typedef struct _Ecore_Evas_Engine Ecore_Evas_Engine;
|
|
|
|
typedef struct _Ecore_Evas_Engine_Func Ecore_Evas_Engine_Func;
|
|
|
|
|
|
|
|
struct _Ecore_Evas_Engine_Func
|
|
|
|
{
|
|
|
|
void (*fn_free) (Ecore_Evas *ee);
|
|
|
|
void (*fn_callback_resize_set) (Ecore_Evas *ee, void (*func) (Ecore_Evas *ee));
|
|
|
|
void (*fn_callback_move_set) (Ecore_Evas *ee, void (*func) (Ecore_Evas *ee));
|
|
|
|
void (*fn_callback_show_set) (Ecore_Evas *ee, void (*func) (Ecore_Evas *ee));
|
|
|
|
void (*fn_callback_hide_set) (Ecore_Evas *ee, void (*func) (Ecore_Evas *ee));
|
|
|
|
void (*fn_callback_delete_request_set) (Ecore_Evas *ee, void (*func) (Ecore_Evas *ee));
|
|
|
|
void (*fn_callback_destroy_set) (Ecore_Evas *ee, void (*func) (Ecore_Evas *ee));
|
|
|
|
void (*fn_callback_focus_in_set) (Ecore_Evas *ee, void (*func) (Ecore_Evas *ee));
|
|
|
|
void (*fn_callback_focus_out_set) (Ecore_Evas *ee, void (*func) (Ecore_Evas *ee));
|
|
|
|
void (*fn_callback_mouse_in_set) (Ecore_Evas *ee, void (*func) (Ecore_Evas *ee));
|
|
|
|
void (*fn_callback_mouse_out_set) (Ecore_Evas *ee, void (*func) (Ecore_Evas *ee));
|
2006-07-27 09:14:33 -07:00
|
|
|
void (*fn_callback_sticky_set) (Ecore_Evas *ee, void (*func) (Ecore_Evas *ee));
|
|
|
|
void (*fn_callback_unsticky_set) (Ecore_Evas *ee, void (*func) (Ecore_Evas *ee));
|
2003-09-23 01:09:32 -07:00
|
|
|
void (*fn_callback_pre_render_set) (Ecore_Evas *ee, void (*func) (Ecore_Evas *ee));
|
|
|
|
void (*fn_callback_post_render_set) (Ecore_Evas *ee, void (*func) (Ecore_Evas *ee));
|
|
|
|
void (*fn_move) (Ecore_Evas *ee, int x, int y);
|
2005-11-03 03:32:59 -08:00
|
|
|
void (*fn_managed_move) (Ecore_Evas *ee, int x, int y);
|
2003-09-23 01:09:32 -07:00
|
|
|
void (*fn_resize) (Ecore_Evas *ee, int w, int h);
|
|
|
|
void (*fn_move_resize) (Ecore_Evas *ee, int x, int y, int w, int h);
|
|
|
|
void (*fn_rotation_set) (Ecore_Evas *ee, int rot);
|
|
|
|
void (*fn_shaped_set) (Ecore_Evas *ee, int shaped);
|
|
|
|
void (*fn_show) (Ecore_Evas *ee);
|
|
|
|
void (*fn_hide) (Ecore_Evas *ee);
|
|
|
|
void (*fn_raise) (Ecore_Evas *ee);
|
|
|
|
void (*fn_lower) (Ecore_Evas *ee);
|
|
|
|
void (*fn_title_set) (Ecore_Evas *ee, const char *t);
|
|
|
|
void (*fn_name_class_set) (Ecore_Evas *ee, const char *n, const char *c);
|
|
|
|
void (*fn_size_min_set) (Ecore_Evas *ee, int w, int h);
|
|
|
|
void (*fn_size_max_set) (Ecore_Evas *ee, int w, int h);
|
|
|
|
void (*fn_size_base_set) (Ecore_Evas *ee, int w, int h);
|
|
|
|
void (*fn_size_step_set) (Ecore_Evas *ee, int w, int h);
|
|
|
|
void (*fn_cursor_set) (Ecore_Evas *ee, const char *file, int layer, int hot_x, int hot_y);
|
|
|
|
void (*fn_layer_set) (Ecore_Evas *ee, int layer);
|
|
|
|
void (*fn_focus_set) (Ecore_Evas *ee, int on);
|
|
|
|
void (*fn_iconified_set) (Ecore_Evas *ee, int on);
|
|
|
|
void (*fn_borderless_set) (Ecore_Evas *ee, int on);
|
|
|
|
void (*fn_override_set) (Ecore_Evas *ee, int on);
|
|
|
|
void (*fn_maximized_set) (Ecore_Evas *ee, int on);
|
|
|
|
void (*fn_fullscreen_set) (Ecore_Evas *ee, int on);
|
|
|
|
void (*fn_avoid_damage_set) (Ecore_Evas *ee, int on);
|
|
|
|
void (*fn_withdrawn_set) (Ecore_Evas *ee, int withdrawn);
|
2003-11-15 18:29:10 -08:00
|
|
|
void (*fn_sticky_set) (Ecore_Evas *ee, int sticky);
|
2005-10-08 05:41:59 -07:00
|
|
|
void (*fn_ignore_events_set) (Ecore_Evas *ee, int ignore);
|
2006-03-08 00:02:55 -08:00
|
|
|
void (*fn_alpha_set) (Ecore_Evas *ee, int alpha);
|
2003-09-23 01:09:32 -07:00
|
|
|
};
|
|
|
|
|
|
|
|
struct _Ecore_Evas_Engine
|
|
|
|
{
|
|
|
|
Ecore_Evas_Engine_Func *func;
|
|
|
|
|
|
|
|
#ifdef BUILD_ECORE_X
|
|
|
|
struct {
|
2005-04-25 01:28:27 -07:00
|
|
|
Ecore_X_Window win_root;
|
2003-09-23 01:09:32 -07:00
|
|
|
Ecore_X_Window win;
|
2005-09-24 02:00:23 -07:00
|
|
|
Evas_List *win_extra;
|
2003-09-23 01:09:32 -07:00
|
|
|
Ecore_X_Pixmap pmap;
|
|
|
|
Ecore_X_Pixmap mask;
|
|
|
|
Ecore_X_GC gc;
|
Here is ecore_x with XCB backend.
* The XCB backend is disabled by default during the
configuration. To enable it, add --enable-ecore-x-xcb. See the
messages that configure displays when it finishes.
* The way XCB is detected, and used in src/lib/ecore_x/Makefile.am
should be improved
* Any program that uses ecore_evas does not need to be modified.
Any program that uses ecore_x may need some changes. That is,
adding some functions (_prefetch and _fetch ones). No other
change is needed. See the documention of any _get functions, as
these are the ones that need those functions.
* There are some missing parts, especially everything that involves
the keyboard, as porting Xlib functions related to strings (utf8
stuff, XKeysymToString, etc...) is an horror. So keyboard events
are not working yet.
* I tried to write as much documentation as I could. But there is
certainly some missing doc here and there.
there are certainly other things that I have forgotten.
Improvements of that backend:
* the creation of an ecore_evas is faster. Especially when done over
an ssh connection (on my computer, 7-10s with Xlib, 1.5s with XCB,
over an ssh)
* A Window Manager should be more responsive. But it's not tomorrow
that e17 will use it :)
Have fun !
SVN revision: 29500
2007-04-13 10:15:19 -07:00
|
|
|
#ifdef HAVE_ECORE_X_XCB
|
|
|
|
#warning [XCB] No Region code
|
|
|
|
#else
|
2003-09-23 01:09:32 -07:00
|
|
|
Region damages;
|
Here is ecore_x with XCB backend.
* The XCB backend is disabled by default during the
configuration. To enable it, add --enable-ecore-x-xcb. See the
messages that configure displays when it finishes.
* The way XCB is detected, and used in src/lib/ecore_x/Makefile.am
should be improved
* Any program that uses ecore_evas does not need to be modified.
Any program that uses ecore_x may need some changes. That is,
adding some functions (_prefetch and _fetch ones). No other
change is needed. See the documention of any _get functions, as
these are the ones that need those functions.
* There are some missing parts, especially everything that involves
the keyboard, as porting Xlib functions related to strings (utf8
stuff, XKeysymToString, etc...) is an horror. So keyboard events
are not working yet.
* I tried to write as much documentation as I could. But there is
certainly some missing doc here and there.
there are certainly other things that I have forgotten.
Improvements of that backend:
* the creation of an ecore_evas is faster. Especially when done over
an ssh connection (on my computer, 7-10s with Xlib, 1.5s with XCB,
over an ssh)
* A Window Manager should be more responsive. But it's not tomorrow
that e17 will use it :)
Have fun !
SVN revision: 29500
2007-04-13 10:15:19 -07:00
|
|
|
#endif /* HAVE_ECORE_X_XCB */
|
2006-03-08 00:02:55 -08:00
|
|
|
int px, py, pw, ph;
|
2004-11-23 07:17:56 -08:00
|
|
|
unsigned char direct_resize : 1;
|
2005-06-25 00:23:38 -07:00
|
|
|
unsigned char using_bg_pixmap : 1;
|
2005-11-03 03:32:59 -08:00
|
|
|
unsigned char managed : 1;
|
2005-06-09 21:18:24 -07:00
|
|
|
struct {
|
|
|
|
unsigned char modal : 1;
|
|
|
|
unsigned char sticky : 1;
|
|
|
|
unsigned char maximized_v : 1;
|
|
|
|
unsigned char maximized_h : 1;
|
|
|
|
unsigned char shaded : 1;
|
|
|
|
unsigned char skip_taskbar : 1;
|
|
|
|
unsigned char skip_pager : 1;
|
|
|
|
unsigned char fullscreen : 1;
|
|
|
|
unsigned char above : 1;
|
|
|
|
unsigned char below : 1;
|
|
|
|
} state;
|
2003-09-23 01:09:32 -07:00
|
|
|
} x;
|
|
|
|
#endif
|
2003-12-15 21:54:46 -08:00
|
|
|
#ifdef BUILD_ECORE_EVAS_FB
|
2003-09-23 01:09:32 -07:00
|
|
|
struct {
|
|
|
|
int real_w;
|
|
|
|
int real_h;
|
|
|
|
} fb;
|
|
|
|
#endif
|
2005-01-08 10:40:32 -08:00
|
|
|
#ifdef BUILD_ECORE_EVAS_BUFFER
|
|
|
|
struct {
|
|
|
|
void *pixels;
|
|
|
|
Evas_Object *image;
|
|
|
|
} buffer;
|
|
|
|
#endif
|
2005-10-15 03:37:37 -07:00
|
|
|
#ifdef BUILD_ECORE_EVAS_DIRECTFB
|
|
|
|
struct {
|
2005-11-30 22:39:35 -08:00
|
|
|
Ecore_DirectFB_Window *window;
|
2005-10-15 03:37:37 -07:00
|
|
|
} directfb;
|
|
|
|
#endif
|
2007-06-16 20:41:43 -07:00
|
|
|
Ecore_Timer *idle_flush_timer;
|
2003-09-23 01:09:32 -07:00
|
|
|
};
|
|
|
|
|
|
|
|
struct _Ecore_Evas
|
|
|
|
{
|
|
|
|
Ecore_List __list_data;
|
|
|
|
ECORE_MAGIC;
|
|
|
|
Evas *evas;
|
2006-10-19 18:46:41 -07:00
|
|
|
const char *driver;
|
2003-09-23 01:09:32 -07:00
|
|
|
char *name;
|
|
|
|
int x, y, w, h;
|
|
|
|
short rotation;
|
|
|
|
char shaped : 1;
|
|
|
|
char visible : 1;
|
|
|
|
char should_be_visible : 1;
|
2006-03-08 00:02:55 -08:00
|
|
|
char alpha : 1;
|
2004-09-02 09:50:18 -07:00
|
|
|
|
|
|
|
Evas_Hash *data;
|
|
|
|
|
2003-09-23 01:09:32 -07:00
|
|
|
struct {
|
|
|
|
int x, y;
|
|
|
|
} mouse;
|
|
|
|
|
|
|
|
struct {
|
|
|
|
int w, h;
|
|
|
|
} expecting_resize;
|
|
|
|
|
|
|
|
struct {
|
|
|
|
char *title;
|
|
|
|
char *name;
|
|
|
|
char *clas;
|
|
|
|
struct {
|
|
|
|
int w, h;
|
|
|
|
} min,
|
|
|
|
max,
|
|
|
|
base,
|
|
|
|
step;
|
|
|
|
struct {
|
|
|
|
Evas_Object *object;
|
|
|
|
char *file;
|
|
|
|
int layer;
|
|
|
|
struct {
|
|
|
|
int x, y;
|
|
|
|
} hot;
|
|
|
|
} cursor;
|
|
|
|
int layer;
|
|
|
|
char focused : 1;
|
|
|
|
char iconified : 1;
|
|
|
|
char borderless : 1;
|
|
|
|
char override : 1;
|
|
|
|
char maximized : 1;
|
|
|
|
char fullscreen : 1;
|
|
|
|
char avoid_damage : 1;
|
|
|
|
char withdrawn : 1;
|
2005-08-04 01:51:31 -07:00
|
|
|
char sticky : 1;
|
|
|
|
char request_pos : 1;
|
2003-09-23 01:09:32 -07:00
|
|
|
} prop;
|
|
|
|
|
|
|
|
struct {
|
|
|
|
void (*fn_resize) (Ecore_Evas *ee);
|
|
|
|
void (*fn_move) (Ecore_Evas *ee);
|
|
|
|
void (*fn_show) (Ecore_Evas *ee);
|
|
|
|
void (*fn_hide) (Ecore_Evas *ee);
|
|
|
|
void (*fn_delete_request) (Ecore_Evas *ee);
|
|
|
|
void (*fn_destroy) (Ecore_Evas *ee);
|
|
|
|
void (*fn_focus_in) (Ecore_Evas *ee);
|
|
|
|
void (*fn_focus_out) (Ecore_Evas *ee);
|
2006-07-27 09:14:33 -07:00
|
|
|
void (*fn_sticky) (Ecore_Evas *ee);
|
|
|
|
void (*fn_unsticky) (Ecore_Evas *ee);
|
2003-09-23 01:09:32 -07:00
|
|
|
void (*fn_mouse_in) (Ecore_Evas *ee);
|
|
|
|
void (*fn_mouse_out) (Ecore_Evas *ee);
|
|
|
|
void (*fn_pre_render) (Ecore_Evas *ee);
|
|
|
|
void (*fn_post_render) (Ecore_Evas *ee);
|
|
|
|
} func;
|
|
|
|
|
|
|
|
Ecore_Evas_Engine engine;
|
2005-01-08 10:40:32 -08:00
|
|
|
Evas_List *sub_ecore_evas;
|
2005-10-08 05:41:59 -07:00
|
|
|
|
|
|
|
unsigned char ignore_events : 1;
|
2003-09-23 01:09:32 -07:00
|
|
|
};
|
|
|
|
|
|
|
|
#ifdef BUILD_ECORE_X
|
|
|
|
int _ecore_evas_x_shutdown(void);
|
|
|
|
#endif
|
2003-12-15 21:54:46 -08:00
|
|
|
#ifdef BUILD_ECORE_EVAS_FB
|
2003-09-23 01:09:32 -07:00
|
|
|
int _ecore_evas_fb_shutdown(void);
|
|
|
|
#endif
|
2005-01-08 10:40:32 -08:00
|
|
|
#ifdef BUILD_ECORE_EVAS_BUFFER
|
|
|
|
int _ecore_evas_buffer_shutdown(void);
|
|
|
|
void _ecore_evas_buffer_render(Ecore_Evas *ee);
|
|
|
|
#endif
|
2005-11-04 15:47:53 -08:00
|
|
|
#ifdef BUILD_ECORE_EVAS_DIRECTFB
|
|
|
|
int _ecore_evas_directfb_shutdown(void);
|
|
|
|
#endif
|
2003-09-23 01:09:32 -07:00
|
|
|
|
2004-03-16 21:14:13 -08:00
|
|
|
void _ecore_evas_fps_debug_init(void);
|
|
|
|
void _ecore_evas_fps_debug_shutdown(void);
|
|
|
|
void _ecore_evas_fps_debug_rendertime_add(double t);
|
2005-07-28 07:09:09 -07:00
|
|
|
void _ecore_evas_free(Ecore_Evas *ee);
|
2007-06-16 20:41:43 -07:00
|
|
|
void _ecore_evas_idle_timeout_update(Ecore_Evas *ee);
|
|
|
|
|
2003-09-23 01:09:32 -07:00
|
|
|
#endif
|