implement * and / operators for wxPoint, not only wxSize.
[wxWidgets.git] / interface / wx / gdicmn.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: gdicmn.h
3 // Purpose: interface of wxRealPoint
4 // Author: wxWidgets team
5 // RCS-ID: $Id$
6 // Licence: wxWindows license
7 /////////////////////////////////////////////////////////////////////////////
8
9
10 /**
11 Bitmap type flags. See wxBitmap and wxImage classes.
12 */
13 enum wxBitmapType
14 {
15 wxBITMAP_TYPE_INVALID,
16 wxBITMAP_TYPE_BMP,
17 wxBITMAP_TYPE_BMP_RESOURCE,
18 wxBITMAP_TYPE_RESOURCE = wxBITMAP_TYPE_BMP_RESOURCE,
19 wxBITMAP_TYPE_ICO,
20 wxBITMAP_TYPE_ICO_RESOURCE,
21 wxBITMAP_TYPE_CUR,
22 wxBITMAP_TYPE_CUR_RESOURCE,
23 wxBITMAP_TYPE_XBM,
24 wxBITMAP_TYPE_XBM_DATA,
25 wxBITMAP_TYPE_XPM,
26 wxBITMAP_TYPE_XPM_DATA,
27 wxBITMAP_TYPE_TIF,
28 wxBITMAP_TYPE_TIF_RESOURCE,
29 wxBITMAP_TYPE_GIF,
30 wxBITMAP_TYPE_GIF_RESOURCE,
31 wxBITMAP_TYPE_PNG,
32 wxBITMAP_TYPE_PNG_RESOURCE,
33 wxBITMAP_TYPE_JPEG,
34 wxBITMAP_TYPE_JPEG_RESOURCE,
35 wxBITMAP_TYPE_PNM,
36 wxBITMAP_TYPE_PNM_RESOURCE,
37 wxBITMAP_TYPE_PCX,
38 wxBITMAP_TYPE_PCX_RESOURCE,
39 wxBITMAP_TYPE_PICT,
40 wxBITMAP_TYPE_PICT_RESOURCE,
41 wxBITMAP_TYPE_ICON,
42 wxBITMAP_TYPE_ICON_RESOURCE,
43 wxBITMAP_TYPE_ANI,
44 wxBITMAP_TYPE_IFF,
45 wxBITMAP_TYPE_TGA,
46 wxBITMAP_TYPE_MACCURSOR,
47 wxBITMAP_TYPE_MACCURSOR_RESOURCE,
48 wxBITMAP_TYPE_ANY = 50
49 };
50
51 /**
52 Polygon filling mode. See wxDC::DrawPolygon.
53 */
54 enum wxPolygonFillMode
55 {
56 wxODDEVEN_RULE = 1,
57 wxWINDING_RULE
58 };
59
60 /**
61 Standard cursors.
62
63 Notice that under wxMSW some of these cursors are defined in @c wx.rc file
64 and not by the system itself so you should include this file from your own
65 resource file (possibly creating a trivial resource file just containing a
66 single include line if you don't need it otherwise) to be able to use them.
67
68 See wxCursor.
69 */
70 enum wxStockCursor
71 {
72 wxCURSOR_NONE,
73 wxCURSOR_ARROW, ///< A standard arrow cursor.
74 wxCURSOR_RIGHT_ARROW, ///< A standard arrow cursor pointing to the right.
75 wxCURSOR_BULLSEYE, ///< Bullseye cursor.
76 wxCURSOR_CHAR, ///< Rectangular character cursor.
77 wxCURSOR_CROSS, ///< A cross cursor.
78 wxCURSOR_HAND, ///< A hand cursor.
79 wxCURSOR_IBEAM, ///< An I-beam cursor (vertical line).
80 wxCURSOR_LEFT_BUTTON, ///< Represents a mouse with the left button depressed.
81 wxCURSOR_MAGNIFIER, ///< A magnifier icon.
82 wxCURSOR_MIDDLE_BUTTON, ///< Represents a mouse with the middle button depressed.
83 wxCURSOR_NO_ENTRY, ///< A no-entry sign cursor.
84 wxCURSOR_PAINT_BRUSH, ///< A paintbrush cursor.
85 wxCURSOR_PENCIL, ///< A pencil cursor.
86 wxCURSOR_POINT_LEFT, ///< A cursor that points left.
87 wxCURSOR_POINT_RIGHT, ///< A cursor that points right.
88 wxCURSOR_QUESTION_ARROW, ///< An arrow and question mark.
89 wxCURSOR_RIGHT_BUTTON, ///< Represents a mouse with the right button depressed.
90 wxCURSOR_SIZENESW, ///< A sizing cursor pointing NE-SW.
91 wxCURSOR_SIZENS, ///< A sizing cursor pointing N-S.
92 wxCURSOR_SIZENWSE, ///< A sizing cursor pointing NW-SE.
93 wxCURSOR_SIZEWE, ///< A sizing cursor pointing W-E.
94 wxCURSOR_SIZING, ///< A general sizing cursor.
95 wxCURSOR_SPRAYCAN, ///< A spraycan cursor.
96 wxCURSOR_WAIT, ///< A wait cursor.
97 wxCURSOR_WATCH, ///< A watch cursor.
98 wxCURSOR_BLANK, ///< Transparent cursor.
99 wxCURSOR_DEFAULT, ///< Standard X11 cursor (only in wxGTK).
100 wxCURSOR_COPY_ARROW , ///< MacOS Theme Plus arrow (only in wxMac).
101 wxCURSOR_CROSS_REVERSE, ///< Only available on wxX11.
102 wxCURSOR_DOUBLE_ARROW, ///< Only available on wxX11.
103 wxCURSOR_BASED_ARROW_UP, ///< Only available on wxX11.
104 wxCURSOR_BASED_ARROW_DOWN, ///< Only available on wxX11.
105 wxCURSOR_ARROWWAIT, ///< A wait cursor with a standard arrow.
106 wxCURSOR_MAX
107 };
108
109
110
111 /**
112 @class wxRealPoint
113
114 A wxRealPoint is a useful data structure for graphics operations.
115
116 It contains floating point @e x and @e y members.
117 See wxPoint for an integer version.
118
119 Note that the coordinates stored inside a wxRealPoint object may be negative
120 and that wxRealPoint functions do not perform any check against negative values.
121
122 @library{wxcore}
123 @category{data}
124
125 @see wxPoint
126 */
127 class wxRealPoint
128 {
129 public:
130 /**
131 Initializes to zero the x and y members.
132 */
133 wxRealPoint();
134
135 /**
136 Initializes the point with the given coordinates.
137 */
138 wxRealPoint(double x, double y);
139
140 /**
141 X coordinate of this point.
142 */
143 double x;
144
145 /**
146 Y coordinate of this point.
147 */
148 double y;
149 };
150
151
152
153 /**
154 @class wxRect
155
156 A class for manipulating rectangles.
157
158 Note that the x, y coordinates and the width and height stored inside a wxRect
159 object may be negative and that wxRect functions do not perform any check against
160 negative values.
161
162 @library{wxcore}
163 @category{data}
164
165 @see wxPoint, wxSize
166 */
167 class wxRect
168 {
169 public:
170 /**
171 Default constructor.
172 Initializes to zero the internal @a x, @a y, @a width and @a height members.
173 */
174 wxRect();
175 /**
176 Creates a wxRect object from @a x, @a y, @a width and @a height values.
177 */
178 wxRect(int x, int y, int width, int height);
179 /**
180 Creates a wxRect object from top-left and bottom-right points.
181 */
182 wxRect(const wxPoint& topLeft, const wxPoint& bottomRight);
183 /**
184 Creates a wxRect object from position @a pos and @a size values.
185 */
186 wxRect(const wxPoint& pos, const wxSize& size);
187 /**
188 Creates a wxRect object from @a size values at the origin.
189 */
190 wxRect(const wxSize& size);
191
192 //@{
193 /**
194 Returns the rectangle having the same size as this one but centered
195 relatively to the given rectangle @a r. By default, rectangle is
196 centred in both directions but if @a dir includes only @c wxVERTICAL or
197 only @c wxHORIZONTAL, then it is only centered in this direction while
198 the other component of its position remains unchanged.
199 */
200 wxRect CentreIn(const wxRect& r, int dir = wxBOTH) const;
201 wxRect CenterIn(const wxRect& r, int dir = wxBOTH) const;
202 //@}
203
204 /**
205 Returns @true if the given point is inside the rectangle (or on its
206 boundary) and @false otherwise.
207 */
208 bool Contains(int x, int y) const;
209 /**
210 Returns @true if the given point is inside the rectangle (or on its
211 boundary) and @false otherwise.
212 */
213 bool Contains(const wxPoint& pt) const;
214 /**
215 Returns @true if the given rectangle is completely inside this
216 rectangle (or touches its boundary) and @false otherwise.
217 */
218 bool Contains(const wxRect& rect) const;
219
220 //@{
221 /**
222 Decrease the rectangle size.
223
224 This method is the opposite from Inflate(): Deflate(a, b) is equivalent
225 to Inflate(-a, -b). Please refer to Inflate() for full description.
226 */
227 void Deflate(wxCoord dx, wxCoord dy);
228 void Deflate(const wxSize& diff);
229 void Deflate(wxCoord diff);
230 wxRect Deflate(wxCoord dx, wxCoord dy) const;
231 //@}
232
233 /**
234 Gets the bottom point of the rectangle.
235 */
236 int GetBottom() const;
237
238 /**
239 Gets the position of the bottom left corner.
240 */
241 wxPoint GetBottomLeft() const;
242
243 /**
244 Gets the position of the bottom right corner.
245 */
246 wxPoint GetBottomRight() const;
247
248 /**
249 Gets the height member.
250 */
251 int GetHeight() const;
252
253 /**
254 Gets the left point of the rectangle (the same as GetX()).
255 */
256 int GetLeft() const;
257
258 /**
259 Gets the position.
260 */
261 wxPoint GetPosition() const;
262
263 /**
264 Gets the right point of the rectangle.
265 */
266 int GetRight() const;
267
268 /**
269 Gets the size.
270
271 @see SetSize()
272 */
273 wxSize GetSize() const;
274
275 /**
276 Gets the top point of the rectangle (the same as GetY()).
277 */
278 int GetTop() const;
279
280 /**
281 Gets the position of the top left corner of the rectangle, same as
282 GetPosition().
283 */
284 wxPoint GetTopLeft() const;
285
286 /**
287 Gets the position of the top right corner.
288 */
289 wxPoint GetTopRight() const;
290
291 /**
292 Gets the width member.
293 */
294 int GetWidth() const;
295
296 /**
297 Gets the x member.
298 */
299 int GetX() const;
300
301 /**
302 Gets the y member.
303 */
304 int GetY() const;
305
306 //@{
307 /**
308 Increases the size of the rectangle.
309
310 The left border is moved farther left and the right border is moved
311 farther right by @a dx. The upper border is moved farther up and the
312 bottom border is moved farther down by @a dy. (Note the the width and
313 height of the rectangle thus change by 2*dx and 2*dy, respectively.) If
314 one or both of @a dx and @a dy are negative, the opposite happens: the
315 rectangle size decreases in the respective direction.
316
317 Inflating and deflating behaves "naturally". Defined more precisely,
318 that means:
319 -# "Real" inflates (that is, @a dx and/or @a dy = 0) are not
320 constrained. Thus inflating a rectangle can cause its upper left
321 corner to move into the negative numbers. (2.5.4 and older forced
322 the top left coordinate to not fall below (0, 0), which implied a
323 forced move of the rectangle.)
324 -# Deflates are clamped to not reduce the width or height of the
325 rectangle below zero. In such cases, the top-left corner is
326 nonetheless handled properly. For example, a rectangle at (10, 10)
327 with size (20, 40) that is inflated by (-15, -15) will become
328 located at (20, 25) at size (0, 10). Finally, observe that the width
329 and height are treated independently. In the above example, the
330 width is reduced by 20, whereas the height is reduced by the full 30
331 (rather than also stopping at 20, when the width reached zero).
332
333 @see Deflate()
334 */
335 void Inflate(wxCoord dx, wxCoord dy);
336 void Inflate(const wxSize& diff);
337 void Inflate(wxCoord diff);
338 wxRect Inflate(wxCoord dx, wxCoord dy) const;
339 //@}
340
341 /**
342 Modifies this rectangle to contain the overlapping portion of this rectangle
343 and the one passed in as parameter.
344
345 @return This rectangle, modified.
346 */
347 wxRect& Intersect(const wxRect& rect);
348
349 /**
350 Returns the overlapping portion of this rectangle and the one passed in as
351 parameter.
352 */
353 wxRect Intersect(const wxRect& rect) const;
354
355 /**
356 Returns @true if this rectangle has a non-empty intersection with the
357 rectangle @a rect and @false otherwise.
358 */
359 bool Intersects(const wxRect& rect) const;
360
361 /**
362 Returns @true if this rectangle has a width or height less than or
363 equal to 0 and @false otherwise.
364 */
365 bool IsEmpty() const;
366
367 //@{
368 /**
369 Moves the rectangle by the specified offset. If @a dx is positive, the
370 rectangle is moved to the right, if @a dy is positive, it is moved to the
371 bottom, otherwise it is moved to the left or top respectively.
372 */
373 void Offset(wxCoord dx, wxCoord dy);
374 void Offset(const wxPoint& pt);
375 //@}
376
377 /**
378 Sets the height.
379 */
380 void SetHeight(int height);
381
382 /**
383 Sets the size.
384
385 @see GetSize()
386 */
387 void SetSize(const wxSize& s);
388
389 /**
390 Sets the width.
391 */
392 void SetWidth(int width);
393
394 /**
395 Sets the x position.
396 */
397 void SetX(int x);
398
399 /**
400 Sets the y position.
401 */
402 void SetY(int y);
403
404 //@{
405 /**
406 Modifies the rectangle to contain the bounding box of this rectangle
407 and the one passed in as parameter.
408 */
409 wxRect Union(const wxRect& rect) const;
410 wxRect& Union(const wxRect& rect);
411 //@}
412
413 /**
414 Inequality operator.
415 */
416 bool operator !=(const wxRect& r1, const wxRect& r2);
417
418 //@{
419 /**
420 Like Union(), but doesn't treat empty rectangles specially.
421 */
422 wxRect operator +(const wxRect& r1, const wxRect& r2);
423 wxRect& operator +=(const wxRect& r);
424 //@}
425
426 //@{
427 /**
428 Returns the intersection of two rectangles (which may be empty).
429 */
430 wxRect operator *(const wxRect& r1, const wxRect& r2);
431 wxRect& operator *=(const wxRect& r);
432 //@}
433
434 /**
435 Assignment operator.
436 */
437 wxRect& operator=(const wxRect& rect);
438
439 /**
440 Equality operator.
441 */
442 bool operator ==(const wxRect& r1, const wxRect& r2);
443
444 /**
445 Height member.
446 */
447 int height;
448
449 /**
450 Width member.
451 */
452 int width;
453
454 /**
455 x coordinate of the top-level corner of the rectangle.
456 */
457 int x;
458
459 /**
460 y coordinate of the top-level corner of the rectangle.
461 */
462 int y;
463 };
464
465
466
467 /**
468 @class wxPoint
469
470 A wxPoint is a useful data structure for graphics operations.
471
472 It contains integer @e x and @e y members.
473 See wxRealPoint for a floating point version.
474
475 Note that the width and height stored inside a wxPoint object may be negative
476 and that wxPoint functions do not perform any check against negative values
477 (this is used to e.g. store the special -1 value in ::wxDefaultPosition instance).
478
479 @library{wxcore}
480 @category{data}
481
482 @stdobjects
483 ::wxDefaultPosition
484
485 @see wxRealPoint
486 */
487 class wxPoint
488 {
489 public:
490 /**
491 Constructs a point.
492 Initializes the internal x and y coordinates to zero.
493 */
494 wxPoint();
495
496 /**
497 Initializes the point object with the given @a x and @a y coordinates.
498 */
499 wxPoint(int x, int y);
500
501 /**
502 @name Miscellaneous operators
503
504 Note that these operators are documented as class members
505 (to make them easier to find) but, as their prototype shows,
506 they are implemented as global operators; note that this is
507 transparent to the user but it helps to understand why the
508 following functions are documented to take the wxPoint they
509 operate on as an explicit argument.
510 */
511 //@{
512 wxPoint& operator=(const wxPoint& pt);
513
514 bool operator ==(const wxPoint& p1, const wxPoint& p2);
515 bool operator !=(const wxPoint& p1, const wxPoint& p2);
516
517 wxPoint operator +(const wxPoint& p1, const wxPoint& p2);
518 wxPoint operator -(const wxPoint& p1, const wxPoint& p2);
519
520 wxPoint& operator +=(const wxPoint& pt);
521 wxPoint& operator -=(const wxPoint& pt);
522
523 wxPoint operator +(const wxPoint& pt, const wxSize& sz);
524 wxPoint operator -(const wxPoint& pt, const wxSize& sz);
525 wxPoint operator +(const wxSize& sz, const wxPoint& pt);
526 wxPoint operator -(const wxSize& sz, const wxPoint& pt);
527
528 wxPoint& operator +=(const wxSize& sz);
529 wxPoint& operator -=(const wxSize& sz);
530
531 wxSize operator /(const wxPoint& sz, int factor);
532 wxSize operator *(const wxPoint& sz, int factor);
533 wxSize operator *(int factor, const wxSize& sz);
534 wxSize& operator /=(int factor);
535 wxSize& operator *=(int factor);
536 //@}
537
538 /**
539 x member.
540 */
541 int x;
542
543 /**
544 y member.
545 */
546 int y;
547 };
548
549 /**
550 Global istance of a wxPoint initialized with values (-1,-1).
551 */
552 wxPoint wxDefaultPosition;
553
554
555 /**
556 @class wxColourDatabase
557
558 wxWidgets maintains a database of standard RGB colours for a predefined
559 set of named colours. The application may add to this set if desired by
560 using AddColour() and may use it to look up colours by names using Find()
561 or find the names for the standard colour using FindName().
562
563 There is one predefined, global instance of this class called
564 ::wxTheColourDatabase.
565
566 The standard database contains at least the following colours:
567
568 @beginTable
569 <tr><td>
570 AQUAMARINE
571 @n BLACK
572 @n BLUE
573 @n BLUE VIOLET
574 @n BROWN
575 @n CADET BLUE
576 @n CORAL
577 @n CORNFLOWER BLUE
578 @n CYAN
579 @n DARK GREY
580 @n DARK GREEN
581 @n DARK OLIVE GREEN
582 @n DARK ORCHID
583 @n DARK SLATE BLUE
584 @n DARK SLATE GREY
585 @n DARK TURQUOISE
586 @n DIM GREY
587 </td><td>
588 FIREBRICK
589 @n FOREST GREEN
590 @n GOLD
591 @n GOLDENROD
592 @n GREY
593 @n GREEN
594 @n GREEN YELLOW
595 @n INDIAN RED
596 @n KHAKI
597 @n LIGHT BLUE
598 @n LIGHT GREY
599 @n LIGHT STEEL BLUE
600 @n LIME GREEN
601 @n MAGENTA
602 @n MAROON
603 @n MEDIUM AQUAMARINE
604 @n MEDIUM BLUE
605 </td><td>
606 MEDIUM FOREST GREEN
607 @n MEDIUM GOLDENROD
608 @n MEDIUM ORCHID
609 @n MEDIUM SEA GREEN
610 @n MEDIUM SLATE BLUE
611 @n MEDIUM SPRING GREEN
612 @n MEDIUM TURQUOISE
613 @n MEDIUM VIOLET RED
614 @n MIDNIGHT BLUE
615 @n NAVY
616 @n ORANGE
617 @n ORANGE RED
618 @n ORCHID
619 @n PALE GREEN
620 @n PINK
621 @n PLUM
622 @n PURPLE
623 </td><td>
624 RED
625 @n SALMON
626 @n SEA GREEN
627 @n SIENNA
628 @n SKY BLUE
629 @n SLATE BLUE
630 @n SPRING GREEN
631 @n STEEL BLUE
632 @n TAN
633 @n THISTLE
634 @n TURQUOISE
635 @n VIOLET
636 @n VIOLET RED
637 @n WHEAT
638 @n WHITE
639 @n YELLOW
640 @n YELLOW GREEN
641 </td></tr>
642 @endTable
643
644 @library{wxcore}
645 @category{gdi}
646
647 @see wxColour
648 */
649 class wxColourDatabase
650 {
651 public:
652 /**
653 Constructs the colour database. It will be initialized at the first
654 use.
655 */
656 wxColourDatabase();
657
658 /**
659 Adds a colour to the database. If a colour with the same name already
660 exists, it is replaced.
661 */
662 void AddColour(const wxString& colourName, const wxColour& colour);
663
664 /**
665 Finds a colour given the name. Returns an invalid colour object (that
666 is, wxColour::IsOk() will return @false) if the colour wasn't found in
667 the database.
668 */
669 wxColour Find(const wxString& colourName) const;
670
671 /**
672 Finds a colour name given the colour. Returns an empty string if the
673 colour is not found in the database.
674 */
675 wxString FindName(const wxColour& colour) const;
676 };
677
678
679 /**
680 @class wxSize
681
682 A wxSize is a useful data structure for graphics operations.
683 It simply contains integer @e width and @e height members.
684
685 Note that the width and height stored inside a wxSize object may be negative
686 and that wxSize functions do not perform any check against negative values
687 (this is used to e.g. store the special -1 value in ::wxDefaultSize instance).
688 See also IsFullySpecified() and SetDefaults() for utility functions regarding
689 the special -1 value.
690
691 wxSize is used throughout wxWidgets as well as wxPoint which, although
692 almost equivalent to wxSize, has a different meaning: wxPoint represents a
693 position while wxSize represents the size.
694
695 @beginWxPythonOnly
696 wxPython defines aliases for the @e x and @e y members named @e width and
697 @e height since it makes much more sense for sizes.
698 @endWxPythonOnly
699
700 @library{wxcore}
701 @category{data}
702
703 @stdobjects
704 ::wxDefaultSize
705
706 @see wxPoint, wxRealPoint
707 */
708 class wxSize
709 {
710 public:
711 /**
712 Initializes this size object with zero width and height.
713 */
714 wxSize();
715
716 /**
717 Initializes this size object with the given @a width and @a height.
718 */
719 wxSize(int width, int height);
720
721 //@{
722 /**
723 Decreases the size in both x and y directions.
724
725 @see IncBy()
726 */
727 void DecBy(const wxSize& size);
728 void DecBy(int dx, int dy);
729 void DecBy(int d);
730 //@}
731
732 /**
733 Decrements this object so that both of its dimensions are not greater
734 than the corresponding dimensions of the @a size.
735
736 @see IncTo()
737 */
738 void DecTo(const wxSize& size);
739
740 /**
741 Gets the height member.
742 */
743 int GetHeight() const;
744
745 /**
746 Gets the width member.
747 */
748 int GetWidth() const;
749
750 //@{
751 /**
752 Increases the size in both x and y directions.
753
754 @see DecBy()
755 */
756 void IncBy(const wxSize& size);
757 void IncBy(int dx, int dy);
758 void IncBy(int d);
759 //@}
760
761 /**
762 Increments this object so that both of its dimensions are not less than
763 the corresponding dimensions of the @a size.
764
765 @see DecTo()
766 */
767 void IncTo(const wxSize& size);
768
769 /**
770 Returns @true if neither of the size object components is equal to -1,
771 which is used as default for the size values in wxWidgets (hence the
772 predefined ::wxDefaultSize has both of its components equal to -1).
773
774 This method is typically used before calling SetDefaults().
775 */
776 bool IsFullySpecified() const;
777
778 /**
779 Scales the dimensions of this object by the given factors. If you want
780 to scale both dimensions by the same factor you can also use
781 operator*=().
782
783 @return A reference to this object (so that you can concatenate other
784 operations in the same line).
785 */
786 wxSize& Scale(float xscale, float yscale);
787
788 /**
789 Sets the width and height members.
790 */
791 void Set(int width, int height);
792
793 /**
794 Combine this size object with another one replacing the default (i.e.
795 equal to -1) components of this object with those of the other. It is
796 typically used like this:
797
798 @code
799 if ( !size.IsFullySpecified() )
800 {
801 size.SetDefaults(GetDefaultSize());
802 }
803 @endcode
804
805 @see IsFullySpecified()
806 */
807 void SetDefaults(const wxSize& sizeDefault);
808
809 /**
810 Sets the height.
811 */
812 void SetHeight(int height);
813
814 /**
815 Sets the width.
816 */
817 void SetWidth(int width);
818
819
820 /**
821 @name Miscellaneous operators
822
823 Note that these operators are documented as class members
824 (to make them easier to find) but, as their prototype shows,
825 they are implemented as global operators; note that this is
826 transparent to the user but it helps to understand why the
827 following functions are documented to take the wxSize they
828 operate on as an explicit argument.
829 */
830 //@{
831 wxSize& operator=(const wxSize& sz);
832
833 bool operator ==(const wxSize& s1, const wxSize& s2);
834 bool operator !=(const wxSize& s1, const wxSize& s2);
835
836 wxSize operator +(const wxSize& s1, const wxSize& s2);
837 wxSize operator -(const wxSize& s1, const wxSize& s2);
838 wxSize& operator +=(const wxSize& sz);
839 wxSize& operator -=(const wxSize& sz);
840
841 wxSize operator /(const wxSize& sz, int factor);
842 wxSize operator *(const wxSize& sz, int factor);
843 wxSize operator *(int factor, const wxSize& sz);
844 wxSize& operator /=(int factor);
845 wxSize& operator *=(int factor);
846 //@}
847 };
848
849 /**
850 Global instance of a wxSize object initialized to (-1,-1).
851 */
852 wxSize wxDefaultSize;
853
854
855
856
857 // ============================================================================
858 // Global functions/macros
859 // ============================================================================
860
861 /** @addtogroup group_funcmacro_gdi */
862 //@{
863
864 /**
865 This macro loads a bitmap from either application resources (on the
866 platforms for which they exist, i.e. Windows and OS2) or from an XPM file.
867 This can help to avoid using @ifdef_ when creating bitmaps.
868
869 @see @ref overview_bitmap, wxICON()
870
871 @header{wx/gdicmn.h}
872 */
873 #define wxBITMAP(bitmapName)
874
875 /**
876 This macro loads an icon from either application resources (on the
877 platforms for which they exist, i.e. Windows and OS2) or from an XPM file.
878 This can help to avoid using @ifdef_ when creating icons.
879
880 @see @ref overview_bitmap, wxBITMAP()
881
882 @header{wx/gdicmn.h}
883 */
884 #define wxICON(iconName)
885
886 /**
887 Returns @true if the display is colour, @false otherwise.
888
889 @header{wx/gdicmn.h}
890 */
891 bool wxColourDisplay();
892
893 /**
894 Returns the depth of the display (a value of 1 denotes a monochrome
895 display).
896
897 @header{wx/gdicmn.h}
898 */
899 int wxDisplayDepth();
900
901 /**
902 Globally sets the cursor; only has an effect on Windows, Mac and GTK+. You
903 should call this function with wxNullCursor to restore the system cursor.
904
905 @see wxCursor, wxWindow::SetCursor()
906
907 @header{wx/gdicmn.h}
908 */
909 void wxSetCursor(const wxCursor& cursor);
910
911 //@}
912
913 /** @addtogroup group_funcmacro_gdi */
914 //@{
915 /**
916 Returns the dimensions of the work area on the display. On Windows this
917 means the area not covered by the taskbar, etc. Other platforms are
918 currently defaulting to the whole display until a way is found to provide
919 this info for all window managers, etc.
920
921 @header{wx/gdicmn.h}
922 */
923 void wxClientDisplayRect(int* x, int* y, int* width, int* height);
924 wxRect wxGetClientDisplayRect();
925 //@}
926
927 /** @addtogroup group_funcmacro_gdi */
928 //@{
929 /**
930 Returns the display resolution in pixels per inch.
931
932 The @c x component of the returned wxSize object contains the horizontal
933 resolution and the @c y one -- the vertical resolution.
934
935 @header{wx/gdicmn.h}
936
937 @since 2.9.0
938 */
939 wxSize wxGetDisplayPPI();
940 //@}
941
942 /** @addtogroup group_funcmacro_gdi */
943 //@{
944 /**
945 Returns the display size in pixels.
946
947 For the version taking @a width and @a header arguments, either of them
948 can be @NULL if the caller is not interested in the returned value.
949
950 @header{wx/gdicmn.h}
951 */
952 void wxDisplaySize(int* width, int* height);
953 wxSize wxGetDisplaySize();
954 //@}
955
956 /** @addtogroup group_funcmacro_gdi */
957 //@{
958 /**
959 Returns the display size in millimeters.
960
961 For the version taking @a width and @a header arguments, either of them
962 can be @NULL if the caller is not interested in the returned value.
963
964 @see wxGetDisplayPPI()
965
966 @header{wx/gdicmn.h}
967 */
968 void wxDisplaySizeMM(int* width, int* height);
969 wxSize wxGetDisplaySizeMM();
970 //@}
971