Enlightenment CVS committal

Author  : codewarrior
Project : e17
Module  : libs/esmart

Dir     : e17/libs/esmart/src/lib/esmart_textarea


Modified Files:
        Esmart_Textarea.h esmart_textarea_callbacks.c 
        esmart_textarea_private.c esmart_textarea_private.h 
        esmart_textarea_public.c 


Log Message:
added format structure so we can return formatting info without having to parse 
them
===================================================================
RCS file: 
/cvsroot/enlightenment/e17/libs/esmart/src/lib/esmart_textarea/Esmart_Textarea.h,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -3 -r1.5 -r1.6
--- Esmart_Textarea.h   2 Apr 2005 00:01:10 -0000       1.5
+++ Esmart_Textarea.h   3 Apr 2005 01:57:54 -0000       1.6
@@ -30,6 +30,30 @@
    int pos;
 };
 
+struct _Esmart_Text_Area_Format {           /* formatting information */
+   char *font;
+   char *size;
+   char *color;
+   char *underline;
+   char *underline_color;
+   char *double_underline;
+   char *double_underline_color;
+   char *outline;
+   char *outline_color;
+   char *shadow;
+   char *shadow_color;
+   char *glow;
+   char *glow_color;
+   char *outer_glow;
+   char *outer_glow_color;
+   char *backing;
+   char *backing_color;
+   char *strikethrough;
+   char *strikethrough_color;      
+};
+
+typedef struct _Esmart_Text_Area_Format Esmart_Text_Area_Format;
+
 typedef struct _Esmart_Text_Area_Coord Esmart_Text_Area_Coord;
 
 struct _Esmart_Text_Area {                  /* our typical text area */   
@@ -89,4 +113,6 @@
 void            esmart_textarea_native_size_get(Evas_Object *o, Evas_Coord *w, 
Evas_Coord *h);
 int             esmart_textarea_native_lines_get(Evas_Object *o);
 
+Esmart_Text_Area_Format *esmart_textarea_format_get(Evas_Object *o);
+    
 #endif
===================================================================
RCS file: 
/cvsroot/enlightenment/e17/libs/esmart/src/lib/esmart_textarea/esmart_textarea_callbacks.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -3 -r1.2 -r1.3
--- esmart_textarea_callbacks.c 2 Apr 2005 00:01:11 -0000       1.2
+++ esmart_textarea_callbacks.c 3 Apr 2005 01:57:54 -0000       1.3
@@ -114,7 +114,7 @@
        break;
        
       case 3:
-       t->mouse_modifiers |= ESMART_TEXTAREA_MOUSE_MODIFIER_RIGHT;     
+       t->mouse_modifiers |= ESMART_TEXTAREA_MOUSE_MODIFIER_RIGHT;
        break;
      }
 }
===================================================================
RCS file: 
/cvsroot/enlightenment/e17/libs/esmart/src/lib/esmart_textarea/esmart_textarea_private.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -3 -r1.6 -r1.7
--- esmart_textarea_private.c   2 Apr 2005 00:01:11 -0000       1.6
+++ esmart_textarea_private.c   3 Apr 2005 01:57:54 -0000       1.7
@@ -257,3 +257,48 @@
 {
    return evas_object_textblock_native_lines_get(t->text);
 }
+
+/* this is an experimental function that gets formatting at a current
+ * location and uses the Esmart_Text_Area_Format struct as a placeholder
+ */
+Esmart_Text_Area_Format *
+_esmart_textarea_format_get(Esmart_Text_Area *t)
+{
+   Esmart_Text_Area_Format *format;
+   char *s, *tok;
+   
+   format = malloc(sizeof(Esmart_Text_Area_Format));
+   s = strdup(evas_object_textblock_format_current_get(t->text));
+              
+#define FORMAT_FILL(op) \
+   if(!strcmp(tok,#op)) \
+       { \
+         if((tok = strtok(NULL," ="))) \
+           format->op = strdup(tok); \
+       }
+   
+   tok = strtok(s," =");
+   if(!tok) return NULL;
+   do {
+      FORMAT_FILL(font);
+      FORMAT_FILL(size);
+      FORMAT_FILL(color);
+      FORMAT_FILL(underline);
+      FORMAT_FILL(underline_color);
+      FORMAT_FILL(double_underline);
+      FORMAT_FILL(double_underline_color);
+      FORMAT_FILL(outline);
+      FORMAT_FILL(outline_color);
+      FORMAT_FILL(shadow);
+      FORMAT_FILL(shadow_color);
+      FORMAT_FILL(glow);
+      FORMAT_FILL(glow_color);
+      FORMAT_FILL(outer_glow);
+      FORMAT_FILL(outer_glow_color);
+      FORMAT_FILL(backing);
+      FORMAT_FILL(backing_color);
+      FORMAT_FILL(strikethrough);
+      FORMAT_FILL(strikethrough_color);      
+   } while((tok = strtok(NULL," =")));
+   return format;   
+}
===================================================================
RCS file: 
/cvsroot/enlightenment/e17/libs/esmart/src/lib/esmart_textarea/esmart_textarea_private.h,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -3 -r1.5 -r1.6
--- esmart_textarea_private.h   2 Apr 2005 00:01:11 -0000       1.5
+++ esmart_textarea_private.h   3 Apr 2005 01:57:54 -0000       1.6
@@ -37,6 +37,8 @@
 void              _esmart_textarea_native_size_get(Esmart_Text_Area *t, 
Evas_Coord *w, Evas_Coord *h);
 int               _esmart_textarea_native_lines_get(Esmart_Text_Area *t);
 
+Esmart_Text_Area_Format *_esmart_textarea_format_get(Esmart_Text_Area *t);
+    
 
 /* textarea cursor movement and cursor related functions */
 void              _esmart_textarea_cursor_goto_cursor(Esmart_Text_Area *t);
===================================================================
RCS file: 
/cvsroot/enlightenment/e17/libs/esmart/src/lib/esmart_textarea/esmart_textarea_public.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -3 -r1.5 -r1.6
--- esmart_textarea_public.c    2 Apr 2005 00:01:11 -0000       1.5
+++ esmart_textarea_public.c    3 Apr 2005 01:57:54 -0000       1.6
@@ -401,3 +401,13 @@
    t = evas_object_smart_data_get(o);
    return _esmart_textarea_native_lines_get(t);
 }
+
+Esmart_Text_Area_Format *
+esmart_textarea_format_get(Evas_Object *o)
+{
+   Esmart_Text_Area *t;
+   
+   t = evas_object_smart_data_get(o);
+   return _esmart_textarea_format_get(t);
+}
+    




-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
enlightenment-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to