<commit_before>#include "e.h"
#include "e_fm_device.h"
#include <sys/statvfs.h>
#ifdef HAVE_EMOTION
# include <Emotion.h>
#endif

#define FILEPREVIEW_TEXT_PREVIEW_SIZE 2048

typedef struct _E_Widget_Data E_Widget_Data;
struct _E_Widget_Data
{
   Evas_Object  *obj;
   Evas_Object  *o_preview_list;
   Evas_Object  *o_preview_preview_table;
   Evas_Object  *o_preview_properties_table;
   Evas_Object  *o_preview_scroll;
   Evas_Object  *o_preview_extra;
   Evas_Object  *o_preview_extra_entry;
   Evas_Object  *o_preview_size;
   Evas_Object  *o_preview_size_entry;
   Evas_Object  *o_preview_owner;
   Evas_Object  *o_preview_owner_entry;
   Evas_Object  *o_preview_perms;
   Evas_Object  *o_preview_perms_entry;
   Evas_Object  *o_preview_time;
   Evas_Object  *o_preview_time_entry;
   Evas_Object  *o_preview_preview;
   Evas_Object  *o_preview_scrollframe;
   Evas_Coord    preview_w, preview_h;
   int           w, h;
   Ecore_Thread *preview_text_file_thread;
   Eio_Monitor  *monitor;
   Eina_List    *handlers;
   char         *preview_extra_text;
   char         *preview_size_text;
   char         *preview_owner_text;
   char         *preview_perms_text;
   char         *preview_time_text;
   const char   *path;
   const char   *mime;
   double        vid_pct;
   Eina_Bool     mime_icon : 1;
   Eina_Bool     is_dir : 1;
   Eina_Bool     is_txt : 1;
   Eina_Bool     prev_is_fm : 1;
   Eina_Bool     prev_is_txt : 1;
   Eina_Bool     prev_is_video : 1;
};

static void  _e_wid_fprev_preview_update(void *data, Evas_Object *obj, void *event_info);
static void  _e_wid_fprev_preview_file(E_Widget_Data *wd);
static char *_e_wid_file_size_get(off_t st_size);
static char *_e_wid_file_user_get(uid_t st_uid);
static char *_e_wid_file_perms_get(mode_t st_mode, uid_t st_uid, gid_t gid);
static char *_e_wid_file_time_get(time_t st_modtime);
static void  _e_wid_fprev_img_update(E_Widget_Data *wd, const char *path, const char *key);
static void  _e_wid_del_hook(Evas_Object *obj);
static void  _e_wid_fprev_preview_reset(E_Widget_Data *wd);
static void  _e_wid_fprev_preview_txt(E_Widget_Data *wd);
static void  _e_wid_fprev_preview_fm(E_Widget_Data *wd);

static void
_e_wid_fprev_preview_update(void *data, Evas_Object *obj, void *event_info __UNUSED__)
{
   E_Widget_Data *wd;
   Evas_Object *o;
   char buf[256];
   int iw = 0, ih = 0;

   wd = data;
   if (evas_object_image_extension_can_load_get(wd->path))
     {
        o = evas_object_image_add(evas_object_evas_get(obj));
        evas_object_image_file_set(o, wd->path, NULL);
        evas_object_image_size_get(o, &iw, &ih);
        evas_object_del(o);
     }
   if ((iw > 0) && (ih > 0))
     {
        e_widget_label_text_set(wd->o_preview_extra, _("Resolution:"));
        snprintf(buf, sizeof(buf), _("%i×%i"), iw, ih);
        e_widget_entry_text_set(wd->o_preview_extra_entry, buf);
     }
   else if (wd->mime)
     {
        if (wd->mime_icon)
          {
             e_widget_label_text_set(wd->o_preview_extra, _("Mime-type:"));
             e_widget_entry_text_set(wd->o_preview_extra_entry, wd->mime);
          }
        else
          {
             const char *mime;
             Efreet_Desktop *ed = NULL;
             unsigned int size;
             char group[1024];
             Eina_Bool edj;

             wd->mime_icon = EINA_TRUE;
             size = wd->w;
             mime = e_util_mime_icon_get(wd->mime, size);
             if (mime)
               {
                  edj = eina_str_has_extension(mime, "edj");
                  if (edj)
                    snprintf(group, sizeof(group), "e/icons/fileman/mime/%s", wd->mime);
                  _e_wid_fprev_img_update(wd, mime, edj ? group : NULL);
                  return;
               }
             if (eina_str_has_extension(wd->path, "desktop"))
               {
                  ed = efreet_desktop_new(wd->path);
                  if (ed)
                    mime = efreet_icon_path_find(e_config->icon_theme, ed->icon, size);
               }
             if (!mime)
               mime = efreet_icon_path_find(e_config->icon_theme, "unknown", size);
             if (!mime)
               mime = efreet_icon_path_find(e_config->icon_theme, "text/plain", size);
             _e_wid_fprev_img_update(wd, mime, NULL);
             if (ed) efreet_desktop_free(ed);
          }
     }
   e_widget_table_object_repack(wd->o_preview_preview_table,
                                wd->o_preview_preview,
                                0, 0, 1, 1, 0, 0, 1, 1);
}

static void
_e_wid_fprev_img_update(E_Widget_Data *wd, const char *path, const char *key)
{
   if (!path) return;
   if (wd->is_dir || wd->is_txt) return;
   evas_object_smart_callback_del_full(wd->o_preview_preview, "preview_update", _e_wid_fprev_preview_update, wd);
   if (eina_str_has_extension(path, ".gif"))
     {
        e_widget_preview_file_set(wd->o_preview_preview, path, key);
        _e_wid_fprev_preview_update(wd, wd->o_preview_preview, NULL);
     }
   else if (eina_str_has_extension(path, ".edj"))
     {
        if (key)
          e_widget_preview_edje_set(wd->o_preview_preview, path, key);
        else
          {
             Eina_List *l;
             Eina_Stringshare *str;
             Eina_Bool set = EINA_FALSE;

             l = edje_file_collection_list(path);
             if (eina_list_count(l) < 2)
               {
                  e_widget_preview_thumb_set(wd->o_preview_preview, path, eina_list_data_get(l), wd->w, wd->h);
                  set = EINA_TRUE;
                  edje_file_collection_list_free(l), l = NULL;
               }
             EINA_LIST_FREE(l, str)
               {
                  Eina_Bool use = EINA_FALSE;

                  if (!strcmp(str, "icon")) use = EINA_TRUE;
                  else if (!strcmp(str, "e/desktop/background")) use = EINA_TRUE;
                  else if (!strcmp(str, "e/init/splash")) use = EINA_TRUE;

                  if (use)
                    {
                       e_widget_preview_thumb_set(wd->o_preview_preview, path, str, wd->w, wd->h);
                       set = EINA_TRUE;
                       break;
                    }
                  eina_stringshare_del(str);
               }
             if (!set)
               {
                  e_widget_preview_edje_set(wd->o_preview_preview, path, NULL);
                  _e_wid_fprev_preview_update(wd, wd->o_preview_preview, NULL);
               }
             if (l) edje_file_collection_list_free(l);
          }
     }
   else
     {
        e_widget_preview_thumb_set(wd->o_preview_preview, path, key, wd->w, wd->h);
        evas_object_smart_callback_add(wd->o_preview_preview, "preview_update", _e_wid_fprev_preview_update, wd);
     }
}

static void
_e_wid_fprev_clear_widgets(E_Widget_Data *wd)
{
#define CLRWID(xx) \
  do { if (wd->xx) { evas_object_del(wd->xx); wd->xx = NULL; } } while (0)

   CLRWID(o_preview_preview_table);
   CLRWID(o_preview_properties_table);
   CLRWID(o_preview_scroll);
   CLRWID(o_preview_extra);
   CLRWID(o_preview_extra_entry);
   CLRWID(o_preview_size);
   CLRWID(o_preview_size_entry);
   CLRWID(o_preview_owner);
   CLRWID(o_preview_owner_entry);
   CLRWID(o_preview_perms);
   CLRWID(o_preview_perms_entry);
   CLRWID(o_preview_time);
   CLRWID(o_preview_time_entry);
   CLRWID(o_preview_preview);
   CLRWID(o_preview_scrollframe);
   wd->is_dir = wd->is_txt = wd->prev_is_fm = wd->prev_is_video = EINA_FALSE;
   wd->vid_pct = 0;
   if (wd->preview_text_file_thread) ecore_thread_cancel(wd->preview_text_file_thread);
   wd->preview_text_file_thread = NULL;
}

#ifdef HAVE_EMOTION

static void
_e_wid_fprev_preview_video_position(E_Widget_Data *wd, Evas_Object *obj, void *event_info __UNUSED__)
{
   double t, tot, ratio;
   int iw, ih;
   Evas_Coord w, h, mw, mh, ow, oh;

   evas_object_geometry_get(wd->o_preview_preview, NULL, NULL, &ow, &oh);
   evas_object_geometry_get(wd->o_preview_properties_table, NULL, NULL, &w, &h);

   tot = emotion_object_play_length_get(obj);
   if (!tot) return;
   wd->vid_pct = t = (emotion_object_position_get(obj) * 100.0) / emotion_object_play_length_get(obj);
   e_widget_slider_value_double_set(wd->o_preview_time, t);

   if (w < 10) return;
   w -= 4;
   emotion_object_size_get(obj, &iw, &ih);
   ratio = emotion_object_ratio_get(obj);
   if (ratio > 0.0) iw = (ih * ratio) + 0.5;
   if (iw < 1) iw = 1;
   if (ih < 1) ih = 1;

   w = w;
   h = (w * ih) / iw;
   e_widget_preview_vsize_set(wd->o_preview_preview, w, h);
   if (h > oh)
     {
        w = (w * oh) / h;
        h = oh;
     }
   e_widget_size_min_set(wd->o_preview_preview, w, h);
   e_widget_table_object_repack(wd->o_preview_properties_table,
                                wd->o_preview_preview, 0, 0, 2, 2, 0, 0, 1, 1);
   e_widget_list_object_repack(wd->o_preview_list,
                               wd->o_preview_properties_table,
                               1, 1, 0.5);
   e_widget_size_min_get(wd->o_preview_list, &mw, &mh);
   e_widget_size_min_set(wd->obj, mw, mh);
}

static void
_e_wid_fprev_preview_video_opened(E_Widget_Data *wd, Evas_Object *obj, void *event_info __UNUSED__)
{
   e_widget_entry_text_set(wd->o_preview_extra_entry, e_util_time_str_get(emotion_object_play_length_get(obj)));
}

static void
_e_wid_fprev_preview_video_change(void *data, Evas_Object *obj)
{
   double pos, tot, t;

   tot = emotion_object_play_length_get(data);
   t = emotion_object_position_get(data);
   e_widget_slider_value_double_get(obj, &pos);
   pos = (pos * tot) / 100.0;
   t = pos - t;
   if (t < 0.0) t = -t;
   if (t > 0.25) emotion_object_position_set(data, pos);
}

static void
_e_wid_fprev_preview_video_widgets(E_Widget_Data *wd)
{
   Evas *evas = evas_object_evas_get(wd->obj);
   Evas_Object *o, *em;
   int mw, mh, y = 3;

   _e_wid_fprev_clear_widgets(wd);

   o = e_widget_table_add(evas, 0);
   wd->o_preview_properties_table = o;

#define WIDROW(lab, labob, entob, entw)                                           \
  do {                                                                            \
       o = e_widget_label_add(evas, lab);                                         \
       wd->labob = o;                                                             \
       e_widget_table_object_align_append(wd->o_preview_properties_table,         \
                                          wd->labob,                              \
                                          0, y, 1, 1, 0, 1, 0, 0, 1.0, 0.0);      \
       o = e_widget_entry_add(evas, &(wd->preview_extra_text), NULL, NULL, NULL); \
       e_widget_entry_readonly_set(o, 1);                                         \
       wd->entob = o;                                                             \
       e_widget_size_min_set(o, entw, -1);                                        \
       e_widget_table_object_align_append(wd->o_preview_properties_table,         \
                                          wd->entob,                              \
                                          1, y, 1, 1, 1, 1, 1, 0, 0.0, 0.0);      \
       y++;                                                                       \
    } while (0)

   o = e_widget_table_add(evas, 0);
   e_widget_size_min_set(o, wd->w, wd->h);
   e_widget_table_object_append(wd->o_preview_properties_table,
                                o, 0, 0, 2, 2, 1, 1, 1, 1);

   wd->o_preview_preview = e_widget_preview_add(evas, 4, 4);
   em = o = emotion_object_add(e_widget_preview_evas_get(wd->o_preview_preview));
   emotion_object_init(o, NULL);
   emotion_object_file_set(o, wd->path);
   emotion_object_play_set(o, EINA_TRUE);
   evas_object_size_hint_aspect_set(o, EVAS_ASPECT_CONTROL_BOTH, wd->w, wd->h);
   e_widget_preview_extern_object_set(wd->o_preview_preview, o);
   e_widget_table_object_append(wd->o_preview_properties_table,<commit_msg>fix emotion filepreview backend setting with 1.8<commit_after>#include "e.h"
#include "e_fm_device.h"
#include <sys/statvfs.h>
#ifdef HAVE_EMOTION
# include <Emotion.h>
#endif

#define FILEPREVIEW_TEXT_PREVIEW_SIZE 2048

typedef struct _E_Widget_Data E_Widget_Data;
struct _E_Widget_Data
{
   Evas_Object  *obj;
   Evas_Object  *o_preview_list;
   Evas_Object  *o_preview_preview_table;
   Evas_Object  *o_preview_properties_table;
   Evas_Object  *o_preview_scroll;
   Evas_Object  *o_preview_extra;
   Evas_Object  *o_preview_extra_entry;
   Evas_Object  *o_preview_size;
   Evas_Object  *o_preview_size_entry;
   Evas_Object  *o_preview_owner;
   Evas_Object  *o_preview_owner_entry;
   Evas_Object  *o_preview_perms;
   Evas_Object  *o_preview_perms_entry;
   Evas_Object  *o_preview_time;
   Evas_Object  *o_preview_time_entry;
   Evas_Object  *o_preview_preview;
   Evas_Object  *o_preview_scrollframe;
   Evas_Coord    preview_w, preview_h;
   int           w, h;
   Ecore_Thread *preview_text_file_thread;
   Eio_Monitor  *monitor;
   Eina_List    *handlers;
   char         *preview_extra_text;
   char         *preview_size_text;
   char         *preview_owner_text;
   char         *preview_perms_text;
   char         *preview_time_text;
   const char   *path;
   const char   *mime;
   double        vid_pct;
   Eina_Bool     mime_icon : 1;
   Eina_Bool     is_dir : 1;
   Eina_Bool     is_txt : 1;
   Eina_Bool     prev_is_fm : 1;
   Eina_Bool     prev_is_txt : 1;
   Eina_Bool     prev_is_video : 1;
};

static void  _e_wid_fprev_preview_update(void *data, Evas_Object *obj, void *event_info);
static void  _e_wid_fprev_preview_file(E_Widget_Data *wd);
static char *_e_wid_file_size_get(off_t st_size);
static char *_e_wid_file_user_get(uid_t st_uid);
static char *_e_wid_file_perms_get(mode_t st_mode, uid_t st_uid, gid_t gid);
static char *_e_wid_file_time_get(time_t st_modtime);
static void  _e_wid_fprev_img_update(E_Widget_Data *wd, const char *path, const char *key);
static void  _e_wid_del_hook(Evas_Object *obj);
static void  _e_wid_fprev_preview_reset(E_Widget_Data *wd);
static void  _e_wid_fprev_preview_txt(E_Widget_Data *wd);
static void  _e_wid_fprev_preview_fm(E_Widget_Data *wd);

static void
_e_wid_fprev_preview_update(void *data, Evas_Object *obj, void *event_info __UNUSED__)
{
   E_Widget_Data *wd;
   Evas_Object *o;
   char buf[256];
   int iw = 0, ih = 0;

   wd = data;
   if (evas_object_image_extension_can_load_get(wd->path))
     {
        o = evas_object_image_add(evas_object_evas_get(obj));
        evas_object_image_file_set(o, wd->path, NULL);
        evas_object_image_size_get(o, &iw, &ih);
        evas_object_del(o);
     }
   if ((iw > 0) && (ih > 0))
     {
        e_widget_label_text_set(wd->o_preview_extra, _("Resolution:"));
        snprintf(buf, sizeof(buf), _("%i×%i"), iw, ih);
        e_widget_entry_text_set(wd->o_preview_extra_entry, buf);
     }
   else if (wd->mime)
     {
        if (wd->mime_icon)
          {
             e_widget_label_text_set(wd->o_preview_extra, _("Mime-type:"));
             e_widget_entry_text_set(wd->o_preview_extra_entry, wd->mime);
          }
        else
          {
             const char *mime;
             Efreet_Desktop *ed = NULL;
             unsigned int size;
             char group[1024];
             Eina_Bool edj;

             wd->mime_icon = EINA_TRUE;
             size = wd->w;
             mime = e_util_mime_icon_get(wd->mime, size);
             if (mime)
               {
                  edj = eina_str_has_extension(mime, "edj");
                  if (edj)
                    snprintf(group, sizeof(group), "e/icons/fileman/mime/%s", wd->mime);
                  _e_wid_fprev_img_update(wd, mime, edj ? group : NULL);
                  return;
               }
             if (eina_str_has_extension(wd->path, "desktop"))
               {
                  ed = efreet_desktop_new(wd->path);
                  if (ed)
                    mime = efreet_icon_path_find(e_config->icon_theme, ed->icon, size);
               }
             if (!mime)
               mime = efreet_icon_path_find(e_config->icon_theme, "unknown", size);
             if (!mime)
               mime = efreet_icon_path_find(e_config->icon_theme, "text/plain", size);
             _e_wid_fprev_img_update(wd, mime, NULL);
             if (ed) efreet_desktop_free(ed);
          }
     }
   e_widget_table_object_repack(wd->o_preview_preview_table,
                                wd->o_preview_preview,
                                0, 0, 1, 1, 0, 0, 1, 1);
}

static void
_e_wid_fprev_img_update(E_Widget_Data *wd, const char *path, const char *key)
{
   if (!path) return;
   if (wd->is_dir || wd->is_txt) return;
   evas_object_smart_callback_del_full(wd->o_preview_preview, "preview_update", _e_wid_fprev_preview_update, wd);
   if (eina_str_has_extension(path, ".gif"))
     {
        e_widget_preview_file_set(wd->o_preview_preview, path, key);
        _e_wid_fprev_preview_update(wd, wd->o_preview_preview, NULL);
     }
   else if (eina_str_has_extension(path, ".edj"))
     {
        if (key)
          e_widget_preview_edje_set(wd->o_preview_preview, path, key);
        else
          {
             Eina_List *l;
             Eina_Stringshare *str;
             Eina_Bool set = EINA_FALSE;

             l = edje_file_collection_list(path);
             if (eina_list_count(l) < 2)
               {
                  e_widget_preview_thumb_set(wd->o_preview_preview, path, eina_list_data_get(l), wd->w, wd->h);
                  set = EINA_TRUE;
                  edje_file_collection_list_free(l), l = NULL;
               }
             EINA_LIST_FREE(l, str)
               {
                  Eina_Bool use = EINA_FALSE;

                  if (!strcmp(str, "icon")) use = EINA_TRUE;
                  else if (!strcmp(str, "e/desktop/background")) use = EINA_TRUE;
                  else if (!strcmp(str, "e/init/splash")) use = EINA_TRUE;

                  if (use)
                    {
                       e_widget_preview_thumb_set(wd->o_preview_preview, path, str, wd->w, wd->h);
                       set = EINA_TRUE;
                       break;
                    }
                  eina_stringshare_del(str);
               }
             if (!set)
               {
                  e_widget_preview_edje_set(wd->o_preview_preview, path, NULL);
                  _e_wid_fprev_preview_update(wd, wd->o_preview_preview, NULL);
               }
             if (l) edje_file_collection_list_free(l);
          }
     }
   else
     {
        e_widget_preview_thumb_set(wd->o_preview_preview, path, key, wd->w, wd->h);
        evas_object_smart_callback_add(wd->o_preview_preview, "preview_update", _e_wid_fprev_preview_update, wd);
     }
}

static void
_e_wid_fprev_clear_widgets(E_Widget_Data *wd)
{
#define CLRWID(xx) \
  do { if (wd->xx) { evas_object_del(wd->xx); wd->xx = NULL; } } while (0)

   CLRWID(o_preview_preview_table);
   CLRWID(o_preview_properties_table);
   CLRWID(o_preview_scroll);
   CLRWID(o_preview_extra);
   CLRWID(o_preview_extra_entry);
   CLRWID(o_preview_size);
   CLRWID(o_preview_size_entry);
   CLRWID(o_preview_owner);
   CLRWID(o_preview_owner_entry);
   CLRWID(o_preview_perms);
   CLRWID(o_preview_perms_entry);
   CLRWID(o_preview_time);
   CLRWID(o_preview_time_entry);
   CLRWID(o_preview_preview);
   CLRWID(o_preview_scrollframe);
   wd->is_dir = wd->is_txt = wd->prev_is_fm = wd->prev_is_video = EINA_FALSE;
   wd->vid_pct = 0;
   if (wd->preview_text_file_thread) ecore_thread_cancel(wd->preview_text_file_thread);
   wd->preview_text_file_thread = NULL;
}

#ifdef HAVE_EMOTION

static void
_e_wid_fprev_preview_video_position(E_Widget_Data *wd, Evas_Object *obj, void *event_info __UNUSED__)
{
   double t, tot, ratio;
   int iw, ih;
   Evas_Coord w, h, mw, mh, ow, oh;

   evas_object_geometry_get(wd->o_preview_preview, NULL, NULL, &ow, &oh);
   evas_object_geometry_get(wd->o_preview_properties_table, NULL, NULL, &w, &h);

   tot = emotion_object_play_length_get(obj);
   if (!tot) return;
   wd->vid_pct = t = (emotion_object_position_get(obj) * 100.0) / emotion_object_play_length_get(obj);
   e_widget_slider_value_double_set(wd->o_preview_time, t);

   if (w < 10) return;
   w -= 4;
   emotion_object_size_get(obj, &iw, &ih);
   ratio = emotion_object_ratio_get(obj);
   if (ratio > 0.0) iw = (ih * ratio) + 0.5;
   if (iw < 1) iw = 1;
   if (ih < 1) ih = 1;

   w = w;
   h = (w * ih) / iw;
   e_widget_preview_vsize_set(wd->o_preview_preview, w, h);
   if (h > oh)
     {
        w = (w * oh) / h;
        h = oh;
     }
   e_widget_size_min_set(wd->o_preview_preview, w, h);
   e_widget_table_object_repack(wd->o_preview_properties_table,
                                wd->o_preview_preview, 0, 0, 2, 2, 0, 0, 1, 1);
   e_widget_list_object_repack(wd->o_preview_list,
                               wd->o_preview_properties_table,
                               1, 1, 0.5);
   e_widget_size_min_get(wd->o_preview_list, &mw, &mh);
   e_widget_size_min_set(wd->obj, mw, mh);
}

static void
_e_wid_fprev_preview_video_opened(E_Widget_Data *wd, Evas_Object *obj, void *event_info __UNUSED__)
{
   e_widget_entry_text_set(wd->o_preview_extra_entry, e_util_time_str_get(emotion_object_play_length_get(obj)));
}

static void
_e_wid_fprev_preview_video_change(void *data, Evas_Object *obj)
{
   double pos, tot, t;

   tot = emotion_object_play_length_get(data);
   t = emotion_object_position_get(data);
   e_widget_slider_value_double_get(obj, &pos);
   pos = (pos * tot) / 100.0;
   t = pos - t;
   if (t < 0.0) t = -t;
   if (t > 0.25) emotion_object_position_set(data, pos);
}

static void
_e_wid_fprev_preview_video_widgets(E_Widget_Data *wd)
{
   Evas *evas = evas_object_evas_get(wd->obj);
   Evas_Object *o, *em;
   int mw, mh, y = 3;

   _e_wid_fprev_clear_widgets(wd);

   o = e_widget_table_add(evas, 0);
   wd->o_preview_properties_table = o;

#define WIDROW(lab, labob, entob, entw)                                           \
  do {                                                                            \
       o = e_widget_label_add(evas, lab);                                         \
       wd->labob = o;                                                             \
       e_widget_table_object_align_append(wd->o_preview_properties_table,         \
                                          wd->labob,                              \
                                          0, y, 1, 1, 0, 1, 0, 0, 1.0, 0.0);      \
       o = e_widget_entry_add(evas, &(wd->preview_extra_text), NULL, NULL, NULL); \
       e_widget_entry_readonly_set(o, 1);                                         \
       wd->entob = o;                                                             \
       e_widget_size_min_set(o, entw, -1);                                        \
       e_widget_table_object_align_append(wd->o_preview_properties_table,         \
                                          wd->entob,                              \
                                          1, y, 1, 1, 1, 1, 1, 0, 0.0, 0.0);      \
       y++;                                                                       \
    } while (0)

   o = e_widget_table_add(evas, 0);
   e_widget_size_min_set(o, wd->w, wd->h);
   e_widget_table_object_append(wd->o_preview_properties_table,
                                o, 0, 0, 2, 2, 1, 1, 1, 1);

   wd->o_preview_preview = e_widget_preview_add(evas, 4, 4);
   em = o = emotion_object_add(e_widget_preview_evas_get(wd->o_preview_preview));
#if (EMOTION_VERSION_MAJOR > 1) || (EMOTION_VERSION_MINOR >= 8)
   emotion_object_init(o, "vlc");
#else
   emotion_object_init(o, NULL);
#endif
   emotion_object_file_set(o, wd->path);
   emotion_object_play_set(o, EINA_TRUE);
   evas_object_size_hint_aspect_set(o, EVAS_ASPECT_CONTROL_BOTH, wd->w, wd->h);
   e_widget_preview_extern_object_set(wd->o_preview_preview, o);
   e_widget_table_object_append(wd->o_preview_properties_table,
{'fraction_non_alphanumeric': 0.10395541774909914, 'fraction_numerical': 0.009050532137769211, 'mean_word_length': 2.233572686627828, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 183, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 54, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4601795', 'n_tokens_mistral': 8916, 'n_tokens_neox': 8541, 'n_words': 1452}