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
|
|
|
*
|
2023-10-25 18:10:10 +02:00
|
|
|
* SPDX-License-Identifier: LGPL-2.1-or-later
|
|
|
|
*
|
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.
|
|
|
|
*/
|
|
|
|
|
2023-11-07 19:23:17 +01:00
|
|
|
#pragma once
|
2008-02-08 16:31:03 +01:00
|
|
|
|
|
|
|
#include <glib-object.h>
|
|
|
|
#include <gmodule.h>
|
2010-06-07 04:22:57 +02:00
|
|
|
|
2023-10-25 18:12:29 +02:00
|
|
|
#include <girepository/gi-visibility.h>
|
2023-10-16 16:24:08 +02:00
|
|
|
|
2010-06-07 04:22:57 +02:00
|
|
|
#define __GIREPOSITORY_H_INSIDE__
|
|
|
|
|
2023-10-25 18:12:29 +02:00
|
|
|
#include <girepository/giarginfo.h>
|
|
|
|
#include <girepository/gibaseinfo.h>
|
|
|
|
#include <girepository/gicallableinfo.h>
|
2023-11-28 18:24:20 +01:00
|
|
|
#include <girepository/gicallbackinfo.h>
|
2023-10-25 18:12:29 +02:00
|
|
|
#include <girepository/giconstantinfo.h>
|
|
|
|
#include <girepository/gienuminfo.h>
|
|
|
|
#include <girepository/gifieldinfo.h>
|
|
|
|
#include <girepository/gifunctioninfo.h>
|
|
|
|
#include <girepository/giinterfaceinfo.h>
|
|
|
|
#include <girepository/giobjectinfo.h>
|
|
|
|
#include <girepository/gipropertyinfo.h>
|
|
|
|
#include <girepository/giregisteredtypeinfo.h>
|
|
|
|
#include <girepository/gisignalinfo.h>
|
|
|
|
#include <girepository/gistructinfo.h>
|
|
|
|
#include <girepository/gitypeinfo.h>
|
|
|
|
#include <girepository/gitypelib.h>
|
|
|
|
#include <girepository/gitypes.h>
|
|
|
|
#include <girepository/giunioninfo.h>
|
2023-11-28 18:24:20 +01:00
|
|
|
#include <girepository/giunresolvedinfo.h>
|
2023-10-25 18:12:29 +02:00
|
|
|
#include <girepository/givfuncinfo.h>
|
2008-02-08 16:31:03 +01:00
|
|
|
|
|
|
|
G_BEGIN_DECLS
|
|
|
|
|
2023-11-08 15:17:52 +01:00
|
|
|
#define GI_TYPE_REPOSITORY (gi_repository_get_type ())
|
|
|
|
#define GI_REPOSITORY(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), GI_TYPE_REPOSITORY, GIRepository))
|
|
|
|
#define GI_REPOSITORY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GI_TYPE_REPOSITORY, GIRepositoryClass))
|
|
|
|
#define GI_IS_REPOSITORY(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), GI_TYPE_REPOSITORY))
|
|
|
|
#define GI_IS_REPOSITORY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GI_TYPE_REPOSITORY))
|
|
|
|
#define GI_REPOSITORY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GI_TYPE_REPOSITORY, 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
|
|
|
|
{
|
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:
|
2023-11-08 15:17:52 +01:00
|
|
|
* @GI_REPOSITORY_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.
|
2023-12-13 14:24:40 +01:00
|
|
|
*
|
|
|
|
* Since: 2.80
|
2010-05-18 23:10:51 +02:00
|
|
|
*/
|
2008-08-30 22:31:12 +02:00
|
|
|
typedef enum
|
|
|
|
{
|
2023-11-08 15:17:52 +01:00
|
|
|
GI_REPOSITORY_LOAD_FLAG_LAZY = 1 << 0
|
2008-08-30 22:31:12 +02:00
|
|
|
} GIRepositoryLoadFlags;
|
2008-02-08 16:31:03 +01:00
|
|
|
|
|
|
|
/* Repository */
|
|
|
|
|
2014-07-04 12:18:32 +02:00
|
|
|
GI_AVAILABLE_IN_ALL
|
2023-11-08 15:17:52 +01:00
|
|
|
GType gi_repository_get_type (void) G_GNUC_CONST;
|
2014-07-04 12:18:32 +02:00
|
|
|
|
|
|
|
GI_AVAILABLE_IN_ALL
|
2023-11-08 15:17:52 +01:00
|
|
|
GIRepository *gi_repository_get_default (void);
|
2014-07-04 12:18:32 +02:00
|
|
|
|
2023-11-24 00:22:55 +01:00
|
|
|
GI_AVAILABLE_IN_ALL
|
|
|
|
GIRepository *gi_repository_new (void);
|
|
|
|
|
2014-07-04 12:18:32 +02:00
|
|
|
GI_AVAILABLE_IN_ALL
|
2023-11-08 15:17:52 +01:00
|
|
|
void gi_repository_prepend_search_path (const char *directory);
|
2014-07-04 12:18:32 +02:00
|
|
|
|
2023-11-08 01:02:12 +01:00
|
|
|
GI_AVAILABLE_IN_ALL
|
2023-11-08 15:17:52 +01:00
|
|
|
void gi_repository_prepend_library_path (const char *directory);
|
2014-07-04 12:18:32 +02:00
|
|
|
|
|
|
|
GI_AVAILABLE_IN_ALL
|
2023-11-08 15:17:52 +01:00
|
|
|
GSList * gi_repository_get_search_path (void);
|
2014-07-04 12:18:32 +02:00
|
|
|
|
|
|
|
GI_AVAILABLE_IN_ALL
|
2023-11-08 15:17:52 +01:00
|
|
|
const char * gi_repository_load_typelib (GIRepository *repository,
|
|
|
|
GITypelib *typelib,
|
|
|
|
GIRepositoryLoadFlags flags,
|
|
|
|
GError **error);
|
2014-07-04 12:18:32 +02:00
|
|
|
|
|
|
|
GI_AVAILABLE_IN_ALL
|
2023-11-08 15:17:52 +01:00
|
|
|
gboolean gi_repository_is_registered (GIRepository *repository,
|
|
|
|
const gchar *namespace_,
|
|
|
|
const gchar *version);
|
2014-07-04 12:18:32 +02:00
|
|
|
|
|
|
|
GI_AVAILABLE_IN_ALL
|
2023-11-08 15:17:52 +01:00
|
|
|
GIBaseInfo * gi_repository_find_by_name (GIRepository *repository,
|
|
|
|
const gchar *namespace_,
|
|
|
|
const gchar *name);
|
2014-07-04 12:18:32 +02:00
|
|
|
|
|
|
|
GI_AVAILABLE_IN_ALL
|
2023-11-08 15:17:52 +01:00
|
|
|
GList * gi_repository_enumerate_versions (GIRepository *repository,
|
|
|
|
const gchar *namespace_);
|
2014-07-04 12:18:32 +02:00
|
|
|
|
|
|
|
GI_AVAILABLE_IN_ALL
|
2023-11-08 15:17:52 +01:00
|
|
|
GITypelib * gi_repository_require (GIRepository *repository,
|
|
|
|
const gchar *namespace_,
|
|
|
|
const gchar *version,
|
|
|
|
GIRepositoryLoadFlags flags,
|
|
|
|
GError **error);
|
2014-07-04 12:18:32 +02:00
|
|
|
|
|
|
|
GI_AVAILABLE_IN_ALL
|
2023-11-08 15:17:52 +01:00
|
|
|
GITypelib * gi_repository_require_private (GIRepository *repository,
|
|
|
|
const gchar *typelib_dir,
|
|
|
|
const gchar *namespace_,
|
|
|
|
const gchar *version,
|
|
|
|
GIRepositoryLoadFlags flags,
|
|
|
|
GError **error);
|
2014-07-04 12:18:32 +02:00
|
|
|
|
2023-11-08 01:02:12 +01:00
|
|
|
GI_AVAILABLE_IN_ALL
|
2023-11-08 15:17:52 +01:00
|
|
|
gchar ** gi_repository_get_immediate_dependencies (GIRepository *repository,
|
2015-01-31 23:48:56 +01:00
|
|
|
const gchar *namespace_);
|
|
|
|
|
2014-07-04 12:18:32 +02:00
|
|
|
GI_AVAILABLE_IN_ALL
|
2023-11-08 15:17:52 +01:00
|
|
|
gchar ** gi_repository_get_dependencies (GIRepository *repository,
|
|
|
|
const gchar *namespace_);
|
2014-07-04 12:18:32 +02:00
|
|
|
|
|
|
|
GI_AVAILABLE_IN_ALL
|
2023-11-08 15:17:52 +01:00
|
|
|
gchar ** gi_repository_get_loaded_namespaces (GIRepository *repository);
|
2014-07-04 12:18:32 +02:00
|
|
|
|
|
|
|
GI_AVAILABLE_IN_ALL
|
2023-11-08 15:17:52 +01:00
|
|
|
GIBaseInfo * gi_repository_find_by_gtype (GIRepository *repository,
|
|
|
|
GType gtype);
|
2014-07-04 12:18:32 +02:00
|
|
|
|
2023-11-08 01:02:12 +01:00
|
|
|
GI_AVAILABLE_IN_ALL
|
2023-11-08 15:17:52 +01:00
|
|
|
void gi_repository_get_object_gtype_interfaces (GIRepository *repository,
|
2010-10-23 00:08:15 +02:00
|
|
|
GType gtype,
|
2023-12-12 19:12:17 +01:00
|
|
|
gsize *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
|
2023-12-12 19:12:17 +01:00
|
|
|
guint gi_repository_get_n_infos (GIRepository *repository,
|
2023-11-08 15:17:52 +01:00
|
|
|
const gchar *namespace_);
|
2014-07-04 12:18:32 +02:00
|
|
|
|
|
|
|
GI_AVAILABLE_IN_ALL
|
2023-11-08 15:17:52 +01:00
|
|
|
GIBaseInfo * gi_repository_get_info (GIRepository *repository,
|
|
|
|
const gchar *namespace_,
|
2023-12-12 19:12:17 +01:00
|
|
|
guint idx);
|
2014-07-04 12:18:32 +02:00
|
|
|
|
|
|
|
GI_AVAILABLE_IN_ALL
|
2023-11-08 15:17:52 +01:00
|
|
|
GIEnumInfo * gi_repository_find_by_error_domain (GIRepository *repository,
|
|
|
|
GQuark domain);
|
2014-07-04 12:18:32 +02:00
|
|
|
|
|
|
|
GI_AVAILABLE_IN_ALL
|
2023-11-08 15:17:52 +01:00
|
|
|
const gchar * gi_repository_get_typelib_path (GIRepository *repository,
|
|
|
|
const gchar *namespace_);
|
2014-07-04 12:18:32 +02:00
|
|
|
GI_AVAILABLE_IN_ALL
|
2023-11-08 15:17:52 +01:00
|
|
|
const gchar * gi_repository_get_shared_library (GIRepository *repository,
|
|
|
|
const gchar *namespace_);
|
2014-07-04 12:18:32 +02:00
|
|
|
GI_AVAILABLE_IN_ALL
|
2023-11-08 15:17:52 +01:00
|
|
|
const gchar * gi_repository_get_c_prefix (GIRepository *repository,
|
2009-02-13 00:42:47 +01:00
|
|
|
const gchar *namespace_);
|
2014-07-04 12:18:32 +02:00
|
|
|
GI_AVAILABLE_IN_ALL
|
2023-11-08 15:17:52 +01:00
|
|
|
const gchar * gi_repository_get_version (GIRepository *repository,
|
|
|
|
const gchar *namespace_);
|
2008-10-12 06:51:48 +02:00
|
|
|
|
2014-07-04 12:18:32 +02:00
|
|
|
|
|
|
|
GI_AVAILABLE_IN_ALL
|
2023-11-08 15:17:52 +01:00
|
|
|
GOptionGroup * gi_repository_get_option_group (void);
|
2008-11-13 20:57:09 +01:00
|
|
|
|
2014-07-04 12:18:32 +02:00
|
|
|
|
|
|
|
GI_AVAILABLE_IN_ALL
|
2023-12-12 23:43:11 +01:00
|
|
|
gboolean gi_repository_dump (const char *input_filename,
|
|
|
|
const char *output_filename,
|
|
|
|
GError **error);
|
2008-11-13 20:57:09 +01:00
|
|
|
|
2010-05-18 23:10:51 +02:00
|
|
|
/**
|
|
|
|
* GIRepositoryError:
|
2023-11-08 15:17:52 +01:00
|
|
|
* @GI_REPOSITORY_ERROR_TYPELIB_NOT_FOUND: the typelib could not be found.
|
|
|
|
* @GI_REPOSITORY_ERROR_NAMESPACE_MISMATCH: the namespace does not match the
|
2013-10-10 22:21:18 +02:00
|
|
|
* requested namespace.
|
2023-11-08 15:17:52 +01:00
|
|
|
* @GI_REPOSITORY_ERROR_NAMESPACE_VERSION_CONFLICT: the version of the
|
2013-10-10 22:21:18 +02:00
|
|
|
* typelib does not match the requested version.
|
2023-11-08 15:17:52 +01:00
|
|
|
* @GI_REPOSITORY_ERROR_LIBRARY_NOT_FOUND: the library used by the typelib
|
2013-10-10 22:21:18 +02:00
|
|
|
* could not be found.
|
|
|
|
*
|
2023-12-13 14:24:40 +01:00
|
|
|
* An error code used with `GI_REPOSITORY_ERROR` in a [type@GLib.Error]
|
|
|
|
* returned from a [class@GIRepository.Repository] routine.
|
|
|
|
*
|
|
|
|
* Since: 2.80
|
2010-05-18 23:10:51 +02:00
|
|
|
*/
|
2008-02-08 16:31:03 +01:00
|
|
|
typedef enum
|
|
|
|
{
|
2023-11-08 15:17:52 +01:00
|
|
|
GI_REPOSITORY_ERROR_TYPELIB_NOT_FOUND,
|
|
|
|
GI_REPOSITORY_ERROR_NAMESPACE_MISMATCH,
|
|
|
|
GI_REPOSITORY_ERROR_NAMESPACE_VERSION_CONFLICT,
|
|
|
|
GI_REPOSITORY_ERROR_LIBRARY_NOT_FOUND
|
2008-02-08 16:31:03 +01:00
|
|
|
} GIRepositoryError;
|
|
|
|
|
2013-10-10 22:21:18 +02:00
|
|
|
/**
|
2023-11-08 15:17:52 +01:00
|
|
|
* GI_REPOSITORY_ERROR:
|
2013-10-10 22:21:18 +02:00
|
|
|
*
|
2023-12-13 14:24:40 +01:00
|
|
|
* Error domain for [class@GIRepository.Repository].
|
|
|
|
*
|
|
|
|
* Errors in this domain will be from the [enum@GIRepository.Error] enumeration.
|
|
|
|
* See [type@GLib.Error] for more information on error domains.
|
|
|
|
*
|
|
|
|
* Since: 2.80
|
2013-10-10 22:21:18 +02:00
|
|
|
*/
|
2023-11-08 15:17:52 +01:00
|
|
|
#define GI_REPOSITORY_ERROR (gi_repository_error_quark ())
|
2008-02-08 16:31:03 +01:00
|
|
|
|
2014-07-04 12:18:32 +02:00
|
|
|
GI_AVAILABLE_IN_ALL
|
2023-11-08 15:17:52 +01:00
|
|
|
GQuark gi_repository_error_quark (void);
|
2008-02-08 16:31:03 +01:00
|
|
|
|
|
|
|
|
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
|