tornavis/source/blender/blenkernel/BKE_addon.h

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

46 lines
1.1 KiB
C
Raw Normal View History

/* SPDX-FileCopyrightText: 2023 Blender Authors
*
* SPDX-License-Identifier: GPL-2.0-or-later */
#pragma once
/** \file
* \ingroup bke
2013-09-12 05:02:50 +02:00
*/
#ifdef __cplusplus
extern "C" {
#endif
2018-02-12 07:24:18 +01:00
struct ListBase;
struct bAddon;
#ifdef __RNA_TYPES_H__
typedef struct bAddonPrefType {
PyAPI: add-on name-spacing for extension repositories Support name-spaced add-ons, exposed via user configurable extension repositories. Directories for add-ons can be added at run-time and are name-spaced to avoid name-collisions with Python modules or add-ons from other repositories. This is exposed as an experimental feature "Extension Repositories". Details: - A `bUserExtensionRepo` type which represents a repository which is listed in the add-ons repository. - `JunctionModuleHandle` class to manage a package with sub-modules which can point to arbitrary locations. - `bpy.app.handlers._extension_repos_update_{pre/post}` internal callbacks run before/after changes to extension repositories, callbacks are used to sync the changes to the Python package that exposes these to add-ons. - The size of an add-on name has been increased so a user-defined package prefix can be included without enforcing shorter add-on names. - Functionality relating to package management has been left out of this change and will be developed separately. Further work: - While a repository can be renamed, enabled add-ons aren't renamed. Eventually we might want to support this although we could also disallow renaming repositories with add-ons enabled as the name isn't all that significant. - Removing a repository should remove all the add-ons located in this repository. - Sub-module names are currently restricted to `[A-Za-z]+[A-Za-z0-9_]*` we might want to relax this to allow unicode characters (we might still want to disallow `-` or any characters that would prevent attribute access in code). Ref !110869. Reviewed By: brecht
2023-08-09 12:15:34 +02:00
/** Type info, match #bAddon::module. */
char idname[128];
/* RNA integration */
ExtensionRNA rna_ext;
} bAddonPrefType;
2018-02-12 07:24:18 +01:00
#else
typedef struct bAddonPrefType bAddonPrefType;
#endif
bAddonPrefType *BKE_addon_pref_type_find(const char *idname, bool quiet);
void BKE_addon_pref_type_add(bAddonPrefType *apt);
2015-05-11 04:39:39 +02:00
void BKE_addon_pref_type_remove(const bAddonPrefType *apt);
void BKE_addon_pref_type_init(void);
void BKE_addon_pref_type_free(void);
2018-02-12 07:24:18 +01:00
struct bAddon *BKE_addon_new(void);
struct bAddon *BKE_addon_find(const struct ListBase *addon_list, const char *module);
struct bAddon *BKE_addon_ensure(struct ListBase *addon_list, const char *module);
2018-07-06 07:55:29 +02:00
bool BKE_addon_remove_safe(struct ListBase *addon_list, const char *module);
2018-02-12 07:24:18 +01:00
void BKE_addon_free(struct bAddon *addon);
#ifdef __cplusplus
}
#endif