Blender V2.61 - r43446

rna_sequencer_api.c

Go to the documentation of this file.
00001 /*
00002  * ***** BEGIN GPL LICENSE BLOCK *****
00003  *
00004  * This program is free software; you can redistribute it and/or
00005  * modify it under the terms of the GNU General Public License
00006  * as published by the Free Software Foundation; either version 2
00007  * of the License, or (at your option) any later version.
00008  *
00009  * This program is distributed in the hope that it will be useful,
00010  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012  * GNU General Public License for more details.
00013  *
00014  * You should have received a copy of the GNU General Public License
00015  * along with this program; if not, write to the Free Software Foundation,
00016  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
00017  *
00018  * Contributor(s): Blender Foundation (2010)
00019  *
00020  * ***** END GPL LICENSE BLOCK *****
00021  */
00022 
00029 #include <stdlib.h>
00030 #include <stdio.h>
00031 #include <string.h>
00032 
00033 #include "RNA_define.h"
00034 
00035 #include "BLO_sys_types.h" /* needed for intptr_t used in ED_mesh.h */
00036 
00037 #include "RNA_access.h"
00038 #include "RNA_define.h"
00039 
00040 #include "rna_internal.h"
00041 
00042 #include "DNA_scene_types.h"
00043 #include "DNA_sequence_types.h"
00044 
00045 #ifdef RNA_RUNTIME
00046 
00047 #include "BKE_report.h"
00048 #include "BKE_sequencer.h"
00049 
00050 static void rna_Sequence_swap_internal(Sequence *seq_self, ReportList *reports, Sequence *seq_other)
00051 {
00052     const char *error_msg;
00053     
00054     if(seq_swap(seq_self, seq_other, &error_msg) == 0)
00055         BKE_report(reports, RPT_ERROR, error_msg);
00056 }
00057 
00058 #else
00059 
00060 void RNA_api_sequence_strip(StructRNA *srna)
00061 {
00062     FunctionRNA *func;
00063     PropertyRNA *parm;
00064 
00065     func= RNA_def_function(srna, "getStripElem", "give_stripelem");
00066     RNA_def_function_ui_description(func, "Return the strip element from a given frame or None");
00067     parm= RNA_def_int(func, "frame", 0, -MAXFRAME, MAXFRAME, "Frame",
00068                       "The frame to get the strip element from", -MAXFRAME, MAXFRAME);
00069     RNA_def_property_flag(parm, PROP_REQUIRED);
00070     RNA_def_function_return(func, RNA_def_pointer(func, "elem", "SequenceElement", "", "strip element of the current frame"));
00071 
00072     func= RNA_def_function(srna, "swap", "rna_Sequence_swap_internal");
00073     RNA_def_function_flag(func, FUNC_USE_REPORTS);
00074     parm= RNA_def_pointer(func, "other", "Sequence", "Other", "");
00075     RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
00076 }
00077 
00078 #endif