X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=src%2Fswfc-history.h;fp=src%2Fswfc-history.h;h=5ced477d53876e31b6b985c7038bd2c7a8bd3123;hb=3ef17c4cee41231e1eed731c08381d3ddf0c8d1a;hp=0000000000000000000000000000000000000000;hpb=d1920e49f268abad90e5aabed8b65f6ea048a681;p=swftools.git diff --git a/src/swfc-history.h b/src/swfc-history.h new file mode 100644 index 0000000..5ced477 --- /dev/null +++ b/src/swfc-history.h @@ -0,0 +1,103 @@ +/* swfc- Compiles swf code (.sc) files into .swf files. + + Part of the swftools package. + + Copyright (c) 2007 Huub Schaeks + Copyright (c) 2007 Matthias Kramm + + 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 */ + +#ifndef __HISTORY_H +#define __HISTORY_Y + +#include "types.h" +#include "rfxswf.h" +#include "q.h" +#include "feedback.h" +#include "interpolation.h" + +enum +{ + CF_PUT = 1, + CF_CHANGE = 2, + CF_QCHANGE = 3, + CF_ARCCHANGE = 4, + CF_JUMP = 5 +}; + +#define SF_X 0x0001 +#define SF_Y 0x0002 +#define SF_SCALEX 0x0004 +#define SF_SCALEY 0x0008 +#define SF_CX_R 0x0010 +#define SF_CX_G 0x0020 +#define SF_CX_B 0x0040 +#define SF_CX_A 0x0080 +#define SF_ROTATE 0x0100 +#define SF_SHEAR 0x0200 +#define SF_PIVOT 0x0400 +#define SF_PIN 0x0800 +#define SF_BLEND 0x01000 +#define SF_FILTER 0x02000 + + +typedef struct _change +{ + U16 frame; + float value; + int function; + interpolation_t* interpolation; + struct _change* next; +} change_t; + +change_t* change_new(U16 frame, int function, float value, interpolation_t* inter); +void change_free(change_t* change); +void change_init(change_t* change); +void change_append(change_t* first, change_t* newChange); +float change_value(change_t* first, U16 frame); + +typedef struct _changeFilter +{ + U16 frame; + FILTER* value; + int function; + interpolation_t* interpolation; + struct _changeFilter* next; +} changeFilter_t; + +changeFilter_t* changeFilter_new(U16 frame, int function, FILTER* value, interpolation_t* inter); +void changeFilter_free(changeFilter_t* change); +void changeFilter_init(changeFilter_t* change); +void changeFilter_append(changeFilter_t* first, changeFilter_t* newChange); +FILTER* changeFilter_value(changeFilter_t* first, U16 frame); + +typedef struct _history +{ + U16 firstFrame; + TAG* firstTag; + dictionary_t* changes; +} history_t; + +history_t* history_new(); +void history_free(history_t* past); +void history_init(history_t* past); +void history_begin(history_t* past, char* parameter, U16 frame, TAG* tag, float value); +void history_beginFilter(history_t* past, U16 frame, TAG* tag, FILTER* value); +void history_remember(history_t* past, char* parameter, U16 frame, int function, float value, interpolation_t* inter); +void history_rememberFilter(history_t* past, U16 frame, int function, FILTER* value, interpolation_t* inter); +float history_value(history_t* past, U16 frame, char* parameter); +FILTER* history_valueFilter(history_t* past, U16 frame); + +#endif