Line data Source code
1 : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : /*
3 : * This file is part of the LibreOffice project.
4 : *
5 : * This Source Code Form is subject to the terms of the Mozilla Public
6 : * License, v. 2.0. If a copy of the MPL was not distributed with this
7 : * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 : *
9 : * This file incorporates work covered by the following license notice:
10 : *
11 : * Licensed to the Apache Software Foundation (ASF) under one or more
12 : * contributor license agreements. See the NOTICE file distributed
13 : * with this work for additional information regarding copyright
14 : * ownership. The ASF licenses this file to you under the Apache
15 : * License, Version 2.0 (the "License"); you may not use this file
16 : * except in compliance with the License. You may obtain a copy of
17 : * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 : */
19 :
20 :
21 : #include <stdlib.h>
22 : #include <stdio.h>
23 : #include <string.h>
24 :
25 : #include <comphelper/string.hxx>
26 : #include <i18nlangtag/mslangid.hxx>
27 : #include <i18nlangtag/languagetag.hxx>
28 : #include <tools/color.hxx>
29 : #include <tools/fldunit.hxx>
30 : #include <tools/gen.hxx>
31 : #include <tools/mapunit.hxx>
32 : #include <tools/rc.h>
33 : #include <tools/wintypes.hxx>
34 : #include <rsc/rsc-vcl-shared-types.hxx>
35 :
36 : #include <com/sun/star/awt/Key.hpp>
37 :
38 : #include <rscconst.hxx>
39 : #include <rscarray.hxx>
40 : #include <rscclass.hxx>
41 : #include <rsccont.hxx>
42 : #include <rscdb.hxx>
43 : #include <rsclex.hxx>
44 : #include <rscyacc.hxx>
45 :
46 : #include <unordered_map>
47 :
48 89655 : void RscTypCont::SETCONST( RscConst * pClass, const char * szString, sal_uInt32 nVal )
49 : {
50 : #if OSL_DEBUG_LEVEL > 2
51 : fprintf( stderr, "setconst : %s\n", szString );
52 : #endif
53 : pClass->SetConstant( aNmTb.Put( szString,
54 89655 : CONSTNAME, nVal ), nVal );
55 89655 : }
56 :
57 8340 : void RscTypCont::SETCONST( RscConst * pClass, Atom nName, sal_uInt32 nVal )
58 : {
59 : #if OSL_DEBUG_LEVEL > 2
60 : fprintf( stderr, "setconst hash: %u\n", (unsigned int)nName );
61 : #endif
62 : pClass->SetConstant( aNmTb.Put( nName,
63 8340 : CONSTNAME, nVal ), nVal );
64 8340 : }
65 :
66 :
67 : typedef std::unordered_map< OString, sal_uInt32, OStringHash > langmap;
68 417 : static langmap ULong_Iso_map;
69 :
70 523864 : sal_uInt32 GetLangId(const OString &rLang)
71 : {
72 523864 : langmap::iterator pIter = ULong_Iso_map.find( rLang );
73 523864 : if ( pIter != ULong_Iso_map.end())
74 211531 : return pIter->second;
75 312333 : return 0;
76 : }
77 :
78 417 : void RscLangEnum::Init( RscNameTable& rNames )
79 : {
80 417 : SetConstant( rNames.Put( "SYSTEM", CONSTNAME, (long)LANGUAGE_SYSTEM ), LANGUAGE_SYSTEM );
81 417 : SetConstant( rNames.Put( "DONTKNOW", CONSTNAME, LANGUAGE_DONTKNOW ), LANGUAGE_DONTKNOW );
82 :
83 417 : sal_Int32 nIndex = 0;
84 417 : mnLangId = 0x400; // stay away from selfdefined...
85 :
86 417 : const ::std::vector< MsLangId::LanguagetagMapping > aList( MsLangId::getDefinedLanguagetags());
87 231852 : for (::std::vector< MsLangId::LanguagetagMapping >::const_iterator iTag( aList.begin()); iTag != aList.end(); ++iTag)
88 : {
89 : #if OSL_DEBUG_LEVEL > 2
90 : fprintf( stderr, "ISO Language in : %d, 0x%04x, %s\n",
91 : (int)nIndex,
92 : (unsigned)(*iTag).mnLang,
93 : OUStringToOString( (*iTag).maBcp47, RTL_TEXTENCODING_ASCII_US).getStr());
94 : fprintf( stderr, "ISO Language out:");
95 : #endif
96 231435 : LanguageTag aLanguageTag( (*iTag).maBcp47);
97 462870 : ::std::vector< OUString > aFallbacks( aLanguageTag.getFallbackStrings( true));
98 755187 : for (::std::vector< OUString >::const_iterator it( aFallbacks.begin()); it != aFallbacks.end(); ++it)
99 : {
100 523752 : OString aLang( OUStringToOString( *it, RTL_TEXTENCODING_ASCII_US));
101 523752 : SetConstant( rNames.Put( aLang.getStr(), CONSTNAME, mnLangId ), mnLangId );
102 523752 : bool bAdd = (GetLangId( aLang ) == 0);
103 523752 : if ( bAdd )
104 312333 : ULong_Iso_map[ aLang ] = mnLangId;
105 : #if OSL_DEBUG_LEVEL > 2
106 : fprintf( stderr, " %s 0x%lx (%s)", aLang.getStr(), mnLangId, (bAdd ? "added" : "exists") );
107 : #endif
108 523752 : mnLangId++;
109 523752 : }
110 : #if OSL_DEBUG_LEVEL > 2
111 : fprintf( stderr, "\n");
112 : #endif
113 231435 : nIndex++;
114 231435 : }
115 : // hack - survive "x-no-translate"
116 : /* XXX: that ^^^ was the original comment, but we're adding "x-comment"
117 : * here? Which is good anyway. */
118 417 : SetConstant( rNames.Put( "x-comment", CONSTNAME, mnLangId ), mnLangId );
119 417 : mnLangId++;
120 :
121 834 : OString aEnvIsoTokens = getenv( "RSC_LANG_ISO" );
122 417 : if ( !aEnvIsoTokens.isEmpty() )
123 : {
124 0 : OString aIsoToken;
125 0 : sal_uInt16 nTokenCounter = 0;
126 0 : bool bOneMore = true;
127 0 : while ( bOneMore )
128 : {
129 0 : aIsoToken = aEnvIsoTokens.getToken(nTokenCounter, ' ');
130 0 : if ( !aIsoToken.isEmpty() )
131 : {
132 0 : SetConstant( rNames.Put( aIsoToken.getStr(), CONSTNAME, mnLangId ), mnLangId );
133 0 : bool bAdd = (GetLangId( aIsoToken ) == 0);
134 0 : if ( bAdd )
135 0 : ULong_Iso_map[ aIsoToken ] = mnLangId;
136 : #if OSL_DEBUG_LEVEL > 2
137 : fprintf( stderr, "Env ISO Language out: %s 0x%lx (%s)\n",
138 : aIsoToken.getStr(), mnLangId, (bAdd ? "added" : "exists") );
139 : #endif
140 0 : mnLangId++;
141 : }
142 : else
143 0 : bOneMore = false;
144 :
145 0 : nTokenCounter++;
146 0 : }
147 417 : }
148 417 : }
149 :
150 0 : Atom RscLangEnum::AddLanguage( const char* pLang, RscNameTable& rNames )
151 : {
152 0 : Atom nResult = 0;
153 : KEY_STRUCT aStruct;
154 0 : if( ! rNames.Get( nResult = pHS->getID( pLang ), &aStruct ) )
155 : {
156 0 : SetConstant( nResult = rNames.Put( pLang, CONSTNAME, mnLangId ), mnLangId );
157 : // insert new lang to ULong_Iso_map
158 0 : OString aLang( pLang );
159 0 : bool bAdd = (GetLangId( aLang ) == 0);
160 0 : if ( bAdd )
161 0 : ULong_Iso_map[ aLang ] = mnLangId;
162 : // increase id counter
163 0 : mnLangId++;
164 : }
165 0 : return nResult;
166 : }
167 :
168 417 : RscEnum * RscTypCont::InitLangType()
169 : {
170 417 : aLangType.Init( aNmTb );
171 417 : return &aLangType;
172 : }
173 :
174 417 : RscEnum * RscTypCont::InitFieldUnitsType()
175 : {
176 : RscEnum * pFieldUnits;
177 417 : pFieldUnits = new RscEnum( pHS->getID( "EnumFieldUnit" ), RSC_NOTYPE );
178 :
179 417 : SETCONST( pFieldUnits, "FUNIT_NONE", FUNIT_NONE );
180 417 : SETCONST( pFieldUnits, "FUNIT_MM", FUNIT_MM );
181 417 : SETCONST( pFieldUnits, "FUNIT_CM", FUNIT_CM );
182 417 : SETCONST( pFieldUnits, "FUNIT_M", FUNIT_M );
183 417 : SETCONST( pFieldUnits, "FUNIT_KM", FUNIT_KM );
184 417 : SETCONST( pFieldUnits, "FUNIT_TWIP", FUNIT_TWIP );
185 417 : SETCONST( pFieldUnits, "FUNIT_POINT", FUNIT_POINT );
186 417 : SETCONST( pFieldUnits, "FUNIT_PICA", FUNIT_PICA );
187 417 : SETCONST( pFieldUnits, "FUNIT_INCH", FUNIT_INCH );
188 417 : SETCONST( pFieldUnits, "FUNIT_FOOT", FUNIT_FOOT );
189 417 : SETCONST( pFieldUnits, "FUNIT_MILE", FUNIT_MILE );
190 417 : SETCONST( pFieldUnits, "FUNIT_CUSTOM", FUNIT_CUSTOM );
191 417 : SETCONST( pFieldUnits, "FUNIT_CHAR", FUNIT_CHAR );
192 417 : SETCONST( pFieldUnits, "FUNIT_LINE", FUNIT_LINE );
193 417 : SETCONST( pFieldUnits, "FUNIT_PERCENT", FUNIT_PERCENT );
194 417 : SETCONST( pFieldUnits, "FUNIT_DEGREE", FUNIT_DEGREE);
195 417 : SETCONST( pFieldUnits, "FUNIT_SECOND", FUNIT_SECOND);
196 417 : SETCONST( pFieldUnits, "FUNIT_MILLISECOND", FUNIT_MILLISECOND);
197 417 : SETCONST( pFieldUnits, "FUNIT_PIXEL", FUNIT_PIXEL );
198 :
199 417 : return pFieldUnits;
200 : }
201 :
202 417 : RscEnum * RscTypCont::InitColor()
203 : {
204 : RscEnum * pColor;
205 417 : pColor = new RscEnum( pHS->getID( "EnumColor" ), RSC_NOTYPE );
206 :
207 417 : SETCONST( pColor, "COL_BLACK", COL_BLACK );
208 417 : SETCONST( pColor, "COL_BLUE", COL_BLUE );
209 417 : SETCONST( pColor, "COL_GREEN", COL_GREEN );
210 417 : SETCONST( pColor, "COL_CYAN", COL_CYAN );
211 417 : SETCONST( pColor, "COL_RED", COL_RED );
212 417 : SETCONST( pColor, "COL_MAGENTA", COL_MAGENTA );
213 417 : SETCONST( pColor, "COL_BROWN", COL_BROWN );
214 417 : SETCONST( pColor, "COL_GRAY", COL_GRAY );
215 417 : SETCONST( pColor, "COL_LIGHTGRAY", COL_LIGHTGRAY );
216 417 : SETCONST( pColor, "COL_LIGHTBLUE", COL_LIGHTBLUE );
217 417 : SETCONST( pColor, "COL_LIGHTGREEN", COL_LIGHTGREEN );
218 417 : SETCONST( pColor, "COL_LIGHTCYAN", COL_LIGHTCYAN );
219 417 : SETCONST( pColor, "COL_LIGHTRED", COL_LIGHTRED );
220 417 : SETCONST( pColor, "COL_LIGHTMAGENTA", COL_LIGHTMAGENTA );
221 417 : SETCONST( pColor, "COL_YELLOW", COL_YELLOW );
222 417 : SETCONST( pColor, "COL_WHITE", COL_WHITE );
223 :
224 417 : return pColor;
225 : }
226 :
227 417 : RscEnum * RscTypCont::InitMapUnit()
228 : {
229 : RscEnum * pMapUnit;
230 417 : pMapUnit = new RscEnum( pHS->getID( "EnumMapUnit" ), RSC_NOTYPE );
231 :
232 417 : SETCONST( pMapUnit, "MAP_PIXEL", MAP_PIXEL );
233 417 : SETCONST( pMapUnit, "MAP_SYSFONT", MAP_SYSFONT );
234 417 : SETCONST( pMapUnit, "MAP_100TH_MM", MAP_100TH_MM );
235 417 : SETCONST( pMapUnit, "MAP_10TH_MM", MAP_10TH_MM );
236 417 : SETCONST( pMapUnit, "MAP_MM", MAP_MM );
237 417 : SETCONST( pMapUnit, "MAP_CM", MAP_CM );
238 417 : SETCONST( pMapUnit, "MAP_1000TH_INCH", MAP_1000TH_INCH );
239 417 : SETCONST( pMapUnit, "MAP_100TH_INCH", MAP_100TH_INCH );
240 417 : SETCONST( pMapUnit, "MAP_10TH_INCH", MAP_10TH_INCH );
241 417 : SETCONST( pMapUnit, "MAP_INCH", MAP_INCH );
242 417 : SETCONST( pMapUnit, "MAP_POINT", MAP_POINT );
243 417 : SETCONST( pMapUnit, "MAP_TWIP", MAP_TWIP );
244 417 : SETCONST( pMapUnit, "MAP_APPFONT", MAP_APPFONT );
245 417 : SETCONST( pMapUnit, "MAP_SV", RSC_EXTRAMAPUNIT );
246 417 : return pMapUnit;
247 : }
248 :
249 417 : RscEnum * RscTypCont::InitKey()
250 : {
251 : RscEnum * pKey;
252 417 : pKey = new RscEnum( pHS->getID( "EnumKey" ), RSC_NOTYPE );
253 :
254 417 : SETCONST( pKey, "KEY_0", com::sun::star::awt::Key::NUM0 );
255 417 : SETCONST( pKey, "KEY_1", com::sun::star::awt::Key::NUM1 );
256 417 : SETCONST( pKey, "KEY_2", com::sun::star::awt::Key::NUM2 );
257 417 : SETCONST( pKey, "KEY_3", com::sun::star::awt::Key::NUM3 );
258 417 : SETCONST( pKey, "KEY_4", com::sun::star::awt::Key::NUM4 );
259 417 : SETCONST( pKey, "KEY_5", com::sun::star::awt::Key::NUM5 );
260 417 : SETCONST( pKey, "KEY_6", com::sun::star::awt::Key::NUM6 );
261 417 : SETCONST( pKey, "KEY_7", com::sun::star::awt::Key::NUM7 );
262 417 : SETCONST( pKey, "KEY_8", com::sun::star::awt::Key::NUM8 );
263 417 : SETCONST( pKey, "KEY_9", com::sun::star::awt::Key::NUM9 );
264 :
265 417 : SETCONST( pKey, "KEY_A", com::sun::star::awt::Key::A );
266 417 : SETCONST( pKey, "KEY_B", com::sun::star::awt::Key::B );
267 417 : SETCONST( pKey, "KEY_C", com::sun::star::awt::Key::C );
268 417 : SETCONST( pKey, "KEY_D", com::sun::star::awt::Key::D );
269 417 : SETCONST( pKey, "KEY_E", com::sun::star::awt::Key::E );
270 417 : SETCONST( pKey, "KEY_F", com::sun::star::awt::Key::F );
271 417 : SETCONST( pKey, "KEY_G", com::sun::star::awt::Key::G );
272 417 : SETCONST( pKey, "KEY_H", com::sun::star::awt::Key::H );
273 417 : SETCONST( pKey, "KEY_I", com::sun::star::awt::Key::I );
274 417 : SETCONST( pKey, "KEY_J", com::sun::star::awt::Key::J );
275 417 : SETCONST( pKey, "KEY_K", com::sun::star::awt::Key::K );
276 417 : SETCONST( pKey, "KEY_L", com::sun::star::awt::Key::L );
277 417 : SETCONST( pKey, "KEY_M", com::sun::star::awt::Key::M );
278 417 : SETCONST( pKey, "KEY_N", com::sun::star::awt::Key::N );
279 417 : SETCONST( pKey, "KEY_O", com::sun::star::awt::Key::O );
280 417 : SETCONST( pKey, "KEY_P", com::sun::star::awt::Key::P );
281 417 : SETCONST( pKey, "KEY_Q", com::sun::star::awt::Key::Q );
282 417 : SETCONST( pKey, "KEY_R", com::sun::star::awt::Key::R );
283 417 : SETCONST( pKey, "KEY_S", com::sun::star::awt::Key::S );
284 417 : SETCONST( pKey, "KEY_T", com::sun::star::awt::Key::T );
285 417 : SETCONST( pKey, "KEY_U", com::sun::star::awt::Key::U );
286 417 : SETCONST( pKey, "KEY_V", com::sun::star::awt::Key::V );
287 417 : SETCONST( pKey, "KEY_W", com::sun::star::awt::Key::W );
288 417 : SETCONST( pKey, "KEY_X", com::sun::star::awt::Key::X );
289 417 : SETCONST( pKey, "KEY_Y", com::sun::star::awt::Key::Y );
290 417 : SETCONST( pKey, "KEY_Z", com::sun::star::awt::Key::Z );
291 :
292 417 : SETCONST( pKey, "KEY_F1", com::sun::star::awt::Key::F1 );
293 417 : SETCONST( pKey, "KEY_F2", com::sun::star::awt::Key::F2 );
294 417 : SETCONST( pKey, "KEY_F3", com::sun::star::awt::Key::F3 );
295 417 : SETCONST( pKey, "KEY_F4", com::sun::star::awt::Key::F4 );
296 417 : SETCONST( pKey, "KEY_F5", com::sun::star::awt::Key::F5 );
297 417 : SETCONST( pKey, "KEY_F6", com::sun::star::awt::Key::F6 );
298 417 : SETCONST( pKey, "KEY_F7", com::sun::star::awt::Key::F7 );
299 417 : SETCONST( pKey, "KEY_F8", com::sun::star::awt::Key::F8 );
300 417 : SETCONST( pKey, "KEY_F9", com::sun::star::awt::Key::F9 );
301 417 : SETCONST( pKey, "KEY_F10", com::sun::star::awt::Key::F10 );
302 417 : SETCONST( pKey, "KEY_F11", com::sun::star::awt::Key::F11 );
303 417 : SETCONST( pKey, "KEY_F12", com::sun::star::awt::Key::F12 );
304 417 : SETCONST( pKey, "KEY_F13", com::sun::star::awt::Key::F13 );
305 417 : SETCONST( pKey, "KEY_F14", com::sun::star::awt::Key::F14 );
306 417 : SETCONST( pKey, "KEY_F15", com::sun::star::awt::Key::F15 );
307 417 : SETCONST( pKey, "KEY_F16", com::sun::star::awt::Key::F16 );
308 417 : SETCONST( pKey, "KEY_F17", com::sun::star::awt::Key::F17 );
309 417 : SETCONST( pKey, "KEY_F18", com::sun::star::awt::Key::F18 );
310 417 : SETCONST( pKey, "KEY_F19", com::sun::star::awt::Key::F19 );
311 417 : SETCONST( pKey, "KEY_F20", com::sun::star::awt::Key::F20 );
312 417 : SETCONST( pKey, "KEY_F21", com::sun::star::awt::Key::F21 );
313 417 : SETCONST( pKey, "KEY_F22", com::sun::star::awt::Key::F22 );
314 417 : SETCONST( pKey, "KEY_F23", com::sun::star::awt::Key::F23 );
315 417 : SETCONST( pKey, "KEY_F24", com::sun::star::awt::Key::F24 );
316 417 : SETCONST( pKey, "KEY_F25", com::sun::star::awt::Key::F25 );
317 417 : SETCONST( pKey, "KEY_F26", com::sun::star::awt::Key::F26 );
318 :
319 417 : SETCONST( pKey, "KEY_DOWN", com::sun::star::awt::Key::DOWN );
320 417 : SETCONST( pKey, "KEY_UP", com::sun::star::awt::Key::UP );
321 417 : SETCONST( pKey, "KEY_LEFT", com::sun::star::awt::Key::LEFT );
322 417 : SETCONST( pKey, "KEY_RIGHT", com::sun::star::awt::Key::RIGHT );
323 417 : SETCONST( pKey, "KEY_HOME", com::sun::star::awt::Key::HOME );
324 417 : SETCONST( pKey, "KEY_END", com::sun::star::awt::Key::END );
325 417 : SETCONST( pKey, "KEY_PAGEUP", com::sun::star::awt::Key::PAGEUP );
326 417 : SETCONST( pKey, "KEY_PAGEDOWN", com::sun::star::awt::Key::PAGEDOWN );
327 :
328 417 : SETCONST( pKey, "KEY_RETURN", com::sun::star::awt::Key::RETURN );
329 417 : SETCONST( pKey, "KEY_ESCAPE", com::sun::star::awt::Key::ESCAPE );
330 417 : SETCONST( pKey, "KEY_TAB", com::sun::star::awt::Key::TAB );
331 417 : SETCONST( pKey, "KEY_BACKSPACE", com::sun::star::awt::Key::BACKSPACE );
332 417 : SETCONST( pKey, "KEY_SPACE", com::sun::star::awt::Key::SPACE );
333 417 : SETCONST( pKey, "KEY_INSERT", com::sun::star::awt::Key::INSERT );
334 417 : SETCONST( pKey, "KEY_DELETE", com::sun::star::awt::Key::DELETE );
335 :
336 417 : SETCONST( pKey, "KEY_ADD", com::sun::star::awt::Key::ADD );
337 417 : SETCONST( pKey, "KEY_SUBTRACT", com::sun::star::awt::Key::SUBTRACT );
338 417 : SETCONST( pKey, "KEY_MULTIPLY", com::sun::star::awt::Key::MULTIPLY );
339 417 : SETCONST( pKey, "KEY_DIVIDE", com::sun::star::awt::Key::DIVIDE );
340 417 : SETCONST( pKey, "KEY_POINT", com::sun::star::awt::Key::POINT );
341 417 : SETCONST( pKey, "KEY_COMMA", com::sun::star::awt::Key::COMMA );
342 417 : SETCONST( pKey, "KEY_LESS", com::sun::star::awt::Key::LESS );
343 417 : SETCONST( pKey, "KEY_GREATER", com::sun::star::awt::Key::GREATER );
344 417 : SETCONST( pKey, "KEY_EQUAL", com::sun::star::awt::Key::EQUAL );
345 :
346 417 : SETCONST( pKey, "KEY_OPEN", com::sun::star::awt::Key::OPEN );
347 417 : SETCONST( pKey, "KEY_CUT", com::sun::star::awt::Key::CUT );
348 417 : SETCONST( pKey, "KEY_COPY", com::sun::star::awt::Key::COPY );
349 417 : SETCONST( pKey, "KEY_PASTE", com::sun::star::awt::Key::PASTE );
350 417 : SETCONST( pKey, "KEY_UNDO", com::sun::star::awt::Key::UNDO );
351 417 : SETCONST( pKey, "KEY_REPEAT", com::sun::star::awt::Key::REPEAT );
352 417 : SETCONST( pKey, "KEY_FIND", com::sun::star::awt::Key::FIND );
353 417 : SETCONST( pKey, "KEY_PROPERTIES", com::sun::star::awt::Key::PROPERTIES );
354 417 : SETCONST( pKey, "KEY_FRONT", com::sun::star::awt::Key::FRONT );
355 417 : SETCONST( pKey, "KEY_CONTEXTMENU", com::sun::star::awt::Key::CONTEXTMENU );
356 417 : SETCONST( pKey, "KEY_HELP", com::sun::star::awt::Key::HELP );
357 417 : SETCONST( pKey, "KEY_HANGUL_HANJA", com::sun::star::awt::Key::HANGUL_HANJA );
358 417 : SETCONST( pKey, "KEY_DECIMAL", com::sun::star::awt::Key::DECIMAL );
359 417 : SETCONST( pKey, "KEY_TILDE", com::sun::star::awt::Key::TILDE );
360 417 : SETCONST( pKey, "KEY_QUOTELEFT", com::sun::star::awt::Key::QUOTELEFT );
361 :
362 417 : return pKey;
363 : }
364 :
365 417 : RscEnum * RscTypCont::InitTriState()
366 : {
367 : RscEnum * pTriState;
368 417 : pTriState = new RscEnum( pHS->getID( "EnumTriState" ), RSC_NOTYPE );
369 :
370 417 : SETCONST( pTriState, "STATE_NOCHECK", TRISTATE_FALSE );
371 417 : SETCONST( pTriState, "STATE_CHECK", TRISTATE_TRUE );
372 417 : SETCONST( pTriState, "STATE_DONTKNOW", TRISTATE_INDET );
373 :
374 417 : return pTriState;
375 : }
376 :
377 417 : RscTupel * RscTypCont::InitGeometry()
378 : {
379 : RscTop * pTupel;
380 : Atom nId;
381 :
382 : // Clientvariablen einfuegen
383 834 : pTupel = new RscTupel( pHS->getID( "TupelDeltaSystem" ),
384 417 : RSC_NOTYPE, NULL );
385 417 : nId = aNmTb.Put( "X", VARNAME );
386 417 : pTupel->SetVariable( nId, &aShort );
387 417 : nId = aNmTb.Put( "Y", VARNAME );
388 417 : pTupel->SetVariable( nId, &aShort );
389 417 : nId = aNmTb.Put( "WIDTH", VARNAME );
390 417 : pTupel->SetVariable( nId, &aShort );
391 417 : nId = aNmTb.Put( "HEIGHT", VARNAME );
392 417 : pTupel->SetVariable( nId, &aShort );
393 :
394 417 : return static_cast<RscTupel *>(pTupel);
395 : }
396 :
397 417 : RscArray * RscTypCont::InitLangGeometry( RscTupel * pGeo )
398 : {
399 417 : return new RscArray( pHS->getID( "Lang_TupelGeometry" ), RSC_NOTYPE, pGeo, &aLangType );
400 : }
401 :
402 417 : RscCont * RscTypCont::InitStringList()
403 : {
404 : RscCont * pCont;
405 :
406 417 : pCont = new RscCont( pHS->getID( "Chars[]" ), RSC_NOTYPE );
407 417 : pCont->SetTypeClass( &aString );
408 :
409 417 : return pCont;
410 : }
411 :
412 417 : RscArray * RscTypCont::InitLangStringList( RscCont * pStrLst )
413 : {
414 834 : return new RscArray( pHS->getID( "Lang_CharsList" ),
415 834 : RSC_NOTYPE, pStrLst, &aLangType );
416 : }
417 :
418 417 : RscTupel * RscTypCont::InitStringTupel()
419 : {
420 : RscTop * pTupel;
421 : Atom nId;
422 :
423 : // Clientvariablen einfuegen
424 417 : pTupel = new RscTupel( pHS->getID( "CharsTupel" ), RSC_NOTYPE, NULL );
425 417 : nId = aNmTb.Put( "FILTER", VARNAME );
426 417 : pTupel->SetVariable( nId, &aString );
427 417 : nId = aNmTb.Put( "MASK", VARNAME );
428 417 : pTupel->SetVariable( nId, &aString );
429 :
430 417 : return static_cast<RscTupel *>(pTupel);
431 : }
432 :
433 417 : RscTupel * RscTypCont::InitStringLongTupel()
434 : {
435 : RscTop * pTupel;
436 : Atom nId;
437 :
438 : // Clientvariablen einfuegen
439 417 : pTupel = new RscTupel( pHS->getID( "CharsLongTupel" ), RSC_NOTYPE, NULL );
440 417 : nId = aNmTb.Put( "ItemText", VARNAME );
441 417 : pTupel->SetVariable( nId, &aString );
442 417 : nId = aNmTb.Put( "ItemId", VARNAME );
443 417 : pTupel->SetVariable( nId, &aEnumLong );
444 :
445 417 : return static_cast<RscTupel *>(pTupel);
446 : }
447 :
448 417 : RscCont * RscTypCont::InitStringTupelList( RscTupel * pTupelString )
449 : {
450 : RscCont * pCont;
451 :
452 417 : pCont = new RscCont( pHS->getID( "CharsCharsTupel[]" ), RSC_NOTYPE );
453 417 : pCont->SetTypeClass( pTupelString );
454 :
455 417 : return pCont;
456 : }
457 :
458 417 : RscCont * RscTypCont::InitStringLongTupelList( RscTupel * pStringLong )
459 : {
460 : RscCont * pCont;
461 :
462 417 : pCont = new RscCont( pHS->getID( "CharsLongTupel[]" ), RSC_NOTYPE );
463 417 : pCont->SetTypeClass( pStringLong );
464 :
465 417 : return pCont;
466 : }
467 :
468 417 : RscArray * RscTypCont::InitLangStringTupelList( RscCont * pStrTupelLst )
469 : {
470 834 : return new RscArray( pHS->getID( "Lang_CharsCharsTupel" ),
471 834 : RSC_NOTYPE, pStrTupelLst, &aLangType );
472 : }
473 :
474 417 : RscArray * RscTypCont::InitLangStringLongTupelList( RscCont * pStrLongTupelLst )
475 : {
476 834 : return new RscArray( pHS->getID( "Lang_CharsLongTupelList" ),
477 834 : RSC_NOTYPE, pStrLongTupelLst, &aLangType );
478 1251 : }
479 :
480 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|