aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/eolian/database_event_api.c
diff options
context:
space:
mode:
authorDaniel Kolesa <d.kolesa@osg.samsung.com>2016-05-17 17:14:47 +0100
committerDaniel Kolesa <d.kolesa@osg.samsung.com>2016-05-17 17:50:43 +0100
commit7782c0bcb956263e4b58b9ee5640381fe7b3c4f9 (patch)
tree42845dcc2450ec2815c320379c83c2017fda4f57 /src/lib/eolian/database_event_api.c
parentPanes: Use orientation interface APIs instead of horizontal set/get APIs (diff)
downloadefl-7782c0bcb956263e4b58b9ee5640381fe7b3c4f9.tar.gz
eolian: add event_prefix and have classes follow that or eo_prefix by default
Previously events used to use class name as a prefix and ignored eo_prefix when specified. This is no longer the case. Events follow eo_prefix by default now. In order to get around this for classes where this is undesirable, a new field event_prefix was added which takes priority over eo_prefix. If neither is specified, class name is used like previously. @feature
Diffstat (limited to 'src/lib/eolian/database_event_api.c')
-rw-r--r--src/lib/eolian/database_event_api.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/lib/eolian/database_event_api.c b/src/lib/eolian/database_event_api.c
index 1ef52ece15..5d69041783 100644
--- a/src/lib/eolian/database_event_api.c
+++ b/src/lib/eolian/database_event_api.c
@@ -59,8 +59,10 @@ eolian_event_c_name_get(const Eolian_Event *event)
{
char buf[512];
char *tmp = buf;
- snprintf(buf, sizeof(buf), "%s_EVENT_%s", event->klass->full_name,
- event->name);
+ const char *pfx = event->klass->ev_prefix;
+ if (!pfx) pfx = event->klass->eo_prefix;
+ if (!pfx) pfx = event->klass->full_name;
+ snprintf(buf, sizeof(buf), "%s_EVENT_%s", pfx, event->name);
eina_str_toupper(&tmp);
while ((tmp = strpbrk(tmp, ".,"))) *tmp = '_';
return eina_stringshare_add(buf);