Enlightenment CVS committal

Author  : andreas
Project : e17
Module  : proto/eflpp

Dir     : e17/proto/eflpp/src/ecore


Modified Files:
        eflpp_ecore.cpp eflpp_ecore.h 


Log Message:
- added GL and XRender backend support
- changed example code to new API

===================================================================
RCS file: /cvs/e/e17/proto/eflpp/src/ecore/eflpp_ecore.cpp,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -3 -r1.4 -r1.5
--- eflpp_ecore.cpp     22 Aug 2007 21:14:54 -0000      1.4
+++ eflpp_ecore.cpp     22 Aug 2007 22:35:50 -0000      1.5
@@ -152,7 +152,7 @@
 // EcoreEvasWindow
 
//===============================================================================================
 
-EcoreEvasWindow::EcoreEvasWindow( int width, int height, const char* display, 
int rotation )
+EcoreEvasWindow::EcoreEvasWindow(/* int width, int height, const char* 
display, int rotation*/ )
                 :Trackable( "EcoreEvasWindow" )
 {
   
@@ -491,11 +491,12 @@
 }
 
 EcoreEvasWindowSoftwareX11::EcoreEvasWindowSoftwareX11( int width, int height, 
const char* display )
-                :EcoreEvasWindow( width, height )
+                :EcoreEvasWindow()
 {    
-    Dout( dc::notice, "EcoreEvasWindow::EcoreEvasWindow" );
+    Dout( dc::notice, "EcoreEvasWindow::EcoreEvasWindowSoftwareX11" );
     EcoreApplication::application()->setMainWindow( this );
 
+    if ( ::getenv( "EFL_DISPLAY" ) ) display = ::getenv( "EFL_DISPLAY" );
     if ( ::getenv( "EFL_WIDTH" ) ) width = atoi( ::getenv( "EFL_WIDTH" ) );
     if ( ::getenv( "EFL_HEIGHT" ) ) height = atoi( ::getenv( "EFL_HEIGHT" ) );
   
@@ -521,10 +522,75 @@
   
 }
 
-EcoreEvasWindowFB::EcoreEvasWindowFB( int width, int height, const char* 
display = 0, int rotation = 0 )
-                :EcoreEvasWindow( width, height )
+EcoreEvasWindowGLX11::EcoreEvasWindowGLX11( int width, int height, const char* 
display )
+                :EcoreEvasWindow()
+{    
+    Dout( dc::notice, "EcoreEvasWindow::EcoreEvasWindowGL" );
+    EcoreApplication::application()->setMainWindow( this );
+
+    if ( ::getenv( "EFL_DISPLAY" ) ) display = ::getenv( "EFL_DISPLAY" );
+    if ( ::getenv( "EFL_WIDTH" ) ) width = atoi( ::getenv( "EFL_WIDTH" ) );
+    if ( ::getenv( "EFL_HEIGHT" ) ) height = atoi( ::getenv( "EFL_HEIGHT" ) );
+  
+    Dout( dc::notice, "- detected display string '" << ( display ? 
display:"<null>" ) << "' - starting X11 engine" );
+    //FIXME: Should we care about positioning? 0, 0 for now
+    _ee = ecore_evas_gl_x11_new( const_cast<char*>( display ), 0, 0, 0, width, 
height );
+    
+    ecore_evas_title_set( _ee, eApp->name().c_str() );
+    ecore_evas_borderless_set( _ee, 0 );
+    ecore_evas_show( _ee );
+    _canvas = new EvasCanvas( ecore_evas_get( _ee ) );
+
+    /* Set up magic object back link */
+    ecore_evas_data_set( _ee, "obj_c++", this );
+
+    /* Set up default callbacks */
+    setEventEnabled( Resize, true );
+    setEventEnabled( DeleteRequest, true );
+}
+
+EcoreEvasWindowGLX11::~EcoreEvasWindowGLX11()
+{
+  
+}
+
+EcoreEvasWindowXRenderX11::EcoreEvasWindowXRenderX11( int width, int height, 
const char* display )
+                :EcoreEvasWindow()
+{    
+    Dout( dc::notice, "EcoreEvasWindow::EcoreEvasWindowGL" );
+    EcoreApplication::application()->setMainWindow( this );
+
+    if ( ::getenv( "EFL_DISPLAY" ) ) display = ::getenv( "EFL_DISPLAY" );
+    if ( ::getenv( "EFL_WIDTH" ) ) width = atoi( ::getenv( "EFL_WIDTH" ) );
+    if ( ::getenv( "EFL_HEIGHT" ) ) height = atoi( ::getenv( "EFL_HEIGHT" ) );
+  
+    Dout( dc::notice, "- detected display string '" << ( display ? 
display:"<null>" ) << "' - starting X11 engine" );
+    //FIXME: Should we care about positioning? 0, 0 for now
+    _ee = ecore_evas_xrender_x11_new( const_cast<char*>( display ), 0, 0, 0, 
width, height );
+    
+    ecore_evas_title_set( _ee, eApp->name().c_str() );
+    ecore_evas_borderless_set( _ee, 0 );
+    ecore_evas_show( _ee );
+    _canvas = new EvasCanvas( ecore_evas_get( _ee ) );
+
+    /* Set up magic object back link */
+    ecore_evas_data_set( _ee, "obj_c++", this );
+
+    /* Set up default callbacks */
+    setEventEnabled( Resize, true );
+    setEventEnabled( DeleteRequest, true );
+}
+
+EcoreEvasWindowXRenderX11::~EcoreEvasWindowXRenderX11()
+{
+  
+}
+
+// TODO: Possible without #ifdef stuff?
+EcoreEvasWindowFB::EcoreEvasWindowFB( int width, int height, const char* 
display, int rotation )
+                :EcoreEvasWindow()
 {
-    Dout( dc::notice, "EcoreEvasWindow::EcoreEvasWindow" );
+    Dout( dc::notice, "EcoreEvasWindow::EcoreEvasWindowFB" );
     EcoreApplication::application()->setMainWindow( this );
 
     if ( ::getenv( "EFL_DISPLAY" ) ) display = ::getenv( "EFL_DISPLAY" );
===================================================================
RCS file: /cvs/e/e17/proto/eflpp/src/ecore/eflpp_ecore.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -3 -r1.3 -r1.4
--- eflpp_ecore.h       18 Aug 2007 18:28:00 -0000      1.3
+++ eflpp_ecore.h       22 Aug 2007 22:35:50 -0000      1.4
@@ -106,6 +106,7 @@
 // EcoreEvasWindow
 
//===============================================================================================
 
+// TODO: Test for supported backends?
 class EcoreEvasWindow : public Trackable
 {
   public:
@@ -113,7 +114,6 @@
                     FocusIn, FocusOut, MouseIn, MouseOut, PreRender, 
PostRender };
 
   public:
-    EcoreEvasWindow( int width, int height, const char* display = 0, int 
rotation = 0 );
     virtual ~EcoreEvasWindow();
 
     EvasCanvas* canvas() const { return _canvas; };
@@ -207,10 +207,10 @@
     EvasCanvas* _canvas;
     Ecore_Evas* _ee;
 
+    EcoreEvasWindow();
     static EcoreEvasWindow* objectLink( Ecore_Evas* );
 
   private:
-    EcoreEvasWindow();
     bool operator=( const EcoreEvasWindow& );
     bool operator==( const EcoreEvasWindow& );
 };
@@ -220,8 +220,6 @@
   public:
     EcoreEvasWindowSoftwareX11( int width, int height, const char* display = 0 
);
     virtual ~EcoreEvasWindowSoftwareX11();
-
-    // TODO: Test for supported backends?
   
   private:
     EcoreEvasWindowSoftwareX11();
@@ -229,10 +227,34 @@
     bool operator==( const EcoreEvasWindowSoftwareX11& );
 };
 
+class EcoreEvasWindowGLX11 : public EcoreEvasWindow
+{
+  public:
+    EcoreEvasWindowGLX11( int width, int height, const char* display = 0 );
+    virtual ~EcoreEvasWindowGLX11();
+  
+  private:
+    EcoreEvasWindowGLX11();
+    bool operator=( const EcoreEvasWindowGLX11& );
+    bool operator==( const EcoreEvasWindowGLX11& );
+};
+
+class EcoreEvasWindowXRenderX11 : public EcoreEvasWindow
+{
+  public:
+    EcoreEvasWindowXRenderX11( int width, int height, const char* display = 0 
);
+    virtual ~EcoreEvasWindowXRenderX11();
+  
+  private:
+    EcoreEvasWindowXRenderX11();
+    bool operator=( const EcoreEvasWindowXRenderX11& );
+    bool operator==( const EcoreEvasWindowXRenderX11& );
+};
+
 class EcoreEvasWindowFB : public EcoreEvasWindow
 {
   public:
-    EcoreEvasWindowFB( int width, int height, const char* display, int 
rotation );
+    EcoreEvasWindowFB( int width, int height, const char* display = 0, int 
rotation = 0 );
     virtual ~EcoreEvasWindowFB();
 
     // TODO: Test for supported backends?



-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
_______________________________________________
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to