~ubuntu-branches/ubuntu/lucid/codelite/lucid

« back to all changes in this revision

Viewing changes to sdk/wxpropgrid/include/wx/propgrid/propdev.h

  • Committer: Bazaar Package Importer
  • Author(s): Chow Loong Jin
  • Date: 2009-02-10 02:27:55 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20090210022755-m5692nfc1t5uf1w9
Tags: 1.0.2759+dfsg-0ubuntu1
* New upstream release (LP: #327216).
* debian/patches/series, debian/patches/00_fix-ia64-build.patch:
  + Dropped, applied upstream already.
* debian/patches/02_fix-desktop.patch,
  debian/patches/03_fix-sh.patch:
  + Refreshed to patch cleanly.
* debian/rules:
  + Make get-orig-source honour UPSTREAM_VERSION if set.
* debian/ctags-le.1,
  debian/codelite_indexer.1,
  debian/codelite.manpages:
  + Dropped ctags-le manpage, since ctags-le was replaced by
    codelite_indexer.
  + Added codelite_indexer manpage.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/////////////////////////////////////////////////////////////////////////////
 
2
// Name:        propdev.h
 
3
// Purpose:     wxPropertyGrid Internal Header
 
4
// Author:      Jaakko Salli
 
5
// Modified by:
 
6
// Created:     ?-?-2004
 
7
// RCS-ID:      $Id:
 
8
// Copyright:   (c) Jaakko Salli
 
9
// Licence:     wxWindows license
 
10
/////////////////////////////////////////////////////////////////////////////
 
11
 
 
12
#ifndef _WX_PROPGRID_PROPDEV_H_
 
13
#define _WX_PROPGRID_PROPDEV_H_
 
14
 
 
15
// -----------------------------------------------------------------------
 
16
 
 
17
 
 
18
class WXDLLIMPEXP_PG wxArrayEditorDialog;
 
19
 
 
20
// -----------------------------------------------------------------------
 
21
 
 
22
// These are intuitive substitutes for base property classes.
 
23
typedef wxPGProperty                wxBasePropertyClass;
 
24
typedef wxPGProperty                wxBaseParentPropertyClass;
 
25
 
 
26
// -----------------------------------------------------------------------
 
27
 
 
28
#ifndef SWIG
 
29
 
 
30
// This is required for sharing common global variables.
 
31
// TODO: Automatic locking mechanism?
 
32
class WXDLLIMPEXP_PG wxPGGlobalVarsClass
 
33
{
 
34
public:
 
35
 
 
36
    wxPGGlobalVarsClass();
 
37
    ~wxPGGlobalVarsClass();
 
38
 
 
39
    wxString            m_pDefaultImageWildcard; // Used by advprops, but here to make things easier.
 
40
 
 
41
    //wxArrayPtrVoid      m_arrEditorClasses; // List of editor class instances.
 
42
    wxPGHashMapS2P      m_mapEditorClasses; // Map of editor class instances (keys are name string).
 
43
 
 
44
#if wxUSE_VALIDATORS
 
45
    wxArrayPtrVoid      m_arrValidators; // These wxValidators need to be freed
 
46
#endif
 
47
 
 
48
    //wxPGHashMapS2P      m_dictValueType; // Valuename -> Value type object instance.
 
49
 
 
50
/*#if wxPG_VALUETYPE_IS_STRING
 
51
    wxPGHashMapS2P      m_dictValueTypeByClass; // VTClassname -> Value type object instance.
 
52
#endif*/
 
53
 
 
54
    wxPGHashMapS2P      m_dictPropertyClassInfo; // PropertyName -> ClassInfo
 
55
 
 
56
    wxPGChoices*        m_fontFamilyChoices;
 
57
 
 
58
    wxPGCellRenderer*   m_defaultRenderer;  // Replace with your own to affect all properties using
 
59
                                            // default renderer.
 
60
 
 
61
    wxPGVariantDataClassInfo wxVariantClassInfo_long;  // These are for fast variant type comparison
 
62
    wxPGVariantDataClassInfo wxVariantClassInfo_string;
 
63
    wxPGVariantDataClassInfo wxVariantClassInfo_double;
 
64
    wxPGVariantDataClassInfo wxVariantClassInfo_bool;
 
65
    wxPGVariantDataClassInfo wxVariantClassInfo_arrstring;
 
66
    wxPGVariantDataClassInfo wxVariantClassInfo_wxobject;
 
67
    wxPGVariantDataClassInfo wxVariantClassInfo_list;
 
68
#if wxCHECK_VERSION(2,8,0)
 
69
    wxPGVariantDataClassInfo wxVariantClassInfo_wxColour;
 
70
#endif
 
71
#if wxUSE_DATETIME
 
72
    wxPGVariantDataClassInfo wxVariantClassInfo_datetime;
 
73
#endif
 
74
 
 
75
    wxPGChoices         m_boolChoices;
 
76
 
 
77
#if wxVARIANT_REFCOUNTED
 
78
    wxVariant           m_vEmptyString;
 
79
    wxVariant           m_vZero;
 
80
    wxVariant           m_vMinusOne;
 
81
    wxVariant           m_vTrue;
 
82
    wxVariant           m_vFalse;
 
83
#endif
 
84
 
 
85
    // Cached constant strings
 
86
    wxPGCachedString    m_strMin;
 
87
    wxPGCachedString    m_strMax;
 
88
    wxPGCachedString    m_strUnits;
 
89
    wxPGCachedString    m_strInlineHelp;
 
90
 
 
91
    bool                m_autoGetTranslation; // If true then some things are automatically translated
 
92
 
 
93
    int                 m_offline; // > 0 if errors cannot or should not be shown in statusbar etc.
 
94
 
 
95
    int                 m_extraStyle;  // global extra style
 
96
 
 
97
#ifdef __WXDEBUG__
 
98
    int                 m_warnings;
 
99
#endif
 
100
 
 
101
    int HasExtraStyle( int style ) const { return (m_extraStyle & style); }
 
102
 
 
103
/*#if wxUSE_THREADS
 
104
    wxCriticalSection   m_critSect; // To allow different property grids to be addressed from different threads
 
105
#endif*/
 
106
};
 
107
 
 
108
#if wxCHECK_VERSION(2,9,0)
 
109
 
 
110
#define wxPGIsVariantType(VARIANT, T) \
 
111
    ((VARIANT).GetData() && typeid(*(VARIANT).GetData()) == *wxPGGlobalVars->wxVariantClassInfo_##T)
 
112
 
 
113
#define wxPGIsVariantClassInfo(CLASSINFO, T) \
 
114
    (*CLASSINFO == *wxPGGlobalVars->wxVariantClassInfo_##T)
 
115
 
 
116
#else
 
117
 
 
118
#define wxPGIsVariantType(VARIANT, T) \
 
119
    ((VARIANT).GetData() && wxPGVariantDataGetClassInfo((VARIANT).GetData()) == wxPGGlobalVars->wxVariantClassInfo_##T)
 
120
 
 
121
#define wxPGIsVariantClassInfo(CLASSINFO, T) \
 
122
    (CLASSINFO == wxPGGlobalVars->wxVariantClassInfo_##T)
 
123
 
 
124
#endif
 
125
 
 
126
#if wxVARIANT_REFCOUNTED
 
127
    #define wxPGVariant_EmptyString     (wxPGGlobalVars->m_vEmptyString)
 
128
    #define wxPGVariant_Zero            (wxPGGlobalVars->m_vZero)
 
129
    #define wxPGVariant_MinusOne        (wxPGGlobalVars->m_vMinusOne)
 
130
    #define wxPGVariant_True            (wxPGGlobalVars->m_vTrue)
 
131
    #define wxPGVariant_False           (wxPGGlobalVars->m_vFalse)
 
132
#else
 
133
    #define wxPGVariant_EmptyString     wxEmptyString
 
134
    #define wxPGVariant_Zero            ((long)0)
 
135
    #define wxPGVariant_MinusOne        ((long)-1)
 
136
    #define wxPGVariant_True            true
 
137
    #define wxPGVariant_False           false
 
138
#endif
 
139
 
 
140
#define wxPGVariant_Bool(A)     (A?wxPGVariant_True:wxPGVariant_False)
 
141
 
 
142
 
 
143
#if wxVARIANT_REFCOUNTED
 
144
    #define wxPGVariantAssign(A, B) A = B
 
145
#else
 
146
//
 
147
// Does A = B, so that the operation should not
 
148
// fail due to dataclass mismatch with typename
 
149
// match.
 
150
    #define wxPGVariantAssign(A, B) \
 
151
        { \
 
152
            A.MakeNull(); \
 
153
            A = B; \
 
154
        }
 
155
 
 
156
#endif
 
157
 
 
158
 
 
159
extern WXDLLIMPEXP_PG wxPGGlobalVarsClass* wxPGGlobalVars;
 
160
 
 
161
#endif
 
162
 
 
163
// -----------------------------------------------------------------------
 
164
 
 
165
 
 
166
#ifndef SWIG
 
167
 
 
168
//
 
169
// Tokenizer macros.
 
170
// NOTE: I have made two versions - worse ones (performance and consistency
 
171
//   wise) use wxStringTokenizer and better ones (may have unfound bugs)
 
172
//   use custom code.
 
173
//
 
174
 
 
175
#include <wx/tokenzr.h>
 
176
 
 
177
// TOKENIZER1 can be done with wxStringTokenizer
 
178
#define WX_PG_TOKENIZER1_BEGIN(WXSTRING,DELIMITER) \
 
179
    wxStringTokenizer tkz(WXSTRING,DELIMITER,wxTOKEN_RET_EMPTY); \
 
180
    while ( tkz.HasMoreTokens() ) \
 
181
    { \
 
182
        wxString token = tkz.GetNextToken(); \
 
183
        token.Trim(true); \
 
184
        token.Trim(false);
 
185
 
 
186
#define WX_PG_TOKENIZER1_END() \
 
187
    }
 
188
 
 
189
 
 
190
//
 
191
// 2nd version: tokens are surrounded by DELIMITERs (for example, C-style strings).
 
192
// TOKENIZER2 must use custom code (a class) for full compliancy
 
193
// with " surrounded strings with \" inside.
 
194
//
 
195
// class implementation is in propgrid.cpp
 
196
//
 
197
 
 
198
class WXDLLIMPEXP_PG wxPGStringTokenizer
 
199
{
 
200
public:
 
201
    wxPGStringTokenizer( const wxString& str, wxChar delimeter );
 
202
    ~wxPGStringTokenizer();
 
203
 
 
204
    bool HasMoreTokens(); // not const so we can do some stuff in it
 
205
    wxString GetNextToken();
 
206
 
 
207
protected:
 
208
#ifndef SWIG
 
209
 
 
210
    const wxString*             m_str;
 
211
    wxString::const_iterator    m_curPos;
 
212
    wxString                    m_readyToken;
 
213
    wxUniChar                   m_delimeter;
 
214
#endif
 
215
};
 
216
 
 
217
#define WX_PG_TOKENIZER2_BEGIN(WXSTRING,DELIMITER) \
 
218
    wxPGStringTokenizer tkz(WXSTRING,DELIMITER); \
 
219
    while ( tkz.HasMoreTokens() ) \
 
220
    { \
 
221
        wxString token = tkz.GetNextToken();
 
222
 
 
223
#define WX_PG_TOKENIZER2_END() \
 
224
    }
 
225
 
 
226
#endif
 
227
 
 
228
#ifndef __wxPG_SOURCE_FILE__
 
229
    // Reduce compile time, but still include in user app
 
230
    #include "props.h"
 
231
#endif
 
232
 
 
233
// -----------------------------------------------------------------------
 
234
 
 
235
#if !wxCHECK_VERSION(2,8,0)
 
236
 
 
237
// There is no wxString::EndsWith() in wxWidgets 2.6.
 
238
bool wxPG_String_EndsWith(const wxString& str, const wxChar *suffix, wxString *rest = NULL);
 
239
 
 
240
#else
 
241
 
 
242
inline bool wxPG_String_EndsWith(const wxString& str, const wxChar *suffix, wxString *rest = NULL)
 
243
{
 
244
    return str.EndsWith(suffix, rest);
 
245
}
 
246
 
 
247
#endif
 
248
 
 
249
// -----------------------------------------------------------------------
 
250
 
 
251
#endif // _WX_PROPGRID_PROPDEV_H_