Blender  V3.3
Classes
view2d_gizmo_navigate.cc File Reference
#include "BLI_math.h"
#include "BLI_utildefines.h"
#include "BKE_context.h"
#include "ED_gizmo_library.h"
#include "ED_screen.h"
#include "UI_interface.h"
#include "UI_resources.h"
#include "MEM_guardedalloc.h"
#include "RNA_access.h"
#include "WM_api.h"
#include "WM_types.h"
#include "UI_view2d.h"

Go to the source code of this file.

Classes

struct  NavigateGizmoInfo
 
struct  NavigateWidgetGroup
 

View2D Navigation Gizmo Group

A simpler version of VIEW3D_GGT_navigate

Written to be used by different kinds of 2D view types.

#define GIZMO_SIZE   80
 
#define GIZMO_MINI_FAC   0.35f
 
#define GIZMO_MINI_OFFSET_FAC   0.38f
 
enum  { GZ_INDEX_MOVE = 0 , GZ_INDEX_ZOOM = 1 , GZ_INDEX_TOTAL = 2 }
 
static struct NavigateGizmoInfo g_navigate_params_for_space_image [GZ_INDEX_TOTAL]
 
static struct NavigateGizmoInfo g_navigate_params_for_space_clip [GZ_INDEX_TOTAL]
 
static struct NavigateGizmoInfo g_navigate_params_for_view2d [GZ_INDEX_TOTAL]
 
static struct NavigateGizmoInfonavigate_params_from_space_type (short space_type)
 
static bool WIDGETGROUP_navigate_poll (const bContext *C, wmGizmoGroupType *UNUSED(gzgt))
 
static void WIDGETGROUP_navigate_setup (const bContext *UNUSED(C), wmGizmoGroup *gzgroup)
 
static void WIDGETGROUP_navigate_draw_prepare (const bContext *C, wmGizmoGroup *gzgroup)
 
void VIEW2D_GGT_navigate_impl (wmGizmoGroupType *gzgt, const char *idname)
 

Macro Definition Documentation

◆ GIZMO_MINI_FAC

#define GIZMO_MINI_FAC   0.35f

Definition at line 38 of file view2d_gizmo_navigate.cc.

◆ GIZMO_MINI_OFFSET_FAC

#define GIZMO_MINI_OFFSET_FAC   0.38f

Definition at line 40 of file view2d_gizmo_navigate.cc.

◆ GIZMO_SIZE

#define GIZMO_SIZE   80

Definition at line 36 of file view2d_gizmo_navigate.cc.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
GZ_INDEX_MOVE 
GZ_INDEX_ZOOM 
GZ_INDEX_TOTAL 

Definition at line 42 of file view2d_gizmo_navigate.cc.

Function Documentation

◆ navigate_params_from_space_type()

static struct NavigateGizmoInfo* navigate_params_from_space_type ( short  space_type)
static

◆ VIEW2D_GGT_navigate_impl()

void VIEW2D_GGT_navigate_impl ( struct wmGizmoGroupType gzgt,
const char *  idname 
)

◆ WIDGETGROUP_navigate_draw_prepare()

static void WIDGETGROUP_navigate_draw_prepare ( const bContext C,
wmGizmoGroup gzgroup 
)
static

◆ WIDGETGROUP_navigate_poll()

static bool WIDGETGROUP_navigate_poll ( const bContext C,
wmGizmoGroupType UNUSEDgzgt 
)
static

◆ WIDGETGROUP_navigate_setup()

static void WIDGETGROUP_navigate_setup ( const bContext UNUSEDC,
wmGizmoGroup gzgroup 
)
static

Variable Documentation

◆ g_navigate_params_for_space_clip

struct NavigateGizmoInfo g_navigate_params_for_space_clip[GZ_INDEX_TOTAL]
static
Initial value:
= {
{
"CLIP_OT_view_pan",
"GIZMO_GT_button_2d",
ICON_VIEW_PAN,
},
{
"CLIP_OT_view_zoom",
"GIZMO_GT_button_2d",
ICON_VIEW_ZOOM,
},
}

Definition at line 1 of file view2d_gizmo_navigate.cc.

Referenced by navigate_params_from_space_type().

◆ g_navigate_params_for_space_image

struct NavigateGizmoInfo g_navigate_params_for_space_image[GZ_INDEX_TOTAL]
static
Initial value:
= {
{
"IMAGE_OT_view_pan",
"GIZMO_GT_button_2d",
ICON_VIEW_PAN,
},
{
"IMAGE_OT_view_zoom",
"GIZMO_GT_button_2d",
ICON_VIEW_ZOOM,
},
}

Definition at line 1 of file view2d_gizmo_navigate.cc.

Referenced by navigate_params_from_space_type().

◆ g_navigate_params_for_view2d

struct NavigateGizmoInfo g_navigate_params_for_view2d[GZ_INDEX_TOTAL]
static
Initial value:
= {
{
"VIEW2D_OT_pan",
"GIZMO_GT_button_2d",
ICON_VIEW_PAN,
},
{
"VIEW2D_OT_zoom",
"GIZMO_GT_button_2d",
ICON_VIEW_ZOOM,
},
}

Definition at line 1 of file view2d_gizmo_navigate.cc.

Referenced by navigate_params_from_space_type().