elocation: remove beta library

This has never been fully finished or really used. The GeoClue project
dbus API moved on to a newer version as well. We still have it marked as
beta so we should take the chance and get rid of it to cleanup our tree
a little bit.

Reviewed-by: Chris Michael <cp.michael@samsung.com>
Reviewed-by: Vincent Torri <vincent.torri@gmail.com>
Differential Revision: https://phab.enlightenment.org/D10788
devs/xartigas/eolian_mono_list_formatting
Stefan Schmidt 3 years ago
parent 431f3b1fce
commit 4ff8fb140c
  1. 1
      doc/elementary_examples.dox
  2. 226
      doc/elementary_examples_cxx.dox
  3. 1
      doc/main.dox
  4. 3
      meson.build
  5. 151
      src/examples/elementary/location_example_01.c
  6. 1
      src/examples/elementary/meson.build
  7. 1
      src/examples/elocation/.gitignore
  8. 167
      src/examples/elocation/elocation.c
  9. 4
      src/lib/elementary/Elementary.h
  10. 4
      src/lib/elementary/Elementary_Options.h.in
  11. 17
      src/lib/elementary/elm_deprecated.h
  12. 21
      src/lib/elementary/elm_main.c
  13. 15
      src/lib/elementary/elm_need.h
  14. 3
      src/lib/elementary/meson.build
  15. 433
      src/lib/elocation/Elocation.h
  16. 1414
      src/lib/elocation/elocation.c
  17. 186
      src/lib/elocation/elocation_private.h
  18. 448
      src/lib/elocation/gen/eldbus_geo_clue2_client.c
  19. 36
      src/lib/elocation/gen/eldbus_geo_clue2_client.h
  20. 246
      src/lib/elocation/gen/eldbus_geo_clue2_location.c
  21. 22
      src/lib/elocation/gen/eldbus_geo_clue2_location.h
  22. 209
      src/lib/elocation/gen/eldbus_geo_clue2_manager.c
  23. 23
      src/lib/elocation/gen/eldbus_geo_clue2_manager.h
  24. 24
      src/lib/elocation/gen/eldbus_utils.h
  25. 5
      src/lib/elocation/gen/meson.build
  26. 199
      src/lib/elocation/gen/org.freedesktop.GeoClue2.xml
  27. 28
      src/lib/elocation/meson.build
  28. 235
      src/tests/elocation/elocation_suite.c

@ -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
*/

@ -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

@ -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>.

@ -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'], []],

@ -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()

@ -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',

@ -1 +0,0 @@
/elocation

@ -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;
}

@ -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

@ -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

@ -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);

@ -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();

@ -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
*

@ -952,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()
@ -967,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')

@ -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

@ -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

@ -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;