eolian: events now use Eolian_Type* instead of stringshare
This commit is contained in:
parent
a9171a89f9
commit
883c4ca7df
|
@ -310,8 +310,8 @@ inline efl::eolian::eo_event
|
|||
event_create(Eolian_Class const& klass, const Eolian_Event *event_)
|
||||
{
|
||||
efl::eolian::eo_event event;
|
||||
const char *name, *type, *comment;
|
||||
if(::eolian_class_event_information_get(event_, &name, &type, &comment))
|
||||
const char *name, *comment;
|
||||
if(::eolian_class_event_information_get(event_, &name, NULL, &comment))
|
||||
{
|
||||
std::string name_ = safe_str(name);
|
||||
std::transform(name_.begin(), name_.end(), name_.begin(),
|
||||
|
|
|
@ -670,12 +670,13 @@ EAPI const Eina_List *eolian_class_events_list_get(const Eolian_Class *klass);
|
|||
*
|
||||
* @param[in] event handle of the event
|
||||
* @param[out] event_name name of the event
|
||||
* @param[out] event_type type of the event
|
||||
* @param[out] event_desc description of the event
|
||||
* @return EINA_TRUE on success, EINA_FALSE otherwise.
|
||||
*
|
||||
* @ingroup Eolian
|
||||
*/
|
||||
EAPI Eina_Bool eolian_class_event_information_get(const Eolian_Event *event, const char **event_name, const char **event_type, const char **event_desc);
|
||||
EAPI Eina_Bool eolian_class_event_information_get(const Eolian_Event *event, const char **event_name, const Eolian_Type **event_type, const char **event_desc);
|
||||
|
||||
/*
|
||||
* @brief Indicates if the class constructor has to invoke
|
||||
|
|
|
@ -6,7 +6,7 @@ database_event_del(Eolian_Event *event)
|
|||
{
|
||||
if (!event) return;
|
||||
if (event->name) eina_stringshare_del(event->name);
|
||||
if (event->type) eina_stringshare_del(event->type);
|
||||
if (event->comment) eina_stringshare_del(event->comment);
|
||||
database_type_del(event->type);
|
||||
free(event);
|
||||
}
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
#include "eolian_database.h"
|
||||
|
||||
EAPI Eina_Bool
|
||||
eolian_class_event_information_get(const Eolian_Event *event, const char **event_name, const char **event_type, const char **event_comment)
|
||||
eolian_class_event_information_get(const Eolian_Event *event, const char **event_name, const Eolian_Type **event_type, const char **event_comment)
|
||||
{
|
||||
EINA_SAFETY_ON_NULL_RETURN_VAL(event, EINA_FALSE);
|
||||
if (event_name) *event_name = event->name;
|
||||
|
|
|
@ -29,10 +29,13 @@ _implements_print(Eolian_Implement *impl, int nb_spaces)
|
|||
static void
|
||||
_event_print(Eolian_Event *ev, int nb_spaces)
|
||||
{
|
||||
const char *name, *comment, *type;
|
||||
const char *name, *comment;
|
||||
const Eolian_Type *type;
|
||||
|
||||
eolian_class_event_information_get(ev, &name, &type, &comment);
|
||||
printf("%*s <%s> <%s> <%s>\n", nb_spaces + 5, "", name, type, comment);
|
||||
printf("%*s <%s> <", nb_spaces + 5, "", name);
|
||||
database_type_print((Eolian_Type*)type);
|
||||
printf("> <%s>\n", comment);
|
||||
}
|
||||
|
||||
static Eina_Bool _function_print(const Eolian_Function *fid, int nb_spaces)
|
||||
|
|
|
@ -808,9 +808,9 @@ parse_event(Eo_Lexer *ls)
|
|||
if (ls->t.token == '(')
|
||||
{
|
||||
int line = ls->line_number, col = ls->column;
|
||||
eo_lexer_get_balanced(ls, '(', ')');
|
||||
ev->type = eina_stringshare_add(ls->t.value);
|
||||
eo_lexer_get(ls);
|
||||
ev->type = parse_type(ls);
|
||||
pop_type(ls);
|
||||
check_match(ls, ')', '(', line, col);
|
||||
}
|
||||
check(ls, ';');
|
||||
|
|
|
@ -130,8 +130,8 @@ struct _Eolian_Implement
|
|||
struct _Eolian_Event
|
||||
{
|
||||
Eina_Stringshare *name;
|
||||
Eina_Stringshare *type;
|
||||
Eina_Stringshare *comment;
|
||||
Eolian_Type *type;
|
||||
};
|
||||
|
||||
typedef struct _Eolian_Typedef
|
||||
|
|
Loading…
Reference in New Issue