Enlightenment CVS committal Author : pfritz Project : e17 Module : libs/ewl
Dir : e17/libs/ewl/src/plugins Modified Files: ewl_io_manager_text_c_plugin.c Log Message: - put some color in the ewl_test source viewer - fix the "text/c"-plugin therefor =================================================================== RCS file: /cvs/e/e17/libs/ewl/src/plugins/ewl_io_manager_text_c_plugin.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -3 -r1.3 -r1.4 --- ewl_io_manager_text_c_plugin.c 4 Jan 2007 05:09:48 -0000 1.3 +++ ewl_io_manager_text_c_plugin.c 6 Jan 2007 19:48:30 -0000 1.4 @@ -4,6 +4,7 @@ #include "ewl_debug.h" #include "ewl_macros.h" +static void setup_hash(); static int string_is_keyword(Ecore_Hash *keys, const char * string); static void text_set(Ewl_Text *t, char *text); @@ -61,6 +62,22 @@ NULL }; +static void +setup_hash() +{ + + int i; + + key1 = ecore_hash_new(ecore_str_hash, ecore_str_compare); + key2 = ecore_hash_new(ecore_str_hash, ecore_str_compare); + + for (i = 0; keywords1[i] != NULL; i++) + ecore_hash_set(key1, keywords1[i], keywords1[i]); + + for (i = 0; keywords2[i] != NULL; i++) + ecore_hash_set(key2, keywords2[i], keywords2[i]); +} + Ewl_Widget * ewl_io_manager_plugin_uri_read(const char *uri) { @@ -71,18 +88,8 @@ DCHECK_PARAM_PTR_RET("uri", uri, NULL); if (!key1) - { - int i; - key1 = ecore_hash_new(ecore_str_hash, ecore_str_compare); - key2 = ecore_hash_new(ecore_str_hash, ecore_str_compare); - - for (i = 0; keywords1[i] != NULL; i++) - ecore_hash_set(key1, keywords1[i], keywords1[i]); - - for (i = 0; keywords2[i] != NULL; i++) - ecore_hash_set(key2, keywords2[i], keywords2[i]); + setup_hash(); - } file = fopen(uri, "r"); if (file) @@ -112,8 +119,11 @@ DENTER_FUNCTION(DLEVEL_STABLE); + if (!key1) + setup_hash(); + ret = ewl_text_new(); - ewl_text_text_set(EWL_TEXT(ret), string); + text_set(EWL_TEXT(ret), string); DRETURN_PTR(ret, DLEVEL_STABLE); } ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV _______________________________________________ enlightenment-cvs mailing list enlightenment-cvs@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs