summaryrefslogtreecommitdiff
path: root/src/bin/controls.c
diff options
context:
space:
mode:
authorBoris Faure <billiob@gmail.com>2018-01-09 23:21:48 +0100
committerBoris Faure <billiob@gmail.com>2018-01-09 23:21:48 +0100
commitc7fe3ca9643b38df83434ab01f0a449782c9b854 (patch)
treebc6659f2d2760302365d72a00e806fbcef87e0da /src/bin/controls.c
parent69e3176f4e36a0d8d18c716386ada69969720a30 (diff)
fix coding style wrt _Ctx types
Diffstat (limited to 'src/bin/controls.c')
-rw-r--r--src/bin/controls.c40
1 files changed, 20 insertions, 20 deletions
diff --git a/src/bin/controls.c b/src/bin/controls.c
index a472114..89fbc8d 100644
--- a/src/bin/controls.c
+++ b/src/bin/controls.c
@@ -10,7 +10,7 @@
10 10
11static Eina_Hash *controls = NULL; 11static Eina_Hash *controls = NULL;
12 12
13struct controls_ctx { 13typedef struct _Controls_Ctx {
14 Evas_Object *frame; 14 Evas_Object *frame;
15 Evas_Object *over; 15 Evas_Object *over;
16 Evas_Object *win; 16 Evas_Object *win;
@@ -18,11 +18,11 @@ struct controls_ctx {
18 Evas_Object *term; 18 Evas_Object *term;
19 void (*donecb) (void *data); 19 void (*donecb) (void *data);
20 void *donedata; 20 void *donedata;
21}; 21} Controls_Ctx;
22 22
23 23
24static void 24static void
25controls_hide(struct controls_ctx *ctx, Eina_Bool call_cb); 25controls_hide(Controls_Ctx *ctx, Eina_Bool call_cb);
26 26
27 27
28 28
@@ -31,7 +31,7 @@ _cb_sel_on(void *data,
31 Evas_Object *_term EINA_UNUSED, 31 Evas_Object *_term EINA_UNUSED,
32 void *_ev EINA_UNUSED) 32 void *_ev EINA_UNUSED)
33{ 33{
34 struct controls_ctx *ctx = data; 34 Controls_Ctx *ctx = data;
35 Evas_Object *bt_copy = evas_object_data_get(ctx->frame, "bt_copy"); 35 Evas_Object *bt_copy = evas_object_data_get(ctx->frame, "bt_copy");
36 if (bt_copy) 36 if (bt_copy)
37 elm_object_disabled_set(bt_copy, EINA_FALSE); 37 elm_object_disabled_set(bt_copy, EINA_FALSE);
@@ -42,7 +42,7 @@ _cb_sel_off(void *data,
42 Evas_Object *_term EINA_UNUSED, 42 Evas_Object *_term EINA_UNUSED,
43 void *_ev EINA_UNUSED) 43 void *_ev EINA_UNUSED)
44{ 44{
45 struct controls_ctx *ctx = data; 45 Controls_Ctx *ctx = data;
46 Evas_Object *bt_copy = evas_object_data_get(ctx->frame, "bt_copy"); 46 Evas_Object *bt_copy = evas_object_data_get(ctx->frame, "bt_copy");
47 if (bt_copy) 47 if (bt_copy)
48 elm_object_disabled_set(bt_copy, EINA_TRUE); 48 elm_object_disabled_set(bt_copy, EINA_TRUE);
@@ -62,7 +62,7 @@ _cb_ct_copy(void *data,
62 Evas_Object *_obj EINA_UNUSED, 62 Evas_Object *_obj EINA_UNUSED,
63 void *_event EINA_UNUSED) 63 void *_event EINA_UNUSED)
64{ 64{
65 struct controls_ctx *ctx = data; 65 Controls_Ctx *ctx = data;
66 Evas_Object *term = ctx->term; 66 Evas_Object *term = ctx->term;
67 67
68 controls_hide(ctx, EINA_TRUE); 68 controls_hide(ctx, EINA_TRUE);
@@ -74,7 +74,7 @@ _cb_ct_paste(void *data,
74 Evas_Object *_obj EINA_UNUSED, 74 Evas_Object *_obj EINA_UNUSED,
75 void *_event EINA_UNUSED) 75 void *_event EINA_UNUSED)
76{ 76{
77 struct controls_ctx *ctx = data; 77 Controls_Ctx *ctx = data;
78 Evas_Object *term = ctx->term; 78 Evas_Object *term = ctx->term;
79 79
80 controls_hide(ctx, EINA_TRUE); 80 controls_hide(ctx, EINA_TRUE);
@@ -86,7 +86,7 @@ _cb_ct_new(void *data,
86 Evas_Object *_obj EINA_UNUSED, 86 Evas_Object *_obj EINA_UNUSED,
87 void *_event EINA_UNUSED) 87 void *_event EINA_UNUSED)
88{ 88{
89 struct controls_ctx *ctx = data; 89 Controls_Ctx *ctx = data;
90 main_new(ctx->win, ctx->term); 90 main_new(ctx->win, ctx->term);
91} 91}
92 92
@@ -95,7 +95,7 @@ _cb_ct_split_v(void *data,
95 Evas_Object *_obj EINA_UNUSED, 95 Evas_Object *_obj EINA_UNUSED,
96 void *_event EINA_UNUSED) 96 void *_event EINA_UNUSED)
97{ 97{
98 struct controls_ctx *ctx = data; 98 Controls_Ctx *ctx = data;
99 split_vertically(ctx->win, ctx->term, NULL); 99 split_vertically(ctx->win, ctx->term, NULL);
100} 100}
101 101
@@ -104,7 +104,7 @@ _cb_ct_split_h(void *data,
104 Evas_Object *_obj EINA_UNUSED, 104 Evas_Object *_obj EINA_UNUSED,
105 void *_event EINA_UNUSED) 105 void *_event EINA_UNUSED)
106{ 106{
107 struct controls_ctx *ctx = data; 107 Controls_Ctx *ctx = data;
108 split_horizontally(ctx->win, ctx->term, NULL); 108 split_horizontally(ctx->win, ctx->term, NULL);
109} 109}
110 110
@@ -113,7 +113,7 @@ _cb_ct_miniview(void *data,
113 Evas_Object *_obj EINA_UNUSED, 113 Evas_Object *_obj EINA_UNUSED,
114 void *_event EINA_UNUSED) 114 void *_event EINA_UNUSED)
115{ 115{
116 struct controls_ctx *ctx = data; 116 Controls_Ctx *ctx = data;
117 term_miniview_toggle(termio_term_get(ctx->term)); 117 term_miniview_toggle(termio_term_get(ctx->term));
118} 118}
119 119
@@ -122,7 +122,7 @@ _cb_ct_set_title(void *data,
122 Evas_Object *_obj EINA_UNUSED, 122 Evas_Object *_obj EINA_UNUSED,
123 void *_event EINA_UNUSED) 123 void *_event EINA_UNUSED)
124{ 124{
125 struct controls_ctx *ctx = data; 125 Controls_Ctx *ctx = data;
126 Evas_Object *term = ctx->term; 126 Evas_Object *term = ctx->term;
127 controls_hide(ctx, EINA_TRUE); 127 controls_hide(ctx, EINA_TRUE);
128 term_set_title(termio_term_get(term)); 128 term_set_title(termio_term_get(term));
@@ -133,7 +133,7 @@ _cb_ct_close(void *data,
133 Evas_Object *_obj EINA_UNUSED, 133 Evas_Object *_obj EINA_UNUSED,
134 void *_event EINA_UNUSED) 134 void *_event EINA_UNUSED)
135{ 135{
136 struct controls_ctx *ctx = data; 136 Controls_Ctx *ctx = data;
137 Evas_Object *term = ctx->term; 137 Evas_Object *term = ctx->term;
138 Evas_Object *win = ctx->win; 138 Evas_Object *win = ctx->win;
139 139
@@ -144,7 +144,7 @@ _cb_ct_close(void *data,
144static void 144static void
145_on_sub_done(void *data) 145_on_sub_done(void *data)
146{ 146{
147 struct controls_ctx *ctx = data; 147 Controls_Ctx *ctx = data;
148 148
149 ecore_timer_add(10.0, _cb_del_delay, ctx->frame); 149 ecore_timer_add(10.0, _cb_del_delay, ctx->frame);
150 ctx->frame = NULL; 150 ctx->frame = NULL;
@@ -162,7 +162,7 @@ _cb_ct_options(void *data,
162 Evas_Object *_obj EINA_UNUSED, 162 Evas_Object *_obj EINA_UNUSED,
163 void *_event EINA_UNUSED) 163 void *_event EINA_UNUSED)
164{ 164{
165 struct controls_ctx *ctx = data; 165 Controls_Ctx *ctx = data;
166 166
167 options_show(ctx->win, ctx->bg, ctx->term, _on_sub_done, ctx); 167 options_show(ctx->win, ctx->bg, ctx->term, _on_sub_done, ctx);
168 controls_hide(ctx, EINA_FALSE); 168 controls_hide(ctx, EINA_FALSE);
@@ -174,7 +174,7 @@ _cb_ct_about(void *data,
174 Evas_Object *_obj EINA_UNUSED, 174 Evas_Object *_obj EINA_UNUSED,
175 void *_event EINA_UNUSED) 175 void *_event EINA_UNUSED)
176{ 176{
177 struct controls_ctx *ctx = data; 177 Controls_Ctx *ctx = data;
178 178
179 about_show(ctx->win, ctx->bg, ctx->term, _on_sub_done, ctx); 179 about_show(ctx->win, ctx->bg, ctx->term, _on_sub_done, ctx);
180 controls_hide(ctx, EINA_FALSE); 180 controls_hide(ctx, EINA_FALSE);
@@ -186,7 +186,7 @@ _cb_mouse_down(void *data,
186 Evas_Object *_obj EINA_UNUSED, 186 Evas_Object *_obj EINA_UNUSED,
187 void *_ev EINA_UNUSED) 187 void *_ev EINA_UNUSED)
188{ 188{
189 struct controls_ctx *ctx = data; 189 Controls_Ctx *ctx = data;
190 190
191 controls_hide(ctx, EINA_TRUE); 191 controls_hide(ctx, EINA_TRUE);
192} 192}
@@ -197,7 +197,7 @@ _cb_saved_del(void *data,
197 Evas_Object *obj, 197 Evas_Object *obj,
198 void *_ev EINA_UNUSED) 198 void *_ev EINA_UNUSED)
199{ 199{
200 struct controls_ctx *ctx = data; 200 Controls_Ctx *ctx = data;
201 201
202 if (obj == ctx->win) 202 if (obj == ctx->win)
203 ctx->win = NULL; 203 ctx->win = NULL;
@@ -256,7 +256,7 @@ _sep_add_h(Evas_Object *win)
256} 256}
257 257
258static void 258static void
259controls_hide(struct controls_ctx *ctx, Eina_Bool call_cb) 259controls_hide(Controls_Ctx *ctx, Eina_Bool call_cb)
260{ 260{
261 if (ctx->win) 261 if (ctx->win)
262 { 262 {
@@ -297,7 +297,7 @@ controls_show(Evas_Object *win, Evas_Object *bg, Evas_Object *term,
297{ 297{
298 Evas_Object *o; 298 Evas_Object *o;
299 Evas_Object *ct_boxh, *ct_boxv, *ct_box, *ct_box2, *ct_box3; 299 Evas_Object *ct_boxh, *ct_boxv, *ct_box, *ct_box2, *ct_box3;
300 struct controls_ctx *ctx; 300 Controls_Ctx *ctx;
301 301
302 if (eina_hash_find(controls, &win)) 302 if (eina_hash_find(controls, &win))
303 { 303 {