Reference Manual

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

# drawable.h

Go to the documentation of this file.

    00001 /*  Inti: Integrated Foundation Classes
    00002  *  Copyright (C) 2002-2003 The Inti 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 INTI_GDK_DRAWABLE_H
    00025 #define INTI_GDK_DRAWABLE_H
    00026
    00027 #ifndef INTI_G_OBJECT_H
    00028 #include <inti/glib/object.h>
    00029 #endif
    00030
    00031 #ifndef INTI_GDK_GC_H
    00032 #include <inti/gdk/gc.h>
    00033 #endif
    00034
    00035 #ifndef INTI_GDK_TYPES_H
    00036 #include <inti/gdk/types.h>
    00037 #endif
    00038
    00039 namespace Inti {
    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 DrawableClass;
    00052 class Image;
    00053 class Pixbuf;
    00054 class Segment;
    00055 class Screen;
    00056 class Visual;
    00057
    00070
    00071 class Drawable : public G::Object
    00072 {
    00073         friend class G::Object;
    00074         friend class DrawableClass;
    00075
    00076         Drawable(const Drawable&);
    00077         Drawable& operator=(const Drawable&);
    00078
    00079 protected:
    00082
    00083         Drawable();
    00085
    00086         explicit Drawable(GdkDrawable *drawable, bool reference = true);
    00093
    00095 //  Override these do_ methods when you want to change the default behaviour of the GdkDrawable.
    00096
    00097         virtual GdkGC* do_create_gc(GdkGCValues *values, GdkGCValuesMask mask);
    00098
    00099         virtual void do_draw_rectangle(GdkGC *gc, int filled, int x, int y, int width, int height);
    00100
    00101         virtual void do_draw_arc(GdkGC *gcc, int filled, int x, int y, int width, int height, int angle1, int angle2);
    00102
    00103         virtual void do_draw_polygon(GdkGC *gc, int filled, GdkPoint *points, int npoints);
    00104
    00105         virtual void do_draw_drawable(GdkGC *gc, GdkDrawable *src, int xsrc, int ysrc, int xdest, int ydest, int width, int height);
    00106
    00107         virtual void do_draw_points(GdkGC *gc, GdkPoint *points, int npoints);
    00108
    00109         virtual void do_draw_segments(GdkGC *gc, GdkSegment *segments, int nsegments);
    00110
    00111         virtual void do_draw_lines(GdkGC *gc, GdkPoint *points, int npoints);
    00112
    00113         virtual void do_draw_glyphs(GdkGC *gc, PangoFont *font, int  x, int y, PangoGlyphString *glyphs);
    00114
    00115         virtual void do_draw_image(GdkGC *gc, GdkImage *image, int xsrc, int ysrc, int xdest, int ydest, int width, int height);
    00116
    00117         virtual int do_get_depth();
    00118
    00119         virtual void do_get_size(int *width, int *height);
    00120
    00121         virtual void do_set_colormap(GdkColormap *cmap);
    00122
    00123         virtual GdkColormap* do_get_colormap();
    00124
    00125         virtual GdkVisual* do_get_visual();
    00126
    00127         virtual GdkImage* do_get_image(int x, int  y, int width, int height);
    00128
    00129         virtual GdkRegion* do_get_clip_region();
    00130
    00131         virtual GdkRegion* do_get_visible_region();
    00132
    00133 public:
    00136
    00137         virtual ~Drawable();
    00139
    00143
    00144         GdkDrawable* gdk_drawable() const { return (GdkDrawable*)instance; }
    00146
    00147         GdkDrawableClass* gdk_drawable_class() const;
    00149
    00150         operator GdkDrawable* () const;
    00152
    00153         void get_size(int *width, int *height) const;
    00162
    00163         Colormap* get_colormap() const;
    00166
    00167         const Visual* get_visual() const;
    00170
    00171         int get_depth() const;
    00177
    00178         Screen* get_screen() const;
    00181
    00182         Display* get_display() const;
    00185
    00186         Pointer<Image> get_image(int x, int y, int width, int height) const;
    00215
    00216         Pointer<Region> get_clip_region() const;
    00225
    00226         Pointer<Region> get_visible_region() const;
    00232
    00233         Pointer<Pixbuf> get_pixbuf(int x, int y, int width, int height, Colormap *colormap = 0) const;
    00234         // Returns a new Pixbuf created from this drawable. If drawable is a pixmap a colormap must be specified.
    00235
    00239
    00240         void set_colormap(Colormap *colormap);
    00249
    00250         void draw_point(const GC& gc, int x, int y);
    00255
    00256         void draw_point(const GC& gc, const Point& point);
    00260
    00261         void draw_points(const GC& gc, const std::vector<Point>& points);
    00265
    00266         void draw_line(const GC& gc, int x1, int y1, int x2, int y2);
    00273
    00274         void draw_line(const GC& gc, const Segment& seg);
    00278
    00279         void draw_lines(const GC& gc, const std::vector<Point>& points);
    00286
    00287         void draw_segments(const GC& gc, const std::vector<Segment>& segs);
    00291
    00292         void draw_rectangle(const GC& gc, int x, int y, int width, int height, bool filled = true);
    00308
    00309         void draw_rectangle(const GC& gc, const Rectangle& rectangle, bool filled = true);
    00322
    00323         void draw_arc(const GC& gc, int x, int y, int width, int height, int angle1, int angle2, bool filled = true);
    00337
    00338         void draw_arc(const GC& gc, const Rectangle& rectangle, int angle1, int angle2, bool filled = true);
    00349
    00350         void draw_polygon(const GC& gc, const std::vector<Point>& points, bool filled = true);
    00357
    00358         void draw_drawable(const GC& gc, const Drawable& src, int xsrc, int ysrc, int xdest, int ydest, int width, int height);
    00378
    00379         void draw_drawable(const GC& gc, const Drawable& src, int xsrc, int ysrc, const Rectangle& dest);
    00397
    00398         void draw_image(const GC& gc, const Image& image, int xsrc, int ysrc, int xdest, int ydest, int width, int height);
    00412
    00413         void draw_glyphs(const GC& gc, const Pango::Font *font, int x, int y, const Pango::GlyphString *glyphs);
    00425
    00426         void draw_layout_line
    00427         (
    00428                 const GC& gc,
    00429                 int x,
    00430                 int y,
    00431                 const Pango::LayoutLine& line,
    00432                 const Color *foreground = 0,
    00433                 const Color *background = 0
    00434         );
    00445
    00446         void draw_layout
    00447         (
    00448                 const GC& gc,
    00449                 int x,
    00450                 int y,
    00451                 const Pango::Layout& layout,
    00452                 const Color *foreground = 0,
    00453                 const Color *background = 0
    00454         );
    00465
    00466         void draw_pixbuf
    00467         (
    00468                 const GC *gc,
    00469                 const Pixbuf& pixbuf,
    00470                 int src_x,
    00471                 int src_y,
    00472                 int dest_x,
    00473                 int dest_y,
    00474                 int width,
    00475                 int height,
    00476                 RgbDither dither,
    00477                 int x_dither,
    00478                 int y_dither
    00479         );
    00498
    00502
    00503         void draw_rgb_image
    00504         (
    00505                 const GC& gc,
    00506                 int x,
    00507                 int y,
    00508                 int width,
    00509                 int height,
    00510                 RgbDither dith,
    00511                 unsigned char *rgb_buf,
    00512                 int rowstride
    00513         );
    00534
    00535         void draw_rgb_image_dithalign
    00536         (
    00537                 const GC& gc,
    00538                 int x,
    00539                 int y,
    00540                 int width,
    00541                 int height,
    00542                 RgbDither dith,
    00543                 unsigned char *rgb_buf,
    00544                 int rowstride,
    00545                 int xdith,
    00546                 int ydith
    00547         );
    00567
    00568         void draw_rgb_32_image
    00569         (
    00570                 const GC& gc,
    00571                 int x,
    00572                 int y,
    00573                 int width,
    00574                 int height,
    00575                 RgbDither dith,
    00576                 unsigned char *buf,
    00577                 int rowstride
    00578         );
    00594
    00595         void draw_rgb_32_image_dithalign
    00596         (
    00597                 const GC& gc,
    00598                 int x,
    00599                 int y,
    00600                 int width,
    00601                 int height,
    00602                 RgbDither dith,
    00603                 unsigned char *buf,
    00604                 int rowstride,
    00605                 int xdith,
    00606                 int ydith
    00607         );
    00619
    00620         void draw_gray_image
    00621         (
    00622                 const GC& gc,
    00623                 int x,
    00624                 int y,
    00625                 int width,
    00626                 int height,
    00627                 RgbDither dith,
    00628                 unsigned char *buf,
    00629                 int rowstride
    00630         );
    00640
    00641         void draw_indexed_image
    00642         (
    00643                 const GC& gc,
    00644                 int x,
    00645                 int y,
    00646                 int width,
    00647                 int height,
    00648                 RgbDither dith,
    00649                 unsigned char *buf,
    00650                 int rowstride,
    00651                 GdkRgbCmap *cmap
    00652         );
    00663
    00665 };
    00666
    00667 } // namespace Gdk
    00668
    00669 } // namespace Inti
    00670
    00671 #endif // INTI_GDK_DRAWABLE_H
    00672

Main Page - Footer