remove unused includes from editors/space_*
[blender.git] / source / blender / editors / space_sequencer / sequencer_buttons.c
1 /**
2  * $Id$
3  *
4  * ***** BEGIN GPL LICENSE BLOCK *****
5  *
6  * This program is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU General Public License
8  * as published by the Free Software Foundation; either version 2
9  * of the License, or (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, write to the Free Software Foundation,
18  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
19  *
20  * The Original Code is Copyright (C) 2009 by Blender Foundation
21  * All rights reserved.
22  *
23  * ***** END GPL LICENSE BLOCK *****
24  */
25
26
27 #include <string.h>
28 #include <stdio.h>
29
30
31 #include "MEM_guardedalloc.h"
32
33 #include "BLI_blenlib.h"
34
35 #include "BKE_context.h"
36 #include "BKE_screen.h"
37
38
39 #include "ED_screen.h"
40
41
42 #include "WM_api.h"
43 #include "WM_types.h"
44
45 #include "UI_interface.h"
46
47 #include "sequencer_intern.h"
48
49
50 static void do_sequencer_panel_events(bContext *C, void *arg, int event)
51 {
52
53 }
54
55
56 static void sequencer_panel_view_properties(const bContext *C, Panel *pa)
57 {
58         uiBlock *block;
59
60         block= uiLayoutAbsoluteBlock(pa->layout);
61         uiBlockSetHandleFunc(block, do_sequencer_panel_events, NULL);
62         
63 }
64
65
66 static void sequencer_panel_properties(const bContext *C, Panel *pa)
67 {
68         uiBlock *block;
69         
70         block= uiLayoutAbsoluteBlock(pa->layout);
71         uiBlockSetHandleFunc(block, do_sequencer_panel_events, NULL);
72
73 }       
74
75 void sequencer_buttons_register(ARegionType *art)
76 {
77         PanelType *pt;
78
79         pt= MEM_callocN(sizeof(PanelType), "spacetype sequencer strip properties");
80         strcpy(pt->idname, "SEQUENCER_PT_properties");
81         strcpy(pt->label, "Strip Properties");
82         pt->draw= sequencer_panel_properties;
83         BLI_addtail(&art->paneltypes, pt);
84
85         pt= MEM_callocN(sizeof(PanelType), "spacetype sequencer view properties");
86         strcpy(pt->idname, "SEQUENCER_PT_view_properties");
87         strcpy(pt->label, "View Properties");
88         pt->draw= sequencer_panel_view_properties;
89         BLI_addtail(&art->paneltypes, pt);
90
91 }
92
93 /* **************** operator to open/close properties view ************* */
94
95 static int sequencer_properties(bContext *C, wmOperator *op)
96 {
97         ScrArea *sa= CTX_wm_area(C);
98         ARegion *ar= sequencer_has_buttons_region(sa);
99         
100         if(ar)
101                 ED_region_toggle_hidden(C, ar);
102
103         return OPERATOR_FINISHED;
104 }
105
106 void SEQUENCER_OT_properties(wmOperatorType *ot)
107 {
108         ot->name= "Properties";
109         ot->idname= "SEQUENCER_OT_properties";
110         ot->description= "Open sequencer properties panel";
111         
112         ot->exec= sequencer_properties;
113         ot->poll= ED_operator_sequencer_active;
114         
115         /* flags */
116         ot->flag= 0;
117 }
118