tests/eolian/data/struct_ref_stub.h \
tests/eolian/data/owning.eo.c \
tests/eolian/data/class_simple_ref.c \
-tests/eolian/data/class_simple_ref.legacy.c \
tests/eolian/data/override_ref.c \
tests/eolian/data/class_simple_ref_eo.h \
-tests/eolian/data/class_simple_ref_legacy.h \
tests/eolian/data/import_types_ref.h \
tests/eolian/data/docs_ref.h \
-tests/eolian/data/docs_ref_legacy.h \
tests/eolian/data/function_types_ref.h \
tests/eolian/data/function_as_argument_impl_ref.c \
tests/eolian/data/function_as_argument_ref.c \
if (!fn) goto noref;
- Eina_Stringshare *fcn = eolian_function_full_c_name_get(fn, ftype, use_legacy);
+ Eina_Stringshare *fcn = eolian_function_full_c_name_get(fn, ftype);
if (!fcn) goto noref;
eina_strbuf_append(wbuf, fcn);
eina_stringshare_del(fcn);
Eina_Strbuf *
eo_gen_docs_func_gen(const Eolian_State *state, const Eolian_Function *fid,
- Eolian_Function_Type ftype, int indent,
- Eina_Bool use_legacy)
+ Eolian_Function_Type ftype, int indent)
{
const Eolian_Function_Parameter *par = NULL;
const Eolian_Function_Parameter *vpar = NULL;
int curl = 0;
- const char *group = NULL;
- char legacy_group_name[1024];
- if (use_legacy)
- {
- // Generate legacy doxygen group name
- const char *prefix =
- eolian_class_legacy_prefix_get(eolian_function_class_get(fid));
- unsigned int i;
- snprintf(legacy_group_name, sizeof(legacy_group_name),
- "%s_Group", prefix);
- for (i = 0; i < strlen(legacy_group_name); i++)
- {
- if ((i == 0) || (legacy_group_name[i - 1] == '_'))
- legacy_group_name[i] = toupper(legacy_group_name[i]);
- }
- group = legacy_group_name;
- }
- else
- {
- group = eolian_class_name_get(eolian_function_class_get(fid));
- }
-
+ const char *group = eolian_class_name_get(eolian_function_class_get(fid));
const Eolian_Implement *fimp = eolian_function_implement_get(fid);
if (ftype == EOLIAN_METHOD)
if (!desc && !par && !vpar && !rdoc && (ftype == EOLIAN_METHOD || !pdoc))
{
_gen_doc_brief(state, sum ? sum : "No description supplied.", since, group,
- NULL, indent, buf, use_legacy);
+ NULL, indent, buf, EINA_FALSE);
return buf;
}
eina_strbuf_append(buf, " * @brief ");
curl += sizeof(" * @brief ") - 1;
_append_section(state, sum ? sum : "No description supplied.",
- indent, curl, buf, wbuf, use_legacy);
+ indent, curl, buf, wbuf, EINA_FALSE);
eina_strbuf_append_char(buf, '\n');
if (desc || since || par || rdoc || pdoc)
{
curl = _indent_line(buf, indent);
eina_strbuf_append(buf, " * ");
- _append_section(state, desc, indent, curl + 3, buf, wbuf, use_legacy);
+ _append_section(state, desc, indent, curl + 3, buf, wbuf, EINA_FALSE);
eina_strbuf_append_char(buf, '\n');
if (par || rdoc || pdoc || since)
{
curl = _indent_line(buf, indent);
eina_strbuf_append(buf, " * ");
_append_section(state, eolian_documentation_summary_get(pdoc), indent,
- curl + 3, buf, wbuf, use_legacy);
+ curl + 3, buf, wbuf, EINA_FALSE);
eina_strbuf_append_char(buf, '\n');
if (pdesc)
{
eina_strbuf_append(buf, " *\n");
curl = _indent_line(buf, indent);
eina_strbuf_append(buf, " * ");
- _append_section(state, pdesc, indent, curl + 3, buf, wbuf, use_legacy);
+ _append_section(state, pdesc, indent, curl + 3, buf, wbuf, EINA_FALSE);
eina_strbuf_append_char(buf, '\n');
}
if (par || rdoc || since)
eina_strbuf_append_char(buf, ' ');
curl += 1;
_append_section(state, eolian_documentation_summary_get(adoc),
- indent, curl, buf, wbuf, use_legacy);
+ indent, curl, buf, wbuf, EINA_FALSE);
}
eina_strbuf_append_char(buf, '\n');
eina_strbuf_append(buf, " * @return ");
curl += sizeof(" * @return ") - 1;
_append_section(state, eolian_documentation_summary_get(rdoc), indent,
- curl, buf, wbuf, use_legacy);
+ curl, buf, wbuf, EINA_FALSE);
eina_strbuf_append_char(buf, '\n');
if (since)
{
* @param[in] fid te function
* @param[in] type the function type (either METHOD, PROP_GET, PROP_SET)
* @param[in] indent by how many spaces to indent the comment from second line
- * @param[in] use_legacy whether to use legacy names
*
* @return A documentation comment
*
*/
-Eina_Strbuf *eo_gen_docs_func_gen(const Eolian_State *state, const Eolian_Function *fid, Eolian_Function_Type ftype, int indent, Eina_Bool use_legacy);
+Eina_Strbuf *eo_gen_docs_func_gen(const Eolian_State *state, const Eolian_Function *fid, Eolian_Function_Type ftype, int indent);
/*
* @brief Generate event documentation
static void
_gen_func(const Eolian_State *state, const Eolian_Function *fid,
- Eolian_Function_Type ftype, Eina_Strbuf *buf, char *cname,
- char *cnameu, Eina_Bool legacy)
+ Eolian_Function_Type ftype, Eina_Strbuf *buf, char *cnameu)
{
- Eina_Stringshare *fcn = eolian_function_full_c_name_get(fid, ftype, legacy);
+ Eina_Stringshare *fcn = eolian_function_full_c_name_get(fid, ftype);
if (!fcn)
return;
Eolian_Object_Scope fsc = eolian_function_scope_get(fid, ftype);
- /* this one will never be satisfied in legacy */
if (eolian_function_is_beta(fid))
eina_strbuf_append(buf, "#ifdef EFL_BETA_API_SUPPORT\n");
- /* XXX: is this right? we expose potentially internal stuff into legacy */
- if (!legacy && (fsc == EOLIAN_SCOPE_PROTECTED))
+ if (fsc == EOLIAN_SCOPE_PROTECTED)
eina_strbuf_append_printf(buf, "#ifdef %s_PROTECTED\n", cnameu);
const Eolian_Implement *fimp = eolian_function_implement_get(fid);
hasdoc = !!eolian_implement_documentation_get(fimp, EOLIAN_PROPERTY);
if (hasdoc)
{
- Eina_Strbuf *dbuf = eo_gen_docs_func_gen(state, fid, ftype, 0, legacy);
+ Eina_Strbuf *dbuf = eo_gen_docs_func_gen(state, fid, ftype, 0);
eina_strbuf_append(buf, eina_strbuf_string_get(dbuf));
eina_strbuf_append_char(buf, '\n');
eina_strbuf_free(dbuf);
}
- eina_strbuf_append(buf, legacy ? "EAPI " : "EOAPI ");
+ eina_strbuf_append(buf, "EOAPI ");
if (rtp)
{
Eina_Stringshare *rtps = eolian_type_c_type_get(rtp, EOLIAN_C_TYPE_RETURN);
{
eina_strbuf_append(buf, "const ");
}
- if (legacy)
- eina_strbuf_append_printf(buf, "%s *obj", cname);
- else
- eina_strbuf_append(buf, "Eo *obj");
+ eina_strbuf_append(buf, "Eo *obj");
}
eo_gen_params(eolian_property_keys_get(fid, ftype), buf, &flagbuf, &nidx, EOLIAN_PROPERTY);
}
eina_strbuf_append(buf, ";\n");
- if (!legacy && (fsc == EOLIAN_SCOPE_PROTECTED))
+ if (fsc == EOLIAN_SCOPE_PROTECTED)
eina_strbuf_append_printf(buf, "#endif\n");
if (eolian_function_is_beta(fid))
eina_strbuf_append_printf(buf, "#endif /* EFL_BETA_API_SUPPORT */\n");
eo_gen_header_gen(const Eolian_State *state, const Eolian_Class *cl,
Eina_Strbuf *buf, Eina_Bool legacy)
{
- if (!cl)
+ if (!cl || legacy)
return;
- char *cname = NULL, *cnameu = NULL;
- eo_gen_class_names_get(cl, &cname, &cnameu, NULL);
+ Eina_Iterator *itr;
+ Eolian_Event *ev;
+ char *cnameu = NULL;
+ eo_gen_class_names_get(cl, NULL, &cnameu, NULL);
/* class definition */
- if (!legacy && eolian_class_is_beta(cl))
+ if (eolian_class_is_beta(cl))
{
eina_strbuf_append(buf, "#ifdef EFL_BETA_API_SUPPORT\n");
}
- if (!legacy)
+ const Eolian_Documentation *doc = eolian_class_documentation_get(cl);
+ if (doc)
{
- const Eolian_Documentation *doc = eolian_class_documentation_get(cl);
- if (doc)
+ Eina_Strbuf *cdoc = eo_gen_docs_full_gen(state, doc,
+ eolian_class_name_get(cl), 0, EINA_FALSE);
+ if (cdoc)
{
- Eina_Strbuf *cdoc = eo_gen_docs_full_gen(state, doc,
- eolian_class_name_get(cl), 0, EINA_FALSE);
- if (cdoc)
- {
- eina_strbuf_append(buf, eina_strbuf_string_get(cdoc));
- eina_strbuf_append_char(buf, '\n');
- eina_strbuf_free(cdoc);
- }
+ eina_strbuf_append(buf, eina_strbuf_string_get(cdoc));
+ eina_strbuf_append_char(buf, '\n');
+ eina_strbuf_free(cdoc);
}
+ }
- Eina_Stringshare *mname = eolian_class_c_name_get(cl);
- Eina_Stringshare *gname = eolian_class_c_get_function_name_get(cl);
- eina_strbuf_append_printf(buf, "#define %s %s()\n\n", mname, gname);
- eina_stringshare_del(mname);
+ Eina_Stringshare *mname = eolian_class_c_name_get(cl);
+ Eina_Stringshare *gname = eolian_class_c_get_function_name_get(cl);
+ eina_strbuf_append_printf(buf, "#define %s %s()\n\n", mname, gname);
+ eina_stringshare_del(mname);
- eina_strbuf_append_printf(buf, "EWAPI const Efl_Class *%s(void);\n", gname);
- eina_stringshare_del(gname);
- }
+ eina_strbuf_append_printf(buf, "EWAPI const Efl_Class *%s(void);\n", gname);
+ eina_stringshare_del(gname);
/* method section */
- {
- Eina_Iterator *itr = eolian_class_implements_get(cl);
- if (!itr)
- goto events;
-
- const Eolian_Implement *imp;
- EINA_ITERATOR_FOREACH(itr, imp)
- {
- if (eolian_implement_class_get(imp) != cl)
- continue;
- Eolian_Function_Type ftype = EOLIAN_UNRESOLVED;
- const Eolian_Function *fid = eolian_implement_function_get(imp, &ftype);
- /* beta can only exist for eo api */
- if (legacy && eolian_function_is_beta(fid))
- continue;
- eina_strbuf_append_char(buf, '\n');
- switch (ftype)
- {
- case EOLIAN_PROP_GET:
- case EOLIAN_PROP_SET:
- _gen_func(state, fid, ftype, buf, cname, cnameu, legacy);
- break;
- case EOLIAN_PROPERTY:
- _gen_func(state, fid, EOLIAN_PROP_SET, buf, cname, cnameu, legacy);
- eina_strbuf_append_char(buf, '\n');
- _gen_func(state, fid, EOLIAN_PROP_GET, buf, cname, cnameu, legacy);
- break;
- default:
- _gen_func(state, fid, EOLIAN_METHOD, buf, cname, cnameu, legacy);
- }
- }
- eina_iterator_free(itr);
- }
+ itr = eolian_class_implements_get(cl);
+ if (!itr)
+ goto events;
+
+ const Eolian_Implement *imp;
+ EINA_ITERATOR_FOREACH(itr, imp)
+ {
+ if (eolian_implement_class_get(imp) != cl)
+ continue;
+ Eolian_Function_Type ftype = EOLIAN_UNRESOLVED;
+ const Eolian_Function *fid = eolian_implement_function_get(imp, &ftype);
+ eina_strbuf_append_char(buf, '\n');
+ switch (ftype)
+ {
+ case EOLIAN_PROP_GET:
+ case EOLIAN_PROP_SET:
+ _gen_func(state, fid, ftype, buf, cnameu);
+ break;
+ case EOLIAN_PROPERTY:
+ _gen_func(state, fid, EOLIAN_PROP_SET, buf, cnameu);
+ eina_strbuf_append_char(buf, '\n');
+ _gen_func(state, fid, EOLIAN_PROP_GET, buf, cnameu);
+ break;
+ default:
+ _gen_func(state, fid, EOLIAN_METHOD, buf, cnameu);
+ }
+ }
+ eina_iterator_free(itr);
events:
/* event section */
- if (!legacy)
+ itr = eolian_class_events_get(cl);
+ EINA_ITERATOR_FOREACH(itr, ev)
{
- Eina_Iterator *itr = eolian_class_events_get(cl);
- Eolian_Event *ev;
- EINA_ITERATOR_FOREACH(itr, ev)
+ Eina_Stringshare *evn = eolian_event_c_name_get(ev);
+ Eolian_Object_Scope evs = eolian_event_scope_get(ev);
+
+ if (evs == EOLIAN_SCOPE_PRIVATE)
+ continue;
+
+ if (eolian_event_is_beta(ev))
{
- Eina_Stringshare *evn = eolian_event_c_name_get(ev);
- Eolian_Object_Scope evs = eolian_event_scope_get(ev);
-
- if (evs == EOLIAN_SCOPE_PRIVATE)
- continue;
-
- if (eolian_event_is_beta(ev))
- {
- eina_strbuf_append(buf, "#ifdef EFL_BETA_API_SUPPORT\n");
- }
- if (evs == EOLIAN_SCOPE_PROTECTED)
- {
- if (!eolian_event_is_beta(ev))
- eina_strbuf_append_char(buf, '\n');
- eina_strbuf_append_printf(buf, "#ifdef %s_PROTECTED\n", cnameu);
- }
-
- if (!eolian_event_is_beta(ev) && evs == EOLIAN_SCOPE_PUBLIC)
+ eina_strbuf_append(buf, "#ifdef EFL_BETA_API_SUPPORT\n");
+ }
+ if (evs == EOLIAN_SCOPE_PROTECTED)
+ {
+ if (!eolian_event_is_beta(ev))
eina_strbuf_append_char(buf, '\n');
+ eina_strbuf_append_printf(buf, "#ifdef %s_PROTECTED\n", cnameu);
+ }
- eina_strbuf_append_printf(buf, "EWAPI extern const "
- "Efl_Event_Description _%s;\n\n", evn);
+ if (!eolian_event_is_beta(ev) && evs == EOLIAN_SCOPE_PUBLIC)
+ eina_strbuf_append_char(buf, '\n');
- Eina_Strbuf *evdbuf = eo_gen_docs_event_gen(state, ev,
- eolian_class_name_get(cl));
- eina_strbuf_append(buf, eina_strbuf_string_get(evdbuf));
- eina_strbuf_append_char(buf, '\n');
- eina_strbuf_free(evdbuf);
- eina_strbuf_append_printf(buf, "#define %s (&(_%s))\n", evn, evn);
+ eina_strbuf_append_printf(buf, "EWAPI extern const "
+ "Efl_Event_Description _%s;\n\n", evn);
- if (evs == EOLIAN_SCOPE_PROTECTED)
- eina_strbuf_append(buf, "#endif\n");
- if (eolian_event_is_beta(ev))
- eina_strbuf_append(buf, "#endif /* EFL_BETA_API_SUPPORT */\n");
+ Eina_Strbuf *evdbuf = eo_gen_docs_event_gen(state, ev,
+ eolian_class_name_get(cl));
+ eina_strbuf_append(buf, eina_strbuf_string_get(evdbuf));
+ eina_strbuf_append_char(buf, '\n');
+ eina_strbuf_free(evdbuf);
+ eina_strbuf_append_printf(buf, "#define %s (&(_%s))\n", evn, evn);
- eina_stringshare_del(evn);
- }
- eina_iterator_free(itr);
+ if (evs == EOLIAN_SCOPE_PROTECTED)
+ eina_strbuf_append(buf, "#endif\n");
+ if (eolian_event_is_beta(ev))
+ eina_strbuf_append(buf, "#endif /* EFL_BETA_API_SUPPORT */\n");
+
+ eina_stringshare_del(evn);
}
- if (!legacy && eolian_class_is_beta(cl))
+ eina_iterator_free(itr);
+
+ if (eolian_class_is_beta(cl))
{
eina_strbuf_append(buf, "#endif /* EFL_BETA_API_SUPPORT */\n");
}
- free(cname);
free(cnameu);
}
{
INF("generating source: %s", ofname);
Eina_Strbuf *buf = eina_strbuf_new();
- Eina_Strbuf *lbuf = eina_strbuf_new();
- Eina_Strbuf *oflname = eina_strbuf_new();
Eina_Bool ret = EINA_FALSE;
- const char *lext = strrchr(ofname, '.');
- if (!lext)
- {
- eina_strbuf_append(oflname, ofname);
- eina_strbuf_append(oflname, ".legacy.c");
- }
- else
- {
- eina_strbuf_append_length(oflname, ofname, strlen(ofname) - strlen(lext));
- eina_strbuf_append(oflname, ".legacy");
- eina_strbuf_append(oflname, lext);
- }
- const char *lfname = eina_strbuf_string_get(oflname);
- {
- const char *p1 = strrchr(lfname, '/');
- const char *p2 = strrchr(lfname, '\\');
- lfname = (p1 || p2) ? ((p1 > p2) ? (p1 + 1) : (p2 + 1)) : lfname;
- }
const Eolian_Class *cl = eolian_state_class_by_file_get(eos, ifname);
eo_gen_types_source_gen(eolian_state_objects_by_file_get(eos, ifname), buf);
- eo_gen_source_gen(cl, buf, lbuf, lfname);
+ eo_gen_source_gen(cl, buf);
if (cl || (eot && eina_strbuf_length_get(buf)))
{
if (!_write_file(ofname, buf))
goto done;
- if (eina_strbuf_length_get(lbuf))
- {
- if (!_write_file(eina_strbuf_string_get(oflname), lbuf))
- goto done;
- }
ret = EINA_TRUE;
}
done:
eina_strbuf_free(buf);
- eina_strbuf_free(lbuf);
- eina_strbuf_free(oflname);
return ret;
}
Eina_Stringshare *ct = eolian_type_c_type_get(valt, EOLIAN_C_TYPE_RETURN);
const char *starsp = (ct[strlen(ct) - 1] != '*') ? " " : "";
- Eina_Stringshare *fcn = eolian_function_full_c_name_get(fid, EOLIAN_PROP_GET, EINA_FALSE);
+ Eina_Stringshare *fcn = eolian_function_full_c_name_get(fid, EOLIAN_PROP_GET);
eina_strbuf_append_printf(buf, " %s%sval = %s(obj);\n", ct, starsp, fcn);
eina_stringshare_del(fcn);
eina_stringshare_del(ct);
eina_strbuf_append(buf, " goto end;\n");
eina_strbuf_append(buf, " }\n");
- Eina_Stringshare *fcn = eolian_function_full_c_name_get(fid, EOLIAN_PROP_SET, EINA_FALSE);
+ Eina_Stringshare *fcn = eolian_function_full_c_name_get(fid, EOLIAN_PROP_SET);
eina_strbuf_append_printf(buf, " %s(obj, cval);\n", fcn);
eina_stringshare_del(fcn);
static void
_gen_func(const Eolian_Class *cl, const Eolian_Function *fid,
Eolian_Function_Type ftype, Eina_Strbuf *buf,
- const Eolian_Implement *impl, Eina_Strbuf *lbuf,
- Eina_Hash *refh)
+ const Eolian_Implement *impl, Eina_Hash *refh)
{
Eina_Bool is_empty = eolian_implement_is_empty(impl, ftype);
Eina_Bool is_auto = eolian_implement_is_auto(impl, ftype);
{
//we have owned parameters we need to take care of
eina_strbuf_append_printf(buf, "static void\n");
- eina_strbuf_append_printf(buf, "_%s_ownership_fallback(%s)\n{\n", eolian_function_full_c_name_get(fid, ftype, EINA_FALSE), eina_strbuf_string_get(params_full) + 2);
+ eina_strbuf_append_printf(buf, "_%s_ownership_fallback(%s)\n{\n", eolian_function_full_c_name_get(fid, ftype), eina_strbuf_string_get(params_full) + 2);
eina_strbuf_append_buffer(buf, fallback_free_ownership);
eina_strbuf_append_printf(buf, "}\n\n");
eina_strbuf_append_char(buf, '(');
- Eina_Stringshare *eofn = eolian_function_full_c_name_get(fid, ftype, EINA_FALSE);
+ Eina_Stringshare *eofn = eolian_function_full_c_name_get(fid, ftype);
eina_strbuf_append(buf, eofn);
if (strcmp(rtpn, "void"))
}
if (fallback_free_ownership)
- eina_strbuf_append_printf(buf, ", _%s_ownership_fallback(%s);", eolian_function_full_c_name_get(fid, ftype, EINA_FALSE), eina_strbuf_string_get(params));
+ eina_strbuf_append_printf(buf, ", _%s_ownership_fallback(%s);", eolian_function_full_c_name_get(fid, ftype), eina_strbuf_string_get(params));
if (has_params)
{
eina_strbuf_append(buf, ");\n");
- /* now try legacy */
- Eina_Stringshare *lfn = eolian_function_full_c_name_get(fid, ftype, EINA_TRUE);
- if (!eolian_function_is_beta(fid) && lfn)
- {
- eina_strbuf_append(lbuf, "\nEAPI ");
- eina_strbuf_append(lbuf, rtpn);
- eina_strbuf_append_char(lbuf, '\n');
- eina_strbuf_append(lbuf, lfn);
- /* param list */
- eina_strbuf_append_char(lbuf, '(');
- /* for class funcs, offset the params to remove comma */
- int poff = 2;
- if (!eolian_function_is_class(fid))
- {
- /* non-class funcs have the obj though */
- poff = 0;
- if ((ftype == EOLIAN_PROP_GET) || eolian_function_object_is_const(fid))
- eina_strbuf_append(lbuf, "const ");
- eina_strbuf_append_printf(lbuf, "%s *obj", cname);
- }
- eina_strbuf_append(lbuf, eina_strbuf_string_get(params_full) + poff);
- eina_strbuf_append(lbuf, ")\n{\n");
- /* body */
- if (strcmp(rtpn, "void"))
- eina_strbuf_append(lbuf, " return ");
- else
- eina_strbuf_append(lbuf, " ");
- eina_strbuf_append(lbuf, eofn);
- eina_strbuf_append_char(lbuf, '(');
- if (!eolian_function_is_class(fid))
- eina_strbuf_append(lbuf, "obj");
- else
- {
- Eina_Stringshare *mname = eolian_class_c_name_get(cl);
- eina_strbuf_append(lbuf, mname);
- eina_stringshare_del(mname);
- }
- if (has_params)
- eina_strbuf_append_printf(lbuf, ", %s", eina_strbuf_string_get(params));
- eina_strbuf_append(lbuf, ");\n}\n");
- }
-
- eina_stringshare_del(lfn);
eina_stringshare_del(eofn);
}
if (impl_same_class && eolian_function_is_class(fid))
- {
- const char *legacy_name = eolian_function_full_c_name_get(fid, ftype, EINA_TRUE);
-
- _emit_class_function(buf, fid, rtp, params_full, ocnamel, func_suffix, params, eolian_function_full_c_name_get(fid, ftype, EINA_FALSE));
- if (legacy_name)
- _emit_class_function(buf, fid, rtp, params_full, ocnamel, func_suffix, params, legacy_name);
- }
+ _emit_class_function(buf, fid, rtp, params_full, ocnamel, func_suffix, params, eolian_function_full_c_name_get(fid, ftype));
free(cname);
free(cnamel);
Eina_Strbuf *buf, const Eolian_Implement *impl, Eina_Bool pinit,
const char *cnamel, const char *ocnamel)
{
- Eina_Stringshare *fnm = eolian_function_full_c_name_get(fid, ftype, EINA_FALSE);
+ Eina_Stringshare *fnm = eolian_function_full_c_name_get(fid, ftype);
eina_strbuf_append(buf, " EFL_OBJECT_OP_FUNC(");
eina_strbuf_append(buf, fnm);
eina_strbuf_append(buf, ", ");
}
void
-eo_gen_source_gen(const Eolian_Class *cl, Eina_Strbuf *buf, Eina_Strbuf *lbuf,
- const char *lfname)
+eo_gen_source_gen(const Eolian_Class *cl, Eina_Strbuf *buf)
{
if (!cl)
return;
{
case EOLIAN_PROP_GET:
case EOLIAN_PROP_SET:
- _gen_func(cl, fid, ftype, buf, imp, lbuf, refh);
+ _gen_func(cl, fid, ftype, buf, imp, refh);
break;
case EOLIAN_PROPERTY:
- _gen_func(cl, fid, EOLIAN_PROP_SET, buf, imp, lbuf, refh);
- _gen_func(cl, fid, EOLIAN_PROP_GET, buf, imp, lbuf, refh);
+ _gen_func(cl, fid, EOLIAN_PROP_SET, buf, imp, refh);
+ _gen_func(cl, fid, EOLIAN_PROP_GET, buf, imp, refh);
break;
default:
- _gen_func(cl, fid, EOLIAN_METHOD, buf, imp, lbuf, refh);
+ _gen_func(cl, fid, EOLIAN_METHOD, buf, imp, refh);
}
}
eina_iterator_free(itr);
/* terminate inherits */
eina_strbuf_append(buf, ", NULL);\n");
- /* append legacy include if there */
- if (eina_strbuf_length_get(lbuf))
- eina_strbuf_append_printf(buf, "\n#include \"%s\"\n", lfname);
-
/* and we're done */
free(cnamel);
eina_hash_free(_funcs_params_init_get);
if (strlen(efname) >= (sizeof("destructor") - 1) && !impl_same_class)
if (!strcmp(efname + strlen(efname) - sizeof("destructor") + 1, "destructor"))
{
- Eina_Stringshare *fcn = eolian_function_full_c_name_get(fid, ftype, EINA_FALSE);
+ Eina_Stringshare *fcn = eolian_function_full_c_name_get(fid, ftype);
Eina_Stringshare *mname = eolian_class_c_name_get(cl);
eina_strbuf_append(buf, " ");
eina_strbuf_append(buf, fcn);
#include "main.h"
-void eo_gen_source_gen(const Eolian_Class *cl, Eina_Strbuf *buf, Eina_Strbuf *lbuf, const char *lfname);
+void eo_gen_source_gen(const Eolian_Class *cl, Eina_Strbuf *buf);
void eo_gen_impl_gen(const Eolian_Class *cl, Eina_Strbuf *buf);
#endif
{
case ::EOLIAN_METHOD:
if (blacklist::is_function_blacklisted(
- ::eolian_function_full_c_name_get(function, ftype, EINA_FALSE))) return "";
+ ::eolian_function_full_c_name_get(function, ftype))) return "";
name += ".";
name += name_helpers::managed_method_name(
::eolian_object_short_name_get(klass), eo_name);
Eolian_Class_Type eolian_class_type_get(const Eolian_Class *klass);
const Eolian_Documentation *eolian_class_documentation_get(const Eolian_Class *klass);
- const char *eolian_class_legacy_prefix_get(const Eolian_Class *klass);
const char *eolian_class_eo_prefix_get(const Eolian_Class *klass);
const char *eolian_class_data_type_get(const Eolian_Class *klass);
const Eolian_Class *eolian_class_parent_get(const Eolian_Class *klass);
Eina_Iterator *eolian_class_functions_get(const Eolian_Class *klass, Eolian_Function_Type func_type);
Eolian_Function_Type eolian_function_type_get(const Eolian_Function *function_id);
Eolian_Object_Scope eolian_function_scope_get(const Eolian_Function *function_id, Eolian_Function_Type ftype);
- const char *eolian_function_full_c_name_get(const Eolian_Function *function_id, Eolian_Function_Type ftype, Eina_Bool use_legacy);
+ const char *eolian_function_full_c_name_get(const Eolian_Function *function_id, Eolian_Function_Type ftype);
const Eolian_Function *eolian_class_function_by_name_get(const Eolian_Class *klass, const char *func_name, Eolian_Function_Type f_type);
- const char *eolian_function_legacy_get(const Eolian_Function *function_id, Eolian_Function_Type f_type);
const Eolian_Implement *eolian_function_implement_get(const Eolian_Function *function_id);
- Eina_Bool eolian_function_is_legacy_only(const Eolian_Function *function_id, Eolian_Function_Type ftype);
Eina_Bool eolian_function_is_class(const Eolian_Function *function_id);
Eina_Bool eolian_function_is_constructor(const Eolian_Function *function_id, const Eolian_Class *klass);
Eina_Bool eolian_function_is_function_pointer(const Eolian_Function *function_id);
return tonumber(eolian.eolian_function_scope_get(self, ftype))
end,
- full_c_name_get = function(self, ftype, use_legacy)
- local v = eolian.eolian_function_full_c_name_get(self, ftype, use_legacy or false)
+ full_c_name_get = function(self, ftype)
+ local v = eolian.eolian_function_full_c_name_get(self, ftype)
if v == nil then return nil end
return ffi_stringshare(v)
end,
- legacy_get = function(self, ftype)
- local v = eolian.eolian_function_legacy_get(self, ftype)
- if v == nil then return nil end
- return ffi.string(v)
- end,
-
implement_get = function(self)
local v = eolian.eolian_function_implement_get(self)
if v == nil then return nil end
return v
end,
- is_legacy_only = function(self, ftype)
- return eolian.eolian_function_is_legacy_only(self, ftype) ~= 0
- end,
-
is_class = function(self)
return eolian.eolian_function_is_class(self) ~= 0
end,
return v
end,
- legacy_prefix_get = function(self)
- local v = eolian.eolian_class_legacy_prefix_get(self)
- if v == nil then return nil end
- return ffi.string(v)
- end,
-
eo_prefix_get = function(self)
local v = eolian.eolian_class_eo_prefix_get(self)
if v == nil then
methods {
rgb_24bits_constructor {
[[RGB Constructor.]]
- legacy: null;
params {
@in rgb: int; [[24-bit RGB Component.]]
}
}
}
size_constructor {
- legacy: null;
params {
@in size: int;
}
EAPI const Eolian_Documentation *eolian_class_documentation_get(const Eolian_Class *klass);
/*
- * @brief Returns the legacy prefix of a class
- *
- * @param[in] klass the class
- * @return the legacy prefix
- *
- * @ingroup Eolian
- */
-EAPI Eina_Stringshare *eolian_class_legacy_prefix_get(const Eolian_Class *klass);
-
-/*
* @brief Returns the eo prefix of a class
*
* @param[in] klass the class
*
* @param[in] function_id Id of the function
* @param[in] ftype The type of function to get the name for
- * @param[in] use_legacy If true, legacy prefix or name will be used when available
* @return the function name
*
* It's here because the C API names are deduplicated (prefix of function and
* suffix of prefix merge if applicable) and this helps generators not write
* the same code over and over.
*
- * If legacy name is supplied for the given type and use_legacy is set, it
- * will be used. Also, if the given type is PROP_GET or PROPERTY, a "_get"
- * suffix will be applied when not using legacy name, and "_set" for PROP_SET.
+ * If the given type is PROP_GET or PROPERTY, a "_get" suffix will be applied,
+ * and "_set" for PROP_SET.
*
* Also, you're responsible for deleting the stringshare.
*
* @ingroup Eolian
*/
-EAPI Eina_Stringshare *eolian_function_full_c_name_get(const Eolian_Function *function_id, Eolian_Function_Type ftype, Eina_Bool use_legacy);
+EAPI Eina_Stringshare *eolian_function_full_c_name_get(const Eolian_Function *function_id, Eolian_Function_Type ftype);
/*
* @brief Get a function in a class by its name and type
EAPI const Eolian_Function *eolian_class_function_by_name_get(const Eolian_Class *klass, const char *func_name, Eolian_Function_Type f_type);
/*
- * @brief Returns a legacy name for a function.
- *
- * @param[in] function_id Id of the function
- * @param[in] f_type The function type, for property get/set distinction.
- * @return the legacy name or NULL.
- *
- * Acceptable input types are METHOD, PROP_GET and PROP_SET.
- *
- * @ingroup Eolian
- */
-EAPI Eina_Stringshare *eolian_function_legacy_get(const Eolian_Function *function_id, Eolian_Function_Type f_type);
-
-/*
* @brief Returns the implement for a function.
*
* @param[in] function_id Id of the function
EAPI const Eolian_Implement *eolian_function_implement_get(const Eolian_Function *function_id);
/*
- * @brief Indicates if a function is legacy only.
- *
- * @param[in] function_id Id of the function
- * @param[in] f_type The function type, for property get/set distinction.
- * @return EINA_TRUE if legacy only, EINA_FALSE otherwise.
- *
- * Acceptable input types are METHOD, PROP_GET and PROP_SET.
- *
- * @ingroup Eolian
- */
-EAPI Eina_Bool eolian_function_is_legacy_only(const Eolian_Function *function_id, Eolian_Function_Type ftype);
-
-/*
* @brief Get whether a function is a class method/property.
*
* @param[in] function_id Id of the function
eina_list_free(cl->callables);
eina_list_free(cl->composite);
- if (cl->legacy_prefix) eina_stringshare_del(cl->legacy_prefix);
if (cl->eo_prefix) eina_stringshare_del(cl->eo_prefix);
if (cl->ev_prefix) eina_stringshare_del(cl->ev_prefix);
if (cl->data_type) eina_stringshare_del(cl->data_type);
}
EAPI Eina_Stringshare*
-eolian_class_legacy_prefix_get(const Eolian_Class *cl)
-{
- EINA_SAFETY_ON_NULL_RETURN_VAL(cl, NULL);
- return cl->legacy_prefix;
-}
-
-EAPI Eina_Stringshare*
eolian_class_eo_prefix_get(const Eolian_Class *cl)
{
EINA_SAFETY_ON_NULL_RETURN_VAL(cl, NULL);
database_type_del(fid->set_ret_type);
database_expr_del(fid->get_ret_val);
database_expr_del(fid->set_ret_val);
- if (fid->get_legacy) eina_stringshare_del(fid->get_legacy);
- if (fid->set_legacy) eina_stringshare_del(fid->set_legacy);
database_doc_del(fid->get_return_doc);
database_doc_del(fid->set_return_doc);
free(fid);
}
static const char *
-_get_eo_prefix(const Eolian_Function *foo_id, char *buf, Eina_Bool use_legacy)
+_get_eo_prefix(const Eolian_Function *foo_id, char *buf)
{
char *tmp = buf;
- if (use_legacy)
- return foo_id->klass->legacy_prefix;
- else if (foo_id->klass->eo_prefix)
+ if (foo_id->klass->eo_prefix)
return foo_id->klass->eo_prefix;
strcpy(buf, foo_id->klass->base.name);
eina_str_tolower(&buf);
EAPI Eina_Stringshare *
eolian_function_full_c_name_get(const Eolian_Function *foo_id,
- Eolian_Function_Type ftype,
- Eina_Bool use_legacy)
+ Eolian_Function_Type ftype)
{
- switch (ftype)
- {
- case EOLIAN_UNRESOLVED:
- case EOLIAN_METHOD:
- case EOLIAN_PROPERTY:
- case EOLIAN_PROP_GET:
- case EOLIAN_FUNCTION_POINTER:
- if (foo_id->get_legacy && use_legacy)
- {
- if (!strcmp(foo_id->get_legacy, "null"))
- return NULL;
- return eina_stringshare_ref(foo_id->get_legacy);
- }
- break;
- case EOLIAN_PROP_SET:
- if (foo_id->set_legacy && use_legacy)
- {
- if (!strcmp(foo_id->set_legacy, "null"))
- return NULL;
- return eina_stringshare_ref(foo_id->set_legacy);
- }
- break;
- }
-
char tbuf[512];
tbuf[0] = '\0';
- const char *prefix = (ftype != EOLIAN_FUNCTION_POINTER) ? _get_eo_prefix(foo_id, tbuf, use_legacy): tbuf;
+ const char *prefix = (ftype != EOLIAN_FUNCTION_POINTER) ? _get_eo_prefix(foo_id, tbuf): tbuf;
if (!prefix)
return NULL;
Eina_Strbuf *buf = eina_strbuf_new();
Eina_Stringshare *ret;
- if (use_legacy)
- {
- eina_strbuf_append(buf, prefix);
- eina_strbuf_append_char(buf, '_');
- eina_strbuf_append(buf, funcn);
-
- if ((ftype == EOLIAN_PROP_GET) || (ftype == EOLIAN_PROPERTY))
- eina_strbuf_append(buf, "_get");
- else if (ftype == EOLIAN_PROP_SET)
- eina_strbuf_append(buf, "_set");
-
- ret = eina_stringshare_add(eina_strbuf_string_get(buf));
- eina_strbuf_free(buf);
- return ret;
- }
-
char *abbr = _get_abbreviated_name(prefix, funcn);
eina_strbuf_append(buf, abbr);
free(abbr);
return ret;
}
-EAPI Eina_Stringshare *
-eolian_function_legacy_get(const Eolian_Function *fid, Eolian_Function_Type ftype)
-{
- EINA_SAFETY_ON_NULL_RETURN_VAL(fid, NULL);
- EINA_SAFETY_ON_FALSE_RETURN_VAL(ftype != EOLIAN_UNRESOLVED, NULL);
- EINA_SAFETY_ON_FALSE_RETURN_VAL(ftype != EOLIAN_PROPERTY, NULL);
- switch (ftype)
- {
- case EOLIAN_METHOD:
- if (fid->type != EOLIAN_METHOD)
- return NULL;
- return fid->get_legacy;
- case EOLIAN_PROP_GET:
- if ((fid->type != EOLIAN_PROP_GET) && (fid->type != EOLIAN_PROPERTY))
- return NULL;
- return fid->get_legacy;
- case EOLIAN_PROP_SET:
- if ((fid->type != EOLIAN_PROP_SET) && (fid->type != EOLIAN_PROPERTY))
- return NULL;
- return fid->set_legacy;
- default:
- return NULL;
- }
-}
-
EAPI const Eolian_Implement *
eolian_function_implement_get(const Eolian_Function *fid)
{
}
EAPI Eina_Bool
-eolian_function_is_legacy_only(const Eolian_Function *fid, Eolian_Function_Type ftype)
-{
- EINA_SAFETY_ON_NULL_RETURN_VAL(fid, EINA_FALSE);
- EINA_SAFETY_ON_FALSE_RETURN_VAL(ftype != EOLIAN_UNRESOLVED, EINA_FALSE);
- EINA_SAFETY_ON_FALSE_RETURN_VAL(ftype != EOLIAN_PROPERTY, EINA_FALSE);
- switch (ftype)
- {
- case EOLIAN_METHOD:
- if (fid->type != EOLIAN_METHOD)
- return EINA_FALSE;
- return fid->get_only_legacy;
- case EOLIAN_PROP_GET:
- if ((fid->type != EOLIAN_PROP_GET) && (fid->type != EOLIAN_PROPERTY))
- return EINA_FALSE;
- return fid->get_only_legacy;
- case EOLIAN_PROP_SET:
- if ((fid->type != EOLIAN_PROP_SET) && (fid->type != EOLIAN_PROPERTY))
- return EINA_FALSE;
- return fid->set_only_legacy;
- default:
- return EINA_FALSE;
- }
-}
-
-EAPI Eina_Bool
eolian_function_is_class(const Eolian_Function *fid)
{
EINA_SAFETY_ON_NULL_RETURN_VAL(fid, EINA_FALSE);
database_type_del(tp->base_type);
if (tp->fields) eina_hash_free(tp->fields);
if (tp->field_list) eina_list_free(tp->field_list);
- if (tp->legacy) eina_stringshare_del(tp->legacy);
if (tp->freefunc) eina_stringshare_del(tp->freefunc);
database_doc_del(tp->doc);
free(tp);
return EINA_FALSE;
}
- if (tp->is_ptr && !tp->legacy)
+ if (tp->is_ptr)
{
tp->is_ptr = EINA_FALSE;
Eina_Bool still_ownable = database_type_is_ownable(src, tp, EINA_FALSE);
#define KEYWORDS KW(class), KW(const), KW(enum), KW(return), KW(struct), \
\
KW(abstract), KW(composite), KW(constructor), KW(constructors), KW(data), \
- KW(destructor), KW(eo), KW(eo_prefix), KW(event_prefix), KW(events), \
+ KW(destructor), KW(eo_prefix), KW(event_prefix), KW(events), \
KW(extends), KW(free), KW(get), KW(implements), KW(import), KW(interface), \
- KW(keys), KW(legacy), KW(legacy_prefix), KW(methods), KW(mixin), KW(params), \
+ KW(keys), KW(legacy), KW(methods), KW(mixin), KW(params), \
KW(parse), KW(parts), KW(ptr), KW(set), KW(type), KW(values), KW(var), KW(requires), \
\
KWAT(auto), KWAT(beta), KWAT(class), KWAT(const), KWAT(cref), KWAT(empty), \
check_match(ls, ')', '(', pline, pcol);
return def;
}
- case KW_legacy:
- {
- int pline, pcol;
- eo_lexer_get(ls);
- pline = ls->line_number;
- pcol = ls->column;
- check_next(ls, '(');
- def = parse_type_void(ls, allow_ptr);
- FILL_BASE(def->base, ls, line, col, TYPE);
- def->legacy = EINA_TRUE;
- check_match(ls, ')', '(', pline, pcol);
- return def;
- }
case KW_free:
{
int pline, pcolumn;
}
static void
-parse_legacy(Eo_Lexer *ls, const char **out)
-{
- eo_lexer_get(ls);
- check_next(ls, ':');
- check(ls, TOK_VALUE);
- *out = eina_stringshare_ref(ls->t.value.s);
- eo_lexer_get(ls);
- check_next(ls, ';');
-}
-
-static void
parse_params(Eo_Lexer *ls, Eina_List **params, Eina_Bool allow_inout,
Eina_Bool is_vals)
{
parse_accessor(Eo_Lexer *ls, Eolian_Function *prop)
{
int line, col;
- Eina_Bool has_return = EINA_FALSE, has_legacy = EINA_FALSE,
+ Eina_Bool has_return = EINA_FALSE,
has_eo = EINA_FALSE, has_keys = EINA_FALSE,
has_values = EINA_FALSE, has_protected = EINA_FALSE,
has_virtp = EINA_FALSE;
prop->set_ret_type->owned = ret.owned;
}
break;
- case KW_legacy:
- CASE_LOCK(ls, legacy, "legacy name")
- if (is_get)
- parse_legacy(ls, &prop->get_legacy);
- else
- parse_legacy(ls, &prop->set_legacy);
- break;
- case KW_eo:
- CASE_LOCK(ls, eo, "eo name")
- eo_lexer_get(ls);
- check_next(ls, ':');
- check_kw_next(ls, KW_null);
- check_next(ls, ';');
- if (is_get)
- prop->get_only_legacy = EINA_TRUE;
- else
- prop->set_only_legacy = EINA_TRUE;
- break;
case KW_keys:
{
Eina_List **stor;
Eolian_Function *meth = NULL;
Eolian_Implement *impl = NULL;
Eina_Bool has_const = EINA_FALSE, has_params = EINA_FALSE,
- has_return = EINA_FALSE, has_legacy = EINA_FALSE,
+ has_return = EINA_FALSE,
has_protected = EINA_FALSE, has_class = EINA_FALSE,
has_eo = EINA_FALSE, has_beta = EINA_FALSE,
has_virtp = EINA_FALSE;
meth->get_return_warn_unused = ret.warn_unused;
meth->get_ret_type->owned = ret.owned;
break;
- case KW_legacy:
- CASE_LOCK(ls, legacy, "legacy name")
- parse_legacy(ls, &meth->get_legacy);
- break;
- case KW_eo:
- CASE_LOCK(ls, eo, "eo name")
- eo_lexer_get(ls);
- check_next(ls, ':');
- check_kw_next(ls, KW_null);
- check_next(ls, ';');
- meth->get_only_legacy = EINA_TRUE;
- break;
case KW_params:
CASE_LOCK(ls, params, "params definition")
parse_params(ls, &meth->params, EINA_TRUE, EINA_FALSE);
static void
parse_class_body(Eo_Lexer *ls, Eolian_Class_Type type)
{
- Eina_Bool has_legacy_prefix = EINA_FALSE,
- has_eo_prefix = EINA_FALSE,
+ Eina_Bool has_eo_prefix = EINA_FALSE,
has_event_prefix = EINA_FALSE,
has_data = EINA_FALSE,
has_methods = EINA_FALSE,
}
for (;;) switch (ls->t.kw)
{
- case KW_legacy_prefix:
- CASE_LOCK(ls, legacy_prefix, "legacy prefix definition")
- eo_lexer_get(ls);
- check_next(ls, ':');
- _validate_pfx(ls);
- ls->klass->legacy_prefix = eina_stringshare_ref(ls->t.value.s);
- eo_lexer_get(ls);
- check_next(ls, ';');
- break;
case KW_eo_prefix:
CASE_LOCK(ls, eo_prefix, "eo prefix definition")
eo_lexer_get(ls);
Eolian_Object base;
Eolian_Class_Type type;
Eolian_Documentation *doc;
- Eina_Stringshare *legacy_prefix;
Eina_Stringshare *eo_prefix;
Eina_Stringshare *ev_prefix;
Eina_Stringshare *data_type;
Eolian_Expression *get_ret_val;
Eolian_Expression *set_ret_val;
Eolian_Implement *impl;
- Eina_Stringshare *get_legacy;
- Eina_Stringshare *set_legacy;
Eolian_Documentation *get_return_doc;
Eolian_Documentation *set_return_doc;
Eina_Bool obj_is_const :1; /* True if the object has to be const. Useful for a few methods. */
Eina_Bool get_return_warn_unused :1; /* also used for methods */
Eina_Bool set_return_warn_unused :1;
- Eina_Bool get_only_legacy: 1;
- Eina_Bool set_only_legacy: 1;
Eina_Bool is_class :1;
Eina_List *ctor_of;
Eolian_Class *klass;
Eina_Bool is_const :1;
Eina_Bool is_ptr :1;
Eina_Bool owned :1;
- Eina_Bool legacy :1;
};
struct _Eolian_Typedecl
else
parameters.insert(parameters.end(), values.begin(), values.end());
}
- c_name = eolian_function_full_c_name_get(function, type, EINA_FALSE);
+ c_name = eolian_function_full_c_name_get(function, type);
if (type != EOLIAN_FUNCTION_POINTER)
{
const Eolian_Class *eolian_klass = eolian_function_class_get(function);
efl::eina::optional<function_def> getter(nullptr);
efl::eina::optional<function_def> setter(nullptr);
try {
- if(! ::eolian_function_is_legacy_only(function, EOLIAN_PROP_GET)
- && ::eolian_function_scope_get(function, EOLIAN_PROP_GET) != EOLIAN_SCOPE_PRIVATE)
+ if(::eolian_function_scope_get(function, EOLIAN_PROP_GET) != EOLIAN_SCOPE_PRIVATE)
{
function_def f(function, EOLIAN_PROP_GET, NULL, unit);
functions.push_back(f);
}
} catch(std::exception const&) {}
try {
- if(! ::eolian_function_is_legacy_only(function, EOLIAN_PROP_SET)
- && ::eolian_function_scope_get(function, EOLIAN_PROP_SET) != EOLIAN_SCOPE_PRIVATE)
+ if(::eolian_function_scope_get(function, EOLIAN_PROP_SET) != EOLIAN_SCOPE_PRIVATE)
{
function_def f(function, EOLIAN_PROP_SET, NULL, unit);
functions.push_back(f);
}
else
try {
- if(! ::eolian_function_is_legacy_only(function, func_type)
- && ::eolian_function_scope_get(function, func_type) != EOLIAN_SCOPE_PRIVATE)
+ if(::eolian_function_scope_get(function, func_type) != EOLIAN_SCOPE_PRIVATE)
{
efl::eina::optional<function_def> getter(nullptr);
efl::eina::optional<function_def> setter(nullptr);
try {
Eolian_Function const* function = &*eolian_functions;
Eolian_Function_Type func_type = eolian_function_type_get(function);
- if(! ::eolian_function_is_legacy_only(function, EOLIAN_METHOD)
- && ::eolian_function_scope_get(function, func_type) != EOLIAN_SCOPE_PRIVATE)
+ if(::eolian_function_scope_get(function, func_type) != EOLIAN_SCOPE_PRIVATE)
functions.push_back({function, EOLIAN_METHOD, NULL, unit});
} catch(std::exception const&) {}
}
return ret
@cached_property
- def legacy_prefix(self):
- return _str_to_py(lib.eolian_class_legacy_prefix_get(self))
-
- @cached_property
def eo_prefix(self):
return _str_to_py(lib.eolian_class_eo_prefix_get(self))
def __repr__(self):
return "<eolian.Function '{0.name}'>".format(self)
- def full_c_name_get(self, ftype, use_legacy=False):
- s = lib.eolian_function_full_c_name_get(self, ftype, use_legacy)
+ def full_c_name_get(self, ftype):
+ s = lib.eolian_function_full_c_name_get(self, ftype)
ret = _str_to_py(s)
lib.eina_stringshare_del(c_void_p(s))
return ret
return self.full_c_name_get(Eolian_Function_Type.PROP_SET)
@cached_property
- def full_c_method_name_legacy(self):
- return self.full_c_name_get(Eolian_Function_Type.METHOD, True)
-
- @cached_property
- def full_c_getter_name_legacy(self):
- return self.full_c_name_get(Eolian_Function_Type.PROP_GET, True)
-
- @cached_property
- def full_c_setter_name_legacy(self):
- return self.full_c_name_get(Eolian_Function_Type.PROP_SET, True)
-
- @cached_property
def type(self):
return Eolian_Function_Type(lib.eolian_function_type_get(self))
def setter_scope(self):
return self.scope_get(Eolian_Function_Type.PROP_SET)
- def legacy_get(self, ftype):
- return _str_to_py(lib.eolian_function_legacy_get(self, ftype))
-
- def is_legacy_only(self, ftype):
- return bool(lib.eolian_function_is_legacy_only(self, ftype))
-
@cached_property
def is_class(self):
return bool(lib.eolian_function_is_class(self))
lib.eolian_class_documentation_get.argtypes = (c_void_p,)
lib.eolian_class_documentation_get.restype = c_void_p
-# EAPI Eina_Stringshare *eolian_class_legacy_prefix_get(const Eolian_Class *klass);
-lib.eolian_class_legacy_prefix_get.argtypes = (c_void_p,)
-lib.eolian_class_legacy_prefix_get.restype = c_char_p
-
# EAPI Eina_Stringshare *eolian_class_eo_prefix_get(const Eolian_Class *klass);
lib.eolian_class_eo_prefix_get.argtypes = (c_void_p,)
lib.eolian_class_eo_prefix_get.restype = c_char_p
lib.eolian_function_scope_get.argtypes = (c_void_p, c_int)
lib.eolian_function_scope_get.restype = c_int
-# EAPI Eina_Stringshare *eolian_function_full_c_name_get(const Eolian_Function *function_id, Eolian_Function_Type ftype, Eina_Bool use_legacy);
-lib.eolian_function_full_c_name_get.argtypes = (c_void_p, c_int, c_bool)
+# EAPI Eina_Stringshare *eolian_function_full_c_name_get(const Eolian_Function *function_id, Eolian_Function_Type ftype);
+lib.eolian_function_full_c_name_get.argtypes = (c_void_p, c_int)
lib.eolian_function_full_c_name_get.restype = c_void_p # Stringshare TO BE FREED
-# EAPI Eina_Stringshare *eolian_function_legacy_get(const Eolian_Function *function_id, Eolian_Function_Type f_type);
-lib.eolian_function_legacy_get.argtypes = (c_void_p, c_int)
-lib.eolian_function_legacy_get.restype = c_char_p
-
# EAPI const Eolian_Implement *eolian_function_implement_get(const Eolian_Function *function_id);
lib.eolian_function_implement_get.argtypes = (c_void_p,)
lib.eolian_function_implement_get.restype = c_void_p
-# EAPI Eina_Bool eolian_function_is_legacy_only(const Eolian_Function *function_id, Eolian_Function_Type ftype);
-lib.eolian_function_is_legacy_only.argtypes = (c_void_p, c_int)
-lib.eolian_function_is_legacy_only.restype = c_bool
-
# EAPI Eina_Bool eolian_function_is_class(const Eolian_Function *function_id);
lib.eolian_function_is_class.argtypes = (c_void_p,)
lib.eolian_function_is_class.restype = c_bool
class Class_Simple {
[[Class Desc Simple]]
- legacy_prefix: evas_object_simple;
eo_prefix: efl_canvas_object_simple;
data: Evas_Simple_Data;
methods {
value: int (100); [[Value description]]
}
}
- @property b {
- set {
- eo: null;
- }
- }
foo @beta {
[[comment foo]]
params {
}
return: ptr(char) (null); [[comment for method return]]
}
- bar {
- eo: null;
- params {
- x: int;
- }
- return: ptr(int);
- }
}
}
EOAPI EFL_FUNC_BODY_CONST(efl_canvas_object_simple_a_get, int, 100);
-void _class_simple_b_set(Eo *obj, Evas_Simple_Data *pd);
-
-EOAPI EFL_VOID_FUNC_BODY(efl_canvas_object_simple_b_set);
-
char *_class_simple_foo(Eo *obj, Evas_Simple_Data *pd, int a, char *b, double *c, int *d);
static char *__eolian_class_simple_foo(Eo *obj, Evas_Simple_Data *pd, int a, char *b, double *c, int *d)
EOAPI EFL_FUNC_BODYV(efl_canvas_object_simple_foo, char *, NULL /* null */, EFL_FUNC_CALL(a, b, c, d), int a, char *b, double *c, int *d);
-int *_class_simple_bar(Eo *obj, Evas_Simple_Data *pd, int x);
-
-EOAPI EFL_FUNC_BODYV(efl_canvas_object_simple_bar, int *, NULL, EFL_FUNC_CALL(x), int x);
-
static Eina_Bool
_class_simple_class_initializer(Efl_Class *klass)
{
EFL_OPS_DEFINE(ops,
EFL_OBJECT_OP_FUNC(efl_canvas_object_simple_a_set, _class_simple_a_set),
EFL_OBJECT_OP_FUNC(efl_canvas_object_simple_a_get, _class_simple_a_get),
- EFL_OBJECT_OP_FUNC(efl_canvas_object_simple_b_set, _class_simple_b_set),
EFL_OBJECT_OP_FUNC(efl_canvas_object_simple_foo, __eolian_class_simple_foo),
- EFL_OBJECT_OP_FUNC(efl_canvas_object_simple_bar, _class_simple_bar),
CLASS_SIMPLE_EXTRA_OPS
);
opsp = &ops;
};
EFL_DEFINE_CLASS(class_simple_class_get, &_class_simple_class_desc, NULL, NULL);
-
-#include "eolian_class_simple.eo.legacy.c"
+++ /dev/null
-
-EAPI void
-evas_object_simple_b_set(Class_Simple *obj)
-{
- efl_canvas_object_simple_b_set(obj);
-}
-
-EAPI int *
-evas_object_simple_bar(Class_Simple *obj, int x)
-{
- return efl_canvas_object_simple_bar(obj, x);
-}
EOAPI int efl_canvas_object_simple_a_get(const Eo *obj);
#endif /* EFL_BETA_API_SUPPORT */
-EOAPI void efl_canvas_object_simple_b_set(Eo *obj);
-
#ifdef EFL_BETA_API_SUPPORT
/**
* @brief comment foo
EOAPI char *efl_canvas_object_simple_foo(Eo *obj, int a, char *b, double *c, int *d);
#endif /* EFL_BETA_API_SUPPORT */
-EOAPI int *efl_canvas_object_simple_bar(Eo *obj, int x);
-
#endif
+++ /dev/null
-#ifndef _EOLIAN_CLASS_SIMPLE_EO_LEGACY_H_
-#define _EOLIAN_CLASS_SIMPLE_EO_LEGACY_H_
-
-#ifndef _CLASS_SIMPLE_EO_CLASS_TYPE
-#define _CLASS_SIMPLE_EO_CLASS_TYPE
-
-typedef Eo Class_Simple;
-
-#endif
-
-#ifndef _CLASS_SIMPLE_EO_TYPES
-#define _CLASS_SIMPLE_EO_TYPES
-
-#ifndef FOO
-/** doc for constant
- *
- * @ingroup Foo
- */
-#define FOO 5
-#endif
-
-/** doc for global
- *
- * @ingroup Bar
- */
-EWAPI extern float BAR;
-
-/** in header but not in source
- *
- * @ingroup Baz
- */
-EWAPI extern long BAZ;
-
-
-#endif
-
-EAPI void evas_object_simple_b_set(Class_Simple *obj);
-
-EAPI int *evas_object_simple_bar(Class_Simple *obj, int x);
-
-#endif
@since 1.18
]]
- legacy_prefix: docs;
methods {
meth {
[[Method documentation.]]
+++ /dev/null
-#ifndef _EOLIAN_DOCS_EO_LEGACY_H_
-#define _EOLIAN_DOCS_EO_LEGACY_H_
-
-#ifndef _DOCS_EO_CLASS_TYPE
-#define _DOCS_EO_CLASS_TYPE
-
-typedef Eo Docs;
-
-#endif
-
-#ifndef _DOCS_EO_TYPES
-#define _DOCS_EO_TYPES
-
-/**
- * @brief This is struct Foo. It does stuff.
- *
- * @note This is a note.
- *
- * This is a longer description for struct Foo.
- *
- * @warning This is a warning. You can only use Warning: and Note: at the
- * beginning of a paragraph.
- *
- * This is another paragraph.
- *
- * @since 1.66
- *
- * @ingroup Foo
- */
-typedef struct _Foo
-{
- int field1; /**< Field documentation. */
- float field2;
- short field3; /**< Another field documentation. */
-} Foo;
-
-/** Docs for enum Bar.
- *
- * @ingroup Bar
- */
-typedef enum
-{
- BAR_BLAH = 0,
- BAR_FOO = 1, /**< Docs for foo. */
- BAR_BAR = 2 /**< Docs for bar. */
-} Bar;
-
-/**
- * @brief Docs for typedef.
- *
- * More docs for typedef. See @ref Bar.
- *
- * @since 2.0
- *
- * @ingroup Alias
- */
-typedef Bar Alias;
-
-/** Docs for var.
- *
- * @ingroup pants
- */
-EWAPI extern int PANTS;
-
-/** Opaque struct docs. See @ref Foo for another struct.
- *
- * @ingroup Opaque
- */
-typedef struct _Opaque Opaque;
-
-
-#endif
-
-/**
- * @brief Method documentation.
- *
- * @param[in] obj The object.
- * @param[in] a Param documentation.
- * @param[out] b
- * @param[out] c Another param documentation.
- *
- * @return Return documentation.
- *
- * @since 1.18
- *
- * @ingroup Docs_Group
- */
-EAPI int docs_meth(Docs *obj, int a, float *b, long *c);
-
-/**
- * @brief Property common documentation.
- *
- * Set documentation.
- *
- * @param[in] obj The object.
- * @param[in] val Value documentation.
- *
- * @since 1.18
- *
- * @ingroup Docs_Group
- */
-EAPI void docs_prop_set(Docs *obj, int val);
-
-/**
- * @brief Property common documentation.
- *
- * Get documentation.
- *
- * @param[in] obj The object.
- *
- * @return Value documentation.
- *
- * @since 1.18
- *
- * @ingroup Docs_Group
- */
-EAPI int docs_prop_get(const Docs *obj);
-
-#endif
_remove_ref(output_filepath, "eo.c");
fail_if(0 != _eolian_gen_execute(TESTS_SRC_DIR"/data/class_simple.eo", "-gc", output_filepath));
fail_if(!_files_compare(TESTS_SRC_DIR"/data/class_simple_ref.c", output_filepath, "eo.c"));
- fail_if(!_files_compare(TESTS_SRC_DIR"/data/class_simple_ref.legacy.c", output_filepath, "eo.legacy.c"));
}
EFL_END_TEST
_remove_ref(output_filepath, "eo.h");
fail_if(0 != _eolian_gen_execute(TESTS_SRC_DIR"/data/class_simple.eo", "-gh", output_filepath));
fail_if(!_files_compare(TESTS_SRC_DIR"/data/class_simple_ref_eo.h", output_filepath, "eo.h"));
- _remove_ref(output_filepath, "eo.legacy.h");
fail_if(0 != _eolian_gen_execute(TESTS_SRC_DIR"/data/class_simple.eo", "-gl", output_filepath));
- fail_if(!_files_compare(TESTS_SRC_DIR"/data/class_simple_ref_legacy.h", output_filepath, "eo.legacy.h"));
}
EFL_END_TEST
_remove_ref(output_filepath, "eo.h");
fail_if(0 != _eolian_gen_execute(TESTS_SRC_DIR"/data/docs.eo", "-gh", output_filepath));
fail_if(!_files_compare(TESTS_SRC_DIR"/data/docs_ref.h", output_filepath, "eo.h"));
- _remove_ref(output_filepath, "eo.legacy.h");
fail_if(0 != _eolian_gen_execute(TESTS_SRC_DIR"/data/docs.eo", "-gl", output_filepath));
- fail_if(!_files_compare(TESTS_SRC_DIR"/data/docs_ref_legacy.h", output_filepath, "eo.legacy.h"));
}
EFL_END_TEST
fail_if(eolian_class_type_get(class) != EOLIAN_CLASS_REGULAR);
fail_if(eolian_class_parent_get(class) != NULL);
fail_if(eolian_class_extensions_get(class) != NULL);
- fail_if(strcmp(eolian_class_legacy_prefix_get(class), "evas_object_simple"));
fail_if(strcmp(eolian_class_eo_prefix_get(class), "efl_canvas_object_simple"));
fail_if(strcmp(eolian_class_data_type_get(class), "Evas_Simple_Data"));
Eina_Stringshare *dt = eolian_class_c_data_type_get(class);
fail_if(v.type != EOLIAN_EXPR_INT);
fail_if(v.value.i != 100);
- /* legacy only + c only */
- fail_if(eolian_class_function_by_name_get(class, "b", EOLIAN_PROPERTY));
- fail_if(!(fid = eolian_class_function_by_name_get(class, "b", EOLIAN_PROP_SET)));
- fail_if(eolian_function_is_legacy_only(fid, EOLIAN_PROP_GET));
- fail_if(!eolian_function_is_legacy_only(fid, EOLIAN_PROP_SET));
- fail_if(eolian_function_is_beta(fid));
-
/* Method */
fail_if(!(fid = eolian_class_function_by_name_get(class, "foo", EOLIAN_METHOD)));
fail_if(!eolian_function_is_beta(fid));
fail_if(!expr);
v = eolian_expression_eval(expr, EOLIAN_MASK_NULL);
fail_if(v.type != EOLIAN_EXPR_NULL);
- fail_if(eolian_function_is_legacy_only(fid, EOLIAN_METHOD));
/* Function parameters */
fail_if(!(iter = eolian_function_parameters_get(fid)));
fail_if(eina_iterator_next(iter, &dummy));
eina_iterator_free(iter);
- /* legacy only + c only */
- fail_if(!(fid = eolian_class_function_by_name_get(class, "bar", EOLIAN_METHOD)));
- fail_if(!eolian_function_is_legacy_only(fid, EOLIAN_METHOD));
- fail_if(eolian_function_is_beta(fid));
- fail_if(!eolian_type_is_ptr(eolian_function_return_type_get(fid, EOLIAN_METHOD)));
-
eolian_state_free(eos);
}
EFL_END_TEST
@since 1.17
]]
- legacy_prefix: docs;
methods {
meth {
[[Method documentation.]]