mgplus.h

00001 /*
00002  ** $Id: mgplus.h 2008-12-05$
00003  **
00004  ** This file includes macro definitions, typedefs and function 
00005  ** interfaces of mGPlus component. mGPlus is an advanced 2D graphics
00006  ** rendering engine for MiniGUI V3.0. 
00007  **
00008  ** Copyright (C) 2008 ~ 2009 Feynman Software.
00009  **
00010  ** Create date: 2008/12/02
00011  */
00012 
00013 
00026 #ifndef _MGPLUS_H
00027 #define _MGPLUS_H
00028 
00029 #ifdef __cplusplus
00030 extern "C" {
00031 #endif  /* __cplusplus */
00032 
00033 #include <minigui/common.h>
00034 #include <minigui/minigui.h>
00035 #include <minigui/gdi.h>
00036 #include <minigui/fixedmath.h>
00037 
00038 #ifndef MGPLUS_MAJOR_VERSION
00039 #  ifdef __MGPLUS_LIB__
00040 #    if defined(__CMAKE_PROJECT__) || defined(WIN32)
00041 #      include "mgplusconfig.h"
00042 #    else
00043 #      include "../mgplusconfig.h"
00044 #    endif
00045 #  else
00046 #    include "mgplusconfig.h"
00047 #    undef PACKAGE_BUGREPORT
00048 #    undef PACKAGE_NAME
00049 #    undef PACKAGE_STRING
00050 #    undef PACKAGE_TARNAME
00051 #    undef PACKAGE_VERSION
00052 #  endif
00053 #endif
00054 
00055 #if defined (WIN32) && !defined(__NODLL__)
00056   #if defined (__MGPLUS_LIB__)
00057      #define MGPLUS_EXPORT       __declspec(dllexport)
00058   #else
00059      #define MGPLUS_EXPORT       __declspec(dllimport)
00060   #endif
00061 #else
00062   #define MGPLUS_EXPORT
00063 #endif
00064 
00070 #define MP_INV_HANDLE   0
00071 
00077 typedef DWORD HGRAPHICS;
00078 
00084 typedef DWORD HPATH;
00085 
00091 typedef DWORD HBRUSH;
00092 
00098 typedef DWORD HPEN;
00099 
00105 typedef DWORD HFONT;
00106 
00112 typedef DWORD ARGB;
00113 
00117 typedef struct _MPPOINT
00118 {
00119     float x;
00120     float y;
00121 }MPPOINT;
00122 
00127 typedef enum _MPStatus
00128 {
00129     MP_OK = 0,
00130     MP_GENERIC_ERROR = 1,
00131     MP_INVALID_PARAMETER = 2,
00132     MP_OUT_OF_MEMORY = 3,
00133     MP_INDEX_NOT_MATCH = 4,
00134     MP_NOT_ENOUGH_FIGURE_MEMORY = 5,
00135     MP_NOT_IMPLEMENTED = 6,
00136     MP_NOT_INITIALIZED = 7,
00137     MP_ABORTED = 8,
00138     MP_FILE_NOT_FOUNT = 9,
00139     MP_VALUE_OVERFLOW = 10,
00140     MP_ACCESS_DENIED = 11,
00141     MP_UNKNOWN_IMAGE_FORMAT = 12,
00142     MP_FONT_FAMILY_NOT_FOUND = 13,
00143     MP_FONT_STYLE_NOT_FOUND = 14,
00144     MP_NOT_TRUETYPE_FONT = 15,
00145     MP_UNSUPPORTED_VERSION = 16
00146 }MPStatus;
00147 
00152 typedef enum _MPSmoothingMode
00153 {
00154     /* Smoothing mode with speed.*/
00155     MP_SMOOTHING_SPEED = 0,    
00156     /* Smoothing mode with quality.*/
00157     MP_SMOOTHING_QUALITY = 1,  
00158 }MPSmoothingMode;
00159 
00160 
00165 typedef enum _MPGlyphRendering
00166 {
00167     /* retrieves the glyph bitmap direct from ft2. */
00168     MP_GLYPH_REN_NATIVE_MONO,              
00169     MP_GLYPH_REN_NATIVE_GRAY8,         
00170     /* retrieves the curve data points in the rasterizer's native
00171      * format and uses the font's design units. 
00172      */
00173     MP_GLYPH_REN_OUTLINE,
00174     /* retrieves the glyph bitmap from agg render. */
00175     MP_GLYPH_REN_AGG_MONO,
00176     MP_GLYPH_REN_AGG_GRAY8,
00177 }MPGlyphRendering;
00178 
00183 typedef enum _PATH_VERTEX_COMMANDS
00184 {
00185     PATH_CMD_STOP     = 0,
00186     PATH_CMD_MOVE_TO  = 1,
00187     PATH_CMD_LINE_TO  = 2,
00188     PATH_CMD_CURVE3   = 3,
00189     PATH_CMD_CURVE4   = 4,
00190     PATH_CMD_CURVEN   = 5,
00191     PATH_CMD_CATROM   = 6,
00192     PATH_CMD_UBSPLINE = 7,
00193     PATH_CMD_END_POLY = 0x0F,
00194     PATH_CMD_MASK     = 0x0F
00195 }PATH_VERTEX_COMMANDS;
00196 
00201 typedef enum _MPOrientation
00202 {
00203     MP_ORIENTATION_CW = 0,
00204     MP_ORIENTATION_CCW
00205 }MPOrientation;
00206 
00211 typedef enum _MPCompositingMode
00212 {
00213     /* Porter-Duff Clear rule. Both the color and the alpha of the 
00214      * destination are cleared. Neither the source nor the 
00215      * destination is used as input.
00216      */
00217     MP_COMP_OP_CLEAR = 0,
00218     /* Porter-Duff Source rule. The source is copied to the destination. 
00219      * The destination is not used as input.
00220      */
00221     MP_COMP_OP_SRC,
00222     /* Porter-Duff Destination rule, The destination is left untouched.
00223      */
00224     MP_COMP_OP_DST,
00225     /* Porter-Duff Source Over Destination rule. The source is composited 
00226      * over the destination.
00227      */
00228     MP_COMP_OP_SRC_OVER,
00229     /* Porter-Duff Destination Over Source rule. The destination is composited
00230      * over the source and the result replaces the destination.
00231      */
00232     MP_COMP_OP_DST_OVER,
00233     /* Porter-Duff Source In Destination rule.The part of the source lying 
00234      * inside of the destination replaces the destination.
00235      */
00236     MP_COMP_OP_SRC_IN,
00237     /* Porter-Duff Destination In Source rule. The part of the destination lying 
00238      * inside of the source replaces the destination. 
00239      */
00240     MP_COMP_OP_DST_IN,
00241     /* Porter-Duff Source Held Out By Destination rule. The part of the source 
00242      * lying outside of the destination replaces the destination. 
00243      */
00244     MP_COMP_OP_SRC_OUT,
00245     /* Porter-Duff Destination Held Out By Source rule. The part of the 
00246      * destination lying outside of the source replaces the destination.
00247      */
00248     MP_COMP_OP_DST_OUT,
00249     /* Porter-Duff Source Atop Destination rule, The part of the source 
00250      * lying inside of the destination is composited onto the destination . 
00251      */
00252     MP_COMP_OP_SRC_ATOP,
00253     /* Porter-Duff Destination Atop Source rule The part of the destination 
00254      * lying inside of the source is composited over the source and replaces 
00255      * the destination (). 
00256      */
00257     MP_COMP_OP_DST_ATOP,
00258     /* Porter-Duff Source Xor Destination rule, The part of the source that lies 
00259      * outside of the destination is combined with the part of the destination 
00260      * that lies outside of the source. 
00261      */
00262     MP_COMP_OP_XOR,
00263 }MPCompositingMode;
00264 
00269 typedef enum _MPInterpolationMode
00270 {
00271     MP_INTERPOLATION_MODE_INVALID = -1,          //reserved
00272     MP_INTERPOLATION_MODE_DEFAULT = 0,           //reserved
00273     MP_INTERPOLATION_MODE_LOW_QUALITY = 1,       //reserved
00274     MP_INTERPOLATION_MODE_HIGH_QUALITY = 2,      //reserved
00275     MP_INTERPOLATION_MODE_PERSPECTIVE,
00276     MP_INTERPOLATION_MODE_BILINEAR,
00277     MP_INTERPOLATION_MODE_AFFINE,
00278     MP_INTERPOLATION_MODE_BICUBIC,               //reserved
00279     MP_INTERPOLATION_MODE_NEARESTNEIGHBOR,       //reserved
00280     MP_INTERPOLATION_MODE_HIGH_QUALITY_BILINEAR, //reserved
00281     MP_INTERPOLATION_MODE_HIGH_QUALITY_BICUBIC   //reserved
00282 }MPInterpolationMode;
00283 
00288 typedef enum _MPRenderingControl
00289 {
00290     MP_RENDER_SPEED   = 0,
00291     MP_RENDER_QUALITY = 1,
00292 }MPRenderingControl;
00293 
00298 typedef enum _MPTextRenderingHint
00299 {
00300     MP_TEXT_RENDER_HINT_ANTIALIAS_ON   = 0,
00301     MP_TEXT_RENDER_HINT_ANTIALIAS_OFF  = 1,
00302 }MPTextRenderingHint;
00303 
00308 typedef enum _MPPathRenderingHint
00309 {
00310     MP_PATH_RENDER_HINT_ANTIALIAS_ON   = 0,
00311     MP_PATH_RENDER_HINT_ANTIALIAS_OFF  = 1,
00312 }MPPathRenderingHint;
00313 
00317 typedef struct _MPMatrix
00318 {   
00319     /* transformation matrix.
00320      * [ sx , shy, 0]
00321      * | shx,  sy, 0]
00322      * [ tx,  ty,  0]
00323      */
00324     double sx, shy, shx, sy, tx, ty;
00325 }MPMatrix;
00326 
00330 typedef struct _GLYPHMETRICS {
00331     /* Specifies the x- and y-coordinates of the upper left 
00332      * corner of the smallest rectangle that completely encloses the glyph.   
00333      */
00334     unsigned char bbox_x; 
00335     unsigned char bbox_y; 
00336     /* Specifies the width of the smallest rectangle that 
00337      * completely encloses the glyph (its box).  
00338      */
00339     unsigned char bbox_w; 
00340     unsigned char bbox_h; 
00341     /* Specifies the horizontal/vertical distance from the origin of the current 
00342      * character cell to the origin of the next character cell. 
00343      */
00344     short adv_x; 
00345     short adv_y; 
00346 } GLYPHMETRICS, *LPGLYPHMETRICS; 
00347 
00352 typedef enum _GLYPH_DATE_TYPE
00353 {
00354     GLYPH_DATA_INVALID = 0,
00355     /* glyph is monochrome.*/
00356     GLYPH_DATA_MONO,
00357     /* glyph is anti-aliasing.*/
00358     GLYPH_DATA_GRAY8,
00359     /* glyph is outline.*/
00360     GLYPH_DATA_OUTLINE
00361 }GLYPH_DATE_TYPE;
00362 
00366 typedef struct _GLYPHDATA 
00367 {
00368     /* glyph index of ttf font.*/
00369     unsigned int    glyph_index;
00370     /* glyph render data.*/
00371     BYTE*           data;
00372     unsigned int    data_size;
00373     GLYPH_DATE_TYPE data_type;
00374 } GLYPHDATA, *LPGLYPHDATA;
00375 
00380 typedef enum _MPFillMode
00381 {
00382     /* non zero fill mode.*/ 
00383     MP_PATH_FILL_MODE_WINDING=0,    
00384     /* odd fill mode.*/ 
00385     MP_PATH_FILL_MODE_ALTERNATE,
00386 }MPFillMode;
00387 
00392 typedef enum _LINE_CAP_E
00393 {
00394     /*
00395      * Indicates a flat line cap style. See the class overview for an
00396      * illustration.
00397      */
00398     CAP_BUTT = 0,
00399     /*
00400      * Indicates a rounded line cap style. See the class overview for an
00401      * illustration.
00402      */
00403     CAP_ROUND = 1,
00404     /*
00405      * Indicates a square line cap style. See the class overview for an
00406      * illustration.
00407      */
00408     CAP_SQUARE = 2,
00409 }LINE_CAP_E;
00410 
00415 typedef enum _LINE_JOIN_E
00416 {
00417     /*
00418      * Indicates a mitered line join style.
00419      */
00420     JOIN_MITER = 0,
00421     /*
00422      * Indicates a rounded line join style. 
00423      */
00424     JOIN_ROUND = 1,
00425     /*
00426      * Indicates a bevelled line join style.
00427      */
00428     JOIN_BEVEL = 2,
00429     /* reseverd,not used now, but surport by mgplus.*/
00430     JOIN_MILTER_REVERT = 3, 
00431     JOIN_MILTER_ROUND = 4
00432 }LINE_JOIN_E;
00433 
00438 typedef enum _MPBrushType
00439 {
00440     /* Brush the path with the single color.*/
00441     MP_BRUSH_TYPE_SOLIDCOLOR = 0,   
00442     /* Brush the path with the hatchfill.*/
00443     MP_BRUSH_TYPE_HATCHFILL = 1,    
00444     /* Brush the path with the texturefill.*/
00445     MP_BRUSH_TYPE_TEXTUREFILL = 2,  
00446     /* Brush the path with the path gradient.*/
00447     MP_BRUSH_TYPE_PATHGRADIENT = 3, 
00448     /* Brush the path with linear gradient.*/
00449     MP_BRUSH_TYPE_LINEARGRADIENT    
00450 }MPBrushType;
00451 
00456 typedef enum _MPLinearGradientMode
00457 {
00458     /* gradient horizontal.*/
00459     MP_LINEAR_GRADIENT_MODE_HORIZONTAL = 0,  
00460     /* gradient vertica.*/
00461     MP_LINEAR_GRADIENT_MODE_VERTICAL,        
00462     /* gradient forwarddiagonal.*/
00463     MP_LINEAR_GRADIENT_MODE_FORWARDDIAGONAL, 
00464     /* gradient backwarddiagonal.*/
00465     MP_LINEAR_GRADIENT_MODE_BACKWARDDIAGONAL 
00466 }MPLinearGradientMode;
00467 
00491 MGPLUS_EXPORT HGRAPHICS MGPlusGraphicCreateFromDC (HDC hdc);
00492 
00506 MGPLUS_EXPORT HGRAPHICS MGPlusGraphicCreateWithoutCanvas(HDC hdc);
00507 
00520 MGPLUS_EXPORT HDC MGPlusGetGraphicDC (HGRAPHICS graphic);
00521 
00535 MGPLUS_EXPORT HGRAPHICS MGPlusGraphicCreate (int width, int height);
00536 
00550 MGPLUS_EXPORT int MGPlusSaveHG (HGRAPHICS hg);
00551 
00571 MGPLUS_EXPORT BOOL MGPlusRestoreHG (HGRAPHICS hg, int saved_hg);
00572 
00595 MGPLUS_EXPORT MPStatus MGPlusGraphicCopyFromDC (HGRAPHICS graphic, HDC hdc, int sx,
00596         int sy, int sw, int sh, int dx, int dy);
00597 
00611 MGPLUS_EXPORT MPStatus MGPlusGraphicCopy (HGRAPHICS src_gs, HGRAPHICS dst_gs);
00612 
00626 MGPLUS_EXPORT MPStatus MGPlusGraphicBlend (HGRAPHICS src_gs, HGRAPHICS dst_gs);
00627 
00642 MGPLUS_EXPORT MPStatus MGPlusGraphicClearEx (HGRAPHICS graphics, RECT* rect, ARGB color);
00643 
00644 #define MGPlusGraphicClear(graphics, color) MGPlusGraphicClearEx (graphics, NULL, color)
00645 
00671 MGPLUS_EXPORT MPStatus MGPlusGraphicSave (HGRAPHICS graphics, HDC hdc, 
00672         int sx, int sy, int sw, int sh, int dx, int dy);
00673 
00686 MGPLUS_EXPORT MPStatus MGPlusGraphicDelete (HGRAPHICS graphics);
00687 
00712 MGPLUS_EXPORT MPStatus MGPlusSetCompositingMode (HGRAPHICS graphics, 
00713          MPCompositingMode composite_mode);
00714 
00729 MGPLUS_EXPORT MPStatus MGPlusGetCompositingMode (HGRAPHICS graphics, 
00730         MPCompositingMode* composite_mode);
00731 
00756 MGPLUS_EXPORT MPStatus MGPlusGetSmoothingMode (HGRAPHICS graphics, MPSmoothingMode* value);
00757 
00772 MGPLUS_EXPORT MPStatus MGPlusSetSmoothingMode (HGRAPHICS graphics, MPSmoothingMode value);
00773 
00788 MGPLUS_EXPORT MPStatus MGPlusSetPathRenderingHint (HGRAPHICS graphics, 
00789         MPPathRenderingHint value);
00790 
00805 MGPLUS_EXPORT MPStatus MGPlusGetPathRenderingHint (HGRAPHICS graphics, 
00806         MPPathRenderingHint* value);
00807 
00822 MGPLUS_EXPORT MPStatus MGPlusSetTextRenderingHint (HGRAPHICS graphics, 
00823         MPTextRenderingHint value);
00824 
00840 MGPLUS_EXPORT MPStatus MGPlusGetTextRenderingHint (HGRAPHICS graphics, 
00841         MPTextRenderingHint* value);
00842 
00857 MGPLUS_EXPORT MPStatus MGPlusSetInterpolationMode (HGRAPHICS graphics, 
00858         MPInterpolationMode mode);
00859 
00874 MGPLUS_EXPORT MPStatus MGPlusGetInterpolationMode (HGRAPHICS graphics, 
00875         MPInterpolationMode* mode);
00876 
00901 MGPLUS_EXPORT MPStatus MGPlusSetWorldTransform (HGRAPHICS graphics, 
00902         MPMatrix *matrix);
00903 
00919 MGPLUS_EXPORT MPStatus MGPlusWorldTransform (HGRAPHICS graphics, MPMatrix *matrix);
00920 
00936 MGPLUS_EXPORT MPStatus MGPlusGetWorldTransform (HGRAPHICS graphics, MPMatrix *matrix);
00937 
00950 MGPLUS_EXPORT MPStatus MGPlusResetWorldTransform (HGRAPHICS graphics);
00951 
00967 MGPLUS_EXPORT MPStatus MGPlusTranslateWorldTransform (HGRAPHICS graphics,
00968         float dx, float dy);
00969 
00985 MGPLUS_EXPORT MPStatus MGPlusScaleWorldTransform (HGRAPHICS graphics, 
00986         float sx, float sy);
00987 
01002 MGPLUS_EXPORT MPStatus MGPlusRotateWorldTransform (HGRAPHICS graphics, 
01003         float angle);
01004 
01015 MGPLUS_EXPORT MPStatus MGPlusPathTransform (HPATH path);
01016 
01045 MGPLUS_EXPORT MPStatus MGPlusDrawLine (HGRAPHICS graphics, HPEN pen, 
01046         float x1, float y1, float x2, float y2);
01047 
01066 MGPLUS_EXPORT MPStatus MGPlusDrawLineI (HGRAPHICS graphics, HPEN pen, 
01067         int x1, int y1, int x2, int y2);
01068 
01093 MGPLUS_EXPORT MPStatus MGPlusDrawArc (HGRAPHICS graphics, HPEN pen,
01094         float x, float y, float width, float height, float startangle, 
01095         float sweepangle);
01096 
01119 MGPLUS_EXPORT MPStatus MGPlusDrawArcI (HGRAPHICS graphics, HPEN pen,
01120         int x, int y, int width, int height, float startAngle, 
01121         float sweepAngle);
01122 
01147 MGPLUS_EXPORT MPStatus MGPlusFillArc (HGRAPHICS graphics, HBRUSH brush,
01148         float x, float y, float width, float height, float startangle, 
01149         float sweepangle);
01150 
01173 MGPLUS_EXPORT MPStatus MGPlusFillArcI (HGRAPHICS graphics, HBRUSH brush,
01174         int x, int y, int width, int height, float startAngle,
01175         float sweepAngle);
01176 
01201 MGPLUS_EXPORT MPStatus MGPlusDrawBezier (HGRAPHICS graphics, HPEN pen,
01202         float x1, float y1, float x2, float y2, float x3, float y3,
01203         float x4, float y4);
01204 
01227 MGPLUS_EXPORT MPStatus MGPlusDrawBezierI (HGRAPHICS graphics, HPEN pen, 
01228         int x1, int y1, int x2, int y2, int x3, int y3, int x4, int y4);
01229 
01254 MGPLUS_EXPORT MPStatus MGPlusFillBezier (HGRAPHICS graphics, HBRUSH brush,
01255         float x1, float y1, float x2, float y2, float x3, float y3,
01256         float x4, float y4);
01257 
01280 MGPLUS_EXPORT MPStatus MGPlusFillBezierI (HGRAPHICS graphics, HBRUSH brush, 
01281         int x1, int y1, int x2, int y2, int x3, int y3, int x4, int y4);
01282 
01301 MGPLUS_EXPORT MPStatus MGPlusFillRectangle (HGRAPHICS graphics, HBRUSH brush, 
01302         float x, float y, float width, float height);
01303 
01322 MGPLUS_EXPORT MPStatus MGPlusFillRectangleI (HGRAPHICS graphics, HBRUSH brush, 
01323         int x, int y, int width, int height);
01324 
01343 MGPLUS_EXPORT MPStatus MGPlusDrawRectangle (HGRAPHICS graphics, HPEN pen, 
01344         float x, float y, float width, float height);
01345 
01364 MGPLUS_EXPORT MPStatus MGPlusDrawRectangleI (HGRAPHICS graphics, HPEN pen, 
01365         int x, int y, int width, int height);
01366 
01385 MGPLUS_EXPORT MPStatus MGPlusFillRectangle (HGRAPHICS graphics, HBRUSH brush, 
01386         float x, float y, float width, float height);
01387 
01406 MGPLUS_EXPORT MPStatus MGPlusFillRectangleI (HGRAPHICS graphics, HBRUSH brush, 
01407         int x, int y, int width, int height);
01408 
01429 MGPLUS_EXPORT MPStatus MGPlusDrawRoundRectEx (HGRAPHICS graphics, HPEN pen, 
01430         float x, float y, float width, float height, float rx, float ry);
01431 
01432 #define MGPlusDrawRoundRect(graphics, pen, x, y, width, height, r) \
01433     MGPlusDrawRoundRectEx (graphics, pen, x, y, width, height, r, r)
01434 
01455 MGPLUS_EXPORT MPStatus MGPlusDrawRoundRectIEx (HGRAPHICS graphics, HPEN pen, 
01456         int x, int y, int width, int height, int rx, int ry);
01457 
01458 #define MGPlusDrawRoundRectI(graphics, pen, x, y, width, height, r) \
01459     MGPlusDrawRoundRectIEx (graphics, pen, x, y, width, height, r, r)
01460 
01481 MGPLUS_EXPORT MPStatus MGPlusFillRoundRectEx (HGRAPHICS graphics, HBRUSH brush, 
01482         float x, float y, float width, float height, float rx, float ry);
01483 
01484 #define MGPlusFillRoundRect(graphics, brush, x, y, width, height, r) \
01485     MGPlusFillRoundRectEx (graphics, brush, x, y, width, height, r, r)
01486 
01507 MGPLUS_EXPORT MPStatus MGPlusFillRoundRectIEx (HGRAPHICS graphics, HBRUSH brush, 
01508         int x, int y, int width, int height, int rx, int ry);
01509 
01510 #define MGPlusFillRoundRectI(graphics, brush, x, y, width, height, r) \
01511         MGPlusFillRoundRectIEx (graphics, brush, x, y, width, height, r, r)
01512 
01531 MGPLUS_EXPORT MPStatus MGPlusDrawEllipse (HGRAPHICS graphics, HPEN pen, 
01532         float cx, float cy, float rx, float ry);
01533 
01553 MGPLUS_EXPORT MPStatus MGPlusDrawEllipseI (HGRAPHICS graphics, HPEN pen, 
01554         int cx, int cy, int rx, int ry);
01555 
01574 MGPLUS_EXPORT MPStatus MGPlusFillEllipse (HGRAPHICS graphics, HBRUSH brush, 
01575         float cx, float cy, float rx, float ry);
01576 
01596 MGPLUS_EXPORT MPStatus MGPlusFillEllipseI (HGRAPHICS graphics, HBRUSH brush, 
01597         int cx, int cy, int rx, int ry);
01598 
01614 MGPLUS_EXPORT MPStatus MGPlusSetClipPath (HGRAPHICS graphics, HPATH path);
01615 
01632 MGPLUS_EXPORT MPStatus MGPlusFillPath (HGRAPHICS graphics, HBRUSH brush,
01633         HPATH path);
01634 
01651 MGPLUS_EXPORT MPStatus MGPlusDrawPath (HGRAPHICS graphics, HPEN pen,
01652         HPATH path);
01653 
01670 MGPLUS_EXPORT MPStatus MGPlusGraphicLoadBitmap (HGRAPHICS graphics, int n_index,
01671         PBITMAP p_bitmap);
01672 
01689 MGPLUS_EXPORT MPStatus MGPlusGraphicLoadBitmapFromFile (HGRAPHICS graphics,
01690         int n_index, char* file);
01691 
01707 MGPLUS_EXPORT MPStatus MGPlusGraphicUnLoadBitmap (HGRAPHICS graphics, int n_index);
01708 
01724 MGPLUS_EXPORT PBITMAP MGPlusGraphicGetBitmap (HGRAPHICS graphics, int n_index);
01725 
01740 MGPLUS_EXPORT MPStatus MGPlusSetImageAlpha (HGRAPHICS graphics, int alpha);
01741 
01756 MGPLUS_EXPORT MPStatus MGPlusGetImageAlpha (HGRAPHICS graphics, int* alpha);
01757 
01774 MGPLUS_EXPORT MPStatus MGPlusDrawImageWithPoints (HGRAPHICS graphics, 
01775         int n_index, const MPPOINT* point, int count);
01776 
01800 MGPLUS_EXPORT MPStatus MGPlusDrawImage (HGRAPHICS graphics, int n_index,
01801         int x, int y, int w, int h);
01802 
01819 MGPLUS_EXPORT MPStatus MGPlusDrawImageWithPath (HGRAPHICS graphics, 
01820         int n_index, HPATH path);
01821 
01844 MGPLUS_EXPORT HPATH MGPlusPathCreate (MPFillMode brushMode);
01845 
01858 MGPLUS_EXPORT MPStatus MGPlusPathDelete (HPATH path);
01859 
01870 MGPLUS_EXPORT MPStatus MGPlusPathReset (HPATH path);
01871 
01883 MGPLUS_EXPORT MPStatus MGPlusPathSetAllOrientation (HPATH path,
01884         MPOrientation orientation);
01885 
01901 MGPLUS_EXPORT MPStatus MGPlusPathGetVertex (HPATH path, int idx, 
01902         double* x, double* y, int* cmd);
01903 
01915 MGPLUS_EXPORT MPStatus MGPlusPathGetPointCount (HPATH path, int* count);
01916 
01929 MGPLUS_EXPORT MPStatus MGPlusPathGetPoints (HPATH path, int* count, MPPOINT** pt);
01930 
01949 MGPLUS_EXPORT MPStatus MGPlusPathAddLine (HPATH path, float x1, float y1, 
01950         float x2, float y2); 
01951 
01970 MGPLUS_EXPORT MPStatus MGPlusPathAddLineI (HPATH path, int x1, int y1, 
01971         int x2, int y2);
01972 
01989 MGPLUS_EXPORT MPStatus MGPlusPathAddLines (HPATH path, const MPPOINT* points, 
01990         int count);
01991 
02012 MGPLUS_EXPORT MPStatus MGPlusPathAddArc (HPATH path, float cx, float cy, float rx, 
02013         float ry, float startAngle, float sweepAngle);
02014 
02035 MGPLUS_EXPORT MPStatus MGPlusPathAddArcI (HPATH path, int cx, int cy, 
02036         int rx, int ry, int startAngle, int sweepAngle);
02037 
02060 MGPLUS_EXPORT MPStatus MGPlusPathAddBezier (HPATH path, float x1, float y1, 
02061         float x2, float y2, float x3, float y3, float x4, float y4);
02062 
02085 MGPLUS_EXPORT MPStatus MGPlusPathAddBezierI (HPATH path, int x1, int y1, 
02086         int x2, int y2, int x3, int y3, int x4, int y4);
02087 
02108 MGPLUS_EXPORT MPStatus MGPlusPathAddRoundRectEx (HPATH path, int x, int y, 
02109         int width, int height, int rx, int ry);
02110 
02111 #define MGPlusPathAddRoundRect(path, x, y, width, height, r) \
02112     MGPlusPathAddRoundRectEx (path, x, y, width, height, r, r)
02113 
02146 MGPLUS_EXPORT MPStatus MGPlusPathArcto (HPATH path, double x1, double y1,
02147         double x2, double y2, double radius);
02148 
02171 MGPLUS_EXPORT MPStatus MGPlusPathArctoI (HPATH path, int x1, int y1,
02172         int x2, int y2, int radius);
02173 
02189 MGPLUS_EXPORT MPStatus MGPlusPathMoveto (HPATH path, float x, float y);
02190 
02206 MGPLUS_EXPORT MPStatus MGPlusPathMovetoI (HPATH path, int x, int y);
02207 
02223 MGPLUS_EXPORT MPStatus MGPlusPathLineto (HPATH path, float x, float y);
02224 
02240 MGPLUS_EXPORT MPStatus MGPlusPathLinetoI (HPATH path, int x, int y);
02241 
02263 MGPLUS_EXPORT MPStatus MGPlusPathBezierto (HPATH path, float x1, float y1,
02264         float x2, float y2, float x3, float y3);
02265 
02287 MGPLUS_EXPORT MPStatus MGPlusPathBeziertoI (HPATH path, int x1, int y1,
02288         int x2, int y2, int x3, int y3);
02289 
02309 MGPLUS_EXPORT MPStatus MGPlusPathQuadraticto (HPATH path, float x1,
02310         float y1, float x2, float y2);
02311 
02331 MGPLUS_EXPORT MPStatus MGPlusPathQuadratictoI (HPATH path, int x1, 
02332         int y1, int x2, int y2); 
02333 
02352 MGPLUS_EXPORT MPStatus MGPlusPathAddRectangle (HPATH path, float x, float y, 
02353         float width, float height);
02354 
02373 MGPLUS_EXPORT MPStatus MGPlusPathAddRectangleI (HPATH path, int x, int y, 
02374         int width, int height);
02375 
02395 MGPLUS_EXPORT MPStatus MGPlusPathAddEllipse (HPATH path, float cx, float cy, 
02396         float rx, float ry, BOOL clockwise);
02397 
02417 MGPLUS_EXPORT MPStatus MGPlusPathAddEllipseI (HPATH path, int cx, int cy, 
02418         int rx, int ry, BOOL clockwise);
02419 
02434 MGPLUS_EXPORT MPStatus MGPlusPathAddCurve (HPATH path, const MPPOINT* points, 
02435         int count);
02436 
02449 MGPLUS_EXPORT MPStatus MGPlusPathAddPath (HPATH path, HPATH add_path);
02450 
02463 MGPLUS_EXPORT MPStatus MGPlusPathStartFigure (HPATH path);
02464 
02477 MGPLUS_EXPORT MPStatus MGPlusPathCloseFigure (HPATH path);
02478 
02490 MGPLUS_EXPORT MPStatus MGPlusPathRotateAroundPoint (HPATH path,
02491         const MPPOINT* pt, float angle);
02492 
02502 MGPLUS_EXPORT MPStatus MGPlusPathSetTransform (HPATH path, MPMatrix* matrix);
02503 
02515 MGPLUS_EXPORT MPStatus MGPlusPathGetTransform (HPATH path, MPMatrix* matrix);
02516 
02525 MGPLUS_EXPORT MPStatus MGPlusPathResetTransform (HPATH path);
02526 
02538 MGPLUS_EXPORT MPStatus MGPlusPathScale(HPATH path, float sx, float sy);
02539 
02549 MGPLUS_EXPORT MPStatus MGPlusPathRotate (HPATH path, float angle);
02550 
02561 MGPLUS_EXPORT MPStatus MGPlusPathTranslate(HPATH path, float dx, float dy);
02562 
02586 MGPLUS_EXPORT HPEN MGPlusPenCreate (int width, ARGB rgba);
02587 
02601 MGPLUS_EXPORT MPStatus MGPlusPenSetColor (HPEN pen, ARGB rgba);
02602 
02616 MGPLUS_EXPORT MPStatus MGPlusPenSetJoinStyle (HPEN pen, LINE_JOIN_E line_join);
02617 
02631 MGPLUS_EXPORT MPStatus MGPlusPenSetCapStyle (HPEN pen, LINE_CAP_E line_cap);
02632 
02649 MGPLUS_EXPORT MPStatus MGPlusPenSetDashes (HPEN pen, int dash_phase, 
02650         const unsigned char* dash_list, int dash_len);
02651 
02665 MGPLUS_EXPORT MPStatus MGPlusPenSetWidth (HPEN pen, int width);
02666 
02679 MGPLUS_EXPORT MPStatus MGPlusPenDelete (HPEN pen);
02680 
02703 MGPLUS_EXPORT HBRUSH MGPlusBrushCreate (MPBrushType type);
02704 
02717 MGPLUS_EXPORT MPStatus MGPlusBrushDelete (HBRUSH brush);
02718 
02730 MGPLUS_EXPORT MPStatus MGPlusSetSolidBrushColor (HBRUSH brush, ARGB rgba);
02731 
02743 MPStatus MGPlusGetSolidBrushColor (HBRUSH brush, ARGB* rgba);
02744 
02758 MGPLUS_EXPORT MPStatus MGPlusSetTextureBrushImage (HBRUSH brush, 
02759         BITMAP* bitmap);
02760 
02776 MGPLUS_EXPORT MPStatus MGPlusSetPathGradientBrushCenterPoint (HBRUSH brush, 
02777         MPPOINT* point);
02778 
02793 MGPLUS_EXPORT MPStatus MGPlusSetPathGradientBrushCenterColor (HBRUSH brush, 
02794         ARGB rgba);
02795 
02811 MGPLUS_EXPORT MPStatus MGPlusSetPathGradientBrushSurroundColors (HBRUSH brush, 
02812         ARGB* rgba, int count);
02813 
02829 MGPLUS_EXPORT MPStatus MGPlusSetPathGradientBrushSurroundRect (HBRUSH brush, 
02830         RECT* rect);
02831 
02847 MGPLUS_EXPORT MPStatus MGPlusSetLinearGradientBrushMode (HBRUSH brush, 
02848         MPLinearGradientMode mode);
02849 
02863 MGPLUS_EXPORT MPStatus MGPlusGetLinearGradientBrushMode (HBRUSH brush, 
02864         MPLinearGradientMode* mode);
02865 
02879 MGPLUS_EXPORT MPStatus MGPlusSetLinearGradientBrushRect (HBRUSH brush, RECT* rect);
02880 
02895 MGPLUS_EXPORT MPStatus MGPlusSetLinearGradientBrushColors (HBRUSH brush, 
02896         ARGB* colors, int count);
02897 
02914 MGPLUS_EXPORT MPStatus MGPlusSetLinearGradientBrushColorsEx (HBRUSH brush, 
02915         ARGB* colors, int count, float* position);
02916 
02917 
02932 MGPLUS_EXPORT MPStatus MGPlusLinearGradientBrushGetColors (HBRUSH brush, ARGB* color, 
02933         float* position);
02934 
02947 MGPLUS_EXPORT int MGPlusLinearGradientBrushGetColorNumber (HBRUSH brush);
02948 
02963 MGPLUS_EXPORT MPStatus MGPlusLinearGradientBrushAddColor (HBRUSH brush, 
02964         ARGB color, float position);
02965 
02993 MGPLUS_EXPORT HFONT MGPlusCreateFont (const char* font_name, 
02994         unsigned face_index, MPGlyphRendering ren_type,
02995         unsigned int width, unsigned int height, BOOL flip_y);
02996 
03007 MGPLUS_EXPORT MPStatus MGPlusDeleteFont (HFONT hfont);
03008 
03021 MGPLUS_EXPORT HPATH MGPlusGetGlyphPath (int x, int y, LPGLYPHDATA lpdata);
03022 
03037 MGPLUS_EXPORT MPStatus MGPlusGetGlyphOutline (HFONT hfont, unsigned uchar, 
03038         LPGLYPHMETRICS lpgm, LPGLYPHDATA lpdata);
03039 
03058 MGPLUS_EXPORT MPStatus MGPlusDrawGlyph (HGRAPHICS graphics, HFONT hfont, 
03059         int x, int y, LPGLYPHDATA lpdata, ARGB color);
03060 
03078 MGPLUS_EXPORT BOOL MGPlusRegisterFashionLFRDR (void);
03079 
03087 MGPLUS_EXPORT BOOL MGPlusUnregisterFashionLFRDR (void);
03088 
03089 
03093 #ifdef __cplusplus
03094 }
03095 #endif  /* __cplusplus */
03096 
03097 #endif
Generated on Wed Apr 27 09:48:11 2011 for mGPlus V1.2.4 API Reference by  doxygen 1.6.3