mGEff API Reference  v1.2.0
An animation framework for MiniGUI apps
Data Structures | Typedefs | Functions
mgeff-window-animation.h File Reference

window animation headfile. More...

Go to the source code of this file.

Data Structures

struct  _MGEFF_WindowAnimCtxt
 Structure defines windows animation context. More...
 

Typedefs

typedef struct _MGEFF_WindowAnimCtxt MGEFF_WindowAnimCtxt
 Structure defines windows animation context.
 
typedef void(* SET_BKGND_CB) (HDC hdc, RECT *rc)
 call back used when updating backgroudn. More...
 
typedef void(* DRAW_WND_CB) (HDC hdc1, HDC hdc2, RECT *rc)
 call back used to drawing window when window is moving. More...
 
typedef void(* RENDER_HANDLER) (MGEFF_EFFECTOR effector)
 call back used to handle animation property. More...
 
typedef void(* MGEFF_WINDOWANIM_CB) (MGEFF_WindowAnimCtxt *ctxt)
 Get the window foreground content(means snapshot) DC. More...
 

Functions

 MGEFF_DECLARE_HANDLE (MGEFF_WINDOW_ANIMATION_CONTEXT)
 The handle to the motioncurve.
 
HDC mGEffGetWindowForeground (HWND hwnd, BOOL set_foreground)
 Get window foreground. More...
 
MGEFF_WINDOW_ANIMATION_CONTEXT mGEffCreateWindowAnimationContext (int time, int effector_type, int curve_type, SET_BKGND_CB set_bkgnd_cb, DRAW_WND_CB draw_wnd_cb)
 Create window animation context. More...
 
void mGEffDestroyWindowAnimationContext (MGEFF_WINDOW_ANIMATION_CONTEXT hctxt)
 Deletes window animation context. More...
 
HWND mGEffCreateMainWindow (PMAINWINCREATE pCreateInfo, MGEFF_WINDOW_ANIMATION_CONTEXT hctxt)
 create a main window and show the window with animation. More...
 
BOOL mGEffShowWindow (HWND hwnd, int iCmdShow, MGEFF_WINDOW_ANIMATION_CONTEXT hctxt)
 show main window with animation. More...
 
BOOL mGEffMoveWindow (HWND hWnd, int x, int y, int w, int h, BOOL fPaint, MGEFF_WINDOW_ANIMATION_CONTEXT hctxt)
 Moves window with animation. More...
 
BOOL ControlExtract (HWND mainHwnd, int ctrl_id, PMAINWINCREATE pCreateInfo)
 Extracts a control from main window, and create a new main window take that control content. More...
 
BOOL WindowExtract (HWND mainHwnd, RECT *rc, PMAINWINCREATE pCreateInfo)
 Extracts a rectangle from a main window, and create a new main window take the content in that rectangle. More...
 
BOOL mGEffShowWindowEx (HWND hwnd, int iCmdShow, MGEFF_WINDOW_ANIMATION_CONTEXT hctxt, MGEFF_WINDOWANIM_CB cb)
 show main window with animation which has a user defined window animation callback function. More...
 
HWND mGEffCreateMainWindowEx (PMAINWINCREATE pCreateInfo, MGEFF_WINDOW_ANIMATION_CONTEXT hctxt, MGEFF_WINDOWANIM_CB cb)
 show main window with animation which has a user defined window animation callback function. More...
 
RENDER_HANDLER mGEffSetEffectorPropertyHandler (MGEFF_WINDOW_ANIMATION_CONTEXT hctxt, RENDER_HANDLER new_cb)
 Sets a new animation handle. More...
 
MGEFF_ANIMATION mGEffMoveWindowPreparation (HWND hWnd, int x, int y, int w, int h, BOOL fPaint, MGEFF_WINDOW_ANIMATION_CONTEXT hctxt)
 create an window animation ready to run. More...
 

Detailed Description

window animation headfile.

============================================================================

Author
DongKai
Version
1.0
Date
03/18/2010 03:45:12 PM
   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/>.

Typedef Documentation

void(* DRAW_WND_CB)(HDC hdc1, HDC hdc2, RECT *rc)

call back used to drawing window when window is moving.

Parameters
hdc1The DC holds the content of the animated window.
hdc2The DC to be drawn.
rectThe area to be drawn.
void(* MGEFF_WINDOWANIM_CB)(MGEFF_WindowAnimCtxt *ctxt)

Get the window foreground content(means snapshot) DC.

Parameters
hwndWhich window will be snapshot.
Returns
The DC of window snapshot content.
void(* RENDER_HANDLER)(MGEFF_EFFECTOR effector)

call back used to handle animation property.

Parameters
Theeffector used to handle animation property.
void(* SET_BKGND_CB)(HDC hdc, RECT *rc)

call back used when updating backgroudn.

Parameters
hdcThe background DC, a DC on which background is drawn.
rcThe rectangle to be updated in the background.

Function Documentation

BOOL ControlExtract ( HWND  mainHwnd,
int  ctrl_id,
PMAINWINCREATE  pCreateInfo 
)

Extracts a control from main window, and create a new main window take that control content.

This function creates a window according to pCreateInfo which contains the control specified by ctrl_id in window specifed by mainHwnd.

Parameters
mainHwndhandle of the window which contains the control.
ctrl_idid of the control.
pCreateInfomain window creating info for creating new window containing the control.
Returns
TRUE when succeed, otherwise FALSE.
See also
WindowExtract.
HWND mGEffCreateMainWindow ( PMAINWINCREATE  pCreateInfo,
MGEFF_WINDOW_ANIMATION_CONTEXT  hctxt 
)

create a main window and show the window with animation.

This function creates a window according to pCreateInfo and show the window with animation created according to hctxt.

Parameters
pCreateInfomain window creating info.
hctxthandle of the window animation context.
Note
window animation context contains all the necessary information to animate a window.
Returns
handle of windows
See also
mGEffMoveWindowPreparation, mGEffCreateWindowAnimationContext.
HWND mGEffCreateMainWindowEx ( PMAINWINCREATE  pCreateInfo,
MGEFF_WINDOW_ANIMATION_CONTEXT  hctxt,
MGEFF_WINDOWANIM_CB  cb 
)

show main window with animation which has a user defined window animation callback function.

This function shows or hide an window with animation. iCmdShow determins show or hide the window. hctxt is the handle of window animation context based on which the window animation is created and cb is the window animation callback.

Parameters
pCreateInfoinformation of create window.
hctxthandle of the window animation context.
cbuser defined window animation callback.
Returns
handle of windows
See also
mGEffShowWindow.
MGEFF_WINDOW_ANIMATION_CONTEXT mGEffCreateWindowAnimationContext ( int  time,
int  effector_type,
int  curve_type,
SET_BKGND_CB  set_bkgnd_cb,
DRAW_WND_CB  draw_wnd_cb 
)

Create window animation context.

This function creates a window animation context

Parameters
timeduration of window animation.
effector_typethe type of the effector used in window animation creation.
curve_typemotion curve type of window animation.
set_bkgnd_cbthe function for drawing background.
draw_wnd_cbfunction for drawing window.
Returns
handle to the newly created window animation context.
Note
window animation context contains all the necessary information to animate a window.
See also
mGEffMoveWindowPreparation.
void mGEffDestroyWindowAnimationContext ( MGEFF_WINDOW_ANIMATION_CONTEXT  hctxt)

Deletes window animation context.

This function deletes a window animation context

Parameters
hctxthandle of the window animation context to be deleted.
Note
window animation context contains all the necessary information to animate a window.
See also
mGEffMoveWindowPreparation, mGEffCreateWindowAnimationContext.
HDC mGEffGetWindowForeground ( HWND  hwnd,
BOOL  set_foreground 
)

Get window foreground.

This function return a DC which contain the foreground of the window specified by hwnd.

Parameters
hwndwindow handle.
set_foregroundwhether change the visible property of window.
Returns
a DC contains the foreground of the window.
See also
.
BOOL mGEffMoveWindow ( HWND  hWnd,
int  x,
int  y,
int  w,
int  h,
BOOL  fPaint,
MGEFF_WINDOW_ANIMATION_CONTEXT  hctxt 
)

Moves window with animation.

This function moves the window specified by hWnd with animaiton. The end value of the animation is the window position and size specified by x, y, w, h respectively. The context of the window animation is specified by hctext.

Parameters
hWndwindow handle.
xThe x postion of the window when animation is finnished.
yThe y postion of the window when animation is finnished.
wThe w width of the window when animation is finnished.
hThe h height of the window when animation is finnished.
fPaintIndicates whether the window should be repainted.
hctxtThe window animation context.
Returns
TRUE when succeed, otherwise FALSE.
See also
mGEffCreateWindowAnimationContext.
MGEFF_ANIMATION mGEffMoveWindowPreparation ( HWND  hWnd,
int  x,
int  y,
int  w,
int  h,
BOOL  fPaint,
MGEFF_WINDOW_ANIMATION_CONTEXT  hctxt 
)

create an window animation ready to run.

This function creates an animation for the window specified by hWnd. The end value of the animation is the window position and size specified by x, y, w, h respectively. The context of the window animation is specified by hctext.

Parameters
hWndwindow handle.
xThe x postion of the window when animation is finnished.
yThe y postion of the window when animation is finnished.
wThe w width of the window when animation is finnished.
hThe h height of the window when animation is finnished.
fPaintIndicates whether the window should be repainted.
hctxtThe window animation context.
Returns
a hanle of the animation for the window.
See also
mGEffCreateWindowAnimationContext.
RENDER_HANDLER mGEffSetEffectorPropertyHandler ( MGEFF_WINDOW_ANIMATION_CONTEXT  hctxt,
RENDER_HANDLER  new_cb 
)

Sets a new animation handle.

This function sets a new animation handler specified by new_cb to animation context specified by hctxt.

Parameters
hctxthandle of the window animation context to be set.
new_cbnew window animation handler
Note
window animation context contains the necessary information to animate a window.
See also
mGEffCreateWindowAnimationContext.
BOOL mGEffShowWindow ( HWND  hwnd,
int  iCmdShow,
MGEFF_WINDOW_ANIMATION_CONTEXT  hctxt 
)

show main window with animation.

This function shows or hide an window with animation. iCmdShow determins show or hide the window and the hctxt is the handle of window animation context based on which the window animation is created.

Parameters
hwndthe handle of the window.
iCmdShowshow or hide the window.
hctxthandle of the window animation context
Note
window animation context contains all the necessary information to animate a window.
Returns
TRUE when succeed, otherwise FALSE.
See also
mGEffMoveWindowPreparation, mGEffCreateWindowAnimationContext.
BOOL mGEffShowWindowEx ( HWND  hwnd,
int  iCmdShow,
MGEFF_WINDOW_ANIMATION_CONTEXT  hctxt,
MGEFF_WINDOWANIM_CB  cb 
)

show main window with animation which has a user defined window animation callback function.

This function shows or hide an window with animation. iCmdShow determins show or hide the window. hctxt is the handle of window animation context based on which the window animation is created and cb is the window animation callback.

Parameters
hwndthe handle of the window.
iCmdShowshow or hide the window.
hctxthandle of the window animation context.
cbuser defined window animation callback.
Returns
TRUE if success, else return FALSE
See also
mGEffShowWindow.
BOOL WindowExtract ( HWND  mainHwnd,
RECT *  rc,
PMAINWINCREATE  pCreateInfo 
)

Extracts a rectangle from a main window, and create a new main window take the content in that rectangle.

This function creates a window according to pCreateInfo which contains the content in rectangle specified by rc in main window specifed by mainHwnd.

Parameters
mainHwndhandle of the main window from which then content will be extracted.
rcthe rectangle in which the content will be extract.
pCreateInfomain window creating info for creating new window containing the extracted content.
Returns
TRUE when succeed, otherwise FALSE.
See also
ControlExtract.