Reference Manual

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

# visual.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_VISUAL_H
    00025 #define INTI_GDK_VISUAL_H
    00026
    00027 #ifndef INTI_G_OBJECT_H
    00028 #include <inti/glib/object.h>
    00029 #endif
    00030
    00031 #ifndef INTI_GDK_TYPES_H
    00032 #include <inti/gdk/types.h>
    00033 #endif
    00034
    00035 #ifndef _CPP_VECTOR
    00036 #include <vector>
    00037 #endif
    00038
    00039 namespace Inti {
    00040
    00041 namespace Gdk {
    00042
    00046
    00047 enum VisualType
    00048 {
    00049         VISUAL_STATIC_GRAY = GDK_VISUAL_STATIC_GRAY,
    00051
    00052         VISUAL_GRAYSCALE = GDK_VISUAL_GRAYSCALE,
    00055
    00056         VISUAL_STATIC_COLOR = GDK_VISUAL_STATIC_COLOR,
    00059
    00060         VISUAL_PSUEDO_COLOR = GDK_VISUAL_PSEUDO_COLOR,
    00063
    00064         VISUAL_TRUE_COLOR = GDK_VISUAL_TRUE_COLOR,
    00068
    00069         VISUAL_DIRECT_COLOR = GDK_VISUAL_DIRECT_COLOR
    00073 };
    00074
    00100
    00101 class Visual : public G::Object
    00102 {
    00103         friend class G::Object;
    00104
    00105         Visual(const Visual&);
    00106         Visual& operator=(const Visual&);
    00107
    00108 protected:
    00111
    00112         explicit Visual(GdkVisual *visual, bool reference = true);
    00119
    00121
    00122 public:
    00125
    00126         virtual ~ Visual();
    00128
    00130
    00131         static const Visual* get_best();
    00133
    00134         static const Visual* get_best(int depth);
    00141
    00142         static const Visual* get_best(VisualType visual_type);
    00148
    00149         static const Visual* get_best(int depth, VisualType visual_type);
    00155
    00156         static const Visual* get_system();
    00159
    00162
    00163         GdkVisual* gdk_visual() const { return (GdkVisual*)instance; }
    00165
    00166         GdkVisualClass* gdk_visual_class() const;
    00168
    00169         operator GdkVisual* () const;
    00171
    00172         VisualType type() const;
    00174
    00175         int depth() const;
    00177
    00178         ByteOrder byte_order() const;
    00180
    00181         int colormap_size() const;
    00187
    00188         int bits_per_rgb() const;
    00191
    00192         unsigned int red_mask() const;
    00195
    00196         int red_shift() const;
    00211
    00212         int red_prec() const;
    00214
    00215         unsigned int green_mask() const;
    00217
    00218         int green_shift() const;
    00221
    00222         int green_prec() const;
    00224
    00225         unsigned int blue_mask() const;
    00227
    00228         int blue_shift() const;
    00231
    00232         int blue_prec() const;
    00234
    00235         int get_best_depth() const;
    00240
    00241         VisualType get_best_type() const;
    00244
    00246
    00247         static std::vector<int> query_depths();
    00253
    00254         static bool query_visual_types(std::vector<VisualType>& visual_types);
    00261
    00262         static bool list_visuals(std::vector<const Visual*>& visuals);
    00269 };
    00270
    00271 } // namespace Gdk
    00272
    00273 } // namespace Inti
    00274
    00275 #endif // INTI_GDK_VISUAL_H
    00276

Main Page - Footer