Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/blender/editors/space_clip/clip_toolbar.c')
-rw-r--r--source/blender/editors/space_clip/clip_toolbar.c130
1 files changed, 65 insertions, 65 deletions
diff --git a/source/blender/editors/space_clip/clip_toolbar.c b/source/blender/editors/space_clip/clip_toolbar.c
index 3f16982e2c6..acb05e7d542 100644
--- a/source/blender/editors/space_clip/clip_toolbar.c
+++ b/source/blender/editors/space_clip/clip_toolbar.c
@@ -55,118 +55,118 @@
ARegion *ED_clip_has_properties_region(ScrArea *sa)
{
- ARegion *ar, *arnew;
+ ARegion *ar, *arnew;
- ar = BKE_area_find_region_type(sa, RGN_TYPE_UI);
- if (ar)
- return ar;
+ ar = BKE_area_find_region_type(sa, RGN_TYPE_UI);
+ if (ar)
+ return ar;
- /* add subdiv level; after header */
- ar = BKE_area_find_region_type(sa, RGN_TYPE_HEADER);
+ /* add subdiv level; after header */
+ ar = BKE_area_find_region_type(sa, RGN_TYPE_HEADER);
- /* is error! */
- if (ar == NULL)
- return NULL;
+ /* is error! */
+ if (ar == NULL)
+ return NULL;
- arnew = MEM_callocN(sizeof(ARegion), "clip properties region");
+ arnew = MEM_callocN(sizeof(ARegion), "clip properties region");
- BLI_insertlinkafter(&sa->regionbase, ar, arnew);
- arnew->regiontype = RGN_TYPE_UI;
- arnew->alignment = RGN_ALIGN_RIGHT;
+ BLI_insertlinkafter(&sa->regionbase, ar, arnew);
+ arnew->regiontype = RGN_TYPE_UI;
+ arnew->alignment = RGN_ALIGN_RIGHT;
- arnew->flag = RGN_FLAG_HIDDEN;
+ arnew->flag = RGN_FLAG_HIDDEN;
- return arnew;
+ return arnew;
}
static bool properties_poll(bContext *C)
{
- return (CTX_wm_space_clip(C) != NULL);
+ return (CTX_wm_space_clip(C) != NULL);
}
static int properties_exec(bContext *C, wmOperator *UNUSED(op))
{
- ScrArea *sa = CTX_wm_area(C);
- ARegion *ar = ED_clip_has_properties_region(sa);
+ ScrArea *sa = CTX_wm_area(C);
+ ARegion *ar = ED_clip_has_properties_region(sa);
- if (ar && ar->alignment != RGN_ALIGN_NONE)
- ED_region_toggle_hidden(C, ar);
+ if (ar && ar->alignment != RGN_ALIGN_NONE)
+ ED_region_toggle_hidden(C, ar);
- return OPERATOR_FINISHED;
+ return OPERATOR_FINISHED;
}
void CLIP_OT_properties(wmOperatorType *ot)
{
- /* identifiers */
- ot->name = "Toggle Sidebar";
- ot->description = "Toggle the properties region visibility";
- ot->idname = "CLIP_OT_properties";
-
- /* api callbacks */
- ot->exec = properties_exec;
- ot->poll = properties_poll;
+ /* identifiers */
+ ot->name = "Toggle Sidebar";
+ ot->description = "Toggle the properties region visibility";
+ ot->idname = "CLIP_OT_properties";
+
+ /* api callbacks */
+ ot->exec = properties_exec;
+ ot->poll = properties_poll;
}
/************************** tools ******************************/
static ARegion *clip_has_tools_region(ScrArea *sa)
{
- ARegion *ar, *artool = NULL, *arhead;
+ ARegion *ar, *artool = NULL, *arhead;
- for (ar = sa->regionbase.first; ar; ar = ar->next) {
- if (ar->regiontype == RGN_TYPE_TOOLS)
- artool = ar;
- }
+ for (ar = sa->regionbase.first; ar; ar = ar->next) {
+ if (ar->regiontype == RGN_TYPE_TOOLS)
+ artool = ar;
+ }
- /* tool region hide/unhide also hides props */
- if (artool) {
- return artool;
- }
+ /* tool region hide/unhide also hides props */
+ if (artool) {
+ return artool;
+ }
- if (artool == NULL) {
- /* add subdiv level; after header */
- arhead = BKE_area_find_region_type(sa, RGN_TYPE_HEADER);
+ if (artool == NULL) {
+ /* add subdiv level; after header */
+ arhead = BKE_area_find_region_type(sa, RGN_TYPE_HEADER);
- /* is error! */
- if (arhead == NULL)
- return NULL;
+ /* is error! */
+ if (arhead == NULL)
+ return NULL;
- artool = MEM_callocN(sizeof(ARegion), "clip tools region");
+ artool = MEM_callocN(sizeof(ARegion), "clip tools region");
- BLI_insertlinkafter(&sa->regionbase, arhead, artool);
- artool->regiontype = RGN_TYPE_TOOLS;
- artool->alignment = RGN_ALIGN_LEFT;
+ BLI_insertlinkafter(&sa->regionbase, arhead, artool);
+ artool->regiontype = RGN_TYPE_TOOLS;
+ artool->alignment = RGN_ALIGN_LEFT;
- artool->flag = RGN_FLAG_HIDDEN;
- }
+ artool->flag = RGN_FLAG_HIDDEN;
+ }
- return artool;
+ return artool;
}
static bool tools_poll(bContext *C)
{
- return (CTX_wm_space_clip(C) != NULL);
+ return (CTX_wm_space_clip(C) != NULL);
}
static int tools_exec(bContext *C, wmOperator *UNUSED(op))
{
- ScrArea *sa = CTX_wm_area(C);
- ARegion *ar = clip_has_tools_region(sa);
+ ScrArea *sa = CTX_wm_area(C);
+ ARegion *ar = clip_has_tools_region(sa);
- if (ar && ar->alignment != RGN_ALIGN_NONE)
- ED_region_toggle_hidden(C, ar);
+ if (ar && ar->alignment != RGN_ALIGN_NONE)
+ ED_region_toggle_hidden(C, ar);
- return OPERATOR_FINISHED;
+ return OPERATOR_FINISHED;
}
void CLIP_OT_tools(wmOperatorType *ot)
{
- /* identifiers */
- ot->name = "Toggle Toolbar";
- ot->description = "Toggle clip tools panel";
- ot->idname = "CLIP_OT_tools";
-
- /* api callbacks */
- ot->exec = tools_exec;
- ot->poll = tools_poll;
+ /* identifiers */
+ ot->name = "Toggle Toolbar";
+ ot->description = "Toggle clip tools panel";
+ ot->idname = "CLIP_OT_tools";
+
+ /* api callbacks */
+ ot->exec = tools_exec;
+ ot->poll = tools_poll;
}