Reference Manual

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

# types.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_TYPES_H
    00025 #define INTI_GDK_TYPES_H
    00026
    00027 #ifndef __GDK_H__
    00028 #include <gdk/gdk.h>
    00029 #endif
    00030
    00031 namespace Inti {
    00032
    00033 namespace Gdk {
    00034
    00036
    00037 typedef GdkAtom Atom;
    00038
    00042
    00043 enum AxisUse
    00044 {
    00045         AXIS_IGNORE = GDK_AXIS_IGNORE,
    00046         AXIS_X = GDK_AXIS_X,
    00047         AXIS_Y = GDK_AXIS_Y,
    00048         AXIS_PRESSURE = GDK_AXIS_PRESSURE,
    00049         AXIS_XTILT = GDK_AXIS_XTILT,
    00050         AXIS_YTILT = GDK_AXIS_YTILT,
    00051         AXIS_WHEEL = GDK_AXIS_WHEEL,
    00052         AXIS_LAST = GDK_AXIS_LAST
    00053 };
    00054
    00057
    00058 enum ByteOrder
    00059 {
    00060         LSB_FIRST = GDK_LSB_FIRST,
    00063
    00064         MSB_FIRST = GDK_MSB_FIRST
    00067 };
    00068
    00071
    00072 enum DragAction
    00073 {
    00074         ACTION_DEFAULT = GDK_ACTION_DEFAULT,
    00076
    00077         ACTION_COPY = GDK_ACTION_COPY,
    00079
    00080         ACTION_MOVE = GDK_ACTION_MOVE,
    00083
    00084         ACTION_LINK = GDK_ACTION_LINK,
    00087
    00088         ACTION_PRIVATE = GDK_ACTION_PRIVATE,
    00091
    00092         ACTION_ASK = GDK_ACTION_ASK
    00094 };
    00095
    00097
    00098 typedef unsigned int DragActionField;
    00099
    00102
    00103 enum DragProtocol
    00104 {
    00105         DRAG_PROTO_MOTIF = GDK_DRAG_PROTO_MOTIF,
    00106         DRAG_PROTO_XDND = GDK_DRAG_PROTO_XDND,
    00107         DRAG_PROTO_ROOTWIN = GDK_DRAG_PROTO_ROOTWIN,
    00108         DRAG_PROTO_ = GDK_DRAG_PROTO_NONE,
    00109         DRAG_PROTO_NONE = GDK_DRAG_PROTO_WIN32_DROPFILES,
    00110         DRAG_PROTO_OLE2 = GDK_DRAG_PROTO_OLE2,
    00111         DRAG_PROTO_LOCAL = GDK_DRAG_PROTO_LOCAL
    00112 };
    00113
    00116
    00117 enum ExtensionMode
    00118 {
    00119         EXTENSION_EVENTS_NONE = GDK_EXTENSION_EVENTS_NONE,
    00121
    00122         EXTENSION_EVENTS_ALL = GDK_EXTENSION_EVENTS_ALL,
    00124
    00125         EXTENSION_EVENTS_CURSOR = GDK_EXTENSION_EVENTS_CURSOR
    00127 };
    00128
    00131
    00132 enum FilterReturn
    00133 {
    00134         FILTER_CONTINUE = GDK_FILTER_CONTINUE,
    00135         FILTER_TRANSLATE = GDK_FILTER_TRANSLATE,
    00136         FILTER_REMOVE = GDK_FILTER_REMOVE
    00137 };
    00138
    00142
    00143 enum GrabStatus
    00144 {
    00145         GRAB_SUCCESS = GDK_GRAB_SUCCESS,
    00147
    00148         GRAB_ALREADY_GRABBED = GDK_GRAB_ALREADY_GRABBED,
    00150
    00151         GRAB_INVALID_TIME = GDK_GRAB_INVALID_TIME,
    00153
    00154         GRAB_NOT_VIEWABLE = GDK_GRAB_NOT_VIEWABLE,
    00156
    00157         GRAB_FROZEN = GDK_GRAB_FROZEN
    00159 };
    00160
    00164
    00165 enum Gravity
    00166 {
    00167         GRAVITY_NORTH_WEST = GDK_GRAVITY_NORTH_WEST,
    00169
    00170         GRAVITY_NORTH = GDK_GRAVITY_NORTH,
    00172
    00173         GRAVITY_NORTH_EAST = GDK_GRAVITY_NORTH_EAST,
    00175
    00176         GRAVITY_WEST = GDK_GRAVITY_WEST,
    00178
    00179         GRAVITY_CENTER = GDK_GRAVITY_CENTER,
    00181
    00182         GRAVITY_EAST = GDK_GRAVITY_EAST,
    00184
    00185         GRAVITY_SOUTH_WEST = GDK_GRAVITY_SOUTH_WEST,
    00187
    00188         GRAVITY_SOUTH = GDK_GRAVITY_SOUTH,
    00190
    00191         GRAVITY_SOUTH_EAST = GDK_GRAVITY_SOUTH_EAST,
    00193
    00194         GRAVITY_STATIC = GDK_GRAVITY_STATIC
    00197 };
    00198
    00205
    00206 enum ModifierType
    00207 {
    00208         SHIFT_MASK = GDK_SHIFT_MASK,
    00210
    00211         LOCK_MASK = GDK_LOCK_MASK,
    00214
    00215         CONTROL_MASK = GDK_CONTROL_MASK,
    00217
    00218         MOD1_MASK = GDK_MOD1_MASK,
    00221
    00222         MOD2_MASK = GDK_MOD2_MASK,
    00225
    00226         MOD3_MASK = GDK_MOD3_MASK,
    00229
    00230         MOD4_MASK = GDK_MOD4_MASK,
    00233
    00234         MOD5_MASK = GDK_MOD5_MASK,
    00237
    00238         BUTTON1_MASK = GDK_BUTTON1_MASK,
    00240
    00241         BUTTON2_MASK = GDK_BUTTON2_MASK,
    00243
    00244         BUTTON3_MASK = GDK_BUTTON3_MASK,
    00246
    00247         BUTTON4_MASK = GDK_BUTTON4_MASK,
    00249
    00250         BUTTON5_MASK = GDK_BUTTON5_MASK,
    00252
    00253         RELEASE_MASK = GDK_RELEASE_MASK,
    00256
    00257         MODIFIER_MASK = GDK_MODIFIER_MASK
    00259 };
    00260
    00262
    00263 typedef unsigned int ModifierTypeField;
    00264
    00269
    00270 enum RgbDither
    00271 {
    00272         RGB_DITHER_NONE = GDK_RGB_DITHER_NONE,
    00273         RGB_DITHER_NORMAL = GDK_RGB_DITHER_NORMAL,
    00274         RGB_DITHER_MAX = GDK_RGB_DITHER_MAX
    00275 };
    00276
    00279
    00280 enum WindowEdge
    00281 {
    00282         WINDOW_EDGE_NORTH_WEST = GDK_WINDOW_EDGE_NORTH_WEST,
    00283         WINDOW_EDGE_NORTH = GDK_WINDOW_EDGE_NORTH,
    00284         WINDOW_EDGE_NORTH_EAST = GDK_WINDOW_EDGE_NORTH_EAST,
    00285         WINDOW_EDGE_WEST = GDK_WINDOW_EDGE_WEST,
    00286         WINDOW_EDGE_EAST = GDK_WINDOW_EDGE_EAST,
    00287         WINDOW_EDGE_SOUTH_WEST = GDK_WINDOW_EDGE_SOUTH_WEST,
    00288         WINDOW_EDGE_SOUTH = GDK_WINDOW_EDGE_SOUTH,
    00289         WINDOW_EDGE_SOUTH_EAST = GDK_WINDOW_EDGE_SOUTH_EAST
    00290 };
    00291
    00296
    00297 enum WindowTypeHint
    00298 {
    00299         WINDOW_TYPE_HINT_NORMAL = GDK_WINDOW_TYPE_HINT_NORMAL,
    00300         WINDOW_TYPE_HINT_DIALOG = GDK_WINDOW_TYPE_HINT_DIALOG,
    00301         WINDOW_TYPE_HINT_MENU = GDK_WINDOW_TYPE_HINT_MENU,
    00302         WINDOW_TYPE_HINT_TOOLBAR = GDK_WINDOW_TYPE_HINT_TOOLBAR,
    00303         WINDOW_TYPE_HINT_SPLASHSCREEN = GDK_WINDOW_TYPE_HINT_SPLASHSCREEN,
    00304         WINDOW_TYPE_HINT_UTILITY = GDK_WINDOW_TYPE_HINT_UTILITY,
    00305         WINDOW_TYPE_HINT_DOCK = GDK_WINDOW_TYPE_HINT_DOCK,
    00306         WINDOW_TYPE_HINT_DESKTOP = GDK_WINDOW_TYPE_HINT_DESKTOP
    00307 };
    00308
    00311
    00312 void keyboard_ungrab(unsigned int time = GDK_CURRENT_TIME);
    00316
    00317 bool pointer_is_grabbed();
    00323
    00324 void pointer_ungrab(unsigned int time = GDK_CURRENT_TIME);
    00328
    00332
    00333 void flush();
    00339
    00341
    00349
    00350 class Mutex
    00351 {
    00352 public:
    00353         static void lock();
    00357
    00358         static void unlock();
    00362 };
    00363
    00369
    00370 class Point
    00371 {
    00372         GdkPoint point_;
    00373
    00374 public:
    00377
    00378         Point();
    00380
    00381         Point(int x, int y);
    00385
    00386         Point(double x, double y);
    00390
    00391         Point(const GdkPoint& point);
    00394
    00398
    00399         GdkPoint* gdk_point() const { return const_cast<GdkPoint*>(&point_); }
    00401
    00402         operator GdkPoint* () const;
    00404
    00405         int x() const;
    00407
    00408         int y() const;
    00410
    00411         bool operator==(const Point& other) const;
    00415
    00416         bool operator!=(const Point& other) const;
    00420
    00424
    00425         void set_x(int x);
    00428
    00429         void set_x(double x);
    00432
    00433         void set_y(int y);
    00436
    00437         void set_y(double y);
    00440
    00441         void set(int x, int y);
    00445
    00446         void set(double x, double y);
    00450
    00451         Point& offset(int dx, int dy);
    00458
    00459         Point& operator+=(int increment);
    00464
    00465         Point& operator+=(const Point& other);
    00469
    00470         Point& operator-=(int decrement);
    00475
    00476         Point& operator-=(const Point& other);
    00480
    00481         Point& operator++();
    00484
    00485         Point& operator--();
    00488
    00492
    00493         Point offset_by(int dx, int dy);
    00500
    00501         Point operator+(const Point& other) const;
    00505
    00506         Point operator-(const Point& other) const;
    00510
    00512 };
    00513
    00521
    00522 class Rectangle
    00523 {
    00524         GdkRectangle rectangle_;
    00525
    00526 public:
    00529
    00530         Rectangle();
    00533
    00534         Rectangle(int x, int y, int width, int height);
    00540
    00541         Rectangle(const Point& point, int width, int height);
    00546
    00547         Rectangle(const GdkRectangle& rectangle);
    00550
    00554
    00555         GdkRectangle* gdk_rectangle() const { return const_cast<GdkRectangle*>(&rectangle_); }
    00557
    00558         operator GdkRectangle* () const;
    00560
    00561         int x() const;
    00563
    00564         int y() const;
    00566
    00567         int width() const;
    00569
    00570         int height() const;
    00572
    00573         long area() const;
    00575
    00576         Point center() const;
    00578
    00579         bool contains(int x, int y) const;
    00581
    00582         bool contains(const Point& point) const;
    00584
    00585         bool equal(const Rectangle& other) const;
    00588
    00589         bool empty() const;
    00592
    00593         bool null() const;
    00596
    00597         bool intersect(const Rectangle& other) const;
    00600
    00601         Point& position() const;
    00603
    00604         bool operator==(const Rectangle& other) const;
    00607
    00608         bool operator!=(const Rectangle& other) const;
    00611
    00615
    00616         void set(int x, int y, int width, int height);
    00622
    00623         void set_empty();
    00625
    00626         void set_null();
    00628
    00629         void set_position(int x, int y);
    00633
    00634         void set_position(const Point& point);
    00637
    00638         void set_size(int width, int height);
    00642
    00643         void capture(Point& point) const;
    00651
    00652         Rectangle& inflate(int dx, int dy);
    00660
    00661         bool intersect_with(const Rectangle& other);
    00668
    00669         Rectangle& offset(int dx, int dy);
    00674
    00675         void union_with(const Rectangle& other);
    00682
    00683         Rectangle& operator+=(int increment);
    00687
    00688         Rectangle& operator+=(const Point& point);
    00692
    00693         Rectangle& operator-=(int increment);
    00697
    00698         Rectangle& operator-=(const Point& point);
    00702
    00703         Rectangle& operator++();
    00706
    00707         Rectangle& operator--();
    00710
    00711         bool operator&=(const Rectangle& other);
    00715
    00716         void operator|=(const Rectangle& other);
    00719
    00723
    00724         Rectangle inflate_by(int dx, int dy) const;
    00732
    00733         Rectangle offset_by(int dx, int dy) const;
    00738
    00740 };
    00741
    00748
    00749 class Segment
    00750 {
    00751         GdkSegment segment_;
    00752
    00753 public:
    00756
    00757         Segment();
    00759
    00760         Segment(int x1, int y1, int x2, int y2);
    00766
    00767         Segment(const Point& start, const Point& end);
    00771
    00775
    00776         GdkSegment* gdk_segment() const { return const_cast<GdkSegment*>(&segment_); }
    00778
    00779         operator GdkSegment* () const;
    00781
    00782         int x1() const;
    00784
    00785         int y1() const;
    00787
    00788         int x2() const;
    00790
    00791         int y2() const;
    00793
    00794         bool equal(const Segment& other) const;
    00797
    00798         bool operator==(const Segment& other) const;
    00801
    00802         bool operator!=(const Segment& other) const;
    00805
    00809
    00810         void set(int x1, int y1, int x2, int y2);
    00816
    00817         void set(const Point& start, const Point& end);
    00821
    00822         void set_start(int x, int y);
    00826
    00827         void set_start(const Point& point);
    00830
    00831         void set_end(int x, int y);
    00835
    00836         void set_end(const Point& point);
    00839
    00841 };
    00842
    00849
    00850 class Span
    00851 {
    00852         GdkSpan span_;
    00853
    00854 public:
    00857
    00858         Span();
    00860
    00861         Span(int x, int y, int width);
    00866
    00867         Span(const Point& first, int width);
    00871
    00875
    00876         GdkSpan* gdk_span() const { return const_cast<GdkSpan*>(&span_); }
    00878
    00879         operator GdkSpan* () const;
    00881
    00882         int x() const;
    00884
    00885         int y() const;
    00887
    00888         int width() const;
    00890
    00891         bool equal(const Span& other) const;
    00894
    00895         bool operator==(const Span& other) const;
    00898
    00899         bool operator!=(const Span& other) const;
    00902
    00906
    00907         void set(int x, int y);
    00911
    00912         void set(const Point& first);
    00915
    00916         void set(int x, int y, int width);
    00921
    00922         void set(const Point& first, int width);
    00926
    00928 };
    00929
    00930
    00931
    00932 } // namespace Gdk
    00933
    00934 } // namespace Inti
    00935
    00936 #endif // INTI_GDK_TYPES_H
    00937

Main Page - Footer