canvas.h

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 
00003 /* 
00004  * Gnome Chemistry Utils
00005  * gccv/canvas.h 
00006  *
00007  * Copyright (C) 2008-2009 Jean Bréfort <jean.brefort@normalesup.org>
00008  *
00009  * This program is free software; you can redistribute it and/or 
00010  * modify it under the terms of the GNU General Public License as 
00011  * published by the Free Software Foundation; either version 2 of the
00012  * License, or (at your option) any later version.
00013  *
00014  * This program is distributed in the hope that it will be useful,
00015  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00016  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00017  * GNU General Public License for more details.
00018  *
00019  * You should have received a copy of the GNU General Public License
00020  * along with this program; if not, write to the Free Software
00021  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301
00022  * USA
00023  */
00024 
00025 #ifndef GCCV_CANVAS_H
00026 #define GCCV_CANVAS_H
00027 
00028 #include <gcu/macros.h>
00029 #include <gtk/gtk.h>
00030 
00038 namespace gccv {
00039 
00040 class Client;
00041 class Group;
00042 class Item;
00043 
00052 class CanvasPrivate;
00053 class Canvas
00054 {
00055 friend class CanvasPrivate;
00056 public:
00063         Canvas (Client *client);
00075         virtual ~Canvas();
00076 
00085         Item *GetItemAt (double x, double y);
00089         GtkWidget *GetWidget () {return m_Widget;}
00097         void Invalidate (double x0, double y0, double x1, double y1);
00103         void SetBackgroundColor (GOColor color);
00109         void SetZoom (double zoom);
00116         void Render (cairo_t *cr, bool is_vector);
00117 
00118 private:
00119         GtkWidget *m_Widget;
00120         Client *m_Client;
00121         bool m_Dragging;
00122 
00126 GCU_RO_PROP (double, Zoom)
00130 GCU_RO_PROP (Group *, Root)
00148 GCU_PROP (double, Gap)
00152 GCU_RO_PROP (GOColor, BackgroundColor)
00156                 GCU_RO_PROP (unsigned, LastEventState)
00157 };
00158 
00159 }
00160 
00161 #endif  //       GCCV_CANVAS_H

Generated on Fri Sep 24 15:58:41 2010 for The Gnome Chemistry Utils by  doxygen 1.5.9