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_text/text_header.c')
-rw-r--r--source/blender/editors/space_text/text_header.c224
1 files changed, 112 insertions, 112 deletions
diff --git a/source/blender/editors/space_text/text_header.c b/source/blender/editors/space_text/text_header.c
index e76fab28327..435a6fd67de 100644
--- a/source/blender/editors/space_text/text_header.c
+++ b/source/blender/editors/space_text/text_header.c
@@ -27,7 +27,6 @@
#include "BLI_blenlib.h"
-
#include "BKE_context.h"
#include "BKE_screen.h"
@@ -43,165 +42,166 @@
static ARegion *text_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), "properties region");
+ arnew = MEM_callocN(sizeof(ARegion), "properties region");
- BLI_insertlinkafter(&sa->regionbase, ar, arnew);
- arnew->regiontype = RGN_TYPE_UI;
- arnew->alignment = RGN_ALIGN_LEFT;
+ BLI_insertlinkafter(&sa->regionbase, ar, arnew);
+ arnew->regiontype = RGN_TYPE_UI;
+ arnew->alignment = RGN_ALIGN_LEFT;
- arnew->flag = RGN_FLAG_HIDDEN;
+ arnew->flag = RGN_FLAG_HIDDEN;
- return arnew;
+ return arnew;
}
static bool text_properties_poll(bContext *C)
{
- return (CTX_wm_space_text(C) != NULL);
+ return (CTX_wm_space_text(C) != NULL);
}
static int text_properties_exec(bContext *C, wmOperator *UNUSED(op))
{
- ScrArea *sa = CTX_wm_area(C);
- ARegion *ar = text_has_properties_region(sa);
+ ScrArea *sa = CTX_wm_area(C);
+ ARegion *ar = text_has_properties_region(sa);
- if (ar)
- ED_region_toggle_hidden(C, ar);
+ if (ar)
+ ED_region_toggle_hidden(C, ar);
- return OPERATOR_FINISHED;
+ return OPERATOR_FINISHED;
}
void TEXT_OT_properties(wmOperatorType *ot)
{
- /* identifiers */
- ot->name = "Toggle Sidebar";
- ot->description = "Toggle the properties region visibility";
- ot->idname = "TEXT_OT_properties";
-
- /* api callbacks */
- ot->exec = text_properties_exec;
- ot->poll = text_properties_poll;
+ /* identifiers */
+ ot->name = "Toggle Sidebar";
+ ot->description = "Toggle the properties region visibility";
+ ot->idname = "TEXT_OT_properties";
+
+ /* api callbacks */
+ ot->exec = text_properties_exec;
+ ot->poll = text_properties_poll;
}
static int text_text_search_exec(bContext *C, wmOperator *UNUSED(op))
{
- ScrArea *sa = CTX_wm_area(C);
- ARegion *ar = text_has_properties_region(sa);
- SpaceText *st = CTX_wm_space_text(C);
+ ScrArea *sa = CTX_wm_area(C);
+ ARegion *ar = text_has_properties_region(sa);
+ SpaceText *st = CTX_wm_space_text(C);
- if (ar) {
- if (ar->flag & RGN_FLAG_HIDDEN)
- ED_region_toggle_hidden(C, ar);
+ if (ar) {
+ if (ar->flag & RGN_FLAG_HIDDEN)
+ ED_region_toggle_hidden(C, ar);
- /* cannot send a button activate yet for case when region wasn't visible yet */
- /* flag gets checked and cleared in main draw callback */
- st->flags |= ST_FIND_ACTIVATE;
+ /* cannot send a button activate yet for case when region wasn't visible yet */
+ /* flag gets checked and cleared in main draw callback */
+ st->flags |= ST_FIND_ACTIVATE;
- ED_region_tag_redraw(ar);
- }
- return OPERATOR_FINISHED;
+ ED_region_tag_redraw(ar);
+ }
+ return OPERATOR_FINISHED;
}
-
void TEXT_OT_start_find(wmOperatorType *ot)
{
- /* identifiers */
- ot->name = "Find";
- ot->description = "Start searching text";
- ot->idname = "TEXT_OT_start_find";
-
- /* api callbacks */
- ot->exec = text_text_search_exec;
- ot->poll = text_properties_poll;
+ /* identifiers */
+ ot->name = "Find";
+ ot->description = "Start searching text";
+ ot->idname = "TEXT_OT_start_find";
+
+ /* api callbacks */
+ ot->exec = text_text_search_exec;
+ ot->poll = text_properties_poll;
}
/******************** XXX popup menus *******************/
#if 0
{
- // RMB
-
- uiPopupMenu *pup;
-
- if (text) {
- pup = UI_popup_menu_begin(C, IFACE_("Text"), ICON_NONE);
- if (txt_has_sel(text)) {
- uiItemO(layout, NULL, ICON_NONE, "TEXT_OT_cut");
- uiItemO(layout, NULL, ICON_NONE, "TEXT_OT_copy");
- }
- uiItemO(layout, NULL, ICON_NONE, "TEXT_OT_paste");
- uiItemO(layout, NULL, ICON_NONE, "TEXT_OT_new");
- uiItemO(layout, NULL, ICON_NONE, "TEXT_OT_open");
- uiItemO(layout, NULL, ICON_NONE, "TEXT_OT_save");
- uiItemO(layout, NULL, ICON_NONE, "TEXT_OT_save_as");
- uiItemO(layout, NULL, ICON_NONE, "TEXT_OT_run_script");
- UI_popup_menu_end(C, pup);
- }
- else {
- pup = UI_popup_menu_begin(C, IFACE_("File"), ICON_NONE);
- uiItemO(layout, NULL, ICON_NONE, "TEXT_OT_new");
- uiItemO(layout, NULL, ICON_NONE, "TEXT_OT_open");
- UI_popup_menu_end(C, pup);
- }
+ // RMB
+
+ uiPopupMenu *pup;
+
+ if (text) {
+ pup = UI_popup_menu_begin(C, IFACE_("Text"), ICON_NONE);
+ if (txt_has_sel(text)) {
+ uiItemO(layout, NULL, ICON_NONE, "TEXT_OT_cut");
+ uiItemO(layout, NULL, ICON_NONE, "TEXT_OT_copy");
+ }
+ uiItemO(layout, NULL, ICON_NONE, "TEXT_OT_paste");
+ uiItemO(layout, NULL, ICON_NONE, "TEXT_OT_new");
+ uiItemO(layout, NULL, ICON_NONE, "TEXT_OT_open");
+ uiItemO(layout, NULL, ICON_NONE, "TEXT_OT_save");
+ uiItemO(layout, NULL, ICON_NONE, "TEXT_OT_save_as");
+ uiItemO(layout, NULL, ICON_NONE, "TEXT_OT_run_script");
+ UI_popup_menu_end(C, pup);
+ }
+ else {
+ pup = UI_popup_menu_begin(C, IFACE_("File"), ICON_NONE);
+ uiItemO(layout, NULL, ICON_NONE, "TEXT_OT_new");
+ uiItemO(layout, NULL, ICON_NONE, "TEXT_OT_open");
+ UI_popup_menu_end(C, pup);
+ }
}
{
- // Alt+Shift+E
+ // Alt+Shift+E
- uiPopupMenu *pup;
+ uiPopupMenu *pup;
- pup = UI_popup_menu_begin(C, IFACE_("Edit"), ICON_NONE);
- uiItemO(layout, NULL, ICON_NONE, "TEXT_OT_cut");
- uiItemO(layout, NULL, ICON_NONE, "TEXT_OT_copy");
- uiItemO(layout, NULL, ICON_NONE, "TEXT_OT_paste");
- UI_popup_menu_end(C, pup);
+ pup = UI_popup_menu_begin(C, IFACE_("Edit"), ICON_NONE);
+ uiItemO(layout, NULL, ICON_NONE, "TEXT_OT_cut");
+ uiItemO(layout, NULL, ICON_NONE, "TEXT_OT_copy");
+ uiItemO(layout, NULL, ICON_NONE, "TEXT_OT_paste");
+ UI_popup_menu_end(C, pup);
}
{
- // Alt+Shift+F
-
- uiPopupMenu *pup;
-
- if (text) {
- pup = UI_popup_menu_begin(C, IFACE_("Text"), ICON_NONE);
- uiItemO(layout, NULL, ICON_NONE, "TEXT_OT_new");
- uiItemO(layout, NULL, ICON_NONE, "TEXT_OT_open");
- uiItemO(layout, NULL, ICON_NONE, "TEXT_OT_save");
- uiItemO(layout, NULL, ICON_NONE, "TEXT_OT_save_as");
- uiItemO(layout, NULL, ICON_NONE, "TEXT_OT_run_script");
- UI_popup_menu_end(C, pup);
- }
- else {
- pup = UI_popup_menu_begin(C, IFACE_("File"), ICON_NONE);
- uiItemO(layout, NULL, ICON_NONE, "TEXT_OT_new");
- uiItemO(layout, NULL, ICON_NONE, "TEXT_OT_open");
- UI_popup_menu_end(C, pup);
- }
+ // Alt+Shift+F
+
+ uiPopupMenu *pup;
+
+ if (text) {
+ pup = UI_popup_menu_begin(C, IFACE_("Text"), ICON_NONE);
+ uiItemO(layout, NULL, ICON_NONE, "TEXT_OT_new");
+ uiItemO(layout, NULL, ICON_NONE, "TEXT_OT_open");
+ uiItemO(layout, NULL, ICON_NONE, "TEXT_OT_save");
+ uiItemO(layout, NULL, ICON_NONE, "TEXT_OT_save_as");
+ uiItemO(layout, NULL, ICON_NONE, "TEXT_OT_run_script");
+ UI_popup_menu_end(C, pup);
+ }
+ else {
+ pup = UI_popup_menu_begin(C, IFACE_("File"), ICON_NONE);
+ uiItemO(layout, NULL, ICON_NONE, "TEXT_OT_new");
+ uiItemO(layout, NULL, ICON_NONE, "TEXT_OT_open");
+ UI_popup_menu_end(C, pup);
+ }
}
{
- // Alt+Shift+V
-
- uiPopupMenu *pup;
-
- pup = UI_popup_menu_begin(C, IFACE_("Text"), ICON_NONE);
- uiItemEnumO(layout, "TEXT_OT_move", CTX_IFACE_(BLT_I18NCONTEXT_OPERATOR_DEFAULT, "Top of File"),
- 0, "type", FILE_TOP);
- uiItemEnumO(layout, "TEXT_OT_move", CTX_IFACE_(BLT_I18NCONTEXT_OPERATOR_DEFAULT, "Bottom of File"),
- 0, "type", FILE_BOTTOM);
- uiItemEnumO(layout, "TEXT_OT_move", CTX_IFACE_(BLT_I18NCONTEXT_OPERATOR_DEFAULT, "Page Up"), 0, "type", PREV_PAGE);
- uiItemEnumO(layout, "TEXT_OT_move", CTX_IFACE_(BLT_I18NCONTEXT_OPERATOR_DEFAULT, "Page Down"),
- 0, "type", NEXT_PAGE);
- UI_popup_menu_end(C, pup);
+ // Alt+Shift+V
+
+ uiPopupMenu *pup;
+
+ pup = UI_popup_menu_begin(C, IFACE_("Text"), ICON_NONE);
+ uiItemEnumO(layout, "TEXT_OT_move", CTX_IFACE_(BLT_I18NCONTEXT_OPERATOR_DEFAULT, "Top of File"),
+ 0, "type", FILE_TOP);
+ uiItemEnumO(layout, "TEXT_OT_move", CTX_IFACE_(BLT_I18NCONTEXT_OPERATOR_DEFAULT, "Bottom of File"),
+ 0, "type", FILE_BOTTOM);
+ uiItemEnumO(layout, "TEXT_OT_move", CTX_IFACE_(BLT_I18NCONTEXT_OPERATOR_DEFAULT, "Page Up"), 0, "type", PREV_PAGE);
+ uiItemEnumO(layout, "TEXT_OT_move", CTX_IFACE_(BLT_I18NCONTEXT_OPERATOR_DEFAULT, "Page Down"),
+ 0, "type", NEXT_PAGE);
+ UI_popup_menu_end(C, pup);
}
#endif