aboutsummaryrefslogtreecommitdiffstats
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
parentoptions_background: rewrite to have multiple widgets (diff)
downloadterminology-c7fe3ca9643b38df83434ab01f0a449782c9b854.tar.gz
fix coding style wrt _Ctx types
-rw-r--r--src/bin/about.c8
-rw-r--r--src/bin/controls.c40
-rw-r--r--src/bin/options.c24
-rw-r--r--src/bin/options_keys.c34
4 files changed, 53 insertions, 53 deletions
diff --git a/src/bin/about.c b/src/bin/about.c
index fa54417..514533b 100644
--- a/src/bin/about.c
+++ b/src/bin/about.c
@@ -7,7 +7,7 @@
#include "termio.h"
-struct about_ctx {
+typedef struct _about_ctx {
Evas_Object *layout;
Evas_Object *over;
Evas_Object *win;
@@ -15,7 +15,7 @@ struct about_ctx {
Evas_Object *term;
void (*donecb) (void *data);
void *donedata;
-};
+} About_Ctx;
static Eina_Bool
@@ -33,7 +33,7 @@ _cb_mouse_down(void *data,
Evas_Object *_obj EINA_UNUSED,
void *_ev EINA_UNUSED)
{
- struct about_ctx *ctx = data;
+ About_Ctx *ctx = data;
if (ctx->over)
{
@@ -56,7 +56,7 @@ about_show(Evas_Object *win, Evas_Object *bg, Evas_Object *term,
void (*donecb) (void *data), void *donedata)
{
Evas_Object *o;
- struct about_ctx *ctx;
+ About_Ctx *ctx;
Config *config = termio_config_get(term);
char buf[PATH_MAX];
const char *txt;
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 @@
static Eina_Hash *controls = NULL;
-struct controls_ctx {
+typedef struct _Controls_Ctx {
Evas_Object *frame;
Evas_Object *over;
Evas_Object *win;
@@ -18,11 +18,11 @@ struct controls_ctx {
Evas_Object *term;
void (*donecb) (void *data);
void *donedata;
-};
+} Controls_Ctx;
static void
-controls_hide(struct controls_ctx *ctx, Eina_Bool call_cb);
+controls_hide(Controls_Ctx *ctx, Eina_Bool call_cb);
@@ -31,7 +31,7 @@ _cb_sel_on(void *data,
Evas_Object *_term EINA_UNUSED,
void *_ev EINA_UNUSED)
{
- struct controls_ctx *ctx = data;
+ Controls_Ctx *ctx = data;
Evas_Object *bt_copy = evas_object_data_get(ctx->frame, "bt_copy");
if (bt_copy)
elm_object_disabled_set(bt_copy, EINA_FALSE);
@@ -42,7 +42,7 @@ _cb_sel_off(void *data,
Evas_Object *_term EINA_UNUSED,
void *_ev EINA_UNUSED)
{
- struct controls_ctx *ctx = data;
+ Controls_Ctx *ctx = data;
Evas_Object *bt_copy = evas_object_data_get(ctx->frame, "bt_copy");
if (bt_copy)
elm_object_disabled_set(bt_copy, EINA_TRUE);
@@ -62,7 +62,7 @@ _cb_ct_copy(void *data,
Evas_Object *_obj EINA_UNUSED,
void *_event EINA_UNUSED)
{
- struct controls_ctx *ctx = data;
+ Controls_Ctx *ctx = data;
Evas_Object *term = ctx->term;
controls_hide(ctx, EINA_TRUE);
@@ -74,7 +74,7 @@ _cb_ct_paste(void *data,
Evas_Object *_obj EINA_UNUSED,
void *_event EINA_UNUSED)
{
- struct controls_ctx *ctx = data;
+ Controls_Ctx *ctx = data;
Evas_Object *term = ctx->term;
controls_hide(ctx, EINA_TRUE);
@@ -86,7 +86,7 @@ _cb_ct_new(void *data,
Evas_Object *_obj EINA_UNUSED,
void *_event EINA_UNUSED)
{
- struct controls_ctx *ctx = data;
+ Controls_Ctx *ctx = data;
main_new(ctx->win, ctx->term);
}
@@ -95,7 +95,7 @@ _cb_ct_split_v(void *data,
Evas_Object *_obj EINA_UNUSED,
void *_event EINA_UNUSED)
{
- struct controls_ctx *ctx = data;
+ Controls_Ctx *ctx = data;
split_vertically(ctx->win, ctx->term, NULL);
}
@@ -104,7 +104,7 @@ _cb_ct_split_h(void *data,
Evas_Object *_obj EINA_UNUSED,
void *_event EINA_UNUSED)
{
- struct controls_ctx *ctx = data;
+ Controls_Ctx *ctx = data;
split_horizontally(ctx->win, ctx->term, NULL);
}
@@ -113,7 +113,7 @@ _cb_ct_miniview(void *data,
Evas_Object *_obj EINA_UNUSED,
void *_event EINA_UNUSED)
{
- struct controls_ctx *ctx = data;
+ Controls_Ctx *ctx = data;
term_miniview_toggle(termio_term_get(ctx->term));
}
@@ -122,7 +122,7 @@ _cb_ct_set_title(void *data,
Evas_Object *_obj EINA_UNUSED,
void *_event EINA_UNUSED)
{
- struct controls_ctx *ctx = data;
+ Controls_Ctx *ctx = data;
Evas_Object *term = ctx->term;
controls_hide(ctx, EINA_TRUE);
term_set_title(termio_term_get(term));
@@ -133,7 +133,7 @@ _cb_ct_close(void *data,
Evas_Object *_obj EINA_UNUSED,
void *_event EINA_UNUSED)
{
- struct controls_ctx *ctx = data;
+ Controls_Ctx *ctx = data;
Evas_Object *term = ctx->term;
Evas_Object *win = ctx->win;
@@ -144,7 +144,7 @@ _cb_ct_close(void *data,
static void
_on_sub_done(void *data)
{
- struct controls_ctx *ctx = data;
+ Controls_Ctx *ctx = data;
ecore_timer_add(10.0, _cb_del_delay, ctx->frame);
ctx->frame = NULL;
@@ -162,7 +162,7 @@ _cb_ct_options(void *data,
Evas_Object *_obj EINA_UNUSED,
void *_event EINA_UNUSED)
{
- struct controls_ctx *ctx = data;
+ Controls_Ctx *ctx = data;
options_show(ctx->win, ctx->bg, ctx->term, _on_sub_done, ctx);
controls_hide(ctx, EINA_FALSE);
@@ -174,7 +174,7 @@ _cb_ct_about(void *data,
Evas_Object *_obj EINA_UNUSED,
void *_event EINA_UNUSED)
{
- struct controls_ctx *ctx = data;
+ Controls_Ctx *ctx = data;
about_show(ctx->win, ctx->bg, ctx->term, _on_sub_done, ctx);
controls_hide(ctx, EINA_FALSE);
@@ -186,7 +186,7 @@ _cb_mouse_down(void *data,
Evas_Object *_obj EINA_UNUSED,
void *_ev EINA_UNUSED)
{
- struct controls_ctx *ctx = data;
+ Controls_Ctx *ctx = data;
controls_hide(ctx, EINA_TRUE);
}
@@ -197,7 +197,7 @@ _cb_saved_del(void *data,
Evas_Object *obj,
void *_ev EINA_UNUSED)
{
- struct controls_ctx *ctx = data;
+ Controls_Ctx *ctx = data;
if (obj == ctx->win)
ctx->win = NULL;
@@ -256,7 +256,7 @@ _sep_add_h(Evas_Object *win)
}
static void
-controls_hide(struct controls_ctx *ctx, Eina_Bool call_cb)
+controls_hide(Controls_Ctx *ctx, Eina_Bool call_cb)
{
if (ctx->win)
{
@@ -297,7 +297,7 @@ controls_show(Evas_Object *win, Evas_Object *bg, Evas_Object *term,
{
Evas_Object *o;
Evas_Object *ct_boxh, *ct_boxv, *ct_box, *ct_box2, *ct_box3;
- struct controls_ctx *ctx;
+ Controls_Ctx *ctx;
if (eina_hash_find(controls, &win))
{
diff --git a/src/bin/options.c b/src/bin/options.c
index 2798718..6d79666 100644
--- a/src/bin/options.c
+++ b/src/bin/options.c
@@ -31,7 +31,7 @@ enum option_mode {
OPTIONS_MODE_NB
};
-struct options_ctx {
+typedef struct _Options_Ctx {
enum option_mode mode;
Evas_Object *frame;
Evas_Object *toolbar;
@@ -43,16 +43,16 @@ struct options_ctx {
Config *config;
void (*donecb) (void *data);
void *donedata;
- struct options_ctx *modes[OPTIONS_MODE_NB];
-};
+ struct _Options_Ctx *modes[OPTIONS_MODE_NB];
+} Options_Ctx;
static void
_cb_op(void *data,
Evas_Object *_obj EINA_UNUSED,
void *_event EINA_UNUSED)
{
- struct options_ctx **pctx = data;
- struct options_ctx *ctx = *pctx;
+ Options_Ctx **pctx = data;
+ Options_Ctx *ctx = *pctx;
enum option_mode mode = pctx - ctx->modes;
if (mode == ctx->mode)
@@ -66,7 +66,7 @@ _cb_op(void *data,
static void
_cb_op_tmp_chg(void *data, Evas_Object *obj, void *_event EINA_UNUSED)
{
- struct options_ctx *ctx = data;
+ Options_Ctx *ctx = data;
Config *config = ctx->config;
config->temporary = elm_check_state_get(obj);
@@ -75,7 +75,7 @@ _cb_op_tmp_chg(void *data, Evas_Object *obj, void *_event EINA_UNUSED)
static Eina_Bool
_cb_op_del_delay(void *data)
{
- struct options_ctx *ctx = data;
+ Options_Ctx *ctx = data;
evas_object_del(ctx->opbox);
evas_object_del(ctx->frame);
@@ -93,7 +93,7 @@ _cb_opdt_hide_done(void *data,
const char *_sig EINA_UNUSED,
const char *_src EINA_UNUSED)
{
- struct options_ctx *ctx = data;
+ Options_Ctx *ctx = data;
elm_box_clear(ctx->opbox);
switch (ctx->mode)
@@ -119,7 +119,7 @@ _cb_opdt_hide_done2(void *data,
const char *_sig EINA_UNUSED,
const char *_src EINA_UNUSED)
{
- struct options_ctx *ctx = data;
+ Options_Ctx *ctx = data;
edje_object_signal_callback_del(ctx->bg, "optdetails,hide,done",
"terminology",
@@ -128,7 +128,7 @@ _cb_opdt_hide_done2(void *data,
}
static void
-options_hide(struct options_ctx *ctx)
+options_hide(Options_Ctx *ctx)
{
edje_object_part_swallow(ctx->bg, "terminology.optdetails", ctx->opbox);
edje_object_part_swallow(ctx->bg, "terminology.options", ctx->frame);
@@ -161,7 +161,7 @@ _cb_mouse_down(void *data,
Evas_Object *_obj EINA_UNUSED,
void *_ev EINA_UNUSED)
{
- struct options_ctx *ctx = data;
+ Options_Ctx *ctx = data;
options_hide(ctx);
}
@@ -172,7 +172,7 @@ options_show(Evas_Object *win, Evas_Object *bg, Evas_Object *term,
void (*donecb) (void *data), void *donedata)
{
Evas_Object *o, *op_box, *op_tbox;
- struct options_ctx *ctx;
+ Options_Ctx *ctx;
int i = 0;
Elm_Object_Item *it_fn;
diff --git a/src/bin/options_keys.c b/src/bin/options_keys.c
index 0776dcc..01a64df 100644
--- a/src/bin/options_keys.c
+++ b/src/bin/options_keys.c
@@ -9,14 +9,14 @@
#include "keyin.h"
#include "utils.h"
-struct keys_ctx {
+typedef struct _Keys_Ctx {
Config *config;
Evas_Object *frame;
Evas_Object *gl;
Evas_Object *layout;
-};
+} Keys_Ctx;
-static void _hover_del(struct keys_ctx *ctx);
+static void _hover_del(Keys_Ctx *ctx);
static void
_shortcut_delete(void *data,
@@ -26,7 +26,7 @@ _shortcut_delete(void *data,
Evas_Object *hs, *bx;
Config_Keys *cfg_key;
Evas_Coord w, min_w, min_h;
- struct keys_ctx *ctx;
+ Keys_Ctx *ctx;
hs = data;
bx = evas_object_data_get(hs, "bx");
@@ -53,7 +53,7 @@ _shortcut_delete(void *data,
}
static Evas_Object *
-_shortcut_button_add(struct keys_ctx *ctx,
+_shortcut_button_add(Keys_Ctx *ctx,
Evas_Object *bx,
const Config_Keys *key)
{
@@ -95,7 +95,7 @@ _cb_key_up(void *data,
Config_Keys *cfg_key;
Shortcut_Action *action;
Evas_Object *bx = data;
- struct keys_ctx *ctx;
+ Keys_Ctx *ctx;
if (key_is_modifier(ev->keyname))
return;
@@ -166,14 +166,14 @@ _cb_mouse_down(void *data,
Evas_Object *obj EINA_UNUSED,
void *_event EINA_UNUSED)
{
- struct keys_ctx *ctx = data;
+ Keys_Ctx *ctx = data;
_hover_del(ctx);
}
static void
-_hover_sizing_eval(struct keys_ctx *ctx)
+_hover_sizing_eval(Keys_Ctx *ctx)
{
Evas_Coord x = 0, y = 0, w = 0, h = 0;
@@ -192,7 +192,7 @@ _parent_move_cb(void *data,
Evas_Object *_obj EINA_UNUSED,
void *_event_info EINA_UNUSED)
{
- struct keys_ctx *ctx = data;
+ Keys_Ctx *ctx = data;
_hover_sizing_eval(ctx);
}
@@ -202,7 +202,7 @@ _parent_resize_cb(void *data,
Evas_Object *_obj EINA_UNUSED,
void *_event_info EINA_UNUSED)
{
- struct keys_ctx *ctx = data;
+ Keys_Ctx *ctx = data;
_hover_sizing_eval(ctx);
}
@@ -212,7 +212,7 @@ _parent_hide_cb(void *data,
Evas_Object *_obj EINA_UNUSED,
void *_event_info EINA_UNUSED)
{
- struct keys_ctx *ctx = data;
+ Keys_Ctx *ctx = data;
_hover_del(ctx);
}
@@ -222,7 +222,7 @@ _parent_del_cb(void *data,
Evas_Object *_obj EINA_UNUSED,
void *_event_info EINA_UNUSED)
{
- struct keys_ctx *ctx = data;
+ Keys_Ctx *ctx = data;
_hover_del(ctx);
evas_object_event_callback_del(ctx->frame, EVAS_CALLBACK_DEL,
@@ -233,7 +233,7 @@ _parent_del_cb(void *data,
}
static void
-_hover_del(struct keys_ctx *ctx)
+_hover_del(Keys_Ctx *ctx)
{
if (ctx->layout)
{
@@ -257,7 +257,7 @@ _on_shortcut_add(void *data,
{
Evas_Object *o, *oe;
Evas_Object *bx = data;
- struct keys_ctx *ctx;
+ Keys_Ctx *ctx;
ctx = evas_object_data_get(bx, "ctx");
assert(ctx);
@@ -290,7 +290,7 @@ gl_content_get(void *data, Evas_Object *obj, const char *_part EINA_UNUSED)
Evas_Object *bx, *bt, *lbl, *sep;
Config_Keys *key;
Eina_List *l;
- struct keys_ctx *ctx;
+ Keys_Ctx *ctx;
ctx = evas_object_data_get(obj, "ctx");
assert(ctx);
@@ -363,7 +363,7 @@ _cb_reset_keys(void *data,
Evas_Object *_obj EINA_UNUSED,
void *_event EINA_UNUSED)
{
- struct keys_ctx *ctx = data;
+ Keys_Ctx *ctx = data;
config_reset_keys(ctx->config);
elm_genlist_realized_items_update(ctx->gl);
@@ -377,7 +377,7 @@ options_keys(Evas_Object *opbox, Evas_Object *term)
Elm_Genlist_Item_Class *itc, *itc_group;
Elm_Object_Item *git = NULL;
Config *config = termio_config_get(term);
- struct keys_ctx *ctx;
+ Keys_Ctx *ctx;
ctx = calloc(1, sizeof(*ctx));
assert(ctx);