00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052 #ifndef INC_MI32_MG2X_H
00053 #define INC_MI32_MG2X_H
00054
00055 #ifndef X_NATIVE
00056 #error Cannot use this header unless building for X_NATIVE
00057 #endif
00058
00059 #ifndef INC_MI32_MGD2_H
00060 #include <mi32/mgd2.h>
00061 #endif
00062
00063 #include <X11/Intrinsic.h>
00064
00065 namespace MGD {
00066
00067 class CONTEXT_X;
00068
00070 class DEVICE_X : public DEVICE {
00071
00072 public:
00073
00076 DEVICE_X();
00077
00078
00079
00081 virtual ~DEVICE_X();
00082
00083
00084
00086 ERRVALUE ChangeDrawable (
00087 Drawable drawable
00088 );
00089
00093 ERRVALUE ChangeWidget (
00094 Widget widget
00095 );
00096
00097 ERRVALUE Create (
00098 Display* display,
00099 Drawable drawable
00100 );
00101
00102 Display* GetDisplay () const
00103 { return (m_display); }
00104
00105 Drawable GetDrawable () const
00106 { return (m_drawable); }
00107
00108 protected:
00109
00110 virtual CAPABILITY v_GetCapabilities () const;
00111
00112 private:
00113 #ifndef GENERATING_DOXYGEN_OUTPUT
00114 typedef DEVICE BASECLASS;
00115 friend class CONTEXT_X;
00116
00118 DEVICE_X (const DEVICE_X&);
00119
00120 Display *m_display;
00121 XImage *m_ximage;
00122 void *m_imagedata;
00123 Drawable m_drawable;
00124 UINT8 m_tempbuf[512];
00125
00126 virtual CONTEXT* v_CreateContext ();
00127 virtual ERRVALUE v_FillSpan (MGD::CONTEXT *gc, INT32 x1, INT32 x2, INT32 y);
00128 #endif // GENERATING_DOXYGEN_OUTPUT
00129
00130 };
00131
00132 class CONTEXT_X : public CONTEXT {
00133 public:
00134
00135 virtual ~CONTEXT_X ();
00136
00137 GC GetXGC (
00138 ) const {
00139 return (m_gc);
00140 }
00141
00142 protected:
00143
00145 CONTEXT_X (
00146 DEVICE_X *pDevX
00147 );
00148
00149 DEVICE_X *m_DevX;
00150
00151 private:
00152 #ifndef GENERATING_DOXYGEN_OUTPUT
00153 typedef MGD::CONTEXT BASECLASS;
00154
00155 int m_arcmode;
00156 GC m_gc;
00157 Pixmap m_PixmapStipple;
00158
00159
00160 CONTEXT_X (const CONTEXT_X&);
00161
00162 friend class MGD::DEVICE_X;
00163
00164 virtual ERRVALUE v_CopyRect (const MGD::DEVICE *pDevSrc, const LRECT2D& RectSrc, const LPOINT2D& PtTgtIn, MGD::DEVICE_MEM8G *pDevAlpha);
00165 virtual ERRVALUE v_DrawArc (INT32 xcenter, INT32 ycenter, INT32 xradius, INT32 yradius, double startangle, double sweepangle, double rotangle = 0, MGD::SHAPECLOSE closemode = SHAPECLOSE_None);
00166 virtual ERRVALUE v_DrawCircle (INT32 xcenter, INT32 ycenter, INT32 radius);
00167 virtual ERRVALUE v_DrawEllipse (INT32 xcenter, INT32 ycenter, INT32 xradius, INT32 yradius, double rotangle = 0.0);
00168 virtual ERRVALUE v_DrawIcon (INT32 x, INT32 y, MICONSTRUCT* icon, ICONFLAGS flags);
00169 virtual ERRVALUE v_DrawLine (INT32 x1, INT32 y1, INT32 x2, INT32 y2);
00170 virtual ERRVALUE v_DrawLinesLow (const LPOINT2D* points, INT32 numpoints);
00171 virtual ERRVALUE v_DrawLinesLow (const POLYLINE& line);
00172 virtual ERRVALUE v_DrawPoint (INT32 x, INT32 y);
00173 virtual ERRVALUE v_DrawPoints (const LPOINT2D *points, INT32 NumPoints);
00174 virtual ERRVALUE v_DrawRectangle (INT32 x1, INT32 x2, INT32 y1, INT32 y2);
00175 virtual ERRVALUE v_DrawSegments (const LSEGMENT2D* segments, INT32 NumSegments);
00176 virtual ERRVALUE v_FillArc (INT32 xcenter, INT32 ycenter, INT32 xradius, INT32 yradius, double startangle, double sweepangle, double rotangle = 0, MGD::SHAPECLOSE closemode = SHAPECLOSE_Direct);
00177 virtual ERRVALUE v_FillCircle (INT32 xcenter, INT32 ycenter, INT32 radius);
00178 virtual ERRVALUE v_FillEllipse (INT32 xcenter, INT32 ycenter, INT32 xradius, INT32 yradius, double rotangle = 0.0);
00179 virtual ERRVALUE v_FillPolygon (const LPOINT2D* points, INT32 NumPoints, MGD::POLYSHAPE shape = POLYSHAPE_Complex, bool DrawBorder = false);
00180 virtual ERRVALUE v_FillRectangle (INT32 x1, INT32 x2, INT32 y1, INT32 y2);
00181 ERRVALUE v_InterfaceTextDrawString (INT32 x, INT32 y, const MIUNICODE* string, TEXTBASEORIGIN origin, bool bVisualOrder, INTERFACETEXTSTYLE style);
00182 ERRVALUE v_InterfaceTextGetExtents (const MIUNICODE* string, int *pwidth, int *pheight, int *pascent, INTERFACETEXTSTYLE style);
00183 ERRVALUE v_InterfaceTextGetMetrics (const MIUNICODE* string, TEXTMETRICS& metrics, INTERFACETEXTSTYLE style);
00184 int v_InterfaceTextGetWidth (const MIUNICODE* string, INTERFACETEXTSTYLE style, bool bInkMetrics);
00185 virtual ERRVALUE v_PutImageSpanDirect (INT32 x, INT32 y, INT32 len, const void* data, const UINT8* mask = 0);
00186 virtual ERRVALUE v_PutPixel (INT32 x, INT32 y, MGD::PIXEL pixel);
00187 virtual void v_UpdateClipNone ();
00188 virtual void v_UpdateClipRect ();
00189 virtual void v_UpdateColor ();
00190 virtual void v_UpdateLineAttributes ();
00191 virtual void v_UpdateLineWidth ();
00192 virtual void v_UpdatePixelFunc ();
00193 virtual void v_UpdatePlaneMask ();
00194 virtual void v_UpdateStipple ();
00195 #endif // GENERATING_DOXYGEN_OUTPUT
00196 };
00197
00198 }
00199
00200
00201 #endif // INC_MI32_MG2X_H
00202