File: constrnt.h

package info (click to toggle)
pgadmin3 1.20.0~beta2-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 73,704 kB
  • ctags: 18,591
  • sloc: cpp: 193,786; ansic: 18,736; sh: 5,154; pascal: 1,120; yacc: 927; makefile: 516; lex: 421; xml: 126; perl: 40
file content (96 lines) | stat: -rw-r--r-- 2,647 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
//////////////////////////////////////////////////////////////////////////
//
// pgAdmin III - PostgreSQL Tools
//
// Portions Copyright (C) 1998 - 2011, Julian Smart
// Portions Copyright (C) 2011 - 2014, The pgAdmin Development Team
// This software is released under the PostgreSQL Licence
//
// constrnt.h - OGL constraint definitions
//
//////////////////////////////////////////////////////////////////////////

#ifndef _OGL_CONSTRNT_H_
#define _OGL_CONSTRNT_H_

/*
 * OGL Constraints
 *
 */

class wxOGLConstraintType: public wxObject
{
	DECLARE_DYNAMIC_CLASS(wxOGLConstraintType)
public:
	wxOGLConstraintType(int type = 0, const wxString &name = wxEmptyString,
	                    const wxString &phrase = wxEmptyString);
	~wxOGLConstraintType();

public:
	int           m_type;     // E.g. gyCONSTRAINT_CENTRED_VERTICALLY
	wxString      m_name;     // E.g. "Centre vertically"
	wxString      m_phrase;   // E.g. "centred vertically with respect to", "left of"

};

extern wxList *wxOGLConstraintTypes;

#define gyCONSTRAINT_CENTRED_VERTICALLY   1
#define gyCONSTRAINT_CENTRED_HORIZONTALLY 2
#define gyCONSTRAINT_CENTRED_BOTH         3
#define gyCONSTRAINT_LEFT_OF              4
#define gyCONSTRAINT_RIGHT_OF             5
#define gyCONSTRAINT_ABOVE                6
#define gyCONSTRAINT_BELOW                7
#define gyCONSTRAINT_ALIGNED_TOP          8
#define gyCONSTRAINT_ALIGNED_BOTTOM       9
#define gyCONSTRAINT_ALIGNED_LEFT         10
#define gyCONSTRAINT_ALIGNED_RIGHT        11

// Like aligned, but with the objects centred on the respective edge
// of the reference object.
#define gyCONSTRAINT_MIDALIGNED_TOP       12
#define gyCONSTRAINT_MIDALIGNED_BOTTOM    13
#define gyCONSTRAINT_MIDALIGNED_LEFT      14
#define gyCONSTRAINT_MIDALIGNED_RIGHT     15

class wxOGLConstraint: public wxObject
{
	DECLARE_DYNAMIC_CLASS(wxOGLConstraint)
public:
	wxOGLConstraint()
	{
		m_xSpacing = 0.0;
		m_ySpacing = 0.0;
		m_constraintType = 0;
		m_constraintName = wxEmptyString;
		m_constraintId = 0;
		m_constrainingObject = NULL;
	}
	wxOGLConstraint(int type, wxShape *constraining, wxList &constrained);
	~wxOGLConstraint();

	// Returns TRUE if anything changed
	bool Evaluate();
	inline void SetSpacing(double x, double y)
	{
		m_xSpacing = x;
		m_ySpacing = y;
	};
	bool Equals(double a, double b);

	double         m_xSpacing;
	double         m_ySpacing;
	int           m_constraintType;
	wxString      m_constraintName;
	long          m_constraintId;
	wxShape      *m_constrainingObject;
	wxList        m_constrainedObjects;

};

void OGLInitializeConstraintTypes();
void OGLCleanUpConstraintTypes();

#endif
// _OGL_CONSTRNT_H_