Blender  V2.59
script_ops.c
Go to the documentation of this file.
00001 /*
00002  * $Id: script_ops.c 35242 2011-02-27 20:29:51Z jesterking $
00003  *
00004  * ***** BEGIN GPL LICENSE BLOCK *****
00005  *
00006  * This program is free software; you can redistribute it and/or
00007  * modify it under the terms of the GNU General Public License
00008  * as published by the Free Software Foundation; either version 2
00009  * of the License, or (at your option) any later version.
00010  *
00011  * This program is distributed in the hope that it will be useful,
00012  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014  * GNU General Public License for more details.
00015  *
00016  * You should have received a copy of the GNU General Public License
00017  * along with this program; if not, write to the Free Software Foundation,
00018  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
00019  *
00020  * The Original Code is Copyright (C) 2008 Blender Foundation.
00021  * All rights reserved.
00022  *
00023  *
00024  * Contributor(s): Blender Foundation
00025  *
00026  * ***** END GPL LICENSE BLOCK *****
00027  */
00028 
00034 #include <stdlib.h>
00035 #include <math.h>
00036 
00037 
00038 #include "DNA_screen_types.h"
00039 #include "DNA_space_types.h"
00040 
00041 #include "BLI_math.h"
00042 #include "BLI_blenlib.h"
00043 
00044 #include "BKE_context.h"
00045 
00046 #include "RNA_access.h"
00047 
00048 #include "WM_api.h"
00049 #include "WM_types.h"
00050 
00051 
00052 #include "script_intern.h"
00053 
00054 
00055 /* ************************** registration **********************************/
00056 
00057 void script_operatortypes(void)
00058 {
00059         WM_operatortype_append(SCRIPT_OT_python_file_run);
00060         WM_operatortype_append(SCRIPT_OT_reload);
00061 }
00062 
00063 void script_keymap(wmKeyConfig *keyconf)
00064 {
00065         wmKeyMap *keymap= WM_keymap_find(keyconf, "Script", SPACE_SCRIPT, 0);
00066 
00067         /* TODO - this is just while we have no way to load a text datablock */
00068         RNA_string_set(WM_keymap_add_item(keymap, "SCRIPT_OT_python_file_run", PKEY, KM_PRESS, KM_CTRL|KM_SHIFT|KM_ALT, 0)->ptr, "filepath", "test.py");
00069 }
00070