Enlightenment CVS committal Author : dj2 Project : e17 Module : libs/ewl
Dir : e17/libs/ewl/src/plugins Modified Files: ewl_io_manager_image_plugin.c ewl_io_manager_text_c_plugin.c ewl_io_manager_text_plugin.c Log Message: - tabs are a tricky beast. looks like I missed some. =================================================================== RCS file: /cvs/e/e17/libs/ewl/src/plugins/ewl_io_manager_image_plugin.c,v retrieving revision 1.8 retrieving revision 1.9 diff -u -3 -r1.8 -r1.9 --- ewl_io_manager_image_plugin.c 6 May 2008 20:20:04 -0000 1.8 +++ ewl_io_manager_image_plugin.c 7 May 2008 13:38:25 -0000 1.9 @@ -44,7 +44,7 @@ img = EWL_IMAGE(data); if (!img->image) - DRETURN_INT(ret, DLEVEL_STABLE); + DRETURN_INT(ret, DLEVEL_STABLE); ret = evas_object_image_save(img->image, uri, NULL, NULL); @@ -53,7 +53,7 @@ int ewl_io_manager_plugin_string_write(Ewl_Widget *data, - const char **string __UNUSED__) + const char **string __UNUSED__) { DENTER_FUNCTION(DLEVEL_STABLE); DCHECK_PARAM_PTR_RET(data, FALSE); =================================================================== RCS file: /cvs/e/e17/libs/ewl/src/plugins/ewl_io_manager_text_c_plugin.c,v retrieving revision 1.10 retrieving revision 1.11 diff -u -3 -r1.10 -r1.11 --- ewl_io_manager_text_c_plugin.c 6 May 2008 20:20:04 -0000 1.10 +++ ewl_io_manager_text_c_plugin.c 7 May 2008 13:38:25 -0000 1.11 @@ -73,10 +73,10 @@ 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]); + ecore_hash_set(key1, keywords1[i], keywords1[i]); for (i = 0; keywords2[i] != NULL; i++) - ecore_hash_set(key2, keywords2[i], keywords2[i]); + ecore_hash_set(key2, keywords2[i], keywords2[i]); } Ewl_Widget * @@ -89,26 +89,26 @@ DCHECK_PARAM_PTR_RET(uri, NULL); if (!key1) - setup_hash(); + setup_hash(); file = fopen(uri, "r"); if (file) { - struct stat buf; - char *str; + struct stat buf; + char *str; - ret = ewl_text_new(); - ewl_text_font_set(EWL_TEXT(ret), "ewl/monospace"); + ret = ewl_text_new(); + ewl_text_font_set(EWL_TEXT(ret), "ewl/monospace"); - stat(uri, &buf); - str = malloc(sizeof(char) * (buf.st_size + 1)); - fread(str, buf.st_size, 1, file); - str[buf.st_size] = '\0'; - fclose(file); + stat(uri, &buf); + str = malloc(sizeof(char) * (buf.st_size + 1)); + fread(str, buf.st_size, 1, file); + str[buf.st_size] = '\0'; + fclose(file); - text_set(EWL_TEXT(ret), str); - FREE(str); + text_set(EWL_TEXT(ret), str); + FREE(str); } DRETURN_PTR(ret, DLEVEL_STABLE); @@ -123,7 +123,7 @@ DENTER_FUNCTION(DLEVEL_STABLE); if (!key1) - setup_hash(); + setup_hash(); ret = ewl_text_new(); ewl_text_font_set(EWL_TEXT(ret), "ewl/monospace"); @@ -148,15 +148,15 @@ file = fopen(uri, "w"); if (file) { - char *txt; + char *txt; - txt = ewl_text_text_get(EWL_TEXT(data)); - fwrite(txt, sizeof(char), strlen(txt), file); + txt = ewl_text_text_get(EWL_TEXT(data)); + fwrite(txt, sizeof(char), strlen(txt), file); - FREE(txt); - fclose(file); + FREE(txt); + fclose(file); - ret = TRUE; + ret = TRUE; } DRETURN_INT(ret, DLEVEL_STABLE); @@ -181,7 +181,7 @@ DCHECK_PARAM_PTR_RET(string, FALSE); DRETURN_INT(((ecore_hash_get(keys, string) != NULL) ? TRUE : FALSE), - DLEVEL_STABLE); + DLEVEL_STABLE); } static void @@ -192,111 +192,111 @@ tx1 = tx2 = text; while (*tx1) { - int mode; - char remc = '\0'; + int mode; + char remc = '\0'; - /* decide what case we are dealing with */ - if (isalpha(*tx1) || (*tx1 == '_')) - mode = COMMAND; - - else if ((*tx1 == '/') && (*(tx1 + 1) == '*')) - mode = C_COMMENT; - - else if ((*tx1 == '/') && (*(tx1 + 1) == '/')) - mode = CPP_COMMENT; - - else if (*tx1 == '#') - mode = PREPROCESSOR; - - else if (isdigit(*tx1)) - mode = NUMBER; - - else if (*tx1 == '\"' && !( tx1 != text && *(tx1 - 1) == '\\')) - mode = STRING; - - else - mode = REST; - - /* - * finde the end of the mode - */ - tx2++; - switch (mode) - { - case NUMBER: - case COMMAND: - while(isalnum(*tx2) || (*tx2 == '_')) - tx2++; - break; - - case C_COMMENT: - while((*tx2 != '\0') && - (!((*tx2 == '*') - && (*(tx2 + 1) == '/')))) - tx2++; - - /* skip over the * and / characters */ - if (*tx2) tx2 += 2; - break; - - case PREPROCESSOR: - case CPP_COMMENT: - while((*tx2 != '\0') && (*tx2 != '\n')) - tx2++; - break; - - case STRING: - while((*tx2 != '\0') - && !((*tx2 == '\"') - && (*(tx2 - 1) != '\\'))) - tx2++; - - if (*tx2) tx2++; - break; - - case REST: - while(!isalnum(*tx2) && (*tx2 != '\0') - && (*tx2 != '#') - && (*tx2 != '/') - && (*tx2 != '\"')) - tx2++; - break; - - default: - break; - } - - /* append the text */ - remc = *tx2; - *tx2 = '\0'; - - if (mode == COMMAND && ((tx2 - tx1) < 8) && - string_is_keyword(key1, tx1)) - ewl_text_color_set(t, 68, 144, 169, 255); - - else if ((mode == COMMAND) && ((tx2 - tx1) < 8) && - string_is_keyword(key2, tx1)) - ewl_text_color_set(t, 26, 117, 3, 255); - - else if (mode == STRING) - ewl_text_color_set(t, 217, 0, 0, 255); - - else if ((mode == C_COMMENT) || (mode == CPP_COMMENT)) - ewl_text_color_set(t, 106, 15, 159, 255); - - else if (mode == PREPROCESSOR) - ewl_text_color_set(t, 153, 85, 29, 255); - - else if (mode == NUMBER) - ewl_text_color_set(t, 255, 114, 0, 255); + /* decide what case we are dealing with */ + if (isalpha(*tx1) || (*tx1 == '_')) + mode = COMMAND; + + else if ((*tx1 == '/') && (*(tx1 + 1) == '*')) + mode = C_COMMENT; + + else if ((*tx1 == '/') && (*(tx1 + 1) == '/')) + mode = CPP_COMMENT; + + else if (*tx1 == '#') + mode = PREPROCESSOR; + + else if (isdigit(*tx1)) + mode = NUMBER; + + else if (*tx1 == '\"' && !( tx1 != text && *(tx1 - 1) == '\\')) + mode = STRING; + + else + mode = REST; + + /* + * finde the end of the mode + */ + tx2++; + switch (mode) + { + case NUMBER: + case COMMAND: + while(isalnum(*tx2) || (*tx2 == '_')) + tx2++; + break; + + case C_COMMENT: + while((*tx2 != '\0') && + (!((*tx2 == '*') + && (*(tx2 + 1) == '/')))) + tx2++; + + /* skip over the * and / characters */ + if (*tx2) tx2 += 2; + break; + + case PREPROCESSOR: + case CPP_COMMENT: + while((*tx2 != '\0') && (*tx2 != '\n')) + tx2++; + break; + + case STRING: + while((*tx2 != '\0') + && !((*tx2 == '\"') + && (*(tx2 - 1) != '\\'))) + tx2++; + + if (*tx2) tx2++; + break; + + case REST: + while(!isalnum(*tx2) && (*tx2 != '\0') + && (*tx2 != '#') + && (*tx2 != '/') + && (*tx2 != '\"')) + tx2++; + break; + + default: + break; + } + + /* append the text */ + remc = *tx2; + *tx2 = '\0'; + + if (mode == COMMAND && ((tx2 - tx1) < 8) && + string_is_keyword(key1, tx1)) + ewl_text_color_set(t, 68, 144, 169, 255); + + else if ((mode == COMMAND) && ((tx2 - tx1) < 8) && + string_is_keyword(key2, tx1)) + ewl_text_color_set(t, 26, 117, 3, 255); + + else if (mode == STRING) + ewl_text_color_set(t, 217, 0, 0, 255); + + else if ((mode == C_COMMENT) || (mode == CPP_COMMENT)) + ewl_text_color_set(t, 106, 15, 159, 255); + + else if (mode == PREPROCESSOR) + ewl_text_color_set(t, 153, 85, 29, 255); + + else if (mode == NUMBER) + ewl_text_color_set(t, 255, 114, 0, 255); - else - ewl_text_color_set(t, 0, 0, 0, 255); + else + ewl_text_color_set(t, 0, 0, 0, 255); - ewl_text_text_append(t, tx1); + ewl_text_text_append(t, tx1); - *tx2 = remc; - tx1 = tx2; + *tx2 = remc; + tx1 = tx2; } } =================================================================== RCS file: /cvs/e/e17/libs/ewl/src/plugins/ewl_io_manager_text_plugin.c,v retrieving revision 1.7 retrieving revision 1.8 diff -u -3 -r1.7 -r1.8 --- ewl_io_manager_text_plugin.c 6 May 2008 20:20:04 -0000 1.7 +++ ewl_io_manager_text_plugin.c 7 May 2008 13:38:25 -0000 1.8 @@ -17,19 +17,19 @@ file = fopen(uri, "r"); if (file) { - struct stat buf; - char *str; + struct stat buf; + char *str; - ret = ewl_text_new(); + ret = ewl_text_new(); - stat(uri, &buf); - str = malloc(sizeof(char) * (buf.st_size + 1)); - fread(str, buf.st_size, 1, file); - str[buf.st_size] = '\0'; - fclose(file); + stat(uri, &buf); + str = malloc(sizeof(char) * (buf.st_size + 1)); + fread(str, buf.st_size, 1, file); + str[buf.st_size] = '\0'; + fclose(file); - ewl_text_text_set(EWL_TEXT(ret), str); - FREE(str); + ewl_text_text_set(EWL_TEXT(ret), str); + FREE(str); } DRETURN_PTR(ret, DLEVEL_STABLE); @@ -62,15 +62,15 @@ file = fopen(uri, "w"); if (file) { - char *txt; + char *txt; - txt = ewl_text_text_get(EWL_TEXT(data)); - fwrite(txt, sizeof(char), strlen(txt), file); + txt = ewl_text_text_get(EWL_TEXT(data)); + fwrite(txt, sizeof(char), strlen(txt), file); - FREE(txt); - fclose(file); + FREE(txt); + fclose(file); - ret = TRUE; + ret = TRUE; } DRETURN_INT(ret, DLEVEL_STABLE); ------------------------------------------------------------------------- This SF.net email is sponsored by the 2008 JavaOne(SM) Conference Don't miss this year's exciting event. There's still time to save $100. Use priority code J8TL2D2. http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone _______________________________________________ enlightenment-cvs mailing list enlightenment-cvs@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs