📄 total
字号:
#ifndef _MGBITMAP_H_#define _MGBITMAP_H_class MGBitmap : public MGPixmap{public: MGBitmap(); ~MGBitmap();};#endif#ifndef _MGBRUSH_H_#define _MGBRUSH_H_class MGBrush{friend class MGPainter;public: MGBrush(); MGBrush( const MGColor&, int brush_style = MG::SolidPattern ); ~MGBrush(); const MGColor& color() const { return cl; }protected: void init( const MGColor&, int brush_style ); protected: int style; MGColor cl;};#endif#ifndef _MGCOLOR_H_#define _MGCOLOR_H_typedef unsigned int MGRgb;class MGColor{public: MGColor(); MGColor( const char* p ); MGColor( int r, int g, int b ); ~MGColor(); MGColor& operator=( const MGColor& c ); bool operator==( const MGColor& c ) const; bool operator!=( const MGColor& c ) const; bool isValid() const; int red() const; int green() const; int blue() const; void setRgb( int r, int g, int b );#if( _CURRENT_PLATFORM == _PLATFORM_MINIGUI ) void Rgb2Gal( const HDC&, bool force = true );#endif // dataprotected:#if( _CURRENT_PLATFORM == _PLATFORM_MINIGUI ) RGB rgbVal; gal_pixel pixVal;#endif};#endif#ifndef _MGCOLORGROUP_H_#define _MGCOLORGROUP_H_class MGColorGroup{ enum ColorRole { Foreground, Button, Light, Midlight, Dark, Mid, Text, BrightText, ButtonText, Base, Background, Shadow, Highlight, HighlightedText, NColorRoles }; public: MGColorGroup(); MGColorGroup( const MGColor& foreground, const MGColor& background, const MGColor& light, const MGColor& dark, const MGColor& mid, const MGColor& text, const MGColor& base ); ~MGColorGroup();protected: MGBrush *br;};#endif#ifndef _MGFONT_H_#define _MGFONT_H_class MGFont{public: MGFont(); MGFont( const MGString& family, int pointSize = 12, int weight = MG::Normal, bool italic = false ); ~MGFont(); bool operator==( const MGFont& f ) const; bool operator!=( const MGFont& f ) const; int pointSize() const;protected: friend class MGFontMetrics;#if( _CURRENT_PLATFORM == _PLATFORM_MINIGUI ) bool autoDel; PLOGFONT font;#endif};#endif#ifndef _MGFONTINFO_H_#define _MGFONTINFO_H_class MGFontInfo{public: MGFontInfo(); MGFontInfo( const MGFont& ); MGFontInfo( const MGFontInfo& ); ~MGFontInfo(); bool fixedPitch() const;};#endif#ifndef _MGFONTMETRICS_H_#define _MGFONTMETRICS_H_class MGFontMetrics{public: MGFontMetrics(); ~MGFontMetrics(); MGFontMetrics( const MGFont& ); MGFontMetrics( const MGFontMetrics& ); int ascent() const; int descent() const; int width( char ) const; int width( MGChar ) const; int width( const MGString&, int len = -1 ) const; int height() const; MGRect boundingRect( const MGString&, int len = -1 ) const; int leftBearing( MGChar ) const; int rightBearing( MGChar ) const;protected:#if( _CURRENT_PLATFORM == _PLATFORM_MINIGUI ) LOGFONT font; MGPainter *painter;#endif};#endif#ifndef _MGPAINTER_H_#define _MGPAINTER_H_class MGPainter{public: MGPainter(); ~MGPainter(); void setBrush( int brush_style ); void setBrush( const MGBrush& ); void setBrush( const MGColor& ); void setFont( const MGFont& ); void setPen( const MGPen& ); void setPen( const MGColor& ); void setPen( int ); const MGPen& pen() const; MGFontMetrics fontMetrics() const; void drawRect( int x, int y, int w, int h ); void drawText( int x, int y, const MGString&, int len = -1 ); void drawText( int x, int y, int w, int h, int flags, const MGString&, int len = -1, MGRect *br = 0, char **internal = 0 ); void drawLine( int x1, int y1, int x2, int y2 ); void drawTiledPixmap( int x, int y, int w, int h, const MGPixmap& map, int sx = 0, int sy = 0 ); void drawPixmap( const MGPoint&, const MGPixmap& ); void drawPixmap( const MGPoint&, const MGPixmap&, const MGRect& sr ); void drawPixmap( int x, int y, const MGPixmap&, int sx = 0, int sy = 0, int sw = -1, int sh = -1 ); void drawEllipse( int x, int y, int w, int h ); void drawArc( int x, int y, int w, int h, int a, int alen ); void drawPolyline( const MGPointArray&, int index = 0, int npoints = -1 ); void fillRect( int x, int y, int w, int h, const MGColor& c ); void fillRect( int x, int y, int w, int h, const MGBrush& ); void fillRect( const MGRect&, const MGBrush& ); bool hasClipping() const; void setClipping( bool ); void setRasterOp( int );protected: friend class MGFontMetrics; MGBrush cbrush; MGFont cfont; MGPen cpen;#if( _CURRENT_PLATFORM == _PLATFORM_MINIGUI ) HDC hdc;#endif};#endif#ifndef _MGPEN_H_#define _MGPEN_H_class MGPen{public: MGPen(); ~MGPen(); MGPen( const MGPen& p ); MGPen( const MGColor& c, unsigned int width = 0, int style = MG::SolidLine ); const MGColor& color() const { return cl; } void init( const MGColor&, unsigned int width, int style );protected: unsigned int width; int style; MGColor cl;};#endif#ifndef _MGPIXMAP_H_#define _MGPIXMAP_H_class MGPixmap{public: MGPixmap(); ~MGPixmap(); int width() const; int height() const; const MGBitmap* mask() const; MGSize size() const; void resize( int w, int h ); void resize( const MGSize& ); bool isNull() const;protected:#if( _CURRENT_PLATFORM == _PLATFORM_MINIGUI ) BITMAP bmp;#endif};#endif#ifndef _MGPOINT_H_#define _MGPOINT_H_class MGPoint{public: MGPoint(); MGPoint( int xpos, int ypos ); ~MGPoint();protected: int xp; int yp;};#endif#ifndef _MGRECT_H_#define _MGRECT_H_class MGRect{public: MGRect(); ~MGRect(); MGRect( int left, int top, int width, int height ); MGRect( const MGRect& r ); int left() const; int top() const; int right() const; int bottom() const; int x() const; int y() const; int width() const; int height() const; MGSize size() const; void setWidth( int w ); void setHeight( int h ); bool isValid() const;protected: int x1; int y1; int x2; int y2;};#endif#ifndef _MGSIZE_H_#define _MGSIZE_H_class MGSize{public: MGSize(); ~MGSize(); MGSize( int w, int h ); MGSize( const MGSize& s ); MGSize& operator=( const MGSize& s ); bool operator==( const MGSize& s ) const; bool operator!=( const MGSize& s ) const; int width() const; int height() const; void setWidth( int w ); void setHeight( int h );protected: int wd; int ht;};#endif#ifndef _MGWMATRIX_H_#define _MGWMATRIX_H_class MGWMatrix{public: MGWMatrix(); MGWMatrix( double m11, double m12, double m21, double m22, double dx, double dy ); ~MGWMatrix(); MGWMatrix& scale( double sx, double sy ); MGRect map( const MGRect& ); void setMatrix( double m11, double m12, double m21, double m22, double dx, double dy ); protected: MGWMatrix& bmul( const MGWMatrix& m );protected: double _m11, _m12; double _m21, _m22; double _dx, _dy;};#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -