Enlightenment CVS committal
Author : raster
Project : e17
Module : libs/ecore
Dir : e17/libs/ecore/src/lib/ecore_evas
Modified Files:
Tag: SPLIT
Ecore_Evas.h ecore_evas_private.h ecore_evas_x.c
Log Message:
gl_x11 engine support in ecore_evas... just started.. should work though.
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ecore/src/lib/ecore_evas/Attic/Ecore_Evas.h,v
retrieving revision 1.1.2.19
retrieving revision 1.1.2.20
diff -u -3 -r1.1.2.19 -r1.1.2.20
--- Ecore_Evas.h 4 Sep 2003 21:07:49 -0000 1.1.2.19
+++ Ecore_Evas.h 4 Sep 2003 23:23:59 -0000 1.1.2.20
@@ -35,6 +35,7 @@
/* engine/target specific init calls */
Ecore_Evas *ecore_evas_software_x11_new(const char *disp_name, Ecore_X_Window
parent, int x, int y, int w, int h);
+Ecore_Evas *ecore_evas_gl_x11_new(const char *disp_name, Ecore_X_Window parent,
int x, int y, int w, int h);
Ecore_X_Window ecore_evas_software_x11_window_get(Ecore_Evas *ee);
Ecore_Evas *ecore_evas_fb_new(char *disp_name, int rotation, int w, int h);
===================================================================
RCS file:
/cvsroot/enlightenment/e17/libs/ecore/src/lib/ecore_evas/Attic/ecore_evas_private.h,v
retrieving revision 1.1.2.17
retrieving revision 1.1.2.18
diff -u -3 -r1.1.2.17 -r1.1.2.18
--- ecore_evas_private.h 16 Jul 2003 04:49:07 -0000 1.1.2.17
+++ ecore_evas_private.h 4 Sep 2003 23:23:59 -0000 1.1.2.18
@@ -8,7 +8,11 @@
#ifdef BUILD_ECORE_X
#include "Ecore_X.h"
#include <Evas_Engine_Software_X11.h>
+#include <X11/Xlib.h>
#include <X11/Xutil.h>
+#ifdef BUILD_ECORE_EVAS_GL
+#include <Evas_Engine_GL_X11.h>
+#endif
#endif
#ifdef BUILD_ECORE_FB
#include <Evas_Engine_FB.h>
===================================================================
RCS file:
/cvsroot/enlightenment/e17/libs/ecore/src/lib/ecore_evas/Attic/ecore_evas_x.c,v
retrieving revision 1.1.2.19
retrieving revision 1.1.2.20
diff -u -3 -r1.1.2.19 -r1.1.2.20
--- ecore_evas_x.c 16 Jul 2003 04:49:07 -0000 1.1.2.19
+++ ecore_evas_x.c 4 Sep 2003 23:23:59 -0000 1.1.2.20
@@ -604,6 +604,7 @@
int rot_dif;
if (ee->rotation == rotation) return;
+ if (!strcmp(ee->driver, "gl_x11")) return;
einfo = (Evas_Engine_Info_Software_X11 *)evas_engine_info_get(ee->evas);
if (!einfo) return;
rot_dif = ee->rotation - rotation;
@@ -671,6 +672,7 @@
if (((ee->shaped) && (shaped)) ||
((!ee->shaped) && (!shaped)))
return;
+ if (!strcmp(ee->driver, "gl_x11")) return;
ee->shaped = shaped;
einfo = (Evas_Engine_Info_Software_X11 *)evas_engine_info_get(ee->evas);
if (einfo)
@@ -947,6 +949,7 @@
if (((ee->prop.avoid_damage) && (on)) ||
((!ee->prop.avoid_damage) && (!on)))
return;
+ if (!strcmp(ee->driver, "gl_x11")) return;
ee->prop.avoid_damage = on;
einfo = (Evas_Engine_Info_Software_X11 *)evas_engine_info_get(ee->evas);
if (einfo)
@@ -1095,6 +1098,98 @@
einfo->info.depth = DefaultDepth(ecore_x_display_get(),
DefaultScreen(ecore_x_display_get()));
einfo->info.rotation = 0;
einfo->info.debug = 0;
+ evas_engine_info_set(ee->evas, (Evas_Engine_Info *)einfo);
+ }
+ evas_key_modifier_add(ee->evas, "Shift");
+ evas_key_modifier_add(ee->evas, "Control");
+ evas_key_modifier_add(ee->evas, "Alt");
+ evas_key_modifier_add(ee->evas, "Meta");
+ evas_key_modifier_add(ee->evas, "Hyper");
+ evas_key_modifier_add(ee->evas, "Super");
+ evas_key_lock_add(ee->evas, "Caps_Lock");
+ evas_key_lock_add(ee->evas, "Num_Lock");
+ evas_key_lock_add(ee->evas, "Scroll_Lock");
+
+ ecore_evases = _ecore_list_prepend(ecore_evases, ee);
+ return ee;
+#else
+ return NULL;
+#endif
+}
+
+Ecore_Evas *
+ecore_evas_gl_x11_new(const char *disp_name, Ecore_X_Window parent,
+ int x, int y, int w, int h)
+{
+#ifdef BUILD_ECORE_EVAS_GL
+ Evas_Engine_Info_GL_X11 *einfo;
+ Ecore_Evas *ee;
+ int rmethod;
+
+ rmethod = evas_render_method_lookup("gl_x11");
+ if (!rmethod) return NULL;
+ if (!ecore_x_init(disp_name)) return NULL;
+ ee = calloc(1, sizeof(Ecore_Evas));
+ if (!ee) return NULL;
+
+ ECORE_MAGIC_SET(ee, ECORE_MAGIC_EVAS);
+
+ _ecore_evas_x_init();
+
+ ee->engine.func = (Ecore_Evas_Engine_Func *)&_ecore_x_engine_func;
+
+ ee->driver = strdup("gl_x11");
+ if (disp_name) ee->name = strdup(disp_name);
+
+ if (w < 1) w = 1;
+ if (h < 1) h = 1;
+ ee->x = x;
+ ee->y = y;
+ ee->w = w;
+ ee->h = h;
+
+ ee->prop.max.w = 32767;
+ ee->prop.max.h = 32767;
+ ee->prop.layer = 4;
+
+ /* init evas here */
+ ee->evas = evas_new();
+ evas_output_method_set(ee->evas, rmethod);
+ evas_output_size_set(ee->evas, w, h);
+ evas_output_viewport_set(ee->evas, 0, 0, w, h);
+
+ ee->engine.x.win_container = ecore_x_window_new(parent, x, y, w, h);
+ einfo = (Evas_Engine_Info_GL_X11 *)evas_engine_info_get(ee->evas);
+ if (einfo)
+ {
+ XSetWindowAttributes attr;
+
+ attr.backing_store = NotUseful;
+ attr.colormap = einfo->func.best_colormap_get(ecore_x_display_get(),
DefaultScreen(ecore_x_display_get()));
+ attr.border_pixel = 0;
+ attr.background_pixmap = None;
+ attr.event_mask =
+ ExposureMask | ButtonPressMask | ButtonReleaseMask |
+ PointerMotionMask | StructureNotifyMask;
+ attr.bit_gravity = ForgetGravity;
+
+ ee->engine.x.win =
+ XCreateWindow(ecore_x_display_get(),
+ ee->engine.x.win_container,
+ 0, 0,
+ w, h, 0,
+ einfo->func.best_depth_get(ecore_x_display_get(),
DefaultScreen(ecore_x_display_get())),
+ InputOutput,
+ einfo->func.best_visual_get(ecore_x_display_get(),
DefaultScreen(ecore_x_display_get())),
+ CWBackingStore | CWColormap |
+ CWBackPixmap | CWBorderPixel |
+ CWBitGravity | CWEventMask,
+ &attr);
+ einfo->info.display = ecore_x_display_get();
+ einfo->info.visual = einfo->func.best_visual_get(ecore_x_display_get(),
DefaultScreen(ecore_x_display_get()));
+ einfo->info.colormap = einfo->func.best_colormap_get(ecore_x_display_get(),
DefaultScreen(ecore_x_display_get()));
+ einfo->info.drawable = ee->engine.x.win;
+ einfo->info.depth = einfo->func.best_depth_get(ecore_x_display_get(),
DefaultScreen(ecore_x_display_get()));
evas_engine_info_set(ee->evas, (Evas_Engine_Info *)einfo);
}
evas_key_modifier_add(ee->evas, "Shift");
-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
enlightenment-cvs mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs