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>
|
|
|
|
#include <givfuncinfo.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
|
|
|
|
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
|
|
|
|
{
|
2009-12-08 00:35:06 +01:00
|
|
|
GObject parent;
|
2008-02-08 16:31:03 +01:00
|
|
|
|
|
|
|
/*< private >*/
|
|
|
|
GIRepositoryPrivate *priv;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct _GIRepositoryClass
|
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:
|
2010-05-18 23:10:51 +02:00
|
|
|
* @G_IREPOSITORY_LOAD_FLAG_LAZY: Load the types lazily.
|
|
|
|
*
|
|
|
|
* Flags that controlls how a typelib is loaded by
|
|
|
|
* GIRepositry, used by g_irepository_load_typelib().
|
|
|
|
*/
|
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 */
|
|
|
|
|
|
|
|
GType g_irepository_get_type (void) G_GNUC_CONST;
|
|
|
|
GIRepository *g_irepository_get_default (void);
|
2008-08-30 22:31:07 +02:00
|
|
|
void g_irepository_prepend_search_path (const char *directory);
|
2013-02-22 01:50:48 +01:00
|
|
|
void g_irepository_prepend_library_path (const char *directory);
|
2008-11-12 13:40:34 +01:00
|
|
|
GSList * g_irepository_get_search_path (void);
|
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);
|
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);
|
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);
|
2010-07-28 13:52:05 +02:00
|
|
|
GList * g_irepository_enumerate_versions (GIRepository *repository,
|
|
|
|
const gchar *namespace_);
|
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);
|
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);
|
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_);
|
2008-10-12 06:51:48 +02:00
|
|
|
gchar ** g_irepository_get_loaded_namespaces (GIRepository *repository);
|
2008-02-08 16:31:03 +01:00
|
|
|
GIBaseInfo * g_irepository_find_by_gtype (GIRepository *repository,
|
|
|
|
GType gtype);
|
|
|
|
gint g_irepository_get_n_infos (GIRepository *repository,
|
2009-02-10 22:01:08 +01:00
|
|
|
const gchar *namespace_);
|
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);
|
2011-05-19 23:46:36 +02:00
|
|
|
GIEnumInfo * g_irepository_find_by_error_domain (GIRepository *repository,
|
|
|
|
GQuark domain);
|
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_);
|
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_);
|
2009-02-13 00:42:47 +01:00
|
|
|
const gchar * g_irepository_get_c_prefix (GIRepository *repository,
|
|
|
|
const gchar *namespace_);
|
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
|
|
|
|
2008-11-13 20:57:09 +01:00
|
|
|
GOptionGroup * g_irepository_get_option_group (void);
|
|
|
|
|
|
|
|
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
|
|
|
|
* requested namespace.
|
|
|
|
* @G_IREPOSITORY_ERROR_NAMESPACE_VERSION_CONFLICT: the version of the
|
|
|
|
* typelib does not match the requested version.
|
|
|
|
* @G_IREPOSITORY_ERROR_LIBRARY_NOT_FOUND: the library used by the typelib
|
|
|
|
* could not be found.
|
|
|
|
*/
|
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;
|
|
|
|
|
|
|
|
#define G_IREPOSITORY_ERROR (g_irepository_error_quark ())
|
|
|
|
|
|
|
|
GQuark g_irepository_error_quark (void);
|
|
|
|
|
|
|
|
|
2009-01-12 22:31:43 +01:00
|
|
|
/* Global utility functions */
|
|
|
|
|
|
|
|
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__ */
|
|
|
|
|