Code cleanup:

* Remove some non used *_button_register functions, panels are done in python.
* Remove do_node_region_buttons, was not used anymore.

Fix:
* Only show Grease Pencil panel in the Node editor, when there is a valid nodetree.
This commit is contained in:
Thomas Dinges
2012-04-13 00:04:56 +00:00
parent 2a5a465e2c
commit bdce58a42c
7 changed files with 1 additions and 124 deletions

View File

@@ -50,59 +50,6 @@
#include "interface_intern.h"
#include "logic_intern.h"
#if 0
static void do_logic_panel_events(bContext *C, void *arg, int event)
{
switch(event) {
}
}
/* *** */
static void logic_panel_properties(const bContext *C, Panel *pa)
{
// SpaceLogic *slogic= CTX_wm_space_logic(C);
uiBlock *block;
block= uiLayoutAbsoluteBlock(pa->layout);
uiBlockSetHandleFunc(block, do_logic_panel_events, NULL);
}
static void logic_panel_view_properties(const bContext *C, Panel *pa)
{
// SpaceLogic *slogic= CTX_wm_space_logic(C);
uiBlock *block;
block= uiLayoutAbsoluteBlock(pa->layout);
uiBlockSetHandleFunc(block, do_logic_panel_events, NULL);
}
#endif
void logic_buttons_register(ARegionType *UNUSED(art))
{
#if 0
PanelType *pt;
pt= MEM_callocN(sizeof(PanelType), "spacetype logic panel properties");
strcpy(pt->idname, "LOGIC_PT_properties");
strcpy(pt->label, "Logic Properties");
pt->draw= logic_panel_properties;
BLI_addtail(&art->paneltypes, pt);
pt= MEM_callocN(sizeof(PanelType), "spacetype logic view properties");
strcpy(pt->idname, "LOGIC_PT_view_properties");
strcpy(pt->label, "View Properties");
pt->draw= logic_panel_view_properties;
BLI_addtail(&art->paneltypes, pt);
#endif
}
static int logic_properties(bContext *C, wmOperator *UNUSED(op))
{
ScrArea *sa= CTX_wm_area(C);

View File

@@ -48,7 +48,6 @@ struct ARegion *logic_has_buttons_region(struct ScrArea *sa);
/* logic_ops.c */
/* logic_buttons.c */
void logic_buttons_register(struct ARegionType *art);
void LOGIC_OT_properties(struct wmOperatorType *ot);
void LOGIC_OT_links_cut(struct wmOperatorType *ot);

View File

@@ -337,8 +337,6 @@ void ED_spacetype_logic(void)
art->draw= logic_buttons_area_draw;
BLI_addhead(&st->regiontypes, art);
logic_buttons_register(art);
/* regions: header */
art= MEM_callocN(sizeof(ARegionType), "spacetype logic region");
art->regionid = RGN_TYPE_HEADER;

View File

@@ -64,19 +64,6 @@
/* ******************* node space & buttons ************** */
#define B_NOP 1
#define B_REDR 2
static void do_node_region_buttons(bContext *C, void *UNUSED(arg), int event)
{
//SpaceNode *snode= CTX_wm_space_node(C);
switch(event) {
case B_REDR:
ED_area_tag_redraw(CTX_wm_area(C));
return; /* no notifier! */
}
}
/* poll callback for active node */
static int active_node_poll(const bContext *C, PanelType *UNUSED(pt))
@@ -94,7 +81,6 @@ static void active_node_panel(const bContext *C, Panel *pa)
bNodeTree *ntree= (snode) ? snode->edittree : NULL;
bNode *node = (ntree) ? nodeGetActive(ntree) : NULL; // xxx... for editing group nodes
uiLayout *layout= pa->layout;
uiBlock *block;
PointerRNA ptr;
/* verify pointers, and create RNA pointer for the node */
@@ -105,11 +91,6 @@ static void active_node_panel(const bContext *C, Panel *pa)
//else
RNA_pointer_create(&ntree->id, &RNA_Node, node, &ptr);
/* set update callback */
// xxx is this really needed
block= uiLayoutGetBlock(layout);
uiBlockSetHandleFunc(block, do_node_region_buttons, NULL);
/* draw this node's name, etc. */
uiItemR(layout, &ptr, "label", 0, NULL, ICON_NODE);
uiItemS(layout);
@@ -179,6 +160,7 @@ void node_buttons_register(ARegionType *art)
strcpy(pt->idname, "NODE_PT_gpencil");
strcpy(pt->label, "Grease Pencil");
pt->draw= gpencil_panel_standard;
pt->poll= active_node_poll;
BLI_addtail(&art->paneltypes, pt);
}

View File

@@ -48,50 +48,6 @@
#include "sequencer_intern.h"
static void do_sequencer_panel_events(bContext *UNUSED(C), void *UNUSED(arg), int UNUSED(event))
{
}
static void sequencer_panel_view_properties(const bContext *UNUSED(C), Panel *pa)
{
uiBlock *block;
block = uiLayoutAbsoluteBlock(pa->layout);
uiBlockSetHandleFunc(block, do_sequencer_panel_events, NULL);
}
static void sequencer_panel_properties(const bContext *UNUSED(C), Panel *pa)
{
uiBlock *block;
block = uiLayoutAbsoluteBlock(pa->layout);
uiBlockSetHandleFunc(block, do_sequencer_panel_events, NULL);
}
void sequencer_buttons_register(ARegionType *art)
{
PanelType *pt;
pt = MEM_callocN(sizeof(PanelType), "spacetype sequencer strip properties");
strcpy(pt->idname, "SEQUENCER_PT_properties");
strcpy(pt->label, "Strip Properties");
pt->draw = sequencer_panel_properties;
BLI_addtail(&art->paneltypes, pt);
pt = MEM_callocN(sizeof(PanelType), "spacetype sequencer view properties");
strcpy(pt->idname, "SEQUENCER_PT_view_properties");
strcpy(pt->label, "View Properties");
pt->draw = sequencer_panel_view_properties;
BLI_addtail(&art->paneltypes, pt);
}
/* **************** operator to open/close properties view ************* */
static int sequencer_properties(bContext *C, wmOperator *UNUSED(op))

View File

@@ -176,7 +176,6 @@ struct ImBuf *make_histogram_view_from_ibuf(struct ImBuf * ibuf);
/* sequencer_buttons.c */
void SEQUENCER_OT_properties(struct wmOperatorType *ot);
void sequencer_buttons_register(struct ARegionType *art);
#endif /* __SEQUENCER_INTERN_H__ */

View File

@@ -570,10 +570,6 @@ void ED_spacetype_sequencer(void)
art->init = sequencer_buttons_area_init;
art->draw = sequencer_buttons_area_draw;
BLI_addhead(&st->regiontypes, art);
/* Keep as python only for now
* sequencer_buttons_register(art);
*/
/* regions: header */
art = MEM_callocN(sizeof(ARegionType), "spacetype sequencer region");