Commit 6e2450bb authored by Zeeshan Ali's avatar Zeeshan Ali

lib: Add GClueSimple API

Add new convenience API that does not only make it easy to fetch a
location quickly but also makes it easy to listen to location updates
(by providing a GClueLocationProxy instance, rather than a D-Bus object
path).
parent d06fbf06
......@@ -63,6 +63,7 @@
<chapter>
<title>Convenient helpers</title>
<xi:include href="xml/gclue-helpers.xml"/>
<xi:include href="xml/gclue-simple.xml"/>
</chapter>
<chapter>
......
......@@ -230,3 +230,25 @@ gclue_manager_proxy_get_type
<SUBSECTION Private>
GClueManagerProxyPrivate
</SECTION>
<SECTION>
<SECTION>
<FILE>gclue-simple</FILE>
<TITLE>GClueSimple</TITLE>
gclue_simple_new
gclue_simple_new_finish
gclue_simple_new_sync
gclue_simple_get_client
gclue_simple_get_location
<SUBSECTION Standard>
GCLUE_IS_SIMPLE
GCLUE_IS_SIMPLE_CLASS
GCLUE_SIMPLE
GCLUE_SIMPLE_CLASS
GCLUE_SIMPLE_GET_CLASS
GCLUE_TYPE_SIMPLE
GClueSimple
GClueSimpleClass
GClueSimplePrivate
gclue_simple_get_type
</SECTION>
......@@ -47,6 +47,7 @@ geoclue_include_HEADERS = geoclue.h \
gclue-location.h \
gclue-manager.h \
gclue-helpers.h \
gclue-simple.h \
$(NULL)
AM_CPPFLAGS = $(LIBGEOCLUE_CFLAGS) \
......@@ -66,6 +67,7 @@ libgeoclue_2_la_SOURCES = \
gclue-location.c \
gclue-manager.c \
gclue-helpers.c \
gclue-simple.c \
$(NULL)
libgeoclue_2_la_LIBADD = \
......
This diff is collapsed.
/* vim: set et ts=8 sw=8: */
/*
* Geoclue convenience library.
*
* Copyright (C) 2015 Red Hat, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*
* Author: Zeeshan Ali (Khattak) <zeeshanak@gnome.org>
*/
#ifndef GCLUE_SIMPLE_H
#define GCLUE_SIMPLE_H
#include <glib-object.h>
#include <gio/gio.h>
#include "gclue-client.h"
#include "gclue-location.h"
#include "gclue-enum-types.h"
G_BEGIN_DECLS
#define GCLUE_TYPE_SIMPLE (gclue_simple_get_type())
#define GCLUE_SIMPLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GCLUE_TYPE_SIMPLE, GClueSimple))
#define GCLUE_SIMPLE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GCLUE_TYPE_SIMPLE, GClueSimpleClass))
#define GCLUE_IS_SIMPLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GCLUE_TYPE_SIMPLE))
#define GCLUE_IS_SIMPLE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GCLUE_TYPE_SIMPLE))
#define GCLUE_SIMPLE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GCLUE_TYPE_SIMPLE, GClueSimpleClass))
typedef struct _GClueSimple GClueSimple;
typedef struct _GClueSimpleClass GClueSimpleClass;
typedef struct _GClueSimplePrivate GClueSimplePrivate;
struct _GClueSimple
{
GObject parent;
/*< private >*/
GClueSimplePrivate *priv;
};
struct _GClueSimpleClass
{
GObjectClass parent_class;
};
GType gclue_simple_get_type (void) G_GNUC_CONST;
void gclue_simple_new (const char *desktop_id,
GClueAccuracyLevel accuracy_level,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer user_data);
GClueSimple * gclue_simple_new_finish (GAsyncResult *result,
GError **error);
GClueSimple * gclue_simple_new_sync (const char *desktop_id,
GClueAccuracyLevel accuracy_level,
GCancellable *cancellable,
GError **error);
GClueClient * gclue_simple_get_client (GClueSimple *simple);
GClueLocation * gclue_simple_get_location (GClueSimple *simple);
G_END_DECLS
#endif /* GCLUE_SIMPLE_H */
......@@ -32,5 +32,6 @@
#include <gclue-location.h>
#include <gclue-manager.h>
#include <gclue-helpers.h>
#include <gclue-simple.h>
#endif /* __GEOCLUE_H__ */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment