Enlightenment CVS committal

Author  : mickeyl
Project : e17
Module  : proto/eflpp

Dir     : e17/proto/eflpp/src/evas


Modified Files:
        Makefile.am eflpp_evas.cpp eflpp_evas.h 
        eflpp_evastextblockstyle.cpp eflpp_evastextblockstyle.h 


Log Message:
eflpp: EvasTextblock works again (missing a lot though)

===================================================================
RCS file: /cvs/e/e17/proto/eflpp/src/evas/Makefile.am,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -3 -r1.2 -r1.3
--- Makefile.am 9 Oct 2007 08:38:09 -0000       1.2
+++ Makefile.am 9 Oct 2007 14:59:50 -0000       1.3
@@ -10,14 +10,14 @@
 libeflpp_evas_la_SOURCES = \
        eflpp_evas.cpp\
        eflpp_evasfont.cpp\
-       eflpp_evastextblock.cpp
+       eflpp_evastextblockstyle.cpp
     
 libeflpp_includedir = $(pkgincludedir)
 
 libeflpp_include_DATA = \
        eflpp_evasevent.h\
        eflpp_evasfont.h\
-       eflpp_evastextblock.h\
+       eflpp_evastextblockstyle.h\
        eflpp_evas.h\
        eflpp_evasutils.h
 
===================================================================
RCS file: /cvs/e/e17/proto/eflpp/src/evas/eflpp_evas.cpp,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -3 -r1.5 -r1.6
--- eflpp_evas.cpp      8 Oct 2007 17:58:26 -0000       1.5
+++ eflpp_evas.cpp      9 Oct 2007 14:59:50 -0000       1.6
@@ -2,6 +2,7 @@
 #include <eflpp_common.h>
 
 #include "eflpp_evas.h"
+#include "eflpp_evastextblockstyle.h"
 #include "eflpp_ecore.h"
 
 /* EFL */
@@ -821,52 +822,39 @@
 // Textblock
 
//===============================================================================================
 
-EvasTextBlock::EvasTextBlock( EvasCanvas* canvas, const char* name )
+EvasTextblock::EvasTextblock( EvasCanvas* canvas, const char* name )
      :EvasObject( canvas )
 {
     o = evas_object_textblock_add( canvas->obj() );
     init( name ? name : "textblock" );
 }
 
-EvasTextBlock::EvasTextBlock( int x, int y, const char* text, EvasCanvas* 
canvas, const char* name )
+EvasTextblock::EvasTextblock( int x, int y, const char* text, EvasCanvas* 
canvas, const char* name )
      :EvasObject( canvas )
 {
     o = evas_object_textblock_add( canvas->obj() );
     init( name ? name : "textblock" );
 
     move( x, y );
-    insertText( text );
-    //setFont( "Vera", 10 );
+    setText( text );
 }
 
-void EvasTextBlock::insertFormattedText( const char* text, const char* font, 
int size, const char* color )
+void EvasTextblock::setStyle( const EvasTextblockStyle* style )
 {
-    insertFormat( font, size, color );
-    insertText( text );
+    evas_object_textblock_style_set( o, style->o );
 }
 
-void EvasTextBlock::insertFormat( const char* font, int size, const char* 
color )
+void EvasTextblock::setText( const char* text )
 {
-    char format[1024];
-    memset( format, 0, sizeof format );
-    sprintf( format, "font=%s size=%d color=%s", font, size, color );
-#if 0
-    evas_object_textblock_format_insert( o, format );
-#else
-#warning Excuse me - EvasTextBlock is currently broken due to internal evas 
changes
-#endif
+    evas_object_textblock_text_markup_set( o, text );
 }
 
-void EvasTextBlock::insertText( const char* text )
+void EvasTextblock::clear()
 {
-#if 0
-    evas_object_textblock_text_insert( o, text );
-#else
-#warning Excuse me - EvasTextBlock is currently broken due to internal evas 
changes
-#endif
+    evas_object_textblock_clear( o );
 }
 
-EvasTextBlock::~EvasTextBlock()
+EvasTextblock::~EvasTextblock()
 {
     evas_object_del( o );
 }
===================================================================
RCS file: /cvs/e/e17/proto/eflpp/src/evas/eflpp_evas.h,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -3 -r1.5 -r1.6
--- eflpp_evas.h        18 Aug 2007 18:28:00 -0000      1.5
+++ eflpp_evas.h        9 Oct 2007 14:59:50 -0000       1.6
@@ -31,6 +31,7 @@
 class EvasPolygon;
 class EvasRectangle;
 class EvasText;
+class EvasTextblockStyle;
 
 static const char* EVAS_LOAD_ERROR[] =
 {
@@ -59,13 +60,13 @@
 
     /* Output Methods */
     int lookupRenderMethod( const char* method );
-  
+
     /*! \brief Set the Evas output method.
      *  This does include a call to lookupRenderMethod().
      *  @param method Name of the output method. (See C API docs).
      */
     bool setOutputMethod( const char* method );
-  
+
     void resize( int width, int height );
     Size size() const;
     Rect geometry() const;
@@ -187,7 +188,7 @@
   protected:
     Evas_Object* o;
     EvasCanvas* _canvas;
-  
+
     void init (const char *name);
 
   private:
@@ -276,16 +277,16 @@
 /*
  * Wraps an Evas Textblock Object
  */
-class EvasTextBlock : public EvasObject
+class EvasTextblock : public EvasObject
 {
   public:
-    EvasTextBlock( EvasCanvas* canvas, const char* name = 0 );
-    EvasTextBlock( int x, int y, const char* text, EvasCanvas* canvas, const 
char* name = 0 );
-    virtual ~EvasTextBlock();
-
-    void insertText( const char* text );
-    void insertFormat( const char* font, int size = 12, const char* color = 
"#ffffffff" );
-    void insertFormattedText( const char* text, const char* font = "Vera", int 
size = 12, const char* color = "#ffffffff" );
+    EvasTextblock( EvasCanvas* canvas, const char* name = 0 );
+    EvasTextblock( int x, int y, const char* text, EvasCanvas* canvas, const 
char* name = 0 );
+    virtual ~EvasTextblock();
+
+    void setStyle( const EvasTextblockStyle* style );
+    void setText( const char* text );
+    void clear();
 };
 
 /*
@@ -326,7 +327,7 @@
     /* Border */
     void setBorder( int left, int right, int top, int bottom );
 
-    /// Sets the raw image data. 
+    /// Sets the raw image data.
     void setData (void *data);
 
     /// Retrieves the raw image data.
===================================================================
RCS file: /cvs/e/e17/proto/eflpp/src/evas/eflpp_evastextblockstyle.cpp,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -3 -r1.1 -r1.2
--- eflpp_evastextblockstyle.cpp        9 Oct 2007 08:38:09 -0000       1.1
+++ eflpp_evastextblockstyle.cpp        9 Oct 2007 14:59:50 -0000       1.2
@@ -4,6 +4,8 @@
 
 #include "eflpp_evastextblockstyle.h"
 
+#include <assert.h>
+
 namespace efl {
 
 EvasTextblockStyle::EvasTextblockStyle()
@@ -19,12 +21,19 @@
 
 EvasTextblockStyle::~EvasTextblockStyle()
 {
-    evas_textblock_style_free();
+    evas_textblock_style_free( o );
 }
 
-const char* EvasTextblockStyle::style() const
+const char* EvasTextblockStyle::format() const
 {
     return evas_textblock_style_get( o );
+}
+
+void EvasTextblockStyle::setFormat( const char* format )
+{
+    assert( o );
+    evas_textblock_style_set( o, format );
+
 }
 
 }
===================================================================
RCS file: /cvs/e/e17/proto/eflpp/src/evas/eflpp_evastextblockstyle.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -3 -r1.1 -r1.2
--- eflpp_evastextblockstyle.h  9 Oct 2007 08:38:09 -0000       1.1
+++ eflpp_evastextblockstyle.h  9 Oct 2007 14:59:50 -0000       1.2
@@ -21,11 +21,15 @@
 
 class EvasTextblockStyle
 {
+  friend class EvasTextblock;
+
   public:
     EvasTextblockStyle();
     EvasTextblockStyle( const char* format );
     ~EvasTextblockStyle();
+
     const char* format() const;
+    void setFormat( const char* );
 
   private:
     Evas_Textblock_Style* o;



-------------------------------------------------------------------------
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