Enlightenment CVS committal
Author : kiwi
Project : e_modules
Module : devian
Dir : e_modules/devian/src/module
Modified Files:
e_mod_config.c e_mod_config.h e_mod_config_dialog.c
e_mod_container_box.c e_mod_data_file.c e_mod_data_picture.c
e_mod_data_picture.h e_mod_source_file.c
e_mod_source_picture.c
Log Message:
Work on Log source and Picture source.
* Log source : not finished (at all), but it's working. I enable it for debug
purpose only
* Add ability to select or not hidden files, when loading pictures
* You can now open the picture in a viewer even if the name contains spaces,
special chars ...
===================================================================
RCS file: /cvs/e/e_modules/devian/src/module/e_mod_config.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -3 -r1.3 -r1.4
--- e_mod_config.c 14 Apr 2006 09:09:38 -0000 1.3
+++ e_mod_config.c 18 Apr 2006 08:08:22 -0000 1.4
@@ -226,7 +226,8 @@
snprintf(buf, DEVIAN_MAX_PATH, "%s/Tofs", e_user_homedir_get());
cfg_main->sources_picture_data_import_dir = (char
*)evas_stringshare_add(buf);
cfg_main->sources_picture_data_import_thumbs_warn = 1;
- cfg_main->sources_picture_data_import_recursive = 0;
+ cfg_main->sources_picture_data_import_recursive =
DATA_PICTURE_IMPORT_RECURSIVE_DEFAULT;
+ cfg_main->sources_picture_data_import_hidden =
DATA_PICTURE_IMPORT_HIDDEN_DEFAULT;
cfg_main->sources_picture_default_location = DATA_PICTURE_LOCAL;
cfg_main->sources_picture_set_bg_purge =
SOURCE_PICTURE_SET_BG_PURGE_DEFAULT;
cfg_main->sources_picture_show_devian_pics =
DATA_PICTURE_SHOW_DEVIAN_PICS_DEFAULT;
@@ -508,6 +509,7 @@
E_CONFIG_VAL(D, T, sources_picture_data_import_dir, STR);
E_CONFIG_VAL(D, T, sources_picture_data_import_thumbs_warn, INT);
E_CONFIG_VAL(D, T, sources_picture_data_import_recursive, INT);
+ E_CONFIG_VAL(D, T, sources_picture_data_import_hidden, INT);
E_CONFIG_VAL(D, T, sources_picture_default_location, INT);
E_CONFIG_VAL(D, T, sources_picture_set_bg_purge, INT);
E_CONFIG_VAL(D, T, sources_picture_show_devian_pics, INT);
===================================================================
RCS file: /cvs/e/e_modules/devian/src/module/e_mod_config.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -3 -r1.3 -r1.4
--- e_mod_config.h 14 Apr 2006 09:09:38 -0000 1.3
+++ e_mod_config.h 18 Apr 2006 08:08:22 -0000 1.4
@@ -8,10 +8,10 @@
#define E_MOD_CONFIG_H_INCLUDED
#ifdef HAVE_ALL
-#define CONFIG_VERSION 49
+#define CONFIG_VERSION 50
#else
#ifdef HAVE_PICTURE
-#define CONFIG_VERSION 4
+#define CONFIG_VERSION 5
#else
#ifdef HAVE_RSS
#define CONFIG_VERSION 4
@@ -47,6 +47,7 @@
#ifdef HAVE_PICTURE
const char *sources_picture_data_import_dir;
int sources_picture_data_import_recursive;
+ int sources_picture_data_import_hidden;
int sources_picture_data_import_thumbs_warn;
int sources_picture_default_location;
int sources_picture_set_bg_purge;
===================================================================
RCS file: /cvs/e/e_modules/devian/src/module/e_mod_config_dialog.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -3 -r1.3 -r1.4
--- e_mod_config_dialog.c 14 Apr 2006 09:09:38 -0000 1.3
+++ e_mod_config_dialog.c 18 Apr 2006 08:08:22 -0000 1.4
@@ -34,6 +34,7 @@
#ifdef HAVE_PICTURE
char *sources_picture_data_import_dir;
int sources_picture_data_import_recursive;
+ int sources_picture_data_import_hidden;
#endif
#ifdef HAVE_RSS
int sources_rss_popup_news;
@@ -138,6 +139,7 @@
#ifdef HAVE_PICTURE
cfdata->sources_picture_data_import_dir =
strdup(conf->sources_picture_data_import_dir);
cfdata->sources_picture_data_import_recursive =
conf->sources_picture_data_import_recursive;
+ cfdata->sources_picture_data_import_hidden =
conf->sources_picture_data_import_hidden;
#endif
#ifdef HAVE_RSS
cfdata->sources_rss_timer_s = conf->sources_rss_timer_s / 60;
@@ -271,6 +273,7 @@
DEVIANM->conf->sources_picture_data_import_dir =
evas_stringshare_add(cfdata->sources_picture_data_import_dir);
}
DEVIANM->conf->sources_picture_data_import_recursive =
cfdata->sources_picture_data_import_recursive;
+ DEVIANM->conf->sources_picture_data_import_hidden =
cfdata->sources_picture_data_import_hidden;
#endif
#ifdef HAVE_RSS
DEVIANM->conf->sources_rss_timer_s = cfdata->sources_rss_timer_s * 60;
@@ -537,17 +540,19 @@
e_widget_frametable_object_append(of, ob, 1, 0, 1, 1, 1, 1, 1, 1);
ob = e_widget_check_add(evas, _("Load sub-directories"),
&(cfdata->sources_picture_data_import_recursive));
e_widget_frametable_object_append(of, ob, 0, 1, 2, 1, 1, 1, 1, 1);
- ob = e_widget_button_add(evas, "Regenerate pictures list", NULL,
_cb_button_regen_picture_list, NULL, NULL);
+ ob = e_widget_check_add(evas, _("Load hidden files/directories"),
&(cfdata->sources_picture_data_import_hidden));
e_widget_frametable_object_append(of, ob, 0, 2, 2, 1, 1, 1, 1, 1);
+ ob = e_widget_button_add(evas, "Regenerate pictures list", NULL,
_cb_button_regen_picture_list, NULL, NULL);
+ e_widget_frametable_object_append(of, ob, 0, 3, 2, 1, 1, 1, 1, 1);
ob = e_widget_label_add(evas, _("Quality"));
- e_widget_frametable_object_append(of, ob, 0, 3, 1, 1, 1, 1, 1, 1);
+ e_widget_frametable_object_append(of, ob, 0, 4, 1, 1, 1, 1, 1, 1);
ob = e_widget_slider_add(evas, 1, 0, _("%1.0f"),
(float)CONTAINER_BOX_SIZE_MIN, (float)CONTAINER_BOX_SIZE_MAX, 1.0, 0,
NULL, &(cfdata->data_picture_thumb_default_size),
80);
- e_widget_frametable_object_append(of, ob, 1, 3, 1, 1, 1, 0, 1, 0);
+ e_widget_frametable_object_append(of, ob, 1, 4, 1, 1, 1, 0, 1, 0);
ob = e_widget_check_add(evas, _("Remove created .e/e/backgrounds/"),
&(cfdata->sources_picture_set_bg_purge));
- e_widget_frametable_object_append(of, ob, 0, 4, 2, 1, 1, 1, 1, 1);
- ob = e_widget_check_add(evas, _("Show dEvian's logo in slideshow"),
&(cfdata->sources_picture_show_devian_pics));
e_widget_frametable_object_append(of, ob, 0, 5, 2, 1, 1, 1, 1, 1);
+ ob = e_widget_check_add(evas, _("Show dEvian's logo in slideshow"),
&(cfdata->sources_picture_show_devian_pics));
+ e_widget_frametable_object_append(of, ob, 0, 6, 2, 1, 1, 1, 1, 1);
e_widget_table_object_append(o, of, 1, 1, 1, 1, 1, 1, 1, 1);
#endif
#ifdef HAVE_FILE
===================================================================
RCS file: /cvs/e/e_modules/devian/src/module/e_mod_container_box.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -3 -r1.4 -r1.5
--- e_mod_container_box.c 14 Apr 2006 09:09:39 -0000 1.4
+++ e_mod_container_box.c 18 Apr 2006 08:08:22 -0000 1.5
@@ -996,7 +996,7 @@
}
if (!DEVIANF(source_evas_object_get) (devian, &source0, &source1))
- return 0;
+ return;
if (!strcmp(emission, "source_transition_0-1_end"))
{
===================================================================
RCS file: /cvs/e/e_modules/devian/src/module/e_mod_data_file.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -3 -r1.4 -r1.5
--- e_mod_data_file.c 14 Apr 2006 09:09:39 -0000 1.4
+++ e_mod_data_file.c 18 Apr 2006 08:08:22 -0000 1.5
@@ -119,7 +119,7 @@
tb = evas_object_textblock_add(DEVIANM->container->bg_evas);
tb_style = evas_textblock_style_new();
- evas_textblock_style_set(tb_style, "DEFAULT='font=Vera font_size=10
align=left color=#000000ff wrap=word'" "br='\n'");
+ evas_textblock_style_set(tb_style, "DEFAULT='font=Vera font_size=10
align=left color=#000000ff wrap=line'" "br='\n'");
/* evas_textblock_style_set(tb_style,
* style); */
evas_object_textblock_style_set(tb, tb_style);
@@ -165,25 +165,34 @@
while ( (size_left > 0) &&
(p2 = memchr(p1, '\n', size_left)) )
{
+ /* Add the position to the list */
+ pos = E_NEW(int, 1);
+ *pos = p2 - *buffer;
+ ecore_list_append(lines, pos);
+ printf("pos %d sizeleft %d (new %d) size %d (p1 %5.5s p2 %5.5s)\nBUF
:\n%s",
+ *pos, size_left, *size - (*pos +1), *size, p1, p2, *buffer);
+
/* Replace by <br> */
*size = *size + 3;
+ size_left = *size - (*pos + 4);
*buffer = realloc(*buffer, *size);
- memmove(p2 + 3, p2, strlen(p2) + 1);
+ p2 = *buffer + *pos; /* buffer has been changed, recal p2 */
+ if (size_left)
+ memmove(p2+4, p2+1, size_left);
*p2 = '<';
*(p2 + 1) = 'b';
*(p2 + 2) = 'r';
*(p2 + 3) = '>';
- /* Add the position to the list */
- pos = E_NEW(int, 1);
- *pos = p2 - *buffer;
- ecore_list_append(lines, pos);
-
/* Go to next char */
p1 = p2 + 4;
- size_left = *size - (*pos + 4);
};
+ /* Put a final \0 */
+ (*size)++;
+ *buffer = realloc(*buffer, *size);
+ (*buffer)[(*size)-1] = '\0';
+
return lines;
}
@@ -232,6 +241,7 @@
block_size = DATA_FILE_BUF_SIZE;
}
moves_back += block_size;
+ DDATAFILE(("read_first : blocksize %d beg %d", block_size, beg));
if (block_size)
{
@@ -245,9 +255,10 @@
E_FREE(block->buf); //....CHANGE delete block
return 0;
}
+ DDATAFILE(("read_first : NEW block buf : %s", block->buf));
block->retlines = _get_lines(&block->buf, &block->size);
- DDATAFILE(("read_first (%d lines, block_size %d, offset %d):\n%s",
- ecore_list_nodes(block->retlines), block_size,
ftell(source->fd), block->buf));
+ DDATAFILE(("get_lines : %d lines, block_size %d, offset
%d):\nblock buf : %s",
+ ecore_list_nodes(block->retlines), block->size,
ftell(source->fd), block->buf));
source->lines_tot += ecore_list_nodes(block->retlines);
source->new_blocks++;
@@ -257,7 +268,7 @@
fseek(source->fd, -(block_size * sizeof(char)), SEEK_CUR);
}
}
- while (block_size && (source->lines_tot <
DEVIANM->conf->sources_file_nb_lines_max));
+ while (block_size && (source->lines_tot <
DEVIANM->conf->sources_file_nb_lines_ini));
/* Repositioning to where we start reading */
fseek(source->fd, moves_back, SEEK_CUR);
@@ -282,15 +293,17 @@
if (!source->fd)
return 1;
- fflush(source->fd); //...REMOVE
+ //fflush(source->fd);
do
{
block_size = fread(buffer, sizeof(char), DATA_FILE_BUF_SIZE,
source->fd);
block_size = block_size * sizeof(char);
if (ferror(source->fd))
- DDATAFILE(("ERROR WHEN READING"));
- DDATAFILE(("read_update (offset %d):\n%s", ftell(source->fd), buffer));
+ {
+ DDATAFILE(("ERROR WHEN READING"));
+ }
+ DDATAFILE(("read_update (offset %d blocksize %d):\n%s",
ftell(source->fd), block_size, buffer));
if (block_size)
{
Data_File_Block *block;
@@ -332,11 +345,14 @@
{
block = ecore_list_next(source->blocks);
- cur = evas_object_textblock_cursor_get(source->obj_tb);
- evas_textblock_cursor_node_last((Evas_Textblock_Cursor *) cur);
+ //cur = evas_object_textblock_cursor_get(source->obj_tb);
+ //evas_textblock_cursor_node_last((Evas_Textblock_Cursor *) cur);
//evas_textblock_cursor_text_append((Evas_Textblock_Cursor *)cur,
block->buf);
buf = evas_object_textblock_text_markup_get(source->obj_tb);
- snprintf(buf2, sizeof(buf2), "%s%s", buf, block->buf);
+ if (!buf)
+ strncpy(buf2, block->buf, sizeof(buf2));
+ else
+ snprintf(buf2, sizeof(buf2), "%s%s", buf, block->buf);
evas_object_textblock_text_markup_set(source->obj_tb, buf2);
evas_object_textblock_size_formatted_get(source->obj_tb, &w, &h);
@@ -362,8 +378,8 @@
if (block->buf)
E_FREE(block->buf);
if (block->retlines)
- if (ecore_list_nodes(block->retlines))
- ecore_list_destroy(block->retlines);
+ if (!ecore_list_is_empty(block->retlines))
+ ecore_list_destroy(block->retlines);
E_FREE(block);
}
===================================================================
RCS file: /cvs/e/e_modules/devian/src/module/e_mod_data_picture.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -3 -r1.3 -r1.4
--- e_mod_data_picture.c 14 Apr 2006 09:09:39 -0000 1.3
+++ e_mod_data_picture.c 18 Apr 2006 08:08:22 -0000 1.4
@@ -434,6 +434,10 @@
strncpy(buf, file_tmp, sizeof(buf));
}
+ if (!DEVIANM->conf->sources_picture_data_import_hidden)
+ if (file[0] == '.')
+ continue;
+
if (recursive)
if (ecore_file_is_dir(buf))
{
===================================================================
RCS file: /cvs/e/e_modules/devian/src/module/e_mod_data_picture.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -3 -r1.3 -r1.4
--- e_mod_data_picture.h 14 Apr 2006 09:09:39 -0000 1.3
+++ e_mod_data_picture.h 18 Apr 2006 08:08:22 -0000 1.4
@@ -19,6 +19,8 @@
#define DATA_PICTURE_THUMB_SIZE_DEFAULT 300
#define DATA_PICTURE_CACHE_SIZE_DEFAULT 2
#define DATA_PICTURE_SHOW_DEVIAN_PICS_DEFAULT 1
+#define DATA_PICTURE_IMPORT_RECURSIVE_DEFAULT 0
+#define DATA_PICTURE_IMPORT_HIDDEN_DEFAULT 0
struct _Picture_List_Local
{
===================================================================
RCS file: /cvs/e/e_modules/devian/src/module/e_mod_source_file.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -3 -r1.4 -r1.5
--- e_mod_source_file.c 14 Apr 2006 09:09:39 -0000 1.4
+++ e_mod_source_file.c 18 Apr 2006 08:08:22 -0000 1.5
@@ -19,9 +19,8 @@
snprintf(buf, sizeof(buf),
_("<hilight>dEvian's Log feature isn't stable yet
!</hilight><br><br>"
- "This feature is disabled for the moment"));
+ "It's enabled for debugging purpose only"));
e_module_dialog_show(_(MODULE_NAME " Module error"), buf);
- return 0;
}
/* SOURCE_FILE IS NOT STABLE YET */
===================================================================
RCS file: /cvs/e/e_modules/devian/src/module/e_mod_source_picture.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -3 -r1.4 -r1.5
--- e_mod_source_picture.c 14 Apr 2006 09:09:39 -0000 1.4
+++ e_mod_source_picture.c 18 Apr 2006 08:08:22 -0000 1.5
@@ -179,10 +179,10 @@
{
Ecore_Exe *exe;
- snprintf(buf, 4096, "e17setroot -s %s", file);
+ snprintf(buf, 4096, "e17setroot -s \"%s\"", file);
DSOURCE(("Set background with %s", buf));
- exe = ecore_exe_run(buf, NULL);
- if (exe)
+ exe = ecore_exe_pipe_run(buf, ECORE_EXE_USE_SH, NULL);
+ if (exe > 0)
{
ecore_exe_free(exe);
if (DEVIANM->conf->sources_picture_set_bg_purge)
@@ -264,10 +264,10 @@
{
Ecore_Exe *exe;
- snprintf(buf, 4096, "%s %s", DEVIANM->conf->viewer_image, file);
+ snprintf(buf, 4096, "%s \"%s\"", DEVIANM->conf->viewer_image, file);
DSOURCE(("Viewer: %s", buf));
- exe = ecore_exe_run(buf, NULL);
- if (exe)
+ exe = ecore_exe_pipe_run(buf, ECORE_EXE_USE_SH, NULL);
+ if (exe > 0)
ecore_exe_free(exe);
}
else
-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
enlightenment-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs