Blender  V2.59
rna_sequencer_api.c
Go to the documentation of this file.
00001 /*
00002  * $Id: rna_sequencer_api.c 36972 2011-05-28 09:59:34Z lmg $
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  * Contributor(s): Blender Foundation (2010)
00021  *
00022  * ***** END GPL LICENSE BLOCK *****
00023  */
00024 
00031 #include <stdlib.h>
00032 #include <stdio.h>
00033 #include <string.h>
00034 
00035 #include "RNA_define.h"
00036 
00037 #include "BLO_sys_types.h" /* needed for intptr_t used in ED_mesh.h */
00038 
00039 #include "RNA_access.h"
00040 #include "RNA_define.h"
00041 
00042 #include "rna_internal.h"
00043 
00044 #include "DNA_scene_types.h"
00045 #include "DNA_sequence_types.h"
00046 
00047 #ifdef RNA_RUNTIME
00048 
00049 #include "BKE_report.h"
00050 #include "BKE_sequencer.h"
00051 
00052 static void rna_Sequence_swap_internal(Sequence *seq_self, ReportList *reports, Sequence *seq_other)
00053 {
00054         const char *error_msg;
00055         
00056         if(seq_swap(seq_self, seq_other, &error_msg) == 0)
00057                 BKE_report(reports, RPT_ERROR, error_msg);
00058 }
00059 
00060 #else
00061 
00062 void RNA_api_sequence_strip(StructRNA *srna)
00063 {
00064         FunctionRNA *func;
00065         PropertyRNA *parm;
00066 
00067         func= RNA_def_function(srna, "getStripElem", "give_stripelem");
00068         RNA_def_function_ui_description(func, "Return the strip element from a given frame or None.");
00069         parm= RNA_def_int(func, "frame", 0, -MAXFRAME, MAXFRAME, "Frame", "The frame to get the strip element from", -MAXFRAME, MAXFRAME);
00070         RNA_def_property_flag(parm, PROP_REQUIRED);
00071         RNA_def_function_return(func, RNA_def_pointer(func, "elem", "SequenceElement", "", "strip element of the current frame"));
00072 
00073         func= RNA_def_function(srna, "swap", "rna_Sequence_swap_internal");
00074         RNA_def_function_flag(func, FUNC_USE_REPORTS);
00075         parm= RNA_def_pointer(func, "other", "Sequence", "Other", "");
00076         RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
00077 }
00078 
00079 #endif