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>
|
2024-01-17 16:37:47 +01:00
|
|
|
#include <girepository/giboxedinfo.h>
|
2023-10-25 18:12:29 +02:00
|
|
|
#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>
|
2024-01-17 16:02:05 +01:00
|
|
|
#include <girepository/giflagsinfo.h>
|
2023-10-25 18:12:29 +02:00
|
|
|
#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>
|
2024-01-17 14:43:58 +01:00
|
|
|
#include <girepository/givalueinfo.h>
|
2023-10-25 18:12:29 +02:00
|
|
|
#include <girepository/givfuncinfo.h>
|
2008-02-08 16:31:03 +01:00
|
|
|
|
|
|
|
G_BEGIN_DECLS
|
|
|
|
|
2024-01-26 00:09:16 +01:00
|
|
|
#define GI_TYPE_REPOSITORY (gi_repository_get_type ())
|
|
|
|
GI_AVAILABLE_IN_ALL
|
|
|
|
G_DECLARE_FINAL_TYPE (GIRepository, gi_repository, GI, REPOSITORY, GObject)
|
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
|
|
|
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-12-20 06:29:40 +01:00
|
|
|
const char * const * gi_repository_get_search_path (size_t *n_paths_out);
|
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,
|
2024-01-15 20:20:47 +01:00
|
|
|
const char *namespace_,
|
|
|
|
const char *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,
|
2024-01-15 20:20:47 +01:00
|
|
|
const char *namespace_,
|
|
|
|
const char *name);
|
2014-07-04 12:18:32 +02:00
|
|
|
|
|
|
|
GI_AVAILABLE_IN_ALL
|
2023-12-20 05:11:38 +01:00
|
|
|
char ** gi_repository_enumerate_versions (GIRepository *repository,
|
2024-01-15 20:20:47 +01:00
|
|
|
const char *namespace_,
|
2023-12-20 05:11:38 +01:00
|
|
|
size_t *n_versions_out);
|
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,
|
2024-01-15 20:20:47 +01:00
|
|
|
const char *namespace_,
|
|
|
|
const char *version,
|
2023-11-08 15:17:52 +01:00
|
|
|
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,
|
2024-01-15 20:20:47 +01:00
|
|
|
const char *typelib_dir,
|
|
|
|
const char *namespace_,
|
|
|
|
const char *version,
|
2023-11-08 15:17:52 +01:00
|
|
|
GIRepositoryLoadFlags flags,
|
|
|
|
GError **error);
|
2014-07-04 12:18:32 +02:00
|
|
|
|
2023-11-08 01:02:12 +01:00
|
|
|
GI_AVAILABLE_IN_ALL
|
2024-01-15 20:20:47 +01:00
|
|
|
char ** gi_repository_get_immediate_dependencies (GIRepository *repository,
|
|
|
|
const char *namespace_);
|
2015-01-31 23:48:56 +01:00
|
|
|
|
2014-07-04 12:18:32 +02:00
|
|
|
GI_AVAILABLE_IN_ALL
|
2024-01-15 20:20:47 +01:00
|
|
|
char ** gi_repository_get_dependencies (GIRepository *repository,
|
|
|
|
const char *namespace_);
|
2014-07-04 12:18:32 +02:00
|
|
|
|
|
|
|
GI_AVAILABLE_IN_ALL
|
2024-01-15 20:20:47 +01:00
|
|
|
char ** 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,
|
2024-01-16 00:35:23 +01:00
|
|
|
size_t *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
|
2024-01-15 22:20:02 +01:00
|
|
|
unsigned int gi_repository_get_n_infos (GIRepository *repository,
|
2024-01-15 20:20:47 +01:00
|
|
|
const char *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,
|
2024-01-15 20:20:47 +01:00
|
|
|
const char *namespace_,
|
2024-01-15 22:20:02 +01:00
|
|
|
unsigned int 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
|
2024-01-15 20:20:47 +01:00
|
|
|
const char * gi_repository_get_typelib_path (GIRepository *repository,
|
|
|
|
const char *namespace_);
|
2014-07-04 12:18:32 +02:00
|
|
|
GI_AVAILABLE_IN_ALL
|
2024-01-15 20:20:47 +01:00
|
|
|
const char * const *gi_repository_get_shared_libraries (GIRepository *repository,
|
|
|
|
const char *namespace_,
|
|
|
|
size_t *out_n_elements);
|
2014-07-04 12:18:32 +02:00
|
|
|
GI_AVAILABLE_IN_ALL
|
2024-01-15 20:20:47 +01:00
|
|
|
const char * gi_repository_get_c_prefix (GIRepository *repository,
|
|
|
|
const char *namespace_);
|
2014-07-04 12:18:32 +02:00
|
|
|
GI_AVAILABLE_IN_ALL
|
2024-01-15 20:20:47 +01:00
|
|
|
const char * gi_repository_get_version (GIRepository *repository,
|
|
|
|
const char *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,
|
2024-01-15 22:20:02 +01:00
|
|
|
unsigned int n_param_values,
|
2009-01-12 22:31:43 +01:00
|
|
|
const GValue *param_values,
|
2024-01-15 20:16:00 +01:00
|
|
|
void *invocation_hint,
|
|
|
|
void *marshal_data);
|
2009-01-12 22:31:43 +01:00
|
|
|
|
2008-02-08 16:31:03 +01:00
|
|
|
G_END_DECLS
|