Merge branch 'master' into devs/hermet/lottie

This commit is contained in:
Hermet Park 2019-12-10 19:23:20 +09:00
commit 6fa91c71d8
77 changed files with 803 additions and 4857 deletions

2
NEWS
View File

@ -385,7 +385,7 @@ Features:
* eo: Add "destruct" event
* efl-wl: move to xdg-shell vfinal
* wayland: add xdg-shell vfinal support for client-side
* Canvas image: add Efl.Canvas.Text.Factory + use in Ui.Text
* Canvas image: add Efl.Canvas.Textblock.Factory + use in Ui.Text
* efl-wl: add functionality for directly passing through xkb objects
* ecore-x: add more info to Ecore_X_Event_Xkb event
* ecore-x: add some useful xkb function wrappers

View File

@ -6809,7 +6809,6 @@
* @example efl_thread_win32_2.c
* @example efl_thread_win32_3.c
* @example efl_thread_win32_4.c
* @example location_example_01.c
* @example naviframe_example.c
*/

View File

@ -33,8 +33,6 @@
*
* @ref icon_cxx_example_01
*
* @ref location_cxx_example_01
*
* @ref menu_cxx_example_01
*
* @ref popup_cxx_example_01
@ -3200,230 +3198,6 @@
* @example icon_cxx_example_01.cc
*/
/**
* @page location_cxx_example_01 Location example with C++ Binding
* @dontinclude location_cxx_example_01.cc
* This example shows how to integrate the Elocation.h library with
* elementary.
* The first part consists of including the headers. In this case we
* need to include both Elementary C++ binding and Elocation,
* @skip Elementary.hh
* @until endif
* @attention All necessary libraries from Elementary, Elightenment, C
* and/or C++ headers should be include here.
* Before our main code, we need a set of callbacks to react on
* incoming elocation events. They are standard ecore events and we
* register callbacks on these events in the main function.
* @skip void
* @until ECORE_CALLBACK_DONE
* @until }
* Now we need to actually start the code and initializing pointers
* for address, addr_geocode, position and pos_geocode and an integer
* status. We also run a check for elm_need_elocation.
* @skip EAPI_MAIN
* @until -1
* Now let's set the elm_policy, which defines for a given policy
* group/identifier a new policy's value, respectively. In this
* example the only policy we need to set a value for is @c
* ELM_POLICY_QUIT, possibles values for it are:
* @li @p ELM_POLICY_QUIT_NONE: Never quit the application
* automatically;
* @li @p ELM_POLICY_QUIT_LAST_WINDOW_CLOSED: quit when the
* application's last window is closed;
* @li @p ELM_POLICY_QUIT_LAST_WINDOW_HIDDEN : quit when the
* application's last window is hidden;
* @skipline elm_policy_set
* As you can see, the policy we chose was to quit when the last win
* is hidden as opposed to examples with the C bindings where we
* perpetually set it to quit when last win was closed. This changed
* was necessary because in C++ binding as the elm mainloop stop
* running all object are destroyed, references are unreferenced and
* events are stopped at ELM_MAIN().
* @see For more details consult elm_policy_set
* Next step is creating an elementary window, in this example we use
* the C++ binding method with the elm_win_util_standard_add that is a
* elm_win_legacy function, better explained below. And then we set
* the autohide state for it.
* @p elm_win_util_standard_add (const char *name, const char *tittle)
* Adds a window object with standard setup.
* Parameters:
* @li @p name - The name of the window;
* @li @p title - The title for the window.
* This creates a window but also puts in a standard background with
* @p elm_bg_add(), as well as setting the window title to @p
* title. The window type created is of type @c ELM_WIN_BASIC, with
* the @c NULL as the parent widget. Returns the created object or @c
* NULL on failure.
* The autohide works similarly to @p autodel, automatically handling
* "delete,request" signals when set to @p true, with the difference
* that it will hide the window, instead of destroying it.
* It is specially designed to work together with @p
* ELM_POLICY_QUIT_LAST_WINDOW_HIDDEN which allows exiting
* Elementary's main loop when all the windows are hidden.
* @skip ::elm::win
* @until autohide_set
* @note @p autodel and @a autohide are not mutually exclusive. The
* window will be destructed if both autodel and autohide is set to @p
* EINA_TRUE or @p true.
* For this example we're using a label that will display the text
* "Getting location ...". First we'll create our label, setting it's
* parent, then setting the following label's options:
* @li @p line_wrap_set: Set the wrapping behavior of the label, by
* default no wrapping is done. Possible values for wrap are:
* @p ELM_WRAP_NONE - No wrapping;
* @p ELM_WRAP_CHAR - wrap between characters;
* @p ELM_WRAP_WORD - wrap between words;
* @p ELM_WRAP_MIXED - Word wrap, and if that fails, char wrap.
* @ skipline wrap
* @li @p text_set: Set the text that label will display.
* @skipline text
* @li @p slide_mode_set: Set the slide mode of the label widget. By
* default, slide mode is none. Possible values for mode are:
* ELM_LABEL_SLIDE_MODE_NONE - no slide effect
* ELM_LABEL_SLIDE_MODE_AUTO - slide only if the label area is bigger
* than the text width length
* ELM_LABEL_SLIDE_MODE_ALWAYS -slide always
* @attention ELM_LABEL_SLIDE_MODE_AUTO, ELM_LABEL_SLIDE_MODE_ALWAYS
* only work with the themes "slide_short", "slide_long" and
* "slide_bounce". ELM_LABEL_SLIDE_MODE_AUTO,
* ELM_LABEL_SLIDE_MODE_ALWAYS don't work if the line
* wrap(elm_label_line_wrap_set()) or
* ellipsis(elm_label_ellipsis_set()) is set.
* @skipline slide
* To better understand, the function @c size_hint_weight_set for C++
* bindings originated from C bindings function
* evas_object_size_hint_weight_set, that is EFL Evas type function.
* With this function we set the hints for an object's weight. The
* parameters are:
* @li x - Nonnegative double value to use as horizontal weight hint.
* @li y - Nonnegative double value to use as vertical weight hint.
* This is not a size enforcement in any way, it's just a hint that
* should be used whenever appropriate. This is a hint on how a
* container object should resize a given child within its area.
* Containers may adhere to the simpler logic of just expanding the
* child object's dimensions to fit its own (see the EVAS_HINT_EXPAND
* helper weight macro in the EFL Evas Documentation) or the complete
* one of taking each child's weight hint as real weights to how much
* of its size to allocate for them in each axis. A container is
* supposed to, after normalizing the weights of its children (with
* weight hints), distribute the space it has to layout them by those
* factors most weighted children get larger in this process than
* the least ones.
* @dontinclude location_cxx_example_01.cc
* @skipline weight_set
* @note Default weight hint values are 0.0, for both axis.
* The function @c size_hint_align_set for C++ bindings originated
* from C bindings function evas_object_size_hint_align_set, that is
* EFL Evas type function. With this function we set the hints for an
* object's alignment. The parameters are:
* @li x - Double, ranging from 0.0 to 1.0 or with the special value
* EVAS_HINT_FILL, to use as horizontal alignment hint.
* @li y - Double, ranging from 0.0 to 1.0 or with the special value
* EVAS_HINT_FILL, to use as vertical alignment hint.
* These are hints on how to align an object inside the boundaries of
* a container/manager. Accepted values are in the 0.0 to 1.0 range,
* with the special value EVAS_HINT_FILL used to specify "justify" or
* "fill" by some users. In this case, maximum size hints should be
* enforced with higher priority, if they are set. Also, any padding
* hint set on objects should add up to the alignment space on the
* final scene composition.
* For the horizontal component, 0.0 means to the left, 1.0 means to
* the right. Analogously, for the vertical component, 0.0 to the top,
* 1.0 means to the bottom.
* This is not a size enforcement in any way, it's just a hint that
* should be used whenever appropriate.
* @note Default alignment hint values are 0.5, for both axis.
* @skipline align_set
* Setting the size for label and make it visible.
* @skip size
* @until visibility
* Going back to our elocation, first we'll create an address
* and position object that we'll use for all our operations.
* @skip address
* @until position
* We also have to register our callback so we get updates later on.
* @skipline ecore
* Now we need to get the elocation position and print it, using our
* label. This fills in the object with the data from GeoClue.
* @skip elocation
* @until print
* Now we only have to set the size for our window and make it
* visible.
* @skip size_set
* @until visibility_set
* And finally, start the elm mainloop, starting to handle events and
* drawing operations.
* @skip elm_run
* @until ELM_MAIN
* The full code for this example can be found at @ref location_cxx_example_01.cc
* @example location_cxx_example_01.cc
*/
/**
* @page menu_cxx_example_01 Menu Example with C++ Binding
* @dontinclude menu_cxx_example_01.cc

View File

@ -43,7 +43,6 @@
* <h3>Early stage libraries (BETA testing)</h3>
*
* @li @ref eolian_main an EO file parser and code generator.
* @li @ref elocation_main awareness library.
*
* If you are looking for methods that do not fit into the above list you can
* see the full <a href="modules.html" />module listing</a>.

View File

@ -297,8 +297,7 @@ subprojects = [
['emotion' ,[] , true, true, false, false, true, true, ['eina', 'efl', 'eo'], []],
['ethumb' ,[] , true, true, true, false, false, false, ['eina', 'efl', 'eo'], []],
['ethumb_client' ,[] , false, true, true, false, false, true, ['eina', 'efl', 'eo', 'ethumb'], []],
['elocation' ,[] , false, true, false, false, false, false, ['ecore', 'eldbus'], []],
['elementary' ,[] , true, true, true, true, true, true, ['eina', 'efl', 'eo', 'eet', 'evas', 'ecore', 'ecore-evas', 'ecore-file', 'ecore-input', 'edje', 'ethumb-client', 'emotion', 'ecore-imf', 'ecore-con', 'eldbus', 'efreet', 'efreet-mime', 'efreet-trash', 'eio', 'elocation'], ['atspi']],
['elementary' ,[] , true, true, true, true, true, true, ['eina', 'efl', 'eo', 'eet', 'evas', 'ecore', 'ecore-evas', 'ecore-file', 'ecore-input', 'edje', 'ethumb-client', 'emotion', 'ecore-imf', 'ecore-con', 'eldbus', 'efreet', 'efreet-mime', 'efreet-trash', 'eio'], ['atspi']],
['efl_wl' ,['wl'] , false, true, true, false, false, false, ['evas', 'ecore'], []],
['elua' ,['elua'] , false, true, true, false, true, false, ['eina', 'luajit'], []],
['ecore_wayland' ,['wl-deprecated'] , false, true, false, false, false, false, ['eina'], []],

View File

@ -491,7 +491,7 @@ test_gfx_filters(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *eve
// Experimental textblock support
o = tb = evas_object_textblock_add(evas_object_evas_get(win));
efl_event_callback_add(o, EFL_CANVAS_TEXT_EVENT_STYLE_INSETS_CHANGED, _textblock_resize, NULL);
efl_event_callback_add(o, EFL_CANVAS_TEXTBLOCK_EVENT_STYLE_INSETS_CHANGED, _textblock_resize, NULL);
efl_event_callback_add(o, EFL_GFX_ENTITY_EVENT_SIZE_CHANGED, _textblock_resize, NULL);
Evas_Textblock_Style *st = evas_textblock_style_new();
evas_textblock_style_set(st, "DEFAULT='font=Sans font_size=20 color=#FFF wrap=word'");

View File

@ -141,8 +141,8 @@ struct pack_event_info_and_call_visitor
mutable OutputIterator sink;
Context const* context;
attributes::type_def const& type;
static auto constexpr native_call = "Efl.Eo.Globals.CallEventCallback(this.NativeHandle, desc, info);\n";
std::string library_name;
std::string evt_c_name;
typedef pack_event_info_and_call_visitor<OutputIterator, Context> visitor_type;
typedef bool result_type;
@ -157,15 +157,7 @@ struct pack_event_info_and_call_visitor
{
return as_generator(
indent << "IntPtr info = Marshal.AllocHGlobal(Marshal.SizeOf(e.arg));\n"
<< indent << "try\n"
<< indent << "{\n"
<< indent << scope_tab << "Marshal.StructureToPtr(e.arg, info, false);\n"
<< indent << scope_tab << this->native_call
<< indent << "}\n"
<< indent << "finally\n"
<< indent << "{\n"
<< indent << scope_tab << "Marshal.FreeHGlobal(info);\n"
<< indent << "}\n"
<< indent << "CallNativeEventCallback(" + library_name + ", \"_" + evt_c_name + "\", info, " << "(p) => Marshal.FreeHGlobal(p));\n"
).generate(sink, attributes::unused, *context);
}
@ -192,14 +184,8 @@ struct pack_event_info_and_call_visitor
{
return as_generator(
indent << "IntPtr info = Eina.StringConversion.ManagedStringToNativeUtf8Alloc(" << conversion << ");\n"
<< indent << "try\n"
<< indent << "{\n"
<< indent << scope_tab << this->native_call
<< indent << "}\n"
<< indent << "finally\n"
<< indent << "{\n"
<< indent << scope_tab << "Eina.MemoryNative.Free(info);\n"
<< indent << "}\n").generate(sink, attributes::unused, *context);
<< indent << "CallNativeEventCallback(" + library_name + ", \"_" + evt_c_name + "\", info, " << "(p) => Eina.MemoryNative.Free(p));\n"
).generate(sink, attributes::unused, *context);
};
if (eina::optional<bool> b = call_match(str_table, filter_func, str_accept_func))
@ -216,14 +202,8 @@ struct pack_event_info_and_call_visitor
{
return as_generator(
indent << "IntPtr info = Eina.PrimitiveConversion.ManagedToPointerAlloc(" << conversion << ");\n"
<< indent << "try\n"
<< indent << "{\n"
<< indent << scope_tab << this->native_call
<< indent << "}\n"
<< indent << "finally\n"
<< indent << "{\n"
<< indent << scope_tab << "Marshal.FreeHGlobal(info);\n"
<< indent << "}\n").generate(sink, attributes::unused, *context);
<< indent << "CallNativeEventCallback(" + library_name + ", \"_" + evt_c_name + "\", info, " << "(p) => Marshal.FreeHGlobal(p));\n"
).generate(sink, attributes::unused, *context);
};
if (eina::optional<bool> b = call_match(value_table, filter_func, value_accept_func))
@ -235,13 +215,15 @@ struct pack_event_info_and_call_visitor
{
auto const& indent = current_indentation(*context);
return as_generator(indent << "IntPtr info = e.arg.NativeHandle;\n"
<< indent << this->native_call).generate(sink, attributes::unused, *context);
<< "CallNativeEventCallback(" << library_name << ", \"_" << evt_c_name << "\", IntPtr.Zero, null);\n"
).generate(sink, attributes::unused, *context);
}
bool operator()(attributes::complex_type_def const&) const
{
auto const& indent = current_indentation(*context);
return as_generator(indent << "IntPtr info = e.arg.Handle;\n"
<< indent << this->native_call).generate(sink, attributes::unused, *context);
<< "CallNativeEventCallback(" << library_name << ", \"_" << evt_c_name << "\", IntPtr.Zero, null);\n"
).generate(sink, attributes::unused, *context);
}
};
@ -367,6 +349,7 @@ struct event_definition_generator
if (blacklist::is_event_blacklisted(evt, context))
return true;
auto library_name = context_find_tag<library_context>(context).actual_library_name(klass.filename);
std::string managed_evt_name = name_helpers::managed_event_name(evt.name);
auto const& indent = current_indentation(context);
@ -396,7 +379,7 @@ struct event_definition_generator
if (!etype.is_engaged())
{
auto event_call_site_sink = std::back_inserter(event_native_call);
if (!as_generator(indent.inc().inc() << "Efl.Eo.Globals.CallEventCallback(this.NativeHandle, desc, IntPtr.Zero);\n")
if (!as_generator(indent.inc().inc() << "CallNativeEventCallback(" << library_name << ", \"_" << utils::to_uppercase(evt.c_name) << "\", IntPtr.Zero, null);\n")
.generate(event_call_site_sink, attributes::unused, context))
return false;
}
@ -417,7 +400,7 @@ struct event_definition_generator
if (!(*etype).original_type.visit(unpack_event_args_visitor<decltype(arg_initializer_sink), decltype(sub_context)>{arg_initializer_sink, &sub_context, *etype}))
return false;
if (!(*etype).original_type.visit(pack_event_info_and_call_visitor<decltype(event_call_site_sink), decltype(sub_context)>{event_call_site_sink, &sub_context, *etype}))
if (!(*etype).original_type.visit(pack_event_info_and_call_visitor<decltype(event_call_site_sink), decltype(sub_context)>{event_call_site_sink, &sub_context, *etype, library_name, utils::to_uppercase(evt.c_name)}))
return false;
arg_initializer += " }";
@ -508,18 +491,20 @@ struct event_definition_generator
}
}
// Close summary
if (!as_generator(scope_tab << "/// </summary>\n").generate(sink, nullptr, context))
return false;
if (evt.type.is_engaged())
{
if (!as_generator(scope_tab << "/// <param name=\"e\">Event to raise.</param>\n"
).generate(sink, nullptr, context))
return false;
}
if (!as_generator(
scope_tab << "/// </summary>\n"
<< scope_tab << "/// <param name=\"e\">Event to raise.</param>\n"
<< scope_tab << (is_concrete ? "public" : "protected virtual") << " void On" << event_name << "(" << event_args_type << " e)\n"
scope_tab << (is_concrete ? "public" : "protected virtual") << " void On" << event_name << "(" << (!evt.type.is_engaged() ? "" : event_args_type + " e") << ")\n"
<< scope_tab << "{\n"
<< scope_tab << scope_tab << "var key = \"_" << upper_c_name << "\";\n"
<< scope_tab << scope_tab << "IntPtr desc = Efl.EventDescription.GetNative(" << library_name << ", key);\n"
<< scope_tab << scope_tab << "if (desc == IntPtr.Zero)\n"
<< scope_tab << scope_tab << "{\n"
<< scope_tab << scope_tab << scope_tab << "Eina.Log.Error($\"Failed to get native event {key}\");\n"
<< scope_tab << scope_tab << scope_tab << "return;\n"
<< scope_tab << scope_tab << "}\n\n"
<< event_native_call
<< scope_tab << "}\n\n"
).generate(sink, nullptr, context))

View File

@ -300,6 +300,7 @@ struct klass
documentation
<< "[" << name_helpers::klass_full_native_inherit_name(cls) << "]\n"
<< "[Efl.Eo.BindingEntity]\n"
<< "[SuppressMessage(\"Microsoft.Naming\", \"CA1724:TypeNamesShouldNotMatchNamespaces\")]\n"
<< "public "
<< (is_partial
? class_type == "class"

View File

@ -28,15 +28,15 @@ namespace eina = efl::eina;
namespace detail {
template <typename Array, typename F, int N, typename A>
eina::optional<bool> call_annotation_match(Array const (&array)[N], F f, A a)
template <typename Array, typename SelectionPredicate, int N, typename AcceptFunc>
eina::optional<bool> call_annotation_match(Array const (&array)[N], SelectionPredicate predicate, AcceptFunc acceptFunc)
{
typedef Array const* iterator_type;
iterator_type match_iterator = &array[0], match_last = match_iterator + N;
match_iterator = std::find_if(match_iterator, match_last, f);
match_iterator = std::find_if(match_iterator, match_last, predicate);
if(match_iterator != match_last)
{
return a(match_iterator->function());
return acceptFunc(match_iterator->function());
}
return {nullptr};
}
@ -63,103 +63,108 @@ struct marshall_annotation_visitor_generate
eina::optional<bool> has_own;
std::function<std::string()> function;
};
// These two tables are currently the same but will hold different marshallers
// for @in and @out/return semantics in a future commit.
match const parameter_match_table[] =
{
// signed primitives
{"bool", nullptr, [&] { return "[MarshalAs(UnmanagedType.U1)]"; }},
{"string", true, [&] {
return "[MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringPassOwnershipMarshaler))]";
{"bool", nullptr, [] { return "MarshalAs(UnmanagedType.U1)"; }},
{"string", true, [] {
return "MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringPassOwnershipMarshaler))";
}},
{"string", false, [&] {
return "[MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringKeepOwnershipMarshaler))]";
{"string", false, [] {
return "MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringKeepOwnershipMarshaler))";
}},
{"mstring", true, [&] {
return "[MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringPassOwnershipMarshaler))]";
{"mstring", true, [] {
return "MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringPassOwnershipMarshaler))";
}},
{"mstring", false, [&] {
return "[MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringKeepOwnershipMarshaler))]";
{"mstring", false, [] {
return "MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringKeepOwnershipMarshaler))";
}},
{"stringshare", true, [&] {
return "[MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringsharePassOwnershipMarshaler))]";
{"stringshare", true, [] {
return "MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringsharePassOwnershipMarshaler))";
}},
{"stringshare", false, [&] {
return "[MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringshareKeepOwnershipMarshaler))]";
{"stringshare", false, [] {
return "MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringshareKeepOwnershipMarshaler))";
}},
{"any_value_ref", true, [&] {
return "[MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Eina.ValueMarshalerOwn))]";
{"any_value_ref", true, [] {
return "MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Eina.ValueMarshalerOwn))";
}},
{"any_value_ref", false, [&] {
return "[MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Eina.ValueMarshaler))]";
{"any_value_ref", false, [] {
return "MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Eina.ValueMarshaler))";
}},
{"strbuf", true, [&] {
return "[MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StrbufPassOwnershipMarshaler))]";
{"strbuf", true, [] {
return "MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StrbufPassOwnershipMarshaler))";
}},
{"strbuf", false, [&] {
return "[MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StrbufKeepOwnershipMarshaler))]";
{"strbuf", false, [] {
return "MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StrbufKeepOwnershipMarshaler))";
}},
{"Value_Type", false, [&] {
return "[MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Eina.ValueTypeMarshaler))]";
{"Value_Type", false, [] {
return "MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Eina.ValueTypeMarshaler))";
}},
};
match const return_match_table[] =
{
// signed primitives
{"bool", nullptr, [&] { return "[return: MarshalAs(UnmanagedType.U1)]"; }},
{"string", true, [&] {
return "[return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringPassOwnershipMarshaler))]";
{"bool", nullptr, [] { return "MarshalAs(UnmanagedType.U1)"; }},
{"string", true, [] {
return "MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringPassOwnershipMarshaler))";
}},
{"string", nullptr, [&] {
return "[return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringKeepOwnershipMarshaler))]";
{"string", false, [] {
return "MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringKeepOwnershipMarshaler))";
}},
{"mstring", true, [&] {
return "[return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringPassOwnershipMarshaler))]";
{"mstring", true, [] {
return "MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringPassOwnershipMarshaler))";
}},
{"mstring", false, [&] {
return "[return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringKeepOwnershipMarshaler))]";
{"mstring", false, [] {
return "MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringKeepOwnershipMarshaler))";
}},
{"stringshare", true, [&] {
return "[return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringsharePassOwnershipMarshaler))]";
{"stringshare", true, [] {
return "MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringsharePassOwnershipMarshaler))";
}},
{"stringshare", false, [&] {
return "[return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringshareKeepOwnershipMarshaler))]";
{"stringshare", false, [] {
return "MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringshareKeepOwnershipMarshaler))";
}},
{"any_value_ref", true, [&] {
return "[return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Eina.ValueMarshalerOwn))]";
{"any_value_ref", true, [] {
return "MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Eina.ValueMarshalerOwn))";
}},
{"any_value_ref", false, [&] {
return "[return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Eina.ValueMarshaler))]";
{"any_value_ref", false, [] {
return "MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Eina.ValueMarshaler))";
}},
{"strbuf", true, [&] {
return "[return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StrbufPassOwnershipMarshaler))]";
{"strbuf", true, [] {
return "MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StrbufPassOwnershipMarshaler))";
}},
{"strbuf", false, [&] {
return "[return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StrbufKeepOwnershipMarshaler))]";
{"strbuf", false, [] {
return "MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StrbufKeepOwnershipMarshaler))";
}},
{"Value_Type", false, [&] {
return "[return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Eina.ValueTypeMarshaler))]";
{"Value_Type", false, [] {
return "MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Eina.ValueTypeMarshaler))";
}},
};
if(eina::optional<bool> b = call_annotation_match
((is_return ? return_match_table : parameter_match_table)
, [&] (match const& m)
auto predicate = [&regular] (match const& m)
{
return (!m.name || *m.name == regular.base_type)
&& (!m.has_own || *m.has_own == (bool)(regular.base_qualifier & qualifier_info::is_own))
;
}
, [&] (std::string const& string)
};
auto acceptCb = [this] (std::string const& marshalTag)
{
std::copy(string.begin(), string.end(), sink);
return true;
}))
{
return *b;
}
else
{
return true;
}
std::string prefix = is_return ? "return: " : "";
return as_generator("[" << prefix << marshalTag << "]").generate(sink, nullptr, *context);
};
const auto& match_table = is_return ? return_match_table : parameter_match_table;
if(eina::optional<bool> b = call_annotation_match(match_table, predicate, acceptCb))
{
return *b;
}
else
{
return true;
}
}
bool operator()(attributes::klass_name const& klass_name) const
{

View File

@ -415,6 +415,7 @@ struct struct_definition_generator
(
indent << "[StructLayout(LayoutKind.Sequential)]\n"
<< indent << "[Efl.Eo.BindingEntity]\n"
<< "[SuppressMessage(\"Microsoft.Naming\", \"CA1724:TypeNamesShouldNotMatchNamespaces\")]\n"
<< indent << "public struct " << struct_managed_name << " : IEquatable<" << struct_managed_name << ">\n"
<< indent << "{\n"
)

View File

@ -147,12 +147,10 @@ public class Array<T> : IEnumerable<T>, IDisposable
[EditorBrowsable(EditorBrowsableState.Never)]
public Array(IntPtr handle, bool own)
{
if (handle == IntPtr.Zero)
{
throw new ArgumentNullException("handle", "Handle can't be null");
}
Handle = handle;
Handle = (handle != IntPtr.Zero)
? handle
: throw new ArgumentNullException(nameof(handle),
$"{nameof(Handle)} can't be null");
Own = own;
OwnContent = own;
}
@ -166,12 +164,10 @@ public class Array<T> : IEnumerable<T>, IDisposable
[EditorBrowsable(EditorBrowsableState.Never)]
public Array(IntPtr handle, bool own, bool ownContent)
{
if (handle == IntPtr.Zero)
{
throw new ArgumentNullException("handle", "Handle can't be null");
}
Handle = handle;
Handle = (handle != IntPtr.Zero)
? handle
: throw new ArgumentNullException(nameof(handle),
$"{nameof(Handle)} can't be null");
Own = own;
OwnContent = ownContent;
}

View File

@ -18,6 +18,7 @@
using System;
using System.Runtime.InteropServices;
using System.ComponentModel;
using System.Diagnostics.CodeAnalysis;
using static eldbus.EldbusMessageNativeFunctions;
@ -1543,6 +1544,7 @@ public delegate void MessageDelegate(eldbus.Message msg, eldbus.Pending pending)
/// Commons for eldbus.
/// <para>Since EFL 1.23.</para>
/// </summary>
[SuppressMessage("Microsoft.Naming", "CA1724:TypeNamesShouldNotMatchNamespaces")]
public static class Common
{
/// <summary>

View File

@ -298,7 +298,7 @@ public class Connection : IDisposable
if (msg == null)
{
throw new ArgumentNullException("msg");
throw new ArgumentNullException(nameof(msg));
}
IntPtr cb_wrapper = (dlgt == null ? IntPtr.Zero : eldbus.Common.GetMessageCbWrapperPtr());
@ -347,7 +347,7 @@ public class Connection : IDisposable
if (bus == null)
{
throw new ArgumentNullException("bus");
throw new ArgumentNullException(nameof(bus));
}
IntPtr cb_wrapper = (dlgt == null ? IntPtr.Zero : eldbus.Common.GetMessageCbWrapperPtr());
@ -376,7 +376,7 @@ public class Connection : IDisposable
if (bus == null)
{
throw new ArgumentNullException("bus");
throw new ArgumentNullException(nameof(bus));
}
IntPtr cb_wrapper = (dlgt == null ? IntPtr.Zero : eldbus.Common.GetMessageCbWrapperPtr());
@ -405,7 +405,7 @@ public class Connection : IDisposable
if (bus == null)
{
throw new ArgumentNullException("bus");
throw new ArgumentNullException(nameof(bus));
}
IntPtr cb_wrapper = (dlgt == null ? IntPtr.Zero : eldbus.Common.GetMessageCbWrapperPtr());
@ -434,7 +434,7 @@ public class Connection : IDisposable
if (bus == null)
{
throw new ArgumentNullException("bus");
throw new ArgumentNullException(nameof(bus));
}
IntPtr cb_wrapper = (dlgt == null ? IntPtr.Zero : eldbus.Common.GetMessageCbWrapperPtr());
@ -533,7 +533,7 @@ public class Connection : IDisposable
if (bus == null)
{
throw new ArgumentNullException("bus");
throw new ArgumentNullException(nameof(bus));
}
IntPtr cb_wrapper = (dlgt == null ? IntPtr.Zero : eldbus.Common.GetMessageCbWrapperPtr());

View File

@ -146,17 +146,17 @@ public class Object : System.IDisposable
{
if (conn == null)
{
throw new System.ArgumentNullException("conn");
throw new System.ArgumentNullException(nameof(conn));
}
if (bus == null)
{
throw new System.ArgumentNullException("bus");
throw new System.ArgumentNullException(nameof(bus));
}
if (path == null)
{
throw new System.ArgumentNullException("path");
throw new System.ArgumentNullException(nameof(path));
}
var handle = eldbus_object_get(conn.Handle, bus, path);
@ -316,7 +316,7 @@ public class Object : System.IDisposable
if (msg == null)
{
throw new System.ArgumentNullException("msg");
throw new System.ArgumentNullException(nameof(msg));
}
IntPtr cb_wrapper = dlgt == null ? IntPtr.Zero : eldbus.Common.GetMessageCbWrapperPtr();

View File

@ -24,7 +24,7 @@ using static eldbus.EldbusProxyNativeFunctions;
namespace eldbus
{
[EditorBrowsable(EditorBrowsableState.Never)]
[EditorBrowsable(EditorBrowsableState.Never)]
internal static class EldbusProxyNativeFunctions
{
[DllImport(efl.Libs.Eldbus)] public static extern IntPtr
@ -215,7 +215,7 @@ public class Proxy : IDisposable
if (member == null)
{
throw new ArgumentNullException("member");
throw new ArgumentNullException(nameof(member));
}
var ptr = eldbus_proxy_method_call_new(Handle, member);
@ -233,7 +233,7 @@ public class Proxy : IDisposable
if (msg == null)
{
throw new ArgumentNullException("msg");
throw new ArgumentNullException(nameof(msg));
}
// Native send() takes ownership of the message. We ref here to keep the IDisposable

View File

@ -325,6 +325,7 @@ public abstract class EoWrapper : IWrapper, IDisposable
}
}
}
internal Efl.EventCb GetInternalEventCallback<T>(EventHandler<T> handler, Func<IntPtr, T> createArgsInstance) where T:EventArgs
{
return (IntPtr data, ref Efl.Event.NativeStruct evt) =>
@ -344,6 +345,7 @@ public abstract class EoWrapper : IWrapper, IDisposable
}
};
}
internal Efl.EventCb GetInternalEventCallback(EventHandler handler)
{
return (IntPtr data, ref Efl.Event.NativeStruct evt) =>
@ -364,6 +366,23 @@ public abstract class EoWrapper : IWrapper, IDisposable
};
}
internal void CallNativeEventCallback(string lib, string key, IntPtr eventInfo, Action<IntPtr> freeAction)
{
try
{
IntPtr desc = Efl.EventDescription.GetNative(lib, key);
if (desc == IntPtr.Zero)
throw new ArgumentException($"Failed to get native event {key}", "key");
Efl.Eo.Globals.CallEventCallback(NativeHandle, desc, eventInfo);
}
finally
{
if (freeAction != null)
freeAction(eventInfo);
}
}
private static void OwnershipUniqueCallback(IntPtr data, ref Efl.Event.NativeStruct evt)
{
var ws = Efl.Eo.Globals.WrapperSupervisorPtrToManaged(data);

View File

@ -73,9 +73,10 @@ public class Example
miles_label.SetSize(size);
miles_label.SetVisible(true);
Efl.Ui.TextEditable miles_input = new Efl.Ui.TextEditable(miles_box);
Efl.Ui.Text miles_input = new Efl.Ui.Text(miles_box);
miles_input.SetText("");
miles_input.SetScrollable(true);
miles_input.SetEditable(true);
miles_input.SetSize(size);
miles_input.SetVisible(true);

View File

@ -1,151 +0,0 @@
//Compile with:
//gcc -o location_example_01 location_example_01.c -g `pkg-config --cflags --libs elementary elocation`
#ifndef EFL_BETA_API_SUPPORT
# define EFL_BETA_API_SUPPORT
#endif
#include <Elementary.h>
#ifdef ELM_ELOCATION
#include <Elocation.h>
#endif
static Evas_Object *pos_label, *addr_label, *box, *win;
#ifdef ELM_ELOCATION
static void
_print_position(Elocation_Position *position)
{
char buffer[1024];
if (!position) return;
snprintf(buffer, sizeof(buffer),
"<b>### Position Detail ###</b><br/>"
"<b>GeoClue position reply with data from timestamp</b> %i<br/>"
"<b>Latitude:</b> %f<br/>"
"<b>Longitude:</b> %f<br/>"
"<b>Altitude:</b> %f<br/>"
"<b>Accuracy level:</b> %i<br/>"
"<b>Accuracy horizontal:</b> %f<br/>"
"<b>Accuracy vertical:</b> %f",
position->timestamp, position->latitude, position->longitude,
position->altitude, position->accur->level,
position->accur->horizontal, position->accur->vertical);
elm_object_text_set(pos_label, buffer);
}
static void
_print_address(Elocation_Address *address)
{
char buffer[1024];
if (!address) return;
snprintf(buffer, sizeof(buffer),
"<b>### Address Detail ###</b><br/>"
"<b>Address update with data from timestamp:</b> %i<br/>"
"<b>Country:</b> %s<br/>"
"<b>Countrycode:</b> %s<br/>"
"<b>Locality:</b> %s<br/>"
"<b>Postalcode:</b> %s<br/>"
"<b>Region:</b> %s<br/>"
"<b>Timezone:</b> %s<br/>"
"<b>Accuracy level:</b> %i<br/>"
"<b>Accuracy horizontal:</b> %f<br/>"
"<b>Accuracy vertical:</b> %f",
address->timestamp, address->country, address->countrycode,
address->locality, address->postalcode, address->region,
address->timezone, address->accur->level, address->accur->horizontal,
address->accur->vertical);
elm_object_text_set(addr_label, buffer);
}
static Eina_Bool
_position_changed(void *data EINA_UNUSED, int ev_type EINA_UNUSED, void *event)
{
Elocation_Position *position;
position = event;
_print_position(position);
return ECORE_CALLBACK_DONE;
}
static Eina_Bool
_address_changed(void *data EINA_UNUSED, int ev_type EINA_UNUSED, void *event)
{
Elocation_Address *address;
address = event;
_print_address(address);
return ECORE_CALLBACK_DONE;
}
#endif
EAPI_MAIN int
elm_main(int argc EINA_UNUSED, char **argv EINA_UNUSED)
{
#ifdef ELM_ELOCATION
Elocation_Address *address;
Elocation_Position *position;
#endif
/* The program will proceed only if Ewebkit library is available. */
if (elm_need_elocation() == EINA_FALSE)
return -1;
elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED);
win = elm_win_util_standard_add("elocation", "Elocation example");
elm_win_autodel_set(win, EINA_TRUE);
box = elm_box_add(win);
elm_win_resize_object_add(win, box);
evas_object_size_hint_weight_set(box, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
evas_object_size_hint_align_set(box, EVAS_HINT_FILL, EVAS_HINT_FILL);
pos_label = elm_label_add(box);
elm_label_line_wrap_set(pos_label, ELM_WRAP_CHAR);
elm_object_text_set(pos_label, "Getting location ...");
evas_object_size_hint_weight_set(pos_label, EVAS_HINT_EXPAND, 0.0);
evas_object_size_hint_align_set(pos_label, EVAS_HINT_FILL, EVAS_HINT_FILL);
elm_label_slide_mode_set(pos_label, ELM_LABEL_SLIDE_MODE_ALWAYS);
elm_box_pack_end(box, pos_label);
evas_object_show(pos_label);
elm_box_padding_set(box, 0, 50);
addr_label = elm_label_add(box);
elm_label_line_wrap_set(addr_label, ELM_WRAP_CHAR);
elm_object_text_set(addr_label, "Getting location ...");
evas_object_size_hint_weight_set(addr_label, EVAS_HINT_EXPAND, 0.0);
evas_object_size_hint_align_set(addr_label, EVAS_HINT_FILL, EVAS_HINT_FILL);
elm_label_slide_mode_set(addr_label, ELM_LABEL_SLIDE_MODE_ALWAYS);
elm_box_pack_end(box, addr_label);
evas_object_show(addr_label);
#ifdef ELM_ELOCATION
address = elocation_address_new();
position = elocation_position_new();
ecore_event_handler_add(ELOCATION_EVENT_POSITION, _position_changed, NULL);
ecore_event_handler_add(ELOCATION_EVENT_ADDRESS, _address_changed, NULL);
elocation_position_get(position);
_print_position(position);
elocation_address_get(address);
_print_address(address);
#endif
evas_object_show(box);
evas_object_resize(win, 600, 480);
evas_object_show(win);
elm_run();
#ifdef ELM_ELOCATION
elocation_position_free(position);
elocation_address_free(address);
#endif
return 0;
}
ELM_MAIN()

View File

@ -59,7 +59,6 @@ examples = [
'list_example_01',
'list_example_02',
'list_example_03',
'location_example_01',
'map_example_01',
'map_example_02',
'map_example_03',

View File

@ -1 +0,0 @@
/elocation

View File

@ -1,167 +0,0 @@
#include <stdio.h>
#define EFL_BETA_API_SUPPORT
#include <Ecore.h>
#include <Elocation.h>
/* A set of callbacks to react on incoming elocation events. They are standard
* ecore events and we register callbacks based on these events in the main
* function.
*/
static Eina_Bool
status_changed(void *data EINA_UNUSED, int ev_type EINA_UNUSED, void *event)
{
int *status = event;
printf("Status changed to: %i\n", *status);
printf("\n");
return ECORE_CALLBACK_DONE;
}
static Eina_Bool
rgeocode_arrived(void *data EINA_UNUSED, int ev_type EINA_UNUSED, void *event)
{
Elocation_Address *address;
address = event;
printf("Geocode reply:\n");
printf("Country: %s\n", address->country);
printf("Countrycode: %s\n", address->countrycode);
printf("Locality: %s\n", address->locality);
printf("Postalcode: %s\n", address->postalcode);
printf("Region: %s\n", address->region);
printf("Timezone: %s\n", address->timezone);
printf("Accuracy level: %i\n", address->accur->level);
printf("Accuracy horizontal: %f\n", address->accur->horizontal);
printf("Accuracy vertical: %f\n", address->accur->vertical);
printf("\n");
return ECORE_CALLBACK_DONE;
}
static Eina_Bool
geocode_arrived(void *data EINA_UNUSED, int ev_type EINA_UNUSED, void *event)
{
Elocation_Position *position;
position = event;
printf("Reverse geocode reply:\n");
printf("Latitude:\t %f\n", position->latitude);
printf("Longitude:\t %f\n", position->longitude);
printf("Altitude:\t %f\n", position->altitude);
printf("Accuracy level: %i\n", position->accur->level);
printf("Accuracy horizontal: %f\n", position->accur->horizontal);
printf("Accuracy vertical: %f\n", position->accur->vertical);
printf("\n");
return ECORE_CALLBACK_DONE;
}
static Eina_Bool
address_changed(void *data EINA_UNUSED, int ev_type EINA_UNUSED, void *event)
{
Elocation_Address *address;
address = event;
printf("Address update with data from timestamp: %i\n", address->timestamp);
printf("Country: %s\n", address->country);
printf("Countrycode: %s\n", address->countrycode);
printf("Locality: %s\n", address->locality);
printf("Postalcode: %s\n", address->postalcode);
printf("Region: %s\n", address->region);
printf("Timezone: %s\n", address->timezone);
printf("Accuracy level: %i\n", address->accur->level);
printf("Accuracy horizontal: %f\n", address->accur->horizontal);
printf("Accuracy vertical: %f\n", address->accur->vertical);
printf("\n");
return ECORE_CALLBACK_DONE;
}
static Eina_Bool
position_changed(void *data EINA_UNUSED, int ev_type EINA_UNUSED, void *event)
{
Elocation_Position *position;
position = event;
printf("GeoClue position reply with data from timestamp %i\n", position->timestamp);
printf("Latitude:\t %f\n", position->latitude);
printf("Longitude:\t %f\n", position->longitude);
printf("Altitude:\t %f\n", position->altitude);
printf("Accuracy level: %i\n", position->accur->level);
printf("Accuracy horizontal: %f\n", position->accur->horizontal);
printf("Accuracy vertical: %f\n", position->accur->vertical);
printf("\n");
return ECORE_CALLBACK_DONE;
}
int
main(void)
{
Elocation_Address *address, *addr_geocode;
Elocation_Position *position, *pos_geocode;
int status;
/* Init the needed efl subsystems so we can safely use them */
ecore_init();
eldbus_init();
elocation_init();
/* Create an address and positon object that we use for all our operations.
* Needs to be freed manually with elocation_*_free when we now longer use
* them */
address = elocation_address_new();
position = elocation_position_new();
/* Register callback so we get updates later on */
ecore_event_handler_add(ELOCATION_EVENT_STATUS, status_changed, NULL);
ecore_event_handler_add(ELOCATION_EVENT_POSITION, position_changed, NULL);
ecore_event_handler_add(ELOCATION_EVENT_ADDRESS, address_changed, NULL);
ecore_event_handler_add(ELOCATION_EVENT_GEOCODE, geocode_arrived, NULL);
ecore_event_handler_add(ELOCATION_EVENT_REVERSEGEOCODE, rgeocode_arrived, NULL);
/* To the initial request for status address and position. This fills in the
* objects with the data from GeoClue */
elocation_status_get(&status);
elocation_position_get(position);
elocation_address_get(address);
/* Another set of address and position object. This time for demonstrating
* the GeoCode functionalities */
addr_geocode = elocation_address_new();
pos_geocode = elocation_position_new();
/* The Freeform API could use any string to transform it into position
* coordinates. How good that works depends on the used GeoClue provider */
elocation_freeform_address_to_position("London", pos_geocode);
/* Some demo values to show the position to address conversion */
pos_geocode->latitude = 51.7522;
pos_geocode->longitude = -1.25596;
pos_geocode->accur->level = 3;
elocation_position_to_address(pos_geocode, addr_geocode);
/* And now from address to position */
addr_geocode->locality = "Cambridge";
addr_geocode->countrycode = "UK";
elocation_address_to_position(addr_geocode, pos_geocode);
/* Enter the mainloop now that we are setup with initial data and waiting for
* events. */
ecore_main_loop_begin();
/* Cleanup allocated memory now that we shut down */
elocation_address_free(addr_geocode);
elocation_position_free(pos_geocode);
elocation_address_free(address);
elocation_position_free(position);
/* Make sure we also shut down the initialized subsystems */
elocation_shutdown();
eldbus_shutdown();
ecore_shutdown();
return 0;
}

View File

@ -43,6 +43,8 @@ Ecore_Animator *animator;
* the end of the path.
*/
static const char *batman = "M 256,213 C 245,181 206,187 234,262 147,181 169,71.2 233,18 220,56 235,81 283,88 285,78.7 286,69.3 288,60 289,61.3 290,62.7 291,64 291,64 297,63 300,63 303,63 309,64 309,64 310,62.7 311,61.3 312,60 314,69.3 315,78.7 317,88 365,82 380,56 367,18 431,71 453,181 366,262 394,187 356,181 344,213 328,185 309,184 300,284 291,184 272,185 256,213 Z";
static const unsigned int batman_commandCnt = 17;
static const unsigned int batman_pointCnt = 86;
static const char *morph1[2] = {"M 0,0 L 0,0 L 100,0 L 100,0 L 100,100 L 100,100 L 0,100 L 0,100 L 0,0",
"M 0,0 L 50,-80 L 100,0 L 180,50 L 100,100 L 50,180 L 0,100 L -80,50 L 0,0"};
@ -422,7 +424,7 @@ _2_interpolation_test()
{
anim_index = 0;
Efl_VG *shape;
Efl_VG *shape, *container;
reset_test();
@ -430,13 +432,19 @@ _2_interpolation_test()
animator = ecore_animator_timeline_add(1, _interpolation_keyframe, NULL);
puts(interpolation_menu);
// Make Efl.Canvas.Vg.Container Object
container = efl_add(EFL_CANVAS_VG_CONTAINER_CLASS, d.vg);
// Set the root node of Efl.Canvas.Vg.Object
// The Efl.Canvas.Vg.Object searches and renders
// Efl.Canvas.Vg.Node(Shape, Container, etc...) from set root node.
efl_canvas_vg_object_root_node_set(d.vg, container);
//Interpolation 'from' and 'to' Object
shape = efl_add(EFL_CANVAS_VG_SHAPE_CLASS, d.vg,
efl_gfx_path_append_svg_path(efl_added, morph1[0]), // Set SVG path
efl_gfx_shape_stroke_color_set(efl_added, 255, 0, 0, 255),
efl_gfx_shape_stroke_width_set(efl_added, 5),
efl_canvas_vg_node_origin_set(efl_added, 100, 100)
);
efl_canvas_vg_node_origin_set(efl_added, 100, 100));
d.shape_list = eina_list_append(d.shape_list, shape);
shape = efl_add(EFL_CANVAS_VG_SHAPE_CLASS, d.vg,
@ -447,17 +455,15 @@ _2_interpolation_test()
d.shape_list = eina_list_append(d.shape_list, shape);
// Base Object
shape = efl_add(EFL_CANVAS_VG_SHAPE_CLASS, d.vg);
shape = efl_add(EFL_CANVAS_VG_SHAPE_CLASS, container);
d.shape_list = eina_list_append(d.shape_list, shape);
efl_canvas_vg_object_root_node_set(d.vg, shape);
}
// 2. Interpolation Test Case END
// 3. Gradient Test Case START
static void
_gradient_key_handle(void *data EINA_UNUSED, const Efl_Event *ev)
{
@ -559,7 +565,7 @@ _3_gradient_test()
static void
_main_menu()
{
Efl_VG *shape;
Efl_VG *shape, *container;
if (animator) ecore_animator_del(animator);
animator = NULL;
if(d.vg) efl_del(d.vg);
@ -575,18 +581,23 @@ _main_menu()
d.vg = efl_add(EFL_CANVAS_VG_OBJECT_CLASS, d.evas,
efl_gfx_entity_visible_set(efl_added, EINA_TRUE));
// Make Efl.Canvas.Vg.Container Object
container = efl_add(EFL_CANVAS_VG_CONTAINER_CLASS, d.vg);
// Set the root node of Efl.Canvas.Vg.Object
// The Efl.Canvas.Vg.Object searches and renders
// Efl.Canvas.Vg.Node(Shape, Container, etc...) from set root node.
efl_canvas_vg_object_root_node_set(d.vg, container);
// Make Efl.Canvas.Vg.Shape
shape = efl_add(EFL_CANVAS_VG_SHAPE_CLASS, d.vg,
efl_gfx_path_append_svg_path(efl_added, batman), // Set SVG path
shape = efl_add(EFL_CANVAS_VG_SHAPE_CLASS, container,
efl_gfx_shape_stroke_color_set(efl_added, 255, 0, 0, 255), // Set Stroke color
efl_gfx_shape_stroke_width_set(efl_added, 5), // Set Stroke width
efl_gfx_color_set(efl_added, 255, 255, 0, 255), // Set Fill color
efl_canvas_vg_node_origin_set(efl_added, 25, 100)); // Set Position
// Set the root node of Efl.Canvas.Vg.Object
// The Efl.Canvas.Vg.Object searches and renders
// Efl.Canvas.Vg.Node(Shape, Container, etc...) from set root node.
efl_canvas_vg_object_root_node_set(d.vg, shape);
// Reserve memory for the number of commands and pointers
efl_gfx_path_reserve(shape, batman_commandCnt, batman_pointCnt);
efl_gfx_path_append_svg_path(shape, batman); // Set SVG path
_canvas_resize_cb(d.ee);
puts(main_menu);

View File

@ -18,30 +18,30 @@ ecore_x_gesture_supported(void)
}
EAPI Eina_Bool
ecore_x_gesture_events_select(Ecore_X_Window win,
Ecore_X_Gesture_Event_Mask mask)
ecore_x_gesture_events_select(Ecore_X_Window win EINA_UNUSED,
Ecore_X_Gesture_Event_Mask mask EINA_UNUSED)
{
return EINA_FALSE;
}
EAPI Ecore_X_Gesture_Event_Mask
ecore_x_gesture_events_selected_get(Ecore_X_Window win)
ecore_x_gesture_events_selected_get(Ecore_X_Window win EINA_UNUSED)
{
return ECORE_X_GESTURE_EVENT_MASK_NONE;
}
EAPI Eina_Bool
ecore_x_gesture_event_grab(Ecore_X_Window win,
Ecore_X_Gesture_Event_Type type,
int num_fingers)
ecore_x_gesture_event_grab(Ecore_X_Window win EINA_UNUSED,
Ecore_X_Gesture_Event_Type type EINA_UNUSED,
int num_fingers EINA_UNUSED)
{
return EINA_FALSE;
}
EAPI Eina_Bool
ecore_x_gesture_event_ungrab(Ecore_X_Window win,
Ecore_X_Gesture_Event_Type type,
int num_fingers)
ecore_x_gesture_event_ungrab(Ecore_X_Window win EINA_UNUSED,
Ecore_X_Gesture_Event_Type type EINA_UNUSED,
int num_fingers EINA_UNUSED)
{
return EINA_FALSE;
}

View File

@ -62,10 +62,10 @@ _edje_part_recalc_single_textblock_min_max_calc_legacy(Edje_Real_Part *ep,
if (!minx2)
{
efl_gfx_entity_size_set(ep->object, EINA_SIZE2D(TO_INT(params->eval.w), TO_INT(params->eval.h)));
size = efl_canvas_text_size_formatted_get(ep->object);
size = efl_canvas_textblock_size_formatted_get(ep->object);
}
else
size = efl_canvas_text_size_native_get(ep->object);
size = efl_canvas_textblock_size_native_get(ep->object);
evas_object_textblock_style_insets_get(ep->object, &ins_l,
&ins_r, &ins_t, &ins_b);
mw = ins_l + size.w + ins_r;
@ -88,10 +88,10 @@ _edje_part_recalc_single_textblock_min_max_calc_legacy(Edje_Real_Part *ep,
if (!maxx2)
{
efl_gfx_entity_size_set(ep->object, EINA_SIZE2D(TO_INT(params->eval.w), TO_INT(params->eval.h)));
size = efl_canvas_text_size_formatted_get(ep->object);
size = efl_canvas_textblock_size_formatted_get(ep->object);
}
else
size = efl_canvas_text_size_native_get(ep->object);
size = efl_canvas_textblock_size_native_get(ep->object);
evas_object_textblock_style_insets_get(ep->object, &ins_l, &ins_r,
&ins_t, &ins_b);
mw = ins_l + size.w + ins_r;
@ -180,7 +180,7 @@ _edje_part_recalc_single_textblock_min_max_calc(Edje_Real_Part *ep,
if (temp_w > 0)
{
efl_gfx_entity_size_set(ep->object, EINA_SIZE2D(temp_w, temp_h));
size = efl_canvas_text_size_formatted_get(ep->object);
size = efl_canvas_textblock_size_formatted_get(ep->object);
tw = size.w;
th = size.h;
@ -189,7 +189,7 @@ _edje_part_recalc_single_textblock_min_max_calc(Edje_Real_Part *ep,
}
else
{
size = efl_canvas_text_size_native_get(ep->object);
size = efl_canvas_textblock_size_native_get(ep->object);
th = size.h;
th += ins_t + ins_b;
@ -221,7 +221,7 @@ _edje_part_recalc_single_textblock_min_max_calc(Edje_Real_Part *ep,
}
efl_gfx_entity_size_set(ep->object, EINA_SIZE2D(temp_w, temp_h));
size = efl_canvas_text_size_formatted_get(ep->object);
size = efl_canvas_textblock_size_formatted_get(ep->object);
tw = size.w;
th = size.h;
@ -232,7 +232,7 @@ _edje_part_recalc_single_textblock_min_max_calc(Edje_Real_Part *ep,
* don't get meaningless height for multiline */
if (temp_w <= 0)
{
size = efl_canvas_text_size_native_get(ep->object);
size = efl_canvas_textblock_size_native_get(ep->object);
th = size.h;
th += ins_t + ins_b;
@ -246,7 +246,7 @@ _edje_part_recalc_single_textblock_min_max_calc(Edje_Real_Part *ep,
* text.min: 1 X
* text.max: 0 X without max width.
* It is a singleline Textblock. */
size = efl_canvas_text_size_native_get(ep->object);
size = efl_canvas_textblock_size_native_get(ep->object);
tw = size.w;
th = size.h;
@ -311,7 +311,7 @@ _edje_part_recalc_single_textblock_min_max_calc(Edje_Real_Part *ep,
if (temp_w > 0)
{
efl_gfx_entity_size_set(ep->object, EINA_SIZE2D(temp_w, temp_h));
size = efl_canvas_text_size_formatted_get(ep->object);
size = efl_canvas_textblock_size_formatted_get(ep->object);
tw = size.w;
th = size.h;
@ -320,7 +320,7 @@ _edje_part_recalc_single_textblock_min_max_calc(Edje_Real_Part *ep,
}
else
{
size = efl_canvas_text_size_native_get(ep->object);
size = efl_canvas_textblock_size_native_get(ep->object);
th = size.h;
th += ins_t + ins_b;
@ -335,7 +335,7 @@ _edje_part_recalc_single_textblock_min_max_calc(Edje_Real_Part *ep,
/* text.min: 1 X
* text.max: 1 X
* Singleline. */
size = efl_canvas_text_size_native_get(ep->object);
size = efl_canvas_textblock_size_native_get(ep->object);
tw = size.w;
th = size.h;
@ -374,7 +374,7 @@ _edje_part_recalc_single_textblock_min_max_calc(Edje_Real_Part *ep,
* text.max: 1 1 */
efl_gfx_entity_size_set(ep->object, EINA_SIZE2D(temp_w, temp_h));
size = efl_canvas_text_size_formatted_get(ep->object);
size = efl_canvas_textblock_size_formatted_get(ep->object);
tw = size.w;
th = size.h;
@ -385,7 +385,7 @@ _edje_part_recalc_single_textblock_min_max_calc(Edje_Real_Part *ep,
* don't get meaningless height for multiline */
if (temp_w <= 0)
{
size = efl_canvas_text_size_native_get(ep->object);
size = efl_canvas_textblock_size_native_get(ep->object);
th = size.h;
th += ins_t + ins_b;
@ -404,7 +404,7 @@ _edje_part_recalc_single_textblock_min_max_calc(Edje_Real_Part *ep,
temp_h = efl_gfx_entity_size_get(ep->object).h;
efl_gfx_entity_size_set(ep->object, EINA_SIZE2D(temp_w, temp_h));
size = efl_canvas_text_size_formatted_get(ep->object);
size = efl_canvas_textblock_size_formatted_get(ep->object);
tw = size.w;
th = size.h;
@ -415,7 +415,7 @@ _edje_part_recalc_single_textblock_min_max_calc(Edje_Real_Part *ep,
* don't get meaningless height for multiline */
if (temp_w <= 0)
{
size = efl_canvas_text_size_native_get(ep->object);
size = efl_canvas_textblock_size_native_get(ep->object);
th = size.h;
th += ins_t + ins_b;
@ -545,7 +545,7 @@ _edje_part_recalc_single_textblock(FLOAT_T sc,
if (ep->part->scale) base_s = TO_DOUBLE(sc);
efl_gfx_entity_scale_set(ep->object, base_s);
size = efl_canvas_text_size_native_get(ep->object);
size = efl_canvas_textblock_size_native_get(ep->object);
orig_s = base_s;
/* Now make it bigger so calculations will be more accurate
@ -554,7 +554,7 @@ _edje_part_recalc_single_textblock(FLOAT_T sc,
orig_s = _edje_part_recalc_single_textblock_scale_range_adjust(chosen_desc, base_s,
orig_s * TO_INT(params->eval.w) / size.w);
efl_gfx_entity_scale_set(ep->object, orig_s);
size = efl_canvas_text_size_native_get(ep->object);
size = efl_canvas_textblock_size_native_get(ep->object);
}
if (chosen_desc->text.fit_x)
{
@ -563,7 +563,7 @@ _edje_part_recalc_single_textblock(FLOAT_T sc,
s = _edje_part_recalc_single_textblock_scale_range_adjust(chosen_desc, base_s,
orig_s * TO_INT(params->eval.w) / size.w);
efl_gfx_entity_scale_set(ep->object, s);
efl_canvas_text_size_native_get(ep->object);
efl_canvas_textblock_size_native_get(ep->object);
}
}
if (chosen_desc->text.fit_y)
@ -580,7 +580,7 @@ _edje_part_recalc_single_textblock(FLOAT_T sc,
}
efl_gfx_entity_scale_set(ep->object, s);
efl_canvas_text_size_native_get(ep->object);
efl_canvas_textblock_size_native_get(ep->object);
}
}
@ -589,7 +589,7 @@ _edje_part_recalc_single_textblock(FLOAT_T sc,
{
int i = 5; /* Tries before we give up. */
Eina_Size2D size;
size = efl_canvas_text_size_native_get(ep->object);
size = efl_canvas_textblock_size_native_get(ep->object);
/* If we are still too big, try reducing the size to
* 95% each try. */
@ -605,7 +605,7 @@ _edje_part_recalc_single_textblock(FLOAT_T sc,
s = tmp_s;
efl_gfx_entity_scale_set(ep->object, s);
size = efl_canvas_text_size_native_get(ep->object);
size = efl_canvas_textblock_size_native_get(ep->object);
i--;
}
}

View File

@ -73,10 +73,6 @@
#include <Efreet_Trash.h>
#include <Ethumb_Client.h>
#ifdef ELM_ELOCATION
#include <Elocation.h>
#endif
#ifdef ELM_EMAP
#include <EMap.h>
#endif

View File

@ -13,8 +13,4 @@
@ELM_LIBINTL_H_DEF@ ELM_LIBINTL_H
@ELM_DIRENT_H_DEF@ ELM_DIRENT_H
#ifdef EFL_BETA_API_SUPPORT
# define ELM_ELOCATION
#endif
#endif

View File

@ -4,7 +4,7 @@
#include "elm_priv.h"
#include "efl_ui_internal_text_interactive.h"
#include "efl_canvas_text_internal.h"
#include "efl_canvas_textblock_internal.h"
#define MY_CLASS EFL_UI_INTERNAL_TEXT_INTERACTIVE_CLASS
@ -52,25 +52,25 @@ static const char *_entry_selection_get(Efl_Ui_Internal_Text_Interactive *obj, E
static void _entry_imf_cursor_info_set(Efl_Ui_Internal_Text_Interactive_Data *en);
static void
_text_filter_format_prepend(Efl_Canvas_Text *obj, Efl_Ui_Internal_Text_Interactive_Data *en,
_text_filter_format_prepend(Efl_Canvas_Textblock *obj, Efl_Ui_Internal_Text_Interactive_Data *en,
Efl_Text_Cursor *c, const char *text);
static Efl_Text_Change_Info *
_text_filter_text_prepend(Efl_Canvas_Text *obj, Efl_Ui_Internal_Text_Interactive_Data *en,
_text_filter_text_prepend(Efl_Canvas_Textblock *obj, Efl_Ui_Internal_Text_Interactive_Data *en,
Efl_Text_Cursor *c,
const char *text,
const char *fmtpre, const char *fmtpost,
Eina_Bool clearsel, Eina_Bool changeinfo);
static Efl_Text_Change_Info *
_text_filter_markup_prepend_internal(Efl_Canvas_Text *obj, Efl_Ui_Internal_Text_Interactive_Data *en,
_text_filter_markup_prepend_internal(Efl_Canvas_Textblock *obj, Efl_Ui_Internal_Text_Interactive_Data *en,
Efl_Text_Cursor *c,
char *text,
const char *fmtpre, const char *fmtpost,
Eina_Bool clearsel, Eina_Bool changeinfo);
static Efl_Text_Change_Info *
_text_filter_markup_prepend(Efl_Canvas_Text *obj, Efl_Ui_Internal_Text_Interactive_Data *en,
_text_filter_markup_prepend(Efl_Canvas_Textblock *obj, Efl_Ui_Internal_Text_Interactive_Data *en,
Efl_Text_Cursor *c,
const char *text,
const char *fmtpre, const char *fmtpost,
@ -109,7 +109,7 @@ _preedit_del(Eo *obj EINA_UNUSED, Efl_Ui_Internal_Text_Interactive_Data *en)
static Eina_Bool
_entry_imf_retrieve_surrounding_cb(void *data, Ecore_IMF_Context *ctx EINA_UNUSED, char **text, int *cursor_pos)
{
Efl_Canvas_Text *obj = data;
Efl_Canvas_Textblock *obj = data;
Efl_Text_Cursor *cur = efl_text_interactive_main_cursor_get(obj);
const char *str;
@ -144,7 +144,7 @@ _return_key_update(Evas_Object *obj)
if (sd->input_panel_return_key_state != EFL_INPUT_TEXT_PANEL_RETURN_KEY_STATE_AUTO) return;
if (efl_canvas_text_is_empty_get(obj) == EINA_TRUE)
if (efl_canvas_textblock_is_empty_get(obj) == EINA_TRUE)
return_key_disabled = EINA_TRUE;
if (sd->imf_context)
@ -180,7 +180,7 @@ _entry_hide_visible_password(Eo *obj)
static void
_entry_imf_event_commit_cb(void *data, Ecore_IMF_Context *ctx EINA_UNUSED, void *event_info)
{
Efl_Canvas_Text *obj = data;
Efl_Canvas_Textblock *obj = data;
Efl_Ui_Internal_Text_Interactive_Data *en = efl_data_scope_get(obj, MY_CLASS);
char *commit_str = event_info;
Efl_Text_Change_Info *info = NULL;
@ -231,7 +231,7 @@ _entry_imf_event_commit_cb(void *data, Ecore_IMF_Context *ctx EINA_UNUSED, void
}
static Efl_Text_Change_Info *
_text_filter_markup_prepend_internal(Efl_Canvas_Text *obj, Efl_Ui_Internal_Text_Interactive_Data *en,
_text_filter_markup_prepend_internal(Efl_Canvas_Textblock *obj, Efl_Ui_Internal_Text_Interactive_Data *en,
Efl_Text_Cursor *c,
char *text,
const char *fmtpre, const char *fmtpost,
@ -284,7 +284,7 @@ _text_filter_markup_prepend_internal(Efl_Canvas_Text *obj, Efl_Ui_Internal_Text_
}
static Efl_Text_Change_Info *
_text_filter_markup_prepend(Efl_Canvas_Text *obj, Efl_Ui_Internal_Text_Interactive_Data *en,
_text_filter_markup_prepend(Efl_Canvas_Textblock *obj, Efl_Ui_Internal_Text_Interactive_Data *en,
Efl_Text_Cursor *c,
const char *text,
const char *fmtpre, const char *fmtpost,
@ -313,7 +313,7 @@ _text_filter_markup_prepend(Efl_Canvas_Text *obj, Efl_Ui_Internal_Text_Interacti
}
static Efl_Text_Change_Info *
_text_filter_text_prepend(Efl_Canvas_Text *obj, Efl_Ui_Internal_Text_Interactive_Data *en,
_text_filter_text_prepend(Efl_Canvas_Textblock *obj, Efl_Ui_Internal_Text_Interactive_Data *en,
Efl_Text_Cursor *c,
const char *text,
const char *fmtpre, const char *fmtpost,
@ -342,7 +342,7 @@ _text_filter_text_prepend(Efl_Canvas_Text *obj, Efl_Ui_Internal_Text_Interactive
}
static void
_text_filter_format_prepend(Efl_Canvas_Text *obj, Efl_Ui_Internal_Text_Interactive_Data *en,
_text_filter_format_prepend(Efl_Canvas_Textblock *obj, Efl_Ui_Internal_Text_Interactive_Data *en,
Efl_Text_Cursor *c, const char *text)
{
EINA_SAFETY_ON_NULL_RETURN(text);
@ -416,7 +416,7 @@ _text_filter_format_prepend(Efl_Canvas_Text *obj, Efl_Ui_Internal_Text_Interacti
static void
_entry_imf_event_preedit_changed_cb(void *data, Ecore_IMF_Context *ctx EINA_UNUSED, void *event_info EINA_UNUSED)
{
Efl_Canvas_Text *obj = data;
Efl_Canvas_Textblock *obj = data;
Efl_Text_Cursor *cur = efl_text_interactive_main_cursor_get(obj);
Efl_Ui_Internal_Text_Interactive_Data *en = efl_data_scope_get(obj, MY_CLASS);
Efl_Text_Change_Info *info = NULL;
@ -518,12 +518,12 @@ _entry_imf_event_preedit_changed_cb(void *data, Ecore_IMF_Context *ctx EINA_UNUS
{
/* set preedit start cursor */
if (!en->preedit_start)
en->preedit_start = efl_canvas_text_cursor_create(obj);
en->preedit_start = efl_canvas_textblock_cursor_create(obj);
efl_text_cursor_copy(cur, en->preedit_start);
/* set preedit end cursor */
if (!en->preedit_end)
en->preedit_end = efl_canvas_text_cursor_create(obj);
en->preedit_end = efl_canvas_textblock_cursor_create(obj);
efl_text_cursor_copy(cur, en->preedit_end);
preedit_end_pos = efl_text_cursor_position_get(cur);
@ -561,7 +561,7 @@ _entry_imf_event_preedit_changed_cb(void *data, Ecore_IMF_Context *ctx EINA_UNUS
static void
_entry_imf_event_delete_surrounding_cb(void *data, Ecore_IMF_Context *ctx EINA_UNUSED, void *event_info)
{
Efl_Canvas_Text *obj = data;
Efl_Canvas_Textblock *obj = data;
Efl_Text_Cursor *cur = efl_text_interactive_main_cursor_get(obj);
Efl_Ui_Internal_Text_Interactive_Data *en = efl_data_scope_get(obj, MY_CLASS);
Ecore_IMF_Event_Delete_Surrounding *ev = event_info;
@ -573,10 +573,10 @@ _entry_imf_event_delete_surrounding_cb(void *data, Ecore_IMF_Context *ctx EINA_U
cursor_pos = efl_text_cursor_position_get(cur);
del_start = efl_canvas_text_cursor_create(obj);
del_start = efl_canvas_textblock_cursor_create(obj);
efl_text_cursor_position_set(del_start, cursor_pos + ev->offset);
del_end = efl_canvas_text_cursor_create(obj);
del_end = efl_canvas_textblock_cursor_create(obj);
efl_text_cursor_position_set(del_end, cursor_pos + ev->offset + ev->n_chars);
start = efl_text_cursor_position_get(del_start);
@ -605,7 +605,7 @@ end:
static void
_entry_imf_event_selection_set_cb(void *data, Ecore_IMF_Context *ctx EINA_UNUSED, void *event_info)
{
Efl_Canvas_Text *obj = data;
Efl_Canvas_Textblock *obj = data;
Efl_Text_Cursor *cur = efl_text_interactive_main_cursor_get(obj);
Efl_Ui_Internal_Text_Interactive_Data *en = efl_data_scope_get(obj, MY_CLASS);
Ecore_IMF_Event_Selection *ev = event_info;
@ -628,7 +628,7 @@ _entry_imf_event_selection_set_cb(void *data, Ecore_IMF_Context *ctx EINA_UNUSED
static Eina_Bool
_entry_imf_retrieve_selection_cb(void *data, Ecore_IMF_Context *ctx EINA_UNUSED, char **text)
{
Efl_Canvas_Text *obj = data;
Efl_Canvas_Textblock *obj = data;
Efl_Ui_Internal_Text_Interactive_Data *en = efl_data_scope_get(obj, MY_CLASS);
const char *selection_text = NULL;
@ -856,10 +856,10 @@ _efl_ui_internal_text_interactive_efl_text_interactive_all_select(
Efl_Text_Cursor *cur = efl_text_interactive_main_cursor_get(obj);
_entry_imf_context_reset(en);
efl_text_cursor_move(cur, EFL_TEXT_CURSOR_MOVE_TYPE_PARAGRAPH_FIRST);
efl_text_cursor_move(cur, EFL_TEXT_CURSOR_MOVE_TYPE_FIRST);
_entry_imf_context_reset(en);
_sel_init(cur, obj, en);
efl_text_cursor_move(cur, EFL_TEXT_CURSOR_MOVE_TYPE_PARAGRAPH_LAST);
efl_text_cursor_move(cur, EFL_TEXT_CURSOR_MOVE_TYPE_LAST);
_sel_extend(cur, obj, en);
}
@ -1106,7 +1106,7 @@ _key_down_cb(void *data EINA_UNUSED, Evas *e EINA_UNUSED, Evas_Object *obj, void
{
if (multiline)
{
if (shift || efl_canvas_text_newline_as_paragraph_separator_get(obj))
if (shift || efl_canvas_textblock_newline_as_paragraph_separator_get(obj))
{
string = "\n";
}
@ -1193,7 +1193,7 @@ _key_down_cb(void *data EINA_UNUSED, Evas *e EINA_UNUSED, Evas_Object *obj, void
if (control && !en->have_selection)
{
// del to start of previous word
Efl_Text_Cursor *tc = efl_canvas_text_cursor_create(obj);
Efl_Text_Cursor *tc = efl_canvas_textblock_cursor_create(obj);
efl_text_cursor_copy(tc, cur);
efl_text_cursor_move(cur, EFL_TEXT_CURSOR_MOVE_TYPE_CHAR_PREV);
@ -1228,7 +1228,7 @@ _key_down_cb(void *data EINA_UNUSED, Evas *e EINA_UNUSED, Evas_Object *obj, void
if (control)
{
// del to end of next word
Efl_Text_Cursor *tc = efl_canvas_text_cursor_create(obj);
Efl_Text_Cursor *tc = efl_canvas_textblock_cursor_create(obj);
efl_text_cursor_copy(tc, cur);
efl_text_cursor_move(cur, EFL_TEXT_CURSOR_MOVE_TYPE_WORD_END);
@ -1265,7 +1265,7 @@ _key_down_cb(void *data EINA_UNUSED, Evas *e EINA_UNUSED, Evas_Object *obj, void
_key_down_sel_pre(obj, cur, en, shift, EINA_FALSE);
if ((control) && (multiline))
efl_text_cursor_move(cur, EFL_TEXT_CURSOR_MOVE_TYPE_PARAGRAPH_FIRST);
efl_text_cursor_move(cur, EFL_TEXT_CURSOR_MOVE_TYPE_FIRST);
else
efl_text_cursor_move(cur, EFL_TEXT_CURSOR_MOVE_TYPE_LINE_START);
@ -1280,7 +1280,7 @@ _key_down_cb(void *data EINA_UNUSED, Evas *e EINA_UNUSED, Evas_Object *obj, void
_key_down_sel_pre(obj, cur, en, shift, EINA_TRUE);
if ((control) && (multiline))
efl_text_cursor_move(cur, EFL_TEXT_CURSOR_MOVE_TYPE_PARAGRAPH_LAST);
efl_text_cursor_move(cur, EFL_TEXT_CURSOR_MOVE_TYPE_LAST);
else
efl_text_cursor_move(cur, EFL_TEXT_CURSOR_MOVE_TYPE_LINE_END);
@ -1466,28 +1466,28 @@ end:
}
static void
_cursor_char_coord_set(Efl_Canvas_Text *obj, Efl_Text_Cursor *cur, Evas_Coord canvasx, Evas_Coord canvasy, Evas_Coord *_cx, Evas_Coord *_cy)
_cursor_char_coord_set(Efl_Canvas_Textblock *obj, Efl_Text_Cursor *cur, Evas_Coord canvasx, Evas_Coord canvasy, Evas_Coord *_cx, Evas_Coord *_cy)
{
Evas_Coord cx, cy;
Evas_Coord x, y, lh = 0, cly = 0;
Efl_Text_Cursor *line_cur;
Efl_Text_Cursor *tc;
tc = efl_canvas_text_cursor_create(obj);
tc = efl_canvas_textblock_cursor_create(obj);
efl_text_cursor_copy(cur, tc);
evas_object_geometry_get(obj, &x, &y, NULL, NULL);
cx = canvasx - x;
cy = canvasy - y;
line_cur = efl_canvas_text_cursor_create(obj);
efl_text_cursor_move(line_cur, EFL_TEXT_CURSOR_MOVE_TYPE_PARAGRAPH_LAST);
line_cur = efl_canvas_textblock_cursor_create(obj);
efl_text_cursor_move(line_cur, EFL_TEXT_CURSOR_MOVE_TYPE_LAST);
evas_textblock_cursor_line_geometry_get(efl_text_cursor_handle_get(line_cur), NULL, &cly, NULL, &lh);
/* Consider a threshold of half the line height */
if (cy > (cly + lh) && cy < (cly + lh + lh / 2))
{
cy = cly + lh - 1; // Make it inside Textblock
}
efl_text_cursor_move(line_cur, EFL_TEXT_CURSOR_MOVE_TYPE_PARAGRAPH_FIRST);
efl_text_cursor_move(line_cur, EFL_TEXT_CURSOR_MOVE_TYPE_FIRST);
evas_textblock_cursor_line_geometry_get(efl_text_cursor_handle_get(line_cur), NULL, &cly, NULL, NULL);
if (cy < cly && cy > (cly - lh / 2))
@ -1538,7 +1538,7 @@ _mouse_down_cb(void *data EINA_UNUSED, Evas *e EINA_UNUSED, Evas_Object *obj EIN
{
if (shift)
{
tc = efl_canvas_text_cursor_create(obj);
tc = efl_canvas_textblock_cursor_create(obj);
efl_text_cursor_copy(cur, tc);
if (efl_text_cursor_compare(cur, en->sel_start) < 0)
efl_text_cursor_move(cur, EFL_TEXT_CURSOR_MOVE_TYPE_LINE_START);
@ -1551,7 +1551,7 @@ _mouse_down_cb(void *data EINA_UNUSED, Evas *e EINA_UNUSED, Evas_Object *obj EIN
en->have_selection = EINA_FALSE;
en->selecting = EINA_FALSE;
_sel_clear(obj, en);
tc = efl_canvas_text_cursor_create(obj);
tc = efl_canvas_textblock_cursor_create(obj);
efl_text_cursor_copy(cur, tc);
efl_text_cursor_move(cur, EFL_TEXT_CURSOR_MOVE_TYPE_LINE_START);
_sel_init(cur, obj, en);
@ -1564,7 +1564,7 @@ _mouse_down_cb(void *data EINA_UNUSED, Evas *e EINA_UNUSED, Evas_Object *obj EIN
{
if (shift)
{
tc = efl_canvas_text_cursor_create(obj);
tc = efl_canvas_textblock_cursor_create(obj);
efl_text_cursor_copy(cur, tc);
if (efl_text_cursor_compare(cur, en->sel_start) < 0)
efl_text_cursor_move(cur, EFL_TEXT_CURSOR_MOVE_TYPE_WORD_START);
@ -1580,7 +1580,7 @@ _mouse_down_cb(void *data EINA_UNUSED, Evas *e EINA_UNUSED, Evas_Object *obj EIN
en->have_selection = EINA_FALSE;
en->selecting = EINA_FALSE;
_sel_clear(obj, en);
tc = efl_canvas_text_cursor_create(obj);
tc = efl_canvas_textblock_cursor_create(obj);
efl_text_cursor_copy(cur, tc);
efl_text_cursor_move(cur, EFL_TEXT_CURSOR_MOVE_TYPE_WORD_START);
_sel_init(cur, obj, en);
@ -1679,7 +1679,7 @@ _mouse_move_cb(void *data EINA_UNUSED, Evas *e EINA_UNUSED, Evas_Object *obj, vo
if (en->selecting)
{
tc = efl_canvas_text_cursor_create(obj);
tc = efl_canvas_textblock_cursor_create(obj);
efl_text_cursor_copy(cur, tc);
evas_object_geometry_get(obj, &x, &y, &w, &h);
cx = ev->cur.canvas.x - x;
@ -1692,7 +1692,7 @@ _mouse_move_cb(void *data EINA_UNUSED, Evas *e EINA_UNUSED, Evas_Object *obj, vo
else
{
Evas_Coord lx, ly, lw, lh;
efl_text_cursor_move(cur, EFL_TEXT_CURSOR_MOVE_TYPE_PARAGRAPH_FIRST);
efl_text_cursor_move(cur, EFL_TEXT_CURSOR_MOVE_TYPE_FIRST);
evas_textblock_cursor_line_geometry_get(efl_text_cursor_handle_get(cur), &lx, &ly, &lw, &lh);
efl_text_cursor_char_coord_set(cur, EINA_POSITION2D(cx, ly + (lh / 2)));
}
@ -1733,9 +1733,9 @@ _efl_ui_internal_text_interactive_efl_object_finalize(Eo *obj, Efl_Ui_Internal_T
evas_object_event_callback_add(obj, EVAS_CALLBACK_MOUSE_UP, _mouse_up_cb, NULL);
evas_object_event_callback_add(obj, EVAS_CALLBACK_MOUSE_MOVE, _mouse_move_cb, NULL);
en->main_cursor = efl_canvas_text_cursor_create(obj);
en->sel_start = efl_canvas_text_cursor_create(obj);
en->sel_end = efl_canvas_text_cursor_create(obj);
en->main_cursor = efl_canvas_textblock_cursor_create(obj);
en->sel_start = efl_canvas_textblock_cursor_create(obj);
en->sel_end = efl_canvas_textblock_cursor_create(obj);
efl_event_callback_add(efl_text_interactive_main_cursor_get(obj), EFL_TEXT_CURSOR_EVENT_CHANGED,
_sel_cursor_changed, obj);
@ -1810,7 +1810,7 @@ _efl_ui_internal_text_interactive_efl_text_text_set(Eo *eo_obj, Efl_Ui_Internal_
const char *text)
{
efl_text_set(efl_super(eo_obj, MY_CLASS), text);
efl_text_cursor_move(o->main_cursor, EFL_TEXT_CURSOR_MOVE_TYPE_PARAGRAPH_LAST);
efl_text_cursor_move(o->main_cursor, EFL_TEXT_CURSOR_MOVE_TYPE_LAST);
}
EOLIAN void
@ -1818,7 +1818,7 @@ _efl_ui_internal_text_interactive_efl_text_markup_markup_set(Eo *eo_obj, Efl_Ui_
const char *text)
{
efl_text_markup_set(efl_super(eo_obj, MY_CLASS), text);
efl_text_cursor_move(o->main_cursor, EFL_TEXT_CURSOR_MOVE_TYPE_PARAGRAPH_LAST);
efl_text_cursor_move(o->main_cursor, EFL_TEXT_CURSOR_MOVE_TYPE_LAST);
}
EOLIAN static void

View File

@ -1,4 +1,4 @@
class @beta Efl.Ui.Internal.Text.Interactive extends Efl.Canvas.Text implements Efl.Text_Interactive, Efl.Input_Text
class @beta Efl.Ui.Internal.Text.Interactive extends Efl.Canvas.Textblock implements Efl.Text_Interactive, Efl.Input_Text
{
[[An internal object in charge of the interactive aspect of the text widget.

View File

@ -36,7 +36,7 @@
typedef struct _Efl_Ui_Internal_Text_Scroller_Data
{
Efl_Canvas_Text *text_obj;
Efl_Canvas_Textblock *text_obj;
Efl_Ui_Table *text_table;
Eo *smanager;
@ -101,7 +101,7 @@ _efl_ui_internal_text_scroller_efl_canvas_group_group_calculate(Eo *obj,
efl_event_freeze(sd->text_obj);
efl_gfx_entity_size_set(sd->text_table, view.size);
efl_gfx_entity_size_set(sd->text_obj, view.size);
fsz = efl_canvas_text_size_formatted_get(sd->text_obj);
fsz = efl_canvas_textblock_size_formatted_get(sd->text_obj);
efl_gfx_entity_size_set(sd->text_table, sz);
efl_gfx_entity_size_set(sd->text_obj, sz);
efl_event_thaw(sd->text_obj);
@ -152,7 +152,7 @@ _efl_ui_internal_text_scroller_efl_object_destructor(Eo *obj,
EOLIAN static void
_efl_ui_internal_text_scroller_initialize(Eo *obj,
Efl_Ui_Internal_Text_Scroller_Data *sd,
Efl_Canvas_Text *text_obj,
Efl_Canvas_Textblock *text_obj,
Efl_Ui_Table *text_table)
{
if (efl_finalized_get(obj))

View File

@ -10,7 +10,7 @@ class @beta Efl.Ui.Internal_Text_Scroller extends Efl.Ui.Scroller
[[Internal-usage text scroller class.
This class is a special scroller that evaluates its size based on the
@Efl.Canvas.Text object it holds. On initialization the object is meant
@Efl.Canvas.Textblock object it holds. On initialization the object is meant
to be passed along a container (so that other objects such as
a "guide hint" text object are store in such container.
]]
@ -32,11 +32,11 @@ class @beta Efl.Ui.Internal_Text_Scroller extends Efl.Ui.Scroller
}
}
initialize {
[[The Efl.Canvas.Text content of this scroller.
[[The Efl.Canvas.Textblock content of this scroller.
This should be called upon constructing the object.
]]
params {
text_obj: Efl.Canvas.Text; [[The text object to query]]
text_obj: Efl.Canvas.Textblock; [[The text object to query]]
text_table: Efl.Ui.Table; [[The table container of
the $text_obj]]
}

View File

@ -18,7 +18,7 @@
#include "elm_hoversel_eo.h"
#include "efl_ui_text_part.eo.h"
#include "elm_part_helper.h"
#include "efl_canvas_text_internal.h"
#include "efl_canvas_textblock_internal.h"
typedef struct _Efl_Ui_Text_Data Efl_Ui_Text_Data;
typedef struct _Efl_Ui_Text_Rectangle Efl_Ui_Text_Rectangle;
@ -65,8 +65,8 @@ struct _Efl_Ui_Text_Data
int gen;
Eina_List *sel;
Eina_List *items; /** context menu item list */
Efl_Canvas_Text_Factory *item_factory;
Efl_Canvas_Text_Factory *item_fallback_factory;
Efl_Canvas_Textblock_Factory *item_factory;
Efl_Canvas_Textblock_Factory *item_fallback_factory;
Eina_List *markup_filters;
Ecore_Job *hov_deljob;
Mod_Api *api; // module api if supplied
@ -851,9 +851,9 @@ _efl_ui_text_efl_canvas_group_group_calculate(Eo *obj, Efl_Ui_Text_Data *sd)
efl_gfx_entity_size_set(sd->text_obj, EINA_SIZE2D(sz.w, 0));
/* ignore current object size for single-line since we always need to know the actual size */
if (!efl_text_multiline_get(obj))
min = efl_canvas_text_size_native_get(sd->text_obj);
min = efl_canvas_textblock_size_native_get(sd->text_obj);
else
min = efl_canvas_text_size_formatted_get(sd->text_obj);
min = efl_canvas_textblock_size_formatted_get(sd->text_obj);
efl_gfx_entity_size_set(sd->text_obj, text_sz);
efl_event_thaw(sd->text_obj);
min.w += edmin.w;
@ -1485,11 +1485,11 @@ _item_get(void *data, const char *item)
{
if (sd->item_factory)
{
o = efl_canvas_text_factory_create(sd->item_factory, data, item);
o = efl_canvas_textblock_factory_create(sd->item_factory, data, item);
}
else if (sd->item_fallback_factory)
{
o = efl_canvas_text_factory_create(sd->item_fallback_factory,
o = efl_canvas_textblock_factory_create(sd->item_fallback_factory,
data, item);
}
}
@ -1967,7 +1967,7 @@ _efl_ui_text_efl_object_constructor(Eo *obj, Efl_Ui_Text_Data *sd)
efl_event_callback_forwarder_add(text_obj, EFL_TEXT_INTERACTIVE_EVENT_UNDO_REQUEST, obj);
efl_event_callback_forwarder_add(text_obj, EFL_TEXT_INTERACTIVE_EVENT_PREEDIT_CHANGED, obj);
sd->text_obj = text_obj;
sd->text_guide_obj = efl_add(EFL_CANVAS_TEXT_CLASS, obj);
sd->text_guide_obj = efl_add(EFL_CANVAS_TEXTBLOCK_CLASS, obj);
sd->text_table = efl_add(EFL_UI_TABLE_CLASS, obj);
efl_composite_attach(obj, text_obj);
@ -2028,7 +2028,7 @@ _efl_ui_text_efl_object_finalize(Eo *obj,
(sd->entry_edje, EVAS_HINT_FILL, EVAS_HINT_FILL);
efl_event_callback_add(sd->text_obj, EFL_TEXT_INTERACTIVE_EVENT_CHANGED_USER,
_efl_ui_text_changed_user_cb, obj);
efl_event_callback_add(sd->text_obj, EFL_CANVAS_TEXT_EVENT_CHANGED,
efl_event_callback_add(sd->text_obj, EFL_CANVAS_TEXTBLOCK_EVENT_CHANGED,
_efl_ui_text_changed_cb, obj);
efl_event_callback_add(sd->text_obj, EFL_TEXT_INTERACTIVE_EVENT_HAVE_SELECTION_CHANGED,
_efl_ui_text_selection_start_clear_cb, obj);
@ -2921,8 +2921,8 @@ _efl_ui_text_efl_access_text_default_attributes_get(const Eo *obj, Efl_Ui_Text_D
start = efl_ui_text_cursor_create(mobj);
end = efl_ui_text_cursor_create(mobj);
efl_text_cursor_move(start, EFL_TEXT_CURSOR_MOVE_TYPE_PARAGRAPH_FIRST);
efl_text_cursor_move(end, EFL_TEXT_CURSOR_MOVE_TYPE_PARAGRAPH_LAST);
efl_text_cursor_move(start, EFL_TEXT_CURSOR_MOVE_TYPE_FIRST);
efl_text_cursor_move(end, EFL_TEXT_CURSOR_MOVE_TYPE_LAST);
annotations = efl_text_attribute_factory_range_attributes_get(start, end);
@ -3337,12 +3337,12 @@ _anchors_update(Eo *obj, Efl_Ui_Text_Data *sd)
sd->gen++;
start = efl_canvas_text_cursor_create(sd->text_obj);
end = efl_canvas_text_cursor_create(sd->text_obj);
start = efl_canvas_textblock_cursor_create(sd->text_obj);
end = efl_canvas_textblock_cursor_create(sd->text_obj);
/* Retrieve all annotations in the text. */
efl_text_cursor_move(start, EFL_TEXT_CURSOR_MOVE_TYPE_PARAGRAPH_FIRST);
efl_text_cursor_move(end, EFL_TEXT_CURSOR_MOVE_TYPE_PARAGRAPH_LAST);
efl_text_cursor_move(start, EFL_TEXT_CURSOR_MOVE_TYPE_FIRST);
efl_text_cursor_move(end, EFL_TEXT_CURSOR_MOVE_TYPE_LAST);
it = efl_text_attribute_factory_range_attributes_get(start, end);
efl_del(start);
@ -3645,7 +3645,7 @@ _efl_ui_text_move_cb(void *data, Evas *e EINA_UNUSED,
static void
_efl_ui_text_item_factory_set(Eo *obj EINA_UNUSED, Efl_Ui_Text_Data *pd,
Efl_Canvas_Text_Factory *item_factory)
Efl_Canvas_Textblock_Factory *item_factory)
{
if (pd->item_factory) efl_unref(pd->item_factory);
pd->item_factory = efl_ref(item_factory);

View File

@ -61,7 +61,7 @@ class @beta Efl.Ui.Text extends Efl.Ui.Layout_Base implements Efl.Input.Clickabl
"emoticon/happy" or "href=file://image.jpg" etc.
]]
values {
item_factory: Efl.Canvas.Text_Factory; [[Factory to create items]]
item_factory: Efl.Canvas.Textblock_Factory; [[Factory to create items]]
}
}
cursor_add {

View File

@ -1,8 +0,0 @@
class @beta Efl.Ui.Text_Editable extends Efl.Ui.Text
{
[[Efl UI text editable class]]
data: null;
implements {
Efl.Object.constructor;
}
}

View File

@ -15,7 +15,7 @@ struct _Efl_Ui_Text_Factory_Emoticons_Data
};
EOLIAN static Efl_Canvas_Object
*_efl_ui_text_factory_emoticons_efl_canvas_text_factory_create(
*_efl_ui_text_factory_emoticons_efl_canvas_textblock_factory_create(
Eo *obj EINA_UNUSED,
Efl_Ui_Text_Factory_Emoticons_Data *pd EINA_UNUSED,
Efl_Canvas_Object *object,

View File

@ -1,8 +1,8 @@
class @beta Efl.Ui.Text_Factory.Emoticons extends Efl.Object implements Efl.Canvas.Text_Factory
class @beta Efl.Ui.Text_Factory.Emoticons extends Efl.Object implements Efl.Canvas.Textblock_Factory
{
[[Factory that creates emoticons from the current theme given a key.
]]
implements {
Efl.Canvas.Text_Factory.create;
Efl.Canvas.Textblock_Factory.create;
}
}

View File

@ -12,7 +12,7 @@ typedef struct _Efl_Ui_Text_Factory_Fallback_Data Efl_Ui_Text_Factory_Fallback_D
struct _Efl_Ui_Text_Factory_Fallback_Data
{
Efl_Canvas_Text_Factory *emoticon_factory, *image_factory;
Efl_Canvas_Textblock_Factory *emoticon_factory, *image_factory;
};
EOLIAN static Eo *
@ -34,7 +34,7 @@ _efl_ui_text_factory_fallback_efl_object_destructor(Eo *obj,
EOLIAN static Efl_Canvas_Object
*_efl_ui_text_factory_fallback_efl_canvas_text_factory_create(
*_efl_ui_text_factory_fallback_efl_canvas_textblock_factory_create(
Eo *obj EINA_UNUSED,
Efl_Ui_Text_Factory_Fallback_Data *pd EINA_UNUSED,
Efl_Canvas_Object *object,
@ -48,11 +48,11 @@ EOLIAN static Efl_Canvas_Object
if (key && !strncmp(key, "file://", 7))
{
const char *fname = key + 7;
o = efl_canvas_text_factory_create(pd->image_factory, object, fname);
o = efl_canvas_textblock_factory_create(pd->image_factory, object, fname);
}
else
{
o = efl_canvas_text_factory_create(pd->emoticon_factory, object, key);
o = efl_canvas_textblock_factory_create(pd->emoticon_factory, object, key);
}
return o;
}

View File

@ -1,4 +1,4 @@
class @beta Efl.Ui.Text_Factory.Fallback extends Efl.Object implements Efl.Canvas.Text_Factory
class @beta Efl.Ui.Text_Factory.Fallback extends Efl.Object implements Efl.Canvas.Textblock_Factory
{
[[Internal factory for fallback cases.
@ -10,6 +10,6 @@ class @beta Efl.Ui.Text_Factory.Fallback extends Efl.Object implements Efl.Canva
implements {
Efl.Object.constructor;
Efl.Object.destructor;
Efl.Canvas.Text_Factory.create;
Efl.Canvas.Textblock_Factory.create;
}
}

View File

@ -49,7 +49,7 @@ _efl_ui_text_factory_images_efl_object_destructor(Eo *obj,
}
EOLIAN static Efl_Canvas_Object *
_efl_ui_text_factory_images_efl_canvas_text_factory_create(Eo *obj EINA_UNUSED,
_efl_ui_text_factory_images_efl_canvas_textblock_factory_create(Eo *obj EINA_UNUSED,
Efl_Ui_Text_Factory_Images_Data *pd EINA_UNUSED,
Efl_Canvas_Object *object,
const char *key)

View File

@ -1,4 +1,4 @@
class @beta Efl.Ui.Text_Factory.Images extends Efl.Object implements Efl.Canvas.Text_Factory
class @beta Efl.Ui.Text_Factory.Images extends Efl.Object implements Efl.Canvas.Textblock_Factory
{
[[Factory that creates images given key string
@ -62,6 +62,6 @@ class @beta Efl.Ui.Text_Factory.Images extends Efl.Object implements Efl.Canvas.
implements {
Efl.Object.constructor;
Efl.Object.destructor;
Efl.Canvas.Text_Factory.create;
Efl.Canvas.Textblock_Factory.create;
}
}

View File

@ -1684,3 +1684,20 @@ EINA_DEPRECATED EAPI void elm_win_name_set(Evas_Object *obj, const char *name);
* @ingroup Elm_Textpath_Group
*/
EINA_DEPRECATED EAPI void elm_textpath_circle_set(Efl_Ui_Textpath *obj, double x, double y, double radius, double start_angle, Efl_Ui_Textpath_Direction direction);
/**
* Request that your elementary application needs elocation
*
* This initializes the elocation library when called and if
* support exists it returns @c EINA_TRUE, otherwise returns
* @c EINA_FALSE. This must be called before any elocation usage.
*
* @return @c EINA_TRUE if support exists and initialization succeeded.
*
* @since 1.8.0
*
* @deprecated removed beta API
*
* @ingroup eldbus
*/
EINA_DEPRECATED EAPI Eina_Bool elm_need_elocation(void);

View File

@ -690,30 +690,10 @@ _elm_unneed_eldbus(void)
eldbus_shutdown();
}
#ifdef ELM_ELOCATION
static Eina_Bool _elm_need_elocation = EINA_FALSE;
#endif
EAPI Eina_Bool
elm_need_elocation(void)
{
#ifdef ELM_ELOCATION
if (_elm_need_elocation) return EINA_TRUE;
_elm_need_elocation = EINA_TRUE;
elocation_init();
return EINA_TRUE;
#else
return EINA_FALSE;
#endif
}
static void
_elm_unneed_elocation(void)
{
#ifdef ELM_ELOCATION
if (!_elm_need_elocation) return;
_elm_need_elocation = EINA_FALSE;
elocation_shutdown();
#endif
}
static Eina_Bool _elm_need_efreet = EINA_FALSE;
@ -967,7 +947,6 @@ elm_quicklaunch_shutdown(void)
_elm_unneed_efreet();
_elm_unneed_e_dbus();
_elm_unneed_eldbus();
_elm_unneed_elocation();
_elm_unneed_ethumb();
_elm_unneed_web();

View File

@ -70,21 +70,6 @@ EAPI Eina_Bool elm_need_e_dbus(void) EINA_DEPRECATED;
*/
EAPI Eina_Bool elm_need_eldbus(void);
/**
* Request that your elementary application needs elocation
*
* This initializes the elocation library when called and if
* support exists it returns @c EINA_TRUE, otherwise returns
* @c EINA_FALSE. This must be called before any elocation usage.
*
* @return @c EINA_TRUE if support exists and initialization succeeded.
*
* @since 1.8.0
*
* @ingroup eldbus
*/
EAPI Eina_Bool elm_need_elocation(void);
/**
* Request that your elementary application needs ethumb
*

View File

@ -171,7 +171,6 @@
# include <elm_general.h>
# include <efl_text_interactive.eo.h>
# include <efl_ui_text.eo.h>
# include <efl_ui_text_editable.eo.h>
# include <efl_ui_text_async.eo.h>
extern const char *_efl_model_property_itemw;

View File

@ -85,7 +85,6 @@ pub_eo_files = [
'efl_ui_popup_part_backwall.eo',
'efl_ui_alert_popup.eo',
'efl_ui_alert_popup_part_title.eo',
'efl_ui_text_editable.eo',
'efl_ui_text_async.eo',
'efl_ui_text_factory_images.eo',
'efl_ui_text_factory_emoticons.eo',
@ -953,7 +952,7 @@ elementary_src = [
elementary_deps = [emile, eo, efl, edje, ethumb, ethumb_client, emotion, ecore_imf, ecore_con, eldbus, efreet, efreet_mime, efreet_trash, eio, atspi, dl, intl]
elementary_pub_deps = [eina, eet, evas, ecore, ecore_evas, ecore_file, ecore_input, ecore_imf, ecore_con,
edje, eldbus, efreet, efreet_mime, efreet_trash, ethumb_client, efl, elocation]
edje, eldbus, efreet, efreet_mime, efreet_trash, ethumb_client, efl]
elm_options = configuration_data()
@ -968,7 +967,6 @@ else
elm_options.set('DLL_EXPORT', '1')
endif
elm_options.set('ELM_ELOCATION', '1')
elm_options.set('ELM_EFREET', '1')
if config_h.has('HAVE_ALLOCA_H')

View File

@ -1,433 +0,0 @@
/**
* @file Elocation.h
* @brief Elocation Library
*
* @defgroup Location Location
*/
/**
* @page elocation_main Elocation (BETA)
*
* @section intro Elocation Use Cases
*
* Elocation is meant as a convenience library to ease application developers
* the usage of geo information in their apps. Adding a geo tag to a picture or
* translating an address to a GPS position and show it on a map widget are just
* some of the use cases.
*
* In the beginning elocation will rely on the GeoClue DBus service. Its has
* providers for various techniques to get hold off the current position.
* Ranging from GeoIP over wifi and GSM cell location to GPS. As well as
* provider to translates between location in a textual form to coordinates
* (GeoCode).
*
* Elocation covers all of these interfaces but in the end it depends on your
* system and the installed GeoClue providers what can be used.
*
* Currently it offer the following functionality:
* @li Request current address in textual form
* @li Request current position in GPS format
* @li Translate a position into and address or an address in a position
*
* You can find the API documentation at @ref Location
*/
#ifndef _ELOCATION_H
#define _ELOCATION_H
#ifdef EAPI
# undef EAPI
#endif
#ifdef _WIN32
# ifdef EFL_BUILD
# ifdef DLL_EXPORT
# define EAPI __declspec(dllexport)
# else
# define EAPI
# endif
# else
# define EAPI __declspec(dllimport)
# endif
#else
# ifdef __GNUC__
# if __GNUC__ >= 4
# define EAPI __attribute__ ((visibility("default")))
# else
# define EAPI
# endif
# else
# define EAPI
# endif
#endif
#ifdef EFL_BETA_API_SUPPORT
#include <stdio.h>
#include <Ecore.h>
#include <Eldbus.h>
#ifdef __cplusplus
extern "C" {
#endif
/**
* @ingroup Location
* @brief Available location events that are emitted from the library
* @since 1.13
*
* Ecore events emitted by the library. Applications can register ecore event
* handlers to react on such events. After the initial query this can be used
* to keep track of changes and update your UI or data accordingly.
* @{
*/
EAPI extern int ELOCATION_EVENT_STATUS; /**< Status changed */
EAPI extern int ELOCATION_EVENT_POSITION; /**< Position changed */
EAPI extern int ELOCATION_EVENT_ADDRESS; /**< Address changed */
EAPI extern int ELOCATION_EVENT_VELOCITY; /**< Velocity changed */
EAPI extern int ELOCATION_EVENT_GEOCODE; /**< Reply for geocode translation arrived */
EAPI extern int ELOCATION_EVENT_REVERSEGEOCODE; /**< Reply for geocode translation arrived */
EAPI extern int ELOCATION_EVENT_NMEA; /**< NMEA update */
EAPI extern int ELOCATION_EVENT_SATELLITE; /**< Satellite info changed */
EAPI extern int ELOCATION_EVENT_POI; /**< POI reply */
EAPI extern int ELOCATION_EVENT_META_READY; /**< Meta provider is ready to be used */
/**@}*/
/**
* @ingroup Location
* @typedef Elocation_Accuracy_Level
* @since 1.13
*
* Different location accuracy levels from country level up to detailed,
* e.g. GPS, information.
* @{
*/
typedef enum {
ELOCATION_ACCURACY_LEVEL_NONE = 0,
ELOCATION_ACCURACY_LEVEL_COUNTRY = 1,
ELOCATION_ACCURACY_LEVEL_REGION, /* GeoClue1 only */
ELOCATION_ACCURACY_LEVEL_LOCALITY, /* GeoClue1 only */
ELOCATION_ACCURACY_LEVEL_POSTALCODE, /* GeoClue1 only */
ELOCATION_ACCURACY_LEVEL_CITY = 4, /* GeoClue2 only */
ELOCATION_ACCURACY_LEVEL_NEIGHBORHOOD = 5, /* GeoClue2 only */
ELOCATION_ACCURACY_LEVEL_STREET = 6,
ELOCATION_ACCURACY_LEVEL_DETAILED, /* GeoClue1 only */
ELOCATION_ACCURACY_LEVEL_EXACT = 8, /* GeoClue2 only */
} Elocation_Accuracy_Level;
/**@}*/
/**
* @ingroup Location
* @typedef Elocation_Resource_Flags
* @since 1.13
*
* Flags for available system resources to be used for locating. So far they
* cover physical resources like network connection, cellular network
* connection and GPS.
* @{
*/
typedef enum {
ELOCATION_RESOURCE_NONE = 0,
ELOCATION_RESOURCE_NETWORK = 1 << 0, /**< Internet connection is available */
ELOCATION_RESOURCE_CELL = 1 << 1, /**< Cell network information, e.g. GSM, is available */
ELOCATION_RESOURCE_GPS = 1 << 2, /**< GPS information is available */
ELOCATION_RESOURCE_ALL = (1 << 10) - 1 /**< All resources are available */
} Elocation_Resource_Flags;
/**@}*/
/**
* @ingroup Location
* @typedef Elocation_Accuracy
* @since 1.13
*
* Information about the accuracy of the reported location. For details about
* the level of accuracy see #Elocation_Accuracy_Level. It also covers
* horizontal and vertical accuracy. The values depend on the used provider
* and may very in quality.
*/
typedef struct _Elocation_Accuracy
{
Elocation_Accuracy_Level level;
double horizontal;
double vertical;
} Elocation_Accuracy;
/**
* @ingroup Location
* @typedef Elocation_Address
* @since 1.13
*
* Location information in textual form. Depending on the used provider this
* can cover only the country or a detailed address with postcode and street.
* The level of detail varies depending on the used provider.
* A timestamp is available to calculate the age of the address data.
*/
typedef struct _Elocation_Address
{
unsigned int timestamp; /**< Timestamp of data read out in seconds since epoch */
char *country;
char *countrycode;
char *locality;
char *postalcode;
char *region;
char *timezone;
Elocation_Accuracy *accur;
} Elocation_Address;
/**
* @ingroup Location
* @typedef Elocation_Position
* @since 1.13
*
* Location information based on the GPS grid. Latitude, longitude and altitude.
* A timestamp is available to calculate the age of the address data.
*/
typedef struct _Elocation_Position
{
unsigned int timestamp; /**< Timestamp of data read out in seconds since epoch */
double latitude;
double longitude;
double altitude;
Elocation_Accuracy *accur;
} Elocation_Position;
/**
* @ingroup Location
* @typedef Elocation_Velocity
* @since 1.13
*
* Velocity information. So far this interface is only offered with GPS based
* providers. It offers information about speed, direction and climb.
* A timestamp is available to calculate the age of the address data.
*
* FIXME: check units and formats of this values coming in from GeoClue
*/
typedef struct _Elocation_Velocity
{
unsigned int timestamp; /**< Timestamp of data read out in seconds since epoch */
double speed;
double direction;
double climb;
} Elocation_Velocity;
/**
* @ingroup Location
* @typedef Elocation_Requirements
* @since 1.13
*
* Requirement settings for the location provider. Requirements can be a level
* of accuracy or allowed resources like network access or GPS. See
* #Elocation_Resource_Flags for all available resource flags.
*
* Based on this setting the best provider is chosen between the available
* providers of GeoClue.
*/
typedef struct _Elocation_Requirements
{
Elocation_Accuracy_Level accurancy_level;
int min_time; /**< Minimal time between updates. Not implemented upstream */
Eina_Bool require_update;
Elocation_Resource_Flags allowed_resources;
} Elocation_Requirements;
/**
* @brief Create a new address object to operate on.
* @return Address object.
*
* The returned address object is safe to be operated on. It can be used for
* all other elocation functions. Once finished with it it need to be destroyed
* with a call to #elocation_address_free.
*
* @ingroup Location
* @since 1.13
*/
EAPI Elocation_Address *elocation_address_new(void);
/**
* @brief Free an address object
* @param address Address object to be freed.
*
* Destroys an address object created with #elocation_address_new. Should be
* used during the cleanup of the application or whenever the address object is
* no longer needed.
*
* @ingroup Location
* @since 1.13
*/
EAPI void elocation_address_free(Elocation_Address *address);
/**
* @brief Create a new position object to operate on.
* @return Position object.
*
* The returned address object is safe to be operated on. It can be used for
* all other elocation functions. Once finished with it it need to be destroyed
* with a call to #elocation_address_free.
*
* @ingroup Location
* @since 1.13
*/
EAPI Elocation_Position *elocation_position_new(void);
/**
* @brief Free an position object
* @param position Position object to be freed.
*
* Destroys a position object created with #elocation_address_new. Should be
* used during the cleanup of the application or whenever the location object is
* no longer needed.
*
* @ingroup Location
* @since 1.13
*/
EAPI void elocation_position_free(Elocation_Position *position);
/**
* @brief Get the current address information.
* @param address Address struct to be filled with information.
* @return EINA_TRUE for success and EINA_FALSE for failure.
*
* Request the latest address. The requested to the underling components might
* be asynchronous so better check the timestamp if the data has changed. To get
* events when the address changes one can also subscribe to the
* #ELOCATION_EVENT_ADDRESS ecore event which will have the address object as
* event.
*
* @ingroup Location
* @since 1.13
*/
EAPI Eina_Bool elocation_address_get(Elocation_Address *address);
/**
* @brief Get the current position information.
* @param position Position struct to be filled with information.
* @return EINA_TRUE for success and EINA_FALSE for failure.
*
* Request the latest position. The requested to the underling components might
* be asynchronous so better check the timestamp if the data has changed. To get
* events when the position changes one can also subscribe to the
* #ELOCATION_EVENT_POSITION ecore event which will have the position object as
* event.
*
* @ingroup Location
* @since 1.13
*/
EAPI Eina_Bool elocation_position_get(Elocation_Position *position);
/**
* @brief Get the current status.
* @param status Status
* @return EINA_TRUE for success and EINA_FALSE for failure.
*
* @ingroup Location
* @since 1.13
*/
EAPI Eina_Bool elocation_status_get(int *status);
/**
* @brief Set the requirements.
* @param requirements Requirements
* @return EINA_TRUE for success and EINA_FALSE for failure.
*
* Set the requirements for selecting a provider.
*
* @ingroup Location
* @since 1.13
*/
EAPI Eina_Bool elocation_requirements_set(Elocation_Requirements *requirements);
/**
* @brief Convert position to address
* @param position_shadow Position input
* @param address_shadow Address output
* @return EINA_TRUE for success and EINA_FALSE for failure.
*
* Use a GeoCode provider to translate from a given GPS coordinate
* representation of a location to a representation in textual form.
*
* @ingroup Location
* @since 1.13
*/
EAPI Eina_Bool elocation_position_to_address(Elocation_Position *position_shadow, Elocation_Address *address_shadow);
/**
* @brief Convert address to position
* @param address_shadow Address input
* @param position_shadow Position output
* @return EINA_TRUE for success and EINA_FALSE for failure.
*
* Use a GeoCode provider to translate from a given textual form
* representation of a location to a representation as GPS coordinates.
*
* @ingroup Location
* @since 1.13
*/
EAPI Eina_Bool elocation_address_to_position(Elocation_Address *address_shadow, Elocation_Position *position_shadow);
/**
* @brief Convert free form address tring to position
* @param freeform_address Address string in free form
* @param position_shadow Position output
* @return EINA_TRUE for success and EINA_FALSE for failure.
*
* Similar GeoCode translation from textual form to GPS coordinates as
* #elocation_address_to_position but in this case the address is a simple
* string which hopefully contains enough information for the provider to
* understand and translate.
*
* Useful for an easy search interface in an application but also more error
* prone regarding correct results.
*
* @ingroup Location
* @since 1.13
*/
EAPI Eina_Bool elocation_freeform_address_to_position(const char *freeform_address, Elocation_Position *position_shadow);
/**
* @brief Request a landmark position
* @param position_shadow Position ouput
* @param address_shadow Address input
* @return EINA_TRUE for success and EINA_FALSE for failure.
*
* Request a landmark position also known as Point Of Interest (POI) from
* GeoClue.
*
* @ingroup Location
* @since 1.13
*/
EAPI Eina_Bool elocation_landmarks_get(Elocation_Position *position_shadow, Elocation_Address *address_shadow);
/**
* @brief Initialize the elocation subsystem.
* @return EINA_TRUE for success and EINA_FALSE for failure.
*
* This function must be called before using any of the Elocation functionality
* in your application to make sure it it setup correctly for usage.
*
* @ingroup Location
* @since 1.13
*/
EAPI Eina_Bool elocation_init(void);
/**
* @brief Cleanup and shutdown the elocation subsystem.
*
* This function must be called when the application is no longer using any of
* the Elocation functionality to allow the subsystem to shutdown cleanly.
*
* @ingroup Location
* @since 1.13
*/
EAPI void elocation_shutdown(void);
#ifdef __cplusplus
}
#endif
#endif /* BETA API */
#undef EAPI
#define EAPI
#endif

File diff suppressed because it is too large Load Diff

View File

@ -1,186 +0,0 @@
#ifndef _ELOCATION_PRIVATE_H
#define _ELOCATION_PRIVATE_H
#ifdef EFL_BETA_API_SUPPORT
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <stdio.h>
#include <Eina.h>
#include <Ecore.h>
#include <Eldbus.h>
#ifndef ELOCATION_COLOR_DEFAULT
#define ELOCATION_COLOR_DEFAULT EINA_COLOR_BLUE
#endif
extern int _elocation_log_dom;
#ifdef CRI
#undef CRI
#endif
#ifdef ERR
#undef ERR
#endif
#ifdef INF
#undef INF
#endif
#ifdef WARN
#undef WARN
#endif
#ifdef DBG
#undef DBG
#endif
#define CRI(...) EINA_LOG_DOM_CRIT(_elocation_log_dom, __VA_ARGS__)
#define DBG(...) EINA_LOG_DOM_DBG(_elocation_log_dom, __VA_ARGS__)
#define INF(...) EINA_LOG_DOM_INFO(_elocation_log_dom, __VA_ARGS__)
#define WARN(...) EINA_LOG_DOM_WARN(_elocation_log_dom, __VA_ARGS__)
#define ERR(...) EINA_LOG_DOM_ERR(_elocation_log_dom, __VA_ARGS__)
/* Provider bus names and object paths. Master is the generic one which should
* pick up the best one internally based on given requirements. It is also still
* possible to use providers directly */
#define GEOCLUE_DBUS_NAME "org.freedesktop.Geoclue.Master"
#define GEOCLUE_OBJECT_PATH "/org/freedesktop/Geoclue/Master"
#define GSMLOC_DBUS_NAME "org.freedesktop.Geoclue.Providers.Gsmloc"
#define GSMLOC_OBJECT_PATH "/org/freedesktop/Geoclue/Providers/Gsmloc"
#define HOSTIP_DBUS_NAME "org.freedesktop.Geoclue.Providers.Hostip"
#define HOSTIP_OBJECT_PATH "/org/freedesktop/Geoclue/Providers/Hostip"
#define SKYHOOK_DBUS_NAME "org.freedesktop.Geoclue.Providers.Skyhook"
#define SKYHOOK_OBJECT_PATH "/org/freedesktop/Geoclue/Providers/Skyhook"
#define UBUNTU_DBUS_NAME "org.freedesktop.Geoclue.Providers.UbuntuGeoIP"
#define UBUNTU_OBJECT_PATH "/org/freedesktop/Geoclue/Providers/UbuntuGeoIP"
#define GEONAMES_DBUS_NAME "org.freedesktop.Geoclue.Providers.Geonames"
#define GEONAMES_OBJECT_PATH "/org/freedesktop/Geoclue/Providers/Geonames"
#define PLAZES_DBUS_NAME "org.freedesktop.Geoclue.Providers.Plazes"
#define PLAZES_OBJECT_PATH "/org/freedesktop/Geoclue/Providers/Plazes"
#define YAHOO_DBUS_NAME "org.freedesktop.Geoclue.Providers.Yahoo"
#define YAHOO_OBJECT_PATH "/org/freedesktop/Geoclue/Providers/Yahoo"
/* Master interfaces to control geoclue */
#define GEOCLUE_MASTER_IFACE "org.freedesktop.Geoclue.Master"
#define GEOCLUE_MASTERCLIENT_IFACE "org.freedesktop.Geoclue.MasterClient"
/* Provider interfaces to access location data */
#define GEOCLUE_GEOCLUE_IFACE "org.freedesktop.Geoclue"
#define GEOCLUE_POSITION_IFACE "org.freedesktop.Geoclue.Position"
#define GEOCLUE_ADDRESS_IFACE "org.freedesktop.Geoclue.Address"
#define GEOCLUE_VELOCITY_IFACE "org.freedesktop.Geoclue.Velocity"
#define GEOCLUE_GEOCODE_IFACE "org.freedesktop.Geoclue.Geocode"
#define GEOCLUE_REVERSEGEOCODE_IFACE "org.freedesktop.Geoclue.ReverseGeocode"
/* More provider interfaces. These three are not in upstream geoclue but only
* in the Tizen version. Lets hope they get upstream at some point. Right now
* we will test at runtime if they are offered and ignore them if not */
#define GEOCLUE_NMEA_IFACE "org.freedesktop.Geoclue.Nmea"
#define GEOCLUE_SATELLITE_IFACE "org.freedesktop.Geoclue.Satellite"
#define GEOCLUE_POI_IFACE "org.freedesktop.Geoclue.Poi"
#define GEOCLUE_ADDRESS_KEY_AREA "area"
#define GEOCLUE_ADDRESS_KEY_COUNTRY "country"
#define GEOCLUE_ADDRESS_KEY_COUNTRYCODE "countrycode"
#define GEOCLUE_ADDRESS_KEY_LOCALITY "locality"
#define GEOCLUE_ADDRESS_KEY_POSTALCODE "postalcode"
#define GEOCLUE_ADDRESS_KEY_REGION "region"
#define GEOCLUE_ADDRESS_KEY_STREET "street"
extern int ELOCATION_EVENT_IN;
extern int ELOCATION_EVENT_OUT;
/* Some ENUMs that we mimic from GeoClue code as we only access it over the DBus
* interface and share no header file for such defines.
*/
/**
* @ingroup Location
* @typedef GeocluePositionFields
* @since 1.13
*
* Bitmask to indicate which of the supplied positions fields are valid.
*
* @{
*/
typedef enum {
GEOCLUE_POSITION_FIELDS_NONE = 0,
GEOCLUE_POSITION_FIELDS_LATITUDE = 1 << 0,
GEOCLUE_POSITION_FIELDS_LONGITUDE = 1 << 1,
GEOCLUE_POSITION_FIELDS_ALTITUDE = 1 << 2
} GeocluePositionFields;
/**@}*/
/**
* @ingroup Location
* @typedef GeoclueNetworkStatus
* @since 1.13
*
* Status of the network connectivity for GeoClue. Needed for all providers that
* access external data to determine the location. For example GeoIP or GeoCode
* providers.
*
* @{
*/
typedef enum {
GEOCLUE_CONNECTIVITY_UNKNOWN,
GEOCLUE_CONNECTIVITY_OFFLINE,
GEOCLUE_CONNECTIVITY_ACQUIRING,
GEOCLUE_CONNECTIVITY_ONLINE,
} GeoclueNetworkStatus;
/**@}*/
/**
* @ingroup Location
* @typedef GeoclueStatus
* @since 1.13
*
* Status of a GeoClue provider.
*
* @{
*/
typedef enum {
GEOCLUE_STATUS_ERROR,
GEOCLUE_STATUS_UNAVAILABLE,
GEOCLUE_STATUS_ACQUIRING,
GEOCLUE_STATUS_AVAILABLE
} GeoclueStatus;
/**@}*/
/**
* @ingroup Location
* @typedef GeoclueVelocityFields
* @since 1.13
*
* Bitmask to indicate which of the supplied velocity fields are valid.
*
* @{
*/
typedef enum {
GEOCLUE_VELOCITY_FIELDS_NONE = 0,
GEOCLUE_VELOCITY_FIELDS_SPEED = 1 << 0,
GEOCLUE_VELOCITY_FIELDS_DIRECTION = 1 << 1,
GEOCLUE_VELOCITY_FIELDS_CLIMB = 1 << 2
} GeoclueVelocityFields;
/**@}*/
/**
* @ingroup Location
* @typedef Elocation_Provider
* @since 1.13
*
* Data structure to hold information about a GeoClue provider.
*
*/
typedef struct _Elocation_Provider
{
char *name;
char *description;
char *service;
char *path;
GeoclueStatus status;
} Elocation_Provider;
#endif /* BETA API */
#endif

View File

@ -1,448 +0,0 @@
#ifndef EFL_BETA_API_SUPPORT
# define EFL_BETA_API_SUPPORT
#endif
#include "eldbus_geo_clue2_client.h"
static int _log_main = -1;
#undef ERR
#define ERR(...) EINA_LOG_DOM_ERR(_log_main, __VA_ARGS__);
int GEO_CLUE2_CLIENT_LOCATION_UPDATED_EVENT = 0;
static void
cb_geo_clue2_client_start(void *data, const Eldbus_Message *msg, Eldbus_Pending *pending)
{
void *user_data = eldbus_pending_data_del(pending, "__user_data");
Geo_Clue2_Client_Start_Cb cb = data;
const char *error, *error_msg;
Eldbus_Proxy *proxy = eldbus_pending_data_del(pending, "__proxy");
if (eldbus_message_error_get(msg, &error, &error_msg))
{
Eldbus_Error_Info error_info = {error, error_msg};
cb(proxy, user_data, pending, &error_info);
return;
}
if (!eldbus_message_arguments_get(msg, ""))
{
Eldbus_Error_Info error_info = {"", ""};
ERR("Error: Getting arguments from message.");
cb(proxy, user_data, pending, &error_info);
return;
}
cb(proxy, user_data, pending, NULL);
return;
}
Eldbus_Pending *
geo_clue2_client_start_call(Eldbus_Proxy *proxy, Geo_Clue2_Client_Start_Cb cb, const void *data)
{
Eldbus_Message *msg;
Eldbus_Pending *p;
EINA_SAFETY_ON_NULL_RETURN_VAL(proxy, NULL);
msg = eldbus_proxy_method_call_new(proxy, "Start");
if (!eldbus_message_arguments_append(msg, ""))
{
ERR("Error: Filling message.");
eldbus_message_unref(msg);
return NULL;
}
p = eldbus_proxy_send(proxy, msg, cb_geo_clue2_client_start, cb, -1);
if (data)
eldbus_pending_data_set(p, "__user_data", data);
eldbus_pending_data_set(p, "__proxy", proxy);
return p;
}
static void
cb_geo_clue2_client_stop(void *data, const Eldbus_Message *msg, Eldbus_Pending *pending)
{
void *user_data = eldbus_pending_data_del(pending, "__user_data");
Geo_Clue2_Client_Stop_Cb cb = data;
const char *error, *error_msg;
Eldbus_Proxy *proxy = eldbus_pending_data_del(pending, "__proxy");
if (eldbus_message_error_get(msg, &error, &error_msg))
{
Eldbus_Error_Info error_info = {error, error_msg};
cb(proxy, user_data, pending, &error_info);
return;
}
if (!eldbus_message_arguments_get(msg, ""))
{
Eldbus_Error_Info error_info = {"", ""};
ERR("Error: Getting arguments from message.");
cb(proxy, user_data, pending, &error_info);
return;
}
cb(proxy, user_data, pending, NULL);
return;
}
Eldbus_Pending *
geo_clue2_client_stop_call(Eldbus_Proxy *proxy, Geo_Clue2_Client_Stop_Cb cb, const void *data)
{
Eldbus_Message *msg;
Eldbus_Pending *p;
EINA_SAFETY_ON_NULL_RETURN_VAL(proxy, NULL);
msg = eldbus_proxy_method_call_new(proxy, "Stop");
if (!eldbus_message_arguments_append(msg, ""))
{
ERR("Error: Filling message.");
eldbus_message_unref(msg);
return NULL;
}
p = eldbus_proxy_send(proxy, msg, cb_geo_clue2_client_stop, cb, -1);
if (data)
eldbus_pending_data_set(p, "__user_data", data);
eldbus_pending_data_set(p, "__proxy", proxy);
return p;
}
static void
geo_clue2_client_location_updated_data_free(void *user_data EINA_UNUSED, void *func_data)
{
Geo_Clue2_Client_LocationUpdated_Data *s_data = func_data;
free(s_data->old);
free(s_data->new);
free(s_data);
}
static void
on_geo_clue2_client_location_updated(void *data, const Eldbus_Message *msg)
{
Eldbus_Proxy *proxy = data;
Geo_Clue2_Client_LocationUpdated_Data *s_data = calloc(1, sizeof(Geo_Clue2_Client_LocationUpdated_Data));
s_data->proxy = proxy;
if (!eldbus_message_arguments_get(msg, "oo", &s_data->old, &s_data->new))
{
ERR("Error: Getting arguments from message.");
free(s_data);
return;
}
s_data->old = strdup(s_data->old);
s_data->new = strdup(s_data->new);
ecore_event_add(GEO_CLUE2_CLIENT_LOCATION_UPDATED_EVENT, s_data, geo_clue2_client_location_updated_data_free, NULL);
}
static void
cb_geo_clue2_client_location(void *data, const Eldbus_Message *msg, Eldbus_Pending *pending)
{
void *user_data = eldbus_pending_data_del(pending, "__user_data");
const char *error, *error_msg;
Eldbus_Codegen_Property_String_Get_Cb cb = data;
Eldbus_Proxy *proxy = eldbus_pending_data_del(pending, "__proxy");
Eldbus_Message_Iter *variant;
const char *v;
if (eldbus_message_error_get(msg, &error, &error_msg))
{
Eldbus_Error_Info error_info = {error, error_msg};
cb(user_data, pending, "Location", proxy, &error_info, NULL);
return;
}
if (!eldbus_message_arguments_get(msg, "v", &variant))
{
Eldbus_Error_Info error_info = {"", ""};
cb(user_data, pending, "Location", proxy, &error_info, NULL);
return;
}
if (!eldbus_message_iter_arguments_get(variant, "o", &v))
{
Eldbus_Error_Info error_info = {"", ""};
cb(user_data, pending, "Location", proxy, &error_info, NULL);
return;
}
cb(user_data, pending, "Location", proxy, NULL, v);
}
Eldbus_Pending *
geo_clue2_client_location_propget(Eldbus_Proxy *proxy, Eldbus_Codegen_Property_String_Get_Cb cb, const void *data)
{
Eldbus_Pending *p;
EINA_SAFETY_ON_NULL_RETURN_VAL(proxy, NULL);
p = eldbus_proxy_property_get(proxy, "Location", cb_geo_clue2_client_location, cb);
if (data)
eldbus_pending_data_set(p, "__user_data", data);
eldbus_pending_data_set(p, "__proxy", proxy);
return p;
}
static void
cb_geo_clue2_client_distance_threshold(void *data, const Eldbus_Message *msg, Eldbus_Pending *pending)
{
void *user_data = eldbus_pending_data_del(pending, "__user_data");
const char *error, *error_msg;
Eldbus_Codegen_Property_Uint32_Get_Cb cb = data;
Eldbus_Proxy *proxy = eldbus_pending_data_del(pending, "__proxy");
Eldbus_Message_Iter *variant;
unsigned int v;
if (eldbus_message_error_get(msg, &error, &error_msg))
{
Eldbus_Error_Info error_info = {error, error_msg};
cb(user_data, pending, "DistanceThreshold", proxy, &error_info, 0);
return;
}
if (!eldbus_message_arguments_get(msg, "v", &variant))
{
Eldbus_Error_Info error_info = {"", ""};
cb(user_data, pending, "DistanceThreshold", proxy, &error_info, 0);
return;
}
if (!eldbus_message_iter_arguments_get(variant, "u", &v))
{
Eldbus_Error_Info error_info = {"", ""};
cb(user_data, pending, "DistanceThreshold", proxy, &error_info, 0);
return;
}
cb(user_data, pending, "DistanceThreshold", proxy, NULL, v);
}
Eldbus_Pending *
geo_clue2_client_distance_threshold_propget(Eldbus_Proxy *proxy, Eldbus_Codegen_Property_Uint32_Get_Cb cb, const void *data)
{
Eldbus_Pending *p;
EINA_SAFETY_ON_NULL_RETURN_VAL(proxy, NULL);
p = eldbus_proxy_property_get(proxy, "DistanceThreshold", cb_geo_clue2_client_distance_threshold, cb);
if (data)
eldbus_pending_data_set(p, "__user_data", data);
eldbus_pending_data_set(p, "__proxy", proxy);
return p;
}
static void
cb_geo_clue2_client_distance_threshold_set(void *data, const Eldbus_Message *msg, Eldbus_Pending *pending)
{
const char *error, *error_msg;
void *user_data = eldbus_pending_data_del(pending, "__user_data");
Eldbus_Proxy *proxy = eldbus_pending_data_del(pending, "__proxy");
Eldbus_Codegen_Property_Set_Cb cb = data;
if (eldbus_message_error_get(msg, &error, &error_msg)) {
Eldbus_Error_Info error_info = {error, error_msg};
cb(user_data, "DistanceThreshold", proxy, pending, &error_info);
return;
}
cb(user_data, "DistanceThreshold", proxy, pending, NULL);
}
Eldbus_Pending *
geo_clue2_client_distance_threshold_propset(Eldbus_Proxy *proxy, Eldbus_Codegen_Property_Set_Cb cb, const void *data, const void *value)
{
Eldbus_Pending *p;
EINA_SAFETY_ON_NULL_RETURN_VAL(proxy, NULL);
EINA_SAFETY_ON_NULL_RETURN_VAL(value, NULL);
p = eldbus_proxy_property_set(proxy, "DistanceThreshold", "u", value, cb_geo_clue2_client_distance_threshold_set, cb);
eldbus_pending_data_set(p, "__user_data", data);
eldbus_pending_data_set(p, "__proxy", proxy);
return p;
}
static void
cb_geo_clue2_client_desktop_id(void *data, const Eldbus_Message *msg, Eldbus_Pending *pending)
{
void *user_data = eldbus_pending_data_del(pending, "__user_data");
const char *error, *error_msg;
Eldbus_Codegen_Property_String_Get_Cb cb = data;
Eldbus_Proxy *proxy = eldbus_pending_data_del(pending, "__proxy");
Eldbus_Message_Iter *variant;
const char *v;
if (eldbus_message_error_get(msg, &error, &error_msg))
{
Eldbus_Error_Info error_info = {error, error_msg};
cb(user_data, pending, "DesktopId", proxy, &error_info, NULL);
return;
}
if (!eldbus_message_arguments_get(msg, "v", &variant))
{
Eldbus_Error_Info error_info = {"", ""};
cb(user_data, pending, "DesktopId", proxy, &error_info, NULL);
return;
}
if (!eldbus_message_iter_arguments_get(variant, "s", &v))
{
Eldbus_Error_Info error_info = {"", ""};
cb(user_data, pending, "DesktopId", proxy, &error_info, NULL);
return;
}
cb(user_data, pending, "DesktopId", proxy, NULL, v);
}
Eldbus_Pending *
geo_clue2_client_desktop_id_propget(Eldbus_Proxy *proxy, Eldbus_Codegen_Property_String_Get_Cb cb, const void *data)
{
Eldbus_Pending *p;
EINA_SAFETY_ON_NULL_RETURN_VAL(proxy, NULL);
p = eldbus_proxy_property_get(proxy, "DesktopId", cb_geo_clue2_client_desktop_id, cb);
if (data)
eldbus_pending_data_set(p, "__user_data", data);
eldbus_pending_data_set(p, "__proxy", proxy);
return p;
}
static void
cb_geo_clue2_client_desktop_id_set(void *data, const Eldbus_Message *msg, Eldbus_Pending *pending)
{
const char *error, *error_msg;
void *user_data = eldbus_pending_data_del(pending, "__user_data");
Eldbus_Proxy *proxy = eldbus_pending_data_del(pending, "__proxy");
Eldbus_Codegen_Property_Set_Cb cb = data;
if (eldbus_message_error_get(msg, &error, &error_msg)) {
Eldbus_Error_Info error_info = {error, error_msg};
cb(user_data, "DesktopId", proxy, pending, &error_info);
return;
}
cb(user_data, "DesktopId", proxy, pending, NULL);
}
Eldbus_Pending *
geo_clue2_client_desktop_id_propset(Eldbus_Proxy *proxy, Eldbus_Codegen_Property_Set_Cb cb, const void *data, const void *value)
{
Eldbus_Pending *p;
EINA_SAFETY_ON_NULL_RETURN_VAL(proxy, NULL);
EINA_SAFETY_ON_NULL_RETURN_VAL(value, NULL);
p = eldbus_proxy_property_set(proxy, "DesktopId", "s", value, cb_geo_clue2_client_desktop_id_set, cb);
eldbus_pending_data_set(p, "__user_data", data);
eldbus_pending_data_set(p, "__proxy", proxy);
return p;
}
static void
cb_geo_clue2_client_requested_accuracy_level(void *data, const Eldbus_Message *msg, Eldbus_Pending *pending)
{
void *user_data = eldbus_pending_data_del(pending, "__user_data");
const char *error, *error_msg;
Eldbus_Codegen_Property_Uint32_Get_Cb cb = data;
Eldbus_Proxy *proxy = eldbus_pending_data_del(pending, "__proxy");
Eldbus_Message_Iter *variant;
unsigned int v;
if (eldbus_message_error_get(msg, &error, &error_msg))
{
Eldbus_Error_Info error_info = {error, error_msg};
cb(user_data, pending, "RequestedAccuracyLevel", proxy, &error_info, 0);
return;
}
if (!eldbus_message_arguments_get(msg, "v", &variant))
{
Eldbus_Error_Info error_info = {"", ""};
cb(user_data, pending, "RequestedAccuracyLevel", proxy, &error_info, 0);
return;
}
if (!eldbus_message_iter_arguments_get(variant, "u", &v))
{
Eldbus_Error_Info error_info = {"", ""};
cb(user_data, pending, "RequestedAccuracyLevel", proxy, &error_info, 0);
return;
}
cb(user_data, pending, "RequestedAccuracyLevel", proxy, NULL, v);
}
Eldbus_Pending *
geo_clue2_client_requested_accuracy_level_propget(Eldbus_Proxy *proxy, Eldbus_Codegen_Property_Uint32_Get_Cb cb, const void *data)
{
Eldbus_Pending *p;
EINA_SAFETY_ON_NULL_RETURN_VAL(proxy, NULL);
p = eldbus_proxy_property_get(proxy, "RequestedAccuracyLevel", cb_geo_clue2_client_requested_accuracy_level, cb);
if (data)
eldbus_pending_data_set(p, "__user_data", data);
eldbus_pending_data_set(p, "__proxy", proxy);
return p;
}
static void
cb_geo_clue2_client_requested_accuracy_level_set(void *data, const Eldbus_Message *msg, Eldbus_Pending *pending)
{
const char *error, *error_msg;
void *user_data = eldbus_pending_data_del(pending, "__user_data");
Eldbus_Proxy *proxy = eldbus_pending_data_del(pending, "__proxy");
Eldbus_Codegen_Property_Set_Cb cb = data;
if (eldbus_message_error_get(msg, &error, &error_msg)) {
Eldbus_Error_Info error_info = {error, error_msg};
cb(user_data, "RequestedAccuracyLevel", proxy, pending, &error_info);
return;
}
cb(user_data, "RequestedAccuracyLevel", proxy, pending, NULL);
}
Eldbus_Pending *
geo_clue2_client_requested_accuracy_level_propset(Eldbus_Proxy *proxy, Eldbus_Codegen_Property_Set_Cb cb, const void *data, const void *value)
{
Eldbus_Pending *p;
EINA_SAFETY_ON_NULL_RETURN_VAL(proxy, NULL);
EINA_SAFETY_ON_NULL_RETURN_VAL(value, NULL);
p = eldbus_proxy_property_set(proxy, "RequestedAccuracyLevel", "u", value, cb_geo_clue2_client_requested_accuracy_level_set, cb);
eldbus_pending_data_set(p, "__user_data", data);
eldbus_pending_data_set(p, "__proxy", proxy);
return p;
}
static void
cb_geo_clue2_client_active(void *data, const Eldbus_Message *msg, Eldbus_Pending *pending)
{
void *user_data = eldbus_pending_data_del(pending, "__user_data");
const char *error, *error_msg;
Eldbus_Codegen_Property_Bool_Get_Cb cb = data;
Eldbus_Proxy *proxy = eldbus_pending_data_del(pending, "__proxy");
Eldbus_Message_Iter *variant;
Eina_Bool v;
if (eldbus_message_error_get(msg, &error, &error_msg))
{
Eldbus_Error_Info error_info = {error, error_msg};
cb(user_data, pending, "Active", proxy, &error_info, 0);
return;
}
if (!eldbus_message_arguments_get(msg, "v", &variant))
{
Eldbus_Error_Info error_info = {"", ""};
cb(user_data, pending, "Active", proxy, &error_info, 0);
return;
}
if (!eldbus_message_iter_arguments_get(variant, "b", &v))
{
Eldbus_Error_Info error_info = {"", ""};
cb(user_data, pending, "Active", proxy, &error_info, 0);
return;
}
cb(user_data, pending, "Active", proxy, NULL, v);
}
Eldbus_Pending *
geo_clue2_client_active_propget(Eldbus_Proxy *proxy, Eldbus_Codegen_Property_Bool_Get_Cb cb, const void *data)
{
Eldbus_Pending *p;
EINA_SAFETY_ON_NULL_RETURN_VAL(proxy, NULL);
p = eldbus_proxy_property_get(proxy, "Active", cb_geo_clue2_client_active, cb);
if (data)
eldbus_pending_data_set(p, "__user_data", data);
eldbus_pending_data_set(p, "__proxy", proxy);
return p;
}
void
geo_clue2_client_log_domain_set(int id)
{
_log_main = id;
}
void
geo_clue2_client_proxy_unref(Eldbus_Proxy *proxy)
{
Eldbus_Object *obj = eldbus_proxy_object_get(proxy);
eldbus_proxy_unref(proxy);
eldbus_object_unref(obj);
}
Eldbus_Proxy *
geo_clue2_client_proxy_get(Eldbus_Connection *conn, const char *bus, const char *path)
{
Eldbus_Object *obj;
Eldbus_Proxy *proxy;
EINA_SAFETY_ON_NULL_RETURN_VAL(conn, NULL);
EINA_SAFETY_ON_NULL_RETURN_VAL(bus, NULL);
if (!path) path = "/";
obj = eldbus_object_get(conn, bus, path);
proxy = eldbus_proxy_get(obj, "org.freedesktop.GeoClue2.Client");
eldbus_proxy_signal_handler_add(proxy, "LocationUpdated", on_geo_clue2_client_location_updated, proxy);
if (!GEO_CLUE2_CLIENT_LOCATION_UPDATED_EVENT)
GEO_CLUE2_CLIENT_LOCATION_UPDATED_EVENT = ecore_event_type_new();
return proxy;
}

View File

@ -1,36 +0,0 @@
#ifndef ELDBUS_GEO_CLUE2_CLIENT_H
#define ELDBUS_GEO_CLUE2_CLIENT_H
#ifdef EFL_BETA_API_SUPPORT
#include <Eina.h>
#include <Ecore.h>
#include <Eldbus.h>
#include "eldbus_utils.h"
Eldbus_Proxy *geo_clue2_client_proxy_get(Eldbus_Connection *conn, const char *bus, const char *path);
void geo_clue2_client_proxy_unref(Eldbus_Proxy *proxy);
void geo_clue2_client_log_domain_set(int id);
typedef void (*Geo_Clue2_Client_Start_Cb)(Eldbus_Proxy *proxy, void *data, Eldbus_Pending *pending, Eldbus_Error_Info *error);
Eldbus_Pending *geo_clue2_client_start_call(Eldbus_Proxy *proxy, Geo_Clue2_Client_Start_Cb cb, const void *data);
typedef void (*Geo_Clue2_Client_Stop_Cb)(Eldbus_Proxy *proxy, void *data, Eldbus_Pending *pending, Eldbus_Error_Info *error);
Eldbus_Pending *geo_clue2_client_stop_call(Eldbus_Proxy *proxy, Geo_Clue2_Client_Stop_Cb cb, const void *data);
extern int GEO_CLUE2_CLIENT_LOCATION_UPDATED_EVENT;
typedef struct _Geo_Clue2_Client_LocationUpdated_Data
{
Eldbus_Proxy *proxy;
char *old;
char *new;
} Geo_Clue2_Client_LocationUpdated_Data;
Eldbus_Pending *geo_clue2_client_location_propget(Eldbus_Proxy *proxy, Eldbus_Codegen_Property_String_Get_Cb cb, const void *data);
Eldbus_Pending *geo_clue2_client_distance_threshold_propget(Eldbus_Proxy *proxy, Eldbus_Codegen_Property_Uint32_Get_Cb cb, const void *data);
Eldbus_Pending *geo_clue2_client_distance_threshold_propset(Eldbus_Proxy *proxy, Eldbus_Codegen_Property_Set_Cb cb, const void *data, const void *value);
Eldbus_Pending *geo_clue2_client_desktop_id_propget(Eldbus_Proxy *proxy, Eldbus_Codegen_Property_String_Get_Cb cb, const void *data);
Eldbus_Pending *geo_clue2_client_desktop_id_propset(Eldbus_Proxy *proxy, Eldbus_Codegen_Property_Set_Cb cb, const void *data, const void *value);
Eldbus_Pending *geo_clue2_client_requested_accuracy_level_propget(Eldbus_Proxy *proxy, Eldbus_Codegen_Property_Uint32_Get_Cb cb, const void *data);
Eldbus_Pending *geo_clue2_client_requested_accuracy_level_propset(Eldbus_Proxy *proxy, Eldbus_Codegen_Property_Set_Cb cb, const void *data, const void *value);
Eldbus_Pending *geo_clue2_client_active_propget(Eldbus_Proxy *proxy, Eldbus_Codegen_Property_Bool_Get_Cb cb, const void *data);
#endif /* BETA API */
#endif

View File

@ -1,246 +0,0 @@
#ifndef EFL_BETA_API_SUPPORT
# define EFL_BETA_API_SUPPORT
#endif
#include "eldbus_geo_clue2_location.h"
static int _log_main = -1;
#undef ERR
#define ERR(...) EINA_LOG_DOM_ERR(_log_main, __VA_ARGS__);
static void
cb_geo_clue2_location_latitude(void *data, const Eldbus_Message *msg, Eldbus_Pending *pending)
{
void *user_data = eldbus_pending_data_del(pending, "__user_data");
const char *error, *error_msg;
Eldbus_Codegen_Property_Double_Get_Cb cb = data;
Eldbus_Proxy *proxy = eldbus_pending_data_del(pending, "__proxy");
Eldbus_Message_Iter *variant;
double v;
if (eldbus_message_error_get(msg, &error, &error_msg))
{
Eldbus_Error_Info error_info = {error, error_msg};
cb(user_data, pending, "Latitude", proxy, &error_info, 0);
return;
}
if (!eldbus_message_arguments_get(msg, "v", &variant))
{
Eldbus_Error_Info error_info = {"", ""};
cb(user_data, pending, "Latitude", proxy, &error_info, 0);
return;
}
if (!eldbus_message_iter_arguments_get(variant, "d", &v))
{
Eldbus_Error_Info error_info = {"", ""};
cb(user_data, pending, "Latitude", proxy, &error_info, 0);
return;
}
cb(user_data, pending, "Latitude", proxy, NULL, v);
}
Eldbus_Pending *
geo_clue2_location_latitude_propget(Eldbus_Proxy *proxy, Eldbus_Codegen_Property_Double_Get_Cb cb, const void *data)
{
Eldbus_Pending *p;
EINA_SAFETY_ON_NULL_RETURN_VAL(proxy, NULL);
p = eldbus_proxy_property_get(proxy, "Latitude", cb_geo_clue2_location_latitude, cb);
if (data)
eldbus_pending_data_set(p, "__user_data", data);
eldbus_pending_data_set(p, "__proxy", proxy);
return p;
}
static void
cb_geo_clue2_location_longitude(void *data, const Eldbus_Message *msg, Eldbus_Pending *pending)
{
void *user_data = eldbus_pending_data_del(pending, "__user_data");
const char *error, *error_msg;
Eldbus_Codegen_Property_Double_Get_Cb cb = data;
Eldbus_Proxy *proxy = eldbus_pending_data_del(pending, "__proxy");
Eldbus_Message_Iter *variant;
double v;
if (eldbus_message_error_get(msg, &error, &error_msg))
{
Eldbus_Error_Info error_info = {error, error_msg};
cb(user_data, pending, "Longitude", proxy, &error_info, 0);
return;
}
if (!eldbus_message_arguments_get(msg, "v", &variant))
{
Eldbus_Error_Info error_info = {"", ""};
cb(user_data, pending, "Longitude", proxy, &error_info, 0);
return;
}
if (!eldbus_message_iter_arguments_get(variant, "d", &v))
{
Eldbus_Error_Info error_info = {"", ""};
cb(user_data, pending, "Longitude", proxy, &error_info, 0);
return;
}
cb(user_data, pending, "Longitude", proxy, NULL, v);
}
Eldbus_Pending *
geo_clue2_location_longitude_propget(Eldbus_Proxy *proxy, Eldbus_Codegen_Property_Double_Get_Cb cb, const void *data)
{
Eldbus_Pending *p;
EINA_SAFETY_ON_NULL_RETURN_VAL(proxy, NULL);
p = eldbus_proxy_property_get(proxy, "Longitude", cb_geo_clue2_location_longitude, cb);
if (data)
eldbus_pending_data_set(p, "__user_data", data);
eldbus_pending_data_set(p, "__proxy", proxy);
return p;
}
static void
cb_geo_clue2_location_accuracy(void *data, const Eldbus_Message *msg, Eldbus_Pending *pending)
{
void *user_data = eldbus_pending_data_del(pending, "__user_data");
const char *error, *error_msg;
Eldbus_Codegen_Property_Double_Get_Cb cb = data;
Eldbus_Proxy *proxy = eldbus_pending_data_del(pending, "__proxy");
Eldbus_Message_Iter *variant;
double v;
if (eldbus_message_error_get(msg, &error, &error_msg))
{
Eldbus_Error_Info error_info = {error, error_msg};
cb(user_data, pending, "Accuracy", proxy, &error_info, 0);
return;
}
if (!eldbus_message_arguments_get(msg, "v", &variant))
{
Eldbus_Error_Info error_info = {"", ""};
cb(user_data, pending, "Accuracy", proxy, &error_info, 0);
return;
}
if (!eldbus_message_iter_arguments_get(variant, "d", &v))
{
Eldbus_Error_Info error_info = {"", ""};
cb(user_data, pending, "Accuracy", proxy, &error_info, 0);
return;
}
cb(user_data, pending, "Accuracy", proxy, NULL, v);
}
Eldbus_Pending *
geo_clue2_location_accuracy_propget(Eldbus_Proxy *proxy, Eldbus_Codegen_Property_Double_Get_Cb cb, const void *data)
{
Eldbus_Pending *p;
EINA_SAFETY_ON_NULL_RETURN_VAL(proxy, NULL);
p = eldbus_proxy_property_get(proxy, "Accuracy", cb_geo_clue2_location_accuracy, cb);
if (data)
eldbus_pending_data_set(p, "__user_data", data);
eldbus_pending_data_set(p, "__proxy", proxy);
return p;
}
static void
cb_geo_clue2_location_altitude(void *data, const Eldbus_Message *msg, Eldbus_Pending *pending)
{
void *user_data = eldbus_pending_data_del(pending, "__user_data");
const char *error, *error_msg;
Eldbus_Codegen_Property_Double_Get_Cb cb = data;
Eldbus_Proxy *proxy = eldbus_pending_data_del(pending, "__proxy");
Eldbus_Message_Iter *variant;
double v;
if (eldbus_message_error_get(msg, &error, &error_msg))
{
Eldbus_Error_Info error_info = {error, error_msg};
cb(user_data, pending, "Altitude", proxy, &error_info, 0);
return;
}
if (!eldbus_message_arguments_get(msg, "v", &variant))
{
Eldbus_Error_Info error_info = {"", ""};
cb(user_data, pending, "Altitude", proxy, &error_info, 0);
return;
}
if (!eldbus_message_iter_arguments_get(variant, "d", &v))
{
Eldbus_Error_Info error_info = {"", ""};
cb(user_data, pending, "Altitude", proxy, &error_info, 0);
return;
}
cb(user_data, pending, "Altitude", proxy, NULL, v);
}
Eldbus_Pending *
geo_clue2_location_altitude_propget(Eldbus_Proxy *proxy, Eldbus_Codegen_Property_Double_Get_Cb cb, const void *data)
{
Eldbus_Pending *p;
EINA_SAFETY_ON_NULL_RETURN_VAL(proxy, NULL);
p = eldbus_proxy_property_get(proxy, "Altitude", cb_geo_clue2_location_altitude, cb);
if (data)
eldbus_pending_data_set(p, "__user_data", data);
eldbus_pending_data_set(p, "__proxy", proxy);
return p;
}
static void
cb_geo_clue2_location_description(void *data, const Eldbus_Message *msg, Eldbus_Pending *pending)
{
void *user_data = eldbus_pending_data_del(pending, "__user_data");
const char *error, *error_msg;
Eldbus_Codegen_Property_String_Get_Cb cb = data;
Eldbus_Proxy *proxy = eldbus_pending_data_del(pending, "__proxy");
Eldbus_Message_Iter *variant;
const char *v;
if (eldbus_message_error_get(msg, &error, &error_msg))
{
Eldbus_Error_Info error_info = {error, error_msg};
cb(user_data, pending, "Description", proxy, &error_info, NULL);
return;
}
if (!eldbus_message_arguments_get(msg, "v", &variant))
{
Eldbus_Error_Info error_info = {"", ""};
cb(user_data, pending, "Description", proxy, &error_info, NULL);
return;
}
if (!eldbus_message_iter_arguments_get(variant, "s", &v))
{
Eldbus_Error_Info error_info = {"", ""};
cb(user_data, pending, "Description", proxy, &error_info, NULL);
return;
}
cb(user_data, pending, "Description", proxy, NULL, v);
}
Eldbus_Pending *
geo_clue2_location_description_propget(Eldbus_Proxy *proxy, Eldbus_Codegen_Property_String_Get_Cb cb, const void *data)
{
Eldbus_Pending *p;
EINA_SAFETY_ON_NULL_RETURN_VAL(proxy, NULL);
p = eldbus_proxy_property_get(proxy, "Description", cb_geo_clue2_location_description, cb);
if (data)
eldbus_pending_data_set(p, "__user_data", data);
eldbus_pending_data_set(p, "__proxy", proxy);
return p;
}
void
geo_clue2_location_log_domain_set(int id)
{
_log_main = id;
}
void
geo_clue2_location_proxy_unref(Eldbus_Proxy *proxy)
{
Eldbus_Object *obj = eldbus_proxy_object_get(proxy);
eldbus_proxy_unref(proxy);
eldbus_object_unref(obj);
}
Eldbus_Proxy *
geo_clue2_location_proxy_get(Eldbus_Connection *conn, const char *bus, const char *path)
{
Eldbus_Object *obj;
Eldbus_Proxy *proxy;
EINA_SAFETY_ON_NULL_RETURN_VAL(conn, NULL);
EINA_SAFETY_ON_NULL_RETURN_VAL(bus, NULL);
if (!path) path = "/";
obj = eldbus_object_get(conn, bus, path);
proxy = eldbus_proxy_get(obj, "org.freedesktop.GeoClue2.Location");
return proxy;
}

View File

@ -1,22 +0,0 @@
#ifndef ELDBUS_GEO_CLUE2_LOCATION_H
#define ELDBUS_GEO_CLUE2_LOCATION_H
#ifdef EFL_BETA_API_SUPPORT
#include <Eina.h>
#include <Ecore.h>
#include <Eldbus.h>
#include "eldbus_utils.h"
Eldbus_Proxy *geo_clue2_location_proxy_get(Eldbus_Connection *conn, const char *bus, const char *path);
void geo_clue2_location_proxy_unref(Eldbus_Proxy *proxy);
void geo_clue2_location_log_domain_set(int id);
Eldbus_Pending *geo_clue2_location_latitude_propget(Eldbus_Proxy *proxy, Eldbus_Codegen_Property_Double_Get_Cb cb, const void *data);
Eldbus_Pending *geo_clue2_location_longitude_propget(Eldbus_Proxy *proxy, Eldbus_Codegen_Property_Double_Get_Cb cb, const void *data);
Eldbus_Pending *geo_clue2_location_accuracy_propget(Eldbus_Proxy *proxy, Eldbus_Codegen_Property_Double_Get_Cb cb, const void *data);
Eldbus_Pending *geo_clue2_location_altitude_propget(Eldbus_Proxy *proxy, Eldbus_Codegen_Property_Double_Get_Cb cb, const void *data);
Eldbus_Pending *geo_clue2_location_description_propget(Eldbus_Proxy *proxy, Eldbus_Codegen_Property_String_Get_Cb cb, const void *data);
#endif /* BETA API */
#endif

View File

@ -1,209 +0,0 @@
#ifndef EFL_BETA_API_SUPPORT
# define EFL_BETA_API_SUPPORT
#endif
#include "eldbus_geo_clue2_manager.h"
static int _log_main = -1;
#undef ERR
#define ERR(...) EINA_LOG_DOM_ERR(_log_main, __VA_ARGS__);
static void
cb_geo_clue2_manager_get_client(void *data, const Eldbus_Message *msg, Eldbus_Pending *pending)
{
void *user_data = eldbus_pending_data_del(pending, "__user_data");
Geo_Clue2_Manager_Get_Client_Cb cb = data;
const char *error, *error_msg;
Eldbus_Proxy *proxy = eldbus_pending_data_del(pending, "__proxy");
const char *client = NULL;
if (eldbus_message_error_get(msg, &error, &error_msg))
{
Eldbus_Error_Info error_info = {error, error_msg};
cb(proxy, user_data, pending, &error_info, client);
return;
}
if (!eldbus_message_arguments_get(msg, "o", &client))
{
Eldbus_Error_Info error_info = {"", ""};
ERR("Error: Getting arguments from message.");
cb(proxy, user_data, pending, &error_info, client);
return;
}
cb(proxy, user_data, pending, NULL, client);
return;
}
Eldbus_Pending *
geo_clue2_manager_get_client_call(Eldbus_Proxy *proxy, Geo_Clue2_Manager_Get_Client_Cb cb, const void *data)
{
Eldbus_Message *msg;
Eldbus_Pending *p;
EINA_SAFETY_ON_NULL_RETURN_VAL(proxy, NULL);
msg = eldbus_proxy_method_call_new(proxy, "GetClient");
if (!eldbus_message_arguments_append(msg, ""))
{
ERR("Error: Filling message.");
eldbus_message_unref(msg);
return NULL;
}
p = eldbus_proxy_send(proxy, msg, cb_geo_clue2_manager_get_client, cb, -1);
if (data)
eldbus_pending_data_set(p, "__user_data", data);
eldbus_pending_data_set(p, "__proxy", proxy);
return p;
}
static void
cb_geo_clue2_manager_add_agent(void *data, const Eldbus_Message *msg, Eldbus_Pending *pending)
{
void *user_data = eldbus_pending_data_del(pending, "__user_data");
Geo_Clue2_Manager_Add_Agent_Cb cb = data;
const char *error, *error_msg;
Eldbus_Proxy *proxy = eldbus_pending_data_del(pending, "__proxy");
if (eldbus_message_error_get(msg, &error, &error_msg))
{
Eldbus_Error_Info error_info = {error, error_msg};
cb(proxy, user_data, pending, &error_info);
return;
}
if (!eldbus_message_arguments_get(msg, ""))
{
Eldbus_Error_Info error_info = {"", ""};
ERR("Error: Getting arguments from message.");
cb(proxy, user_data, pending, &error_info);
return;
}
cb(proxy, user_data, pending, NULL);
return;
}
Eldbus_Pending *
geo_clue2_manager_add_agent_call(Eldbus_Proxy *proxy, Geo_Clue2_Manager_Add_Agent_Cb cb, const void *data, const char *id)
{
Eldbus_Message *msg;
Eldbus_Pending *p;
EINA_SAFETY_ON_NULL_RETURN_VAL(proxy, NULL);
msg = eldbus_proxy_method_call_new(proxy, "AddAgent");
if (!eldbus_message_arguments_append(msg, "s", id))
{
ERR("Error: Filling message.");
eldbus_message_unref(msg);
return NULL;
}
p = eldbus_proxy_send(proxy, msg, cb_geo_clue2_manager_add_agent, cb, -1);
if (data)
eldbus_pending_data_set(p, "__user_data", data);
eldbus_pending_data_set(p, "__proxy", proxy);
return p;
}
static void
cb_geo_clue2_manager_in_use(void *data, const Eldbus_Message *msg, Eldbus_Pending *pending)
{
void *user_data = eldbus_pending_data_del(pending, "__user_data");
const char *error, *error_msg;
Eldbus_Codegen_Property_Bool_Get_Cb cb = data;
Eldbus_Proxy *proxy = eldbus_pending_data_del(pending, "__proxy");
Eldbus_Message_Iter *variant;
Eina_Bool v;
if (eldbus_message_error_get(msg, &error, &error_msg))
{
Eldbus_Error_Info error_info = {error, error_msg};
cb(user_data, pending, "InUse", proxy, &error_info, 0);
return;
}
if (!eldbus_message_arguments_get(msg, "v", &variant))
{
Eldbus_Error_Info error_info = {"", ""};
cb(user_data, pending, "InUse", proxy, &error_info, 0);
return;
}
if (!eldbus_message_iter_arguments_get(variant, "b", &v))
{
Eldbus_Error_Info error_info = {"", ""};
cb(user_data, pending, "InUse", proxy, &error_info, 0);
return;
}
cb(user_data, pending, "InUse", proxy, NULL, v);
}
Eldbus_Pending *
geo_clue2_manager_in_use_propget(Eldbus_Proxy *proxy, Eldbus_Codegen_Property_Bool_Get_Cb cb, const void *data)
{
Eldbus_Pending *p;
EINA_SAFETY_ON_NULL_RETURN_VAL(proxy, NULL);
p = eldbus_proxy_property_get(proxy, "InUse", cb_geo_clue2_manager_in_use, cb);
if (data)
eldbus_pending_data_set(p, "__user_data", data);
eldbus_pending_data_set(p, "__proxy", proxy);
return p;
}
static void
cb_geo_clue2_manager_available_accuracy_level(void *data, const Eldbus_Message *msg, Eldbus_Pending *pending)
{
void *user_data = eldbus_pending_data_del(pending, "__user_data");
const char *error, *error_msg;
Eldbus_Codegen_Property_Uint32_Get_Cb cb = data;
Eldbus_Proxy *proxy = eldbus_pending_data_del(pending, "__proxy");
Eldbus_Message_Iter *variant;
unsigned int v;
if (eldbus_message_error_get(msg, &error, &error_msg))
{
Eldbus_Error_Info error_info = {error, error_msg};
cb(user_data, pending, "AvailableAccuracyLevel", proxy, &error_info, 0);
return;
}
if (!eldbus_message_arguments_get(msg, "v", &variant))
{
Eldbus_Error_Info error_info = {"", ""};
cb(user_data, pending, "AvailableAccuracyLevel", proxy, &error_info, 0);
return;
}
if (!eldbus_message_iter_arguments_get(variant, "u", &v))
{
Eldbus_Error_Info error_info = {"", ""};
cb(user_data, pending, "AvailableAccuracyLevel", proxy, &error_info, 0);
return;
}
cb(user_data, pending, "AvailableAccuracyLevel", proxy, NULL, v);
}
Eldbus_Pending *
geo_clue2_manager_available_accuracy_level_propget(Eldbus_Proxy *proxy, Eldbus_Codegen_Property_Uint32_Get_Cb cb, const void *data)
{
Eldbus_Pending *p;
EINA_SAFETY_ON_NULL_RETURN_VAL(proxy, NULL);
p = eldbus_proxy_property_get(proxy, "AvailableAccuracyLevel", cb_geo_clue2_manager_available_accuracy_level, cb);
if (data)
eldbus_pending_data_set(p, "__user_data", data);
eldbus_pending_data_set(p, "__proxy", proxy);
return p;
}
void
geo_clue2_manager_log_domain_set(int id)
{
_log_main = id;
}
void
geo_clue2_manager_proxy_unref(Eldbus_Proxy *proxy)
{
Eldbus_Object *obj = eldbus_proxy_object_get(proxy);
eldbus_proxy_unref(proxy);
eldbus_object_unref(obj);
}
Eldbus_Proxy *
geo_clue2_manager_proxy_get(Eldbus_Connection *conn, const char *bus, const char *path)
{
Eldbus_Object *obj;
Eldbus_Proxy *proxy;
EINA_SAFETY_ON_NULL_RETURN_VAL(conn, NULL);
EINA_SAFETY_ON_NULL_RETURN_VAL(bus, NULL);
if (!path) path = "/";
obj = eldbus_object_get(conn, bus, path);
proxy = eldbus_proxy_get(obj, "org.freedesktop.GeoClue2.Manager");
return proxy;
}

View File

@ -1,23 +0,0 @@
#ifndef ELDBUS_GEO_CLUE2_MANAGER_H
#define ELDBUS_GEO_CLUE2_MANAGER_H
#ifdef EFL_BETA_API_SUPPORT
#include <Eina.h>
#include <Ecore.h>
#include <Eldbus.h>
#include "eldbus_utils.h"
Eldbus_Proxy *geo_clue2_manager_proxy_get(Eldbus_Connection *conn, const char *bus, const char *path);
void geo_clue2_manager_proxy_unref(Eldbus_Proxy *proxy);
void geo_clue2_manager_log_domain_set(int id);
typedef void (*Geo_Clue2_Manager_Get_Client_Cb)(Eldbus_Proxy *proxy, void *data, Eldbus_Pending *pending, Eldbus_Error_Info *error, const char *client);
Eldbus_Pending *geo_clue2_manager_get_client_call(Eldbus_Proxy *proxy, Geo_Clue2_Manager_Get_Client_Cb cb, const void *data);
typedef void (*Geo_Clue2_Manager_Add_Agent_Cb)(Eldbus_Proxy *proxy, void *data, Eldbus_Pending *pending, Eldbus_Error_Info *error);
Eldbus_Pending *geo_clue2_manager_add_agent_call(Eldbus_Proxy *proxy, Geo_Clue2_Manager_Add_Agent_Cb cb, const void *data, const char *id);
Eldbus_Pending *geo_clue2_manager_in_use_propget(Eldbus_Proxy *proxy, Eldbus_Codegen_Property_Bool_Get_Cb cb, const void *data);
Eldbus_Pending *geo_clue2_manager_available_accuracy_level_propget(Eldbus_Proxy *proxy, Eldbus_Codegen_Property_Uint32_Get_Cb cb, const void *data);
#endif /* BETA API */
#endif

View File

@ -1,24 +0,0 @@
#ifndef ELDBUS_UTILS_H
#define ELDBUS_UTILS_H 1
typedef struct _Eldbus_Error_Info
{
const char *error;
const char *message;
} Eldbus_Error_Info;
typedef void (*Eldbus_Codegen_Property_Set_Cb)(void *data, const char *propname, Eldbus_Proxy *proxy, Eldbus_Pending *p, Eldbus_Error_Info *error_info);
typedef void (*Eldbus_Codegen_Property_String_Get_Cb)(void *data, Eldbus_Pending *p, const char *propname, Eldbus_Proxy *proxy, Eldbus_Error_Info *error_info, const char *value);
typedef void (*Eldbus_Codegen_Property_Int32_Get_Cb)(void *data, Eldbus_Pending *p, const char *propname, Eldbus_Proxy *proxy, Eldbus_Error_Info *error_info, int value);
typedef void (*Eldbus_Codegen_Property_Byte_Get_Cb)(void *data, Eldbus_Pending *p, const char *propname, Eldbus_Proxy *proxy, Eldbus_Error_Info *error_info, unsigned char value);
typedef void (*Eldbus_Codegen_Property_Bool_Get_Cb)(void *data, Eldbus_Pending *p, const char *propname, Eldbus_Proxy *proxy, Eldbus_Error_Info *error_info, Eina_Bool value);
typedef void (*Eldbus_Codegen_Property_Int16_Get_Cb)(void *data, Eldbus_Pending *p, const char *propname, Eldbus_Proxy *proxy, Eldbus_Error_Info *error_info, short int value);
typedef void (*Eldbus_Codegen_Property_Uint16_Get_Cb)(void *data, Eldbus_Pending *p, const char *propname, Eldbus_Proxy *proxy, Eldbus_Error_Info *error_info, unsigned short int value);
typedef void (*Eldbus_Codegen_Property_Uint32_Get_Cb)(void *data, Eldbus_Pending *p, const char *propname, Eldbus_Proxy *proxy, Eldbus_Error_Info *error_info, unsigned int value);
typedef void (*Eldbus_Codegen_Property_Double_Get_Cb)(void *data, Eldbus_Pending *p, const char *propname, Eldbus_Proxy *proxy, Eldbus_Error_Info *error_info, double value);
typedef void (*Eldbus_Codegen_Property_Int64_Get_Cb)(void *data, Eldbus_Pending *p, const char *propname, Eldbus_Proxy *proxy, Eldbus_Error_Info *error_info, int64_t value);
typedef void (*Eldbus_Codegen_Property_Uint64_Get_Cb)(void *data, Eldbus_Pending *p, const char *propname, Eldbus_Proxy *proxy, Eldbus_Error_Info *error_info, uint64_t value);
typedef void (*Eldbus_Codegen_Property_Complex_Get_Cb)(void *data, Eldbus_Pending *p, const char *propname, Eldbus_Proxy *proxy, Eldbus_Error_Info *error_info, Eina_Value *value);
#endif

View File

@ -1,5 +0,0 @@
elocation_src += files([
'eldbus_geo_clue2_client.c',
'eldbus_geo_clue2_location.c',
'eldbus_geo_clue2_manager.c'])

View File

@ -1,199 +0,0 @@
<!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN"
"http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd">
<!--
GeoClue 2.0 Interface Specification
Copyright (C) 2013 Red Hat, Inc.
-->
<node>
<!--
org.freedesktop.GeoClue2.Manager:
@short_description: The GeoClue service manager
This is the interface you use to talk to main GeoClue2 manager object at
path "/org/freedesktop/GeoClue2/Manager". The only thing you do with this
interface is to call org.freedesktop.GeoClue2.Manager.GetClient() on it
to get your application specific client object.
-->
<interface name="org.freedesktop.GeoClue2.Manager">
<!--
InUse:
Whether service is currently is use by any application.
-->
<property name="InUse" type="b" access="read"/>
<!--
AvailableAccuracyLevel:
The level of available accuracy, as
<link linkend="GClueAccuracyLevel">GClueAccuracyLevel</link>.
-->
<property name="AvailableAccuracyLevel" type="u" access="read"/>
<!--
GetClient:
@client: The path for newly created client object
Retrieves a client object which can only be used by the calling
application only.
-->
<method name="GetClient">
<arg name="client" type="o" direction="out"/>
</method>
<!--
AddAgent:
@id: The Desktop ID (excluding .desktop) of the agent
An API for user authorization agents to register themselves. Each agent
is responsible for the user it is running as. Application developers
can and should simply ignore this API.
-->
<method name="AddAgent">
<arg name="id" type="s" direction="in"/>
</method>
</interface>
<!--
org.freedesktop.GeoClue2.Client:
@short_description: The Application-specific client API
This is the interface you use to retrieve location information and receive
location update signals from GeoClue service. You get the client object to
use this interface on from org.freedesktop.GeoClue2.Manager.GetClient()
method.
-->
<interface name="org.freedesktop.GeoClue2.Client">
<!--
Location:
Current location as path to a #org.freedesktop.GeoClue2.Location object.
-->
<property name="Location" type="o" access="read"/>
<!--
DistanceThreshold:
Contains the current distance threshold in meters. This value is used
by the service when it gets new location info. If the distance moved is
below the threshold, it won't emit the LocationUpdated signal.
-->
<property name="DistanceThreshold" type="u" access="readwrite"/>
<!--
DesktopId:
The desktop file id (the basename of the desktop file). This property
must be set by applications for authorization to work.
-->
<property name="DesktopId" type="s" access="readwrite"/>
<!--
RequestedAccuracyLevel:
The level of accuracy requested by client, as
<link linkend="GClueAccuracyLevel">GClueAccuracyLevel</link>.
Please keep in mind that the actual accuracy of location information is
dependent on available hardware on your machine, external resources
and/or how much accuracy user agrees to be confortable with.
-->
<property name="RequestedAccuracyLevel" type="u" access="readwrite"/>
<!--
Active:
If client is active, i-e started successfully using
org.freedesktop.GeoClue2.Client.Start() and receiving location updates.
Please keep in mind that geoclue can at any time stop and start the
client on user (agent) request. Applications that are interested in
in these changes, should watch for changes in this property.
-->
<property name="Active" type="b" access="read"/>
<!--
Start:
Start receiving events about the current location. Applications should
hook-up to #org.freedesktop.GeoClue2.Client::LocationUpdated signal
before calling this method.
-->
<method name="Start"/>
<!--
Stop:
Stop receiving events about the current location.
-->
<method name="Stop"/>
<!--
LocationUpdated:
@old: old location as path to a #org.freedesktop.GeoClue2.Location object
@new: new location as path to a #org.freedesktop.GeoClue2.Location object
The signal is emitted every time the location changes.
The client should set the DistanceThreshold property to control how
often this signal is emitted.
-->
<signal name="LocationUpdated">
<arg name="old" type="o"/>
<arg name="new" type="o"/>
</signal>
</interface>
<!--
org.freedesktop.GeoClue2.Location:
@short_description: The Location interface
This is the interface you use on location objects.
-->
<interface name="org.freedesktop.GeoClue2.Location">
<!--
Latitude:
The latitude of the location, in degrees.
-->
<property name="Latitude" type="d" access="read"/>
<!--
Longitude:
The longitude of the location, in degrees.
-->
<property name="Longitude" type="d" access="read"/>
<!--
Accuracy:
The accuracy of the location fix, in meters.
-->
<property name="Accuracy" type="d" access="read"/>
<!--
Altitude:
The altitude of the location fix, in meters. When unknown, its set to
minimum double value, -1.7976931348623157e+308.
-->
<property name="Altitude" type="d" access="read"/>
<!--
Description:
A human-readable description of the location, if available.
WARNING: Applications should not rely on this property since not all
sources provide a description. If you really need a description (or
more details) about current location, use a reverse-geocoding API, e.g
geocode-glib.
-->
<property name="Description" type="s" access="read"/>
</interface>
</node>

View File

@ -1,28 +0,0 @@
elocation_deps = [eina, eo, efl, ecore, eldbus]
elocation_pub_deps = [ecore, eldbus]
elocation_src = files(['elocation.c'])
subdir('gen')
elocation_header_src = ['Elocation.h']
elocation_lib = library('elocation',
elocation_src,
dependencies: [m] + elocation_deps + elocation_pub_deps,
include_directories : config_dir + [include_directories(join_paths('..','..'))],
install: true,
c_args : package_c_args,
version : meson.project_version()
)
elocation = declare_dependency(
include_directories: [include_directories('.')],
link_with: elocation_lib,
dependencies: elocation_pub_deps,
)
install_headers(elocation_header_src,
install_dir : dir_package_include,
)

View File

@ -85,8 +85,8 @@ extern "C" {
#include <canvas/efl_canvas_snapshot.eo.h>
#include <canvas/efl_text_cursor.eo.h>
#include <canvas/efl_text_attribute_factory.eo.h>
#include <canvas/efl_canvas_text.eo.h>
#include <canvas/efl_canvas_text_factory.eo.h>
#include <canvas/efl_canvas_textblock.eo.h>
#include <canvas/efl_canvas_textblock_factory.eo.h>
#include <canvas/efl_canvas_vg_node.eo.h>
#include <canvas/efl_canvas_vg_container.eo.h>
#include <canvas/efl_canvas_vg_gradient.eo.h>

View File

@ -143,14 +143,14 @@ struct _Efl_Canvas_Object_Animation_Event
*/
/**
* @ingroup Efl_Canvas_Text
* @ingroup Efl_Canvas_Textblock
*
* @{
*/
#include "canvas/efl_text_cursor.eo.h"
#include "canvas/efl_text_attribute_factory.eo.h"
#include "canvas/efl_canvas_text.eo.h"
#include "canvas/efl_canvas_text_factory.eo.h"
#include "canvas/efl_canvas_textblock.eo.h"
#include "canvas/efl_canvas_textblock_factory.eo.h"
/**
* @}
*/

View File

@ -1,72 +0,0 @@
EAPI Eina_Bool
evas_object_textblock_visible_range_get(Efl_Canvas_Text *obj EINA_UNUSED, Efl_Text_Cursor_Handle *start, Efl_Text_Cursor_Handle *end)
{
return evas_textblock_cursor_visible_range_get(start, end);
}
EAPI void
evas_object_textblock_style_insets_get(const Efl_Canvas_Text *obj, int *l, int *r, int *t, int *b)
{
efl_canvas_text_style_insets_get(obj, l, r, t, b);
}
EAPI void
evas_object_textblock_bidi_delimiters_set(Efl_Canvas_Text *obj, const char *delim)
{
efl_canvas_text_bidi_delimiters_set(obj, delim);
}
EAPI const char *
evas_object_textblock_bidi_delimiters_get(const Efl_Canvas_Text *obj)
{
return efl_canvas_text_bidi_delimiters_get(obj);
}
EAPI void
evas_object_textblock_legacy_newline_set(Efl_Canvas_Text *obj, Eina_Bool mode)
{
efl_canvas_text_newline_as_paragraph_separator_set(obj, mode);
}
EAPI Eina_Bool
evas_object_textblock_legacy_newline_get(const Efl_Canvas_Text *obj)
{
return efl_canvas_text_newline_as_paragraph_separator_get(obj);
}
EAPI void
evas_object_textblock_size_formatted_get(const Efl_Canvas_Text *obj, int *w, int *h)
{
Eina_Size2D size;
size = efl_canvas_text_size_formatted_get(obj);
if (w) *w = size.w;
if (h) *h = size.h;
}
EAPI void
evas_object_textblock_size_native_get(const Efl_Canvas_Text *obj, int *w, int *h)
{
Eina_Size2D size;
size = efl_canvas_text_size_native_get(obj);
if (w) *w = size.w;
if (h) *h = size.h;
}
EAPI Eina_Bool
evas_object_textblock_obstacle_add(Efl_Canvas_Text *obj, Efl_Canvas_Object *eo_obs)
{
return efl_canvas_text_obstacle_add(obj, eo_obs);
}
EAPI Eina_Bool
evas_object_textblock_obstacle_del(Efl_Canvas_Text *obj, Efl_Canvas_Object *eo_obs)
{
return efl_canvas_text_obstacle_del(obj, eo_obs);
}
EAPI void
evas_object_textblock_obstacles_update(Efl_Canvas_Text *obj)
{
efl_canvas_text_obstacles_update(obj);
}

View File

@ -1,6 +1,6 @@
import efl_text_types;
class @beta Efl.Canvas.Text extends Efl.Canvas.Object implements Efl.Text,
class @beta Efl.Canvas.Textblock extends Efl.Canvas.Object implements Efl.Text,
Efl.Canvas.Filter.Internal, Efl.Text_Font,
Efl.Text_Style, Efl.Text_Format,
Efl.Text_Markup, Efl.Ui.I18n

View File

@ -0,0 +1,72 @@
EAPI Eina_Bool
evas_object_textblock_visible_range_get(Efl_Canvas_Textblock *obj EINA_UNUSED, Efl_Text_Cursor_Handle *start, Efl_Text_Cursor_Handle *end)
{
return evas_textblock_cursor_visible_range_get(start, end);
}
EAPI void
evas_object_textblock_style_insets_get(const Efl_Canvas_Textblock *obj, int *l, int *r, int *t, int *b)
{
efl_canvas_textblock_style_insets_get(obj, l, r, t, b);
}
EAPI void
evas_object_textblock_bidi_delimiters_set(Efl_Canvas_Textblock *obj, const char *delim)
{
efl_canvas_textblock_bidi_delimiters_set(obj, delim);
}
EAPI const char *
evas_object_textblock_bidi_delimiters_get(const Efl_Canvas_Textblock *obj)
{
return efl_canvas_textblock_bidi_delimiters_get(obj);
}
EAPI void
evas_object_textblock_legacy_newline_set(Efl_Canvas_Textblock *obj, Eina_Bool mode)
{
efl_canvas_textblock_newline_as_paragraph_separator_set(obj, mode);
}
EAPI Eina_Bool
evas_object_textblock_legacy_newline_get(const Efl_Canvas_Textblock *obj)
{
return efl_canvas_textblock_newline_as_paragraph_separator_get(obj);
}
EAPI void
evas_object_textblock_size_formatted_get(const Efl_Canvas_Textblock *obj, int *w, int *h)
{
Eina_Size2D size;
size = efl_canvas_textblock_size_formatted_get(obj);
if (w) *w = size.w;
if (h) *h = size.h;
}
EAPI void
evas_object_textblock_size_native_get(const Efl_Canvas_Textblock *obj, int *w, int *h)
{
Eina_Size2D size;
size = efl_canvas_textblock_size_native_get(obj);
if (w) *w = size.w;
if (h) *h = size.h;
}
EAPI Eina_Bool
evas_object_textblock_obstacle_add(Efl_Canvas_Textblock *obj, Efl_Canvas_Object *eo_obs)
{
return efl_canvas_textblock_obstacle_add(obj, eo_obs);
}
EAPI Eina_Bool
evas_object_textblock_obstacle_del(Efl_Canvas_Textblock *obj, Efl_Canvas_Object *eo_obs)
{
return efl_canvas_textblock_obstacle_del(obj, eo_obs);
}
EAPI void
evas_object_textblock_obstacles_update(Efl_Canvas_Textblock *obj)
{
efl_canvas_textblock_obstacles_update(obj);
}

View File

@ -1,15 +1,15 @@
#ifndef _EFL_CANVAS_TEXT_EO_LEGACY_H_
#define _EFL_CANVAS_TEXT_EO_LEGACY_H_
#ifndef _EFL_CANVAS_TEXTBLOCK_EO_LEGACY_H_
#define _EFL_CANVAS_TEXTBLOCK_EO_LEGACY_H_
#ifndef _EFL_CANVAS_TEXT_EO_CLASS_TYPE
#define _EFL_CANVAS_TEXT_EO_CLASS_TYPE
#ifndef _EFL_CANVAS_TEXTBLOCK_EO_CLASS_TYPE
#define _EFL_CANVAS_TEXTBLOCK_EO_CLASS_TYPE
typedef Eo Efl_Canvas_Text;
typedef Eo Efl_Canvas_Textblock;
#endif
#ifndef _EFL_CANVAS_TEXT_EO_TYPES
#define _EFL_CANVAS_TEXT_EO_TYPES
#ifndef _EFL_CANVAS_TEXTBLOCK_EO_TYPES
#define _EFL_CANVAS_TEXTBLOCK_EO_TYPES
#endif
@ -32,7 +32,7 @@ typedef Eo Efl_Canvas_Text;
*
* @ingroup Evas_Object_Textblock_Group
*/
EAPI Eina_Bool evas_object_textblock_visible_range_get(Efl_Canvas_Text *obj, Efl_Text_Cursor_Handle *start, Efl_Text_Cursor_Handle *end);
EAPI Eina_Bool evas_object_textblock_visible_range_get(Efl_Canvas_Textblock *obj, Efl_Text_Cursor_Handle *start, Efl_Text_Cursor_Handle *end);
/**
* @brief Gets the left, right, top and bottom insets of the text.
@ -49,7 +49,7 @@ EAPI Eina_Bool evas_object_textblock_visible_range_get(Efl_Canvas_Text *obj, Efl
*
* @ingroup Evas_Object_Textblock_Group
*/
EAPI void evas_object_textblock_style_insets_get(const Efl_Canvas_Text *obj, int *left, int *right, int *top, int *bottom);
EAPI void evas_object_textblock_style_insets_get(const Efl_Canvas_Textblock *obj, int *left, int *right, int *top, int *bottom);
/**
* @brief BiDi delimiters are used for in-paragraph separation of bidi
@ -64,7 +64,7 @@ EAPI void evas_object_textblock_style_insets_get(const Efl_Canvas_Text *obj, int
*
* @ingroup Evas_Object_Textblock_Group
*/
EAPI void evas_object_textblock_bidi_delimiters_set(Efl_Canvas_Text *obj, const char *delim);
EAPI void evas_object_textblock_bidi_delimiters_set(Efl_Canvas_Textblock *obj, const char *delim);
/**
* @brief BiDi delimiters are used for in-paragraph separation of bidi
@ -79,7 +79,7 @@ EAPI void evas_object_textblock_bidi_delimiters_set(Efl_Canvas_Text *obj, const
*
* @ingroup Evas_Object_Textblock_Group
*/
EAPI const char *evas_object_textblock_bidi_delimiters_get(const Efl_Canvas_Text *obj);
EAPI const char *evas_object_textblock_bidi_delimiters_get(const Efl_Canvas_Textblock *obj);
/**
* @brief When @c true, newline character will behave as a paragraph separator.
@ -91,7 +91,7 @@ EAPI const char *evas_object_textblock_bidi_delimiters_get(const Efl_Canvas_Text
*
* @ingroup Evas_Object_Textblock_Group
*/
EAPI void evas_object_textblock_legacy_newline_set(Efl_Canvas_Text *obj, Eina_Bool mode);
EAPI void evas_object_textblock_legacy_newline_set(Efl_Canvas_Textblock *obj, Eina_Bool mode);
/**
* @brief When @c true, newline character will behave as a paragraph separator.
@ -104,7 +104,7 @@ EAPI void evas_object_textblock_legacy_newline_set(Efl_Canvas_Text *obj, Eina_Bo
*
* @ingroup Evas_Object_Textblock_Group
*/
EAPI Eina_Bool evas_object_textblock_legacy_newline_get(const Efl_Canvas_Text *obj);
EAPI Eina_Bool evas_object_textblock_legacy_newline_get(const Efl_Canvas_Textblock *obj);
@ -133,7 +133,7 @@ EAPI Eina_Bool evas_object_textblock_legacy_newline_get(const Efl_Canvas_Text *o
*
* @ingroup Evas_Object_Textblock_Group
*/
EAPI void evas_object_textblock_size_formatted_get(const Efl_Canvas_Text *obj, int *width, int *height);
EAPI void evas_object_textblock_size_formatted_get(const Efl_Canvas_Textblock *obj, int *width, int *height);
/**
* @brief The native width and height.
@ -161,7 +161,7 @@ EAPI void evas_object_textblock_size_formatted_get(const Efl_Canvas_Text *obj, i
*
* @ingroup Evas_Object_Textblock_Group
*/
EAPI void evas_object_textblock_size_native_get(const Efl_Canvas_Text *obj, int *width, int *height);
EAPI void evas_object_textblock_size_native_get(const Efl_Canvas_Textblock *obj, int *width, int *height);
@ -183,7 +183,7 @@ EAPI void evas_object_textblock_size_native_get(const Efl_Canvas_Text *obj, int
*
* @ingroup Evas_Object_Textblock_Group
*/
EAPI Eina_Bool evas_object_textblock_obstacle_add(Efl_Canvas_Text *obj, Efl_Canvas_Object *eo_obs);
EAPI Eina_Bool evas_object_textblock_obstacle_add(Efl_Canvas_Textblock *obj, Efl_Canvas_Object *eo_obs);
/**
* @brief Removes @c eo_obs from observation during text layout.
@ -197,7 +197,7 @@ EAPI Eina_Bool evas_object_textblock_obstacle_add(Efl_Canvas_Text *obj, Efl_Canv
*
* @ingroup Evas_Object_Textblock_Group
*/
EAPI Eina_Bool evas_object_textblock_obstacle_del(Efl_Canvas_Text *obj, Efl_Canvas_Object *eo_obs);
EAPI Eina_Bool evas_object_textblock_obstacle_del(Efl_Canvas_Textblock *obj, Efl_Canvas_Object *eo_obs);
/**
* @brief Triggers for relayout due to obstacles' state change.
@ -216,7 +216,7 @@ EAPI Eina_Bool evas_object_textblock_obstacle_del(Efl_Canvas_Text *obj, Efl_Canv
*
* @ingroup Evas_Object_Textblock_Group
*/
EAPI void evas_object_textblock_obstacles_update(Efl_Canvas_Text *obj);
EAPI void evas_object_textblock_obstacles_update(Efl_Canvas_Textblock *obj);
#endif

View File

@ -1,4 +1,4 @@
interface @beta Efl.Canvas.Text_Factory
interface @beta Efl.Canvas.Textblock_Factory
{
[[Object factory that creates Efl.Canvas.Object objects.

View File

@ -1,5 +1,5 @@
#ifndef _EFL_CANVAS_TEXT_INTERNAL_H
#define _EFL_CANVAS_TEXT_INTERNAL_H
#ifndef _EFL_CANVAS_TEXTBLOCK_INTERNAL_H
#define _EFL_CANVAS_TEXTBLOCK_INTERNAL_H
#include <Evas.h>
@ -11,10 +11,10 @@
/* private struct for textblock object internal data */
/**
* @internal
* @typedef Efl_Canvas_Text_Data
* @typedef Efl_Canvas_Textblock_Data
* The actual textblock object.
*/
typedef struct _Evas_Object_Textblock Efl_Canvas_Text_Data;
typedef struct _Evas_Object_Textblock Efl_Canvas_Textblock_Data;
/**
* @internal
* @typedef Evas_Object_Style_Tag
@ -89,22 +89,22 @@ typedef struct _Evas_Textblock_Selection_Iterator Evas_Textblock_Selection_Itera
typedef struct _Efl_Text_Attribute_Handle_Iterator Efl_Text_Attribute_Handle_Iterator;
/**
* @internal
* @typedef Efl_Canvas_Text_Filter
* @typedef Efl_Canvas_Textblock_Filter
* A structure holding gfx filter information for a text item
*/
typedef struct _Efl_Canvas_Text_Filter Efl_Canvas_Text_Filter;
typedef struct _Efl_Canvas_Textblock_Filter Efl_Canvas_Textblock_Filter;
/**
* @internal
* @typedef Efl_Canvas_Text_Filter_Post_Render
* @typedef Efl_Canvas_Textblock_Filter_Post_Render
* Post-render data for async rendering of gfx filters
*/
typedef struct _Efl_Canvas_Text_Filter_Post_Render Efl_Canvas_Text_Filter_Post_Render;
typedef struct _Efl_Canvas_Textblock_Filter_Post_Render Efl_Canvas_Textblock_Filter_Post_Render;
/**
* @internal
* @typedef Efl_Canvas_Text_Filter_Program
* @typedef Efl_Canvas_Textblock_Filter_Program
* Filter name - code database
*/
typedef struct _Efl_Canvas_Text_Filter_Program Efl_Canvas_Text_Filter_Program;
typedef struct _Efl_Canvas_Textblock_Filter_Program Efl_Canvas_Textblock_Filter_Program;
/**
* @internal
* @typedef Text_Item_Filter
@ -235,7 +235,7 @@ _evas_textblock_annotations_set(Evas_Object *eo_obj,
const char *format, Eina_Bool is_item);
void
_evas_textblock_annotation_remove(Evas_Object *eo_obj, Efl_Canvas_Text_Data *o,
_evas_textblock_annotation_remove(Evas_Object *eo_obj, Efl_Canvas_Textblock_Data *o,
Efl_Text_Attribute_Handle *an, Eina_Bool remove_nodes, Eina_Bool invalidate);
void
@ -312,4 +312,4 @@ EAPI Efl_Text_Cursor_Handle *efl_text_cursor_handle_get(const Eo *obj);
#undef EAPI
#define EAPI
#endif//#ifndef _EFL_CANVAS_TEXT_INTERNAL_H
#endif//#ifndef _EFL_CANVAS_TEXTBLOCK_INTERNAL_H

View File

@ -1,7 +1,7 @@
//#define EFL_BETA_API_SUPPORT
#include "evas_common_private.h"
#include "evas_private.h"
#include "efl_canvas_text_internal.h"
#include "efl_canvas_textblock_internal.h"
#include "efl_text_cursor.eo.h"
#define MY_CLASS EFL_TEXT_ATTRIBUTE_FACTORY_CLASS
@ -23,7 +23,7 @@ _efl_text_attribute_factory_attribute_insert(const Efl_Text_Cursor *start, const
_evas_textblock_annotations_insert(eo_obj, efl_text_cursor_handle_get(start), efl_text_cursor_handle_get(end), format,
EINA_FALSE);
efl_event_callback_legacy_call(eo_obj, EFL_CANVAS_TEXT_EVENT_CHANGED, NULL);
efl_event_callback_legacy_call(eo_obj, EFL_CANVAS_TEXTBLOCK_EVENT_CHANGED, NULL);
}
EOLIAN static unsigned int

View File

@ -6,7 +6,7 @@ abstract @beta Efl.Text.Attribute.Factory extends Efl.Object {
Attributes can be assigned to character ranges, selected using two @Efl.Text.Cursor instances.
Cursor instances are already bound to a text object so there's no need to provide it to this class.
Style is specified using format strings as described in @Efl.Canvas.Text.style_apply.
Style is specified using format strings as described in @Efl.Canvas.Textblock.style_apply.
There is no need to instantiate this class. Use directly the @.attribute_insert and @.attribute_clear static methods.]]
methods {
@ -15,7 +15,7 @@ abstract @beta Efl.Text.Attribute.Factory extends Efl.Object {
The $format will be applied to the given range.
The passed cursors must belong to same textObject, else insertion will be ignored.
Passed format parameter uses same format as style in @Efl.Canvas.Text.style_apply.
Passed format parameter uses same format as style in @Efl.Canvas.Textblock.style_apply.
]]
params {
start: const(Efl.Text.Cursor); [[Start of range.]]

View File

@ -1,6 +1,6 @@
#include "evas_common_private.h"
#include "evas_private.h"
#include "efl_canvas_text_internal.h"
#include "efl_canvas_textblock_internal.h"
#define MY_CLASS EFL_TEXT_CURSOR_CLASS
#define MY_CLASS_NAME "Efl.Text.Cursor"
@ -168,12 +168,12 @@ _efl_text_cursor_move(Eo *obj EINA_UNUSED, Efl_Text_Cursor_Data *pd, Efl_Text_Cu
if (pos != evas_textblock_cursor_pos_get(pd->handle))
moved = EINA_TRUE;
break;
case EFL_TEXT_CURSOR_MOVE_TYPE_PARAGRAPH_FIRST :
case EFL_TEXT_CURSOR_MOVE_TYPE_FIRST :
evas_textblock_cursor_paragraph_first(pd->handle);
if (pos != evas_textblock_cursor_pos_get(pd->handle))
moved = EINA_TRUE;
break;
case EFL_TEXT_CURSOR_MOVE_TYPE_PARAGRAPH_LAST :
case EFL_TEXT_CURSOR_MOVE_TYPE_LAST :
evas_textblock_cursor_paragraph_last(pd->handle);
if (pos != evas_textblock_cursor_pos_get(pd->handle))
moved = EINA_TRUE;
@ -434,7 +434,7 @@ void efl_text_cursor_text_object_set(Eo *cursor, Eo *canvas_text_obj, Eo *text_o
{
Efl_Text_Cursor_Data *pd = efl_data_scope_get(cursor, MY_CLASS);
Efl_Text_Cursor_Handle *handle = NULL;
if (efl_isa(canvas_text_obj, EFL_CANVAS_TEXT_CLASS))
if (efl_isa(canvas_text_obj, EFL_CANVAS_TEXTBLOCK_CLASS))
{
pd->text_obj = text_obj;
handle = evas_object_textblock_cursor_new(canvas_text_obj);

View File

@ -12,14 +12,14 @@ enum @beta Efl.Text.Cursor_Move_Type
char_prev, [[Advances to the previous character.]]
cluster_next, [[Advances to the next grapheme cluster (A character sequence rendered together. See https://unicode.org/reports/tr29/).]]
cluster_prev, [[Advances to the previous grapheme cluster (A character sequence rendered together. See https://unicode.org/reports/tr29/).]]
paragraph_start, [[Advances to the first character in this paragraph.]]
paragraph_end, [[Advances to the last character in this paragraph.]]
paragraph_start, [[Advances to the first character in current paragraph.]]
paragraph_end, [[Advances to the last character in current paragraph.]]
word_start, [[Advance to current word start.]]
word_end, [[Advance to current word end.]]
line_start, [[Advance to current line first character.]]
line_end, [[Advance to current line last character.]]
paragraph_first, [[Advance to first character in the first paragraph.]]
paragraph_last, [[Advance to last character in the last paragraph.]]
first, [[Advance to first character in the first paragraph.]]
last, [[Advance to last character in the last paragraph.]]
paragraph_next, [[Advances to the start of the next paragraph.]]
paragraph_prev [[Advances to the end of the previous paragraph.]]
}

File diff suppressed because it is too large Load Diff

View File

@ -17,7 +17,7 @@ static size_t _hyphen_clients = 0;
static void
_dicts_hyphen_init(Eo *eo_obj)
{
Efl_Canvas_Text_Data *o = efl_data_scope_get(eo_obj, MY_CLASS);
Efl_Canvas_Textblock_Data *o = efl_data_scope_get(eo_obj, MY_CLASS);
if (!o->hyphenating)
{
@ -98,7 +98,7 @@ _dicts_hyphen_free(void)
static inline void
_dicts_hyphen_detach(Eo *eo_obj)
{
Efl_Canvas_Text_Data *o = efl_data_scope_get(eo_obj, MY_CLASS);
Efl_Canvas_Textblock_Data *o = efl_data_scope_get(eo_obj, MY_CLASS);
if (!o->hyphenating) return;
o->hyphenating = EINA_FALSE;

View File

@ -138,7 +138,7 @@ typedef Eo Evas_Textblock;
* @see evas_textblock_style_set()
*/
typedef struct _Efl_Canvas_Text_Style Evas_Textblock_Style;
typedef struct _Efl_Canvas_Textblock_Style Evas_Textblock_Style;
/**
* @typedef Evas_Textblock_Cursor
@ -921,7 +921,7 @@ EAPI int evas_textblock_cursor_text_prepend(Evas_Textblock_Cursor *cur, const ch
*
* @param[in] ch The charset name.
*
* @ingroup Efl_Canvas_Text
* @ingroup Efl_Canvas_Textblock
*/
EAPI void evas_object_textblock_replace_char_set(Evas_Object *obj, const char *ch);
@ -930,7 +930,7 @@ EAPI void evas_object_textblock_replace_char_set(Evas_Object *obj, const char *c
*
* @return The charset name.
*
* @ingroup Efl_Canvas_Text
* @ingroup Efl_Canvas_Textblock
*/
EAPI const char *evas_object_textblock_replace_char_get(const Evas_Object *obj);
@ -945,7 +945,7 @@ EAPI const char *evas_object_textblock_replace_char_get(const Evas_Object *obj);
*
* @since 1.1
*
* @ingroup Efl_Canvas_Text
* @ingroup Efl_Canvas_Textblock
*/
EAPI void evas_object_textblock_valign_set(Evas_Object *obj, double align);
@ -960,7 +960,7 @@ EAPI void evas_object_textblock_valign_set(Evas_Object *obj, double align);
*
* @since 1.1
*
* @ingroup Efl_Canvas_Text
* @ingroup Efl_Canvas_Textblock
*/
EAPI double evas_object_textblock_valign_get(const Evas_Object *obj);
@ -1056,7 +1056,7 @@ EAPI void evas_textblock_cursor_char_delete(Evas_Textblock_Cursor *cur);
* @ingroup Evas_Textblock
*/
EAPI Evas_Textblock_Cursor *evas_object_textblock_cursor_get(const Evas_Object *obj);
#include "canvas/efl_canvas_text_eo.legacy.h"
#include "canvas/efl_canvas_textblock_eo.legacy.h"
/**
* @}
*/

View File

@ -39,7 +39,7 @@ pub_eo_files = [
'efl_canvas_animation_group.eo',
'efl_canvas_animation_group_parallel.eo',
'efl_canvas_animation_group_sequential.eo',
'efl_canvas_text_factory.eo',
'efl_canvas_textblock_factory.eo',
'efl_canvas_rectangle.eo',
'efl_canvas_object.eo',
'efl_gfx_vg_value_provider.eo',
@ -55,7 +55,7 @@ pub_eo_files = [
'efl_gfx_mapping.eo',
'efl_canvas_event_grabber.eo',
'efl_text_cursor.eo',
'efl_canvas_text.eo',
'efl_canvas_textblock.eo',
'efl_text_attribute_factory.eo',
'efl_canvas_object_animation.eo',
]
@ -106,7 +106,7 @@ evas_legacy_h = files([
'efl_canvas_event_grabber_eo.legacy.h',
'efl_canvas_group_eo.legacy.h',
'efl_canvas_object_eo.legacy.h',
'efl_canvas_text_eo.legacy.h',
'efl_canvas_textblock_eo.legacy.h',
'efl_canvas_vg_container_eo.legacy.h',
'efl_canvas_vg_node_eo.legacy.h',
'efl_canvas_vg_object_eo.legacy.h',

View File

@ -433,6 +433,25 @@ EFL_START_TEST(wl2_window_available_rotation)
}
EFL_END_TEST
EFL_START_TEST(wl2_window_role)
{
Ecore_Wl2_Display *disp;
Ecore_Wl2_Window *win;
const char *role;
disp = _display_connect();
ck_assert(disp != NULL);
win = _window_create(disp);
ck_assert(win != NULL);
ecore_wl2_window_role_set(win, "TEST");
role = ecore_wl2_window_role_get(win);
fail_if(strcmp(role, "TEST"));
}
EFL_END_TEST
void
ecore_wl2_test_window(TCase *tc)
{
@ -461,5 +480,6 @@ ecore_wl2_test_window(TCase *tc)
tcase_add_test(tc, wl2_window_aspect);
tcase_add_test(tc, wl2_window_class);
tcase_add_test(tc, wl2_window_title);
tcase_add_test(tc, wl2_window_role);
}
}

View File

@ -515,7 +515,7 @@ class TestProvider
private class ProviderHolder : Dummy.TestObject
{
private Dummy.TestObject provider;
public string ProviderName
public static string ProviderName
{
get
{
@ -526,7 +526,7 @@ class TestProvider
public ProviderHolder() : base(null)
{
this.provider = new Dummy.TestObject(this);
this.provider.Name = this.ProviderName;
this.provider.Name = ProviderHolder.ProviderName;
this.provider.IfaceProp = 1997;
}
@ -553,7 +553,7 @@ class TestProvider
provider = obj.CallFindProviderForIface();
Test.AssertNotNull(provider, msg : "Provider of ITestIFace must not be null");
Test.AssertEquals(provider.Name, obj.ProviderName, "Provider name does not match expected");
Test.AssertEquals(provider.Name, ProviderHolder.ProviderName, "Provider name does not match expected");
obj.Dispose();
}
}

View File

@ -1,235 +0,0 @@
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif /* ifdef HAVE_CONFIG_H */
#include <stdlib.h>
#include <stdio.h>
#include <check.h>
#include <Elocation.h>
/* Test the init and shutdown pathes only. Good to do that as we don't set up
* other things and already triggered problems with this.
*/
EFL_START_TEST(elocation_test_init)
{
Eina_Bool ret;
ret = elocation_init();
fail_if(ret != EINA_TRUE);
elocation_shutdown();
}
EFL_END_TEST
/* Basic address object testing. Creating and freeing the object */
EFL_START_TEST(elocation_test_address_object)
{
Eina_Bool ret;
Elocation_Address *address = NULL;
ret = elocation_init();
fail_if(ret != EINA_TRUE);
address = elocation_address_new();
fail_if(address == NULL);
elocation_address_free(address);
elocation_shutdown();
}
EFL_END_TEST
/* Basic position object testing. Creating and freeing the object */
EFL_START_TEST(elocation_test_position_object)
{
Eina_Bool ret;
Elocation_Position *position = NULL;
ret = elocation_init();
fail_if(ret != EINA_TRUE);
position = elocation_position_new();
fail_if(position == NULL);
elocation_position_free(position);
elocation_shutdown();
}
EFL_END_TEST
/* Basic testing for the various functions of the GeoCode API */
static int cb_count = 0;
static Eina_Bool
event_cb(void *data EINA_UNUSED, int ev_type EINA_UNUSED, void *event)
{
fail_if(event == NULL);
/* We expect 3 callbacks right now */
if (++cb_count == 3)
ecore_main_loop_quit();
return ECORE_CALLBACK_DONE;
}
EFL_START_TEST(elocation_test_api_geocode)
{
Eina_Bool ret;
Elocation_Position *position = NULL;
Elocation_Address *address = NULL;
Ecore_Event_Handler *handler;
ret = elocation_init();
fail_if(ret != EINA_TRUE);
handler = ecore_event_handler_add(ELOCATION_EVENT_GEOCODE, event_cb, NULL);
fail_if(handler == NULL);
handler = ecore_event_handler_add(ELOCATION_EVENT_REVERSEGEOCODE, event_cb, NULL);
fail_if(handler == NULL);
position = elocation_position_new();
fail_if(position == NULL);
address = elocation_address_new();
fail_if(address == NULL);
ret = elocation_freeform_address_to_position("London", position);
fail_if(ret != EINA_TRUE);
position->latitude = 51.7522;
position->longitude = -1.25596;
position->accur->level = 3;
ret = elocation_position_to_address(position, address);
fail_if(ret != EINA_TRUE);
address->locality = strdup("Cambridge");
address->countrycode = strdup("UK");
ret = elocation_address_to_position(address, position);
fail_if(ret != EINA_TRUE);
ecore_main_loop_begin();
elocation_position_free(position);
elocation_address_free(address);
elocation_shutdown();
}
EFL_END_TEST
/* Basic testing for position API */
EFL_START_TEST(elocation_test_api_position)
{
Eina_Bool ret;
Elocation_Position *position = NULL;
ret = elocation_init();
fail_if(ret != EINA_TRUE);
position = elocation_position_new();
fail_if(position == NULL);
ret = elocation_position_get(position);
fail_if(ret != EINA_TRUE);
elocation_position_free(position);
elocation_shutdown();
}
EFL_END_TEST
/* Basic testing for address API */
EFL_START_TEST(elocation_test_api_address)
{
Eina_Bool ret;
Elocation_Address *address = NULL;
ret = elocation_init();
fail_if(ret != EINA_TRUE);
address = elocation_address_new();
fail_if(address == NULL);
ret = elocation_address_get(address);
fail_if(ret != EINA_TRUE);
elocation_address_free(address);
elocation_shutdown();
}
EFL_END_TEST
/* Basic testing for status API */
EFL_START_TEST(elocation_test_api_status)
{
Eina_Bool ret;
int status = 0;
ret = elocation_init();
fail_if(ret != EINA_TRUE);
ret = elocation_status_get(&status);
fail_if(ret != EINA_TRUE);
elocation_shutdown();
}
EFL_END_TEST
Suite *
elocation_suite(void)
{
Suite *s;
TCase *tc;
s = suite_create("Elocation");
tc = tcase_create("Elocation_Init");
tcase_add_test(tc, elocation_test_init);
suite_add_tcase(s, tc);
tc = tcase_create("Elocation_Objects");
tcase_add_test(tc, elocation_test_address_object);
tcase_add_test(tc, elocation_test_position_object);
suite_add_tcase(s, tc);
tc = tcase_create("Elocation_API_Geocode");
tcase_add_test(tc, elocation_test_api_geocode);
suite_add_tcase(s, tc);
tc = tcase_create("Elocation_API_Position");
tcase_add_test(tc, elocation_test_api_position);
suite_add_tcase(s, tc);
tc = tcase_create("Elocation_API_Address");
tcase_add_test(tc, elocation_test_api_address);
suite_add_tcase(s, tc);
/*
tc = tcase_create("Elocation_API_Status");
tcase_add_test(tc, elocation_test_api_status);
suite_add_tcase(s, tc);
*/
return s;
}
int
main(void)
{
Suite *s;
SRunner *sr;
int failed_count;
#ifdef NEED_RUN_IN_TREE
putenv("EFL_RUN_IN_TREE=1");
#endif
s = elocation_suite();
sr = srunner_create(s);
srunner_set_xml(sr, TESTS_BUILD_DIR "/check-results.xml");
srunner_run_all(sr, CK_ENV);
failed_count = srunner_ntests_failed(sr);
srunner_free(sr);
return (failed_count == 0) ? EXIT_SUCCESS : EXIT_FAILURE;
}

View File

@ -49,7 +49,7 @@ static const char *style_buf =
fail_if(strcmp(style_buf, evas_textblock_style_get(st))); \
evas_object_textblock_style_set(tb, st); \
cur = evas_object_textblock_cursor_new(tb); \
cur_obj =efl_canvas_text_cursor_create(tb);\
cur_obj =efl_canvas_textblock_cursor_create(tb);\
(void) cur_obj;\
(void) cur;\
do \
@ -4319,8 +4319,8 @@ EFL_START_TEST(evas_textblock_annotation)
START_TB_TEST();
Efl_Text_Cursor *start, *end;
start = efl_canvas_text_cursor_create(tb);
end = efl_canvas_text_cursor_create(tb);
start = efl_canvas_textblock_cursor_create(tb);
end = efl_canvas_textblock_cursor_create(tb);
const char *buf =
"This text will check annotation."
@ -4353,19 +4353,19 @@ EFL_END_TEST;
static const char *efl_style_buf =
"" TEST_FONT " font_size=10 color=#000 text_class=entry";
#define START_EFL_CANVAS_TEXT_TEST() \
#define START_EFL_CANVAS_TEXTBLOCK_TEST() \
Evas *evas; \
Eo *txt; \
Efl_Text_Cursor_Handle *cur; \
Efl_Text_Cursor *cur_obj; \
evas = EVAS_TEST_INIT_EVAS(); \
evas_font_hinting_set(evas, EVAS_FONT_HINTING_AUTO); \
txt = efl_add(EFL_CANVAS_TEXT_CLASS, evas); \
txt = efl_add(EFL_CANVAS_TEXTBLOCK_CLASS, evas); \
fail_if(!txt); \
efl_canvas_text_newline_as_paragraph_separator_set(txt, EINA_FALSE); \
efl_canvas_text_style_apply(txt, efl_style_buf); \
fail_if(!efl_canvas_text_all_styles_get(txt)); \
cur_obj = efl_canvas_text_cursor_create(txt);\
efl_canvas_textblock_newline_as_paragraph_separator_set(txt, EINA_FALSE); \
efl_canvas_textblock_style_apply(txt, efl_style_buf); \
fail_if(!efl_canvas_textblock_all_styles_get(txt)); \
cur_obj = efl_canvas_textblock_cursor_create(txt);\
cur = evas_object_textblock_cursor_new(txt); \
fail_if(!cur); \
do \
@ -4373,7 +4373,7 @@ do \
} \
while (0)
#define END_EFL_CANVAS_TEXT_TEST() \
#define END_EFL_CANVAS_TEXTBLOCK_TEST() \
do \
{ \
efl_del(cur_obj); \
@ -4383,11 +4383,11 @@ do \
} \
while (0)
EFL_START_TEST(efl_canvas_text_simple)
EFL_START_TEST(efl_canvas_textblock_simple)
{
START_EFL_CANVAS_TEXT_TEST();
START_EFL_CANVAS_TEXTBLOCK_TEST();
/* It is simple test for Efl_Canvas_Text.
/* It is simple test for Efl_Canvas_Textblock.
* The main object is "txt". */
const char *buf = "Th<i>i</i>s is a <br/> te<b>s</b>t.";
efl_text_set(txt, buf);
@ -4403,7 +4403,7 @@ EFL_START_TEST(efl_canvas_text_simple)
password = efl_text_password_get(txt);
fail_if(password);
END_EFL_CANVAS_TEXT_TEST();
END_EFL_CANVAS_TEXTBLOCK_TEST();
}
EFL_END_TEST
@ -4421,7 +4421,7 @@ EFL_START_TEST(efl_text)
* Russian 't' in the beginnning to create additional item.*/
/*01234 5 6789012345678 19 01234 */
efl_text_set(tb, "тest \u202bנסיוןabcנסיון\u202c bang");
size = efl_canvas_text_size_native_get(tb);
size = efl_canvas_textblock_size_native_get(tb);
nw = size.w;
nh = size.h;
@ -4445,9 +4445,9 @@ EFL_START_TEST(efl_text)
}
EFL_END_TEST
EFL_START_TEST(efl_canvas_text_cursor)
EFL_START_TEST(efl_canvas_textblock_cursor)
{
START_EFL_CANVAS_TEXT_TEST();
START_EFL_CANVAS_TEXTBLOCK_TEST();
int pos;
const char *buf = "abcdefghij";
@ -4469,24 +4469,24 @@ EFL_START_TEST(efl_canvas_text_cursor)
pos = efl_text_cursor_position_get(cursor1);
ck_assert_int_eq(pos, -1);
efl_canvas_text_cursor_add(txt, cursor1);
efl_canvas_textblock_cursor_add(txt, cursor1);
efl_text_cursor_position_set(cursor1, 1);
pos = efl_text_cursor_position_get(cursor1);
ck_assert_int_eq(pos, 1);
END_EFL_CANVAS_TEXT_TEST();
END_EFL_CANVAS_TEXTBLOCK_TEST();
}
EFL_END_TEST
EFL_START_TEST(efl_canvas_text_markup)
EFL_START_TEST(efl_canvas_textblock_markup)
{
START_EFL_CANVAS_TEXT_TEST();
START_EFL_CANVAS_TEXTBLOCK_TEST();
Efl_Text_Cursor *start, *end;
char *res;
start = efl_canvas_text_cursor_create(txt);
end = efl_canvas_text_cursor_create(txt);
start = efl_canvas_textblock_cursor_create(txt);
end = efl_canvas_textblock_cursor_create(txt);
efl_text_set(txt, "\n\n\n");
@ -4503,13 +4503,13 @@ EFL_START_TEST(efl_canvas_text_markup)
ck_assert_str_eq(res, "bc<br>");
free(res);
END_EFL_CANVAS_TEXT_TEST();
END_EFL_CANVAS_TEXTBLOCK_TEST();
}
EFL_END_TEST
EFL_START_TEST(efl_canvas_text_markup_invalid_escape)
EFL_START_TEST(efl_canvas_textblock_markup_invalid_escape)
{
START_EFL_CANVAS_TEXT_TEST();
START_EFL_CANVAS_TEXTBLOCK_TEST();
char * text1 = "Hello";
char * text2 = "Hello&123";
@ -4517,22 +4517,22 @@ EFL_START_TEST(efl_canvas_text_markup_invalid_escape)
Eina_Size2D fw1, fw2, fw3;
efl_text_markup_set(txt,text1);
fw1 = efl_canvas_text_size_native_get(txt);
fw1 = efl_canvas_textblock_size_native_get(txt);
efl_text_markup_set(txt,text2);
fw2 = efl_canvas_text_size_native_get(txt);
fw2 = efl_canvas_textblock_size_native_get(txt);
fail_if(fw2.w <= fw1.w);
efl_text_markup_set(txt,text3);
fw3 = efl_canvas_text_size_native_get(txt);
fw3 = efl_canvas_textblock_size_native_get(txt);
fail_if(fw3.w <= fw2.w);
END_EFL_CANVAS_TEXT_TEST();
END_EFL_CANVAS_TEXTBLOCK_TEST();
}
EFL_END_TEST
EFL_START_TEST(efl_text_font)
{
START_EFL_CANVAS_TEXT_TEST();
START_EFL_CANVAS_TEXTBLOCK_TEST();
efl_text_set(txt, "\n\n\n");
@ -4562,13 +4562,13 @@ EFL_START_TEST(efl_text_font)
fail_if(30 != font_size);
fail_if(strcmp(font,"arial"));
END_EFL_CANVAS_TEXT_TEST();
END_EFL_CANVAS_TEXTBLOCK_TEST();
}
EFL_END_TEST
EFL_START_TEST(efl_canvas_text_style)
EFL_START_TEST(efl_canvas_textblock_style)
{
START_EFL_CANVAS_TEXT_TEST();
START_EFL_CANVAS_TEXTBLOCK_TEST();
unsigned char r, g, b, a;
const char *style;
@ -4578,9 +4578,9 @@ EFL_START_TEST(efl_canvas_text_style)
efl_text_font_slant_set(txt, EFL_TEXT_FONT_SLANT_OBLIQUE);
efl_text_tabstops_set(txt, 20);
efl_canvas_text_style_apply(txt, "color=#90E135");
efl_canvas_textblock_style_apply(txt, "color=#90E135");
style = efl_canvas_text_all_styles_get(txt);
style = efl_canvas_textblock_all_styles_get(txt);
// from efl_style_buf
fail_if(!strstr(style, "font=DejaVuSans,UnDotum,malayalam"));
@ -4593,41 +4593,41 @@ EFL_START_TEST(efl_canvas_text_style)
fail_if(!strstr(style, "color=rgba(144,225,53,255)"));
fail_if(!strstr(style, "password=off"));
efl_text_password_set(txt, EINA_TRUE);
style = efl_canvas_text_all_styles_get(txt);
style = efl_canvas_textblock_all_styles_get(txt);
fail_if(!strstr(style, "password=on"));
efl_canvas_text_style_apply(txt, "font_width=ultracondensed");
efl_canvas_textblock_style_apply(txt, "font_width=ultracondensed");
ck_assert_int_eq(efl_text_font_width_get(txt), EFL_TEXT_FONT_WIDTH_ULTRACONDENSED);
efl_canvas_text_style_apply(txt, "wrap=none");
efl_canvas_textblock_style_apply(txt, "wrap=none");
ck_assert_int_eq(efl_text_wrap_get(txt), EFL_TEXT_FORMAT_WRAP_NONE);
efl_canvas_text_style_apply(txt, "backing=on");
efl_canvas_textblock_style_apply(txt, "backing=on");
ck_assert_int_eq(efl_text_backing_type_get(txt), EFL_TEXT_STYLE_BACKING_TYPE_ENABLED);
efl_canvas_text_style_apply(txt, "style=far_soft_shadow");
efl_canvas_textblock_style_apply(txt, "style=far_soft_shadow");
ck_assert_int_eq(efl_text_effect_type_get(txt), EFL_TEXT_STYLE_EFFECT_TYPE_FAR_SOFT_SHADOW);
efl_canvas_text_style_apply(txt, "style=glow,top_right");
efl_canvas_textblock_style_apply(txt, "style=glow,top_right");
ck_assert_int_eq(efl_text_effect_type_get(txt), EFL_TEXT_STYLE_EFFECT_TYPE_GLOW);
ck_assert_int_eq(efl_text_shadow_direction_get(txt), EFL_TEXT_STYLE_SHADOW_DIRECTION_TOP_RIGHT);
efl_canvas_text_style_apply(txt, "style=far_shadow,top");
efl_canvas_textblock_style_apply(txt, "style=far_shadow,top");
ck_assert_int_eq(efl_text_effect_type_get(txt), EFL_TEXT_STYLE_EFFECT_TYPE_FAR_SHADOW);
ck_assert_int_eq(efl_text_shadow_direction_get(txt), EFL_TEXT_STYLE_SHADOW_DIRECTION_TOP);
efl_canvas_text_style_apply(txt, "style=soft_outline,top,bottom");
efl_canvas_textblock_style_apply(txt, "style=soft_outline,top,bottom");
ck_assert_int_eq(efl_text_effect_type_get(txt), EFL_TEXT_STYLE_EFFECT_TYPE_SOFT_OUTLINE);
ck_assert_int_eq(efl_text_shadow_direction_get(txt), EFL_TEXT_STYLE_SHADOW_DIRECTION_BOTTOM);
efl_canvas_text_style_apply(txt, "color=#EF596C");
efl_canvas_textblock_style_apply(txt, "color=#EF596C");
efl_text_normal_color_get(txt, &r, &g, &b, &a);
ck_assert_int_eq(r, 0xEF);
ck_assert_int_eq(g, 0x59);
ck_assert_int_eq(b, 0x6C);
ck_assert_int_eq(a, 0xFF);
END_EFL_CANVAS_TEXT_TEST();
END_EFL_CANVAS_TEXTBLOCK_TEST();
}
EFL_END_TEST
@ -4659,12 +4659,12 @@ void evas_test_textblock(TCase *tc)
#endif
tcase_add_test(tc, evas_textblock_text_iface);
tcase_add_test(tc, evas_textblock_annotation);
tcase_add_test(tc, efl_canvas_text_simple);
tcase_add_test(tc, efl_canvas_textblock_simple);
tcase_add_test(tc, efl_text);
tcase_add_test(tc, efl_canvas_text_cursor);
tcase_add_test(tc, efl_canvas_text_markup);
tcase_add_test(tc, efl_canvas_text_markup_invalid_escape);
tcase_add_test(tc, efl_canvas_textblock_cursor);
tcase_add_test(tc, efl_canvas_textblock_markup);
tcase_add_test(tc, efl_canvas_textblock_markup_invalid_escape);
tcase_add_test(tc, efl_text_font);
tcase_add_test(tc, efl_canvas_text_style);
tcase_add_test(tc, efl_canvas_textblock_style);
}