2012-02-03 19:42:56 +01:00
|
|
|
/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*-
|
|
|
|
* GObject introspection: Repository
|
2008-02-08 16:31:03 +01:00
|
|
|
*
|
|
|
|
* Copyright (C) 2005 Matthias Clasen
|
2009-02-20 03:48:51 +01:00
|
|
|
* Copyright (C) 2008,2009 Red Hat, Inc.
|
2008-02-08 16:31:03 +01:00
|
|
|
*
|
|
|
|
* 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 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., 59 Temple Place - Suite 330,
|
|
|
|
* Boston, MA 02111-1307, USA.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __G_IREPOSITORY_H__
|
|
|
|
#define __G_IREPOSITORY_H__
|
|
|
|
|
|
|
|
#include <glib-object.h>
|
|
|
|
#include <gmodule.h>
|
2010-06-07 04:22:57 +02:00
|
|
|
|
|
|
|
#define __GIREPOSITORY_H_INSIDE__
|
|
|
|
|
2010-06-05 17:40:15 +02:00
|
|
|
#include <giarginfo.h>
|
2010-06-01 15:23:46 +02:00
|
|
|
#include <gibaseinfo.h>
|
2010-06-05 17:11:58 +02:00
|
|
|
#include <gicallableinfo.h>
|
2010-06-07 00:52:12 +02:00
|
|
|
#include <giconstantinfo.h>
|
2010-06-06 18:06:30 +02:00
|
|
|
#include <gienuminfo.h>
|
2010-06-06 18:11:23 +02:00
|
|
|
#include <gifieldinfo.h>
|
2010-06-01 15:23:46 +02:00
|
|
|
#include <gifunctioninfo.h>
|
2010-06-07 00:52:12 +02:00
|
|
|
#include <giinterfaceinfo.h>
|
|
|
|
#include <giobjectinfo.h>
|
|
|
|
#include <gipropertyinfo.h>
|
2010-06-07 00:28:35 +02:00
|
|
|
#include <giregisteredtypeinfo.h>
|
2010-06-07 00:52:12 +02:00
|
|
|
#include <gisignalinfo.h>
|
|
|
|
#include <gistructinfo.h>
|
2010-06-06 17:58:13 +02:00
|
|
|
#include <gitypeinfo.h>
|
2010-06-01 15:23:46 +02:00
|
|
|
#include <gitypelib.h>
|
|
|
|
#include <gitypes.h>
|
2010-06-07 00:52:12 +02:00
|
|
|
#include <giunioninfo.h>
|
2014-07-04 12:18:32 +02:00
|
|
|
#include <giversionmacros.h>
|
2010-06-07 00:52:12 +02:00
|
|
|
#include <givfuncinfo.h>
|
2018-12-14 11:21:29 +01:00
|
|
|
#include <giversion.h>
|
2008-02-08 16:31:03 +01:00
|
|
|
|
|
|
|
G_BEGIN_DECLS
|
|
|
|
|
2009-12-08 00:35:06 +01:00
|
|
|
#define G_TYPE_IREPOSITORY (g_irepository_get_type ())
|
|
|
|
#define G_IREPOSITORY(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), G_TYPE_IREPOSITORY, GIRepository))
|
|
|
|
#define G_IREPOSITORY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), G_TYPE_IREPOSITORY, GIRepositoryClass))
|
|
|
|
#define G_IS_IREPOSITORY(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), G_TYPE_IREPOSITORY))
|
|
|
|
#define G_IS_IREPOSITORY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), G_TYPE_IREPOSITORY))
|
|
|
|
#define G_IREPOSITORY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), G_TYPE_IREPOSITORY, GIRepositoryClass))
|
2008-02-08 16:31:03 +01:00
|
|
|
|
2013-10-10 22:21:18 +02:00
|
|
|
/**
|
|
|
|
* GIRepository:
|
|
|
|
*
|
|
|
|
* The GIRepository structure contains private data and should only be
|
|
|
|
* accessed using the provided API.
|
|
|
|
*/
|
2010-03-24 19:00:06 +01:00
|
|
|
typedef struct _GIRepository GIRepository;
|
|
|
|
typedef struct _GIRepositoryClass GIRepositoryClass;
|
|
|
|
typedef struct _GIRepositoryPrivate GIRepositoryPrivate;
|
2009-12-08 00:35:06 +01:00
|
|
|
|
2010-03-24 19:00:06 +01:00
|
|
|
struct _GIRepository
|
|
|
|
{
|
2008-02-08 16:31:03 +01:00
|
|
|
/*< private >*/
|
2013-10-10 22:21:18 +02:00
|
|
|
GObject parent;
|
2008-02-08 16:31:03 +01:00
|
|
|
GIRepositoryPrivate *priv;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct _GIRepositoryClass
|
2010-03-24 19:00:06 +01:00
|
|
|
{
|
2013-10-10 22:21:18 +02:00
|
|
|
/*< private >*/
|
2010-03-24 19:00:06 +01:00
|
|
|
GObjectClass parent;
|
2008-02-08 16:31:03 +01:00
|
|
|
};
|
|
|
|
|
2010-05-18 23:10:51 +02:00
|
|
|
/**
|
2012-04-03 07:47:48 +02:00
|
|
|
* GIRepositoryLoadFlags:
|
2013-10-10 22:21:18 +02:00
|
|
|
* @G_IREPOSITORY_LOAD_FLAG_LAZY: Lazily load the typelib.
|
2010-05-18 23:10:51 +02:00
|
|
|
*
|
2013-10-10 22:21:18 +02:00
|
|
|
* Flags that control how a typelib is loaded.
|
2010-05-18 23:10:51 +02:00
|
|
|
*/
|
2008-08-30 22:31:12 +02:00
|
|
|
typedef enum
|
|
|
|
{
|
|
|
|
G_IREPOSITORY_LOAD_FLAG_LAZY = 1 << 0
|
|
|
|
} GIRepositoryLoadFlags;
|
2008-02-08 16:31:03 +01:00
|
|
|
|
|
|
|
/* Repository */
|
|
|
|
|
2014-07-04 12:18:32 +02:00
|
|
|
GI_AVAILABLE_IN_ALL
|
2008-02-08 16:31:03 +01:00
|
|
|
GType g_irepository_get_type (void) G_GNUC_CONST;
|
2014-07-04 12:18:32 +02:00
|
|
|
|
|
|
|
GI_AVAILABLE_IN_ALL
|
2008-02-08 16:31:03 +01:00
|
|
|
GIRepository *g_irepository_get_default (void);
|
2014-07-04 12:18:32 +02:00
|
|
|
|
|
|
|
GI_AVAILABLE_IN_ALL
|
2008-08-30 22:31:07 +02:00
|
|
|
void g_irepository_prepend_search_path (const char *directory);
|
2014-07-04 12:18:32 +02:00
|
|
|
|
|
|
|
GI_AVAILABLE_IN_1_36
|
2013-02-22 01:50:48 +01:00
|
|
|
void g_irepository_prepend_library_path (const char *directory);
|
2014-07-04 12:18:32 +02:00
|
|
|
|
|
|
|
GI_AVAILABLE_IN_ALL
|
2008-11-12 13:40:34 +01:00
|
|
|
GSList * g_irepository_get_search_path (void);
|
2014-07-04 12:18:32 +02:00
|
|
|
|
|
|
|
GI_AVAILABLE_IN_ALL
|
2008-08-30 22:31:07 +02:00
|
|
|
const char * g_irepository_load_typelib (GIRepository *repository,
|
2010-08-31 22:36:06 +02:00
|
|
|
GITypelib *typelib,
|
2008-08-30 22:31:12 +02:00
|
|
|
GIRepositoryLoadFlags flags,
|
2008-08-30 22:31:07 +02:00
|
|
|
GError **error);
|
2014-07-04 12:18:32 +02:00
|
|
|
|
|
|
|
GI_AVAILABLE_IN_ALL
|
2008-10-13 18:59:09 +02:00
|
|
|
gboolean g_irepository_is_registered (GIRepository *repository,
|
2009-02-10 22:01:08 +01:00
|
|
|
const gchar *namespace_,
|
2008-10-12 06:51:48 +02:00
|
|
|
const gchar *version);
|
2014-07-04 12:18:32 +02:00
|
|
|
|
|
|
|
GI_AVAILABLE_IN_ALL
|
2008-02-08 16:31:03 +01:00
|
|
|
GIBaseInfo * g_irepository_find_by_name (GIRepository *repository,
|
2009-02-10 22:01:08 +01:00
|
|
|
const gchar *namespace_,
|
2008-02-08 16:31:03 +01:00
|
|
|
const gchar *name);
|
2014-07-04 12:18:32 +02:00
|
|
|
|
|
|
|
GI_AVAILABLE_IN_ALL
|
2010-07-28 13:52:05 +02:00
|
|
|
GList * g_irepository_enumerate_versions (GIRepository *repository,
|
|
|
|
const gchar *namespace_);
|
2014-07-04 12:18:32 +02:00
|
|
|
|
|
|
|
GI_AVAILABLE_IN_ALL
|
2010-08-31 22:36:06 +02:00
|
|
|
GITypelib * g_irepository_require (GIRepository *repository,
|
2009-02-10 22:01:08 +01:00
|
|
|
const gchar *namespace_,
|
2008-10-13 18:59:09 +02:00
|
|
|
const gchar *version,
|
2008-08-30 22:31:12 +02:00
|
|
|
GIRepositoryLoadFlags flags,
|
2008-08-21 01:56:40 +02:00
|
|
|
GError **error);
|
2014-07-04 12:18:32 +02:00
|
|
|
|
|
|
|
GI_AVAILABLE_IN_ALL
|
2010-08-31 22:36:06 +02:00
|
|
|
GITypelib * g_irepository_require_private (GIRepository *repository,
|
2010-07-30 20:38:34 +02:00
|
|
|
const gchar *typelib_dir,
|
2010-12-28 10:41:16 +01:00
|
|
|
const gchar *namespace_,
|
2010-07-30 20:38:34 +02:00
|
|
|
const gchar *version,
|
|
|
|
GIRepositoryLoadFlags flags,
|
|
|
|
GError **error);
|
2014-07-04 12:18:32 +02:00
|
|
|
|
2015-01-31 23:48:56 +01:00
|
|
|
GI_AVAILABLE_IN_1_44
|
|
|
|
gchar ** g_irepository_get_immediate_dependencies (GIRepository *repository,
|
|
|
|
const gchar *namespace_);
|
|
|
|
|
2014-07-04 12:18:32 +02:00
|
|
|
GI_AVAILABLE_IN_ALL
|
2008-08-30 22:31:07 +02:00
|
|
|
gchar ** g_irepository_get_dependencies (GIRepository *repository,
|
2009-02-10 22:01:08 +01:00
|
|
|
const gchar *namespace_);
|
2014-07-04 12:18:32 +02:00
|
|
|
|
|
|
|
GI_AVAILABLE_IN_ALL
|
2008-10-12 06:51:48 +02:00
|
|
|
gchar ** g_irepository_get_loaded_namespaces (GIRepository *repository);
|
2014-07-04 12:18:32 +02:00
|
|
|
|
|
|
|
GI_AVAILABLE_IN_ALL
|
2008-02-08 16:31:03 +01:00
|
|
|
GIBaseInfo * g_irepository_find_by_gtype (GIRepository *repository,
|
|
|
|
GType gtype);
|
2014-07-04 12:18:32 +02:00
|
|
|
|
2010-10-23 00:08:15 +02:00
|
|
|
GI_AVAILABLE_IN_1_60
|
|
|
|
void g_irepository_get_object_gtype_interfaces (GIRepository *repository,
|
|
|
|
GType gtype,
|
|
|
|
guint *n_interfaces_out,
|
2019-06-20 09:18:13 +02:00
|
|
|
GIInterfaceInfo ***interfaces_out);
|
2010-10-23 00:08:15 +02:00
|
|
|
|
2014-07-04 12:18:32 +02:00
|
|
|
GI_AVAILABLE_IN_ALL
|
2008-02-08 16:31:03 +01:00
|
|
|
gint g_irepository_get_n_infos (GIRepository *repository,
|
2009-02-10 22:01:08 +01:00
|
|
|
const gchar *namespace_);
|
2014-07-04 12:18:32 +02:00
|
|
|
|
|
|
|
GI_AVAILABLE_IN_ALL
|
2008-02-08 16:31:03 +01:00
|
|
|
GIBaseInfo * g_irepository_get_info (GIRepository *repository,
|
2009-02-10 22:01:08 +01:00
|
|
|
const gchar *namespace_,
|
2008-02-08 16:31:03 +01:00
|
|
|
gint index);
|
2014-07-04 12:18:32 +02:00
|
|
|
|
|
|
|
GI_AVAILABLE_IN_ALL
|
2011-05-19 23:46:36 +02:00
|
|
|
GIEnumInfo * g_irepository_find_by_error_domain (GIRepository *repository,
|
|
|
|
GQuark domain);
|
2014-07-04 12:18:32 +02:00
|
|
|
|
|
|
|
GI_AVAILABLE_IN_ALL
|
2008-08-21 05:06:13 +02:00
|
|
|
const gchar * g_irepository_get_typelib_path (GIRepository *repository,
|
2009-02-10 22:01:08 +01:00
|
|
|
const gchar *namespace_);
|
2014-07-04 12:18:32 +02:00
|
|
|
GI_AVAILABLE_IN_ALL
|
2008-02-08 16:31:03 +01:00
|
|
|
const gchar * g_irepository_get_shared_library (GIRepository *repository,
|
2009-02-10 22:01:08 +01:00
|
|
|
const gchar *namespace_);
|
2014-07-04 12:18:32 +02:00
|
|
|
GI_AVAILABLE_IN_ALL
|
2009-02-13 00:42:47 +01:00
|
|
|
const gchar * g_irepository_get_c_prefix (GIRepository *repository,
|
|
|
|
const gchar *namespace_);
|
2014-07-04 12:18:32 +02:00
|
|
|
GI_AVAILABLE_IN_ALL
|
2008-10-12 06:51:48 +02:00
|
|
|
const gchar * g_irepository_get_version (GIRepository *repository,
|
2009-02-10 22:01:08 +01:00
|
|
|
const gchar *namespace_);
|
2008-10-12 06:51:48 +02:00
|
|
|
|
2014-07-04 12:18:32 +02:00
|
|
|
|
|
|
|
GI_AVAILABLE_IN_ALL
|
2008-11-13 20:57:09 +01:00
|
|
|
GOptionGroup * g_irepository_get_option_group (void);
|
|
|
|
|
2014-07-04 12:18:32 +02:00
|
|
|
|
|
|
|
GI_AVAILABLE_IN_ALL
|
2008-11-13 20:57:09 +01:00
|
|
|
gboolean g_irepository_dump (const char *arg, GError **error);
|
|
|
|
|
2010-05-18 23:10:51 +02:00
|
|
|
/**
|
|
|
|
* GIRepositoryError:
|
|
|
|
* @G_IREPOSITORY_ERROR_TYPELIB_NOT_FOUND: the typelib could not be found.
|
|
|
|
* @G_IREPOSITORY_ERROR_NAMESPACE_MISMATCH: the namespace does not match the
|
2013-10-10 22:21:18 +02:00
|
|
|
* requested namespace.
|
2010-05-18 23:10:51 +02:00
|
|
|
* @G_IREPOSITORY_ERROR_NAMESPACE_VERSION_CONFLICT: the version of the
|
2013-10-10 22:21:18 +02:00
|
|
|
* typelib does not match the requested version.
|
2010-05-18 23:10:51 +02:00
|
|
|
* @G_IREPOSITORY_ERROR_LIBRARY_NOT_FOUND: the library used by the typelib
|
2013-10-10 22:21:18 +02:00
|
|
|
* could not be found.
|
|
|
|
*
|
|
|
|
* An error code used with #G_IREPOSITORY_ERROR in a #GError returned
|
|
|
|
* from a #GIRepository routine.
|
2010-05-18 23:10:51 +02:00
|
|
|
*/
|
2008-02-08 16:31:03 +01:00
|
|
|
typedef enum
|
|
|
|
{
|
2008-08-09 14:55:32 +02:00
|
|
|
G_IREPOSITORY_ERROR_TYPELIB_NOT_FOUND,
|
2008-02-08 16:31:03 +01:00
|
|
|
G_IREPOSITORY_ERROR_NAMESPACE_MISMATCH,
|
2008-10-12 06:51:48 +02:00
|
|
|
G_IREPOSITORY_ERROR_NAMESPACE_VERSION_CONFLICT,
|
2008-02-08 16:31:03 +01:00
|
|
|
G_IREPOSITORY_ERROR_LIBRARY_NOT_FOUND
|
|
|
|
} GIRepositoryError;
|
|
|
|
|
2013-10-10 22:21:18 +02:00
|
|
|
/**
|
|
|
|
* G_IREPOSITORY_ERROR:
|
|
|
|
*
|
|
|
|
* Error domain for #GIRepository. Errors in this domain will be from the
|
|
|
|
* #GIRepositoryError enumeration. See #GError for more information on
|
|
|
|
* error domains.
|
|
|
|
*/
|
2008-02-08 16:31:03 +01:00
|
|
|
#define G_IREPOSITORY_ERROR (g_irepository_error_quark ())
|
|
|
|
|
2014-07-04 12:18:32 +02:00
|
|
|
GI_AVAILABLE_IN_ALL
|
2008-02-08 16:31:03 +01:00
|
|
|
GQuark g_irepository_error_quark (void);
|
|
|
|
|
|
|
|
|
2009-01-12 22:31:43 +01:00
|
|
|
/* Global utility functions */
|
|
|
|
|
2014-07-04 12:18:32 +02:00
|
|
|
GI_AVAILABLE_IN_ALL
|
2009-01-12 22:31:43 +01:00
|
|
|
void gi_cclosure_marshal_generic (GClosure *closure,
|
|
|
|
GValue *return_gvalue,
|
|
|
|
guint n_param_values,
|
|
|
|
const GValue *param_values,
|
|
|
|
gpointer invocation_hint,
|
|
|
|
gpointer marshal_data);
|
|
|
|
|
2008-02-08 16:31:03 +01:00
|
|
|
G_END_DECLS
|
|
|
|
|
2010-05-31 22:41:45 +02:00
|
|
|
|
2008-02-08 16:31:03 +01:00
|
|
|
#endif /* __G_IREPOSITORY_H__ */
|
|
|
|
|