~enlightenment-git/enlightenment-svn/emodule-penguins

« back to all changes in this revision

Viewing changes to src/e_mod_main.c

  • Committer: davemds
  • Date: 2014-01-19 20:41:22 UTC
  • Revision ID: git-v1:e827df78f8cf240fb4fcefd67ef4e57c7b35ba66
cleanup e_mod_main.c/h

Show diffs side-by-side

added added

removed removed

Lines of Context:
5
5
#include "e_mod_penguins.h"
6
6
 
7
7
 
8
 
/* module private routines */
9
 
// static void       _population_load(Population *pop);
10
 
// static void       _theme_load(Population *pop);
11
 
 
12
 
 
13
 
/* public module routines. all modules must have these */
14
 
EAPI E_Module_Api e_modapi = {
15
 
   E_MODULE_API_VERSION,
16
 
   "Penguins"
17
 
};
 
8
 
 
9
EAPI E_Module_Api e_modapi = { E_MODULE_API_VERSION, "Penguins" };
18
10
 
19
11
EAPI E_Module *penguins_mod = NULL;
20
12
 
 
13
 
21
14
EAPI void *
22
15
e_modapi_init(E_Module *m)
23
16
{
24
 
   Population *pop;
25
 
   char buf[4096];
 
17
   char buf[PATH_MAX];
26
18
 
27
 
   /* Set up module's message catalogue */
 
19
   // Set up module's message catalogue
28
20
   snprintf(buf, sizeof(buf), "%s/locale", e_module_dir_get(m));
29
21
   bindtextdomain(PACKAGE, buf);
30
22
   bind_textdomain_codeset(PACKAGE, "UTF-8");
31
23
 
32
 
   pop = population_init(m);
33
 
 
 
24
   // Add an item in the config panel
34
25
   snprintf(buf, sizeof(buf), "%s/e-module-penguins.edj", e_module_dir_get(m));
35
 
   e_configure_registry_category_add("appearance", 10, D_("Look"), NULL, "preferences-look");
36
 
   e_configure_registry_item_add("appearance/penguins", 150, D_("Penguins"), NULL, buf, e_int_config_penguins_module);
 
26
   e_configure_registry_category_add("appearance", 10, D_("Look"),
 
27
                                     NULL, "preferences-look");
 
28
   e_configure_registry_item_add("appearance/penguins", 150, D_("Penguins"),
 
29
                                 NULL, buf, e_int_config_penguins_module);
37
30
 
38
31
   penguins_mod = m;
39
32
   e_module_delayed_set(m, 1);
40
 
   return pop;
 
33
 
 
34
   return population_init(m);
41
35
}
42
36
 
43
37
EAPI int
48
42
   e_configure_registry_item_del("appearance/penguins");
49
43
   e_configure_registry_category_del("appearance");
50
44
 
51
 
   pop = m->data;
52
 
   if (pop)
 
45
   if (pop = m->data)
53
46
   {
54
 
      if (pop->config_dialog)
55
 
      {
56
 
         e_object_del(E_OBJECT(pop->config_dialog));
57
 
         pop->config_dialog = NULL;
58
 
      }
 
47
      E_FREE_FUNC(pop->config_dialog, e_object_del);
59
48
      population_shutdown(pop);
60
49
   }
61
50
   return 1;