Geometry Nodes: Node group operators initial phase #108947

Merged
Hans Goudey merged 72 commits from node-group-operators into main 2023-06-29 13:58:01 +02:00
10 changed files with 231 additions and 367 deletions
Showing only changes of commit ff4743e5a6 - Show all commits

View File

@ -48,7 +48,7 @@ struct wmWindow;
struct wmWindowManager;
/* spacetype has everything stored to get an editor working, it gets initialized via
* #ED_spacetypes_init() in `editors/space_api/spacetypes.c` */
* #ED_spacetypes_init() in `editors/space_api/spacetypes.cc` */
/* an editor in Blender is a combined ScrArea + SpaceType + SpaceData */
#define BKE_ST_MAXNAME 64

View File

@ -42,7 +42,7 @@ set(SRC
intern/undofile.cc
intern/versioning_250.c
intern/versioning_260.c
intern/versioning_270.c
intern/versioning_270.cc
intern/versioning_280.cc
intern/versioning_290.cc
intern/versioning_300.cc

View File

@ -10,16 +10,16 @@
#include "BLI_compiler_attrs.h"
#include "BKE_scene.h"
#ifdef __cplusplus
extern "C" {
#endif
enum eSceneCopyMethod;
struct Scene *ED_scene_add(struct Main *bmain,
struct bContext *C,
struct wmWindow *win,
enum eSceneCopyMethod method) ATTR_NONNULL();
eSceneCopyMethod method) ATTR_NONNULL();
/**
* Add a new scene in the sequence editor.
*
@ -27,8 +27,8 @@ struct Scene *ED_scene_add(struct Main *bmain,
*/
struct Scene *ED_scene_sequencer_add(struct Main *bmain,
struct bContext *C,
enum eSceneCopyMethod method,
const bool assign_strip);
eSceneCopyMethod method,
bool assign_strip);
/**
* \note Only call outside of area/region loops.
* \return true if successful.

View File

@ -493,9 +493,9 @@ bScreen *ED_screen_animation_playing(const struct wmWindowManager *wm);
bScreen *ED_screen_animation_no_scrub(const struct wmWindowManager *wm);
/* screen keymaps */
/* called in spacetypes.c */
/* called in spacetypes.cc */
void ED_operatortypes_screen(void);
/* called in spacetypes.c */
/* called in spacetypes.cc */
void ED_keymap_screen(struct wmKeyConfig *keyconf);
/**
* Workspace key-maps.

View File

@ -45,7 +45,7 @@ set(SRC
io_collada.hh
io_gpencil.hh
io_obj.hh
io_ops.h
io_ops.hh
io_ply_ops.hh
io_stl_ops.hh
io_usd.hh

View File

@ -6,7 +6,7 @@
* \ingroup collada
*/
#include "io_ops.h" /* own include */
#include "io_ops.hh" /* own include */
#include "WM_api.h"
@ -28,7 +28,7 @@
#include "io_ply_ops.hh"
#include "io_stl_ops.hh"
void ED_operatortypes_io(void)
void ED_operatortypes_io()
{
#ifdef WITH_COLLADA
/* Collada operators: */

View File

@ -8,12 +8,4 @@
#pragma once
#ifdef __cplusplus
extern "C" {
#endif
void ED_operatortypes_io(void);
#ifdef __cplusplus
}
#endif
void ED_operatortypes_io();

View File

@ -5,6 +5,7 @@
set(INC
../include
../io
../../asset_system
../../blenkernel
../../blenlib
../../gpu
@ -19,7 +20,7 @@ set(INC_SYS
)
set(SRC
spacetypes.c
spacetypes.cc
)
set(LIB

View File

@ -6,7 +6,7 @@
* \ingroup spapi
*/
#include <stdlib.h>
#include <cstdlib>
#include "MEM_guardedalloc.h"
@ -58,9 +58,9 @@
#include "ED_util.h"
#include "ED_uvedit.h"
#include "io_ops.h"
#include "io_ops.hh"
void ED_spacetypes_init(void)
void ED_spacetypes_init()
{
/* UI unit is a variable, may be used in some space type initialization. */
U.widget_unit = 20;
@ -149,7 +149,7 @@ void ED_spacetypes_init(void)
}
}
void ED_spacemacros_init(void)
void ED_spacemacros_init()
{
/* Macros must go last since they reference other operators.
* They need to be registered after python operators too. */
@ -221,22 +221,21 @@ void ED_spacetypes_keymap(wmKeyConfig *keyconf)
/* ********************** Custom Draw Call API ***************** */
typedef struct RegionDrawCB {
struct RegionDrawCB {
struct RegionDrawCB *next, *prev;
void (*draw)(const bContext *, ARegion *, void *);
void *customdata;
int type;
} RegionDrawCB;
};
void *ED_region_draw_cb_activate(ARegionType *art,
void (*draw)(const bContext *, ARegion *, void *),
void *customdata,
int type)
{
RegionDrawCB *rdc = MEM_callocN(sizeof(RegionDrawCB), "RegionDrawCB");
RegionDrawCB *rdc = MEM_cnew<RegionDrawCB>(__func__);
BLI_addtail(&art->drawcalls, rdc);
rdc->draw = draw;
@ -277,7 +276,7 @@ void ED_region_draw_cb_draw(const bContext *C, ARegion *region, int type)
void ED_region_surface_draw_cb_draw(ARegionType *art, int type)
{
ed_region_draw_cb_draw(NULL, NULL, art, type);
ed_region_draw_cb_draw(nullptr, nullptr, art, type);
}
void ED_region_draw_cb_remove_by_type(ARegionType *art, void *draw_fn, void (*free)(void *))
@ -295,19 +294,19 @@ void ED_region_draw_cb_remove_by_type(ARegionType *art, void *draw_fn, void (*fr
/* ********************* space template *********************** */
/* forward declare */
void ED_spacetype_xxx(void);
void ED_spacetype_xxx();
/* allocate and init some vars */
static SpaceLink *xxx_create(const ScrArea *UNUSED(area), const Scene *UNUSED(scene))
static SpaceLink *xxx_create(const ScrArea * /*area*/, const Scene * /*scene*/)
{
return NULL;
return nullptr;
}
/* Doesn't free the space-link itself. */
static void xxx_free(SpaceLink *UNUSED(sl)) {}
static void xxx_free(SpaceLink * /*sl*/) {}
/* spacetype; init callback for usage, should be re-doable. */
static void xxx_init(wmWindowManager *UNUSED(wm), ScrArea *UNUSED(area))
static void xxx_init(wmWindowManager * /*wm*/, ScrArea * /*area*/)
{
/* link area to SpaceXXX struct */
@ -317,24 +316,23 @@ static void xxx_init(wmWindowManager *UNUSED(wm), ScrArea *UNUSED(area))
/* add types to regions */
}
static SpaceLink *xxx_duplicate(SpaceLink *UNUSED(sl))
static SpaceLink *xxx_duplicate(SpaceLink * /*sl*/)
{
return NULL;
return nullptr;
}
static void xxx_operatortypes(void)
static void xxx_operatortypes()
{
/* register operator types for this space */
}
static void xxx_keymap(wmKeyConfig *UNUSED(keyconf))
static void xxx_keymap(wmKeyConfig * /*keyconf*/)
{
/* add default items to keymap */
}
/* only called once, from screen/spacetypes.c */
void ED_spacetype_xxx(void)
/* only called once, from screen/spacetypes.cc */
void ED_spacetype_xxx()
{
static SpaceType st;