Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/interface/interface_panel.c
| Show All 18 Lines | |||||
| /** \file | /** \file | ||||
| * \ingroup edinterface | * \ingroup edinterface | ||||
| */ | */ | ||||
| /* a full doc with API notes can be found in | /* a full doc with API notes can be found in | ||||
| * bf-blender/trunk/blender/doc/guides/interface_API.txt */ | * bf-blender/trunk/blender/doc/guides/interface_API.txt */ | ||||
| #include <CLG_log.h> | |||||
| #include <ctype.h> | #include <ctype.h> | ||||
| #include <math.h> | #include <math.h> | ||||
| #include <stdlib.h> | #include <stdlib.h> | ||||
| #include <string.h> | #include <string.h> | ||||
| #include "MEM_guardedalloc.h" | #include "MEM_guardedalloc.h" | ||||
| #include "PIL_time.h" | #include "PIL_time.h" | ||||
| Show All 39 Lines | |||||
| #define PNL_WAS_ACTIVE 4 | #define PNL_WAS_ACTIVE 4 | ||||
| #define PNL_ANIM_ALIGN 8 | #define PNL_ANIM_ALIGN 8 | ||||
| #define PNL_NEW_ADDED 16 | #define PNL_NEW_ADDED 16 | ||||
| #define PNL_FIRST 32 | #define PNL_FIRST 32 | ||||
| /* only show pin header button for pinned panels */ | /* only show pin header button for pinned panels */ | ||||
| #define USE_PIN_HIDDEN | #define USE_PIN_HIDDEN | ||||
| static CLG_LogRef LOG = {"interface.panel"}; | |||||
| /* the state of the mouse position relative to the panel */ | /* the state of the mouse position relative to the panel */ | ||||
| typedef enum uiPanelMouseState { | typedef enum uiPanelMouseState { | ||||
| PANEL_MOUSE_OUTSIDE, /* mouse is not in the panel */ | PANEL_MOUSE_OUTSIDE, /* mouse is not in the panel */ | ||||
| PANEL_MOUSE_INSIDE_CONTENT, /* mouse is in the actual panel content */ | PANEL_MOUSE_INSIDE_CONTENT, /* mouse is in the actual panel content */ | ||||
| PANEL_MOUSE_INSIDE_HEADER, /* mouse is in the panel header */ | PANEL_MOUSE_INSIDE_HEADER, /* mouse is in the panel header */ | ||||
| PANEL_MOUSE_INSIDE_SCALE, /* mouse is inside panel scale widget */ | PANEL_MOUSE_INSIDE_SCALE, /* mouse is inside panel scale widget */ | ||||
| } uiPanelMouseState; | } uiPanelMouseState; | ||||
| ▲ Show 20 Lines • Show All 173 Lines • ▼ Show 20 Lines | Panel *UI_panel_add_instanced(ScrArea *area, | ||||
| PointerRNA *custom_data) | PointerRNA *custom_data) | ||||
| { | { | ||||
| ARegionType *region_type = region->type; | ARegionType *region_type = region->type; | ||||
| PanelType *panel_type = BLI_findstring( | PanelType *panel_type = BLI_findstring( | ||||
| ®ion_type->paneltypes, panel_idname, offsetof(PanelType, idname)); | ®ion_type->paneltypes, panel_idname, offsetof(PanelType, idname)); | ||||
| if (panel_type == NULL) { | if (panel_type == NULL) { | ||||
| printf("Panel type '%s' not found.\n", panel_idname); | CLOG_ERROR(&LOG, "Panel type '%s' not found", panel_idname); | ||||
| return NULL; | return NULL; | ||||
| } | } | ||||
| return UI_panel_add_instanced_ex(area, region, panels, panel_type, list_index, custom_data); | return UI_panel_add_instanced_ex(area, region, panels, panel_type, list_index, custom_data); | ||||
| } | } | ||||
| /** | /** | ||||
| * Find a unique key to append to the idname for the lookup to the panel's #uiBlock. Needed for | * Find a unique key to append to the idname for the lookup to the panel's #uiBlock. Needed for | ||||
| ▲ Show 20 Lines • Show All 2,394 Lines • Show Last 20 Lines | |||||