code cleanup: remove unused and unsupported functions from libmv-capi
[blender.git] / source / blender / editors / space_sequencer / sequencer_buttons.c
1 /*
2  * ***** BEGIN GPL LICENSE BLOCK *****
3  *
4  * This program is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU General Public License
6  * as published by the Free Software Foundation; either version 2
7  * of the License, or (at your option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program; if not, write to the Free Software Foundation,
16  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17  *
18  * The Original Code is Copyright (C) 2009 by Blender Foundation
19  * All rights reserved.
20  *
21  * ***** END GPL LICENSE BLOCK *****
22  */
23
24 /** \file blender/editors/space_sequencer/sequencer_buttons.c
25  *  \ingroup spseq
26  */
27
28 #include <string.h>
29 #include <stdio.h>
30
31
32 #include "MEM_guardedalloc.h"
33
34 #include "BLI_blenlib.h"
35 #include "BLI_utildefines.h"
36
37 #include "BLF_translation.h"
38
39 #include "BKE_context.h"
40 #include "BKE_screen.h"
41
42 #include "ED_screen.h"
43 #include "ED_gpencil.h"
44 #include "ED_sequencer.h"
45
46 #include "WM_api.h"
47 #include "WM_types.h"
48
49 #include "UI_interface.h"
50
51 #include "sequencer_intern.h"
52
53 /* **************************** buttons ********************************* */
54
55 static int sequencer_grease_pencil_panel_poll(const bContext *C, PanelType *UNUSED(pt))
56 {
57         SpaceSeq *sseq = CTX_wm_space_seq(C);
58
59         /* don't show the gpencil if we are not showing the image */
60         return ED_space_sequencer_check_show_imbuf(sseq);
61 }
62
63 void sequencer_buttons_register(ARegionType *art)
64 {
65         PanelType *pt;
66         
67         pt = MEM_callocN(sizeof(PanelType), "spacetype sequencer panel gpencil");
68         strcpy(pt->idname, "SEQUENCER_PT_gpencil");
69         strcpy(pt->label, N_("Grease Pencil"));
70         pt->draw_header = gpencil_panel_standard_header;
71         pt->draw = gpencil_panel_standard;
72         pt->poll = sequencer_grease_pencil_panel_poll;
73         BLI_addtail(&art->paneltypes, pt);
74 }
75
76 /* **************** operator to open/close properties view ************* */
77
78 static int sequencer_properties(bContext *C, wmOperator *UNUSED(op))
79 {
80         ScrArea *sa = CTX_wm_area(C);
81         ARegion *ar = sequencer_has_buttons_region(sa);
82         
83         if (ar)
84                 ED_region_toggle_hidden(C, ar);
85
86         return OPERATOR_FINISHED;
87 }
88
89 void SEQUENCER_OT_properties(wmOperatorType *ot)
90 {
91         ot->name = "Properties";
92         ot->idname = "SEQUENCER_OT_properties";
93         ot->description = "Open sequencer properties panel";
94         
95         ot->exec = sequencer_properties;
96         ot->poll = ED_operator_sequencer_active;
97         
98         /* flags */
99         ot->flag = 0;
100 }
101