GFC Logo GFC Title Logo
Reference Manual
Main Page  |  Namespace List  |  Alphabetical List  |  Class List  |  File List

drawable.hh

Go to the documentation of this file.
00001 /* GFC-UI: GTK+ Foundation Classes (User Interface Library) 00002 * Copyright (C) 2002-2004 The GFC Development Team. 00003 * 00004 * This program is free software; you can redistribute it and/or modify 00005 * it under the terms of the GNU General Public License as published by 00006 * the Free Software Foundation; either version 2 of the License, or 00007 * (at your option) any later version. 00008 * 00009 * This program is distributed in the hope that it will be useful, 00010 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00012 * GNU Library General Public License for more details. 00013 * 00014 * You should have received a copy of the GNU Library General Public License 00015 * along with this program; if not, write to the Free Software 00016 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 00017 */ 00018 00023 00024 #ifndef GFC_GDK_DRAWABLE_HH 00025 #define GFC_GDK_DRAWABLE_HH 00026 00027 #ifndef GFC_G_OBJECT_HH 00028 #include <gfc/glib/object.hh> 00029 #endif 00030 00031 #ifndef GFC_GDK_GC_HH 00032 #include <gfc/gdk/gc.hh> 00033 #endif 00034 00035 #ifndef GFC_GDK_TYPES_HH 00036 #include <gfc/gdk/types.hh> 00037 #endif 00038 00039 namespace GFC { 00040 00041 namespace Pango { 00042 class Font; 00043 class GlyphString; 00044 class Layout; 00045 class LayoutLine; 00046 } 00047 00048 namespace Gdk { 00049 00050 class Display; 00051 class Image; 00052 class Pixbuf; 00053 class Segment; 00054 class Screen; 00055 class Visual; 00056 00069 00070 class Drawable : public G::Object 00071 { 00072 friend class G::Object; 00073 00074 Drawable(const Drawable&); 00075 Drawable& operator=(const Drawable&); 00076 00077 protected: 00080 00081 explicit Drawable(GdkDrawable *drawable, bool owns_reference = true); 00088 00090 00091 public: 00094 00095 virtual ~Drawable() = 0; 00097 00101 00102 GdkDrawable* gdk_drawable() const; 00104 00105 operator GdkDrawable* () const; 00107 00108 void get_size(int *width, int *height) const; 00117 00118 Colormap* get_colormap() const; 00121 00122 const Visual* get_visual() const; 00125 00126 int get_depth() const; 00132 00133 Screen* get_screen() const; 00136 00137 Display* get_display() const; 00140 00141 Pointer<Image> get_image(int x, int y, int width, int height) const; 00170 00171 Pointer<Region> get_clip_region() const; 00180 00181 Pointer<Region> get_visible_region() const; 00187 00188 Pointer<Pixbuf> get_pixbuf(int x, int y, int width, int height, Colormap *colormap = 0) const; 00189 // Returns a new Pixbuf created from this drawable. If drawable is a pixmap a colormap must be specified. 00190 00194 00195 void set_colormap(Colormap *colormap); 00204 00205 void copy_to_image(Image& image, int src_x, int src_y, int dest_x, int dest_y, int width, int height); 00215 00216 void copy_to_image(Image& image, const Rectangle& src_rect, int dest_x, int dest_y); 00223 00224 void draw_point(const GC& gc, int x, int y); 00229 00230 void draw_point(const GC& gc, const Point& point); 00234 00235 void draw_points(const GC& gc, const std::vector<Point>& points); 00239 00240 void draw_line(const GC& gc, int x1, int y1, int x2, int y2); 00247 00248 void draw_line(const GC& gc, const Segment& seg); 00252 00253 void draw_lines(const GC& gc, const std::vector<Point>& points); 00260 00261 void draw_segments(const GC& gc, const std::vector<Segment>& segs); 00265 00266 void draw_rectangle(const GC& gc, int x, int y, int width, int height, bool filled = true); 00282 00283 void draw_rectangle(const GC& gc, const Rectangle& rectangle, bool filled = true); 00296 00297 void draw_arc(const GC& gc, int x, int y, int width, int height, int angle1, int angle2, bool filled = true); 00311 00312 void draw_arc(const GC& gc, const Rectangle& rectangle, int angle1, int angle2, bool filled = true); 00323 00324 void draw_polygon(const GC& gc, const std::vector<Point>& points, bool filled = true); 00331 00332 void draw_drawable(const GC& gc, const Drawable& src, int xsrc, int ysrc, int xdest, int ydest, int width, int height); 00352 00353 void draw_drawable(const GC& gc, const Drawable& src, const Rectangle& src_rect, int xdest, int ydest); 00369 00370 void draw_image(const GC& gc, const Image& image, int xsrc, int ysrc, int xdest, int ydest, int width, int height); 00384 00385 void draw_glyphs(const GC& gc, const Pango::Font *font, int x, int y, const Pango::GlyphString *glyphs); 00397 00398 void draw_layout_line 00399 ( 00400 const GC& gc, 00401 int x, 00402 int y, 00403 const Pango::LayoutLine& line, 00404 const Color *foreground = 0, 00405 const Color *background = 0 00406 ); 00417 00418 void draw_layout 00419 ( 00420 const GC& gc, 00421 int x, 00422 int y, 00423 const Pango::Layout& layout, 00424 const Color *foreground = 0, 00425 const Color *background = 0 00426 ); 00437 00438 void draw_pixbuf 00439 ( 00440 const GC *gc, 00441 const Pixbuf& pixbuf, 00442 int src_x, 00443 int src_y, 00444 int dest_x, 00445 int dest_y, 00446 int width, 00447 int height, 00448 RgbDither dither, 00449 int x_dither, 00450 int y_dither 00451 ); 00470 00474 00475 void draw_rgb_image 00476 ( 00477 const GC& gc, 00478 int x, 00479 int y, 00480 int width, 00481 int height, 00482 RgbDither dith, 00483 unsigned char *rgb_buf, 00484 int rowstride 00485 ); 00506 00507 void draw_rgb_image_dithalign 00508 ( 00509 const GC& gc, 00510 int x, 00511 int y, 00512 int width, 00513 int height, 00514 RgbDither dith, 00515 unsigned char *rgb_buf, 00516 int rowstride, 00517 int xdith, 00518 int ydith 00519 ); 00539 00540 void draw_rgb_32_image 00541 ( 00542 const GC& gc, 00543 int x, 00544 int y, 00545 int width, 00546 int height, 00547 RgbDither dith, 00548 unsigned char *buf, 00549 int rowstride 00550 ); 00566 00567 void draw_rgb_32_image_dithalign 00568 ( 00569 const GC& gc, 00570 int x, 00571 int y, 00572 int width, 00573 int height, 00574 RgbDither dith, 00575 unsigned char *buf, 00576 int rowstride, 00577 int xdith, 00578 int ydith 00579 ); 00591 00592 void draw_gray_image 00593 ( 00594 const GC& gc, 00595 int x, 00596 int y, 00597 int width, 00598 int height, 00599 RgbDither dith, 00600 unsigned char *buf, 00601 int rowstride 00602 ); 00612 00613 void draw_indexed_image 00614 ( 00615 const GC& gc, 00616 int x, 00617 int y, 00618 int width, 00619 int height, 00620 RgbDither dith, 00621 unsigned char *buf, 00622 int rowstride, 00623 GdkRgbCmap *cmap 00624 ); 00635 00637 }; 00638 00639 } // namespace Gdk 00640 00641 } // namespace GFC 00642 00643 #include <gfc/gdk/inline/drawable.inl> 00644 00645 #endif // GFC_GDK_DRAWABLE_HH 00646

Generated on Tue Aug 24 00:34:30 2004 for GFC-UI by doxygen 1.3.8