news download themes documentation links










FbDrawable.cc

00001 // FbDrawable.cc for FbTk - Fluxbox ToolKit
00002 // Copyright (c) 2003 Henrik Kinnunen (fluxgen at users.sourceforge.net)
00003 //
00004 // Permission is hereby granted, free of charge, to any person obtaining a
00005 // copy of this software and associated documentation files (the "Software"),
00006 // to deal in the Software without restriction, including without limitation
00007 // the rights to use, copy, modify, merge, publish, distribute, sublicense,
00008 // and/or sell copies of the Software, and to permit persons to whom the
00009 // Software is furnished to do so, subject to the following conditions:
00010 //
00011 // The above copyright notice and this permission notice shall be included in
00012 // all copies or substantial portions of the Software.
00013 //
00014 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
00015 // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
00016 // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
00017 // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
00018 // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
00019 // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
00020 // DEALINGS IN THE SOFTWARE.
00021 
00022 // $Id: FbDrawable.cc,v 1.2 2003/09/06 15:39:06 fluxgen Exp $
00023 
00024 #include "FbDrawable.hh"
00025 
00026 #include "App.hh"
00027 
00028 namespace FbTk {
00029 
00030 void FbDrawable::copyArea(Drawable src, GC gc,
00031                         int src_x, int src_y,
00032                         int dest_x, int dest_y,
00033                         unsigned int width, unsigned int height) {
00034     if (drawable() == 0 || src == 0 || gc == 0)
00035         return;
00036     XCopyArea(FbTk::App::instance()->display(),
00037               src, drawable(), gc,
00038               src_x, src_y,
00039               width, height,
00040               dest_x, dest_y);
00041 }
00042 
00043 void FbDrawable::fillRectangle(GC gc, int x, int y,
00044                              unsigned int width, unsigned int height) {
00045     if (drawable() == 0 || gc == 0)
00046         return;
00047     XFillRectangle(FbTk::App::instance()->display(),
00048                    drawable(), gc,
00049                    x, y,
00050                    width, height);
00051 }
00052 
00053 void FbDrawable::drawRectangle(GC gc, int x, int y, 
00054                              unsigned int width, unsigned int height) {
00055     if (drawable() == 0 || gc == 0)
00056         return;
00057     XDrawRectangle(FbTk::App::instance()->display(),
00058                    drawable(), gc,
00059                    x, y,
00060                    width, height);
00061 }
00062 
00063 void FbDrawable::drawLine(GC gc, int start_x, int start_y, 
00064                         int end_x, int end_y) {
00065     if (drawable() == 0 || gc == 0)
00066         return;
00067     XDrawLine(FbTk::App::instance()->display(),
00068               drawable(),
00069               gc,
00070               start_x, start_y,
00071               end_x, end_y);
00072 }
00073 
00074 void FbDrawable::fillPolygon(GC gc, XPoint *points, int npoints,
00075                            int shape, int mode) {
00076     if (drawable() == 0 || gc == 0 || points == 0 || npoints == 0)
00077         return;
00078     XFillPolygon(FbTk::App::instance()->display(),
00079                  drawable(), gc, points, npoints,
00080                  shape, mode);
00081 }
00082 
00083 void FbDrawable::drawPoint(GC gc, int x, int y) {
00084     if (drawable() == 0 || gc == 0)
00085         return;    
00086     XDrawPoint(FbTk::App::instance()->display(), drawable(), gc, x, y);
00087 }
00088 
00089 XImage *FbDrawable::image(int x, int y, unsigned int width, unsigned int height) const {
00090     return XGetImage(FbTk::App::instance()->display(), drawable(), 
00091                      x, y, width, height, 
00092                      AllPlanes, // plane mask
00093                      ZPixmap);
00094 }
00095 
00096 }; // end namespace FbTk

Fluxbox CVS-Jan-2003




      



Got comments about the page? Send them to webmaster.
If you have general Fluxbox related questions ask them on our irc channel or mailing lists.

Show Source








Designed by aLEczapKA