mGEff API Reference
v1.2.0
An animation framework for MiniGUI apps
|
Effector headfile. More...
#include <stdint.h>
#include <minigui/common.h>
#include <minigui/minigui.h>
#include <minigui/gdi.h>
#include <minigui/window.h>
#include "mgeff-common.h"
#include "mgeff-animation.h"
#include "mgeff-effector-source.h"
#include "mgeff-effector-sink.h"
Go to the source code of this file.
Data Structures | |
struct | _EFFECTOROPS |
it contains whole info of an effector, if you want to custom an effector, implement it More... | |
Typedefs | |
typedef int(* | MGEFF_EFFECTOR_SETPROPERTY) (MGEFF_EFFECTOR effector, int property_id, int value) |
effector callback More... | |
typedef int(* | MGEFF_EFFECTOR_GETPROPERTY) (MGEFF_EFFECTOR effector, int property_id, int *pValue) |
Type of effector get property callback functio. More... | |
typedef void(* | MGEFF_EFFECTOR_ANIM_ONDRAW) (MGEFF_ANIMATION animation, MGEFF_EFFECTOR effector, HDC sink_dc, intptr_t id, void *value) |
Type of effector on draw callback function. More... | |
typedef void(* | MGEFF_EFFECTOR_ONBEGINDRAW) (MGEFF_ANIMATION animation, MGEFF_EFFECTOR effector) |
Type of effector begin draw callback function. More... | |
typedef void(* | MGEFF_EFFECTOR_ONENDDRAW) (MGEFF_ANIMATION animation, MGEFF_EFFECTOR effector) |
Type of effector end draw callback function. More... | |
typedef MGEFF_EFFECTOR(* | MGEFF_EFFECTOR_INIT) (MGEFF_EFFECTOR effector) |
Type of effector init callback function. More... | |
typedef void(* | MGEFF_EFFECTOR_FINALIZE) (MGEFF_EFFECTOR effector) |
Type of effector finalize callback function. More... | |
typedef struct _EFFECTOROPS | MGEFF_EFFECTOROPS |
it contains whole info of an effector, if you want to custom an effector, implement it | |
Enumerations | |
enum | LeafProperty { MGEFF_DIRECTION_LEFT2RIGHT = 0, MGEFF_DIRECTION_RIGHT2LEFT = 1, MGEFF_DIRECTION_TOP2BOTTOM = 2, MGEFF_DIRECTION_BOTTOM2TOP = 3 } |
LeafProperty. | |
enum | CenterSplitProperty { MGEFF_DIRECTION_CENTER2OUTSIDE_4 = 0, MGEFF_DIRECTION_OUTSIDE2CENTER_4 = 1, MGEFF_DIRECTION_CENTER2OUTSIDE_2 = 2, MGEFF_DIRECTION_OUTSIDE2CENTER_2 = 3 } |
CenterSplitProperty. | |
enum | AxisProperty { MGEFF_AXIS_X = 1, MGEFF_AXIS_Y = 2, MGEFF_AXIS_Z = 3 } |
AxisProperty. | |
enum | RotateDirectionProperty { MGEFF_CLOCKWISE = 0, MGEFF_CLOCKINVERSE = 1 } |
RotateDirectionProperty. | |
enum | ZoomProperty { MGEFF_DIRECTION_CENTER = 0, MGEFF_DIRECTION_LUP2RDOWN = 1, MGEFF_DIRECTION_LDOWN2RUP = 2, MGEFF_DIRECTION_RDOWN2LUP = 3, MGEFF_DIRECTION_RUP2LDOWN = 4 } |
ZoomProperty. | |
enum | ZoomTypeProperty { MGEFF_ZOOMIN, MGEFF_ZOOMOUT } |
ZoomTypeProperty. More... | |
Functions | |
MGEFF_DECLARE_HANDLE (MGEFF_EFFECTOR) | |
The handle to the effector. | |
MGEFF_EXPORT unsigned long | mGEffStr2Key (const char *str) |
Generate hash key of string. More... | |
MGEFF_EXPORT MGEFF_EFFECTOR | mGEffEffectorCreate (unsigned long key) |
Creates a effector. More... | |
MGEFF_EXPORT void | mGEffEffectorDelete (MGEFF_EFFECTOR handle) |
Deletes a effector. More... | |
MGEFF_EXPORT void | mGEffEffectorDeleteWithoutSink (MGEFF_EFFECTOR handle) |
Deletes a effector. More... | |
MGEFF_EXPORT int | mGEffEffectorAppendSource (MGEFF_EFFECTOR effector, MGEFF_SOURCE source) |
Appends a source to effector. More... | |
MGEFF_EXPORT int | mGEffEffectorSetSink (MGEFF_EFFECTOR effector, MGEFF_SINK sink) |
Sets the sink of a effector. More... | |
MGEFF_EXPORT MGEFF_SINK | mGEffEffectorGetSink (MGEFF_EFFECTOR effector) |
Gets the sink of a effector. More... | |
MGEFF_EXPORT HDC | mGEffEffectorGetSourceDC (MGEFF_EFFECTOR effector, int index) |
Gets the underlying DC of the source of a effector. More... | |
MGEFF_EXPORT int | mGEffEffectorSetProperty (MGEFF_EFFECTOR handle, int property_id, int value) |
Sets the property of a effector. More... | |
MGEFF_EXPORT int | mGEffEffectorGetProperty (MGEFF_EFFECTOR handle, int property_id, int *pValue) |
Sets the property of a effector. More... | |
MGEFF_EXPORT MGEFF_ANIMATION | mGEffAnimationCreateWithEffector (MGEFF_EFFECTOR effector) |
Creates a animation with a effector. More... | |
MGEFF_EXPORT int | mGEffFillEffectorAnimation (HWND hwnd, HDC src1_dc, HDC src2_dc, HDC dst_dc, unsigned long key, int duration) |
Fills a DC with a predefined effector. More... | |
MGEFF_EXPORT MGEFF_EFFECTOR | mGEffEffectorCreateEx (HDC src1_dc, HDC src2_dc, HDC dst_dc, unsigned long key) |
Creates a effector of certain type with given source DCs and destination DC. More... | |
MGEFF_EXPORT MGEFF_EFFECTOR | mGEffEffectorCreateWithoutSink (HDC src1_dc, HDC src2_dc, unsigned long key) |
Creates a effector of certain type with given source DCs but WITHOUT a destination DC. More... | |
MGEFF_EXPORT MGEFF_BOOL | mGEffEffectorRegister (const MGEFF_EFFECTOROPS *info) |
Register specail effector info. More... | |
MGEFF_EXPORT MGEFF_BOOL | mGEffEffectorUnRegister (const MGEFF_EFFECTOROPS *info) |
UnRegister specail effector info. More... | |
MGEFF_EXPORT MGEFF_ANIMATION | mGEffCreateRollerAnimation (HDC dc_rollup, HDC dc_expand, HDC dc_dst) |
create a roller animation from specail dc. More... | |
MGEFF_EXPORT void | mGEffEffectorSetContext (MGEFF_EFFECTOR handle, void *context) |
Sets the effector context. More... | |
MGEFF_EXPORT void * | mGEffEffectorGetContext (MGEFF_EFFECTOR handle) |
Gets the effector context. More... | |
MGEFF_EXPORT MGEFF_SOURCE | mGEffEffectorGetSource (MGEFF_EFFECTOR handle, int index) |
Gets the effector source. More... | |
MGEFF_EXPORT MGEFF_EFFECTOROPS * | mGEffEffectorGetOps (unsigned long key) |
Gets the effector MGEFF_EFFECTOROPS ops. More... | |
Effector headfile.
============================================================================
This file is part of mGEff, a component for MiniGUI. Copyright (C) 2008~2018, Beijing FMSoft Technologies Co., Ltd. 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 3 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, see <http://www.gnu.org/licenses/>. Or, As this program is a library, any link to this program must follow GNU General Public License version 3 (GPLv3). If you cannot accept GPLv3, you need to be licensed from FMSoft. If you have got a commercial license of this program, please use it under the terms and conditions of the commercial license. For more information about the commercial license, please refer to <http://www.minigui.com/en/about/licensing-policy/>.
#define EFFECTORNAME_MAX_LEN 31 |
effector name max length
#define MGEFF_EFFECTOR_ALPHA mGEffStr2Key(MGEFF_MINOR_alpha) |
alpha
#define MGEFF_EFFECTOR_BLOCKFLIP mGEffStr2Key(MGEFF_MINOR_blockflip) |
block flip
#define MGEFF_EFFECTOR_CENTERSPLIT mGEffStr2Key(MGEFF_MINOR_centersplit) |
center split
#define MGEFF_EFFECTOR_CLEAR mGEffStr2Key(MGEFF_MINOR_clear) |
clear
#define MGEFF_EFFECTOR_CUBIC_ROTATE mGEffStr2Key(MGEFF_MINOR_cubicrotate) |
cubic rotate
#define MGEFF_EFFECTOR_FIVEPOINTEDSTAR mGEffStr2Key(MGEFF_MINOR_fivepointedstar) |
five pointed star
#define MGEFF_EFFECTOR_FLIP mGEffStr2Key(MGEFF_MINOR_flip) |
flip
#define MGEFF_EFFECTOR_LEAFWINDOW mGEffStr2Key(MGEFF_MINOR_leafwindow) |
leaf window
#define MGEFF_EFFECTOR_MGPLUS_CUBIC_ROTATE mGEffStr2Key(MGEFF_MINOR_mgplus_cubicrotate) |
mGPlus cubic rotate
#define MGEFF_EFFECTOR_MGPLUS_FLIP mGEffStr2Key(MGEFF_MINOR_mgplus_flip) |
mGPlus flip
#define MGEFF_EFFECTOR_MGPLUS_ROTATE mGEffStr2Key(MGEFF_MINOR_mgplus_rotate) |
mGPlus rotate
#define MGEFF_EFFECTOR_OPENGL_COVERFLOW mGEffStr2Key(MGEFF_MINOR_es_coverflow) |
OpenGL ES cover flow
#define MGEFF_EFFECTOR_OPENGL_CUBICROTATE mGEffStr2Key(MGEFF_MINOR_es_cubicrotate) |
OpenGL ES cubic rotate
#define MGEFF_EFFECTOR_OPENGL_RECTROTATE mGEffStr2Key(MGEFF_MINOR_es_rectrotate) |
OpenGL ES rect rotate
#define MGEFF_EFFECTOR_PUSH mGEffStr2Key(MGEFF_MINOR_push) |
push
#define MGEFF_EFFECTOR_RADARSCAN mGEffStr2Key(MGEFF_MINOR_radarscan) |
radar scan
#define MGEFF_EFFECTOR_ROLLER mGEffStr2Key(MGEFF_MINOR_roller) |
roller
#define MGEFF_EFFECTOR_SCROLL mGEffStr2Key(MGEFF_MINOR_scroll) |
scroll
#define MGEFF_EFFECTOR_ZIP mGEffStr2Key(MGEFF_MINOR_zip) |
zip
#define MGEFF_EFFECTOR_ZOOM mGEffStr2Key(MGEFF_MINOR_zoom) |
zoom
#define MGEFF_MINOR_alpha "alphablending" |
alpha blending
#define MGEFF_MINOR_blockflip "blockflip" |
block flip
#define MGEFF_MINOR_centersplit "centersplit" |
center split
#define MGEFF_MINOR_clear "clear" |
clear
#define MGEFF_MINOR_cubicrotate "cubicrotate" |
cubic rotate
#define MGEFF_MINOR_es_coverflow "opengles-coverflow" |
OpenGL ES cover flow
#define MGEFF_MINOR_es_cubicrotate "opengles-cubicrotate" |
OpenGL ES cubic rotate
#define MGEFF_MINOR_es_rectrotate "opengles-rectrotate" |
OpenGL ES rect rotate
#define MGEFF_MINOR_fivepointedstar "fivepointedstar" |
five pointed star
#define MGEFF_MINOR_flip "flip" |
flip
#define MGEFF_MINOR_leafwindow "leafwindow" |
leaf window
#define MGEFF_MINOR_mgplus_cubicrotate "mgplus-cubicrotate" |
mGPlus cubic rotate
#define MGEFF_MINOR_mgplus_flip "mgplus-flip" |
mGPlus flip
#define MGEFF_MINOR_mgplus_rotate "mgplus-rotate" |
mGPlus rotate
#define MGEFF_MINOR_push "pushpoll" |
push
#define MGEFF_MINOR_radarscan "radarscan" |
radar scan
#define MGEFF_MINOR_roller "roller" |
roller
#define MGEFF_MINOR_scroll "scrollpage" |
scroll page
#define MGEFF_MINOR_zip "zip" |
zip
#define MGEFF_MINOR_zoom "zoominzoomout" |
zoom
#define MGEFF_PROPERTY_AXIS 2 |
property axis
#define MGEFF_PROPERTY_BACKGROUND 8 |
property background
#define MGEFF_PROPERTY_DIRECTION 1 |
effector property
property direction
#define MGEFF_PROPERTY_LEAFROWS 4 |
property leaf rows
#define MGEFF_PROPERTY_LEAFVERTICAL 5 |
property leaf vertical
#define MGEFF_PROPERTY_PIECES 9 |
property pieces
#define MGEFF_PROPERTY_RESOURCE 7 |
property resource
#define MGEFF_PROPERTY_STARTANGLE 10 |
property startangle
#define MGEFF_PROPERTY_ZOOM 6 |
property zoom
void(* MGEFF_EFFECTOR_ANIM_ONDRAW)(MGEFF_ANIMATION animation, MGEFF_EFFECTOR effector, HDC sink_dc, intptr_t id, void *value) |
Type of effector on draw callback function.
It is going to be called every frame
animation | animation handle |
effector | effector handle |
sink_dc | sink dc |
id | animation id |
value | animation current value, startvalue <= value <= endvalue |
void(* MGEFF_EFFECTOR_FINALIZE)(MGEFF_EFFECTOR effector) |
Type of effector finalize callback function.
It is going to be called when you delete the effector with calling mGEffEffectorDelete.
effector | effector handle |
int(* MGEFF_EFFECTOR_GETPROPERTY)(MGEFF_EFFECTOR effector, int property_id, int *pValue) |
Type of effector get property callback functio.
effector | effector handle. |
property_id | property id. |
pValue | property value. |
MGEFF_EFFECTOR(* MGEFF_EFFECTOR_INIT)(MGEFF_EFFECTOR effector) |
Type of effector init callback function.
It is going to be called when you create an effector with calling mGEffEffectorCreate or mGEffEffectorCreateEx.
effector |
void(* MGEFF_EFFECTOR_ONBEGINDRAW)(MGEFF_ANIMATION animation, MGEFF_EFFECTOR effector) |
Type of effector begin draw callback function.
It is going to be called when you create an animation with calling mGEffAnimationCreateWithEffector.
animation | animation handle |
effector | effector handle |
void(* MGEFF_EFFECTOR_ONENDDRAW)(MGEFF_ANIMATION animation, MGEFF_EFFECTOR effector) |
Type of effector end draw callback function.
It is going to be called when the animation specified by animation is finished.
animation | animation handle |
effector | effector handle |
int(* MGEFF_EFFECTOR_SETPROPERTY)(MGEFF_EFFECTOR effector, int property_id, int value) |
effector callback
Type of effector set property callback function .
effector | effector handle. |
property_id | property id. |
value | property value. |
enum ZoomTypeProperty |
MGEFF_ANIMATION mGEffAnimationCreateWithEffector | ( | MGEFF_EFFECTOR | effector | ) |
Creates a animation with a effector.
This function creates an animation whose SetProperty callback is a effector specified by effector and the id of the animation is specified by id.
effector | the handle of the effector. |
MGEFF_ANIMATION mGEffCreateRollerAnimation | ( | HDC | dc_rollup, |
HDC | dc_expand, | ||
HDC | dc_dst | ||
) |
create a roller animation from specail dc.
This function create a roller animation group with specified by dc_rollup, and dc_expand, the background is white.
dc_rollup | The rollup dc. |
dc_expand | The expand dc. |
dc_dst | The output dc. |
int mGEffEffectorAppendSource | ( | MGEFF_EFFECTOR | effector, |
MGEFF_SOURCE | source | ||
) |
Appends a source to effector.
This function appends a source specified by source to a effector specified by effector.
effector | the handle of the effector to which source is appended. |
source | the source to be appended. |
MGEFF_EFFECTOR mGEffEffectorCreate | ( | unsigned long | key | ) |
Creates a effector.
This function creates a effector of certain type specified by type.
key | the hash key of the effector. |
MGEFF_EFFECTOR mGEffEffectorCreateEx | ( | HDC | src1_dc, |
HDC | src2_dc, | ||
HDC | dst_dc, | ||
unsigned long | key | ||
) |
Creates a effector of certain type with given source DCs and destination DC.
This function creates a effector with source DCs specified by src1_dc and by src2_dc and the destination DC specified by dst_dc. The effector type is specified by type.
src1_dc | The first DC of the effector. |
src2_dc | The secondary DC of the effector. |
dst_dc | The destination DC of the effector. |
key | The hash key of the effector to be used. |
MGEFF_EFFECTOR mGEffEffectorCreateWithoutSink | ( | HDC | src1_dc, |
HDC | src2_dc, | ||
unsigned long | key | ||
) |
Creates a effector of certain type with given source DCs but WITHOUT a destination DC.
This function creates a effector with source DCs specified by src1_dc and by src2_dc. The effector type is specified by type.
src1_dc | The first DC of the effector. |
src2_dc | The secondary DC of the effector. |
key | The hash key of the effector to be used. |
void mGEffEffectorDelete | ( | MGEFF_EFFECTOR | handle | ) |
Deletes a effector.
This function deletes a effector specified by handle. source sink and destination sink will also be deleted.
handle | the handle of the effector. |
void mGEffEffectorDeleteWithoutSink | ( | MGEFF_EFFECTOR | handle | ) |
Deletes a effector.
This function deletes a effector specified by handle. source sink and destination sink will NOT be deleted.
handle | the handle of the effector. |
void * mGEffEffectorGetContext | ( | MGEFF_EFFECTOR | handle | ) |
Gets the effector context.
This function gets the context of the effector specified by handle.
handle | The hanle of the effector. |
MGEFF_EFFECTOROPS * mGEffEffectorGetOps | ( | unsigned long | key | ) |
Gets the effector MGEFF_EFFECTOROPS ops.
This function gets the ops of the effector specified by hash key.
key | The hash key of the effector. |
int mGEffEffectorGetProperty | ( | MGEFF_EFFECTOR | handle, |
int | property_id, | ||
int * | pValue | ||
) |
Sets the property of a effector.
This function gets the property specified by property_id of a effector specified by effector.
handle | the handle of the effector. |
property_id | the identifier of the property. |
pValue | the address of the property value. |
MGEFF_SINK mGEffEffectorGetSink | ( | MGEFF_EFFECTOR | effector | ) |
Gets the sink of a effector.
This function gets the sink of a effector specified by effector.
effector | the handle of the effector. |
MGEFF_SOURCE mGEffEffectorGetSource | ( | MGEFF_EFFECTOR | handle, |
int | index | ||
) |
Gets the effector source.
This function gets the source of effector specified by index of source, first source add to effector is zero, next increase sequence.
handle | The hanle of the effector. |
index | The index of the effector source. |
HDC mGEffEffectorGetSourceDC | ( | MGEFF_EFFECTOR | effector, |
int | index | ||
) |
Gets the underlying DC of the source of a effector.
This function gets the DC of the source of a effector specified by effector by index specified by index.
effector | the handle of the effector. |
index | of the source in the effector. |
MGEFF_BOOL mGEffEffectorRegister | ( | const MGEFF_EFFECTOROPS * | info | ) |
Register specail effector info.
This function register a effector with specified by info, Before user create effector it must be register first.
info | The effector info. |
void mGEffEffectorSetContext | ( | MGEFF_EFFECTOR | handle, |
void * | context | ||
) |
Sets the effector context.
This function sets the context of the effector specified by handle to context.
handle | The hanle of the effector. |
context | The context to be set. |
int mGEffEffectorSetProperty | ( | MGEFF_EFFECTOR | handle, |
int | property_id, | ||
int | value | ||
) |
Sets the property of a effector.
This function sets the property specified by property_id of a effector specified by effector to new value specified by value.
handle | the handle of the effector. |
property_id | the identifier of the property. |
value | new value of the property. |
int mGEffEffectorSetSink | ( | MGEFF_EFFECTOR | effector, |
MGEFF_SINK | sink | ||
) |
Sets the sink of a effector.
This function sets the sink of a effector specified by effector to sink specified by sink.
effector | the handle of the effector to which source is appended. |
sink | source the source to be appended. |
MGEFF_BOOL mGEffEffectorUnRegister | ( | const MGEFF_EFFECTOROPS * | info | ) |
UnRegister specail effector info.
This function unregister a effector with specified by info.
info | The effector info. |
int mGEffFillEffectorAnimation | ( | HWND | hwnd, |
HDC | src1_dc, | ||
HDC | src2_dc, | ||
HDC | dst_dc, | ||
unsigned long | key, | ||
int | duration | ||
) |
Fills a DC with a predefined effector.
This function creates and run an animation whose SetProperty callback is a effector specified by type. The sources of the effector are specified by src1_dc and src2_dc respectively. The destination DC of the effector is specified by dst_dc. The duration of the animation is specified by duration.
hwnd | The window handle in animation thread. |
src1_dc | The first DC of the effector. |
src2_dc | The secondary DC of the effector. |
dst_dc | The destination DC of the effector. |
key | The hash key of the effector to be used. |
duration | The duaration of the animation to be run. |
unsigned long mGEffStr2Key | ( | const char * | str | ) |
Generate hash key of string.
This function return the hash key of specified by string.
str | The input string. |