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 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 <goffice/utils/go-color.h>
00030 #include <gtk/gtk.h>
00031 
00039 namespace gccv {
00040 
00041 class Client;
00042 class Group;
00043 class Item;
00044 
00053 class CanvasPrivate;
00054 class Canvas
00055 {
00056 friend class CanvasPrivate;
00057 public:
00064         Canvas (Client *client);
00076         virtual ~Canvas();
00077 
00086         Item *GetItemAt (double x, double y);
00090         GtkWidget *GetWidget () {return m_Widget;}
00098         void Invalidate (double x0, double y0, double x1, double y1);
00104         void SetBackgroundColor (GOColor color);
00110         void SetZoom (double zoom);
00117         void Render (cairo_t *cr, bool is_vector);
00118 
00119 private:
00120         GtkWidget *m_Widget;
00121         Client *m_Client;
00122         bool m_Dragging;
00123 
00127 GCU_RO_PROP (double, Zoom)
00131 GCU_RO_PROP (Group *, Root)
00149 GCU_PROP (double, Gap)
00153 GCU_RO_PROP (GOColor, BackgroundColor)
00154 };
00155 
00156 }
00157 
00158 #endif  //       GCCV_CANVAS_H

Generated on Wed Dec 17 13:43:18 2008 for The Gnome Chemistry Utils by  doxygen 1.5.6