Refactor: BKE: Move icon header to C++
Was trying to use a C++ type (`blender::Span`) in the header but couldn't. I would rather not use a less safe raw pointer to a buffer. Pull Request: https://projects.blender.org/blender/blender/pulls/148214
This commit is contained in:
committed by
Julian Eisel
parent
6521b448c3
commit
2e76bb47bb
@@ -11,7 +11,7 @@
|
||||
#include "BLI_path_utils.hh"
|
||||
|
||||
#include "BKE_blendfile.hh"
|
||||
#include "BKE_icons.h"
|
||||
#include "BKE_icons.hh"
|
||||
#include "BKE_preview_image.hh"
|
||||
|
||||
#include "DNA_ID.h"
|
||||
|
||||
@@ -78,41 +78,41 @@ void BKE_icons_init(int first_dyn_id);
|
||||
/**
|
||||
* Return icon id for library object or create new icon if not found.
|
||||
*/
|
||||
int BKE_icon_id_ensure(struct ID *id);
|
||||
int BKE_icon_id_ensure(ID *id);
|
||||
|
||||
/**
|
||||
* Return icon id for Grease Pencil layer (color preview) or create new icon if not found.
|
||||
*/
|
||||
int BKE_icon_gplayer_color_ensure(struct bGPDlayer *gpl);
|
||||
int BKE_icon_gplayer_color_ensure(bGPDlayer *gpl);
|
||||
|
||||
/**
|
||||
* Return icon id of given preview, or create new icon if not found.
|
||||
*/
|
||||
int BKE_icon_preview_ensure(struct ID *id, struct PreviewImage *preview);
|
||||
int BKE_icon_preview_ensure(ID *id, PreviewImage *preview);
|
||||
|
||||
/**
|
||||
* Create an icon as owner or \a ibuf. The icon-ID is not stored in \a ibuf,
|
||||
* it needs to be stored separately.
|
||||
* \note Transforms ownership of \a ibuf to the newly created icon.
|
||||
*/
|
||||
int BKE_icon_imbuf_create(struct ImBuf *ibuf) ATTR_WARN_UNUSED_RESULT;
|
||||
struct ImBuf *BKE_icon_imbuf_get_buffer(int icon_id) ATTR_WARN_UNUSED_RESULT;
|
||||
int BKE_icon_imbuf_create(ImBuf *ibuf) ATTR_WARN_UNUSED_RESULT;
|
||||
ImBuf *BKE_icon_imbuf_get_buffer(int icon_id) ATTR_WARN_UNUSED_RESULT;
|
||||
|
||||
/**
|
||||
* Retrieve icon for id.
|
||||
*/
|
||||
struct Icon *BKE_icon_get(int icon_id);
|
||||
Icon *BKE_icon_get(int icon_id);
|
||||
|
||||
/**
|
||||
* Set icon for id if not already defined.
|
||||
* Used for inserting the internal icons.
|
||||
*/
|
||||
void BKE_icon_set(int icon_id, struct Icon *icon);
|
||||
void BKE_icon_set(int icon_id, Icon *icon);
|
||||
|
||||
/**
|
||||
* Remove icon and free data if library object becomes invalid.
|
||||
*/
|
||||
void BKE_icon_id_delete(struct ID *id);
|
||||
void BKE_icon_id_delete(ID *id);
|
||||
|
||||
/**
|
||||
* Remove icon and free data.
|
||||
@@ -128,22 +128,20 @@ void BKE_icon_changed(int icon_id);
|
||||
/**
|
||||
* Free all icons.
|
||||
*/
|
||||
void BKE_icons_free(void);
|
||||
void BKE_icons_free();
|
||||
|
||||
/**
|
||||
* Free all icons marked for deferred deletion.
|
||||
*/
|
||||
void BKE_icons_deferred_free(void);
|
||||
void BKE_icons_deferred_free();
|
||||
|
||||
int BKE_icon_geom_ensure(struct Icon_Geom *geom);
|
||||
struct Icon_Geom *BKE_icon_geom_from_memory(uchar *data, size_t data_len);
|
||||
struct Icon_Geom *BKE_icon_geom_from_file(const char *filename);
|
||||
int BKE_icon_geom_ensure(Icon_Geom *geom);
|
||||
Icon_Geom *BKE_icon_geom_from_memory(uchar *data, size_t data_len);
|
||||
Icon_Geom *BKE_icon_geom_from_file(const char *filename);
|
||||
|
||||
struct ImBuf *BKE_icon_geom_rasterize(const struct Icon_Geom *geom,
|
||||
unsigned int size_x,
|
||||
unsigned int size_y);
|
||||
void BKE_icon_geom_invert_lightness(struct Icon_Geom *geom);
|
||||
ImBuf *BKE_icon_geom_rasterize(const Icon_Geom *geom, unsigned int size_x, unsigned int size_y);
|
||||
void BKE_icon_geom_invert_lightness(Icon_Geom *geom);
|
||||
|
||||
int BKE_icon_ensure_studio_light(struct StudioLight *sl, int id_type);
|
||||
int BKE_icon_ensure_studio_light(StudioLight *sl, int id_type);
|
||||
|
||||
#define ICON_RENDER_DEFAULT_HEIGHT 32
|
||||
@@ -419,7 +419,7 @@ set(SRC
|
||||
BKE_grease_pencil.hh
|
||||
BKE_grease_pencil_legacy_convert.hh
|
||||
BKE_grease_pencil_vertex_groups.hh
|
||||
BKE_icons.h
|
||||
BKE_icons.hh
|
||||
BKE_id_hash.hh
|
||||
BKE_idprop.hh
|
||||
BKE_idtype.hh
|
||||
|
||||
@@ -41,7 +41,7 @@
|
||||
#include "BKE_colortools.hh"
|
||||
#include "BKE_deform.hh"
|
||||
#include "BKE_gpencil_legacy.h"
|
||||
#include "BKE_icons.h"
|
||||
#include "BKE_icons.hh"
|
||||
#include "BKE_idtype.hh"
|
||||
#include "BKE_image.hh"
|
||||
#include "BKE_lib_id.hh"
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
#include "BLI_utildefines.h"
|
||||
|
||||
#include "BKE_global.hh" /* only for G.background test */
|
||||
#include "BKE_icons.h"
|
||||
#include "BKE_icons.hh"
|
||||
#include "BKE_preview_image.hh"
|
||||
#include "BKE_studiolight.h"
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
#include "IMB_imbuf.hh"
|
||||
#include "IMB_imbuf_types.hh"
|
||||
|
||||
#include "BKE_icons.h"
|
||||
#include "BKE_icons.hh"
|
||||
|
||||
#include "BLI_strict_flags.h" /* IWYU pragma: keep. Keep last. */
|
||||
|
||||
|
||||
@@ -76,7 +76,7 @@
|
||||
#include "BKE_bpath.hh"
|
||||
#include "BKE_colortools.hh"
|
||||
#include "BKE_global.hh"
|
||||
#include "BKE_icons.h"
|
||||
#include "BKE_icons.hh"
|
||||
#include "BKE_idtype.hh"
|
||||
#include "BKE_image.hh"
|
||||
#include "BKE_image_format.hh"
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
#include "BLI_math_matrix_types.hh"
|
||||
#include "BLI_utildefines.h"
|
||||
|
||||
#include "BKE_icons.h"
|
||||
#include "BKE_icons.hh"
|
||||
#include "BKE_idtype.hh"
|
||||
#include "BKE_lib_id.hh"
|
||||
#include "BKE_lib_query.hh"
|
||||
|
||||
@@ -52,7 +52,7 @@
|
||||
#include "BKE_displist.h"
|
||||
#include "BKE_editmesh.hh"
|
||||
#include "BKE_grease_pencil.hh"
|
||||
#include "BKE_icons.h"
|
||||
#include "BKE_icons.hh"
|
||||
#include "BKE_idtype.hh"
|
||||
#include "BKE_image.hh"
|
||||
#include "BKE_lib_id.hh"
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
#include "DNA_texture_types.h"
|
||||
#include "DNA_world_types.h"
|
||||
|
||||
#include "BKE_icons.h"
|
||||
#include "BKE_icons.hh"
|
||||
|
||||
#include "BLI_ghash.h"
|
||||
#include "BLI_string.h"
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
#include "BKE_studiolight.h"
|
||||
|
||||
#include "BKE_appdir.hh"
|
||||
#include "BKE_icons.h"
|
||||
#include "BKE_icons.hh"
|
||||
|
||||
#include "BLI_dynstr.h"
|
||||
#include "BLI_fileops.h"
|
||||
|
||||
@@ -39,7 +39,7 @@
|
||||
#include "BKE_brush.hh"
|
||||
#include "BKE_colorband.hh"
|
||||
#include "BKE_colortools.hh"
|
||||
#include "BKE_icons.h"
|
||||
#include "BKE_icons.hh"
|
||||
#include "BKE_idtype.hh"
|
||||
#include "BKE_image.hh"
|
||||
#include "BKE_lib_id.hh"
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
#include "BLI_listbase.h"
|
||||
#include "BLI_utildefines.h"
|
||||
|
||||
#include "BKE_icons.h"
|
||||
#include "BKE_icons.hh"
|
||||
#include "BKE_idtype.hh"
|
||||
#include "BKE_lib_id.hh"
|
||||
#include "BKE_lib_query.hh"
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
#include "BKE_context.hh"
|
||||
#include "BKE_fcurve.hh"
|
||||
#include "BKE_global.hh"
|
||||
#include "BKE_icons.h"
|
||||
#include "BKE_icons.hh"
|
||||
#include "BKE_lib_id.hh"
|
||||
#include "BKE_preferences.h"
|
||||
#include "BKE_report.hh"
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
#include "BKE_bpath.hh"
|
||||
#include "BKE_context.hh"
|
||||
#include "BKE_global.hh"
|
||||
#include "BKE_icons.h"
|
||||
#include "BKE_icons.hh"
|
||||
#include "BKE_lib_id.hh"
|
||||
#include "BKE_main.hh"
|
||||
#include "BKE_preferences.h"
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
|
||||
#include "BKE_context.hh"
|
||||
#include "BKE_global.hh"
|
||||
#include "BKE_icons.h"
|
||||
#include "BKE_icons.hh"
|
||||
#include "BKE_paint.hh"
|
||||
#include "BKE_preview_image.hh"
|
||||
#include "BKE_studiolight.h"
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
#include <stdexcept>
|
||||
|
||||
#include "BKE_context.hh"
|
||||
#include "BKE_icons.h"
|
||||
#include "BKE_icons.hh"
|
||||
|
||||
#include "BLI_index_range.hh"
|
||||
|
||||
|
||||
@@ -53,7 +53,7 @@
|
||||
#include "BKE_colortools.hh"
|
||||
#include "BKE_context.hh"
|
||||
#include "BKE_global.hh"
|
||||
#include "BKE_icons.h"
|
||||
#include "BKE_icons.hh"
|
||||
#include "BKE_idprop.hh"
|
||||
#include "BKE_image.hh"
|
||||
#include "BKE_layer.hh"
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
|
||||
#include "BKE_brush.hh"
|
||||
#include "BKE_context.hh"
|
||||
#include "BKE_icons.h"
|
||||
#include "BKE_icons.hh"
|
||||
#include "BKE_main.hh"
|
||||
#include "BKE_main_invariants.hh"
|
||||
#include "BKE_material.hh"
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
|
||||
#include "BKE_context.hh"
|
||||
#include "BKE_global.hh"
|
||||
#include "BKE_icons.h"
|
||||
#include "BKE_icons.hh"
|
||||
#include "BKE_image.hh"
|
||||
#include "BKE_layer.hh"
|
||||
#include "BKE_lib_id.hh"
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
#include "BKE_editmesh.hh"
|
||||
#include "BKE_fcurve.hh"
|
||||
#include "BKE_global.hh"
|
||||
#include "BKE_icons.h"
|
||||
#include "BKE_icons.hh"
|
||||
#include "BKE_layer.hh"
|
||||
#include "BKE_lib_id.hh"
|
||||
#include "BKE_library.hh"
|
||||
|
||||
@@ -52,7 +52,7 @@
|
||||
#include "BKE_blendfile.hh"
|
||||
#include "BKE_context.hh"
|
||||
#include "BKE_global.hh"
|
||||
#include "BKE_icons.h"
|
||||
#include "BKE_icons.hh"
|
||||
#include "BKE_idtype.hh"
|
||||
#include "BKE_main.hh"
|
||||
#include "BKE_preferences.h"
|
||||
|
||||
@@ -39,7 +39,7 @@
|
||||
#include "BKE_colortools.hh"
|
||||
#include "BKE_context.hh"
|
||||
#include "BKE_global.hh"
|
||||
#include "BKE_icons.h"
|
||||
#include "BKE_icons.hh"
|
||||
#include "BKE_image.hh"
|
||||
#include "BKE_image_format.hh"
|
||||
#include "BKE_image_save.hh"
|
||||
|
||||
@@ -218,7 +218,7 @@ const IDFilterEnumPropertyItem rna_enum_id_type_filter_items[] = {
|
||||
|
||||
# include "BKE_anim_data.hh"
|
||||
# include "BKE_global.hh" /* XXX, remove me */
|
||||
# include "BKE_icons.h"
|
||||
# include "BKE_icons.hh"
|
||||
# include "BKE_idprop.hh"
|
||||
# include "BKE_idtype.hh"
|
||||
# include "BKE_lib_override.hh"
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
|
||||
# include "BKE_animsys.h"
|
||||
# include "BKE_gpencil_legacy.h"
|
||||
# include "BKE_icons.h"
|
||||
# include "BKE_icons.hh"
|
||||
# include "BKE_report.hh"
|
||||
|
||||
# include "DEG_depsgraph.hh"
|
||||
|
||||
@@ -372,7 +372,7 @@ static EnumPropertyItem rna_enum_gpencil_brush_modes_items[] = {
|
||||
# include "BKE_colorband.hh"
|
||||
# include "BKE_context.hh"
|
||||
# include "BKE_gpencil_legacy.h"
|
||||
# include "BKE_icons.h"
|
||||
# include "BKE_icons.hh"
|
||||
# include "BKE_layer.hh"
|
||||
# include "BKE_material.hh"
|
||||
# include "BKE_paint.hh"
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
# include "BKE_displist.h"
|
||||
# include "BKE_gpencil_legacy.h"
|
||||
# include "BKE_grease_pencil.hh"
|
||||
# include "BKE_icons.h"
|
||||
# include "BKE_icons.hh"
|
||||
# include "BKE_idtype.hh"
|
||||
# include "BKE_image.hh"
|
||||
# include "BKE_lattice.hh"
|
||||
|
||||
@@ -634,7 +634,7 @@ static const EnumPropertyItem spreadsheet_table_id_type_items[] = {
|
||||
# include "BKE_brush.hh"
|
||||
# include "BKE_context.hh"
|
||||
# include "BKE_global.hh"
|
||||
# include "BKE_icons.h"
|
||||
# include "BKE_icons.hh"
|
||||
# include "BKE_idprop.hh"
|
||||
# include "BKE_image.hh"
|
||||
# include "BKE_key.hh"
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
|
||||
#include "MEM_guardedalloc.h"
|
||||
|
||||
#include "BKE_icons.h"
|
||||
#include "BKE_icons.hh"
|
||||
|
||||
#include "../generic/py_capi_utils.hh"
|
||||
#include "../generic/python_compat.hh" /* IWYU pragma: keep. */
|
||||
|
||||
@@ -36,7 +36,7 @@
|
||||
#include "BKE_blendfile.hh"
|
||||
#include "BKE_context.hh"
|
||||
#include "BKE_global.hh"
|
||||
#include "BKE_icons.h"
|
||||
#include "BKE_icons.hh"
|
||||
#include "BKE_image.hh"
|
||||
#include "BKE_keyconfig.h"
|
||||
#include "BKE_lib_remap.hh"
|
||||
|
||||
@@ -45,7 +45,7 @@
|
||||
#include "BKE_blender_version.h"
|
||||
#include "BKE_context.hh"
|
||||
#include "BKE_global.hh"
|
||||
#include "BKE_icons.h"
|
||||
#include "BKE_icons.hh"
|
||||
#include "BKE_layer.hh"
|
||||
#include "BKE_main.hh"
|
||||
#include "BKE_report.hh"
|
||||
|
||||
Reference in New Issue
Block a user