Changeset View
Changeset View
Standalone View
Standalone View
source/blender/windowmanager/gizmo/intern/wm_gizmo_type.c
| Show All 23 Lines | |||||
| #include "BLI_utildefines.h" | #include "BLI_utildefines.h" | ||||
| #include "BLI_ghash.h" | #include "BLI_ghash.h" | ||||
| #include "BLI_listbase.h" | #include "BLI_listbase.h" | ||||
| #include "BKE_context.h" | #include "BKE_context.h" | ||||
| #include "BKE_main.h" | #include "BKE_main.h" | ||||
| #include "CLG_log.h" | |||||
| #include "DNA_screen_types.h" | #include "DNA_screen_types.h" | ||||
| #include "DNA_space_types.h" | #include "DNA_space_types.h" | ||||
| #include "MEM_guardedalloc.h" | #include "MEM_guardedalloc.h" | ||||
| #include "RNA_access.h" | #include "RNA_access.h" | ||||
| #include "RNA_define.h" | #include "RNA_define.h" | ||||
| #include "WM_api.h" | #include "WM_api.h" | ||||
| #include "WM_types.h" | #include "WM_types.h" | ||||
| #include "ED_screen.h" | #include "ED_screen.h" | ||||
| /* only for own init/exit calls (wm_gizmotype_init/wm_gizmotype_free) */ | /* only for own init/exit calls (wm_gizmotype_init/wm_gizmotype_free) */ | ||||
| #include "wm.h" | #include "wm.h" | ||||
| /* own includes */ | /* own includes */ | ||||
| #include "wm_gizmo_wmapi.h" | #include "wm_gizmo_wmapi.h" | ||||
| #include "wm_gizmo_intern.h" | #include "wm_gizmo_intern.h" | ||||
| static CLG_LogRef LOG = {"wm.gizmo_type"}; | |||||
| /** \name Gizmo Type Append | /** \name Gizmo Type Append | ||||
| * | * | ||||
| * \note This follows conventions from #WM_operatortype_find #WM_operatortype_append & friends. | * \note This follows conventions from #WM_operatortype_find #WM_operatortype_append & friends. | ||||
| * \{ */ | * \{ */ | ||||
| static GHash *global_gizmotype_hash = NULL; | static GHash *global_gizmotype_hash = NULL; | ||||
| const wmGizmoType *WM_gizmotype_find(const char *idname, bool quiet) | const wmGizmoType *WM_gizmotype_find(const char *idname, bool quiet) | ||||
| { | { | ||||
| if (idname[0]) { | if (idname[0]) { | ||||
| wmGizmoType *gzt; | wmGizmoType *gzt; | ||||
| gzt = BLI_ghash_lookup(global_gizmotype_hash, idname); | gzt = BLI_ghash_lookup(global_gizmotype_hash, idname); | ||||
| if (gzt) { | if (gzt) { | ||||
| return gzt; | return gzt; | ||||
| } | } | ||||
| if (!quiet) { | if (!quiet) { | ||||
| printf("search for unknown gizmo '%s'\n", idname); | CLOG_WARN(&LOG, "search for unknown gizmo '%s'", idname); | ||||
| } | } | ||||
| } | } | ||||
| else { | else { | ||||
| if (!quiet) { | if (!quiet) { | ||||
| printf("search for empty gizmo\n"); | CLOG_STR_WARN(&LOG, "search for empty gizmo"); | ||||
| } | } | ||||
| } | } | ||||
| return NULL; | return NULL; | ||||
| } | } | ||||
| /* caller must free */ | /* caller must free */ | ||||
| void WM_gizmotype_iter(GHashIterator *ghi) | void WM_gizmotype_iter(GHashIterator *ghi) | ||||
| ▲ Show 20 Lines • Show All 126 Lines • Show Last 20 Lines | |||||