<commit_before>/*
 * vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2
 */
#include "e.h"
#include "e_mod_main.h"

/***************************************************************************/
/**/
/* actual module specifics */

static void _e_mod_action_winlist_cb(E_Object *obj, const char *params);
static void _e_mod_action_winlist_mouse_cb(E_Object *obj, const char *params, Ecore_X_Event_Mouse_Button_Down *ev);
static void _e_mod_action_winlist_key_cb(E_Object *obj, const char *params, Ecore_X_Event_Key_Down *ev);

static E_Module *conf_module = NULL;
static E_Action *act = NULL;

/**/
/***************************************************************************/

/***************************************************************************/
/**/

/**/
/***************************************************************************/

/***************************************************************************/
/**/
/* module setup */
EAPI E_Module_Api e_modapi =
{
   E_MODULE_API_VERSION,
     "Winlist"
};

EAPI void *
e_modapi_init(E_Module *m)
{
   conf_module = m;
   e_winlist_init();
   /* add module supplied action */
   act = e_action_add("winlist");
   if (act)
     {
	act->func.go = _e_mod_action_winlist_cb;
	act->func.go_mouse = _e_mod_action_winlist_mouse_cb;
	act->func.go_key = _e_mod_action_winlist_key_cb;
	e_action_predef_name_set(_("Window : List"), _("Next Window"), "winlist",
				 "next", NULL, 0);
	e_action_predef_name_set(_("Window : List"), _("Previous Window"),
				 "winlist", "prev", NULL, 0);
     }
   e_module_delayed_set(m, 1);
   return m;
}

EAPI int
e_modapi_shutdown(E_Module *m)
{
   /* remove module-supplied action */
   if (act)
     {
	e_action_predef_name_del(_("Window : List"), _("Previous Window"));
	e_action_predef_name_del(_("Window : List"), _("Next Window"));
	e_action_del("exebuf");
	act = NULL;
     }
   e_winlist_shutdown();
   conf_module = NULL;
   return 1;
}

EAPI int
e_modapi_save(E_Module *m)
{
   return 1;
}

EAPI int
e_modapi_about(E_Module *m)
{
   e_module_dialog_show(m,
			_("Enlightenment Winlist Module"),
			_("A module for displaying a list of windows to switch between."));
   return 1;
}

/* action callback */
static void
_e_mod_action_winlist_cb(E_Object *obj, const char *params)
{<commit_msg>Removing the winlist module will result in a) a segv the next time you use it (yes, you just removed it, but hey), b) the inability to use an exebuf action for a keybinding for the remainder of your E session.  Fixed.<commit_after>/*
 * vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2
 */
#include "e.h"
#include "e_mod_main.h"

/***************************************************************************/
/**/
/* actual module specifics */

static void _e_mod_action_winlist_cb(E_Object *obj, const char *params);
static void _e_mod_action_winlist_mouse_cb(E_Object *obj, const char *params, Ecore_X_Event_Mouse_Button_Down *ev);
static void _e_mod_action_winlist_key_cb(E_Object *obj, const char *params, Ecore_X_Event_Key_Down *ev);

static E_Module *conf_module = NULL;
static E_Action *act = NULL;

/**/
/***************************************************************************/

/***************************************************************************/
/**/

/**/
/***************************************************************************/

/***************************************************************************/
/**/
/* module setup */
EAPI E_Module_Api e_modapi =
{
   E_MODULE_API_VERSION,
     "Winlist"
};

EAPI void *
e_modapi_init(E_Module *m)
{
   conf_module = m;
   e_winlist_init();
   /* add module supplied action */
   act = e_action_add("winlist");
   if (act)
     {
	act->func.go = _e_mod_action_winlist_cb;
	act->func.go_mouse = _e_mod_action_winlist_mouse_cb;
	act->func.go_key = _e_mod_action_winlist_key_cb;
	e_action_predef_name_set(_("Window : List"), _("Next Window"), "winlist",
				 "next", NULL, 0);
	e_action_predef_name_set(_("Window : List"), _("Previous Window"),
				 "winlist", "prev", NULL, 0);
     }
   e_module_delayed_set(m, 1);
   return m;
}

EAPI int
e_modapi_shutdown(E_Module *m)
{
   /* remove module-supplied action */
   if (act)
     {
	e_action_predef_name_del(_("Window : List"), _("Previous Window"));
	e_action_predef_name_del(_("Window : List"), _("Next Window"));
	e_action_del("winlist");
	act = NULL;
     }
   e_winlist_shutdown();
   conf_module = NULL;
   return 1;
}

EAPI int
e_modapi_save(E_Module *m)
{
   return 1;
}

EAPI int
e_modapi_about(E_Module *m)
{
   e_module_dialog_show(m,
			_("Enlightenment Winlist Module"),
			_("A module for displaying a list of windows to switch between."));
   return 1;
}

/* action callback */
static void
_e_mod_action_winlist_cb(E_Object *obj, const char *params)
{
{'fraction_non_alphanumeric': 0.27569604354197197, 'fraction_numerical': 0.005861419300816412, 'mean_word_length': 5.278580814717477, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6253346', 'n_tokens_mistral': 1707, 'n_tokens_neox': 1620, 'n_words': 343}