[E_BORDER] Add missing code to delete timer when the window gets DEICONIFY_APPROVE...
[platform/core/uifw/e17.git] / src / modules / layout / e_mod_main.c
1 #include "e.h"
2 #include "e_mod_main.h"
3
4 /***************************************************************************/
5 /**/
6 /* actual module specifics */
7
8 static E_Module *layout_module = NULL;
9 static E_Border_Hook *hook = NULL;
10
11 static void
12 _e_module_layout_cb_hook(void *data, E_Border *bd)
13 {
14    /* FIXME: make some modification based on policy */
15    printf("Window:\n"
16           "  Title:    [%s][%s]\n"
17           "  Class:    %s::%s\n"
18           "  Geometry: %ix%i+%i+%i\n"
19           "  New:      %i\n"
20           , bd->client.icccm.title, bd->client.netwm.name
21           , bd->client.icccm.name, bd->client.icccm.class
22           , bd->x, bd->y, bd->w, bd->h
23           , bd->new_client
24           );
25    if ((bd->client.icccm.transient_for != 0) ||
26        (bd->client.netwm.type == ECORE_X_WINDOW_TYPE_DIALOG))
27      {
28         bd->client.e.state.centered = 1;
29      }
30    else
31      {
32         e_border_unmaximize(bd, E_MAXIMIZE_BOTH);
33         e_border_resize(bd, 1, 1);
34         e_border_center(bd);
35         if (bd->bordername) eina_stringshare_del(bd->bordername);
36         bd->bordername = eina_stringshare_add("borderless");
37         bd->client.icccm.base_w = 1;
38         bd->client.icccm.base_h = 1;
39         bd->client.icccm.min_w = 1;
40         bd->client.icccm.min_h = 1;
41         bd->client.icccm.max_w = 32767;
42         bd->client.icccm.max_h = 32767;
43         bd->client.icccm.min_aspect = 0.0;
44         bd->client.icccm.max_aspect = 0.0;
45      }
46    e_border_maximize(bd, E_MAXIMIZE_FILL | E_MAXIMIZE_BOTH);
47 }
48
49 /**/
50 /***************************************************************************/
51
52 /***************************************************************************/
53 /**/
54
55 /**/
56 /***************************************************************************/
57
58 /***************************************************************************/
59 /**/
60 /* module setup */
61 EAPI E_Module_Api e_modapi =
62 {
63    E_MODULE_API_VERSION,
64      "Layout"
65 };
66
67 EAPI void *
68 e_modapi_init(E_Module *m)
69 {
70    layout_module = m;
71
72    hook = e_border_hook_add(E_BORDER_HOOK_EVAL_POST_FETCH,
73                             _e_module_layout_cb_hook, NULL);
74    return m;
75 }
76
77 EAPI int
78 e_modapi_shutdown(E_Module *m)
79 {
80    if (hook)
81      {
82         e_border_hook_del(hook);
83         hook = NULL;
84      }
85    layout_module = NULL;
86    return 1;
87 }
88
89 EAPI int
90 e_modapi_save(E_Module *m)
91 {
92    return 1;
93 }