This repository has been archived on 2023-10-09. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
blender-archive/source/blender/windowmanager/gizmo/wm_gizmo_wmapi.h
Campbell Barton c434782e3a File headers: SPDX License migration
Use a shorter/simpler license convention, stops the header taking so
much space.

Follow the SPDX license specification: https://spdx.org/licenses

- C/C++/objc/objc++
- Python
- Shell Scripts
- CMake, GNUmakefile

While most of the source tree has been included

- `./extern/` was left out.
- `./intern/cycles` & `./intern/atomic` are also excluded because they
  use different header conventions.

doc/license/SPDX-license-identifiers.txt has been added to list SPDX all
used identifiers.

See P2788 for the script that automated these edits.

Reviewed By: brecht, mont29, sergey

Ref D14069
2022-02-11 09:14:36 +11:00

119 lines
3.4 KiB
C++

/* SPDX-License-Identifier: GPL-2.0-or-later
* Copyright 2016 Blender Foundation. All rights reserved. */
/** \file
* \ingroup wm
*
* \name Gizmos Window Manager API
* API for usage in window manager code only. It should contain all functionality
* needed to hook up the gizmo system with Blender's window manager. It's
* mostly the event system that needs to communicate with gizmo code.
*
* Only included in wm.h and lower level files.
*/
#pragma once
struct wmEventHandler_Gizmo;
struct wmEventHandler_Op;
struct wmGizmoMap;
struct wmOperatorType;
#ifdef __cplusplus
extern "C" {
#endif
/* -------------------------------------------------------------------- */
/** \name #wmGizmo
* \{ */
/* wm_gizmo_type.c, for init/exit */
void wm_gizmotype_free(void);
/**
* Called on initialize #WM_init().
*/
void wm_gizmotype_init(void);
/* wm_gizmogroup_type.c, for init/exit */
void wm_gizmogrouptype_free(void);
/**
* Called on initialize #WM_init().
*/
void wm_gizmogrouptype_init(void);
/** \} */
/* -------------------------------------------------------------------- */
/** \name #wmGizmoGroup
* \{ */
void GIZMOGROUP_OT_gizmo_select(struct wmOperatorType *ot);
void GIZMOGROUP_OT_gizmo_tweak(struct wmOperatorType *ot);
bool wm_gizmogroup_is_any_selected(const struct wmGizmoGroup *gzgroup);
/** \} */
/* -------------------------------------------------------------------- */
/** \name #wmGizmoMap
* \{ */
void wm_gizmomap_remove(struct wmGizmoMap *gzmap);
/**
* Initialize key-maps for all existing gizmo-groups
*/
void wm_gizmos_keymap(struct wmKeyConfig *keyconf);
void wm_gizmomaps_handled_modal_update(bContext *C,
struct wmEvent *event,
struct wmEventHandler_Op *handler);
/**
* Prepare context for gizmo handling (but only if area/region is
* part of screen). Version of #wm_handler_op_context for gizmos.
*/
void wm_gizmomap_handler_context_op(bContext *C, struct wmEventHandler_Op *handler);
void wm_gizmomap_handler_context_gizmo(bContext *C, struct wmEventHandler_Gizmo *handler);
/**
* Try to find a gizmo under the mouse position. 2D intersections have priority over
* 3D ones (could check for smallest screen-space distance but not needed right now).
*/
struct wmGizmo *wm_gizmomap_highlight_find(struct wmGizmoMap *gzmap,
bContext *C,
const struct wmEvent *event,
int *r_part);
bool wm_gizmomap_highlight_set(struct wmGizmoMap *gzmap,
const bContext *C,
struct wmGizmo *gz,
int part);
struct wmGizmo *wm_gizmomap_highlight_get(struct wmGizmoMap *gzmap);
/**
* Caller should call exit when (enable == False).
*/
void wm_gizmomap_modal_set(struct wmGizmoMap *gzmap,
bContext *C,
struct wmGizmo *gz,
const struct wmEvent *event,
bool enable);
struct wmGizmo *wm_gizmomap_modal_get(struct wmGizmoMap *gzmap);
struct wmGizmo **wm_gizmomap_selected_get(wmGizmoMap *gzmap, int *r_selected_len);
struct ListBase *wm_gizmomap_groups_get(wmGizmoMap *gzmap);
/** \} */
/* -------------------------------------------------------------------- */
/** \name #wmGizmoMapType
* \{ */
void wm_gizmomaptypes_free(void);
/** \} */
#ifdef __cplusplus
}
#endif