2009-06-16 13:09:36 +00:00
|
|
|
/**
|
2009-06-23 00:09:26 +00:00
|
|
|
* $Id$
|
2009-06-16 13:09:36 +00:00
|
|
|
*
|
|
|
|
* ***** BEGIN GPL LICENSE BLOCK *****
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
* as published by the Free Software Foundation; either version 2
|
|
|
|
* of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software Foundation,
|
|
|
|
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
|
|
*
|
|
|
|
* The Original Code is Copyright (C) 2009 by Blender Foundation
|
|
|
|
* All rights reserved.
|
|
|
|
*
|
|
|
|
* ***** END GPL LICENSE BLOCK *****
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
#include <string.h>
|
|
|
|
#include <stdio.h>
|
|
|
|
|
|
|
|
#include "DNA_object_types.h"
|
|
|
|
#include "DNA_node_types.h"
|
|
|
|
#include "DNA_space_types.h"
|
|
|
|
#include "DNA_scene_types.h"
|
|
|
|
#include "DNA_screen_types.h"
|
|
|
|
#include "DNA_userdef_types.h"
|
|
|
|
|
|
|
|
#include "MEM_guardedalloc.h"
|
|
|
|
|
|
|
|
#include "BLI_blenlib.h"
|
2009-11-10 20:43:45 +00:00
|
|
|
#include "BLI_math.h"
|
2009-06-16 13:09:36 +00:00
|
|
|
|
|
|
|
#include "BKE_context.h"
|
|
|
|
#include "BKE_global.h"
|
|
|
|
#include "BKE_library.h"
|
|
|
|
#include "BKE_main.h"
|
|
|
|
#include "BKE_mesh.h"
|
|
|
|
#include "BKE_node.h"
|
|
|
|
#include "BKE_screen.h"
|
|
|
|
#include "BKE_utildefines.h"
|
|
|
|
|
|
|
|
#include "ED_space_api.h"
|
|
|
|
#include "ED_screen.h"
|
|
|
|
#include "ED_util.h"
|
|
|
|
|
|
|
|
#include "BIF_gl.h"
|
|
|
|
#include "BIF_glutil.h"
|
|
|
|
|
|
|
|
#include "RNA_access.h"
|
|
|
|
|
|
|
|
#include "WM_api.h"
|
|
|
|
#include "WM_types.h"
|
|
|
|
|
|
|
|
#include "UI_interface.h"
|
|
|
|
#include "UI_resources.h"
|
|
|
|
#include "UI_view2d.h"
|
|
|
|
|
|
|
|
#include "logic_intern.h"
|
|
|
|
|
2009-07-20 16:21:55 +00:00
|
|
|
#if 0
|
2009-06-16 13:09:36 +00:00
|
|
|
static void do_logic_panel_events(bContext *C, void *arg, int event)
|
|
|
|
{
|
|
|
|
|
|
|
|
switch(event) {
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/* *** */
|
|
|
|
|
|
|
|
static void logic_panel_properties(const bContext *C, Panel *pa)
|
|
|
|
{
|
2009-07-28 16:33:02 +00:00
|
|
|
// SpaceLogic *slogic= CTX_wm_space_logic(C);
|
2009-06-16 13:09:36 +00:00
|
|
|
uiBlock *block;
|
|
|
|
|
2009-10-09 10:45:11 +00:00
|
|
|
block= uiLayoutAbsoluteBlock(pa->layout);
|
2009-06-16 13:09:36 +00:00
|
|
|
uiBlockSetHandleFunc(block, do_logic_panel_events, NULL);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
static void logic_panel_view_properties(const bContext *C, Panel *pa)
|
|
|
|
{
|
2009-07-28 16:33:02 +00:00
|
|
|
// SpaceLogic *slogic= CTX_wm_space_logic(C);
|
2009-06-16 13:09:36 +00:00
|
|
|
uiBlock *block;
|
|
|
|
|
2009-10-09 10:45:11 +00:00
|
|
|
block= uiLayoutAbsoluteBlock(pa->layout);
|
2009-06-16 13:09:36 +00:00
|
|
|
uiBlockSetHandleFunc(block, do_logic_panel_events, NULL);
|
|
|
|
|
|
|
|
}
|
2009-07-20 16:21:55 +00:00
|
|
|
#endif
|
2009-06-16 13:09:36 +00:00
|
|
|
|
|
|
|
void logic_buttons_register(ARegionType *art)
|
|
|
|
{
|
2009-07-20 16:21:55 +00:00
|
|
|
#if 0
|
2009-07-28 16:33:02 +00:00
|
|
|
PanelType *pt;
|
|
|
|
|
2009-06-16 13:09:36 +00:00
|
|
|
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);
|
2009-07-20 16:21:55 +00:00
|
|
|
#endif
|
2009-06-16 13:09:36 +00:00
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
static int logic_properties(bContext *C, wmOperator *op)
|
|
|
|
{
|
|
|
|
ScrArea *sa= CTX_wm_area(C);
|
|
|
|
ARegion *ar= logic_has_buttons_region(sa);
|
|
|
|
|
2009-09-14 19:12:29 +00:00
|
|
|
if(ar)
|
|
|
|
ED_region_toggle_hidden(C, ar);
|
|
|
|
|
2009-06-16 13:09:36 +00:00
|
|
|
return OPERATOR_FINISHED;
|
|
|
|
}
|
|
|
|
|
|
|
|
void LOGIC_OT_properties(wmOperatorType *ot)
|
|
|
|
{
|
|
|
|
ot->name= "Properties";
|
2009-10-24 23:26:28 +00:00
|
|
|
ot->description= "Toggle display properties panel.";
|
2009-06-16 13:09:36 +00:00
|
|
|
ot->idname= "LOGIC_OT_properties";
|
|
|
|
|
|
|
|
ot->exec= logic_properties;
|
|
|
|
ot->poll= ED_operator_logic_active;
|
|
|
|
|
|
|
|
/* flags */
|
|
|
|
ot->flag= 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|