Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/screen/area.c
| Show All 35 Lines | |||||
| #include "DNA_userdef_types.h" | #include "DNA_userdef_types.h" | ||||
| #include "BLI_blenlib.h" | #include "BLI_blenlib.h" | ||||
| #include "BLI_math.h" | #include "BLI_math.h" | ||||
| #include "BLI_utildefines.h" | #include "BLI_utildefines.h" | ||||
| #include "BLI_linklist_stack.h" | #include "BLI_linklist_stack.h" | ||||
| #include "BKE_context.h" | #include "BKE_context.h" | ||||
| #include "BKE_global.h" | #include "BKE_global.h" | ||||
| #include "BKE_screen.h" | #include "BKE_screen.h" | ||||
| #include "BKE_workspace.h" | |||||
| #include "RNA_access.h" | #include "RNA_access.h" | ||||
| #include "RNA_types.h" | #include "RNA_types.h" | ||||
| #include "WM_api.h" | #include "WM_api.h" | ||||
| #include "WM_types.h" | #include "WM_types.h" | ||||
| #include "WM_message.h" | #include "WM_message.h" | ||||
| ▲ Show 20 Lines • Show All 1,763 Lines • ▼ Show 20 Lines | int ED_area_header_switchbutton(const bContext *C, uiBlock *block, int yco) | ||||
| return xco + 1.7 * U.widget_unit; | return xco + 1.7 * U.widget_unit; | ||||
| } | } | ||||
| /************************ standard UI regions ************************/ | /************************ standard UI regions ************************/ | ||||
| void ED_region_panels(const bContext *C, ARegion *ar, const char *context, int contextnr, const bool vertical) | void ED_region_panels(const bContext *C, ARegion *ar, const char *context, int contextnr, const bool vertical) | ||||
| { | { | ||||
| const WorkSpace *workspace = CTX_wm_workspace(C); | |||||
| ScrArea *sa = CTX_wm_area(C); | ScrArea *sa = CTX_wm_area(C); | ||||
| uiStyle *style = UI_style_get_dpi(); | uiStyle *style = UI_style_get_dpi(); | ||||
| uiBlock *block; | uiBlock *block; | ||||
| PanelType *pt; | PanelType *pt; | ||||
| Panel *panel; | Panel *panel; | ||||
| View2D *v2d = &ar->v2d; | View2D *v2d = &ar->v2d; | ||||
| View2DScrollers *scrollers; | View2DScrollers *scrollers; | ||||
| int x, y, xco, yco, w, em, triangle; | int x, y, xco, yco, w, em, triangle; | ||||
| Show All 34 Lines | void ED_region_panels(const bContext *C, ARegion *ar, const char *context, int contextnr, const bool vertical) | ||||
| /* collect panels to draw */ | /* collect panels to draw */ | ||||
| for (pt = ar->type->paneltypes.last; pt; pt = pt->prev) { | for (pt = ar->type->paneltypes.last; pt; pt = pt->prev) { | ||||
| /* verify context */ | /* verify context */ | ||||
| if (context && pt->context[0] && !STREQ(context, pt->context)) { | if (context && pt->context[0] && !STREQ(context, pt->context)) { | ||||
| continue; | continue; | ||||
| } | } | ||||
| /* If we're tagged, only use compatible. */ | |||||
| if (pt->bl_origin[0] && BKE_workspace_bl_origins_check(workspace, pt->bl_origin) == false) { | |||||
| continue; | |||||
| } | |||||
| /* draw panel */ | /* draw panel */ | ||||
| if (pt->draw && (!pt->poll || pt->poll(C, pt))) { | if (pt->draw && (!pt->poll || pt->poll(C, pt))) { | ||||
| BLI_SMALLSTACK_PUSH(pt_stack, pt); | BLI_SMALLSTACK_PUSH(pt_stack, pt); | ||||
| } | } | ||||
| } | } | ||||
| /* collect categories */ | /* collect categories */ | ||||
| ▲ Show 20 Lines • Show All 752 Lines • Show Last 20 Lines | |||||