Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members

/home/jeroen/FOX/fox/fox-1.7.33/include/FXDCWindow.h
00001 /********************************************************************************
00002 *                                                                               *
00003 *  D e v i c e   C o n t e x t   F o r   W i n d o w s   a n d   I m a g e s    *
00004 *                                                                               *
00005 *********************************************************************************
00006 * Copyright (C) 1999,2012 by Jeroen van der Zijp.   All Rights Reserved.        *
00007 *********************************************************************************
00008 * This library is free software; you can redistribute it and/or modify          *
00009 * it under the terms of the GNU Lesser General Public License as published by   *
00010 * the Free Software Foundation; either version 3 of the License, or             *
00011 * (at your option) any later version.                                           *
00012 *                                                                               *
00013 * This library is distributed in the hope that it will be useful,               *
00014 * but WITHOUT ANY WARRANTY; without even the implied warranty of                *
00015 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the                 *
00016 * GNU Lesser General Public License for more details.                           *
00017 *                                                                               *
00018 * You should have received a copy of the GNU Lesser General Public License      *
00019 * along with this program.  If not, see <http://www.gnu.org/licenses/>          *
00020 ********************************************************************************/
00021 #ifndef FXDCWINDOW_H
00022 #define FXDCWINDOW_H
00023 
00024 #ifndef FXDC_H
00025 #include "FXDC.h"
00026 #endif
00027 
00028 namespace FX {
00029 
00030 
00031 class FXApp;
00032 class FXDrawable;
00033 class FXImage;
00034 class FXBitmap;
00035 class FXIcon;
00036 class FXFont;
00037 
00038 
00048 class FXAPI FXDCWindow : public FXDC {
00049   friend class FXFont;
00050 protected:
00051   FXDrawable *surface;        // Drawable surface
00052   FXRectangle rect;           // Paint rectangle inside drawable
00053   FXPixel     devfg;          // Device foreground pixel value
00054   FXPixel     devbg;          // Device background pixel value
00055 #ifdef WIN32
00056   FXID        oldpalette;
00057   FXID        oldbrush;
00058   FXID        oldpen;
00059   FXbool      needsNewBrush;
00060   FXbool      needsNewPen;
00061   FXbool      needsPath;
00062   FXbool      needsClipReset;
00063 #else
00064   void       *xftDraw;
00065   FXuint      flags;
00066 #endif
00067 private:
00068 #ifdef WIN32
00069   void updateBrush();
00070   void updatePen();
00071 #endif
00072 private:
00073   FXDCWindow();
00074   FXDCWindow(const FXDCWindow&);
00075   FXDCWindow &operator=(const FXDCWindow&);
00076 public:
00077 
00080   FXDCWindow(FXDrawable* draw,FXEvent* event);
00081 
00084   FXDCWindow(FXDrawable* draw);
00085 
00087   FXDrawable *drawable() const { return surface; }
00088 
00090   void begin(FXDrawable *draw);
00091 
00093   void end();
00094 
00096   virtual FXColor readPixel(FXint x,FXint y);
00097 
00099   virtual void drawPoint(FXint x,FXint y);
00100   virtual void drawPoints(const FXPoint* points,FXuint npoints);
00101   virtual void drawPointsRel(const FXPoint* points,FXuint npoints);
00102 
00104   virtual void drawLine(FXint x1,FXint y1,FXint x2,FXint y2);
00105   virtual void drawLines(const FXPoint* points,FXuint npoints);
00106   virtual void drawLinesRel(const FXPoint* points,FXuint npoints);
00107   virtual void drawLineSegments(const FXSegment* segments,FXuint nsegments);
00108 
00110   virtual void drawRectangle(FXint x,FXint y,FXint w,FXint h);
00111   virtual void drawRectangles(const FXRectangle* rectangles,FXuint nrectangles);
00112 
00114   virtual void drawRoundRectangle(FXint x,FXint y,FXint w,FXint h,FXint ew,FXint eh);
00115 
00117   virtual void drawArc(FXint x,FXint y,FXint w,FXint h,FXint ang1,FXint ang2);
00118   virtual void drawArcs(const FXArc* arcs,FXuint narcs);
00119 
00121   virtual void drawEllipse(FXint x,FXint y,FXint w,FXint h);
00122 
00124   virtual void fillRectangle(FXint x,FXint y,FXint w,FXint h);
00125   virtual void fillRectangles(const FXRectangle* rectangles,FXuint nrectangles);
00126 
00128   virtual void fillRoundRectangle(FXint x,FXint y,FXint w,FXint h,FXint ew,FXint eh);
00129 
00131   virtual void fillChord(FXint x,FXint y,FXint w,FXint h,FXint ang1,FXint ang2);
00132   virtual void fillChords(const FXArc* chords,FXuint nchords);
00133 
00135   virtual void fillArc(FXint x,FXint y,FXint w,FXint h,FXint ang1,FXint ang2);
00136   virtual void fillArcs(const FXArc* arcs,FXuint narcs);
00137 
00139   virtual void fillEllipse(FXint x,FXint y,FXint w,FXint h);
00140 
00142   virtual void fillPolygon(const FXPoint* points,FXuint npoints);
00143   virtual void fillConcavePolygon(const FXPoint* points,FXuint npoints);
00144   virtual void fillComplexPolygon(const FXPoint* points,FXuint npoints);
00145 
00147   virtual void fillPolygonRel(const FXPoint* points,FXuint npoints);
00148   virtual void fillConcavePolygonRel(const FXPoint* points,FXuint npoints);
00149   virtual void fillComplexPolygonRel(const FXPoint* points,FXuint npoints);
00150 
00152   virtual void fillVerticalGradient(FXint x,FXint y,FXint w,FXint h,FXColor top,FXColor bottom);
00153 
00155   virtual void fillHorizontalGradient(FXint x,FXint y,FXint w,FXint h,FXColor left,FXColor right);
00156 
00158   virtual void drawHashBox(FXint x,FXint y,FXint w,FXint h,FXint b=1);
00159 
00161   virtual void drawFocusRectangle(FXint x,FXint y,FXint w,FXint h);
00162 
00164   virtual void drawArea(const FXDrawable* source,FXint sx,FXint sy,FXint sw,FXint sh,FXint dx,FXint dy);
00165 
00167   virtual void drawArea(const FXDrawable* source,FXint sx,FXint sy,FXint sw,FXint sh,FXint dx,FXint dy,FXint dw,FXint dh);
00168 
00170   virtual void drawImage(const FXImage* image,FXint dx,FXint dy);
00171 
00173   virtual void drawBitmap(const FXBitmap* bitmap,FXint dx,FXint dy);
00174 
00176   virtual void drawIcon(const FXIcon* icon,FXint dx,FXint dy);
00177   virtual void drawIconShaded(const FXIcon* icon,FXint dx,FXint dy);
00178   virtual void drawIconSunken(const FXIcon* icon,FXint dx,FXint dy);
00179 
00181   virtual void drawText(FXint x,FXint y,const FXString& string);
00182   virtual void drawText(FXint x,FXint y,const FXchar* string,FXuint length);
00183 
00185   virtual void drawImageText(FXint x,FXint y,const FXString& string);
00186   virtual void drawImageText(FXint x,FXint y,const FXchar* string,FXuint length);
00187 
00189   virtual void setForeground(FXColor clr);
00190   virtual void setBackground(FXColor clr);
00191 
00193   virtual void setDashes(FXuint dashoffset,const FXchar *dashpattern,FXuint dashlength);
00194 
00196   virtual void setLineWidth(FXuint linewidth=0);
00197 
00199   virtual void setLineCap(FXCapStyle capstyle=CAP_BUTT);
00200 
00202   virtual void setLineJoin(FXJoinStyle joinstyle=JOIN_MITER);
00203 
00205   virtual void setLineStyle(FXLineStyle linestyle=LINE_SOLID);
00206 
00208   virtual void setFillStyle(FXFillStyle fillstyle=FILL_SOLID);
00209 
00211   virtual void setFillRule(FXFillRule fillrule=RULE_EVEN_ODD);
00212 
00214   virtual void setFunction(FXFunction func=BLT_SRC);
00215 
00217   virtual void setTile(FXImage* tile,FXint dx=0,FXint dy=0);
00218 
00220   virtual void setStipple(FXBitmap *stipple,FXint dx=0,FXint dy=0);
00221 
00223   virtual void setStipple(FXStipplePattern stipple,FXint dx=0,FXint dy=0);
00224 
00226   virtual void setClipRegion(const FXRegion& region);
00227 
00229   virtual void setClipRectangle(FXint x,FXint y,FXint w,FXint h);
00230 
00232   virtual void setClipRectangle(const FXRectangle& rectangle);
00233 
00235   virtual void clearClipRectangle();
00236 
00238   virtual void setClipMask(FXBitmap* mask,FXint dx=0,FXint dy=0);
00239 
00241   virtual void clearClipMask();
00242 
00244   virtual void setFont(FXFont *fnt);
00245 
00247   virtual void clipChildren(FXbool yes);
00248 
00250   virtual ~FXDCWindow();
00251   };
00252 
00253 }
00254 
00255 #endif

Copyright © 1997-2011 Jeroen van der Zijp