This is an automated email from the git hooks/post-receive script.

git pushed a commit to branch master
in repository efm2.

View the commit online.

commit 2d76eb58472ef439380d454739933586b349ffb5
Author: Carsten Haitzler (Rasterman) <ras...@rasterman.com>
AuthorDate: Tue Jan 23 14:37:57 2024 +0000

    go to a tradidional multi-object build and no include of c src
    
    this undoes some early hacking about i did to be cleaner
---
 src/efm/bitmap.c       |  18 +--
 src/efm/bitmap.h       |  10 ++
 src/efm/efm.c          | 324 +++++++++++++++++++++++--------------------------
 src/efm/efm_back_end.c |  22 ++--
 src/efm/efm_back_end.h |  14 +++
 src/efm/efm_custom.c   |  23 ++--
 src/efm/efm_custom.h   |  12 ++
 src/efm/efm_dnd.c      |  10 +-
 src/efm/efm_dnd.h      |   9 ++
 src/efm/efm_private.h  |  63 ++++------
 src/efm/efm_structs.h  |   8 ++
 src/efm/efm_util.c     |  67 +++++-----
 src/efm/efm_util.h     |  51 ++++++++
 src/efm/meson.build    |   5 +
 14 files changed, 366 insertions(+), 270 deletions(-)

diff --git a/src/efm/bitmap.c b/src/efm/bitmap.c
index f47c232..2ece32d 100644
--- a/src/efm/bitmap.c
+++ b/src/efm/bitmap.c
@@ -1,17 +1,21 @@
+#include <Eina.h>
+
+#include "bitmap.h"
+
 // bitmap code - must be a multiple of 32 wide - assumed.
-static void
+void
 _bitmap_free(unsigned int *bitmap)
 {
   free(bitmap);
 }
 
-static void
+void
 _bitmap_clear(unsigned int *bitmap, int szw, int szh)
 {
   memset(bitmap, 0, ((szw / 32) * szh) * sizeof(unsigned int));
 }
 
-static unsigned int *
+unsigned int *
 _bitmap_resize(unsigned int *bitmap, int szw, int szh, int nszw, int nszh)
 { // alloc a new sized bitmap and copy current content into new one
   // guaranteeing "new" space is zero'd out if there is new empty space
@@ -123,7 +127,7 @@ _bitmap_run_fill(unsigned int *row, int bit, int w)
     }
 }
 
-static void
+void
 _bitmap_fill(unsigned int *bitmap, int szw, int szh EINA_UNUSED, int x, int y,
              int w, int h)
 { // fill a region in the bitmap with 1's
@@ -182,9 +186,9 @@ _bitmap_is_clear(unsigned int *bitmap, int szw, int szh EINA_UNUSED, int x,
   return EINA_TRUE;
 }
 
-static void
-_bitmap_find_tl_to_br(unsigned int *bitmap, int maxw, int szw, int szh, int inw,
-                      int inh, int *x, int *y, int *w, int *h)
+void
+_bitmap_find_tl_to_br(unsigned int *bitmap, int maxw, int szw, int szh,
+                      int inw, int inh, int *x, int *y, int *w, int *h)
 {
   int xx, yy, ww, hh;
 
diff --git a/src/efm/bitmap.h b/src/efm/bitmap.h
new file mode 100644
index 0000000..96452b5
--- /dev/null
+++ b/src/efm/bitmap.h
@@ -0,0 +1,10 @@
+#ifndef BITMAP_H
+#define BITMAP_H 1
+
+void _bitmap_free(unsigned int *bitmap);
+void _bitmap_clear(unsigned int *bitmap, int szw, int szh);
+unsigned int *_bitmap_resize(unsigned int *bitmap, int szw, int szh, int nszw, int nszh);
+void _bitmap_fill(unsigned int *bitmap, int szw, int szh EINA_UNUSED, int x, int y, int w, int h);
+void _bitmap_find_tl_to_br(unsigned int *bitmap, int maxw, int szw, int szh, int inw, int inh, int *x, int *y, int *w, int *h);
+
+#endif
diff --git a/src/efm/efm.c b/src/efm/efm.c
index 3ffdd1d..1cf2298 100644
--- a/src/efm/efm.c
+++ b/src/efm/efm.c
@@ -5,38 +5,21 @@
 //
 // maximum # of files in a dir that is sane: 10,000
 // maximum number of files in a dir on a real system to be fast with: 3,000
+#include "cmd.h"
 #include "efm.h"
 #include "efm_icon.h"
 #include "efm_graph.h"
-#include "cmd.h"
-#include "sort.h"
-
-// maximum number of icons in a block
-#define BLOCK_MAX            64
-#define SCROLL_SEL_TIMER     0.2
-#define SCROLL_DND_TIMER     0.2
-#define FOCUS_ANIM_TIME      0.2
-#define DND_OVER_OPEN_TIMER  1.0
-#define ICON_LONGPRESS_TIMER 1.0
-
-#define INVALID -999999
-
-typedef enum
-{
-  EFM_FOCUS_DIR_UP,
-  EFM_FOCUS_DIR_DOWN,
-  EFM_FOCUS_DIR_LEFT,
-  EFM_FOCUS_DIR_RIGHT,
-  EFM_FOCUS_DIR_PGDN,
-  EFM_FOCUS_DIR_PGUP
-} Efm_Focus_Dir;
-
-#include "efm_structs.h"
+#include "efm_util.h"
+#include "efm_dnd.h"
+#include "efm_back_end.h"
+#include "efm_custom.h"
+#include "efm_private.h"
 
 int _log_dom = -1;
 
-static Eina_List       *_pending_exe_dels = NULL;
-static Eina_List       *_efm_list         = NULL;
+Eina_List       *_efm_list         = NULL;
+Eina_List       *_pending_exe_dels = NULL;
+
 static Evas_Smart      *_smart            = NULL;
 static Evas_Smart_Class _sc               = EVAS_SMART_CLASS_INIT_NULL;
 static Evas_Smart_Class _sc_parent        = EVAS_SMART_CLASS_INIT_NULL;
@@ -45,12 +28,8 @@ static Evas_Smart_Class _sc_parent        = EVAS_SMART_CLASS_INIT_NULL;
   Smart_Data *sd = evas_object_smart_data_get(obj); \
   if (!sd) return
 
-#include "efm_private.h"
-#include "efm_back_end.c"
-#include "efm_util.c"
-#include "efm_dnd.c"
-
-  static void _cb_header_change(void *data)
+void
+_cb_header_change(void *data)
 {
   Smart_Data *sd = data;
 
@@ -507,22 +486,34 @@ _cb_back_mouse_move(void *data, Evas *e EINA_UNUSED,
 }
 
 static void
-_redo_detail_sizes(Smart_Data *sd)
+_reposition_detail_header_items(Smart_Data *sd)
 {
-  Evas_Object *o;
-  char buf[128];
-  int i;
+  int        i, vw, vh;
+  Evas_Coord det_x, det_w, x, w, xp = 0;
 
-  for (i = 0; i < 6; i++)
+  if (!sd->o_detail_header) return;
+  if (!sd->o_overlay_grid) return;
+  evas_object_geometry_get(sd->o_overlay_grid, &det_x, NULL, &det_w, NULL);
+  elm_grid_size_get(sd->o_overlay_grid, &vw, &vh);
+  elm_grid_size_set(sd->o_detail_header, vw, 100);
+  for (i = 0; i < 7; i++)
     {
-      o = sd->o_list_detail_swallow[i];
-      snprintf(buf, sizeof(buf), "e.swallow.detail%i", i + 1);
-      evas_object_size_hint_min_set
-        (o, sd->config.detail_min_w[i] * _scale_get(sd), 0);
-      edje_object_part_swallow(sd->o_list_detailed_dummy, buf, o);
+      if (i < 6)
+        {
+          if (!sd->o_list_detail[i]) continue;
+          elm_grid_pack_get(sd->o_list_detail[i], &x, NULL, NULL, NULL);
+          w = (x - xp);
+        }
+      else
+        {
+          w = vw - xp;
+          x = xp + w;
+        }
+      if (!sd->o_detail_header_item[i]) continue;
+      elm_grid_pack(sd->o_detail_header, sd->o_detail_header_item[i], xp, 0, w,
+                    100);
+      xp = x;
     }
-  _reposition_detail_bars(sd);
-  _detail_realized_items_resize(sd);
 }
 
 static void
@@ -543,6 +534,25 @@ _reposition_detail_bars(Smart_Data *sd)
   _reposition_detail_header_items(sd);
 }
 
+void
+_redo_detail_sizes(Smart_Data *sd)
+{
+  Evas_Object *o;
+  char buf[128];
+  int i;
+
+  for (i = 0; i < 6; i++)
+    {
+      o = sd->o_list_detail_swallow[i];
+      snprintf(buf, sizeof(buf), "e.swallow.detail%i", i + 1);
+      evas_object_size_hint_min_set
+        (o, sd->config.detail_min_w[i] * _scale_get(sd), 0);
+      edje_object_part_swallow(sd->o_list_detailed_dummy, buf, o);
+    }
+  _reposition_detail_bars(sd);
+  _detail_realized_items_resize(sd);
+}
+
 static void
 _cb_overlay_detail_swallow_move(void *data, Evas *e EINA_UNUSED,
                                 Evas_Object *obj EINA_UNUSED,
@@ -734,6 +744,15 @@ _add_overlay_objects(Smart_Data *sd)
     }
 }
 
+static void
+_cb_canvas_resize(void *data, Evas *e EINA_UNUSED, void *event_info EINA_UNUSED)
+{ // canvas resized and so handle so new visible icons are visible etc.
+  Smart_Data  *sd  = data;
+  Evas_Object *obj = sd->o_smart;
+
+  evas_object_smart_changed(obj);
+}
+
 // gui code
 static void
 _smart_add(Evas_Object *obj)
@@ -1053,15 +1072,6 @@ _smart_resize(Evas_Object *obj, Evas_Coord w, Evas_Coord h)
     }
 }
 
-static void
-_cb_canvas_resize(void *data, Evas *e EINA_UNUSED, void *event_info EINA_UNUSED)
-{ // canvas resized and so handle so new visible icons are visible etc.
-  Smart_Data  *sd  = data;
-  Evas_Object *obj = sd->o_smart;
-
-  evas_object_smart_changed(obj);
-}
-
 static void
 _layout_bounds_increase(Eina_Rectangle *bounds, Eina_Rectangle *newrect)
 {
@@ -1121,8 +1131,90 @@ _relayout_icons(Smart_Data *sd)
   evas_object_size_hint_min_set(sd->o_smart, sd->icon_min_w, minh);
 }
 
-// just breaking out to another file simply
-#include "efm_custom.c"
+static void
+_recalc(Smart_Data *sd)
+{ // recalc position of icons and which may or may not be visible now
+  Eina_List     *bl, *il;
+  Block         *block;
+  Icon          *icon;
+  Eina_Rectangle viewport, rect;
+  Evas          *e;
+  int            num = 0;
+  const char    *theme_edj_file;
+
+  e = evas_object_evas_get(sd->o_smart);
+  evas_output_viewport_get(e, &(viewport.x), &(viewport.y), &(viewport.w),
+                           &(viewport.h));
+  theme_edj_file
+    = elm_theme_group_path_find(NULL, "e/fileman/default/icon/fixed");
+  EINA_LIST_FOREACH(sd->blocks, bl, block)
+  { // walk all our blocks and per clock ... is that block visible
+    rect = block->bounds;
+    rect.x += sd->geom.x;
+    rect.y += sd->geom.y;
+    if (eina_rectangles_intersect(&rect, &viewport))
+      { // if the block intersects the viewport, then look into it
+        // check all the icon to see if each is visible
+        EINA_LIST_FOREACH(block->icons, il, icon)
+        { // check each icon...
+          rect = icon->geom;
+          rect.x += sd->geom.x;
+          rect.y += sd->geom.y;
+          // if the icon is within the viewport ...
+          if (eina_rectangles_intersect(&rect, &viewport))
+            { // we are within vierwport - so could be visible
+              if (icon->changed)
+                { // icon changed - let's redo it, so del the old
+                  _icon_object_clear(icon);
+                }
+              icon->changed = EINA_FALSE;
+              // no icon yet ... it needs to be created
+              if (!icon->o_base)
+                { // no object - let's create one
+                  // about to realize if it hasn't been
+                  if (!icon->realized) icon->block->realized_num++;
+                  _icon_object_add(icon, sd, e, theme_edj_file, EINA_TRUE, num);
+                }
+              // position the icon object where it should be
+              evas_object_geometry_set(icon->o_base, rect.x, rect.y, rect.w,
+                                       rect.h);
+              if (icon->over)
+                evas_object_geometry_set(icon->sd->o_over, rect.x, rect.y,
+                                         rect.w, rect.h);
+            }
+          else
+            { // icon not in viewport
+              if (icon->realized)
+                { // it's realized so unrealize it
+                  icon->realized = EINA_FALSE;
+                  icon->block->realized_num--;
+                  _icon_object_clear(icon);
+                }
+            }
+          num++;
+        }
+      }
+    else if (block->realized_num > 0)
+      { // block is realized but NOT in the viewport (not visible)
+        EINA_LIST_FOREACH(block->icons, il, icon)
+        { // go through each icon now
+          if (icon->realized)
+            { // if the icon was realized then unrealize it
+              if (icon->realized) block->realized_num--;
+              icon->realized = EINA_FALSE;
+              _icon_object_clear(icon);
+            }
+        }
+        num += eina_list_count(block->icons);
+      }
+    else num += eina_list_count(block->icons);
+  }
+
+  evas_object_geometry_set(sd->o_back, sd->geom.x, sd->geom.y, sd->geom.w,
+                           sd->geom.h);
+  _efm_focus_position(sd);
+  _efm_sel_position(sd);
+}
 
 static void
 _listing_do(Smart_Data *sd)
@@ -1135,7 +1227,7 @@ _listing_do(Smart_Data *sd)
     }
 }
 
-static void
+void
 _listing_done(Smart_Data *sd)
 {
   printf("ZZZ: LISTING DONE -----------------------------------------\n");
@@ -1254,92 +1346,7 @@ _relayout(Smart_Data *sd)
     _relayout_list(sd);
 }
 
-static void
-_recalc(Smart_Data *sd)
-{ // recalc position of icons and which may or may not be visible now
-  Eina_List     *bl, *il;
-  Block         *block;
-  Icon          *icon;
-  Eina_Rectangle viewport, rect;
-  Evas          *e;
-  int            num = 0;
-  const char    *theme_edj_file;
-
-  e = evas_object_evas_get(sd->o_smart);
-  evas_output_viewport_get(e, &(viewport.x), &(viewport.y), &(viewport.w),
-                           &(viewport.h));
-  theme_edj_file
-    = elm_theme_group_path_find(NULL, "e/fileman/default/icon/fixed");
-  EINA_LIST_FOREACH(sd->blocks, bl, block)
-  { // walk all our blocks and per clock ... is that block visible
-    rect = block->bounds;
-    rect.x += sd->geom.x;
-    rect.y += sd->geom.y;
-    if (eina_rectangles_intersect(&rect, &viewport))
-      { // if the block intersects the viewport, then look into it
-        // check all the icon to see if each is visible
-        EINA_LIST_FOREACH(block->icons, il, icon)
-        { // check each icon...
-          rect = icon->geom;
-          rect.x += sd->geom.x;
-          rect.y += sd->geom.y;
-          // if the icon is within the viewport ...
-          if (eina_rectangles_intersect(&rect, &viewport))
-            { // we are within vierwport - so could be visible
-              if (icon->changed)
-                { // icon changed - let's redo it, so del the old
-                  _icon_object_clear(icon);
-                }
-              icon->changed = EINA_FALSE;
-              // no icon yet ... it needs to be created
-              if (!icon->o_base)
-                { // no object - let's create one
-                  // about to realize if it hasn't been
-                  if (!icon->realized) icon->block->realized_num++;
-                  _icon_object_add(icon, sd, e, theme_edj_file, EINA_TRUE, num);
-                }
-              // position the icon object where it should be
-              evas_object_geometry_set(icon->o_base, rect.x, rect.y, rect.w,
-                                       rect.h);
-              if (icon->over)
-                evas_object_geometry_set(icon->sd->o_over, rect.x, rect.y,
-                                         rect.w, rect.h);
-            }
-          else
-            { // icon not in viewport
-              if (icon->realized)
-                { // it's realized so unrealize it
-                  icon->realized = EINA_FALSE;
-                  icon->block->realized_num--;
-                  _icon_object_clear(icon);
-                }
-            }
-          num++;
-        }
-      }
-    else if (block->realized_num > 0)
-      { // block is realized but NOT in the viewport (not visible)
-        EINA_LIST_FOREACH(block->icons, il, icon)
-        { // go through each icon now
-          if (icon->realized)
-            { // if the icon was realized then unrealize it
-              if (icon->realized) block->realized_num--;
-              icon->realized = EINA_FALSE;
-              _icon_object_clear(icon);
-            }
-        }
-        num += eina_list_count(block->icons);
-      }
-    else num += eina_list_count(block->icons);
-  }
-
-  evas_object_geometry_set(sd->o_back, sd->geom.x, sd->geom.y, sd->geom.w,
-                           sd->geom.h);
-  _efm_focus_position(sd);
-  _efm_sel_position(sd);
-}
-
-static void
+void
 _reset(Smart_Data *sd)
 {
   Eina_Strbuf *buf;
@@ -1491,37 +1498,6 @@ efm_add(Evas_Object *parent)
   return evas_object_smart_add(evas_object_evas_get(parent), _smart);
 }
 
-static void
-_reposition_detail_header_items(Smart_Data *sd)
-{
-  int        i, vw, vh;
-  Evas_Coord det_x, det_w, x, w, xp = 0;
-
-  if (!sd->o_detail_header) return;
-  if (!sd->o_overlay_grid) return;
-  evas_object_geometry_get(sd->o_overlay_grid, &det_x, NULL, &det_w, NULL);
-  elm_grid_size_get(sd->o_overlay_grid, &vw, &vh);
-  elm_grid_size_set(sd->o_detail_header, vw, 100);
-  for (i = 0; i < 7; i++)
-    {
-      if (i < 6)
-        {
-          if (!sd->o_list_detail[i]) continue;
-          elm_grid_pack_get(sd->o_list_detail[i], &x, NULL, NULL, NULL);
-          w = (x - xp);
-        }
-      else
-        {
-          w = vw - xp;
-          x = xp + w;
-        }
-      if (!sd->o_detail_header_item[i]) continue;
-      elm_grid_pack(sd->o_detail_header, sd->o_detail_header_item[i], xp, 0, w,
-                    100);
-      xp = x;
-    }
-}
-
 static void
 _cb_detail_header_resize(void *data, Evas *e EINA_UNUSED,
                          Evas_Object *obj EINA_UNUSED, void *info EINA_UNUSED)
@@ -1750,7 +1726,7 @@ efm_detail_header_get(Evas_Object *obj)
 }
 
 ////////
-static char *
+char *
 _sanitize_dir(const char *path)
 { // sanitize path to remove multiple / chars like //usr/bin or /usr///bin
   const char *p, *pp;
diff --git a/src/efm/efm_back_end.c b/src/efm/efm_back_end.c
index ae89bc6..660f974 100644
--- a/src/efm/efm_back_end.c
+++ b/src/efm/efm_back_end.c
@@ -1,5 +1,11 @@
-#include "eina_types.h"
-static void
+#include "cmd.h"
+#include "sort.h"
+#include "efm.h"
+#include "efm_util.h"
+#include "efm_back_end.h"
+#include "efm_private.h"
+
+void
 _size_message(Evas_Object *o, double v)
 {
   Edje_Message_Float msg;
@@ -153,7 +159,7 @@ _process(Smart_Data_Thread *std, Ecore_Thread *th, Eina_List *batch)
   if (batch_new) ecore_thread_feedback(th, batch_new);
 }
 
-static Eina_Bool
+Eina_Bool
 _cb_exe_del(void *data, int ev_type EINA_UNUSED, void *event)
 {
   Smart_Data          *sd = data;
@@ -187,7 +193,7 @@ _cb_exe_del(void *data, int ev_type EINA_UNUSED, void *event)
   return ECORE_CALLBACK_PASS_ON;
 }
 
-static Eina_Bool
+Eina_Bool
 _cb_exe_data(void *data, int ev_type EINA_UNUSED, void *event)
 {
   Smart_Data           *sd = data;
@@ -201,7 +207,7 @@ _cb_exe_data(void *data, int ev_type EINA_UNUSED, void *event)
   return ECORE_CALLBACK_DONE;
 }
 
-static Eina_Bool
+Eina_Bool
 _cb_exe_pending_timer(void *data)
 { // timeout trying to kill off back-end open process
   Pending_Exe_Del *pend = data;
@@ -217,7 +223,7 @@ _cb_exe_pending_timer(void *data)
   return EINA_FALSE;
 }
 
-static void
+void
 _cb_thread_main(void *data, Ecore_Thread *th)
 { // thread sits processing commands read from stdout from the back-end open
   Smart_Data_Thread *std = data;
@@ -397,7 +403,7 @@ _cb_smart_timer(void *data)
   return EINA_FALSE;
 }
 
-static void
+void
 _cb_thread_notify(void *data, Ecore_Thread *th EINA_UNUSED, void *msg)
 { // handle data from the view thread to the UI - this will be a batch of cmds
   Smart_Data_Thread *std   = data;
@@ -832,7 +838,7 @@ _cb_thread_notify(void *data, Ecore_Thread *th EINA_UNUSED, void *msg)
   sd->reblock_job = ecore_job_add(_cb_reblock, sd);
 }
 
-static void
+void
 _cb_thread_done(void *data, Ecore_Thread *th EINA_UNUSED)
 {
   Smart_Data_Thread *std = data;
diff --git a/src/efm/efm_back_end.h b/src/efm/efm_back_end.h
new file mode 100644
index 0000000..9d697c5
--- /dev/null
+++ b/src/efm/efm_back_end.h
@@ -0,0 +1,14 @@
+#ifndef EFM_BACK_END_H
+#define EFM_BACK_END_H 1
+
+#include <Elementary.h>
+
+void _size_message(Evas_Object *o, double v);
+Eina_Bool _cb_exe_del(void *data, int ev_type EINA_UNUSED, void *event);
+Eina_Bool _cb_exe_data(void *data, int ev_type EINA_UNUSED, void *event);
+Eina_Bool _cb_exe_pending_timer(void *data);
+void _cb_thread_main(void *data, Ecore_Thread *th);
+void _cb_thread_notify(void *data, Ecore_Thread *th EINA_UNUSED, void *msg);
+void _cb_thread_done(void *data, Ecore_Thread *th EINA_UNUSED);
+
+#endif
diff --git a/src/efm/efm_custom.c b/src/efm/efm_custom.c
index 6698eda..b477273 100644
--- a/src/efm/efm_custom.c
+++ b/src/efm/efm_custom.c
@@ -1,3 +1,12 @@
+#include "cmd.h"
+#include "efm.h"
+#include "efm_util.h"
+#include "efm_custom.h"
+
+#include "bitmap.h"
+
+#define INVALID -999999
+
 typedef struct
 {
   int alloc_w, alloc_h; // size of tile region allocated to allow growth
@@ -7,11 +16,7 @@ typedef struct
 
 ////////////////////////////////////////////////////////////////////////////
 
-#include "bitmap.c"
-
-////////////////////////////////////////////////////////////////////////////
-
-static void
+void
 _icon_custom_data_free(Smart_Data *sd)
 { // free custom data
   Custom_Data *cd = sd->custom_data;
@@ -102,7 +107,7 @@ _icon_custom_data_resize(Smart_Data *sd, int w, int h)
   cd->alloc_h = alloc_h;
 }
 
-static void
+void
 _icon_custom_data_bitmap_clear(Smart_Data *sd)
 { // set all of the bitmap to 0
   Custom_Data *cd = sd->custom_data;
@@ -147,7 +152,7 @@ _icon_custom_data_bitmap_fill(Smart_Data *sd, int x, int y, int w, int h)
   _bitmap_fill(cd->bitmap, cd->alloc_w, cd->alloc_h, x, y, w, h);
 }
 
-static void
+void
 _icon_custom_data_all_icons_fill(Smart_Data *sd)
 { // fill in all placed icons in custom data bitmap
   Eina_List *l;
@@ -195,7 +200,7 @@ _icon_custom_data_tl_to_br_find(Smart_Data *sd, int *x, int *y, int *w, int *h)
 
 //////////////////////////////////////////////////////////////////////////////
 
-static void
+void
 _icon_custom_position_find(Icon *icon)
 { // allocate a spot for this icon as we don't have it stored
   Eina_Rectangle geom = icon->geom;
@@ -211,7 +216,7 @@ _icon_custom_position_find(Icon *icon)
   icon->geom = geom;
 }
 
-static void
+void
 _icon_custom_position_placed(Icon *icon)
 {
   _icon_custom_data_bitmap_fill(icon->block->sd, icon->geom.x, icon->geom.y,
diff --git a/src/efm/efm_custom.h b/src/efm/efm_custom.h
new file mode 100644
index 0000000..6831430
--- /dev/null
+++ b/src/efm/efm_custom.h
@@ -0,0 +1,12 @@
+#ifndef EFM_CUSTOM_H
+#define EFM_CUSTOM_H 1
+
+#include <Elementary.h>
+
+void _icon_custom_data_free(Smart_Data *sd);
+void _icon_custom_position_find(Icon *icon);
+void _icon_custom_data_all_icons_fill(Smart_Data *sd);
+void _icon_custom_position_placed(Icon *icon);
+void _icon_custom_data_bitmap_clear(Smart_Data *sd);
+
+#endif
diff --git a/src/efm/efm_dnd.c b/src/efm/efm_dnd.c
index 6dade22..b4fe894 100644
--- a/src/efm/efm_dnd.c
+++ b/src/efm/efm_dnd.c
@@ -1,3 +1,9 @@
+#include "cmd.h"
+#include "efm.h"
+#include "efm_util.h"
+#include "efm_dnd.h"
+#include "efm_private.h"
+
 // utils for draga and drop handling
 static Eina_Bool
 _cb_dnd_scroll_timer(void *data)
@@ -249,7 +255,7 @@ err:
   return EINA_TRUE;
 }
 
-static void
+void
 _drop_init(Smart_Data *sd)
 { // called once we have our elm scroller around our file view
   elm_drop_target_add(sd->o_scroller, ELM_SEL_FORMAT_URILIST, _cb_drop_in, sd,
@@ -344,7 +350,7 @@ _cb_drag_done(void *data, Evas_Object *obj_drag EINA_UNUSED)
   _icon_free(icon);
 }
 
-static void
+void
 _drag_start(Icon *icon)
 {
   Eina_Strbuf *strbuf;
diff --git a/src/efm/efm_dnd.h b/src/efm/efm_dnd.h
new file mode 100644
index 0000000..de787d5
--- /dev/null
+++ b/src/efm/efm_dnd.h
@@ -0,0 +1,9 @@
+#ifndef EFM_DND_H
+#define EFM_DND_H 1
+
+#include <Elementary.h>
+
+void _drop_init(Smart_Data *sd);
+void _drag_start(Icon *icon);
+
+#endif
diff --git a/src/efm/efm_private.h b/src/efm/efm_private.h
index c61bf3b..645613e 100644
--- a/src/efm/efm_private.h
+++ b/src/efm/efm_private.h
@@ -1,49 +1,30 @@
-// functions used between the split up parts of the efm view
+#ifndef EFM_PRIVATE_H
+#define EFM_PRIVATE_H 1
 
-static void _cb_canvas_resize(void *data, Evas *e,
-                              void *event_info EINA_UNUSED);
-static void _reposition_detail_header_items(Smart_Data *sd);
-static void _recalc(Smart_Data *sd);
-static void _redo_detail_sizes(Smart_Data *sd);
-static void _reposition_detail_bars(Smart_Data *sd);
-static void _detail_realized_items_resize(Smart_Data *sd);
-static void _icon_path_cmd_strbuf_append(Eina_Strbuf *strbuf, const char *key,
-                                         Smart_Data *sd, Icon *icon);
+#include <Elementary.h>
 
-static void _cb_header_change(void *data);
+#define INVALID -999999
+#define SCROLL_SEL_TIMER     0.2
+#define SCROLL_DND_TIMER     0.2
+#define BLOCK_MAX            64
+#define FOCUS_ANIM_TIME      0.2
+#define DND_OVER_OPEN_TIMER  1.0
+#define ICON_LONGPRESS_TIMER 1.0
 
-static void   _listing_do(Smart_Data *sd);
-static void   _listing_done(Smart_Data *sd);
-static double _scale_get(Smart_Data *sd);
+#define ENTRY                                        \
+   Smart_Data *sd = evas_object_smart_data_get(obj); \
+   if (!sd) return
 
-static void _command(Smart_Data *sd, const char *cmd);
-static void _process(Smart_Data_Thread *std, Ecore_Thread *th,
-                     Eina_List *batch);
+void _listing_done(Smart_Data *sd);
+void _cb_header_change(void *data);
+void _reset(Smart_Data *sd);
+void _redo_detail_sizes(Smart_Data *sd);
+char *_sanitize_dir(const char *path);
+void _cb_header_change(void *data);
 
-static Eina_Bool _cb_exe_del(void *data, int ev_type EINA_UNUSED, void *event);
-static Eina_Bool _cb_exe_data(void *data, int ev_type EINA_UNUSED, void *event);
-static Eina_Bool _cb_exe_pending_timer(void *data);
+extern Eina_List       *_efm_list;
+extern Eina_List       *_pending_exe_dels;
 
-static void _cb_thread_main(void *data, Ecore_Thread *th);
-static void _cb_thread_notify(void *data, Ecore_Thread *th EINA_UNUSED,
-                              void *msg);
-static void _cb_thread_done(void *data, Ecore_Thread *th EINA_UNUSED);
 
-static void _icon_object_clear(Icon *icon);
-static void _icon_object_add(Icon *icon, Smart_Data *sd, Evas *e,
-                             const char *theme_edj_file, Eina_Bool clip_set,
-                             int num);
-static void _icon_free(Icon *icon);
-static void _block_free(Block *block);
-static void _cb_reblock(void *data);
+#endif
 
-static void _drag_start(Icon *icon);
-
-static void _icon_custom_data_free(Smart_Data *sd);
-
-static void _reset(Smart_Data *sd);
-static char *_sanitize_dir(const char *path);
-
-static void _icon_detail_add(Icon *icon, Smart_Data *sd, Evas *e,
-                             const char *theme_edj_file, int col,
-                             const char *detail, const char *format);
\ No newline at end of file
diff --git a/src/efm/efm_structs.h b/src/efm/efm_structs.h
index 4464037..cfb852b 100644
--- a/src/efm/efm_structs.h
+++ b/src/efm/efm_structs.h
@@ -1,3 +1,9 @@
+#ifndef EFM_STRUCTS_H
+#define EFM_STRUCTS_H 1
+
+#include <Elementary.h>
+#include "cmd.h"
+
 // data structs used for the efm view
 //
 typedef struct _Smart_Data        Smart_Data;
@@ -195,3 +201,5 @@ typedef struct
   Eina_Thread_Queue_Msg head;
   Cmd                  *c;
 } Msg;
+
+#endif
diff --git a/src/efm/efm_util.c b/src/efm/efm_util.c
index b6a1dc6..6ca67d9 100644
--- a/src/efm/efm_util.c
+++ b/src/efm/efm_util.c
@@ -1,3 +1,12 @@
+#include "cmd.h"
+#include "efm.h"
+#include "efm_util.h"
+#include "efm_icon.h"
+#include "efm_graph.h"
+#include "efm_dnd.h"
+#include "efm_back_end.h"
+#include "efm_private.h"
+
 // util funcs for the efm view
 static inline int
 _xtov(char x)
@@ -22,7 +31,7 @@ _xtoi(const char *str)
   return v;
 }
 
-static char *
+char *
 _escape_parse(const char *str)
 {
   char       *dest = malloc(strlen(str) + 1);
@@ -69,7 +78,7 @@ _strbuf_escape_append(Eina_Strbuf *strbuf, const char *str)
     }
 }
 
-static double
+double
 _scale_get(Smart_Data *sd)
 {
   double s1 = elm_object_scale_get(sd->o_scroller);
@@ -77,7 +86,7 @@ _scale_get(Smart_Data *sd)
   return s1 * s2;
 }
 
-static Eina_List *
+Eina_List *
 _icons_path_find(const char *path)
 {
   Eina_List   *l, *bl, *il;
@@ -110,7 +119,7 @@ _icons_path_find(const char *path)
   return icons;
 }
 
-static Eina_Bool
+Eina_Bool
 _selected_icons_uri_strbuf_append(Smart_Data *sd, Eina_Strbuf *strbuf)
 {
   Eina_List *bl, *il;
@@ -135,7 +144,7 @@ _selected_icons_uri_strbuf_append(Smart_Data *sd, Eina_Strbuf *strbuf)
   return added;
 }
 
-static void
+void
 _detail_realized_items_resize(Smart_Data *sd)
 {
   Eina_List   *bl, *il;
@@ -208,7 +217,7 @@ _icon_find_closest(Eina_List *list, Evas_Coord x, Evas_Coord y, Icon *not_icon,
   return closest;
 }
 
-static void
+void
 _efm_focus_position(Smart_Data *sd)
 {
   Evas_Coord ix, iy, iw, ih, ix2, iy2, iw2, ih2;
@@ -236,7 +245,7 @@ _efm_focus_position(Smart_Data *sd)
                            ih2);
 }
 
-static Eina_Rectangle
+Eina_Rectangle
 _efm_sel_rect_get(Smart_Data *sd)
 {
   Evas_Coord     x1, y1, x2, y2;
@@ -269,7 +278,7 @@ _efm_sel_rect_get(Smart_Data *sd)
   return rect;
 }
 
-static void
+void
 _efm_sel_position(Smart_Data *sd)
 {
   Eina_Rectangle rect;
@@ -297,7 +306,7 @@ _cb_focus_anim(void *data)
   return EINA_TRUE;
 }
 
-static void
+void
 _icon_focus(Smart_Data *sd)
 {
   Evas_Coord ix, iy, iw, ih;
@@ -357,7 +366,7 @@ _icon_focus(Smart_Data *sd)
     }
 }
 
-static Eina_Bool
+Eina_Bool
 _icon_focus_dir(Smart_Data *sd, Efm_Focus_Dir dir)
 {
   Eina_List *bl, *il, *realized = NULL;
@@ -512,7 +521,7 @@ _icon_focus_dir(Smart_Data *sd, Efm_Focus_Dir dir)
   return EINA_TRUE;
 }
 
-static void
+void
 _icon_focus_show(Smart_Data *sd)
 {
   if (sd->focus_show) return;
@@ -520,7 +529,7 @@ _icon_focus_show(Smart_Data *sd)
   evas_object_show(sd->o_focus);
 }
 
-static void
+void
 _icon_focus_hide(Smart_Data *sd)
 {
   if (!sd->focus_show) return;
@@ -528,7 +537,7 @@ _icon_focus_hide(Smart_Data *sd)
   evas_object_hide(sd->o_focus);
 }
 
-static void
+void
 _icon_object_clear(Icon *icon)
 {
   int i;
@@ -592,7 +601,7 @@ _icon_text_update(Icon *icon)
   free(txt);
 }
 
-static void
+void
 _icon_rename_end(Icon *icon)
 {
   if (icon->sd->rename_icon != icon) return;
@@ -693,7 +702,7 @@ _icon_file_set(Icon *icon, const char *file)
     }
 }
 
-static void
+void
 _icon_path_cmd_strbuf_append(Eina_Strbuf *strbuf, const char *key,
                              Smart_Data *sd, Icon *icon)
 {
@@ -706,7 +715,7 @@ _icon_path_cmd_strbuf_append(Eina_Strbuf *strbuf, const char *key,
   eina_strbuf_free(buf);
 }
 
-static void
+void
 _uri_list_cmd_strbuf_append(Eina_Strbuf *strbuf, const char *key,
                             const char *urilist)
 {
@@ -852,7 +861,7 @@ _cb_dnd_over_open_timer(void *data)
   return EINA_FALSE;
 }
 
-static void
+void
 _icon_over_off(Icon *icon)
 {
   icon->over = EINA_FALSE;
@@ -865,7 +874,7 @@ _icon_over_off(Icon *icon)
     }
 }
 
-static void
+void
 _icon_over_on(Icon *icon)
 {
   if (icon->over) return;
@@ -893,7 +902,7 @@ _icon_over_on(Icon *icon)
                            icon->geom.h);
 }
 
-static void
+void
 _icon_select(Icon *icon)
 {
   if (icon->selected) return;
@@ -909,7 +918,7 @@ _icon_select(Icon *icon)
     }
 }
 
-static void
+void
 _icon_unselect(Icon *icon)
 {
   if (!icon->selected) return;
@@ -925,7 +934,7 @@ _icon_unselect(Icon *icon)
     }
 }
 
-static Eina_Bool
+Eina_Bool
 _unselect_all(Smart_Data *sd)
 {
   Eina_List *bl, *il;
@@ -944,7 +953,7 @@ _unselect_all(Smart_Data *sd)
   return had_selected;
 }
 
-static void
+void
 _select_range(Icon *icon_from, Icon *icon_to)
 {
   Eina_List *l;
@@ -1028,7 +1037,7 @@ done:
   icon->down = EINA_FALSE;
 }
 
-static Icon *
+Icon *
 _icon_dup(Icon *icon)
 {
   Icon *icon2;
@@ -1462,13 +1471,13 @@ done:
   free(plist);
 }
 
-static void
+void
 _icon_detail_add(Icon *icon, Smart_Data *sd, Evas *e,
                  const char *theme_edj_file, int col, const char *detail,
                  const char *format)
 { // can call this for add AND update - working on update now
   Evas_Object *o, *o2;
-  
+
   if (!detail) detail = "";
   if (!strcmp(format, "text")) // format: just the string as-is
     {
@@ -1869,7 +1878,7 @@ _icon_detail_add(Icon *icon, Smart_Data *sd, Evas *e,
             icon->info.file, col, format);
 }
 
-static void
+void
 _icon_object_add(Icon *icon, Smart_Data *sd, Evas *e,
                  const char *theme_edj_file, Eina_Bool clip_set, int num)
 { // either image or theme element
@@ -2160,7 +2169,7 @@ _icon_object_add(Icon *icon, Smart_Data *sd, Evas *e,
     }
 }
 
-static void
+void
 _icon_free(Icon *icon)
 { // free an icon - not needed anymore
   if (icon->sd)
@@ -2214,7 +2223,7 @@ _block_free_final(Block *block)
   free(block);
 }
 
-static void
+void
 _block_free(Block *block)
 { // free a block when we're not done with it - not used when reblocking
   Eina_List *il;
@@ -2236,7 +2245,7 @@ _block_free(Block *block)
   _block_free_final(block);
 }
 
-static void
+void
 _cb_reblock(void *data)
 { // re-do all our blocks of icons that we divide into to avoid looking at
   // batches of icons as a group/block when recvalculating when that whole
diff --git a/src/efm/efm_util.h b/src/efm/efm_util.h
new file mode 100644
index 0000000..fc509b9
--- /dev/null
+++ b/src/efm/efm_util.h
@@ -0,0 +1,51 @@
+#ifndef EFM_UTIL_H
+#define EFM_UTIL_H 1
+
+#include <Elementary.h>
+
+#include "efm_structs.h"
+
+typedef enum
+{
+  EFM_FOCUS_DIR_UP,
+  EFM_FOCUS_DIR_DOWN,
+  EFM_FOCUS_DIR_LEFT,
+  EFM_FOCUS_DIR_RIGHT,
+  EFM_FOCUS_DIR_PGDN,
+  EFM_FOCUS_DIR_PGUP
+} Efm_Focus_Dir;
+
+char *_escape_parse(const char *str);
+Eina_Bool _selected_icons_uri_strbuf_append(Smart_Data *sd, Eina_Strbuf *strbuf);
+void _detail_realized_items_resize(Smart_Data *sd);
+double _scale_get(Smart_Data *sd);
+Eina_List *_icons_path_find(const char *path);
+Eina_Bool _icon_focus_dir(Smart_Data *sd, Efm_Focus_Dir dir);
+void _icon_rename_end(Icon *icon);
+void _icon_path_cmd_strbuf_append(Eina_Strbuf *strbuf, const char *key, Smart_Data *sd, Icon *icon);
+void _uri_list_cmd_strbuf_append(Eina_Strbuf *strbuf, const char *key, const char *urilist);
+void _icon_over_off(Icon *icon);
+void _icon_over_on(Icon *icon);
+void _icon_select(Icon *icon);
+void _icon_unselect(Icon *icon);
+Eina_Bool _unselect_all(Smart_Data *sd);
+void _select_range(Icon *icon_from, Icon *icon_to);
+Icon *_icon_dup(Icon *icon);
+
+void _icon_focus(Smart_Data *sd);
+
+void _icon_focus_show(Smart_Data *sd);
+void _icon_focus_hide(Smart_Data *sd);
+void _icon_object_clear(Icon *icon);
+
+void _efm_focus_position(Smart_Data *sd);
+Eina_Rectangle _efm_sel_rect_get(Smart_Data *sd);
+void _efm_sel_position(Smart_Data *sd);
+
+void _icon_detail_add(Icon *icon, Smart_Data *sd, Evas *e, const char *theme_edj_file, int col, const char *detail, const char *format);
+void _icon_object_add(Icon *icon, Smart_Data *sd, Evas *e, const char *theme_edj_file, Eina_Bool clip_set, int num);
+void _icon_free(Icon *icon);
+void _block_free(Block *block);
+void _cb_reblock(void *data);
+
+#endif
diff --git a/src/efm/meson.build b/src/efm/meson.build
index 43c6ed0..e1ded60 100644
--- a/src/efm/meson.build
+++ b/src/efm/meson.build
@@ -8,8 +8,13 @@ executable('efm', [
     '../shared/cmd.c',
     'efm.c',
     'sort.c',
+    'bitmap.c',
     'efm_icon.c',
     'efm_graph.c',
+    'efm_util.c',
+    'efm_dnd.c',
+    'efm_back_end.c',
+    'efm_custom.c',
     'main.c'
   ],
   include_directories: inc,

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.

Reply via email to