]> git.saurik.com Git - wxWidgets.git/blob - contrib/include/wx/ogl/constrnt.h
Applied patch [ 905577 ] Removed copystring from OGL library
[wxWidgets.git] / contrib / include / wx / ogl / constrnt.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: constrnt.h
3 // Purpose: OGL constraint definitions
4 // Author: Julian Smart
5 // Modified by:
6 // Created: 12/07/98
7 // RCS-ID: $Id$
8 // Copyright: (c) Julian Smart
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
11
12 #ifndef _OGL_CONSTRNT_H_
13 #define _OGL_CONSTRNT_H_
14
15 #if defined(__GNUG__) && !defined(__APPLE__)
16 #pragma interface "constrnt.h"
17 #endif
18
19
20 /*
21 * OGL Constraints
22 *
23 */
24
25 class WXDLLIMPEXP_OGL wxOGLConstraintType: public wxObject
26 {
27 DECLARE_DYNAMIC_CLASS(wxOGLConstraintType)
28 public:
29 wxOGLConstraintType(int type = 0, const wxString& name = wxEmptyString,
30 const wxString& phrase = wxEmptyString);
31 ~wxOGLConstraintType();
32
33 public:
34 int m_type; // E.g. gyCONSTRAINT_CENTRED_VERTICALLY
35 wxString m_name; // E.g. "Centre vertically"
36 wxString m_phrase; // E.g. "centred vertically with respect to", "left of"
37
38 };
39
40 extern wxList* wxOGLConstraintTypes;
41
42 #define gyCONSTRAINT_CENTRED_VERTICALLY 1
43 #define gyCONSTRAINT_CENTRED_HORIZONTALLY 2
44 #define gyCONSTRAINT_CENTRED_BOTH 3
45 #define gyCONSTRAINT_LEFT_OF 4
46 #define gyCONSTRAINT_RIGHT_OF 5
47 #define gyCONSTRAINT_ABOVE 6
48 #define gyCONSTRAINT_BELOW 7
49 #define gyCONSTRAINT_ALIGNED_TOP 8
50 #define gyCONSTRAINT_ALIGNED_BOTTOM 9
51 #define gyCONSTRAINT_ALIGNED_LEFT 10
52 #define gyCONSTRAINT_ALIGNED_RIGHT 11
53
54 // Like aligned, but with the objects centred on the respective edge
55 // of the reference object.
56 #define gyCONSTRAINT_MIDALIGNED_TOP 12
57 #define gyCONSTRAINT_MIDALIGNED_BOTTOM 13
58 #define gyCONSTRAINT_MIDALIGNED_LEFT 14
59 #define gyCONSTRAINT_MIDALIGNED_RIGHT 15
60
61 class WXDLLIMPEXP_OGL wxOGLConstraint: public wxObject
62 {
63 DECLARE_DYNAMIC_CLASS(wxOGLConstraint)
64 public:
65 wxOGLConstraint() {
66 m_xSpacing = 0.0; m_ySpacing = 0.0; m_constraintType = 0;
67 m_constraintName = wxEmptyString; m_constraintId = 0;
68 m_constrainingObject = NULL; }
69 wxOGLConstraint(int type, wxShape *constraining, wxList& constrained);
70 ~wxOGLConstraint();
71
72 // Returns TRUE if anything changed
73 bool Evaluate();
74 inline void SetSpacing(double x, double y) { m_xSpacing = x; m_ySpacing = y; };
75 bool Equals(double a, double b);
76
77 double m_xSpacing;
78 double m_ySpacing;
79 int m_constraintType;
80 wxString m_constraintName;
81 long m_constraintId;
82 wxShape* m_constrainingObject;
83 wxList m_constrainedObjects;
84
85 };
86
87 void OGLInitializeConstraintTypes();
88 void OGLCleanUpConstraintTypes();
89
90 #endif
91 // _OGL_CONSTRNT_H_