From 8ab086b6cc054501bfbf7ef6fa509c393691e860 Mon Sep 17 00:00:00 2001 From: Jens-Heiner Rechtien Date: Mon, 18 Sep 2000 16:07:07 +0000 Subject: initial import --- rsc/source/parser/erscerr.cxx | 512 +++++++++ rsc/source/parser/makefile.mk | 111 ++ rsc/source/parser/parser.cxx | 91 ++ rsc/source/parser/parser.hxx | 60 + rsc/source/parser/rscdb.cxx | 1127 +++++++++++++++++++ rsc/source/parser/rscibas.cxx | 736 ++++++++++++ rsc/source/parser/rscicpx.cxx | 2483 +++++++++++++++++++++++++++++++++++++++++ rsc/source/parser/rscinit.cxx | 1037 +++++++++++++++++ rsc/source/parser/rsckey.cxx | 297 +++++ rsc/source/parser/rsclex.cxx | 588 ++++++++++ rsc/source/parser/rsclex.hxx | 217 ++++ rsc/source/parser/rscpar.cxx | 299 +++++ rsc/source/parser/rscyacc.cxx | 322 ++++++ 13 files changed, 7880 insertions(+) create mode 100644 rsc/source/parser/erscerr.cxx create mode 100644 rsc/source/parser/makefile.mk create mode 100644 rsc/source/parser/parser.cxx create mode 100644 rsc/source/parser/parser.hxx create mode 100644 rsc/source/parser/rscdb.cxx create mode 100644 rsc/source/parser/rscibas.cxx create mode 100644 rsc/source/parser/rscicpx.cxx create mode 100644 rsc/source/parser/rscinit.cxx create mode 100644 rsc/source/parser/rsckey.cxx create mode 100644 rsc/source/parser/rsclex.cxx create mode 100644 rsc/source/parser/rsclex.hxx create mode 100644 rsc/source/parser/rscpar.cxx create mode 100644 rsc/source/parser/rscyacc.cxx (limited to 'rsc/source/parser') diff --git a/rsc/source/parser/erscerr.cxx b/rsc/source/parser/erscerr.cxx new file mode 100644 index 000000000000..1a0453dca865 --- /dev/null +++ b/rsc/source/parser/erscerr.cxx @@ -0,0 +1,512 @@ +/************************************************************************* + * + * $RCSfile: erscerr.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: hr $ $Date: 2000-09-18 16:42:55 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +/************************************************************************ + + Source Code Control System - Header + + $Header: /zpool/svn/migration/cvs_rep_09_09_08/code/rsc/source/parser/erscerr.cxx,v 1.1.1.1 2000-09-18 16:42:55 hr Exp $ + +************************************************************************/ +#pragma hdrstop +#include +#include + +#include + +#ifndef _RSCHASH_HXX +#include +#endif +#ifndef _RSCERROR_H +#include +#endif +#ifndef _RSCALL_H +#include +#endif +#ifndef _RSCDB_HXX +#include +#endif +#ifndef _RSCPAR_HXX +#include +#endif + +#include "rsclex.hxx" + +/************************************************************************* +|* +|* ERRTYPE::operator = ; +|* +|* Beschreibung +|* Ersterstellung MM 25.09.91 +|* Letzte Aenderung MM 25.09.91 +|* +*************************************************************************/ +ERRTYPE& ERRTYPE::operator = ( const ERRTYPE & rError ) +{ + if( !IsError() ){ + if( rError.IsError() || !IsWarning() ) + nError = rError.nError; + } + return *this; +} + +/************************************************************************* +|* +|* RscError::StdOut(); +|* +|* Beschreibung +|* Ersterstellung MM 06.05.91 +|* Letzte Aenderung MM 06.05.91 +|* +*************************************************************************/ +void RscError::StdOut( const char * pStr ) +{ +#ifndef WIN + if( pStr ){ + printf( "%s", pStr ); + fflush( stdout ); + } +#endif +} + +/************************************************************************* +|* +|* RscError::LstOut(); +|* +|* Beschreibung +|* Ersterstellung MM 06.05.91 +|* Letzte Aenderung MM 06.05.91 +|* +*************************************************************************/ +void RscError::LstOut( const char * pStr ){ + if( fListing && pStr ) + fprintf( fListing, "%s", pStr ); +} + +/************************************************************************* +|* +|* RscError::StdLstOut(); +|* +|* Beschreibung +|* Ersterstellung MM 06.05.91 +|* Letzte Aenderung MM 06.05.91 +|* +*************************************************************************/ +void RscError::StdLstOut( const char * pStr ){ + StdOut( pStr ); + LstOut( pStr ); +} + +/************************************************************************* +|* +|* RscError::WriteError(); +|* +|* Beschreibung +|* Ersterstellung MM 06.05.91 +|* Letzte Aenderung MM 06.05.91 +|* +*************************************************************************/ +void RscError::WriteError( const ERRTYPE& rError, const char * pMessage ) +{ + switch( rError ) + { + case ERR_ERROR: { + StdLstOut( "!! " ); + if( 1 == nErrors ) + StdLstOut( ByteString::CreateFromInt32( nErrors ).GetBuffer() ); + else + StdLstOut( ByteString::CreateFromInt32( (USHORT)(nErrors -1) ).GetBuffer() ); + StdLstOut( " Error" ); + StdLstOut( " found!!" ); + } + break; + + case ERR_UNKNOWN_METHOD: + StdLstOut( "The used type is not allowed." ); + break; + + case ERR_OPENFILE: + StdLstOut( "This file <" ); + StdLstOut( pMessage ); + StdLstOut( "> cannot be opened." ); + break; + + case ERR_FILESIZE: + StdLstOut( "Wrong file <" ); + StdLstOut( pMessage ); + StdLstOut( "> length." ); + break; + + case ERR_FILEFORMAT: + StdLstOut( "Wrong file type <" ); + StdLstOut( pMessage ); + StdLstOut( ">." ); + break; + + case ERR_NOCHAR: + StdLstOut( "Character: '\\xxx'; The value xxx is greater than 255."); + break; + + case ERR_NORSCINST: + StdLstOut( "Internal error, instance invalid."); + break; + + + case ERR_NOINPUT: + StdLstOut( "Input file was not specified.\n"); + case ERR_USAGE: + StdLstOut( "Copyright (C) 1990-92 STAR DIVISION GmbH\n" ); + { + char buf[40]; + + StdLstOut( "DataVersion: " ); + sprintf( buf, "%d.%d\n\n", + RSCVERSION_ID / 100, RSCVERSION_ID % 100 ); + StdLstOut( buf ); + }; + + StdLstOut( "Command line: rsc [Switches] \n" ); + StdLstOut( "Command line: rsc @\n" ); + StdLstOut( "-h shows this help.\n" ); + StdLstOut( "-p No Preprocessor.\n" ); + StdLstOut( "-s Syntax analysis, creates .srs file\n"); + StdLstOut( "-l Linker, links files created with rsc -s,\n" ); + StdLstOut( " creates .rc file and .res file.\n" ); + StdLstOut( "-r Prevents .res file.\n" ); + StdLstOut( "-d Symbol definitions for the Preprocessor.\n" ); + StdLstOut( "-i Include directives for the Preprocessor.\n" ); + StdLstOut( "-presponse Use response file for Preprocessor.\n" ); + StdLstOut( "-lg Use a different language.\n" ); + StdLstOut( "-pp Use a different Preprocessor.\n" ); + StdLstOut( "-rc Use a different system resource compiler.\n" ); + StdLstOut( "-fo Renaming of the .res file.\n" ); + StdLstOut( "-fs Renaming of the .rc file.\n" ); + StdLstOut( "-fp Renaming of the .srs file.\n" ); + StdLstOut( "-fl Listing file.\n" ); + StdLstOut( "-fh Header file.\n" ); + StdLstOut( "-fc Code file.\n" ); + StdLstOut( "-CHARSET_... Convert to this character set.\n" ); + StdLstOut( "-BIGENDIAN Format of number values.\n" ); + StdLstOut( "-LITTLEENDIAN Format of number values.\n" ); + StdLstOut( "-SMART Generate smart names (cxx, hxx).\n" ); + StdLstOut( "-SrsDefault Only write one language to srs file.\n" ); + break; + + case ERR_UNKNOWNSW: + StdLstOut( "Unknown switch <" ); + StdLstOut( pMessage ); + StdLstOut( ">." ); + break; + + case ERR_REFTODEEP: + StdLstOut( "Too many reference levels have been used (see Switch -RefDeep)." ); + break; + + case ERR_CONT_INVALIDPOS: + StdLstOut( "Internal error, Container class: invalid position." ); + break; + + case ERR_CONT_INVALIDTYPE: + StdLstOut( "Invalid type <" ); + StdLstOut( pMessage ); + StdLstOut( ">." ); + break; + + case ERR_ARRAY_INVALIDINDEX: + StdLstOut( "Internal error, Array class: invalid index." ); + break; + + case ERR_RSCINST_NOVARNAME: + StdLstOut( "Internal error, invalid name of variable." ); + break; + + case ERR_YACC: + StdLstOut( pMessage ); + break; + + case ERR_DOUBLEID: + StdLstOut( "Two global resources have the same identifier." ); + break; + + case ERR_FALSETYPE: + StdLstOut( "Wrong type <" ); + StdLstOut( pMessage ); + StdLstOut( ">." ); + break; + + case ERR_NOVARIABLENAME: + StdLstOut( "The variable <" ); + StdLstOut( pMessage ); + StdLstOut( "> must not be used here." ); + break; + + case ERR_RSCRANGE_OUTDEFSET: + StdLstOut( "The used value is not in the expected domain." ); + break; + + case ERR_USHORTRANGE: + StdLstOut( "Value is <" ); + StdLstOut( pMessage ); + StdLstOut( "> the allowed domain is from 0 up to 65535." ); + break; + + case ERR_IDRANGE: + StdLstOut( "Value is <" ); + StdLstOut( pMessage ); + StdLstOut( "> the allowed domain is from 1 up to 32767." ); + break; + + case ERR_NOCOPYOBJ: + StdLstOut( "Default resource <" ); + StdLstOut( pMessage ); + StdLstOut( "> not found." ); + break; + + case ERR_REFNOTALLOWED: + StdLstOut( "The use of a reference is not allowed." ); + break; + + case ERR_COPYNOTALLOWED: + StdLstOut( "The use of a default resource is not allowed." ); + break; + + case ERR_IDEXPECTED: + StdLstOut( "An identifier needs to be specified." ); + break; + + case ERR_DOUBLEDEFINE: + StdLstOut( "The symbol <" ); + StdLstOut( pMessage ); + StdLstOut( "> is defined twice." ); + break; + + case ERR_RSCINST_RESERVEDNAME: + StdLstOut( "The symbol <" ); + StdLstOut( pMessage ); + StdLstOut( "> is a reserved name." ); + break; + + case ERR_ZERODIVISION: + StdLstOut( "Attempt to divide by zero." ); + break; + + case ERR_PRAGMA: + StdLstOut( "Error in a #pragma statement." ); + break; + + case ERR_DECLAREDEFINE: + StdLstOut( "Error in the declaration part of the macro." ); + break; + + case ERR_NOTYPE: + StdLstOut( "type expected." ); + break; + +/****************** W A R N I N G S **************************************/ + case WRN_LOCALID: + StdLstOut( "Sub resources should have an identifier < 256." ); + break; + + case WRN_GLOBALID: + StdLstOut( "Global resources should have an identifier >= 256." ); + break; + + case WRN_SUBINMEMBER: + StdLstOut( "Sub resources are ignored." ); + break; + + case WRN_CONT_NOID: + StdLstOut( "Resources without name are ignored." ); + break; + + case WRN_CONT_DOUBLEID: + StdLstOut( "Two local resources have the same identifier." ); + break; + + case WRN_STR_REFNOTFOUND: + StdLstOut( "String reference <" ); + StdLstOut( pMessage ); + StdLstOut( " > could not be resolved." ); + break; + + case WRN_MGR_REFNOTFOUND: + StdLstOut( "Reference <" ); + StdLstOut( pMessage ); + StdLstOut( " > could not be resolved." ); + break; + + default: + if( pMessage ){ + StdLstOut( "\nMessage: " ); + StdLstOut( pMessage ); + }; + break; + } +} + +/************************************************************************* +|* +|* RscErrorFormat() +|* +|* Beschreibung +|* Ersterstellung MM 06.05.91 +|* Letzte Aenderung MM 06.05.91 +|* +*************************************************************************/ +void RscError::ErrorFormat( const ERRTYPE& rError, RscTop * pClass, + const RscId & aId ){ + char buf[ 10 ]; + USHORT i; + + if( pFI ) + { + pFI->SetError( rError ); + StdOut( "\n" ); + StdOut( pFI->GetLine() ); + StdOut( "\n" ); + // Fehlerposition anzeigen + for( i = 0; (USHORT)(i +1) < pFI->GetScanPos(); i++ ) + StdLstOut( " " ); + LstOut( " ^" ); //Zeilennummern beachten + StdOut( "^" ); + StdLstOut( "\n" ); + } + StdLstOut( "f" ); + sprintf( buf, "%u", (USHORT)rError ); + StdLstOut( buf ); + + if( pFI && pTC ){ + StdLstOut( ": \"" ); + StdLstOut( pTC->aFileTab.Get( pFI->GetFileIndex() )->aFileName.GetBuffer() ); + StdLstOut( "\", line " ); + sprintf( buf, "%d", pFI->GetLineNo() ); + StdLstOut( buf ); + } + + if( rError.IsError() ) + StdLstOut( ": Error" ); + else + StdLstOut( ": Warning" ); + + if( pClass || aId.IsId() ) + { + StdLstOut( " in the object (" ); + if( pClass ) + { + StdLstOut( "Type: " ); + StdLstOut( pHS->Get( pClass->GetId() ) ); + if( aId.IsId() ) + StdLstOut( ", " ); + } + if( aId.IsId() ) + StdLstOut( aId.GetName().GetBuffer() ); + StdLstOut( "):\n" ); + } + else + StdLstOut( ": " ); +} + +/************************************************************************* +|* +|* RscError::Error() +|* +|* Beschreibung +|* Ersterstellung MM 06.05.91 +|* Letzte Aenderung MM 06.05.91 +|* +*************************************************************************/ +void RscError::Error( const ERRTYPE& rError, RscTop * pClass, + const RscId & aId, const char * pMessage ) +{ + if( WRN_LOCALID == (USHORT)rError ) // Keine Warning erzeugen + return; + if( rError.IsError() ) + nErrors++; + if( rError.IsError() || rError.IsWarning() ){ + ErrorFormat( rError, pClass, aId ); + WriteError( rError, pMessage ); + StdLstOut( "\n" ); + }; +} + +/************************************************************************* +|* +|* RscError::FatalError(); +|* +|* Beschreibung +|* Ersterstellung MM 06.05.91 +|* Letzte Aenderung MM 06.05.91 +|* +*************************************************************************/ +void RscError::FatalError( const ERRTYPE& rError, const RscId &aId, + const char * pMessage ) +{ + if( ERR_USAGE != (USHORT)rError ){ + nErrors++; + ErrorFormat( rError, NULL, aId ); + WriteError( rError, pMessage ); + StdLstOut( "\nTerminating compiler\n" ); + } + else + WriteError( rError, pMessage ); + + exit( 1 ); +} + diff --git a/rsc/source/parser/makefile.mk b/rsc/source/parser/makefile.mk new file mode 100644 index 000000000000..a1563686ed64 --- /dev/null +++ b/rsc/source/parser/makefile.mk @@ -0,0 +1,111 @@ +#************************************************************************* +# +# $RCSfile: makefile.mk,v $ +# +# $Revision: 1.1.1.1 $ +# +# last change: $Author: hr $ $Date: 2000-09-18 16:42:55 $ +# +# The Contents of this file are made available subject to the terms of +# either of the following licenses +# +# - GNU Lesser General Public License Version 2.1 +# - Sun Industry Standards Source License Version 1.1 +# +# Sun Microsystems Inc., October, 2000 +# +# GNU Lesser General Public License Version 2.1 +# ============================================= +# Copyright 2000 by Sun Microsystems, Inc. +# 901 San Antonio Road, Palo Alto, CA 94303, USA +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License version 2.1, as published by the Free Software Foundation. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, +# MA 02111-1307 USA +# +# +# Sun Industry Standards Source License Version 1.1 +# ================================================= +# The contents of this file are subject to the Sun Industry Standards +# Source License Version 1.1 (the "License"); You may not use this file +# except in compliance with the License. You may obtain a copy of the +# License at http://www.openoffice.org/license.html. +# +# Software provided under this License is provided on an "AS IS" basis, +# WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, +# WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, +# MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. +# See the License for the specific provisions governing your rights and +# obligations concerning the Software. +# +# The Initial Developer of the Original Code is: Sun Microsystems, Inc. +# +# Copyright: 2000 by Sun Microsystems, Inc. +# +# All Rights Reserved. +# +# Contributor(s): _______________________________________ +# +# +# +#************************************************************************* + +PRJ=..$/.. + +PROJECTPCH=parser +PROJECTPCHSOURCE=parser +PRJNAME=rsc +TARGET=rscpar + +# --- Settings ----------------------------------------------------- + +.IF "$(COM)"=="ICC" +CFLAGS+= /O- +.ENDIF + +#prjpch=T +.INCLUDE : svpre.mk +.INCLUDE : settings.mk +.INCLUDE : sv.mk + +# --- Files -------------------------------------------------------- + +YACCOUT=$(INCCOM) + +YACCTARGET= $(YACCOUT)$/rscyacc.yxx +YACCFILES= rscyacc.y + +CXXFILES= rscpar.cxx \ + rscyacc.cxx \ + rsclex.cxx \ + erscerr.cxx \ + rsckey.cxx \ + rscinit.cxx \ + rscibas.cxx \ + rscdb.cxx \ + rscicpx.cxx \ + parser.cxx + +OBJFILES= $(OBJ)$/rscpar.obj \ + $(OBJ)$/rscyacc.obj \ + $(OBJ)$/rsclex.obj \ + $(OBJ)$/erscerr.obj \ + $(OBJ)$/rsckey.obj \ + $(OBJ)$/rscinit.obj \ + $(OBJ)$/rscibas.obj \ + $(OBJ)$/rscdb.obj \ + $(OBJ)$/rscicpx.obj + +# --- Targets ------------------------------------------------------ + +.INCLUDE : target.mk diff --git a/rsc/source/parser/parser.cxx b/rsc/source/parser/parser.cxx new file mode 100644 index 000000000000..68da2c7d69b4 --- /dev/null +++ b/rsc/source/parser/parser.cxx @@ -0,0 +1,91 @@ +/************************************************************************* + * + * $RCSfile: parser.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: hr $ $Date: 2000-09-18 16:42:55 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +#pragma hdrstop +#include +#include +#include +#include +#include + +#include +#define RSC_COMPILER + +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + diff --git a/rsc/source/parser/parser.hxx b/rsc/source/parser/parser.hxx new file mode 100644 index 000000000000..a70d723ca401 --- /dev/null +++ b/rsc/source/parser/parser.hxx @@ -0,0 +1,60 @@ +/************************************************************************* + * + * $RCSfile: parser.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: hr $ $Date: 2000-09-18 16:42:55 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ diff --git a/rsc/source/parser/rscdb.cxx b/rsc/source/parser/rscdb.cxx new file mode 100644 index 000000000000..bf92498609fb --- /dev/null +++ b/rsc/source/parser/rscdb.cxx @@ -0,0 +1,1127 @@ +/************************************************************************* + * + * $RCSfile: rscdb.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: hr $ $Date: 2000-09-18 16:42:55 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +/************************************************************************ + + Source Code Control System - Header + + $Header: /zpool/svn/migration/cvs_rep_09_09_08/code/rsc/source/parser/rscdb.cxx,v 1.1.1.1 2000-09-18 16:42:55 hr Exp $ + +*************************************************************************/ +/****************** I N C L U D E S **************************************/ + +#pragma hdrstop + +// C and C++ Includes. +#include +#include +#include + +#include +#include +#include + +// Programmabhaengige Includes. +#ifndef _RSCTREE_HXX +#include +#endif +#ifndef _RSCTOP_HXX +#include +#endif +#ifndef _RSCMGR_HXX +#include +#endif +#ifndef _RSCDB_HXX +#include +#endif + +/************************************************************************* +|* +|* RscTypCont :: RscTypCont +|* +|* Beschreibung RES.DOC +|* Ersterstellung MM 22.03.90 +|* Letzte Aenderung MM 27.06.90 +|* +*************************************************************************/ +RscTypCont :: RscTypCont( RscError * pErrHdl, + LanguageType nLangType, + RSCBYTEORDER_TYPE nOrder, + rtl_TextEncoding nSourceCharSet_, + const ByteString & rSearchPath, + USHORT nFlagsP ) + : nLangTypeId( nLangType ), + nDfltLangTypeId( International::GetNeutralLanguage( nLangType ) ), + nByteOrder( nOrder ), + nSourceCharSet( nSourceCharSet_ ), + aSearchPath( rSearchPath ), + nFlags( nFlagsP ), + aBool( pHS->Insert( "BOOL" ), RSC_NOTYPE ), + aShort( pHS->Insert( "short" ), RSC_NOTYPE ), + aUShort( pHS->Insert( "USHORT" ), RSC_NOTYPE ), + aLong( pHS->Insert( "long" ), RSC_NOTYPE ), + aEnumLong( pHS->Insert( "enum_long" ), RSC_NOTYPE ), + aIdUShort( pHS->Insert( "IDUSHORT" ), RSC_NOTYPE ), + aIdNoZeroUShort( pHS->Insert( "IDUSHORT" ), RSC_NOTYPE ), + aNoZeroShort( pHS->Insert( "NoZeroShort" ), RSC_NOTYPE ), + a1to12Short( pHS->Insert( "MonthShort" ), RSC_NOTYPE ), + a0to23Short( pHS->Insert( "HourShort" ), RSC_NOTYPE ), + a1to31Short( pHS->Insert( "DayShort" ), RSC_NOTYPE ), + a0to59Short( pHS->Insert( "MinuteShort" ), RSC_NOTYPE ), + a0to99Short( pHS->Insert( "_0to59Short" ), RSC_NOTYPE ), + a0to9999Short( pHS->Insert( "YearShort" ), RSC_NOTYPE ), + aIdLong( pHS->Insert( "IDLONG" ), RSC_NOTYPE, TRUE ), + aString( pHS->Insert( "Chars" ), RSC_NOTYPE ), + aWinBits( pHS->Insert( "WinBits" ), RSC_NOTYPE, FALSE ), + aLangType( pHS->Insert( "LangEnum" ), RSC_NOTYPE ), + aLangString( pHS->Insert( "Lang_Chars" ), RSC_NOTYPE, &aString, + &aLangType, &nLangTypeId, &nDfltLangTypeId ), + aLangShort( pHS->Insert( "Lang_short" ), RSC_NOTYPE, &aShort, + &aLangType, &nLangTypeId, &nDfltLangTypeId ) +{ + nUniqueId = 256; + nPMId = RSC_VERSIONCONTROL +1; //mindestens einen groesser + pEH = pErrHdl; + Init(); +} + +/************************************************************************* +|* +|* RscTypCont :: ~RscTypCont +|* +|* Beschreibung RES.DOC +|* Ersterstellung MM 22.03.90 +|* Letzte Aenderung MM 27.06.90 +|* +*************************************************************************/ +void DestroyNode( RscTop * pRscTop, ObjNode * pObjNode ){ + if( pObjNode ){ + DestroyNode( pRscTop, (ObjNode*)pObjNode->Left() ); + DestroyNode( pRscTop, (ObjNode*)pObjNode->Right() ); + + if( pObjNode->GetRscObj() ){ + pRscTop->Destroy( RSCINST( pRscTop, pObjNode->GetRscObj() ) ); + RscMem::Free( pObjNode->GetRscObj() ); + } + delete pObjNode; + }; +} + +void DestroySubTrees( RscTop * pRscTop ){ + if( pRscTop ){ + DestroySubTrees( (RscTop*)pRscTop->Left() ); + + DestroyNode( pRscTop, pRscTop->GetObjNode() ); + + DestroySubTrees( (RscTop*)pRscTop->Right() ); + }; +} + +void DestroyTree( RscTop * pRscTop ){ + if( pRscTop ){ + DestroyTree( (RscTop*)pRscTop->Left() ); + DestroyTree( (RscTop*)pRscTop->Right() ); + + delete pRscTop; + }; +} + +void Pre_dtorTree( RscTop * pRscTop ){ + if( pRscTop ){ + Pre_dtorTree( (RscTop*)pRscTop->Left() ); + Pre_dtorTree( (RscTop*)pRscTop->Right() ); + + pRscTop->Pre_dtor(); + }; +} + +RscTypCont :: ~RscTypCont(){ + RscTop * pRscTmp; + RscSysEntry * pSysEntry; + + // Alle Unterbaeume loeschen + aVersion.pClass->Destroy( aVersion ); + RscMem::Free( aVersion.pData ); + DestroySubTrees( pRoot ); + + // Alle Klassen noch gueltig, jeweilige Instanzen freigeben + // BasisTypen + pRscTmp = aBaseLst.First(); + while( pRscTmp ){ + pRscTmp->Pre_dtor(); + pRscTmp = aBaseLst.Next(); + }; + aBool.Pre_dtor(); + aShort.Pre_dtor(); + aUShort.Pre_dtor(); + aIdUShort.Pre_dtor(); + aIdNoZeroUShort.Pre_dtor(); + aNoZeroShort.Pre_dtor(); + aIdLong.Pre_dtor(); + aString.Pre_dtor(); + aWinBits.Pre_dtor(); + aVersion.pClass->Pre_dtor(); + // Zusammengesetzte Typen + Pre_dtorTree( pRoot ); + + // Klassen zerstoeren + delete aVersion.pClass; + DestroyTree( pRoot ); + + while( NULL != (pRscTmp = aBaseLst.Remove()) ){ + delete pRscTmp; + }; + + while( NULL != (pSysEntry = aSysLst.Remove()) ){ + delete pSysEntry; + }; +} + +//======================================================================= +RscTop * RscTypCont::SearchType( HASHID nId ) +/* [Beschreibung] + + Sucht eine Basistyp nId; +*/ +{ + if( nId == HASH_NONAME ) + return NULL; + +#define ELSE_IF( a ) \ + else if( a##.GetId() == nId ) \ + return &a; \ + + if( aBool.GetId() == nId ) + return &aBool; + ELSE_IF( aShort ) + ELSE_IF( aUShort ) + ELSE_IF( aLong ) + ELSE_IF( aEnumLong ) + ELSE_IF( aIdUShort ) + ELSE_IF( aIdNoZeroUShort ) + ELSE_IF( aNoZeroShort ) + ELSE_IF( a1to12Short ) + ELSE_IF( a0to23Short ) + ELSE_IF( a1to31Short ) + ELSE_IF( a0to59Short ) + ELSE_IF( a0to99Short ) + ELSE_IF( a0to9999Short ) + ELSE_IF( aIdLong ) + ELSE_IF( aString ) + ELSE_IF( aWinBits ) + ELSE_IF( aLangType ) + ELSE_IF( aLangString ) + ELSE_IF( aLangShort ) + + RscTop * pEle = aBaseLst.First(); + while( pEle ) + { + if( pEle->GetId() == nId ) + return pEle; + pEle = aBaseLst.Next(); + } + return NULL; +} + +/************************************************************************* +|* +|* RscTypCont :: Search +|* +|* Beschreibung RES.DOC +|* Ersterstellung MM 22.03.90 +|* Letzte Aenderung MM 27.06.90 +|* +*************************************************************************/ +RscTop * RscTypCont :: Search( HASHID nRT ){ + return( (RscTop *)pRoot->Search( nRT ) ); +} + +CLASS_DATA RscTypCont :: Search( HASHID nRT, const RscId & rId ){ + ObjNode *pObjNode; + RscTop *pRscTop; + + if( NULL != (pRscTop = Search( nRT )) ){ + if( NULL != (pObjNode = pRscTop->GetObjNode( rId )) ){ + return( pObjNode->GetRscObj() ); + } + } + return( (CLASS_DATA)0 ); +} + +/************************************************************************* +|* +|* RscTypCont :: Delete() +|* +|* Beschreibung +|* Ersterstellung MM 10.07.91 +|* Letzte Aenderung MM 10.07.91 +|* +*************************************************************************/ +void RscTypCont :: Delete( HASHID nRT, const RscId & rId ){ + ObjNode * pObjNode; + RscTop * pRscTop; + + if( NULL != (pRscTop = Search( nRT )) ){ + if( NULL != (pObjNode = pRscTop->GetObjNode()) ){ + pObjNode = pObjNode->Search( rId ); + + if( pObjNode ){ + //Objekt aus Baum entfernen + pRscTop->pObjBiTree = + (ObjNode *)pRscTop->pObjBiTree->Remove( pObjNode ); + + if( pObjNode->GetRscObj() ){ + pRscTop->Destroy( RSCINST( pRscTop, + pObjNode->GetRscObj() ) ); + RscMem::Free( pObjNode->GetRscObj() ); + } + delete pObjNode; + } + } + } +} + +/************************************************************************* +|* +|* RscTypCont :: PutSysName() +|* +|* Beschreibung RES.DOC +|* Ersterstellung MM 22.03.90 +|* Letzte Aenderung MM 27.06.90 +|* +*************************************************************************/ +USHORT RscTypCont :: PutSysName( USHORT nRscTyp, char * pFileName, + USHORT nConst, USHORT nId, BOOL bFirst ) +{ + RscSysEntry * pSysEntry; + BOOL bId1 = FALSE; + + pSysEntry = aSysLst.First(); + while( pSysEntry ) + { + if( pSysEntry->nKey == 1 ) + bId1 = TRUE; + if( !strcmp( pSysEntry->aFileName.GetBuffer(), pFileName ) ) + if( pSysEntry->nRscTyp == nRscTyp + && pSysEntry->nTyp == nConst + && pSysEntry->nRefId == nId ) + break; + pSysEntry = aSysLst.Next(); + } + + if ( !pSysEntry || (bFirst && !bId1) ) + { + pSysEntry = new RscSysEntry; + pSysEntry->nKey = nUniqueId++; + pSysEntry->nRscTyp = nRscTyp; + pSysEntry->nTyp = nConst; + pSysEntry->nRefId = nId; + pSysEntry->aFileName = (const char*)pFileName; + if( bFirst && !bId1 ) + { + pSysEntry->nKey = 1; + aSysLst.Insert( pSysEntry, (ULONG)0 ); + } + else + aSysLst.Insert( pSysEntry, LIST_APPEND ); + } + + return pSysEntry->nKey; +} + +/************************************************************************* +|* +|* RscTypCont :: WriteInc +|* +|* Beschreibung RES.DOC +|* Ersterstellung MM 21.06.90 +|* Letzte Aenderung MM 21.06.90 +|* +*************************************************************************/ +void RscTypCont :: WriteInc( FILE * fOutput, ULONG lFileKey ) +{ + RscFile * pFName; + + if( NOFILE_INDEX == lFileKey ) + { + pFName = aFileTab.First(); + while( pFName ) + { + if( pFName && pFName->IsIncFile() ) + { + fprintf( fOutput, "#include " ); + fprintf( fOutput, "\"%s\"\n", + pFName->aFileName.GetBuffer() ); + } + pFName = aFileTab.Next(); + } + } + else + { + RscDepend * pDep; + RscFile * pFile; + + pFName = aFileTab.Get( lFileKey ); + if( pFName ) + { + pDep = pFName->First(); + while( pDep ) + { + if( pDep->GetFileKey() != lFileKey ) + { + pFile = aFileTab.GetFile( pDep->GetFileKey() ); + if( pFile ) + { + fprintf( fOutput, "#include " ); + fprintf( fOutput, "\"%s\"\n", + pFile->aFileName.GetBuffer() ); + } + } + pDep = pFName->Next(); + }; + }; + }; +} + +/************************************************************************* +|* +|* RscTypCont :: Methoden die ueber all Knoten laufen +|* +|* Beschreibung RES.DOC +|* Ersterstellung MM 22.03.90 +|* Letzte Aenderung MM 09.12.91 +|* +*************************************************************************/ + +class RscEnumerateObj +{ +friend class RscEnumerateRef; +private: + ERRTYPE aError; // Enthaelt den ersten Fehler + RscTypCont* pTypCont; + FILE * fOutput; // AusgabeDatei + ULONG lFileKey; // Welche src-Datei + RscTop * pClass; + + DECL_LINK( CallBackWriteRc, ObjNode * ); + DECL_LINK( CallBackWriteSrc, ObjNode * ); + DECL_LINK( CallBackWriteCxx, ObjNode * ); + DECL_LINK( CallBackWriteHxx, ObjNode * ); + + ERRTYPE WriteRc( RscTop * pCl, ObjNode * pRoot ) + { + pClass = pCl; + if( pRoot ) + pRoot->EnumNodes( LINK( this, RscEnumerateObj, CallBackWriteRc ) ); + return aError; + } + ERRTYPE WriteSrc( RscTop * pCl, ObjNode * pRoot ){ + pClass = pCl; + if( pRoot ) + pRoot->EnumNodes( LINK( this, RscEnumerateObj, CallBackWriteSrc ) ); + return aError; + } + ERRTYPE WriteCxx( RscTop * pCl, ObjNode * pRoot ){ + pClass = pCl; + if( pRoot ) + pRoot->EnumNodes( LINK( this, RscEnumerateObj, CallBackWriteCxx ) ); + return aError; + } + ERRTYPE WriteHxx( RscTop * pCl, ObjNode * pRoot ){ + pClass = pCl; + if( pRoot ) + pRoot->EnumNodes( LINK( this, RscEnumerateObj, CallBackWriteHxx ) ); + return aError; + } +public: + void WriteRcFile( RscWriteRc & rMem, FILE * fOutput ); +}; + +/************************************************************************* +|* +|* RscEnumerateObj :: CallBackWriteRc +|* +|* Beschreibung +|* Ersterstellung MM 09.12.91 +|* Letzte Aenderung MM 09.12.91 +|* +*************************************************************************/ +IMPL_LINK( RscEnumerateObj, CallBackWriteRc, ObjNode *, pObjNode ) +{ + RscWriteRc aMem( pTypCont->GetByteOrder() ); + + aError = pClass->WriteRcHeader( RSCINST( pClass, pObjNode->GetRscObj() ), + aMem, pTypCont, + pObjNode->GetRscId(), 0, TRUE ); + if( aError.IsError() || aError.IsWarning() ) + pTypCont->pEH->Error( aError, pClass, pObjNode->GetRscId() ); + + WriteRcFile( aMem, fOutput ); + return 0; +} + +/************************************************************************* +|* +|* RscEnumerateObj :: CallBackWriteSrc +|* +|* Beschreibung +|* Ersterstellung MM 09.12.91 +|* Letzte Aenderung MM 09.12.91 +|* +*************************************************************************/ +IMPL_LINK_INLINE_START( RscEnumerateObj, CallBackWriteSrc, ObjNode *, pObjNode ) +{ + if( pObjNode->GetFileKey() == lFileKey ){ + pClass->WriteSrcHeader( RSCINST( pClass, pObjNode->GetRscObj() ), + fOutput, pTypCont, 0, + pObjNode->GetRscId(), "" ); + fprintf( fOutput, ";\n" ); + } + return 0; +} +IMPL_LINK_INLINE_END( RscEnumerateObj, CallBackWriteSrc, ObjNode *, pObjNode ) + +/************************************************************************* +|* +|* RscEnumerateObj :: CallBackWriteCxx +|* +|* Beschreibung +|* Ersterstellung MM 09.12.91 +|* Letzte Aenderung MM 09.12.91 +|* +*************************************************************************/ +IMPL_LINK_INLINE_START( RscEnumerateObj, CallBackWriteCxx, ObjNode *, pObjNode ) +{ + if( pClass->IsCodeWriteable() && pObjNode->GetFileKey() == lFileKey ) + aError = pClass->WriteCxxHeader( + RSCINST( pClass, pObjNode->GetRscObj() ), + fOutput, pTypCont, pObjNode->GetRscId() ); + return 0; +} +IMPL_LINK_INLINE_END( RscEnumerateObj, CallBackWriteCxx, ObjNode *, pObjNode ) + +/************************************************************************* +|* +|* RscEnumerateObj :: CallBackWriteHxx +|* +|* Beschreibung +|* Ersterstellung MM 09.12.91 +|* Letzte Aenderung MM 09.12.91 +|* +*************************************************************************/ +IMPL_LINK_INLINE_START( RscEnumerateObj, CallBackWriteHxx, ObjNode *, pObjNode ) +{ + if( pClass->IsCodeWriteable() && pObjNode->GetFileKey() == lFileKey ) + aError = pClass->WriteHxxHeader( + RSCINST( pClass, pObjNode->GetRscObj() ), + fOutput, pTypCont, pObjNode->GetRscId() ); + return 0; +} +IMPL_LINK_INLINE_END( RscEnumerateObj, CallBackWriteHxx, ObjNode *, pObjNode ) + +/************************************************************************* +|* +|* RscEnumerateObj :: WriteRcFile +|* +|* Beschreibung +|* Ersterstellung MM 09.12.91 +|* Letzte Aenderung MM 09.12.91 +|* +*************************************************************************/ +ULONG WritePMRes( FILE * fOutput, USHORT nType, USHORT nId, UINT32 nLen ) +{ + fputc( (char)0xFF, fOutput ); + fwrite( (const char *)&nType, sizeof( nType ), 1, fOutput ); + fputc( (char)0xFF, fOutput ); + fwrite( (const char *)&nId, sizeof( nId ), 1, fOutput ); + USHORT fsOption = 0x0030; // Aus Resourcefile ermittelt + fwrite( (const char *)&fsOption, sizeof( fsOption ), 1, fOutput ); + // !!! Achtung: Groesse der Resource NICHT dazuaddieren + // !!! nLen += 12; // groesse des Headers + ULONG nFilePos = ftell( fOutput ); + fwrite( (const char *)&nLen, sizeof( nLen ), 1, fOutput ); + return nFilePos; +} + +void RscEnumerateObj :: WriteRcFile( RscWriteRc & rMem, FILE * fOut ){ + // Definition der Struktur, aus denen die Resource aufgebaut ist + /* + struct RSHEADER_TYPE{ + USHORT nId; // Identifier der Resource + USHORT nRT; // Resource Typ + USHORT nGlobOff; // Globaler Offset + USHORT nLocalOff; // Lokaler Offset + } aHeader; + */ + + USHORT nId = rMem.GetShort( 0 ); + USHORT nRT = rMem.GetShort( 2 ); + + // Tabelle wird entsprechend gefuellt + pTypCont->PutTranslatorKey( ((INT32)nRT << 16) + nId ); + + if( nRT == RSC_VERSIONCONTROL ) + { // kommt immmer als letztes + INT32 nCount = pTypCont->aIdTranslator.Count(); + // groesse der Tabelle + UINT32 nSize = (nCount * 2 + 1) * sizeof( INT32 ); + + rMem.Put( nCount ); //Anzahl speichern + INT32 l = (INT32)pTypCont->aIdTranslator.First(); + while( nCount ) + { + // Schluessel schreiben + l = pTypCont->aIdTranslator.GetCurKey(); + rMem.Put( l ); + // Objekt Id oder Position schreiben + l = (INT32)pTypCont->aIdTranslator.GetCurObject(); + rMem.Put( l ); + l = (INT32)pTypCont->aIdTranslator.Next(); + nCount--; + } + rMem.Put( nSize ); // Groesse hinten Speichern + } + + //Dateioffset neu setzen + pTypCont->IncFilePos( rMem.Size() ); + + + //Position wurde vorher in Tabelle geschrieben + fwrite( rMem.GetBuffer(), rMem.Size(), 1, fOut ); + +}; + +class RscEnumerateRef +{ +private: + RscTop * pRoot; + + DECL_LINK( CallBackWriteRc, RscTop * ); + DECL_LINK( CallBackWriteSrc, RscTop * ); + DECL_LINK( CallBackWriteCxx, RscTop * ); + DECL_LINK( CallBackWriteHxx, RscTop * ); + DECL_LINK( CallBackWriteSyntax, RscTop * ); + DECL_LINK( CallBackWriteRcCtor, RscTop * ); +public: + RscEnumerateObj aEnumObj; + + RscEnumerateRef( RscTypCont * pTC, RscTop * pR, + FILE * fOutput ) + { + aEnumObj.pTypCont = pTC; + aEnumObj.fOutput = fOutput; + pRoot = pR; + } + ERRTYPE WriteRc() + { + aEnumObj.aError.Clear(); + pRoot->EnumNodes( LINK( this, RscEnumerateRef, CallBackWriteRc ) ); + return aEnumObj.aError; + }; + + ERRTYPE WriteSrc( ULONG lFileKey ) + { + aEnumObj.lFileKey = lFileKey; + + aEnumObj.aError.Clear(); + pRoot->EnumNodes( LINK( this, RscEnumerateRef, CallBackWriteSrc ) ); + return aEnumObj.aError; + } + + ERRTYPE WriteCxx( ULONG lFileKey ) + { + aEnumObj.lFileKey = lFileKey; + + aEnumObj.aError.Clear(); + pRoot->EnumNodes( LINK( this, RscEnumerateRef, CallBackWriteCxx ) ); + return aEnumObj.aError; + } + + ERRTYPE WriteHxx( ULONG lFileKey ) + { + aEnumObj.lFileKey = lFileKey; + + aEnumObj.aError.Clear(); + pRoot->EnumNodes( LINK( this, RscEnumerateRef, CallBackWriteHxx ) ); + return aEnumObj.aError; + } + + void WriteSyntax() + { + pRoot->EnumNodes( LINK( this, RscEnumerateRef, + CallBackWriteSyntax ) ); + } + + void WriteRcCtor() + { + pRoot->EnumNodes( LINK( this, RscEnumerateRef, + CallBackWriteRcCtor ) ); + } +}; + +/************************************************************************* +|* +|* RscRscEnumerateRef :: CallBack... +|* +|* Beschreibung +|* Ersterstellung MM 09.12.91 +|* Letzte Aenderung MM 09.12.91 +|* +*************************************************************************/ +IMPL_LINK_INLINE_START( RscEnumerateRef, CallBackWriteRc, RscTop *, pRef ) +{ + aEnumObj.WriteRc( pRef, pRef->GetObjNode() ); + return 0; +} +IMPL_LINK_INLINE_END( RscEnumerateRef, CallBackWriteRc, RscTop *, pRef ) +IMPL_LINK_INLINE_START( RscEnumerateRef, CallBackWriteSrc, RscTop *, pRef ) +{ + aEnumObj.WriteSrc( pRef, pRef->GetObjNode() ); + return 0; +} +IMPL_LINK_INLINE_END( RscEnumerateRef, CallBackWriteSrc, RscTop *, pRef ) +IMPL_LINK_INLINE_START( RscEnumerateRef, CallBackWriteCxx, RscTop *, pRef ) +{ + if( pRef->IsCodeWriteable() ) + aEnumObj.WriteCxx( pRef, pRef->GetObjNode() ); + return 0; +} +IMPL_LINK_INLINE_END( RscEnumerateRef, CallBackWriteCxx, RscTop *, pRef ) +IMPL_LINK_INLINE_START( RscEnumerateRef, CallBackWriteHxx, RscTop *, pRef ) +{ + if( pRef->IsCodeWriteable() ) + aEnumObj.WriteHxx( pRef, pRef->GetObjNode() ); + return 0; +} +IMPL_LINK_INLINE_END( RscEnumerateRef, CallBackWriteHxx, RscTop *, pRef ) +IMPL_LINK_INLINE_START( RscEnumerateRef, CallBackWriteSyntax, RscTop *, pRef ) +{ + pRef->WriteSyntaxHeader( aEnumObj.fOutput, aEnumObj.pTypCont ); + return 0; +} +IMPL_LINK_INLINE_END( RscEnumerateRef, CallBackWriteSyntax, RscTop *, pRef ) +IMPL_LINK_INLINE_START( RscEnumerateRef, CallBackWriteRcCtor, RscTop *, pRef ) +{ + pRef->WriteRcCtor( aEnumObj.fOutput, aEnumObj.pTypCont ); + return 0; +} +IMPL_LINK_INLINE_END( RscEnumerateRef, CallBackWriteRcCtor, RscTop *, pRef ) + +/************************************************************************* +|* +|* RscTypCont :: WriteRc +|* +|* Beschreibung RES.DOC +|* Ersterstellung MM 22.03.90 +|* Letzte Aenderung MM 22.07.91 +|* +*************************************************************************/ +ERRTYPE RscTypCont::WriteRc( FILE * fOutput ) +{ + RscSysEntry * pSysEntry; + ERRTYPE aError; + RscEnumerateRef aEnumRef( this, pRoot, fOutput ); + + aIdTranslator.Clear(); + nFilePos = 0; + nPMId = RSCVERSION_ID +1; //mindestens einen groesser + + aError = aEnumRef.WriteRc(); + + if( aError.IsOk() ) + { + // Systemabhaengige Resourcen schreiben + pSysEntry = aSysLst.First(); + while( pSysEntry && aError.IsOk() ) + { + UniString aUniFileName( pSysEntry->aFileName, RTL_TEXTENCODING_ASCII_US ); + DirEntry aFullName( aUniFileName ); + aFullName.Find( UniString( GetSearchPath(), RTL_TEXTENCODING_ASCII_US ) ); + pSysEntry->aFileName = ByteString( aFullName.GetFull(), RTL_TEXTENCODING_ASCII_US ); + if( !::Append( fOutput, pSysEntry->aFileName.GetBuffer() ) ) + { + pEH->FatalError( ERR_OPENFILE, RscId(), pSysEntry->aFileName.GetBuffer() ); + break; + } + UniString aUniFileName2( pSysEntry->aFileName, RTL_TEXTENCODING_ASCII_US ); + FileStat aFS( aUniFileName2 ); + if( !aFS.IsKind( FSYS_KIND_FILE ) ) + { + pEH->FatalError( ERR_OPENFILE, RscId(), pSysEntry->aFileName.GetBuffer() ); + break; + } + + // Tabelle wird entsprechend gefuellt + PutTranslatorKey( ((ULONG)RT_SYS_BITMAP << 16) + pSysEntry->nKey ); + UINT32 nSize = aFS.GetSize(); + IncFilePos( nSize ); + + // wegen Alignment + nSize = sizeof( int ) - nSize % sizeof( int ); + nSize %= sizeof( int ); + IncFilePos( nSize ); + while( nSize-- ) + fputc( 0, fOutput ); + + pSysEntry = aSysLst.Next(); + } + + // Versionskontrolle schreiben + RscWriteRc aMem( nByteOrder ); + aVersion.pClass->WriteRcHeader( aVersion, aMem, this, + RscId( RSCVERSION_ID ), 0, TRUE ); + aEnumRef.aEnumObj.WriteRcFile( aMem, fOutput ); + } + + return( aError ); +} + +/************************************************************************* +|* +|* RscTypCont :: WriteSrc +|* +|* Beschreibung RES.DOC +|* Ersterstellung MM 22.03.90 +|* Letzte Aenderung MM 27.06.90 +|* +*************************************************************************/ +void RscTypCont :: WriteSrc( FILE * fOutput, ULONG nFileKey, + CharSet nCharSet, BOOL bName ) +{ + RscFile * pFName; + RscEnumerateRef aEnumRef( this, pRoot, fOutput ); + + if( bName ) + { + WriteInc( fOutput, nFileKey ); + + if( NOFILE_INDEX == nFileKey ) + { + pFName = aFileTab.First(); + while( pFName ){ + if( !pFName->IsIncFile() ) + pFName->aDefLst.WriteAll( fOutput ); + aEnumRef.WriteSrc( aFileTab.GetIndex( pFName ) ); + pFName = aFileTab.Next(); + }; + } + else + { + pFName = aFileTab.Get( nFileKey ); + if( pFName ){ + pFName->aDefLst.WriteAll( fOutput ); + aEnumRef.WriteSrc( nFileKey ); + } + } + } + else + { + RscId::SetNames( FALSE ); + if( NOFILE_INDEX == nFileKey ) + { + pFName = aFileTab.First(); + while( pFName ) + { + aEnumRef.WriteSrc( aFileTab.GetIndex( pFName ) ); + pFName = aFileTab.Next(); + }; + } + else + aEnumRef.WriteSrc( nFileKey ); + RscId::SetNames(); + }; +} + +/************************************************************************* +|* +|* RscTypCont :: WriteHxx +|* +|* Beschreibung +|* Ersterstellung MM 30.05.91 +|* Letzte Aenderung MM 30.05.91 +|* +*************************************************************************/ +ERRTYPE RscTypCont :: WriteHxx( FILE * fOutput, ULONG nFileKey ) +{ + fprintf( fOutput, "#include \n" ); + fprintf( fOutput, "#include \n" ); + fprintf( fOutput, "#include \n" ); + fprintf( fOutput, "#include \n" ); + fprintf( fOutput, "#include \n" ); + fprintf( fOutput, "#include \n" ); + fprintf( fOutput, "#include \n" ); + fprintf( fOutput, "#include \n" ); + fprintf( fOutput, "#include \n" ); + fprintf( fOutput, "#include \n" ); + fprintf( fOutput, "#include \n" ); + fprintf( fOutput, "#include \n" ); + fprintf( fOutput, "#include \n" ); + fprintf( fOutput, "#include \n" ); + fprintf( fOutput, "#include \n" ); + fprintf( fOutput, "#include \n" ); + fprintf( fOutput, "#include \n" ); + fprintf( fOutput, "#include \n" ); + fprintf( fOutput, "#include \n" ); + fprintf( fOutput, "#include \n" ); + fprintf( fOutput, "#include \n" ); + fprintf( fOutput, "#include \n" ); + fprintf( fOutput, "#include \n" ); + fprintf( fOutput, "#include \n" ); + fprintf( fOutput, "#include \n" ); + fprintf( fOutput, "#include \n" ); + fprintf( fOutput, "#include \n" ); + fprintf( fOutput, "#include \n" ); + fprintf( fOutput, "#include \n" ); + fprintf( fOutput, "#include \n" ); + fprintf( fOutput, "#include \n" ); + fprintf( fOutput, "#include \n" ); + fprintf( fOutput, "#include \n" ); + fprintf( fOutput, "#include \n" ); + + RscEnumerateRef aEnumRef( this, pRoot, fOutput ); + ERRTYPE aError; + + if( NOFILE_INDEX == nFileKey ) + { + RscFile * pFName; + + pFName = aFileTab.First(); + while( pFName ) + { + aError = aEnumRef.WriteHxx( aFileTab.GetIndex( pFName ) ); + pFName = aFileTab.Next(); + }; + } + else + aError = aEnumRef.WriteHxx( nFileKey ); + + return aError; +} + +/************************************************************************* +|* +|* RscTypCont :: WriteCxx +|* +|* Beschreibung +|* Ersterstellung MM 30.05.91 +|* Letzte Aenderung MM 30.05.91 +|* +*************************************************************************/ +ERRTYPE RscTypCont::WriteCxx( FILE * fOutput, ULONG nFileKey, + const ByteString & rHxxName ) +{ + RscEnumerateRef aEnumRef( this, pRoot, fOutput ); + ERRTYPE aError; + fprintf( fOutput, "#include \n" ); + WriteInc( fOutput, nFileKey ); + if( rHxxName.Len() ) + fprintf( fOutput, "#include \"%s\"\n", rHxxName.GetBuffer() ); + fprintf( fOutput, "\n\n" ); + + if( NOFILE_INDEX == nFileKey ) + { + RscFile * pFName; + + pFName = aFileTab.First(); + while( pFName ) + { + aError = aEnumRef.WriteCxx( aFileTab.GetIndex( pFName ) ); + pFName = aFileTab.Next(); + }; + } + else + aError = aEnumRef.WriteCxx( nFileKey ); + + return aError; +} + +/************************************************************************* +|* +|* RscTypCont :: WriteSyntax +|* +|* Beschreibung +|* Ersterstellung MM 30.05.91 +|* Letzte Aenderung MM 30.05.91 +|* +*************************************************************************/ +void RscTypCont::WriteSyntax( FILE * fOutput ) +{ + for( USHORT i = 0; i < aBaseLst.Count(); i++ ) + aBaseLst.GetObject( i )->WriteSyntaxHeader( fOutput, this ); + RscEnumerateRef aEnumRef( this, pRoot, fOutput ); + aEnumRef.WriteSyntax(); +} + +//======================================================================= +void RscTypCont::WriteRcCtor +( + FILE * fOutput +) +{ + RscEnumerateRef aEnumRef( this, pRoot, fOutput ); + aEnumRef.WriteRcCtor(); +} + +/************************************************************************* +|* +|* RscTypCont :: Delete() +|* +|* Beschreibung +|* Ersterstellung MM 09.12.91 +|* Letzte Aenderung MM 09.12.91 +|* +*************************************************************************/ +class RscDel +{ + ULONG lFileKey; + DECL_LINK( Delete, RscTop * ); +public: + RscDel( RscTop * pRoot, ULONG lKey ); +}; + + +inline RscDel::RscDel( RscTop * pRoot, ULONG lKey ) +{ + lFileKey = lKey; + pRoot->EnumNodes( LINK( this, RscDel, Delete ) ); +} + +IMPL_LINK_INLINE_START( RscDel, Delete, RscTop *, pNode ) +{ + if( pNode->GetObjNode() ) + pNode->pObjBiTree = pNode->GetObjNode()->DelObjNode( pNode, lFileKey ); + return 0; +} +IMPL_LINK_INLINE_END( RscDel, Delete, RscTop *, pNode ) + +void RscTypCont :: Delete( ULONG lFileKey ){ + // Resourceinstanzen loeschen + RscDel aDel( pRoot, lFileKey ); + // Defines loeschen + aFileTab.DeleteFileContext( lFileKey ); +} + +/************************************************************************* +|* +|* RscTypCont :: MakeConsistent() +|* +|* Beschreibung +|* Ersterstellung MM 23.09.91 +|* Letzte Aenderung MM 23.09.91 +|* +*************************************************************************/ +BOOL IsInstConsistent( ObjNode * pObjNode, RscTop * pRscTop, + RscInconsList * pList ) +{ + BOOL bRet = TRUE; + + if( pObjNode ){ + RSCINST aTmpI; + + if( ! IsInstConsistent( (ObjNode*)pObjNode->Left(), pRscTop, pList ) ) + bRet = FALSE; + + aTmpI.pClass = pRscTop; + aTmpI.pData = pObjNode->GetRscObj(); + if( ! aTmpI.pClass->IsConsistent( aTmpI, pList ) ) + bRet = FALSE; + + if( ! IsInstConsistent( (ObjNode*)pObjNode->Right(), pRscTop, pList ) ) + bRet = FALSE; + }; + + return( bRet ); +} + +BOOL MakeConsistent( RscTop * pRscTop, RscInconsList * pList ) +{ + BOOL bRet = TRUE; + + if( pRscTop ){ + if( ! ::MakeConsistent( (RscTop*)pRscTop->Left(), pList ) ) + bRet = FALSE; + + if( pRscTop->GetObjNode() ){ + if( ! pRscTop->GetObjNode()->IsConsistent() ){ + pRscTop->GetObjNode()->OrderTree(); + if( ! pRscTop->GetObjNode()->IsConsistent( pList ) ) + bRet = FALSE; + } + if( ! IsInstConsistent( pRscTop->GetObjNode(), pRscTop, pList ) ) + bRet = FALSE; + } + + if( ! ::MakeConsistent( (RscTop*)pRscTop->Right(), pList ) ) + bRet = FALSE; + }; + + return bRet; +} + +BOOL RscTypCont :: MakeConsistent( RscInconsList * pList ){ + return( ::MakeConsistent( pRoot, pList ) ); +} + +USHORT RscTypCont::PutTranslatorKey( ULONG nKey ) +{ + aIdTranslator.Insert( nKey, (void*)nFilePos ); + return nPMId++; +} + diff --git a/rsc/source/parser/rscibas.cxx b/rsc/source/parser/rscibas.cxx new file mode 100644 index 000000000000..0032cb78fb66 --- /dev/null +++ b/rsc/source/parser/rscibas.cxx @@ -0,0 +1,736 @@ +/************************************************************************* + * + * $RCSfile: rscibas.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: hr $ $Date: 2000-09-18 16:42:55 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +/****************** I N C L U D E S **************************************/ +#pragma hdrstop + +// C and C++ Includes. +#include +#include + +#include +#include +#include +#include + +#ifndef _RSCCONST_HXX +#include +#endif +#ifndef _RSCARRAY_HXX +#include +#endif +#ifndef _RSCCLASS_HXX +#include +#endif +#ifndef _RSCCONT_HXX +#include +#endif +#ifndef _RSCDB_HXX +#include +#endif + + +#include "rsclex.hxx" +#include + +/****************** M A C R O S ******************************************/ +void RscTypCont::SETCONST( RscConst * pClass, char * szString, UINT32 nVal ) +{ + pClass->SetConstant( aNmTb.Put( szString, + (USHORT)CONSTNAME, nVal ), nVal ); +} + +void RscTypCont::SETCONST( RscConst * pClass, HASHID nName, UINT32 nVal ) +{ + pClass->SetConstant( aNmTb.Put( nName, + (USHORT)CONSTNAME, nVal ), nVal ); +} + +/****************** C O D E **********************************************/ +/************************************************************************* +|* RscTypCont::InitLangType() +|* +|* Beschreibung +*************************************************************************/ +#define LT(Name) \ + SETCONST( &aLangType, #Name, LANGUAGE_##Name ) + +RscEnum * RscTypCont::InitLangType() +{ + LT( SYSTEM ); + LT( DONTKNOW ); +#include + SETCONST( &aLangType, "LANGUAGE_USER1", LANGUAGE_USER1 ); + SETCONST( &aLangType, "LANGUAGE_USER2", LANGUAGE_USER2 ); + SETCONST( &aLangType, "LANGUAGE_USER3", LANGUAGE_USER3 ); + SETCONST( &aLangType, "LANGUAGE_USER4", LANGUAGE_USER4 ); + SETCONST( &aLangType, "LANGUAGE_USER5", LANGUAGE_USER5 ); + SETCONST( &aLangType, "LANGUAGE_USER6", LANGUAGE_USER6 ); + SETCONST( &aLangType, "LANGUAGE_USER7", LANGUAGE_USER7 ); + SETCONST( &aLangType, "LANGUAGE_USER8", LANGUAGE_USER8 ); + SETCONST( &aLangType, "LANGUAGE_USER9", LANGUAGE_USER9 ); + + return( &aLangType ); +} + +/************************************************************************* +|* +|* RscTypCont::InitDateFormatType() +|* +|* Beschreibung +|* Ersterstellung MM 22.03.91 +|* Letzte Aenderung MM 27.06.91 +|* +*************************************************************************/ +RscEnum * RscTypCont::InitDateFormatType() +{ + RscEnum * pDate; + pDate = new RscEnum( pHS->Insert( "EnumDateFormat" ), RSC_NOTYPE ); + + SETCONST( pDate, "MDY", MDY ); + SETCONST( pDate, "DMY", DMY ); + SETCONST( pDate, "YMD", YMD ); + + return pDate; +} + +/************************************************************************* +|* +|* RscTypCont::InitTimeType() +|* +|* Beschreibung +|* Ersterstellung MM 22.03.91 +|* Letzte Aenderung MM 27.06.91 +|* +*************************************************************************/ +RscEnum * RscTypCont::InitTimeFormatType() +{ + RscEnum * pTime; + pTime = new RscEnum( pHS->Insert( "EnumTimeFormat" ), RSC_NOTYPE ); + + SETCONST( pTime, "HOUR_12", HOUR_12 ); + SETCONST( pTime, "HOUR_24", HOUR_24 ); + + return pTime; +} + +/************************************************************************* +|* +|* RscTypCont::InitWeekDayFormatType() +|* +|* Beschreibung +|* Ersterstellung MM 22.03.91 +|* Letzte Aenderung MM 27.06.91 +|* +*************************************************************************/ +RscEnum * RscTypCont::InitWeekDayFormatType() +{ + RscEnum * pWeekDay; + pWeekDay = new RscEnum( pHS->Insert( "EnumWeekDayFormat" ), RSC_NOTYPE ); + + SETCONST( pWeekDay, "DAYOFWEEK_NONE", DAYOFWEEK_NONE ); + SETCONST( pWeekDay, "DAYOFWEEK_SHORT", DAYOFWEEK_SHORT ); + SETCONST( pWeekDay, "DAYOFWEEK_LONG", DAYOFWEEK_LONG ); + + return pWeekDay; +} + +/************************************************************************* +|* +|* RscTypCont::InitMonthFormatType() +|* +|* Beschreibung +|* Ersterstellung MM 22.03.91 +|* Letzte Aenderung MM 27.06.91 +|* +*************************************************************************/ +RscEnum * RscTypCont::InitMonthFormatType() +{ + RscEnum * pMonth; + pMonth = new RscEnum( pHS->Insert( "EnumMonthFormat" ), RSC_NOTYPE ); + + SETCONST( pMonth, "MONTH_NORMAL", MONTH_NORMAL ); + SETCONST( pMonth, "MONTH_ZERO", MONTH_ZERO ); + SETCONST( pMonth, "MONTH_SHORT", MONTH_SHORT ); + SETCONST( pMonth, "MONTH_LONG", MONTH_LONG ); + + return pMonth; +} + +/************************************************************************* +|* +|* RscTypCont::InitFieldUnitsType() +|* +|* Beschreibung +|* Ersterstellung MM 22.03.91 +|* Letzte Aenderung MM 27.06.91 +|* +*************************************************************************/ +RscEnum * RscTypCont::InitFieldUnitsType() +{ + RscEnum * pFieldUnits; + pFieldUnits = new RscEnum( pHS->Insert( "EnumFieldUnit" ), RSC_NOTYPE ); + + SETCONST( pFieldUnits, "FUNIT_NONE", FUNIT_NONE ); + SETCONST( pFieldUnits, "FUNIT_MM", FUNIT_MM ); + SETCONST( pFieldUnits, "FUNIT_CM", FUNIT_CM ); + SETCONST( pFieldUnits, "FUNIT_M", FUNIT_M ); + SETCONST( pFieldUnits, "FUNIT_KM", FUNIT_KM ); + SETCONST( pFieldUnits, "FUNIT_TWIP", FUNIT_TWIP ); + SETCONST( pFieldUnits, "FUNIT_POINT", FUNIT_POINT ); + SETCONST( pFieldUnits, "FUNIT_PICA", FUNIT_PICA ); + SETCONST( pFieldUnits, "FUNIT_INCH", FUNIT_INCH ); + SETCONST( pFieldUnits, "FUNIT_FOOT", FUNIT_FOOT ); + SETCONST( pFieldUnits, "FUNIT_MILE", FUNIT_MILE ); + SETCONST( pFieldUnits, "FUNIT_CUSTOM", FUNIT_CUSTOM ); + + return pFieldUnits; +} + +/************************************************************************* +|* +|* RscTypCont::InitDayOfWeekType() +|* +|* Beschreibung +|* Ersterstellung MM 22.03.91 +|* Letzte Aenderung MM 27.06.91 +|* +*************************************************************************/ +RscEnum * RscTypCont::InitDayOfWeekType() +{ + RscEnum * pDayOfWeek; + pDayOfWeek = new RscEnum( pHS->Insert( "EnumDayOfWeek" ), RSC_NOTYPE ); + + SETCONST( pDayOfWeek, "MONDAY", MONDAY ); + SETCONST( pDayOfWeek, "TUESDAY", TUESDAY ); + SETCONST( pDayOfWeek, "WEDNESDAY", WEDNESDAY ); + SETCONST( pDayOfWeek, "THURSDAY", THURSDAY ); + SETCONST( pDayOfWeek, "FRIDAY", FRIDAY ); + SETCONST( pDayOfWeek, "SATURDAY", SATURDAY ); + SETCONST( pDayOfWeek, "SUNDAY", SUNDAY ); + + return pDayOfWeek; +} + +/************************************************************************* +|* +|* RscTypCont::InitTimeFieldFormat() +|* +|* Beschreibung +|* Ersterstellung MM 22.03.91 +|* Letzte Aenderung MM 27.06.91 +|* +*************************************************************************/ +RscEnum * RscTypCont::InitTimeFieldFormat() +{ + RscEnum * pTimeFieldFormat; + pTimeFieldFormat = new RscEnum( pHS->Insert( "EnumTimeFieldFormat" ), + RSC_NOTYPE ); + + SETCONST( pTimeFieldFormat, "TIMEF_NONE", TIMEF_NONE ); + SETCONST( pTimeFieldFormat, "TIMEF_SEC", TIMEF_SEC ); + SETCONST( pTimeFieldFormat, "TIMEF_100TH_SEC", TIMEF_100TH_SEC ); + + return pTimeFieldFormat; +} + +/************************************************************************* +|* +|* RscTypCont::InitColor() +|* +|* Beschreibung +|* Ersterstellung MM 24.05.91 +|* Letzte Aenderung MM 24.05.91 +|* +*************************************************************************/ +RscEnum * RscTypCont::InitColor(){ + RscEnum * pColor; + pColor = new RscEnum( pHS->Insert( "EnumColor" ), RSC_NOTYPE ); + + SETCONST( pColor, "COL_BLACK", COL_BLACK ); + SETCONST( pColor, "COL_BLUE", COL_BLUE ); + SETCONST( pColor, "COL_GREEN", COL_GREEN ); + SETCONST( pColor, "COL_CYAN", COL_CYAN ); + SETCONST( pColor, "COL_RED", COL_RED ); + SETCONST( pColor, "COL_MAGENTA", COL_MAGENTA ); + SETCONST( pColor, "COL_BROWN", COL_BROWN ); + SETCONST( pColor, "COL_GRAY", COL_GRAY ); + SETCONST( pColor, "COL_LIGHTGRAY", COL_LIGHTGRAY ); + SETCONST( pColor, "COL_LIGHTBLUE", COL_LIGHTBLUE ); + SETCONST( pColor, "COL_LIGHTGREEN", COL_LIGHTGREEN ); + SETCONST( pColor, "COL_LIGHTCYAN", COL_LIGHTCYAN ); + SETCONST( pColor, "COL_LIGHTRED", COL_LIGHTRED ); + SETCONST( pColor, "COL_LIGHTMAGENTA", COL_LIGHTMAGENTA ); + SETCONST( pColor, "COL_YELLOW", COL_YELLOW ); + SETCONST( pColor, "COL_WHITE", COL_WHITE ); + + return( pColor ); +} + +/************************************************************************* +|* +|* RscTypCont::InitMapUnit() +|* +|* Beschreibung +|* Ersterstellung MM 24.05.91 +|* Letzte Aenderung MM 24.05.91 +|* +*************************************************************************/ +RscEnum * RscTypCont::InitMapUnit(){ + RscEnum * pMapUnit; + pMapUnit = new RscEnum( pHS->Insert( "EnumMapUnit" ), RSC_NOTYPE ); + + SETCONST( pMapUnit, "MAP_PIXEL", MAP_PIXEL ); + SETCONST( pMapUnit, "MAP_SYSFONT", MAP_SYSFONT ); + SETCONST( pMapUnit, "MAP_100TH_MM", MAP_100TH_MM ); + SETCONST( pMapUnit, "MAP_10TH_MM", MAP_10TH_MM ); + SETCONST( pMapUnit, "MAP_MM", MAP_MM ); + SETCONST( pMapUnit, "MAP_CM", MAP_CM ); + SETCONST( pMapUnit, "MAP_1000TH_INCH", MAP_1000TH_INCH ); + SETCONST( pMapUnit, "MAP_100TH_INCH", MAP_100TH_INCH ); + SETCONST( pMapUnit, "MAP_10TH_INCH", MAP_10TH_INCH ); + SETCONST( pMapUnit, "MAP_INCH", MAP_INCH ); + SETCONST( pMapUnit, "MAP_POINT", MAP_POINT ); + SETCONST( pMapUnit, "MAP_TWIP", MAP_TWIP ); + SETCONST( pMapUnit, "MAP_APPFONT", MAP_APPFONT ); + SETCONST( pMapUnit, "MAP_SV", RSC_EXTRAMAPUNIT ); + return( pMapUnit ); +} + +/************************************************************************* +|* +|* RscTypCont::InitKey() +|* +|* Beschreibung +|* Ersterstellung MM 24.05.91 +|* Letzte Aenderung MM 24.05.91 +|* +*************************************************************************/ +RscEnum * RscTypCont::InitKey(){ + RscEnum * pKey; + pKey = new RscEnum( pHS->Insert( "EnumKey" ), RSC_NOTYPE ); + + SETCONST( pKey, "KEY_0", KEY_0 ); + SETCONST( pKey, "KEY_1", KEY_1 ); + SETCONST( pKey, "KEY_2", KEY_2 ); + SETCONST( pKey, "KEY_3", KEY_3 ); + SETCONST( pKey, "KEY_4", KEY_4 ); + SETCONST( pKey, "KEY_5", KEY_5 ); + SETCONST( pKey, "KEY_6", KEY_6 ); + SETCONST( pKey, "KEY_7", KEY_7 ); + SETCONST( pKey, "KEY_8", KEY_8 ); + SETCONST( pKey, "KEY_9", KEY_9 ); + + SETCONST( pKey, "KEY_A", KEY_A ); + SETCONST( pKey, "KEY_B", KEY_B ); + SETCONST( pKey, "KEY_C", KEY_C ); + SETCONST( pKey, "KEY_D", KEY_D ); + SETCONST( pKey, "KEY_E", KEY_E ); + SETCONST( pKey, "KEY_F", KEY_F ); + SETCONST( pKey, "KEY_G", KEY_G ); + SETCONST( pKey, "KEY_H", KEY_H ); + SETCONST( pKey, "KEY_I", KEY_I ); + SETCONST( pKey, "KEY_J", KEY_J ); + SETCONST( pKey, "KEY_K", KEY_K ); + SETCONST( pKey, "KEY_L", KEY_L ); + SETCONST( pKey, "KEY_M", KEY_M ); + SETCONST( pKey, "KEY_N", KEY_N ); + SETCONST( pKey, "KEY_O", KEY_O ); + SETCONST( pKey, "KEY_P", KEY_P ); + SETCONST( pKey, "KEY_Q", KEY_Q ); + SETCONST( pKey, "KEY_R", KEY_R ); + SETCONST( pKey, "KEY_S", KEY_S ); + SETCONST( pKey, "KEY_T", KEY_T ); + SETCONST( pKey, "KEY_U", KEY_U ); + SETCONST( pKey, "KEY_V", KEY_V ); + SETCONST( pKey, "KEY_W", KEY_W ); + SETCONST( pKey, "KEY_X", KEY_X ); + SETCONST( pKey, "KEY_Y", KEY_Y ); + SETCONST( pKey, "KEY_Z", KEY_Z ); + + SETCONST( pKey, "KEY_F1", KEY_F1 ); + SETCONST( pKey, "KEY_F2", KEY_F2 ); + SETCONST( pKey, "KEY_F3", KEY_F3 ); + SETCONST( pKey, "KEY_F4", KEY_F4 ); + SETCONST( pKey, "KEY_F5", KEY_F5 ); + SETCONST( pKey, "KEY_F6", KEY_F6 ); + SETCONST( pKey, "KEY_F7", KEY_F7 ); + SETCONST( pKey, "KEY_F8", KEY_F8 ); + SETCONST( pKey, "KEY_F9", KEY_F9 ); + SETCONST( pKey, "KEY_F10", KEY_F10 ); + SETCONST( pKey, "KEY_F11", KEY_F11 ); + SETCONST( pKey, "KEY_F12", KEY_F12 ); + SETCONST( pKey, "KEY_F13", KEY_F13 ); + SETCONST( pKey, "KEY_F14", KEY_F14 ); + SETCONST( pKey, "KEY_F15", KEY_F15 ); + SETCONST( pKey, "KEY_F16", KEY_F16 ); + SETCONST( pKey, "KEY_F17", KEY_F17 ); + SETCONST( pKey, "KEY_F18", KEY_F18 ); + SETCONST( pKey, "KEY_F19", KEY_F19 ); + SETCONST( pKey, "KEY_F20", KEY_F20 ); + SETCONST( pKey, "KEY_F21", KEY_F21 ); + SETCONST( pKey, "KEY_F22", KEY_F22 ); + SETCONST( pKey, "KEY_F23", KEY_F23 ); + SETCONST( pKey, "KEY_F24", KEY_F24 ); + SETCONST( pKey, "KEY_F25", KEY_F25 ); + SETCONST( pKey, "KEY_F26", KEY_F26 ); + + SETCONST( pKey, "KEY_DOWN", KEY_DOWN ); + SETCONST( pKey, "KEY_UP", KEY_UP ); + SETCONST( pKey, "KEY_LEFT", KEY_LEFT ); + SETCONST( pKey, "KEY_RIGHT", KEY_RIGHT ); + SETCONST( pKey, "KEY_HOME", KEY_HOME ); + SETCONST( pKey, "KEY_END", KEY_END ); + SETCONST( pKey, "KEY_PAGEUP", KEY_PAGEUP ); + SETCONST( pKey, "KEY_PAGEDOWN", KEY_PAGEDOWN ); + + SETCONST( pKey, "KEY_RETURN", KEY_RETURN ); + SETCONST( pKey, "KEY_ESCAPE", KEY_ESCAPE ); + SETCONST( pKey, "KEY_TAB", KEY_TAB ); + SETCONST( pKey, "KEY_BACKSPACE", KEY_BACKSPACE ); + SETCONST( pKey, "KEY_SPACE", KEY_SPACE ); + SETCONST( pKey, "KEY_INSERT", KEY_INSERT ); + SETCONST( pKey, "KEY_DELETE", KEY_DELETE ); + + SETCONST( pKey, "KEY_ADD", KEY_ADD ); + SETCONST( pKey, "KEY_SUBTRACT", KEY_SUBTRACT ); + SETCONST( pKey, "KEY_MULTIPLY", KEY_MULTIPLY ); + SETCONST( pKey, "KEY_DIVIDE", KEY_DIVIDE ); + SETCONST( pKey, "KEY_POINT", KEY_POINT ); + SETCONST( pKey, "KEY_COMMA", KEY_COMMA ); + SETCONST( pKey, "KEY_LESS", KEY_LESS ); + SETCONST( pKey, "KEY_GREATER", KEY_GREATER ); + SETCONST( pKey, "KEY_EQUAL", KEY_EQUAL ); + + SETCONST( pKey, "KEY_OPEN", KEY_OPEN ); + SETCONST( pKey, "KEY_CUT", KEY_CUT ); + SETCONST( pKey, "KEY_COPY", KEY_COPY ); + SETCONST( pKey, "KEY_PASTE", KEY_PASTE ); + SETCONST( pKey, "KEY_UNDO", KEY_UNDO ); + SETCONST( pKey, "KEY_REPEAT", KEY_REPEAT ); + SETCONST( pKey, "KEY_FIND", KEY_FIND ); + SETCONST( pKey, "KEY_PROPERTIES", KEY_PROPERTIES ); + SETCONST( pKey, "KEY_FRONT", KEY_FRONT ); + + return( pKey ); +} + +/************************************************************************* +|* +|* RscTypCont::InitTriState() +|* +|* Beschreibung +|* Ersterstellung MM 26.11.91 +|* Letzte Aenderung MM 26.11.91 +|* +*************************************************************************/ +RscEnum * RscTypCont::InitTriState(){ + RscEnum * pTriState; + pTriState = new RscEnum( pHS->Insert( "EnumTriState" ), RSC_NOTYPE ); + + SETCONST( pTriState, "STATE_NOCHECK", STATE_NOCHECK ); + SETCONST( pTriState, "STATE_CHECK", STATE_CHECK ); + SETCONST( pTriState, "STATE_DONTKNOW", STATE_DONTKNOW ); + + return( pTriState ); +} + +/************************************************************************* +|* +|* RscTypCont::InitMessButtons() +|* +|* Beschreibung +|* Ersterstellung MM 24.05.91 +|* Letzte Aenderung MM 24.05.91 +|* +*************************************************************************/ +RscEnum * RscTypCont::InitMessButtons(){ + RscEnum * pMessButtons; + pMessButtons = new RscEnum( pHS->Insert( "EnumMessButtons" ), RSC_NOTYPE, FALSE ); + SETCONST( pMessButtons, "WB_OK", WB_OK ); + SETCONST( pMessButtons, "WB_OK_CANCEL", WB_OK_CANCEL ); + SETCONST( pMessButtons, "WB_YES_NO", WB_YES_NO ); + SETCONST( pMessButtons, "WB_YES_NO_CANCEL", WB_YES_NO_CANCEL ); + SETCONST( pMessButtons, "WB_RETRY_CANCEL", WB_RETRY_CANCEL ); + return( pMessButtons ); +} + +/************************************************************************* +|* +|* RscTypCont::InitMessDefButton() +|* +|* Beschreibung +|* Ersterstellung MM 24.05.91 +|* Letzte Aenderung MM 24.05.91 +|* +*************************************************************************/ +RscEnum * RscTypCont::InitMessDefButton(){ + RscEnum * pMessDefButton; + pMessDefButton = new RscEnum( pHS->Insert( "EnumMessDefButton" ), + RSC_NOTYPE, FALSE ); + + SETCONST( pMessDefButton, "WB_DEF_OK", WB_DEF_OK ); + SETCONST( pMessDefButton, "WB_DEF_CANCEL", WB_DEF_CANCEL ); + SETCONST( pMessDefButton, "WB_DEF_RETRY", WB_DEF_RETRY ); + SETCONST( pMessDefButton, "WB_DEF_YES", WB_DEF_YES ); + SETCONST( pMessDefButton, "WB_DEF_NO", WB_DEF_NO ); + return( pMessDefButton ); +} + +/************************************************************************* +|* +|* RscTypCont::InitGeometry() +|* +|* Beschreibung +|* Ersterstellung MM 24.05.91 +|* Letzte Aenderung MM 24.05.91 +|* +*************************************************************************/ +RscTupel * RscTypCont::InitGeometry() +{ + RscTop * pTupel; + HASHID nId; + + // Clientvariablen einfuegen + pTupel = new RscTupel( pHS->Insert( "TupelDeltaSystem" ), + RSC_NOTYPE, NULL ); + nId = aNmTb.Put( "X", VARNAME ); + pTupel->SetVariable( nId, &aShort ); + nId = aNmTb.Put( "Y", VARNAME ); + pTupel->SetVariable( nId, &aShort ); + nId = aNmTb.Put( "WIDTH", VARNAME ); + pTupel->SetVariable( nId, &aShort ); + nId = aNmTb.Put( "HEIGHT", VARNAME ); + pTupel->SetVariable( nId, &aShort ); + + return (RscTupel *)pTupel; +} + +/************************************************************************* +|* +|* RscTypCont::InitLangGeometry() +|* +|* Beschreibung +|* Ersterstellung MM 24.05.91 +|* Letzte Aenderung MM 24.05.91 +|* +*************************************************************************/ +RscArray * RscTypCont::InitLangGeometry( RscTupel * pGeo ) +{ + return new RscArray( pHS->Insert( "Lang_TupelGeometry" ), + RSC_NOTYPE, pGeo, &aLangType, + &nLangTypeId, &nDfltLangTypeId ); +} + +/************************************************************************* +|* +|* RscTypCont::InitStringList() +|* +|* Beschreibung +|* Ersterstellung MM 24.05.91 +|* Letzte Aenderung MM 24.05.91 +|* +*************************************************************************/ +RscCont * RscTypCont::InitStringList() +{ + RscCont * pCont; + + pCont = new RscCont( pHS->Insert( "Chars[]" ), RSC_NOTYPE ); + pCont->SetTypeClass( &aString ); + + return pCont; +} + +/************************************************************************* +|* +|* RscTypCont::InitLangStringList() +|* +|* Beschreibung +|* Ersterstellung MM 24.05.91 +|* Letzte Aenderung MM 24.05.91 +|* +*************************************************************************/ +RscArray * RscTypCont::InitLangStringList( RscCont * pStrLst ) +{ + return new RscArray( pHS->Insert( "Lang_CharsList" ), + RSC_NOTYPE, pStrLst, &aLangType, + &nLangTypeId, &nDfltLangTypeId ); +} + +/************************************************************************* +|* +|* RscTypCont::InitStringTupel() +|* +|* Beschreibung +|* Ersterstellung MM 24.05.91 +|* Letzte Aenderung MM 24.05.91 +|* +*************************************************************************/ +RscTupel * RscTypCont::InitStringTupel() +{ + RscTop * pTupel; + HASHID nId; + + // Clientvariablen einfuegen + pTupel = new RscTupel( pHS->Insert( "CharsTupel" ), + RSC_NOTYPE, NULL ); + nId = aNmTb.Put( "FILTER", VARNAME ); + pTupel->SetVariable( nId, &aString ); + nId = aNmTb.Put( "MASK", VARNAME ); + pTupel->SetVariable( nId, &aString ); + + return (RscTupel *)pTupel; +} + +/************************************************************************* +|* +|* RscTypCont::InitStringLongTupel() +|* +|* Beschreibung +|* Ersterstellung MM 18.07.94 +|* Letzte Aenderung MM 18.07.94 +|* +*************************************************************************/ +RscTupel * RscTypCont::InitStringLongTupel() +{ + RscTop * pTupel; + HASHID nId; + + // Clientvariablen einfuegen + pTupel = new RscTupel( pHS->Insert( "CharsLongTupel" ), RSC_NOTYPE, NULL ); + nId = aNmTb.Put( "ItemText", VARNAME ); + pTupel->SetVariable( nId, &aString ); + nId = aNmTb.Put( "ItemId", VARNAME ); + pTupel->SetVariable( nId, &aEnumLong ); + + return (RscTupel *)pTupel; +} + +/************************************************************************* +|* +|* RscTypCont::InitStringTupelList() +|* +|* Beschreibung +|* Ersterstellung MM 24.05.91 +|* Letzte Aenderung MM 24.05.91 +|* +*************************************************************************/ +RscCont * RscTypCont::InitStringTupelList( RscTupel * pTupelString ) +{ + RscCont * pCont; + + pCont = new RscCont( pHS->Insert( "CharsCharsTupel[]" ), RSC_NOTYPE ); + pCont->SetTypeClass( pTupelString ); + + return pCont; +} + +/************************************************************************* +|* +|* RscTypCont::InitStringLongTupelList() +|* +|* Beschreibung +|* Ersterstellung MM 24.05.91 +|* Letzte Aenderung MM 24.05.91 +|* +*************************************************************************/ +RscCont * RscTypCont::InitStringLongTupelList( RscTupel * pStringLong ) +{ + RscCont * pCont; + + pCont = new RscCont( pHS->Insert( "CharsLongTupel[]" ), RSC_NOTYPE ); + pCont->SetTypeClass( pStringLong ); + + return pCont; +} + +/************************************************************************* +|* +|* RscTypCont::InitLangStringTupelList() +|* +|* Beschreibung +|* Ersterstellung MM 24.05.91 +|* Letzte Aenderung MM 24.05.91 +|* +*************************************************************************/ +RscArray * RscTypCont::InitLangStringTupelList( RscCont * pStrTupelLst ) +{ + return new RscArray( pHS->Insert( "Lang_CharsCharsTupel" ), + RSC_NOTYPE, pStrTupelLst, &aLangType, + &nLangTypeId, &nDfltLangTypeId ); +} + +/************************************************************************* +|* +|* RscTypCont::InitLangStringLongTupelList() +|* +|* Beschreibung +|* Ersterstellung MM 24.05.91 +|* Letzte Aenderung MM 24.05.91 +|* +*************************************************************************/ +RscArray * RscTypCont::InitLangStringLongTupelList( RscCont * pStrLongTupelLst ) +{ + return new RscArray( pHS->Insert( "Lang_CharsLongTupelList" ), + RSC_NOTYPE, pStrLongTupelLst, &aLangType, + &nLangTypeId, &nDfltLangTypeId ); +} + diff --git a/rsc/source/parser/rscicpx.cxx b/rsc/source/parser/rscicpx.cxx new file mode 100644 index 000000000000..a632db4d8043 --- /dev/null +++ b/rsc/source/parser/rscicpx.cxx @@ -0,0 +1,2483 @@ +/************************************************************************* + * + * $RCSfile: rscicpx.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: hr $ $Date: 2000-09-18 16:42:55 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +/****************** I N C L U D E S **************************************/ +#pragma hdrstop + +// C and C++ Includes. +#include +#include + +#include +#include + +#ifndef _RSCMGR_HXX +#include +#endif +#ifndef _RSCCLASS_HXX +#include +#endif +#ifndef _RSCCONT_HXX +#include +#endif +#ifndef _RSCDB_HXX +#include +#endif +#ifndef _RSCSFX_HXX +#include +#endif + +#include "rsclex.hxx" +#include + +/************************************************************************* +|* RscTypCont::InsWinBit() +*************************************************************************/ +void RscTypCont::InsWinBit( RscTop * pClass, const ByteString & rName, + HASHID nVal ) +{ + RscClient * pClient; + + // Clientvariablen einfuegen + aBaseLst.Insert( + pClient = new RscClient( pHS->Insert( "BOOL" ), RSC_NOTYPE, + &aWinBits, nVal ), + LIST_APPEND ); + HASHID nId = aNmTb.Put( rName.GetBuffer(), VARNAME ); + pClass->SetVariable( nId, pClient, NULL, + VAR_NODATAINST, 0, nWinBitVarId ); +} + +#define INS_WINBIT( pClass, WinBit ) \ + InsWinBit( pClass, #WinBit, n##WinBit##Id ); + +/************************************************************************* +|* RscTypCont::InitClassMgr() +*************************************************************************/ +RscTop * RscTypCont::InitClassMgr() +{ + RscTop * pClassMgr; + RscBaseCont * pClass; + HASHID nId; + + aBaseLst.Insert( pClass = + new RscBaseCont( HASH_NONAME, RSC_NOTYPE, NULL, FALSE ), + LIST_APPEND ); + + nId = pHS->Insert( "Resource" ); + pClassMgr = new RscMgr( nId, RSC_RESOURCE, pClass ); + aNmTb.Put( nId, CLASSNAME, pClassMgr ); + pClassMgr->SetCallPar( *pStdPar1, *pStdPar2, *pStdParType ); + + // Variablen anlegen + { + RscContWriteSrc * pCont; + + // Variablen anlegen + aBaseLst.Insert( + pCont = new RscContExtraData( pHS->Insert( "ContExtradata" ), + RSC_NOTYPE ), + LIST_APPEND ); + pCont->SetTypeClass( &aShort, &aString ); + nRsc_EXTRADATA = nId = aNmTb.Put( "ExtraData", VARNAME ); + pClassMgr->SetVariable( nId, pCont ); + }; + nId = aNmTb.Put( "Comment", VARNAME ); + pClassMgr->SetVariable( nId, &aString, NULL, VAR_NORC ); + + pClass->SetTypeClass( pClassMgr ); + + return pClassMgr; +} + +/************************************************************************* +|* RscTypCont::InitClassString() +*************************************************************************/ +RscTop * RscTypCont::InitClassString( RscTop * pSuper ){ + HASHID nId; + RscTop * pClassString; + + nId = pHS->Insert( "String" ); + pClassString = new RscClass( nId, RSC_STRING, pSuper ); + aNmTb.Put( nId, CLASSNAME, pClassString ); + pClassString->SetCallPar( *pStdPar1, *pStdPar2, *pStdParType ); + + // Variablen anlegen + nId = aNmTb.Put( "Text", VARNAME ); + pClassString->SetVariable( nId, &aLangString ); + return( pClassString ); +} + +/************************************************************************* +|* RscTypCont::InitClassBitmap() +*************************************************************************/ +RscTop * RscTypCont::InitClassBitmap( RscTop * pSuper ){ + HASHID nId; + RscTop * pClassBitmap; + + nId = pHS->Insert( "Bitmap" ); + pClassBitmap = new RscSysDepend( nId, RSC_BITMAP, pSuper ); + pClassBitmap->SetCallPar( *pStdPar1, *pStdPar2, *pStdParType ); + aNmTb.Put( nId, CLASSNAME, pClassBitmap ); + + // Die Klasse RscSysDepend behandelt die Variablen + // "FILE" gesondert + nId = aNmTb.Put( "File", VARNAME ); + pClassBitmap->SetVariable( nId, &aLangString, NULL, VAR_NORC ); + + return( pClassBitmap ); +} + +/************************************************************************* +|* RscTypCont::InitClassColor() +*************************************************************************/ +RscTop * RscTypCont::InitClassColor( RscTop * pSuper, RscEnum * pColor ){ + HASHID nId; + RscTop * pClassColor; + + // Klasse anlegen + nId = pHS->Insert( "Color" ); + pClassColor = new RscClass( nId, RSC_COLOR, pSuper ); + pClassColor->SetCallPar( *pStdPar1, *pStdPar2, *pStdParType ); + aNmTb.Put( nId, CLASSNAME, pClassColor ); + + // Variablen anlegen + nId = aNmTb.Put( "Red", VARNAME ); + pClassColor->SetVariable( nId, &aUShort ); + nId = aNmTb.Put( "Green", VARNAME ); + pClassColor->SetVariable( nId, &aUShort ); + nId = aNmTb.Put( "Blue", VARNAME ); + pClassColor->SetVariable( nId, &aUShort ); + nId = aNmTb.Put( "Predefine", VARNAME ); + pClassColor->SetVariable( nId, pColor ); + + return( pClassColor ); +} + +/************************************************************************* +|* RscTypCont::InitClassImage() +*************************************************************************/ +RscTop * RscTypCont::InitClassImage( RscTop * pSuper, RscTop * pClassBitmap, + RscTop * pClassColor ) +{ + HASHID nId; + RscTop * pClassImage; + + // Klasse anlegen + nId = pHS->Insert( "Image" ); + pClassImage = new RscClass( nId, RSC_IMAGE, pSuper ); + pClassImage->SetCallPar( *pStdPar1, *pStdPar2, *pStdParType ); + aNmTb.Put( nId, CLASSNAME, pClassImage ); + + // Variablen anlegen + nId = aNmTb.Put( "ImageBitmap", VARNAME ); + pClassImage->SetVariable( nId, pClassBitmap, NULL, 0, RSC_IMAGE_IMAGEBITMAP ); + nId = aNmTb.Put( "MaskBitmap", VARNAME ); + pClassImage->SetVariable( nId, pClassBitmap, NULL, 0, RSC_IMAGE_MASKBITMAP ); + nId = aNmTb.Put( "MaskColor", VARNAME ); + pClassImage->SetVariable( nId, pClassColor, NULL, + VAR_SVDYNAMIC, RSC_IMAGE_MASKCOLOR ); + + return( pClassImage ); +} + +/************************************************************************* +|* RscTypCont::InitClassImageList() +*************************************************************************/ +RscTop * RscTypCont::InitClassImageList( RscTop * pSuper, RscTop * pClassBitmap, + RscTop * pClassColor ) +{ + HASHID nId; + RscTop * pClassImageList; + + // Klasse anlegen + nId = pHS->Insert( "ImageList" ); + pClassImageList = new RscClass( nId, RSC_IMAGELIST, pSuper ); + pClassImageList->SetCallPar( *pStdPar1, *pStdPar2, *pStdParType ); + aNmTb.Put( nId, CLASSNAME, pClassImageList ); + + // Variablen anlegen + nId = aNmTb.Put( "ImageBitmap", VARNAME ); + pClassImageList->SetVariable( nId, pClassBitmap, NULL, 0, + RSC_IMAGELIST_IMAGEBITMAP ); + nId = aNmTb.Put( "MaskBitmap", VARNAME ); + pClassImageList->SetVariable( nId, pClassBitmap, NULL, 0, + RSC_IMAGELIST_MASKBITMAP ); + nId = aNmTb.Put( "MaskColor", VARNAME ); + pClassImageList->SetVariable( nId, pClassColor, NULL, + VAR_SVDYNAMIC, RSC_IMAGELIST_MASKCOLOR ); + { + RscCont * pCont; + + pCont = new RscCont( pHS->Insert( "USHORT *" ), RSC_NOTYPE ); + pCont->SetTypeClass( &aIdUShort ); + aBaseLst.Insert( pCont, LIST_APPEND ); + + nId = aNmTb.Put( "IdList", VARNAME ); + pClassImageList->SetVariable( nId, pCont, NULL, 0, + RSC_IMAGELIST_IDLIST ); + } + nId = aNmTb.Put( "IdCount", VARNAME ); + pClassImageList->SetVariable( nId, &aUShort, NULL, 0, + RSC_IMAGELIST_IDCOUNT ); + return( pClassImageList ); +} + +/************************************************************************* +|* RscTypCont::InitClassWindow() +*************************************************************************/ +RscTop * RscTypCont::InitClassWindow( RscTop * pSuper, RscEnum * pMapUnit, + RscArray * pLangGeo ) +{ + HASHID nId; + RscTop * pClassWindow; + + // Klasse anlegen + nId = pHS->Insert( "Window" ); + pClassWindow = new RscClass( nId, RSC_WINDOW, pSuper ); + pClassWindow->SetCallPar( *pWinPar1, *pWinPar2, *pWinParType ); + aNmTb.Put( nId, CLASSNAME, pClassWindow ); + + // Variablen anlegen + { + RscFlag * pFlag; + RscClient * pClient; + HASHID nVarId, nDisableId, nOutputSizeId; + + aBaseLst.Insert( pFlag = new RscFlag( pHS->Insert( "FlagWndExtra" ), + RSC_NOTYPE ), + LIST_APPEND ); + + // Konstanten in Tabelle stellen + nDisableId = pHS->Insert( "RSWND_DISABLE" ); + SETCONST( pFlag, nDisableId, RSWND_DISABLED ); + nOutputSizeId = pHS->Insert( "RSWND_OUTPUTSIZE" ); + SETCONST( pFlag, nOutputSizeId, RSWND_CLIENTSIZE ); + + // Variable einfuegen + nVarId = aNmTb.Put( "_RscExtraFlags", VARNAME ); + pClassWindow->SetVariable( nVarId, pFlag, NULL, + VAR_HIDDEN | VAR_NOENUM ); + + aBaseLst.Insert( + pClient = new RscClient( pHS->Insert( "BOOL" ), RSC_NOTYPE, + pFlag, nDisableId ), + LIST_APPEND ); + nId = aNmTb.Put( "Disable", VARNAME ); + pClassWindow->SetVariable( nId, pClient, NULL, + VAR_NODATAINST, 0, nVarId ); + + aBaseLst.Insert( + pClient = new RscClient( pHS->Insert( "BOOL" ), RSC_NOTYPE, + pFlag, nOutputSizeId ), + LIST_APPEND ); + nId = aNmTb.Put( "OutputSize", VARNAME ); + pClassWindow->SetVariable( nId, pClient, NULL, + VAR_NODATAINST, 0, nVarId ); + } + + pClassWindow->SetVariable( nWinBitVarId, &aWinBits, NULL, + VAR_HIDDEN | VAR_NOENUM ); + + INS_WINBIT(pClassWindow,Border) + INS_WINBIT(pClassWindow,Hide) + INS_WINBIT(pClassWindow,ClipChildren) + INS_WINBIT(pClassWindow,SVLook) + InsWinBit( pClassWindow, "DialogControl", nTabControlId ); + + nId = aNmTb.Put( "HelpID", VARNAME ); + pClassWindow->SetVariable( nId, &aIdLong ); + + + nRsc_XYMAPMODEId = nId = aNmTb.Put( "_XYMapMode", VARNAME ); + pClassWindow->SetVariable( nId, pMapUnit, NULL, 0, WINDOW_XYMAPMODE ); + nRsc_X = nId = aNmTb.Put( "_X", VARNAME ); + pClassWindow->SetVariable( nId, &aLong, NULL, 0, WINDOW_X ); + nRsc_Y = nId = aNmTb.Put( "_Y", VARNAME ); + pClassWindow->SetVariable( nId, &aLong, NULL, 0, WINDOW_Y ); + + nRsc_WHMAPMODEId = nId = aNmTb.Put( "_WHMapMode", VARNAME ); + pClassWindow->SetVariable( nId, pMapUnit, NULL, 0, WINDOW_WHMAPMODE ); + nRsc_WIDTH = nId = aNmTb.Put( "_Width", VARNAME ); + pClassWindow->SetVariable( nId, &aLong, NULL, 0, WINDOW_WIDTH ); + nRsc_HEIGHT = nId = aNmTb.Put( "_Height", VARNAME ); + pClassWindow->SetVariable( nId, &aLong, NULL, 0, WINDOW_HEIGHT ); + + nRsc_DELTALANG = nId = aNmTb.Put( "DeltaLang", VARNAME ); + pClassWindow->SetVariable( nId, pLangGeo, NULL, VAR_NORC | VAR_NOENUM); + nId = aNmTb.Put( "Text", VARNAME ); + pClassWindow->SetVariable( nId, &aLangString, NULL, 0, WINDOW_TEXT ); + nId = aNmTb.Put( "HelpText", VARNAME ); + pClassWindow->SetVariable( nId, &aLangString, NULL, 0, WINDOW_HELPTEXT ); + nId = aNmTb.Put( "QuickHelpText", VARNAME ); + pClassWindow->SetVariable( nId, &aLangString, NULL, 0, WINDOW_QUICKTEXT ); + nId = aNmTb.Put( "ExtraLong", VARNAME ); + pClassWindow->SetVariable( nId, &aLong, NULL, 0, WINDOW_EXTRALONG ); + nId = aNmTb.Put( "UniqueId", VARNAME ); + pClassWindow->SetVariable( nId, &aLong, NULL, 0, WINDOW_UNIQUEID ); + + return( pClassWindow ); +} + +/************************************************************************* +|* RscTypCont::InitClassSystemWindow() +*************************************************************************/ +RscTop * RscTypCont::InitClassSystemWindow( RscTop * pSuper ) +{ + HASHID nId; + RscTop * pClassSystemWindow; + + // Klasse anlegen + nId = pHS->Insert( "SystemWindow" ); + pClassSystemWindow = new RscClass( nId, RSC_SYSWINDOW, pSuper ); + pClassSystemWindow->SetCallPar( *pWinPar1, *pWinPar2, *pWinParType ); + aNmTb.Put( nId, CLASSNAME, pClassSystemWindow ); + + INS_WINBIT(pClassSystemWindow,Sizeable) + INS_WINBIT(pClassSystemWindow,Moveable) + InsWinBit( pClassSystemWindow, "Minable", nMinimizeId ); + InsWinBit( pClassSystemWindow, "Maxable", nMaximizeId ); + INS_WINBIT(pClassSystemWindow,Closeable) + INS_WINBIT(pClassSystemWindow,App) + + return pClassSystemWindow ; +} + +/************************************************************************* +|* RscTypCont::InitClassWorkWindow() +*************************************************************************/ +RscTop * RscTypCont::InitClassWorkWindow( RscTop * pSuper ) +{ + HASHID nId; + RscTop * pClassWorkWindow; + + // Klasse anlegen + nId = pHS->Insert( "WorkWindow" ); + pClassWorkWindow = new RscClass( nId, RSC_WORKWIN, pSuper ); + pClassWorkWindow->SetCallPar( *pWinPar1, *pWinPar2, *pWinParType ); + + aNmTb.Put( nId, CLASSNAME, pClassWorkWindow ); + + // Variablen anlegen + { + HASHID nVarId; + RscEnum * pShow; + + aBaseLst.Insert( pShow = new RscEnum( pHS->Insert( "EnumShowState" ), + RSC_NOTYPE ), + LIST_APPEND ); + + SETCONST( pShow, "SHOW_NORMAL", WORKWIN_SHOWNORMAL ); + SETCONST( pShow, "SHOW_MINIMIZED", WORKWIN_SHOWMINIMIZED ); + SETCONST( pShow, "SHOW_MAXIMIZED", WORKWIN_SHOWMAXIMIZED ); + + + // Variable einfuegen + nVarId = aNmTb.Put( "Show", VARNAME ); + pClassWorkWindow->SetVariable( nVarId, pShow, NULL ); + } + + return pClassWorkWindow; +} + +/************************************************************************* +|* RscTypCont::InitClassDialogBox() +*************************************************************************/ +RscTop * RscTypCont::InitClassModalDialog( RscTop * pSuper ) +{ + HASHID nId; + RscTop * pClassDialog; + + // Klasse anlegen + nId = pHS->Insert( "ModalDialog" ); + pClassDialog = new RscClass( nId, RSC_MODALDIALOG, pSuper ); + pClassDialog->SetCallPar( *pWinPar1, *pWinPar2, *pWinParType ); + aNmTb.Put( nId, CLASSNAME, pClassDialog ); + + InsWinBit( pClassDialog, "SysModal", nSysmodalId ); + + return pClassDialog; +} + +/************************************************************************* +|* RscTypCont::InitClassModelessDialog() +*************************************************************************/ +RscTop * RscTypCont::InitClassModelessDialog( RscTop * pSuper ) +{ + HASHID nId; + RscTop * pClassDialog; + + // Klasse anlegen + nId = pHS->Insert( "ModelessDialog" ); + pClassDialog = new RscClass( nId, RSC_MODELESSDIALOG, pSuper ); + pClassDialog->SetCallPar( *pWinPar1, *pWinPar2, *pWinParType ); + aNmTb.Put( nId, CLASSNAME, pClassDialog ); + + return pClassDialog; +} + +/************************************************************************* +|* RscTypCont::InitClassControl() +*************************************************************************/ +RscTop * RscTypCont::InitClassControl( RscTop * pSuper ) +{ + HASHID nId; + RscTop * pClassControl; + + // Klasse anlegen + nId = pHS->Insert( "Control" ); + pClassControl = new RscClass( nId, RSC_CONTROL, pSuper ); + pClassControl->SetCallPar( *pWinPar1, *pWinPar2, *pWinParType ); + aNmTb.Put( nId, CLASSNAME, pClassControl ); + + InsWinBit( pClassControl, "TabStop", nTabstopId ); + INS_WINBIT(pClassControl,Group) + + return pClassControl; +} + +/************************************************************************* +|* RscTypCont::InitClassPushButton() +*************************************************************************/ +RscTop * RscTypCont::InitClassPushButton( RscTop * pSuper ) +{ + HASHID nId; + RscTop * pClassPushButton; + + // Klasse anlegen + nId = pHS->Insert( "PushButton" ); + pClassPushButton = new RscClass( nId, RSC_PUSHBUTTON, pSuper ); + pClassPushButton->SetCallPar( *pWinPar1, *pWinPar2, *pWinParType ); + aNmTb.Put( nId, CLASSNAME, pClassPushButton ); + + InsWinBit( pClassPushButton, "DefButton", nDefaultId ); + + return pClassPushButton; +} + +/************************************************************************* +|* RscTypCont::InitClassTriStateBox() +*************************************************************************/ +RscTop * RscTypCont::InitClassTriStateBox( RscTop * pSuper, + RscEnum * pTriState ) +{ + HASHID nId; + RscTop * pClassTriStateBox; + + nId = pHS->Insert( "TriStateBox" ); + pClassTriStateBox = new RscClass( nId, RSC_TRISTATEBOX, pSuper ); + pClassTriStateBox->SetCallPar( *pWinPar1, *pWinPar2, *pWinParType ); + aNmTb.Put( nId, CLASSNAME, pClassTriStateBox ); + + // Variablen anlegen + nId = aNmTb.Put( "State", VARNAME ); + pClassTriStateBox->SetVariable( nId, pTriState ); + nId = aNmTb.Put( "TriStateDisable", VARNAME ); + pClassTriStateBox->SetVariable( nId, &aBool ); + + return( pClassTriStateBox ); +} + +/************************************************************************* +|* RscTypCont::InitClassMenuButton() +*************************************************************************/ +RscTop * RscTypCont::InitClassMenuButton( RscTop * pSuper, + RscTop * pClassMenu ) +{ + HASHID nId; + RscTop * pClassMenuButton; + + nId = pHS->Insert( "MenuButton" ); + pClassMenuButton = new RscClass( nId, RSC_MENUBUTTON, pSuper ); + pClassMenuButton->SetCallPar( *pWinPar1, *pWinPar2, *pWinParType ); + aNmTb.Put( nId, CLASSNAME, pClassMenuButton ); + + // Variablen anlegen + nId = aNmTb.Put( "ButtonMenu", VARNAME ); + pClassMenuButton->SetVariable( nId, pClassMenu, NULL, 0, + RSCMENUBUTTON_MENU ); + + return( pClassMenuButton ); +} + + +/************************************************************************* +|* RscTypCont::InitClassImageButton() +*************************************************************************/ +RscTop * RscTypCont::InitClassImageButton( RscTop * pSuper, + RscTop * pClassImage, + RscEnum * pTriState ) +{ + HASHID nId; + RscTop * pClassImageButton; + + // Klasse anlegen + nId = pHS->Insert( "ImageButton" ); + pClassImageButton = new RscClass( nId, RSC_IMAGEBUTTON, pSuper ); + pClassImageButton->SetCallPar( *pWinPar1, *pWinPar2, *pWinParType ); + aNmTb.Put( nId, CLASSNAME, pClassImageButton ); + + // Variablen anlegen + { + nId = aNmTb.Put( "ButtonImage", VARNAME ); + pClassImageButton->SetVariable( nId, pClassImage, NULL, 0, + RSC_IMAGEBUTTON_IMAGE ); + } + // Variablen anlegen + { + HASHID nVarId; + RscEnum * pSymbol; + + aBaseLst.Insert( pSymbol = new RscEnum( pHS->Insert( "EnumSymbolButton" ), + RSC_NOTYPE ), LIST_APPEND ); + + SETCONST( pSymbol, "IMAGEBUTTON_DONTKNOW", SYMBOL_DONTKNOW ); + SETCONST( pSymbol, "IMAGEBUTTON_IMAGE", SYMBOL_IMAGE ); + SETCONST( pSymbol, "IMAGEBUTTON_ARROW_UP", SYMBOL_ARROW_UP ); + SETCONST( pSymbol, "IMAGEBUTTON_ARROW_DOWN", SYMBOL_ARROW_DOWN ); + SETCONST( pSymbol, "IMAGEBUTTON_ARROW_LEFT", SYMBOL_ARROW_LEFT ); + SETCONST( pSymbol, "IMAGEBUTTON_ARROW_RIGHT", SYMBOL_ARROW_RIGHT ); + SETCONST( pSymbol, "IMAGEBUTTON_SPIN_UP", SYMBOL_SPIN_UP ); + SETCONST( pSymbol, "IMAGEBUTTON_SPIN_DOWN", SYMBOL_SPIN_DOWN ); + SETCONST( pSymbol, "IMAGEBUTTON_SPIN_LEFT", SYMBOL_SPIN_LEFT ); + SETCONST( pSymbol, "IMAGEBUTTON_SPIN_RIGHT", SYMBOL_SPIN_RIGHT ); + SETCONST( pSymbol, "IMAGEBUTTON_FIRST", SYMBOL_FIRST ); + SETCONST( pSymbol, "IMAGEBUTTON_LAST", SYMBOL_LAST ); + SETCONST( pSymbol, "IMAGEBUTTON_PREV", SYMBOL_PREV ); + SETCONST( pSymbol, "IMAGEBUTTON_NEXT", SYMBOL_NEXT ); + SETCONST( pSymbol, "IMAGEBUTTON_PAGEUP", SYMBOL_PAGEUP ); + SETCONST( pSymbol, "IMAGEBUTTON_PAGEDOWN", SYMBOL_PAGEDOWN ); + SETCONST( pSymbol, "IMAGEBUTTON_PLAY", SYMBOL_PLAY ); + SETCONST( pSymbol, "IMAGEBUTTON_REVERSEPLAY", SYMBOL_REVERSEPLAY ); + SETCONST( pSymbol, "IMAGEBUTTON_STOP", SYMBOL_STOP ); + SETCONST( pSymbol, "IMAGEBUTTON_PAUSE", SYMBOL_PAUSE ); + SETCONST( pSymbol, "IMAGEBUTTON_WINDSTART", SYMBOL_WINDSTART ); + SETCONST( pSymbol, "IMAGEBUTTON_WINDEND", SYMBOL_WINDEND ); + SETCONST( pSymbol, "IMAGEBUTTON_WINDBACKWARD", SYMBOL_WINDBACKWARD ); + SETCONST( pSymbol, "IMAGEBUTTON_WINDFORWARD", SYMBOL_WINDFORWARD ); + + // Variable einfuegen + nVarId = aNmTb.Put( "Symbol", VARNAME ); + pClassImageButton->SetVariable( nVarId, pSymbol, NULL, 0, + RSC_IMAGEBUTTON_SYMBOL ); + } + nId = aNmTb.Put( "State", VARNAME ); + pClassImageButton->SetVariable( nId, pTriState, NULL, 0, + RSC_IMAGEBUTTON_STATE ); + + INS_WINBIT(pClassImageButton,Repeat) + INS_WINBIT(pClassImageButton,SmallStyle) + INS_WINBIT(pClassImageButton,RectStyle) + + return pClassImageButton; +} + +/************************************************************************* +|* RscTypCont::InitClassEdit() +*************************************************************************/ +RscTop * RscTypCont::InitClassEdit( RscTop * pSuper ) +{ + HASHID nId; + RscTop * pClassEdit; + + // Klasse anlegen + nId = pHS->Insert( "Edit" ); + pClassEdit = new RscClass( nId, RSC_EDIT, pSuper ); + pClassEdit->SetCallPar( *pWinPar1, *pWinPar2, *pWinParType ); + aNmTb.Put( nId, CLASSNAME, pClassEdit ); + + INS_WINBIT(pClassEdit,Left) + INS_WINBIT(pClassEdit,Center) + INS_WINBIT(pClassEdit,Right) + INS_WINBIT(pClassEdit,PassWord) + INS_WINBIT(pClassEdit,ReadOnly) + + nId = aNmTb.Put( "MaxTextLength", VARNAME ); + pClassEdit->SetVariable( nId, &aUShort ); + + return pClassEdit; +} + +/************************************************************************* +|* RscTypCont::InitClassMultiLineedit() +*************************************************************************/ +RscTop * RscTypCont::InitClassMultiLineEdit( RscTop * pSuper ) +{ + HASHID nId; + RscTop * pClassMultiLineEdit; + + // Klasse anlegen + nId = pHS->Insert( "MultiLineEdit" ); + pClassMultiLineEdit = new RscClass( nId, RSC_MULTILINEEDIT, pSuper ); + pClassMultiLineEdit->SetCallPar( *pWinPar1, *pWinPar2, *pWinParType ); + + aNmTb.Put( nId, CLASSNAME, pClassMultiLineEdit ); + + InsWinBit( pClassMultiLineEdit, "HScroll", nHscrollId ); + InsWinBit( pClassMultiLineEdit, "VScroll", nVscrollId ); + INS_WINBIT( pClassMultiLineEdit, IgnoreTab ); + + return pClassMultiLineEdit; +} + +/************************************************************************* +|* RscTypCont::InitClassScrollBar() +*************************************************************************/ +RscTop * RscTypCont::InitClassScrollBar( RscTop * pSuper ) +{ + HASHID nId; + RscTop * pClassScrollBar; + + // Klasse anlegen + nId = pHS->Insert( "ScrollBar" ); + pClassScrollBar = new RscClass( nId, RSC_SCROLLBAR, pSuper ); + pClassScrollBar->SetCallPar( *pWinPar1, *pWinPar2, *pWinParType ); + aNmTb.Put( nId, CLASSNAME, pClassScrollBar ); + + // Variablen anlegen + nId = aNmTb.Put( "MinPos", VARNAME ); + pClassScrollBar->SetVariable( nId, &aShort ); + { + RSCINST aDfltI; + + aDfltI = aShort.Create( NULL, RSCINST(), FALSE ); + aDfltI.pClass->SetNumber( aDfltI, 100 ); +// aDfltI.pClass->MakeDefault( aDfltI ); + + nId = aNmTb.Put( "MaxPos", VARNAME ); + pClassScrollBar->SetVariable( nId, &aShort, &aDfltI ); + } + nId = aNmTb.Put( "ThumbPos", VARNAME ); + pClassScrollBar->SetVariable( nId, &aShort ); + { + RSCINST aDfltI; + + aDfltI = aShort.Create( NULL, RSCINST(), FALSE ); + aDfltI.pClass->SetNumber( aDfltI, 1 ); +// aDfltI.pClass->MakeDefault( aDfltI ); + + nId = aNmTb.Put( "PageSize", VARNAME); + pClassScrollBar->SetVariable( nId, &aShort, &aDfltI ); + } + { + RSCINST aDfltI; + + aDfltI = aShort.Create( NULL, RSCINST(), FALSE ); + aDfltI.pClass->SetNumber( aDfltI, 1 ); +// aDfltI.pClass->MakeDefault( aDfltI ); + nId = aNmTb.Put( "LineSize", VARNAME ); + pClassScrollBar->SetVariable( nId, &aShort, &aDfltI ); + } + nId = aNmTb.Put( "VisibleSize", VARNAME ); + pClassScrollBar->SetVariable( nId, &aShort ); + + InsWinBit( pClassScrollBar, "HScroll", nHscrollId ); + InsWinBit( pClassScrollBar, "VScroll", nVscrollId ); + INS_WINBIT(pClassScrollBar,Drag) + + return pClassScrollBar; +} + +/************************************************************************* +|* RscTypCont::InitClassListBox() +*************************************************************************/ +RscTop * RscTypCont::InitClassListBox( RscTop * pSuper, RscArray * pStrLst ) +{ + HASHID nId; + RscTop * pClassListBox; + + // Klasse anlegen + nId = pHS->Insert( "ListBox" ); + pClassListBox = new RscClass( nId, RSC_LISTBOX, pSuper ); + pClassListBox->SetCallPar( *pWinPar1, *pWinPar2, *pWinParType ); + aNmTb.Put( nId, CLASSNAME, pClassListBox ); + + // Variablen anlegen + INS_WINBIT(pClassListBox,Sort) + INS_WINBIT(pClassListBox,DropDown) + InsWinBit( pClassListBox, "HScroll", nHscrollId ); + InsWinBit( pClassListBox, "VScroll", nVscrollId ); + INS_WINBIT(pClassListBox,AutoSize) + INS_WINBIT(pClassListBox,AutoHScroll) + INS_WINBIT(pClassListBox,DDExtraWidth) + + { + RSCINST aDflt = aUShort.Create( NULL, RSCINST(), FALSE ); + aDflt.pClass->SetNumber( aDflt, (USHORT)0xFFFF ); + nId = aNmTb.Put( "CurPos", VARNAME ); + pClassListBox->SetVariable( nId, &aUShort, &aDflt ); + } + nId = aNmTb.Put( "StringList", VARNAME ); + pClassListBox->SetVariable( nId, pStrLst ); + + return pClassListBox; +} + +/************************************************************************* +|* RscTypCont::InitClassMultiListBox() +*************************************************************************/ +RscTop * RscTypCont::InitClassMultiListBox( RscTop * pSuper ) +{ + HASHID nId; + RscTop * pClassMultiListBox; + + // Klasse anlegen + nId = pHS->Insert( "MultiListBox" ); + pClassMultiListBox = new RscClass( nId, RSC_MULTILISTBOX, pSuper ); + pClassMultiListBox->SetCallPar( *pWinPar1, *pWinPar2, *pWinParType ); + aNmTb.Put( nId, CLASSNAME, pClassMultiListBox ); + + INS_WINBIT(pClassMultiListBox,SimpleMode) + + return pClassMultiListBox; +} + +/************************************************************************* +|* RscTypCont::InitClassComboBox() +*************************************************************************/ +RscTop * RscTypCont::InitClassComboBox( RscTop * pSuper, RscArray * pStrLst ) +{ + HASHID nId; + RscTop * pClassComboBox; + + // Klasse anlegen + nId = pHS->Insert( "ComboBox" ); + pClassComboBox = new RscClass( nId, RSC_COMBOBOX, pSuper ); + pClassComboBox->SetCallPar( *pWinPar1, *pWinPar2, *pWinParType ); + aNmTb.Put( nId, CLASSNAME, pClassComboBox ); + + // Variablen anlegen + INS_WINBIT(pClassComboBox,DropDown) + INS_WINBIT(pClassComboBox,Sort) + InsWinBit( pClassComboBox, "HScroll", nHscrollId ); + InsWinBit( pClassComboBox, "VScroll", nVscrollId ); + INS_WINBIT(pClassComboBox,AutoSize) + INS_WINBIT(pClassComboBox,AutoHScroll) + INS_WINBIT(pClassComboBox,DDExtraWidth) + + nId = aNmTb.Put( "StringList", VARNAME ); + pClassComboBox->SetVariable( nId, pStrLst ); + + return pClassComboBox; +} + +#ifdef MAC +#pragma segment rsctypcont +#endif + +/************************************************************************* +|* RscTypCont::InitClassFixedText() +*************************************************************************/ +RscTop * RscTypCont::InitClassFixedText( RscTop * pSuper ) +{ + HASHID nId; + RscTop * pClassFixedText; + + // Klasse anlegen + nId = pHS->Insert( "FixedText" ); + pClassFixedText = new RscClass( nId, RSC_TEXT, pSuper ); + pClassFixedText->SetCallPar( *pWinPar1, *pWinPar2, *pWinParType ); + aNmTb.Put( nId, CLASSNAME, pClassFixedText ); + + // Variablen anlegen + INS_WINBIT(pClassFixedText,Left) + INS_WINBIT(pClassFixedText,Center) + INS_WINBIT(pClassFixedText,Right) + INS_WINBIT(pClassFixedText,WordBreak) + INS_WINBIT(pClassFixedText,LeftLabel) + INS_WINBIT(pClassFixedText,NoLabel) + + return pClassFixedText; +} + +/************************************************************************* +|* RscTypCont::InitClassFixedBitmap() +*************************************************************************/ +RscTop * RscTypCont::InitClassFixedBitmap( RscTop * pSuper, RscTop * pClassBitmap ) +{ + HASHID nId; + RscTop * pClassFixedBitmap; + + // Klasse anlegen + nId = pHS->Insert( "FixedBitmap" ); + pClassFixedBitmap = new RscClass( nId, RSC_FIXEDBITMAP, pSuper ); + pClassFixedBitmap->SetCallPar( *pWinPar1, *pWinPar2, *pWinParType ); + aNmTb.Put( nId, CLASSNAME, pClassFixedBitmap ); + + INS_WINBIT(pClassFixedBitmap,Scale) + + // Variablen anlegen + nId = aNmTb.Put( "Fixed", VARNAME ); + pClassFixedBitmap->SetVariable( nId, pClassBitmap, 0, 0, RSC_FIXEDBITMAP_BITMAP ); + + return pClassFixedBitmap; +} + +/************************************************************************* +|* RscTypCont::InitClassFixedImage() +*************************************************************************/ +RscTop * RscTypCont::InitClassFixedImage( RscTop * pSuper, RscTop * pClassImage ) +{ + HASHID nId; + RscTop * pClassFixedImage; + + // Klasse anlegen + nId = pHS->Insert( "FixedImage" ); + pClassFixedImage = new RscClass( nId, RSC_FIXEDIMAGE, pSuper ); + pClassFixedImage->SetCallPar( *pWinPar1, *pWinPar2, *pWinParType ); + aNmTb.Put( nId, CLASSNAME, pClassFixedImage ); + + // Variablen anlegen + nId = aNmTb.Put( "Fixed", VARNAME ); + pClassFixedImage->SetVariable( nId, pClassImage, 0, 0, RSC_FIXEDIMAGE_IMAGE ); + + return pClassFixedImage; +} + +/************************************************************************* +|* RscTypCont::InitClassImageRadioButton() +*************************************************************************/ +RscTop * RscTypCont::InitClassImageRadioButton( RscTop * pSuper, RscTop * pClassImage ) +{ + HASHID nId; + RscTop * pClassImageRadioButton; + + // Klasse anlegen + nId = pHS->Insert( "ImageRadioButton" ); + pClassImageRadioButton = new RscClass( nId, RSC_IMAGERADIOBUTTON, pSuper ); + pClassImageRadioButton->SetCallPar( *pWinPar1, *pWinPar2, *pWinParType ); + aNmTb.Put( nId, CLASSNAME, pClassImageRadioButton ); + + // Variablen anlegen + INS_WINBIT(pClassImageRadioButton,TopImage) + nId = aNmTb.Put( "RadioButtonImage", VARNAME ); + pClassImageRadioButton->SetVariable( nId, pClassImage, 0, 0, RSC_IMAGERADIOBUTTON_IMAGE ); + + return pClassImageRadioButton; +} + +/************************************************************************* +|* RscTypCont::InitClassKeyCode() +*************************************************************************/ +RscTop * RscTypCont::InitClassKeyCode( RscTop * pSuper, RscEnum * pKey ) +{ + HASHID nId; + RscTop * pClassKeyCode; + + // Klasse anlegen + nId = pHS->Insert( "KeyCode" ); + pClassKeyCode = new RscClass( nId, RSC_KEYCODE, pSuper ); + aNmTb.Put( nId, CLASSNAME, pClassKeyCode ); + + // Variablen anlegen + nId = aNmTb.Put( "Code", VARNAME ); + pClassKeyCode->SetVariable( nId, pKey ); + + { + RscFlag * pFlag; + RscClient * pClient; + HASHID nVarId, nShiftId, nMod1Id, nMod2Id; + + aBaseLst.Insert( pFlag = new RscFlag( pHS->Insert( "FlagKeyModifier" ), + RSC_NOTYPE ), + LIST_APPEND ); + + // Konstanten in Tabelle stellen + nShiftId = pHS->Insert( "KEY_SHIFT" ); + SETCONST( pFlag, nShiftId, KEY_SHIFT ); + nMod1Id = pHS->Insert( "KEY_MOD1" ); + SETCONST( pFlag, nMod1Id, KEY_MOD1 ); + nMod2Id = pHS->Insert( "KEY_MOD2" ); + SETCONST( pFlag, nMod2Id, KEY_MOD2 ); + + // Variable einfuegen + nVarId = aNmTb.Put( "_ModifierFlags", VARNAME ); + pClassKeyCode->SetVariable( nVarId, pFlag, NULL, + VAR_HIDDEN | VAR_NOENUM ); + + // Clientvariablen einfuegen + aBaseLst.Insert( + pClient = new RscClient( pHS->Insert( "BOOL" ), RSC_NOTYPE, + pFlag, nShiftId ), + LIST_APPEND ); + nId = aNmTb.Put( "Shift", VARNAME ); + pClassKeyCode->SetVariable( nId, pClient, NULL, + VAR_NODATAINST, 0, nVarId ); + + aBaseLst.Insert( + pClient = new RscClient( pHS->Insert( "BOOL" ), RSC_NOTYPE, + pFlag, nMod1Id ), + LIST_APPEND ); + nId = aNmTb.Put( "Modifier1", VARNAME ); + pClassKeyCode->SetVariable( nId, pClient, NULL, + VAR_NODATAINST, 0, nVarId ); + + + aBaseLst.Insert( + pClient = new RscClient( pHS->Insert( "BOOL" ), RSC_NOTYPE, + pFlag, nMod2Id ), + LIST_APPEND ); + nId = aNmTb.Put( "Modifier2", VARNAME ); + pClassKeyCode->SetVariable( nId, pClient, NULL, + VAR_NODATAINST, 0, nVarId ); + } + { + HASHID nVarId; + RscEnum * pKeyFunc; + + aBaseLst.Insert( pKeyFunc = new RscEnum( pHS->Insert( "EnumKeyFunc" ), + RSC_NOTYPE ), + LIST_APPEND ); + + SETCONST( pKeyFunc, "KEYFUNC_DONTKNOW", KEYFUNC_DONTKNOW ); + SETCONST( pKeyFunc, "KEYFUNC_NEW", KEYFUNC_NEW ); + SETCONST( pKeyFunc, "KEYFUNC_OPEN", KEYFUNC_OPEN ); + SETCONST( pKeyFunc, "KEYFUNC_SAVE", KEYFUNC_SAVE ); + SETCONST( pKeyFunc, "KEYFUNC_SAVEAS", KEYFUNC_SAVEAS ); + SETCONST( pKeyFunc, "KEYFUNC_PRINT", KEYFUNC_PRINT ); + SETCONST( pKeyFunc, "KEYFUNC_CLOSE", KEYFUNC_CLOSE ); + SETCONST( pKeyFunc, "KEYFUNC_QUIT", KEYFUNC_QUIT ); + SETCONST( pKeyFunc, "KEYFUNC_CUT", KEYFUNC_CUT ); + SETCONST( pKeyFunc, "KEYFUNC_COPY", KEYFUNC_COPY ); + SETCONST( pKeyFunc, "KEYFUNC_PASTE", KEYFUNC_PASTE ); + SETCONST( pKeyFunc, "KEYFUNC_UNDO", KEYFUNC_UNDO ); + SETCONST( pKeyFunc, "KEYFUNC_REDO", KEYFUNC_REDO ); + SETCONST( pKeyFunc, "KEYFUNC_DELETE", KEYFUNC_DELETE ); + SETCONST( pKeyFunc, "KEYFUNC_REPEAT", KEYFUNC_REPEAT ); + SETCONST( pKeyFunc, "KEYFUNC_FIND", KEYFUNC_FIND ); + SETCONST( pKeyFunc, "KEYFUNC_PROPERTIES", KEYFUNC_PROPERTIES ); + SETCONST( pKeyFunc, "KEYFUNC_FRONT", KEYFUNC_FRONT ); + SETCONST( pKeyFunc, "KEYFUNC_FINDBACKWARD", KEYFUNC_FINDBACKWARD ); + // Variable einfuegen + nVarId = aNmTb.Put( "Function", VARNAME ); + pClassKeyCode->SetVariable( nVarId, pKeyFunc, NULL ); + } + + return pClassKeyCode; +} + +/************************************************************************* +|* RscTypCont::InitClassAccelItem() +*************************************************************************/ +RscTop * RscTypCont::InitClassAccelItem( RscTop * pSuper, + RscTop * pClassKeyCode ) +{ + HASHID nId; + RscTop * pClassAccelItem; + + // Klasse anlegen + nId = pHS->Insert( "AcceleratorItem" ); + pClassAccelItem = new RscClass( nId, RSC_ACCELITEM, pSuper ); + aNmTb.Put( nId, CLASSNAME, pClassAccelItem ); + + // Variablen anlegen + nId = aNmTb.Put( "Identifier", VARNAME ); + pClassAccelItem->SetVariable( nId, &aIdNoZeroUShort ); + nId = aNmTb.Put( "Disable", VARNAME ); + pClassAccelItem->SetVariable( nId, &aBool ); + nId = aNmTb.Put( "Key", VARNAME ); + pClassAccelItem->SetVariable( nId, pClassKeyCode, NULL, 0, + ACCELITEM_KEY ); + + return pClassAccelItem; +} + +/************************************************************************* +|* RscTypCont::InitClassAccelm() +*************************************************************************/ +RscTop * RscTypCont::InitClassAccel( RscTop * pSuper, RscTop * pClassAccelItem ) +{ + HASHID nId; + RscTop * pClassAccel; + + // Klasse anlegen + nId = pHS->Insert( "Accelerator" ); + pClassAccel = new RscClass( nId, RSC_ACCEL, pSuper ); + pClassAccel->SetCallPar( *pStdPar1, *pStdPar2, *pStdParType ); + aNmTb.Put( nId, CLASSNAME, pClassAccel ); + + // Variablen anlegen + nId = aNmTb.Put( "HelpText", VARNAME ); + pClassAccel->SetVariable( nId, &aLangString ); + { + RscCont * pCont; + + aBaseLst.Insert( pCont = new RscCont( + pHS->Insert( "ContAcceleratorKey" ), + RSC_NOTYPE ), + LIST_APPEND ); + pCont->SetTypeClass( pClassAccelItem ); + nId = aNmTb.Put( "ItemList", VARNAME ); + pClassAccel->SetVariable( nId, pCont ); + } + + return pClassAccel; +} + +/************************************************************************* +|* RscTypCont::InitClassMenuItem() +*************************************************************************/ +RscTop * RscTypCont::InitClassMenuItem( RscTop * pSuper, + RscTop * pClassBitmap, + RscTop * pClassKeyCode ) +{ + HASHID nId; + RscTop * pClassMenuItem; + + // Klasse anlegen + nId = pHS->Insert( "MenuItem" ); + pClassMenuItem = new RscClass( nId, RSC_MENUITEM, pSuper ); + aNmTb.Put( nId, CLASSNAME, pClassMenuItem ); + + // Variablen anlegen + nId = aNmTb.Put( "Separator", VARNAME ); + pClassMenuItem->SetVariable( nId, &aBool, NULL, 0, + RSC_MENUITEM_SEPARATOR ); + nId = aNmTb.Put( "Identifier", VARNAME ); + pClassMenuItem->SetVariable( nId, &aIdNoZeroUShort, NULL, 0, + RSC_MENUITEM_ID ); + { + RscFlag * pFlag; + RscClient * pClient; + HASHID nVarId, nAutoCheckId, nRadioCheckId; + HASHID nCheckableId, nAboutId, nHelpId; + + aBaseLst.Insert( pFlag = new RscFlag( pHS->Insert( "FlagMenuState" ), + RSC_NOTYPE ), + LIST_APPEND ); + + // Konstanten in Tabelle stellen + nCheckableId = pHS->Insert( "MIB_CHECKABLE" ); + SETCONST( pFlag, nCheckableId, MIB_CHECKABLE ); + nAutoCheckId = pHS->Insert( "MIB_AUTOCHECK" ); + SETCONST( pFlag, nAutoCheckId, MIB_AUTOCHECK ); + nRadioCheckId = pHS->Insert( "MIB_RADIOCHECK" ); + SETCONST( pFlag, nRadioCheckId, MIB_RADIOCHECK ); + nAboutId = pHS->Insert( "MIB_ABOUT" ); + SETCONST( pFlag, nAboutId, MIB_ABOUT ); + nHelpId = pHS->Insert( "MIB_HELP" ); + SETCONST( pFlag, nHelpId, MIB_HELP ); + + // Variable einfuegen + nVarId = aNmTb.Put( "_MenuItemFlags", VARNAME ); + pClassMenuItem->SetVariable( nVarId, pFlag, NULL, + VAR_HIDDEN | VAR_NOENUM, + RSC_MENUITEM_STATUS ); + + // Clientvariablen einfuegen + aBaseLst.Insert( + pClient = new RscClient( pHS->Insert( "BOOL" ), RSC_NOTYPE, + pFlag, nCheckableId ), + LIST_APPEND ); + nId = aNmTb.Put( "Checkable", VARNAME ); + pClassMenuItem->SetVariable( nId, pClient, NULL, + VAR_NODATAINST, 0, nVarId ); + + aBaseLst.Insert( + pClient = new RscClient( pHS->Insert( "BOOL" ), RSC_NOTYPE, + pFlag, nAutoCheckId ), + LIST_APPEND ); + nId = aNmTb.Put( "AutoCheck", VARNAME ); + pClassMenuItem->SetVariable( nId, pClient, NULL, + VAR_NODATAINST, 0, nVarId ); + + aBaseLst.Insert( + pClient = new RscClient( pHS->Insert( "BOOL" ), RSC_NOTYPE, + pFlag, nRadioCheckId ), + LIST_APPEND ); + nId = aNmTb.Put( "RadioCheck", VARNAME ); + pClassMenuItem->SetVariable( nId, pClient, NULL, + VAR_NODATAINST, 0, nVarId ); + + aBaseLst.Insert( + pClient = new RscClient( pHS->Insert( "BOOL" ), RSC_NOTYPE, + pFlag, nAboutId ), + LIST_APPEND ); + nId = aNmTb.Put( "About", VARNAME ); + pClassMenuItem->SetVariable( nId, pClient, NULL, + VAR_NODATAINST, 0, nVarId ); + + aBaseLst.Insert( + pClient = new RscClient( pHS->Insert( "BOOL" ), RSC_NOTYPE, + pFlag, nHelpId ), + LIST_APPEND ); + nId = aNmTb.Put( "Help", VARNAME ); + pClassMenuItem->SetVariable( nId, pClient, NULL, + VAR_NODATAINST, 0, nVarId ); + + } + nId = aNmTb.Put( "Text", VARNAME ); + pClassMenuItem->SetVariable( nId, &aLangString, NULL, 0, + RSC_MENUITEM_TEXT ); + nId = aNmTb.Put( "ItemBitmap", VARNAME ); + pClassMenuItem->SetVariable( nId, pClassBitmap, NULL, 0, + RSC_MENUITEM_BITMAP ); + nId = aNmTb.Put( "HelpText", VARNAME ); + pClassMenuItem->SetVariable( nId, &aLangString, NULL, 0, + RSC_MENUITEM_HELPTEXT ); + nId = aNmTb.Put( "HelpID", VARNAME ); + pClassMenuItem->SetVariable( nId, &aIdLong, NULL, 0, + RSC_MENUITEM_HELPID ); + nId = aNmTb.Put( "AccelKey", VARNAME ); + pClassMenuItem->SetVariable( nId, pClassKeyCode, NULL, 0, + RSC_MENUITEM_KEYCODE ); + nId = aNmTb.Put( "Check", VARNAME ); + pClassMenuItem->SetVariable( nId, &aBool, NULL, 0, + RSC_MENUITEM_CHECKED ); + nId = aNmTb.Put( "Disable", VARNAME ); + pClassMenuItem->SetVariable( nId, &aBool, NULL, 0, + RSC_MENUITEM_DISABLE ); + nId = aNmTb.Put( "Command", VARNAME ); + pClassMenuItem->SetVariable( nId, &aString, NULL, 0, + RSC_MENUITEM_COMMAND ); + + return pClassMenuItem; +} + +/************************************************************************* +|* RscTypCont::InitClassMenu() +*************************************************************************/ +RscTop * RscTypCont::InitClassMenu( RscTop * pSuper, + RscTop * pClassMenuItem ) +{ + HASHID nId; + RscTop * pClassMenu; + + // Klasse anlegen + nId = pHS->Insert( "Menu" ); + pClassMenu = new RscClass( nId, RSC_MENU, pSuper ); + pClassMenu->SetCallPar( *pStdPar1, *pStdPar2, *pStdParType ); + aNmTb.Put( nId, CLASSNAME, pClassMenu ); + + // Variablen anlegen + { + RscCont * pCont; + + aBaseLst.Insert( pCont = new RscCont( pHS->Insert( "ContMenuItem" ), + RSC_NOTYPE ), + LIST_APPEND ); + pCont->SetTypeClass( pClassMenuItem ); + nId = aNmTb.Put( "ItemList", VARNAME ); + pClassMenu->SetVariable( nId, pCont, NULL, 0, RSC_MENU_ITEMS ); + } + nId = aNmTb.Put( "Text", VARNAME ); + pClassMenu->SetVariable( nId, &aLangString, NULL, 0, RSC_MENU_TEXT ); + nId = aNmTb.Put( "DefaultItemId", VARNAME ); + pClassMenu->SetVariable( nId, &aIdUShort, NULL, 0, + RSC_MENU_DEFAULTITEMID ); + + return pClassMenu; +} + +/************************************************************************* +|* RscTypCont::InitClassMessageBox() +*************************************************************************/ +RscTop * RscTypCont::InitClassMessBox( RscTop * pSuper, + RscEnum * pMessButtons, + RscEnum * pMessDefButton ) +{ + HASHID nId; + RscTop * pClassMessBox; + + // Klasse anlegen + nId = pHS->Insert( "MessBox" ); + pClassMessBox = new RscClass( nId, RSC_MESSBOX, pSuper ); + pClassMessBox->SetCallPar( *pWinPar1, *pWinPar2, *pWinParType ); + aNmTb.Put( nId, CLASSNAME, pClassMessBox ); + + // Variablen anlegen + nId = aNmTb.Put( "Buttons", VARNAME ); + pClassMessBox->SetVariable( nId, pMessButtons ); + nId = aNmTb.Put( "DefButton", VARNAME ); + pClassMessBox->SetVariable( nId, pMessDefButton ); + nId = aNmTb.Put( "HelpID", VARNAME ); + pClassMessBox->SetVariable( nId, &aIdLong ); + nId = aNmTb.Put( "SysModal", VARNAME ); + pClassMessBox->SetVariable( nId, &aBool ); + nId = aNmTb.Put( "Title", VARNAME ); + pClassMessBox->SetVariable( nId, &aLangString ); + nId = aNmTb.Put( "Message", VARNAME ); + pClassMessBox->SetVariable( nId, &aLangString ); + nId = aNmTb.Put( "HelpText", VARNAME ); + pClassMessBox->SetVariable( nId, &aLangString ); + + return pClassMessBox; +} + +/************************************************************************* +|* RscTypCont::InitClassSplitter() +*************************************************************************/ +RscTop * RscTypCont::InitClassSplitter( RscTop * pSuper ) +{ + HASHID nId; + RscTop * pClassSplitter; + + // Klasse anlegen + nId = pHS->Insert( "Splitter" ); + pClassSplitter = new RscClass( nId, RSC_SPLITTER, pSuper ); + pClassSplitter->SetCallPar( *pWinPar1, *pWinPar2, *pWinParType ); + + aNmTb.Put( nId, CLASSNAME, pClassSplitter ); + + InsWinBit( pClassSplitter, "HScroll", nHscrollId ); + InsWinBit( pClassSplitter, "VScroll", nVscrollId ); + + return pClassSplitter; +} + +/************************************************************************* +|* RscTypCont::InitClassSplitWindow() +*************************************************************************/ +RscTop * RscTypCont::InitClassSplitWindow( RscTop * pSuper ) +{ + HASHID nId; + RscTop * pClassSplitWindow; + + // Klasse anlegen + nId = pHS->Insert( "SplitWindow" ); + pClassSplitWindow = new RscClass( nId, RSC_SPLITWINDOW, pSuper ); + pClassSplitWindow->SetCallPar( *pWinPar1, *pWinPar2, *pWinParType ); + + aNmTb.Put( nId, CLASSNAME, pClassSplitWindow ); + + INS_WINBIT(pClassSplitWindow,Sizeable) + INS_WINBIT(pClassSplitWindow,NoSplitDraw) + + return pClassSplitWindow; +} + +/************************************************************************* +|* RscTypCont::InitClassTime() +*************************************************************************/ +RscTop * RscTypCont::InitClassTime( RscTop * pSuper ) +{ + HASHID nId; + RscTop * pClassTime; + + // Klasse anlegen + nId = pHS->Insert( "Time" ); + pClassTime = new RscClass( nId, RSC_TIME, pSuper ); + pClassTime->SetCallPar( *pStdPar1, *pStdPar2, *pStdParType ); + + aNmTb.Put( nId, CLASSNAME, pClassTime ); + + // Variablen anlegen + nId = aNmTb.Put( "Hour", VARNAME ); + pClassTime->SetVariable( nId, &a0to23Short, NULL, 0, TIME_HOUR ); + + nId = aNmTb.Put( "Minute", VARNAME ); + pClassTime->SetVariable( nId, &a0to59Short, NULL, 0, TIME_MINUTE ); + + nId = aNmTb.Put( "Second", VARNAME ); + pClassTime->SetVariable( nId, &a0to59Short, NULL, 0, TIME_SECOND ); + + nId = aNmTb.Put( "Sec100", VARNAME ); // weiss noch nich + pClassTime->SetVariable( nId, &a0to99Short, NULL, 0, TIME_SEC100 ); + + return pClassTime; +} + +/************************************************************************* +|* RscTypCont::InitClassDate() +*************************************************************************/ +RscTop * RscTypCont::InitClassDate( RscTop * pSuper, RscEnum * /*pDayOfWeek*/ ) +{ + HASHID nId; + RscTop * pClassDate; + + // Klasse anlegen + nId = pHS->Insert( "Date" ); + pClassDate = new RscClass( nId, RSC_DATE, pSuper ); + pClassDate->SetCallPar( *pStdPar1, *pStdPar2, *pStdParType ); + + aNmTb.Put( nId, CLASSNAME, pClassDate ); + + // Variablen anlegen + nId = aNmTb.Put( "Year", VARNAME ); + pClassDate->SetVariable( nId, &a0to9999Short, NULL, 0, DATE_YEAR ); + + nId = aNmTb.Put( "Month", VARNAME ); + pClassDate->SetVariable( nId, &a1to12Short, NULL, 0, DATE_MONTH ); + + nId = aNmTb.Put( "Day", VARNAME ); + pClassDate->SetVariable( nId, &a1to31Short, NULL, 0, DATE_DAY ); + + return pClassDate; +} + +/************************************************************************* +|* RscTypCont::InitClassInt1() +*************************************************************************/ +RscTop * RscTypCont::InitClassInt1( RscTop * pSuper, + RscEnum * pDateFormat, + RscEnum * pTimeFormat, RscEnum * pDayOfWeekFormat, + RscEnum * pMonthFormat ) +{ + HASHID nId; + RscTop * pClassInt; + + // Klasse anlegen + nId = pHS->Insert( "SubInternational" ); + pClassInt = new RscClass( nId, RSC_NOTYPE, pSuper ); + //pClassInt->SetCallPar( *pStdPar1, *pStdPar2, *pStdParType ); + + // Variablen anlegen + nId = aNmTb.Put( "Language", VARNAME ); + pClassInt->SetVariable( nId, &aLangType, NULL, 0, INT1_LANGUAGE ); + + nId = aNmTb.Put( "FormatLanguage", VARNAME ); + pClassInt->SetVariable( nId, &aLangType, NULL, 0, INT1_FORMATLANGUAGE ); + + nId = aNmTb.Put( "DateFormat", VARNAME ); + pClassInt->SetVariable( nId, pDateFormat, NULL, 0, INT1_DATEFORMAT ); + + nId = aNmTb.Put( "DateDayLeadingZero", VARNAME ); + pClassInt->SetVariable( nId, &aBool, NULL, 0, INT1_DATEDAYLEADINDZERO ); + + nId = aNmTb.Put( "DateMonthLeadingZero", VARNAME ); + pClassInt->SetVariable( nId, &aBool, NULL, 0, INT1_DATEMONTHLEADINDZERO ); + + nId = aNmTb.Put( "DateCentury", VARNAME ); + pClassInt->SetVariable( nId, &aBool, NULL, 0, INT1_DATECENTURY ); + + nId = aNmTb.Put( "LongDateFormat", VARNAME ); + pClassInt->SetVariable( nId, pDateFormat, NULL, 0, INT1_LONGDATEFORMAT ); + + nId = aNmTb.Put( "LongDateDayOfWeekFormat", VARNAME ); + pClassInt->SetVariable( nId, pDayOfWeekFormat, NULL, 0, + INT1_LONGDATEDAYOFWEEKFORMAT ); + + nId = aNmTb.Put( "LongDateDayOfWeekSep", VARNAME ); + pClassInt->SetVariable( nId, &aString, NULL, 0, INT1_LONGDATEDAYOFWEEKSEP ); + + nId = aNmTb.Put( "LongDateDayLeadingZero", VARNAME ); + pClassInt->SetVariable( nId, &aBool, NULL, 0, + INT1_LONGDATEDAYLEADINGZERO ); + + nId = aNmTb.Put( "LongDateDaySep", VARNAME ); + pClassInt->SetVariable( nId, &aString, NULL, 0, INT1_LONGDATEDAYSEP ); + + nId = aNmTb.Put( "LongDateMonthFormat", VARNAME ); + pClassInt->SetVariable( nId, pMonthFormat, NULL, 0, + INT1_LONGDATEMONTHFORMAT ); + + nId = aNmTb.Put( "LongDateMonthSep", VARNAME ); + pClassInt->SetVariable( nId, &aString, NULL, 0, INT1_LONGDATEMONTHSEP ); + + nId = aNmTb.Put( "LongDateCentury", VARNAME ); + pClassInt->SetVariable( nId, &aBool, NULL, 0, INT1_LONGDATECENTURY ); + + nId = aNmTb.Put( "LongDateYearSep", VARNAME ); + pClassInt->SetVariable( nId, &aString, NULL, 0, INT1_LONGDATEYEARSEP ); + + nId = aNmTb.Put( "TimeFormat", VARNAME ); + pClassInt->SetVariable( nId, pTimeFormat, NULL, 0, INT1_TIMEFORMAT ); + + // Maske voll zweite Struktur anfangen + + return pClassInt; +} + + +/************************************************************************* +|* RscTypCont::InitClassInternational() +*************************************************************************/ +RscTop * RscTypCont::InitClassInternational( RscTop * pSuper, + RscEnum * /*pDateFormat*/, + RscEnum * /*pTimeFormat*/, RscEnum * /*pWeekDayFormat*/, + RscEnum * /*pMonthFormat*/ ) +{ + HASHID nId; + RscTop * pClassInt; + + // Klasse anlegen + nId = pHS->Insert( "International" ); + pClassInt = new RscClass( nId, RSC_INTERNATIONAL, pSuper ); + pClassInt->SetCallPar( *pStdPar1, *pStdPar2, *pStdParType ); + + aNmTb.Put( nId, CLASSNAME, pClassInt ); + + // Variablen anlegen + nId = aNmTb.Put( "TimeLeadingZero", VARNAME ); + pClassInt->SetVariable( nId, &aBool, NULL, 0, INT2_TIMELEADINGZERO ); + + nId = aNmTb.Put( "TimeAM", VARNAME ); + pClassInt->SetVariable( nId, &aString, NULL, 0, INT2_TIMEAM ); + + nId = aNmTb.Put( "TimePM", VARNAME ); + pClassInt->SetVariable( nId, &aString, NULL, 0, INT2_TIMEPM ); + + nId = aNmTb.Put( "NumLeadingZero", VARNAME ); + pClassInt->SetVariable( nId, &aBool, NULL, 0, INT2_NUMLEADINGZERO ); + + nId = aNmTb.Put( "NumDigits", VARNAME ); + pClassInt->SetVariable( nId, &aUShort, NULL, 0, INT2_NUMDIGITS ); + + nId = aNmTb.Put( "CurrPositiveFormat", VARNAME ); + pClassInt->SetVariable( nId, &aUShort, NULL, 0, INT2_CURRPOSITIVEFORMAT ); + + nId = aNmTb.Put( "CurrNegativeFormat", VARNAME ); + pClassInt->SetVariable( nId, &aUShort, NULL, 0, INT2_CURRNEGATIVEFORMAT ); + + nId = aNmTb.Put( "CurrDigits", VARNAME ); + pClassInt->SetVariable( nId, &aUShort, NULL, 0, INT2_CURRDIGITS ); + + nId = aNmTb.Put( "NumTrailingZeros", VARNAME ); + pClassInt->SetVariable( nId, &aBool, NULL, 0, INT2_NUMTRAILINGZEROS ); + + return pClassInt; +} + +/************************************************************************* +|* RscTypCont::InitClassPatternFormatter() +*************************************************************************/ +RscTop * RscTypCont::InitClassPatternFormatter( RscTop * pSuper ) +{ + HASHID nId; + RscTop * pClassPattern; + + // Klasse anlegen + nId = pHS->Insert( "PatternFormatter" ); + pClassPattern = new RscClass( nId, RSC_NOTYPE, pSuper ); + pClassPattern->SetCallPar( *pStdPar1, *pStdPar2, *pStdParType ); + + // Variablen anlegen + nId = aNmTb.Put( "StrictFormat", VARNAME ); + pClassPattern->SetVariable( nId, &aBool, NULL, + 0, PATTERNFORMATTER_STRICTFORMAT ); + nId = aNmTb.Put( "EditMask", VARNAME ); + pClassPattern->SetVariable( nId, &aLangString, NULL, + 0, PATTERNFORMATTER_EDITMASK ); + nId = aNmTb.Put( "LiteralMask", VARNAME ); + pClassPattern->SetVariable( nId, &aLangString, NULL, + 0, PATTERNFORMATTER_LITTERALMASK ); + + return pClassPattern; +} + +/************************************************************************* +|* RscTypCont::InitClassNumericFormatter() +*************************************************************************/ +RscTop * RscTypCont::InitClassNumericFormatter( RscTop * pSuper, + RscTop * pClassI12 ) +{ + HASHID nId; + RscTop * pClassNumeric; + + // Klasse anlegen + nId = pHS->Insert( "NumericFormatter" ); + pClassNumeric = new RscClass( nId, RSC_NOTYPE, pSuper ); + pClassNumeric->SetCallPar( *pStdPar1, *pStdPar2, *pStdParType ); + + // Variablen anlegen + nId = aNmTb.Put( "Minimum", VARNAME ); + pClassNumeric->SetVariable( nId, &aIdLong, NULL, + 0, NUMERICFORMATTER_MIN ); + nId = aNmTb.Put( "Maximum", VARNAME ); + pClassNumeric->SetVariable( nId, &aIdLong, NULL, + 0, NUMERICFORMATTER_MAX ); + nId = aNmTb.Put( "StrictFormat", VARNAME ); + pClassNumeric->SetVariable( nId, &aBool, NULL, + 0, NUMERICFORMATTER_STRICTFORMAT ); + nId = aNmTb.Put( "Intnl", VARNAME ); + pClassNumeric->SetVariable( nId, pClassI12, NULL, + 0, NUMERICFORMATTER_I12 ); + nId = aNmTb.Put( "DecimalDigits", VARNAME ); + pClassNumeric->SetVariable( nId, &aUShort, NULL, + 0, NUMERICFORMATTER_DECIMALDIGITS ); + nId = aNmTb.Put( "Value", VARNAME ); + pClassNumeric->SetVariable( nId, &aIdLong, NULL, + 0, NUMERICFORMATTER_VALUE ); + + return pClassNumeric; +} + +/************************************************************************* +|* RscTypCont::InitClassMetricFormatter() +*************************************************************************/ +RscTop * RscTypCont::InitClassMetricFormatter( RscTop * pSuper, + RscEnum * pFieldUnits ) +{ + HASHID nId; + RscTop * pClassMetric; + + // Klasse anlegen + nId = pHS->Insert( "MetricFormatter" ); + pClassMetric = new RscClass( nId, RSC_NOTYPE, pSuper ); + pClassMetric->SetCallPar( *pStdPar1, *pStdPar2, *pStdParType ); + + // Variablen anlegen + nId = aNmTb.Put( "Unit", VARNAME ); + pClassMetric->SetVariable( nId, pFieldUnits, NULL, + 0, METRICFORMATTER_UNIT ); + nId = aNmTb.Put( "CustomUnitText", VARNAME ); + pClassMetric->SetVariable( nId, &aLangString, NULL, + 0, METRICFORMATTER_CUSTOMUNITTEXT ); + + return pClassMetric; +} + +/************************************************************************* +|* RscTypCont::InitClassCurrencyFormatter() +*************************************************************************/ +RscTop * RscTypCont::InitClassCurrencyFormatter +( + RscTop * pSuper, + RscEnum * /* pFieldUnits */) +{ + HASHID nId; + RscTop * pClassCurrency; + + // Klasse anlegen + nId = pHS->Insert( "CurrencyFormatter" ); + pClassCurrency = new RscClass( nId, RSC_NOTYPE, pSuper ); + pClassCurrency->SetCallPar( *pStdPar1, *pStdPar2, *pStdParType ); + + return pClassCurrency; +} + +/************************************************************************* +|* RscTypCont::InitClassDateFormatter() +*************************************************************************/ +RscTop * RscTypCont::InitClassDateFormatter( RscTop * pSuper, + RscTop * pClassDate, RscTop * pClassI12 ) +{ + HASHID nId; + RscTop * pClassDateF; + + // Klasse anlegen + nId = pHS->Insert( "DateFormatter" ); + pClassDateF = new RscClass( nId, RSC_NOTYPE, pSuper ); + pClassDateF->SetCallPar( *pStdPar1, *pStdPar2, *pStdParType ); + + // Variablen anlegen + nId = aNmTb.Put( "Minimum", VARNAME ); + pClassDateF->SetVariable( nId, pClassDate, NULL, + 0, DATEFORMATTER_MIN ); + nId = aNmTb.Put( "Maximum", VARNAME ); + pClassDateF->SetVariable( nId, pClassDate, NULL, + 0, DATEFORMATTER_MAX ); + nId = aNmTb.Put( "LongFormat", VARNAME ); + pClassDateF->SetVariable( nId, &aBool, NULL, + 0, DATEFORMATTER_LONGFORMAT ); + nId = aNmTb.Put( "StrictFormat", VARNAME ); + pClassDateF->SetVariable( nId, &aBool, NULL, + 0, DATEFORMATTER_STRICTFORMAT ); + nId = aNmTb.Put( "Intnl", VARNAME ); + pClassDateF->SetVariable( nId, pClassI12, NULL, + 0, DATEFORMATTER_I12 ); + nId = aNmTb.Put( "Value", VARNAME ); + pClassDateF->SetVariable( nId, pClassDate, NULL, + 0, DATEFORMATTER_VALUE ); + + return pClassDateF; +} + +/************************************************************************* +|* RscTypCont::InitClassTimeFormatter() +*************************************************************************/ +RscTop * RscTypCont::InitClassTimeFormatter( RscTop * pSuper, + RscTop * pClassTime, RscTop * pClassI12, + RscEnum * pTimeFieldFormat ) +{ + HASHID nId; + RscTop * pClassTimeF; + + // Klasse anlegen + nId = pHS->Insert( "TimeFormatter" ); + pClassTimeF = new RscClass( nId, RSC_NOTYPE, pSuper ); + pClassTimeF->SetCallPar( *pStdPar1, *pStdPar2, *pStdParType ); + + // Variablen anlegen + nId = aNmTb.Put( "Minimum", VARNAME ); + pClassTimeF->SetVariable( nId, pClassTime, NULL, + 0, TIMEFORMATTER_MIN ); + nId = aNmTb.Put( "Maximum", VARNAME ); + pClassTimeF->SetVariable( nId, pClassTime, NULL, + 0, TIMEFORMATTER_MAX ); + nId = aNmTb.Put( "Format", VARNAME ); + pClassTimeF->SetVariable( nId, pTimeFieldFormat, NULL, + 0, TIMEFORMATTER_TIMEFIELDFORMAT ); + nId = aNmTb.Put( "Duration", VARNAME ); + pClassTimeF->SetVariable( nId, &aBool, NULL, + 0, TIMEFORMATTER_DURATION ); + nId = aNmTb.Put( "StrictFormat", VARNAME ); + pClassTimeF->SetVariable( nId, &aBool, NULL, + 0, TIMEFORMATTER_STRICTFORMAT ); + nId = aNmTb.Put( "Intnl", VARNAME ); + pClassTimeF->SetVariable( nId, pClassI12, NULL, + 0, TIMEFORMATTER_I12 ); + nId = aNmTb.Put( "Value", VARNAME ); + pClassTimeF->SetVariable( nId, pClassTime, NULL, + 0, TIMEFORMATTER_VALUE ); + + return pClassTimeF; +} + +/************************************************************************* +|* RscTypCont::InitClassSpinField() +*************************************************************************/ +RscTop * RscTypCont::InitClassSpinField( RscTop * pSuper ) +{ + HASHID nId; + RscTop * pClassSpinField; + + // Klasse anlegen + nId = pHS->Insert( "SpinField" ); + pClassSpinField = new RscClass( nId, RSC_SPINFIELD, pSuper ); + pClassSpinField->SetCallPar( *pWinPar1, *pWinPar2, *pWinParType ); + + aNmTb.Put( nId, CLASSNAME, pClassSpinField ); + + INS_WINBIT(pClassSpinField,Repeat) + INS_WINBIT(pClassSpinField,Spin) + + return pClassSpinField; +} + +/************************************************************************* +|* RscTypCont::InitClassPatternField() +*************************************************************************/ +RscTop * RscTypCont::InitClassPatternField( RscTop * pSuper ) +{ + HASHID nId; + RscTop * pClassPatternField; + + // Klasse anlegen + nId = pHS->Insert( "PatternField" ); + pClassPatternField = new RscClass( nId, RSC_PATTERNFIELD, pSuper ); + pClassPatternField->SetCallPar( *pWinPar1, *pWinPar2, *pWinParType ); + + aNmTb.Put( nId, CLASSNAME, pClassPatternField ); + + return pClassPatternField; +} + +/************************************************************************* +|* RscTypCont::InitClassNumericField() +*************************************************************************/ +RscTop * RscTypCont::InitClassNumericField( RscTop * pSuper ) +{ + HASHID nId; + RscTop * pClassNumericField; + + // Klasse anlegen + nId = pHS->Insert( "NumericField" ); + pClassNumericField = new RscClass( nId, RSC_NUMERICFIELD, pSuper ); + pClassNumericField->SetCallPar( *pWinPar1, *pWinPar2, *pWinParType ); + + aNmTb.Put( nId, CLASSNAME, pClassNumericField ); + + // Variablen anlegen + nId = aNmTb.Put( "First", VARNAME ); + pClassNumericField->SetVariable( nId, &aIdLong, NULL, + 0, NUMERICFIELD_FIRST ); + nId = aNmTb.Put( "Last", VARNAME ); + pClassNumericField->SetVariable( nId, &aIdLong, NULL, + 0, NUMERICFIELD_LAST ); + nId = aNmTb.Put( "SpinSize", VARNAME ); + pClassNumericField->SetVariable( nId, &aIdLong, NULL, + 0, NUMERICFIELD_SPINSIZE ); + + return pClassNumericField; +} + +/************************************************************************* +|* RscTypCont::InitClassMetricField() +*************************************************************************/ +RscTop * RscTypCont::InitClassMetricField( RscTop * pSuper ) +{ + HASHID nId; + RscTop * pClassMetricField; + + // Klasse anlegen + nId = pHS->Insert( "MetricField" ); + pClassMetricField = new RscClass( nId, RSC_METRICFIELD, pSuper ); + pClassMetricField->SetCallPar( *pWinPar1, *pWinPar2, *pWinParType ); + + aNmTb.Put( nId, CLASSNAME, pClassMetricField ); + + // Variablen anlegen + nId = aNmTb.Put( "First", VARNAME ); + pClassMetricField->SetVariable( nId, &aIdLong, NULL, + 0, METRICFIELD_FIRST ); + nId = aNmTb.Put( "Last", VARNAME ); + pClassMetricField->SetVariable( nId, &aIdLong, NULL, + 0, METRICFIELD_LAST ); + nId = aNmTb.Put( "SpinSize", VARNAME ); + pClassMetricField->SetVariable( nId, &aIdLong, NULL, + 0, METRICFIELD_SPINSIZE ); + + return pClassMetricField; +} + +/************************************************************************* +|* RscTypCont::InitClassCurrencyField() +*************************************************************************/ +RscTop * RscTypCont::InitClassCurrencyField +( + const char * pClassName, + USHORT nRT, + RscTop * pSuper +) +{ + HASHID nId; + RscTop * pClassCurrencyField; + + // Klasse anlegen + nId = pHS->Insert( pClassName ); + pClassCurrencyField = new RscClass( nId, nRT, pSuper ); + pClassCurrencyField->SetCallPar( *pWinPar1, *pWinPar2, *pWinParType ); + + aNmTb.Put( nId, CLASSNAME, pClassCurrencyField ); + + // Variablen anlegen + nId = aNmTb.Put( "First", VARNAME ); + pClassCurrencyField->SetVariable( nId, &aIdLong, NULL, + 0, CURRENCYFIELD_FIRST ); + nId = aNmTb.Put( "Last", VARNAME ); + pClassCurrencyField->SetVariable( nId, &aIdLong, NULL, + 0, CURRENCYFIELD_LAST ); + nId = aNmTb.Put( "SpinSize", VARNAME ); + pClassCurrencyField->SetVariable( nId, &aIdLong, NULL, + 0, CURRENCYFIELD_SPINSIZE ); + + return pClassCurrencyField; +} + +/************************************************************************* +|* RscTypCont::InitClassDateField() +*************************************************************************/ +RscTop * RscTypCont::InitClassDateField( RscTop * pSuper, RscTop * pClassDate ) +{ + HASHID nId; + RscTop * pClassDateField; + + // Klasse anlegen + nId = pHS->Insert( "DateField" ); + pClassDateField = new RscClass( nId, RSC_DATEFIELD, pSuper ); + pClassDateField->SetCallPar( *pWinPar1, *pWinPar2, *pWinParType ); + + aNmTb.Put( nId, CLASSNAME, pClassDateField ); + + // Variablen anlegen + nId = aNmTb.Put( "First", VARNAME ); + pClassDateField->SetVariable( nId, pClassDate, NULL, 0, DATEFIELD_FIRST ); + nId = aNmTb.Put( "Last", VARNAME ); + pClassDateField->SetVariable( nId, pClassDate, NULL, 0, DATEFIELD_LAST ); + + return pClassDateField; +} + +/************************************************************************* +|* RscTypCont::InitClassTimeField() +*************************************************************************/ +RscTop * RscTypCont::InitClassTimeField( RscTop * pSuper, RscTop * pClassTime ) +{ + HASHID nId; + RscTop * pClassTimeField; + + // Klasse anlegen + nId = pHS->Insert( "TimeField" ); + pClassTimeField = new RscClass( nId, RSC_TIMEFIELD, pSuper ); + pClassTimeField->SetCallPar( *pWinPar1, *pWinPar2, *pWinParType ); + + aNmTb.Put( nId, CLASSNAME, pClassTimeField ); + + // Variablen anlegen + nId = aNmTb.Put( "First", VARNAME ); + pClassTimeField->SetVariable( nId, pClassTime, NULL, 0, TIMEFIELD_FIRST ); + nId = aNmTb.Put( "Last", VARNAME ); + pClassTimeField->SetVariable( nId, pClassTime, NULL, 0, TIMEFIELD_LAST ); + + return pClassTimeField; +} + +/************************************************************************* +|* RscTypCont::InitClassPatternBox() +*************************************************************************/ +RscTop * RscTypCont::InitClassPatternBox( RscTop * pSuper ) +{ + HASHID nId; + RscTop * pClassPatternBox; + + // Klasse anlegen + nId = pHS->Insert( "PatternBox" ); + pClassPatternBox = new RscClass( nId, RSC_PATTERNBOX, pSuper ); + pClassPatternBox->SetCallPar( *pWinPar1, *pWinPar2, *pWinParType ); + + aNmTb.Put( nId, CLASSNAME, pClassPatternBox ); + + return pClassPatternBox; +} + +/************************************************************************* +|* RscTypCont::InitClassNumericBox() +*************************************************************************/ +RscTop * RscTypCont::InitClassNumericBox( RscTop * pSuper ) +{ + HASHID nId; + RscTop * pClassNumericBox; + + // Klasse anlegen + nId = pHS->Insert( "NumericBox" ); + pClassNumericBox = new RscClass( nId, RSC_NUMERICBOX, pSuper ); + pClassNumericBox->SetCallPar( *pWinPar1, *pWinPar2, *pWinParType ); + + aNmTb.Put( nId, CLASSNAME, pClassNumericBox ); + + // Variablen anlegen + + return pClassNumericBox; +} + +/************************************************************************* +|* RscTypCont::InitClassMetricBox() +*************************************************************************/ +RscTop * RscTypCont::InitClassMetricBox( RscTop * pSuper ) +{ + HASHID nId; + RscTop * pClassMetricBox; + + // Klasse anlegen + nId = pHS->Insert( "MetricBox" ); + pClassMetricBox = new RscClass( nId, RSC_METRICBOX, pSuper ); + pClassMetricBox->SetCallPar( *pWinPar1, *pWinPar2, *pWinParType ); + + aNmTb.Put( nId, CLASSNAME, pClassMetricBox ); + + // Variablen anlegen + + return pClassMetricBox; +} + +/************************************************************************* +|* RscTypCont::InitClassCurrencyBox() +*************************************************************************/ +RscTop * RscTypCont::InitClassCurrencyBox +( + const char * pClassName, + USHORT nRT, + RscTop * pSuper +) +{ + HASHID nId; + RscTop * pClassCurrencyBox; + + // Klasse anlegen + nId = pHS->Insert( pClassName ); + pClassCurrencyBox = new RscClass( nId, nRT, pSuper ); + pClassCurrencyBox->SetCallPar( *pWinPar1, *pWinPar2, *pWinParType ); + + aNmTb.Put( nId, CLASSNAME, pClassCurrencyBox ); + + // Variablen anlegen + + return pClassCurrencyBox; +} + +/************************************************************************* +|* RscTypCont::InitClassDateBox() +*************************************************************************/ +RscTop * RscTypCont::InitClassDateBox( RscTop * pSuper, + RscTop * /*pClassDate*/ ) +{ + HASHID nId; + RscTop * pClassDateBox; + + // Klasse anlegen + nId = pHS->Insert( "DateBox" ); + pClassDateBox = new RscClass( nId, RSC_DATEBOX, pSuper ); + pClassDateBox->SetCallPar( *pWinPar1, *pWinPar2, *pWinParType ); + + aNmTb.Put( nId, CLASSNAME, pClassDateBox ); + + // Variablen anlegen + + return pClassDateBox; +} + +/************************************************************************* +|* RscTypCont::InitClassTimeBox() +*************************************************************************/ +RscTop * RscTypCont::InitClassTimeBox( RscTop * pSuper, + RscTop * /*pClassTime*/ ) +{ + HASHID nId; + RscTop * pClassTimeBox; + + // Klasse anlegen + nId = pHS->Insert( "TimeBox" ); + pClassTimeBox = new RscClass( nId, RSC_TIMEBOX, pSuper ); + pClassTimeBox->SetCallPar( *pWinPar1, *pWinPar2, *pWinParType ); + + aNmTb.Put( nId, CLASSNAME, pClassTimeBox ); + + // Variablen anlegen + + return pClassTimeBox; +} + +/************************************************************************* +|* RscTypCont::InitClassDockWindow() +*************************************************************************/ +RscTop * RscTypCont::InitClassDockingWindow( RscTop * pSuper, + RscEnum * pMapUnit ) +{ + HASHID nId; + RscTop * pClassDockWindow; + + // Klasse anlegen + nId = pHS->Insert( "DockingWindow" ); + pClassDockWindow = new RscClass( nId, RSC_DOCKINGWINDOW, pSuper ); + pClassDockWindow->SetCallPar( *pWinPar1, *pWinPar2, *pWinParType ); + aNmTb.Put( nId, CLASSNAME, pClassDockWindow ); + + // Variablen anlegen + nId = aNmTb.Put( "_FloatingPosMapMode", VARNAME ); + pClassDockWindow->SetVariable( nId, pMapUnit, NULL, 0, + RSC_DOCKINGWINDOW_XYMAPMODE ); + nId = aNmTb.Put( "_FloatingPosX", VARNAME ); + pClassDockWindow->SetVariable( nId, &aShort, NULL, 0, + RSC_DOCKINGWINDOW_X ); + nId = aNmTb.Put( "_FloatingPosY", VARNAME ); + pClassDockWindow->SetVariable( nId, &aShort, NULL, 0, + RSC_DOCKINGWINDOW_Y ); + nId = aNmTb.Put( "FloatingMode", VARNAME ); + pClassDockWindow->SetVariable( nId, &aBool, NULL, 0, + RSC_DOCKINGWINDOW_FLOATING ); + + INS_WINBIT(pClassDockWindow,Moveable) + INS_WINBIT(pClassDockWindow,Sizeable) + INS_WINBIT(pClassDockWindow,EnableResizing) + INS_WINBIT(pClassDockWindow,Closeable) + INS_WINBIT(pClassDockWindow,HideWhenDeactivate); + INS_WINBIT(pClassDockWindow,Zoomable); + INS_WINBIT(pClassDockWindow,Dockable); + + return pClassDockWindow; +} + +/************************************************************************* +|* RscTypCont::InitClassToolBoxItem() +*************************************************************************/ +RscTop * RscTypCont::InitClassToolBoxItem( RscTop * pSuper, + RscTop * pClassBitmap, + RscTop * pClassImage, + RscEnum * pTriState ) +{ + HASHID nId; + RscTop * pClassToolBoxItem; + + // Klasse anlegen + nId = pHS->Insert( "ToolBoxItem" ); + pClassToolBoxItem = new RscClass( nId, RSC_TOOLBOXITEM, pSuper ); + aNmTb.Put( nId, CLASSNAME, pClassToolBoxItem ); + + // Variablen anlegen + nId = aNmTb.Put( "Identifier", VARNAME ); + pClassToolBoxItem->SetVariable( nId, &aIdNoZeroUShort, NULL, 0, + RSC_TOOLBOXITEM_ID ); + { + RscEnum * pEnum; + + aBaseLst.Insert( + pEnum = new RscEnum( pHS->Insert( "EnumToolBoxItemType" ), + RSC_NOTYPE ), LIST_APPEND ); + SETCONST( pEnum, "TOOLBOXITEM_BUTTON", TOOLBOXITEM_BUTTON ); + SETCONST( pEnum, "TOOLBOXITEM_SPACE", TOOLBOXITEM_SPACE ); + SETCONST( pEnum, "TOOLBOXITEM_SEPARATOR", TOOLBOXITEM_SEPARATOR ); + SETCONST( pEnum, "TOOLBOXITEM_BREAK", TOOLBOXITEM_BREAK ); + + // Variable einfuegen + nId = aNmTb.Put( "Type", VARNAME ); + pClassToolBoxItem->SetVariable( nId, pEnum, NULL, 0, + RSC_TOOLBOXITEM_TYPE ); + } + { + RscFlag * pFlag; + RscClient * pClient; + HASHID nVarId, nAutoCheckId, nRadioCheckId, nCheckableId, nLeftId, nAutoSizeId, nDropDownId; + + aBaseLst.Insert( pFlag = new RscFlag( pHS->Insert( "FlagToolBoxState" ), + RSC_NOTYPE ), + LIST_APPEND ); + + // Konstanten in Tabelle stellen + nCheckableId = pHS->Insert( "TIB_CHECKABLE" ); + SETCONST( pFlag, nCheckableId, TIB_CHECKABLE ); + nAutoCheckId = pHS->Insert( "TIB_AUTOCHECK" ); + SETCONST( pFlag, nAutoCheckId, TIB_AUTOCHECK ); + nRadioCheckId = pHS->Insert( "TIB_RADIOCHECK" ); + SETCONST( pFlag, nRadioCheckId, TIB_RADIOCHECK ); + nLeftId = pHS->Insert( "TIB_LEFT" ); + SETCONST( pFlag, nLeftId, TIB_LEFT ); + nAutoSizeId = pHS->Insert( "TIB_AUTOSIZE" ); + SETCONST( pFlag, nAutoSizeId, TIB_AUTOSIZE ); + nDropDownId = pHS->Insert( "TIB_DROPDOWN" ); + SETCONST( pFlag, nDropDownId, TIB_DROPDOWN ); + + // Variable einfuegen + nVarId = aNmTb.Put( "_ToolBoxItemFlags", VARNAME ); + pClassToolBoxItem->SetVariable( nVarId, pFlag, NULL, + VAR_HIDDEN | VAR_NOENUM, + RSC_TOOLBOXITEM_STATUS ); + + // Clientvariablen einfuegen + aBaseLst.Insert( + pClient = new RscClient( pHS->Insert( "BOOL" ), RSC_NOTYPE, + pFlag, nCheckableId ), LIST_APPEND ); + nId = aNmTb.Put( "Checkable", VARNAME ); + pClassToolBoxItem->SetVariable( nId, pClient, NULL, VAR_NODATAINST, 0, nVarId ); + + aBaseLst.Insert( + pClient = new RscClient( pHS->Insert( "BOOL" ), RSC_NOTYPE, + pFlag, nAutoCheckId ), LIST_APPEND ); + nId = aNmTb.Put( "AutoCheck", VARNAME ); + pClassToolBoxItem->SetVariable( nId, pClient, NULL, VAR_NODATAINST, 0, nVarId ); + + aBaseLst.Insert( + pClient = new RscClient( pHS->Insert( "BOOL" ), RSC_NOTYPE, + pFlag, nRadioCheckId ), LIST_APPEND ); + nId = aNmTb.Put( "RadioCheck", VARNAME ); + pClassToolBoxItem->SetVariable( nId, pClient, NULL, VAR_NODATAINST, 0, nVarId ); + + aBaseLst.Insert( + pClient = new RscClient( pHS->Insert( "BOOL" ), RSC_NOTYPE, + pFlag, nLeftId ), LIST_APPEND ); + nId = aNmTb.Put( "Left", VARNAME ); + pClassToolBoxItem->SetVariable( nId, pClient, NULL, VAR_NODATAINST, 0, nVarId ); + + aBaseLst.Insert( + pClient = new RscClient( pHS->Insert( "BOOL" ), RSC_NOTYPE, + pFlag, nAutoSizeId ), LIST_APPEND ); + nId = aNmTb.Put( "AutoSize", VARNAME ); + pClassToolBoxItem->SetVariable( nId, pClient, NULL, VAR_NODATAINST, 0, nVarId ); + + aBaseLst.Insert( + pClient = new RscClient( pHS->Insert( "BOOL" ), RSC_NOTYPE, + pFlag, nDropDownId ), LIST_APPEND ); + nId = aNmTb.Put( "DropDown", VARNAME ); + pClassToolBoxItem->SetVariable( nId, pClient, NULL, VAR_NODATAINST, 0, nVarId ); + } + nId = aNmTb.Put( "HelpID", VARNAME ); + pClassToolBoxItem->SetVariable( nId, &aIdLong, NULL, 0, + RSC_TOOLBOXITEM_HELPID ); + nId = aNmTb.Put( "Text", VARNAME ); + pClassToolBoxItem->SetVariable( nId, &aLangString, NULL, 0, + RSC_TOOLBOXITEM_TEXT ); + nId = aNmTb.Put( "HelpText", VARNAME ); + pClassToolBoxItem->SetVariable( nId, &aLangString, NULL, 0, + RSC_TOOLBOXITEM_HELPTEXT ); + nId = aNmTb.Put( "ItemBitmap", VARNAME ); + pClassToolBoxItem->SetVariable( nId, pClassBitmap, NULL, 0, + RSC_TOOLBOXITEM_BITMAP ); + nId = aNmTb.Put( "ItemImage", VARNAME ); + pClassToolBoxItem->SetVariable( nId, pClassImage, NULL, 0, + RSC_TOOLBOXITEM_IMAGE ); + nId = aNmTb.Put( "Disable", VARNAME ); + pClassToolBoxItem->SetVariable( nId, &aBool, NULL, 0, + RSC_TOOLBOXITEM_DISABLE ); + + nId = aNmTb.Put( "State", VARNAME ); + pClassToolBoxItem->SetVariable( nId, pTriState, NULL, 0, + RSC_TOOLBOXITEM_STATE ); + nId = aNmTb.Put( "Hide", VARNAME ); + pClassToolBoxItem->SetVariable( nId, &aBool, NULL, 0, + RSC_TOOLBOXITEM_HIDE ); + nId = aNmTb.Put( "Hide", VARNAME ); + pClassToolBoxItem->SetVariable( nId, &aBool, NULL, 0, + RSC_TOOLBOXITEM_HIDE ); + nId = aNmTb.Put( "Command", VARNAME ); + pClassToolBoxItem->SetVariable( nId, &aString, NULL, 0, + RSC_TOOLBOXITEM_COMMAND ); + + return pClassToolBoxItem; +} + +/************************************************************************* +|* RscTypCont::InitClassToolBox() +*************************************************************************/ +RscTop * RscTypCont::InitClassToolBox( RscTop * pSuper, + RscTop * pClassToolBoxItem, + RscTop * pClassImageList ) +{ + HASHID nId; + RscTop * pClassToolBox; + + // Klasse anlegen + nId = pHS->Insert( "ToolBox" ); + pClassToolBox = new RscClass( nId, RSC_TOOLBOX, pSuper ); + pClassToolBox->SetCallPar( *pWinPar1, *pWinPar2, *pWinParType ); + aNmTb.Put( nId, CLASSNAME, pClassToolBox ); + + // Variablen anlegen + { + RscEnum * pEnum; + + aBaseLst.Insert( + pEnum = new RscEnum( pHS->Insert( "EnumButtonType" ), + RSC_NOTYPE ), LIST_APPEND ); + SETCONST( pEnum, "BUTTON_SYMBOL", BUTTON_SYMBOL ); + SETCONST( pEnum, "BUTTON_TEXT", BUTTON_TEXT ); + SETCONST( pEnum, "BUTTON_SYMBOLTEXT", BUTTON_SYMBOLTEXT ); + + // Variable einfuegen + nId = aNmTb.Put( "ButtonType", VARNAME ); + pClassToolBox->SetVariable( nId, pEnum, NULL, 0, + RSC_TOOLBOX_BUTTONTYPE ); + } + { + RscEnum * pEnum; + + aBaseLst.Insert( + pEnum = new RscEnum( pHS->Insert( "EnumToolBoxAlign" ), + RSC_NOTYPE ), LIST_APPEND ); + SETCONST( pEnum, "BOXALIGN_TOP", BOXALIGN_TOP ); + SETCONST( pEnum, "BOXALIGN_LEFT", BOXALIGN_LEFT ); + SETCONST( pEnum, "BOXALIGN_RIGHT", BOXALIGN_RIGHT ); + SETCONST( pEnum, "BOXALIGN_BOTTOM", BOXALIGN_BOTTOM ); + + // Variable einfuegen + nId = aNmTb.Put( "Align", VARNAME ); + pClassToolBox->SetVariable( nId, pEnum, NULL, 0, + RSC_TOOLBOX_ALIGN ); + } + nId = aNmTb.Put( "LineCount", VARNAME ); + pClassToolBox->SetVariable( nId, &aIdNoZeroUShort, NULL, 0, + RSC_TOOLBOX_LINECOUNT ); + nId = aNmTb.Put( "FloatingLines", VARNAME ); + pClassToolBox->SetVariable( nId, &aUShort, NULL, 0, + RSC_TOOLBOX_FLOATLINES ); + nId = aNmTb.Put( "Customize", VARNAME ); + pClassToolBox->SetVariable( nId, &aBool, NULL, 0, + RSC_TOOLBOX_CUSTOMIZE ); + nId = aNmTb.Put( "MenuStrings", VARNAME ); + pClassToolBox->SetVariable( nId, &aBool, NULL, 0, + RSC_TOOLBOX_MENUSTRINGS ); + nId = aNmTb.Put( "ItemImageList", VARNAME ); + pClassToolBox->SetVariable( nId, pClassImageList, NULL, 0, + RSC_TOOLBOX_ITEMIMAGELIST ); + { + RscCont * pCont; + + aBaseLst.Insert( pCont = new RscCont( pHS->Insert( "ContToolBoxItem" ), + RSC_NOTYPE ), + LIST_APPEND ); + pCont->SetTypeClass( pClassToolBoxItem ); + nId = aNmTb.Put( "ItemList", VARNAME ); + pClassToolBox->SetVariable( nId, pCont, NULL, 0, + RSC_TOOLBOX_ITEMLIST ); + } + INS_WINBIT(pClassToolBox,Scroll) + INS_WINBIT(pClassToolBox,LineSpacing) + INS_WINBIT(pClassToolBox,RectStyle) + + return pClassToolBox; +} + +/************************************************************************* +|* RscTypCont::InitClassStatusBar() +*************************************************************************/ +RscTop * RscTypCont::InitClassStatusBar( RscTop * pSuper ) +{ + HASHID nId; + RscTop * pClassStatusBar; + + // Klasse anlegen + nId = pHS->Insert( "StatusBar" ); + pClassStatusBar = new RscClass( nId, RSC_STATUSBAR, pSuper ); + pClassStatusBar->SetCallPar( *pWinPar1, *pWinPar2, *pWinParType ); + aNmTb.Put( nId, CLASSNAME, pClassStatusBar ); + + // Variablen anlegen + INS_WINBIT(pClassStatusBar,Left) + INS_WINBIT(pClassStatusBar,Right) + + return pClassStatusBar; +} + +/************************************************************************* +|* RscTypCont::InitClassMoreButton() +*************************************************************************/ +RscTop * RscTypCont::InitClassMoreButton( RscTop * pSuper, RscEnum * pMapUnit ) +{ + HASHID nId; + RscTop * pClassMoreButton; + + // Klasse anlegen + nId = pHS->Insert( "MoreButton" ); + pClassMoreButton = new RscClass( nId, RSC_MOREBUTTON, pSuper ); + pClassMoreButton->SetCallPar( *pWinPar1, *pWinPar2, *pWinParType ); + aNmTb.Put( nId, CLASSNAME, pClassMoreButton ); + + // Variablen anlegen + nId = aNmTb.Put( "State", VARNAME ); + pClassMoreButton->SetVariable( nId, &aBool, NULL, 0, + RSC_MOREBUTTON_STATE ); + nId = aNmTb.Put( "MapUnit", VARNAME ); + pClassMoreButton->SetVariable( nId, pMapUnit, NULL, 0, + RSC_MOREBUTTON_MAPUNIT ); + nId = aNmTb.Put( "Delta", VARNAME ); + pClassMoreButton->SetVariable( nId, &aUShort, NULL, 0, + RSC_MOREBUTTON_DELTA ); + + return pClassMoreButton; +} + +/************************************************************************* +|* RscTypCont::InitClassFloatingWindow() +*************************************************************************/ +RscTop * RscTypCont::InitClassFloatingWindow( RscTop * pSuper, + RscEnum * pMapUnit ) +{ + HASHID nId; + RscTop * pClassFloatingWindow; + + // Klasse anlegen + nId = pHS->Insert( "FloatingWindow" ); + pClassFloatingWindow = new RscClass( nId, RSC_FLOATINGWINDOW, pSuper ); + pClassFloatingWindow->SetCallPar( *pWinPar1, *pWinPar2, *pWinParType ); + aNmTb.Put( nId, CLASSNAME, pClassFloatingWindow ); + + // Variablen anlegen + nId = aNmTb.Put( "_ZoomInMapMode", VARNAME ); + pClassFloatingWindow->SetVariable( nId, pMapUnit, NULL, 0, + RSC_FLOATINGWINDOW_WHMAPMODE ); + nId = aNmTb.Put( "_ZoomInWidth", VARNAME ); + pClassFloatingWindow->SetVariable( nId, &aShort, NULL, 0, + RSC_FLOATINGWINDOW_WIDTH ); + nId = aNmTb.Put( "_ZoomInHeight", VARNAME ); + pClassFloatingWindow->SetVariable( nId, &aShort, NULL, 0, + RSC_FLOATINGWINDOW_HEIGHT ); + nId = aNmTb.Put( "ZoomIn", VARNAME ); + pClassFloatingWindow->SetVariable( nId, &aBool, NULL, 0, + RSC_FLOATINGWINDOW_ZOOMIN ); + + INS_WINBIT(pClassFloatingWindow,Zoomable) + INS_WINBIT(pClassFloatingWindow,HideWhenDeactivate) + INS_WINBIT(pClassFloatingWindow,EnableResizing) + + return pClassFloatingWindow; +} + +/************************************************************************* +|* RscTypCont::InitClassTabControlItem() +*************************************************************************/ +RscTop * RscTypCont::InitClassTabControlItem( RscTop * pSuper, + RscTop * pClassTabPage ) +{ + HASHID nId; + RscTop * pClassTabControlItem; + + // Klasse anlegen + nId = pHS->Insert( "PageItem" ); + pClassTabControlItem = new RscClass( nId, RSC_TABCONTROLITEM, pSuper ); + aNmTb.Put( nId, CLASSNAME, pClassTabControlItem ); + + // Variablen anlegen + nId = aNmTb.Put( "Identifier", VARNAME ); + pClassTabControlItem->SetVariable( nId, &aIdNoZeroUShort, NULL, 0, + RSC_TABCONTROLITEM_ID ); + nId = aNmTb.Put( "Text", VARNAME ); + pClassTabControlItem->SetVariable( nId, &aLangString, NULL, 0, + RSC_TABCONTROLITEM_TEXT ); + nId = aNmTb.Put( "PageResID", VARNAME ); + pClassTabControlItem->SetVariable( nId, &aIdUShort, NULL, 0, + RSC_TABCONTROLITEM_PAGERESID ); + + return pClassTabControlItem; +} + +/************************************************************************* +|* RscTypCont::InitClassTabControl() +*************************************************************************/ +RscTop * RscTypCont::InitClassTabControl( RscTop * pSuper, + RscTop * pClassTabControlItem ) +{ + HASHID nId; + RscTop * pClassTabControl; + + // Klasse anlegen + nId = pHS->Insert( "TabControl" ); + pClassTabControl = new RscClass( nId, RSC_TABCONTROL, pSuper ); + pClassTabControl->SetCallPar( *pStdPar1, *pStdPar2, *pStdParType ); + aNmTb.Put( nId, CLASSNAME, pClassTabControl ); + + // Variablen anlegen + { + RscCont * pCont; + + aBaseLst.Insert( pCont = new RscCont( pHS->Insert( "ContTabControlItem" ), + RSC_NOTYPE ), + LIST_APPEND ); + pCont->SetTypeClass( pClassTabControlItem ); + nId = aNmTb.Put( "PageList", VARNAME ); + pClassTabControl->SetVariable( nId, pCont, NULL, 0, + RSC_TABCONTROL_ITEMLIST ); + } + + return pClassTabControl; +} + +/************************************************************************* +|* RscTypCont::InitClassSfxFamilyStyleItem() +*************************************************************************/ +RscTop * RscTypCont::InitClassSfxStyleFamilyItem( RscTop * pSuper, + RscTop * pClassBitmap, + RscTop * pClassImage, + RscArray * pStrLst ) +{ + HASHID nId; + RscTop * pClassSfxFamilyStyleItem; + + // Klasse anlegen + nId = pHS->Insert( "SfxStyleFamilyItem" ); + pClassSfxFamilyStyleItem = new RscClass( nId, RSC_SFX_STYLE_FAMILY_ITEM, pSuper ); + aNmTb.Put( nId, CLASSNAME, pClassSfxFamilyStyleItem ); + + nId = aNmTb.Put( "FilterList", VARNAME ); + pClassSfxFamilyStyleItem->SetVariable( nId, pStrLst, NULL, 0, + RSC_SFX_STYLE_ITEM_LIST ); + nId = aNmTb.Put( "StyleBitmap", VARNAME ); + pClassSfxFamilyStyleItem->SetVariable( nId, pClassBitmap, NULL, 0, + RSC_SFX_STYLE_ITEM_BITMAP ); + nId = aNmTb.Put( "Text", VARNAME ); + pClassSfxFamilyStyleItem->SetVariable( nId, &aLangString, NULL, 0, + RSC_SFX_STYLE_ITEM_TEXT ); + nId = aNmTb.Put( "HelpText", VARNAME ); + pClassSfxFamilyStyleItem->SetVariable( nId, &aLangString, NULL, 0, + RSC_SFX_STYLE_ITEM_HELPTEXT ); + { + RscEnum * pSfxStyleFamily; + pSfxStyleFamily = new RscEnum( pHS->Insert( "StyleFamily" ), + RSC_NOTYPE ); + + SETCONST( pSfxStyleFamily, "SFX_STYLE_FAMILY_PARA", SFX_STYLE_FAMILY_PARA ); + SETCONST( pSfxStyleFamily, "SFX_STYLE_FAMILY_CHAR", SFX_STYLE_FAMILY_CHAR ); + SETCONST( pSfxStyleFamily, "SFX_STYLE_FAMILY_FRAME",SFX_STYLE_FAMILY_FRAME); + SETCONST( pSfxStyleFamily, "SFX_STYLE_FAMILY_PAGE", SFX_STYLE_FAMILY_PAGE ); + SETCONST( pSfxStyleFamily, "SFX_STYLE_FAMILY_PSEUDO", SFX_STYLE_FAMILY_PSEUDO ); + aBaseLst.Insert( pSfxStyleFamily ); + + nId = aNmTb.Put( "StyleFamily", VARNAME ); + pClassSfxFamilyStyleItem->SetVariable( nId, pSfxStyleFamily, NULL, 0, + RSC_SFX_STYLE_ITEM_STYLEFAMILY ); + } + nId = aNmTb.Put( "StyleImage", VARNAME ); + pClassSfxFamilyStyleItem->SetVariable( nId, pClassImage, NULL, 0, + RSC_SFX_STYLE_ITEM_IMAGE ); + return pClassSfxFamilyStyleItem; +} + +/************************************************************************* +|* RscTypCont::InitClassSfxTemplateDialogm() +*************************************************************************/ +RscTop * RscTypCont::InitClassSfxTemplateDialog( RscTop * pSuper, + RscTop * pClassFamilyStyleItem ) +{ + HASHID nId; + RscTop * pClassSfxTemplateDialog; + + // Klasse anlegen + nId = pHS->Insert( "SfxStyleFamilies" ); + pClassSfxTemplateDialog = new RscClass( nId, RSC_SFX_STYLE_FAMILIES, pSuper ); + aNmTb.Put( nId, CLASSNAME, pClassSfxTemplateDialog ); + + // Variablen anlegen + { + RscCont * pCont; + + aBaseLst.Insert( pCont = new RscCont( + pHS->Insert( "ContFamilyStyleItem" ), + RSC_NOTYPE ), + LIST_APPEND ); + pCont->SetTypeClass( pClassFamilyStyleItem ); + nId = aNmTb.Put( "StyleFamilyList", VARNAME ); + pClassSfxTemplateDialog->SetVariable( nId, pCont ); + } + + return pClassSfxTemplateDialog; +} + +/************************************************************************* +|* RscTypCont::InitClassSfxSlotInfo() +*************************************************************************/ +RscTop * RscTypCont::InitClassSfxSlotInfo( RscTop * pSuper ) +{ + HASHID nId; + RscTop * pClassSfxSlotInfo; + + // Klasse anlegen + nId = pHS->Insert( "SfxSlotInfo" ); + pClassSfxSlotInfo = new RscClass( nId, RSC_SFX_SLOT_INFO, pSuper ); + aNmTb.Put( nId, CLASSNAME, pClassSfxSlotInfo ); + + nId = aNmTb.Put( "SlotName", VARNAME ); + pClassSfxSlotInfo->SetVariable( nId, &aLangString, NULL, 0, + RSC_SFX_SLOT_INFO_SLOTNAME ); + nId = aNmTb.Put( "HelpText", VARNAME ); + pClassSfxSlotInfo->SetVariable( nId, &aLangString, NULL, 0, + RSC_SFX_SLOT_INFO_HELPTEXT ); + return pClassSfxSlotInfo; +} + + diff --git a/rsc/source/parser/rscinit.cxx b/rsc/source/parser/rscinit.cxx new file mode 100644 index 000000000000..cee22a6cbdca --- /dev/null +++ b/rsc/source/parser/rscinit.cxx @@ -0,0 +1,1037 @@ +/************************************************************************* + * + * $RCSfile: rscinit.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: hr $ $Date: 2000-09-18 16:42:55 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +/****************** I N C L U D E S **************************************/ +#pragma hdrstop + +// C and C++ Includes. +#include +#include + +#include +#include + +// Programmabhaengige Includes. +#ifndef _RSCTREE_HXX +#include +#endif +#ifndef _RSCTOP_HXX +#include +#endif +#ifndef _RSCRANGE_HXX +#include +#endif +#ifndef _RSCCONST_HXX +#include +#endif +#ifndef _RSCFLAG_HXX +#include +#endif +#ifndef _RSCSTR_HXX +#include +#endif +#ifndef _RSCCONT_HXX +#include +#endif +#ifndef _RSCMGR_HXX +#include +#endif +#ifndef _RSCCLASS_HXX +#include +#endif +#ifndef _RSCKEY_HXX +#include +#endif +#ifndef _RSCDB_HXX +#include +#endif + +#include "rsclex.hxx" +#include + +/****************** M a c r o s ******************************************/ +#define INS_WINBIT( pClass, WinBit ) \ + InsWinBit( pClass, #WinBit, n##WinBit##Id ); + +/****************** C O D E **********************************************/ +void NameToVerCtrl( RSCINST & aVersion, RscTop * pClass, + RscTop * pClassString ) +{ + if( pClass ) + { + NameToVerCtrl( aVersion, (RscTop *)pClass->Left(), pClassString ); + { + RSCINST aVI; + RSCINST aStr; + + // Namen in Versionskontrolle einsetzen + aVersion.pClass-> + GetElement( aVersion, RscId( pClass->GetTypId() ), + pClassString, RSCINST(), &aVI ); + aStr = aVI.pClass->GetVariable( aVI, pHS->Insert( "TEXT" ), + RSCINST() ); + aStr.pClass->SetString( aStr, pHS->Get( pClass->GetId() ) ); + } + NameToVerCtrl( aVersion, (RscTop *)pClass->Right(), pClassString ); + } +} + +/************************************************************************* +|* +|* RscTypCont::Init() +|* +|* Beschreibung +|* Ersterstellung MM 22.03.91 +|* Letzte Aenderung MM 27.06.91 +|* +*************************************************************************/ +void RscTypCont::Init() +{ + RscEnum * pDateFormat; + RscEnum * pTimeFormat; + RscEnum * pWeekDayFormat; + RscEnum * pMonthFormat; + RscEnum * pFieldUnits; + RscEnum * pDayOfWeek; + RscEnum * pTimeFieldFormat; + RscEnum * pColor; + RscEnum * pMapUnit; + RscEnum * pKey; + RscEnum * pTriState; + RscEnum * pMessButtons; + RscEnum * pMessDefButton; + RscTupel * pGeometry; + RscArray * pLangGeometry; + RscCont * pStringList; + RscArray * pLangStringList; + RscTupel * pStringTupel; + RscTupel * pStringLongTupel; + RscCont * pStringTupelList; + RscCont * pStringLongTupelList; + RscArray * pLangStringTupelList; + RscArray * pLangStringLongTupelList; + + RscTop * pClassMgr; + RscTop * pClassString; + RscTop * pClassStringArray; + RscTop * pClassBitmap; + RscTop * pClassColor; + RscTop * pClassImage; + RscTop * pClassImageList; + RscTop * pClassWindow; + RscTop * pClassSystemWindow; + RscTop * pClassWorkWindow; + RscTop * pClassDialog; + RscTop * pClassModalDialog; + RscTop * pClassModelessDialog; + RscTop * pClassControl; + RscTop * pClassButton; + RscTop * pClassCheckBox; + RscTop * pClassPushButton; + RscTop * pClassOKButton; + RscTop * pClassCancelButton; + RscTop * pClassHelpButton; + RscTop * pClassRadioButton; + RscTop * pClassImageRadioButton; + RscTop * pClassImageButton; + RscTop * pClassTriStateBox; + RscTop * pClassEdit; + RscTop * pClassMultiLineEdit; + RscTop * pClassScrollBar; + RscTop * pClassListBox; + RscTop * pClassMultiListBox; + RscTop * pClassComboBox; + RscTop * pClassFixedText; + RscTop * pClassFixedBitmap; + RscTop * pClassFixedImage; + RscTop * pClassGroupBox; + RscTop * pClassKeyCode; + RscTop * pLangClassKeyCode; + RscTop * pClassAccelItem; + RscTop * pClassAccel; + RscTop * pClassMenuItem; + RscTop * pClassMenu; + RscTop * pClassMenuButton; + RscTop * pClassMessBox; + RscTop * pClassInfoBox; + RscTop * pClassWarningBox; + RscTop * pClassErrorBox; + RscTop * pClassQueryBox; + RscTop * pClassSplitter; + RscTop * pClassSplitWindow; + RscTop * pClassSpinButton; + RscTop * pClassTime; + RscTop * pClassDate; + RscTop * pClassI12; + RscTop * pLangClassI12; + RscTop * pClassSpinField; + RscTop * pClassPatternField; + RscTop * pClassNumericField; + RscTop * pClassMetricField; + RscTop * pClassCurrencyField; + RscTop * pClassLongCurrencyField; + RscTop * pClassDateField; + RscTop * pClassTimeField; + RscTop * pClassPatternBox; + RscTop * pClassNumericBox; + RscTop * pClassMetricBox; + RscTop * pClassCurrencyBox; + RscTop * pClassLongCurrencyBox; + RscTop * pClassDateBox; + RscTop * pClassTimeBox; + RscTop * pClassDockingWindow; + RscTop * pClassToolBoxItem; + RscTop * pClassToolBox; + RscTop * pClassStatusBar; + RscTop * pClassMoreButton; + RscTop * pClassFloatingWindow; + RscTop * pClassTabPage; + RscTop * pClassTabDialog; + RscTop * pClassTabControlItem; + RscTop * pClassTabControl; + RscTop * pClassFixedLine; + RscTop * pClassScrollBarBox; + RscTop * pClassSfxStyleFamilyItem; + RscTop * pClassSfxTemplateDialog; + RscTop * pClassSfxSlotInfo; + + HASHID nId; + + aNmTb.SetSort( FALSE ); +{ + /********** C O M P I L E R T Y P E N ******************************/ + aNmTb.Put( "LINE", (USHORT)LINE, (long)0 ); + aNmTb.Put( "NOT", (USHORT)NOT, (long)0 ); + aNmTb.Put( "DEFINE", (USHORT)DEFINE, (long)0 ); + aNmTb.Put( "INCLUDE", (USHORT)INCLUDE, (long)0 ); + aNmTb.Put( "DEFAULT", (USHORT)DEFAULT, (long)0 ); + aNmTb.Put( "class", (USHORT)CLASS, (long)0 ); + aNmTb.Put( "extendable", (USHORT)EXTENDABLE, (long)0 ); + aNmTb.Put( "writeifset", (USHORT)WRITEIFSET, (long)0 ); + +/* Werte fuer Aufzaehlungstypen */ + aNmTb.Put( "TRUE", (USHORT)BOOLEAN, (long)TRUE ); + aNmTb.Put( "FALSE", (USHORT)BOOLEAN, (long)FALSE ); + +/* Vordefinierte HilfeId's */ + aNmTb.Put( "HELP_INDEX", (USHORT)NUMBER, HELP_INDEX ); + aNmTb.Put( "HELP_HELPONHELP", (USHORT)NUMBER, HELP_HELPONHELP ); + + aNmTb.Put( "XSCALE", (USHORT)XSCALE , (long)0 ); + aNmTb.Put( "YSCALE", (USHORT)YSCALE , (long)0 ); + aNmTb.Put( "RGB", (USHORT)RGB , (long)0 ); + aNmTb.Put( "POSSIZE", (USHORT)GEOMETRY, (long)0 ); + aNmTb.Put( "POS", (USHORT)POSITION, (long)0 ); + aNmTb.Put( "SIZE", (USHORT)DIMENSION, (long)0 ); + aNmTb.Put( "ZoomInOutputSize", (USHORT)INZOOMOUTPUTSIZE,(long)0 ); + aNmTb.Put( "FloatingPos", (USHORT)FLOATINGPOS, (long)0 ); +} + /********** B A S I S T Y P E N ************************************/ +{ + /********** S H O R T ************************************************/ + aShort.SetRange( -32768, 32767 ); + + /********** U S H O R T **********************************************/ + aUShort.SetRange( 0, 0xFFFF ); + + /********** L O N G **************************************************/ + aLong.SetRange( -0x80000000, 0x7FFFFFFF ); + aEnumLong.SetRange( -0x80000000, 0x7FFFFFFF ); + + /********** I D U S H O R T ******************************************/ + aIdUShort.SetRange( 0, 0xFFFF ); + + /********** I D N O Z E R O U S H O R T ******************************/ + aIdNoZeroUShort.SetRange( 1, 0xFFFF ); + + /********** N O Z E R O S H O R T ************************************/ + aNoZeroShort.SetRange( -32768, 32767 ); + aNoZeroShort.SetOutRange( 0 ); + + /********** R A N G E S H O R T **************************************/ + a1to12Short.SetRange( 1, 12 ); + a0to23Short.SetRange( 0, 23 ); + a1to31Short.SetRange( 1, 31 ); + a0to59Short.SetRange( 0, 59 ); + a0to99Short.SetRange( 0, 99 ); + a0to9999Short.SetRange( 0, 9999 ); + + /********** I D R A N G E ********************************************/ + aIdLong.SetRange( -0x80000000, 0x7FFFFFFF ); +} +{ + /********** W I N B I T S F L A G ************************************/ + // Variablenname fuer WinBits + nWinBitVarId = aNmTb.Put( "_WinBits", VARNAME ); + + // Windows + nBorderId = pHS->Insert( "WB_BORDER" ); + aWinBits.SetConstant( nBorderId, WB_BORDER ); + nHideId = pHS->Insert( "WB_HIDE" ); + aWinBits.SetConstant( nHideId, WB_HIDE ); + nClipChildrenId = pHS->Insert( "WB_CLIPCHILDREN" ); + aWinBits.SetConstant( nClipChildrenId, WB_CLIPCHILDREN ); + nSizeableId = pHS->Insert( "WB_SIZEABLE" ); + aWinBits.SetConstant( nSizeableId, WB_SIZEABLE ); + nMoveableId = pHS->Insert( "WB_MOVEABLE" ); + aWinBits.SetConstant( nMoveableId, WB_MOVEABLE ); + nMinimizeId = pHS->Insert( "WB_MINABLE" ); + aWinBits.SetConstant( nMinimizeId, WB_MINABLE ); + nMaximizeId = pHS->Insert( "WB_MAXABLE" ); + aWinBits.SetConstant( nMaximizeId, WB_MAXABLE ); + nCloseableId = pHS->Insert( "WB_CLOSEABLE" ); + aWinBits.SetConstant( nCloseableId, WB_CLOSEABLE ); + nAppId = pHS->Insert( "WB_APP" ); + aWinBits.SetConstant( nAppId, WB_APP ); + nTabstopId = pHS->Insert( "WB_TABSTOP" ); + aWinBits.SetConstant( nTabstopId, WB_TABSTOP ); + nGroupId = pHS->Insert( "WB_GROUP" ); + aWinBits.SetConstant( nGroupId, WB_GROUP ); + nSysmodalId = pHS->Insert( "WB_SYSMODAL" ); + aWinBits.SetConstant( nSysmodalId, WB_SYSMODAL ); +} +{ + nLeftId = pHS->Insert( "WB_LEFT" ); + aWinBits.SetConstant( nLeftId, WB_LEFT ); + nCenterId = pHS->Insert( "WB_CENTER" ); + aWinBits.SetConstant( nCenterId, WB_CENTER ); + nRightId = pHS->Insert( "WB_RIGHT" ); + aWinBits.SetConstant( nRightId, WB_RIGHT ); + nHscrollId = pHS->Insert( "WB_HSCROLL" ); + aWinBits.SetConstant( nHscrollId, WB_HSCROLL ); + nVscrollId = pHS->Insert( "WB_VSCROLL" ); + aWinBits.SetConstant( nVscrollId, WB_VSCROLL ); + nSortId = pHS->Insert( "WB_SORT" ); + aWinBits.SetConstant( nSortId, WB_SORT ); + nDefaultId = pHS->Insert( "WB_DEFBUTTON" ); + aWinBits.SetConstant( nDefaultId, WB_DEFBUTTON ); + nRepeatId = pHS->Insert( "WB_REPEAT" ); + aWinBits.SetConstant( nRepeatId, WB_REPEAT ); + nSVLookId = pHS->Insert( "WB_SVLOOK" ); + aWinBits.SetConstant( nSVLookId, WB_SVLOOK ); + nDropDownId = pHS->Insert( "WB_DROPDOWN" ); + aWinBits.SetConstant( nDropDownId, WB_DROPDOWN ); + nPassWordId = pHS->Insert( "WB_PASSWORD" ); + aWinBits.SetConstant( nPassWordId, WB_PASSWORD ); + nReadOnlyId = pHS->Insert( "WB_READONLY" ); + aWinBits.SetConstant( nReadOnlyId, WB_READONLY ); + nAutoSizeId = pHS->Insert( "WB_AUTOSIZE" ); + aWinBits.SetConstant( nAutoSizeId, WB_AUTOSIZE ); + nSpinId = pHS->Insert( "WB_SPIN" ); + aWinBits.SetConstant( nSpinId, WB_SPIN ); + nTabControlId = pHS->Insert( "WB_DIALOGCONTROL" ); + aWinBits.SetConstant( nTabControlId, WB_DIALOGCONTROL ); + nSimpleModeId = pHS->Insert( "WB_SIMPLEMODE" ); + aWinBits.SetConstant( nSimpleModeId, WB_SIMPLEMODE ); + nDragId = pHS->Insert( "WB_DRAG" ); + aWinBits.SetConstant( nDragId, WB_DRAG ); + nSaveAsId = pHS->Insert( "WB_SAVEAS" ); + aWinBits.SetConstant( nSaveAsId, WB_SAVEAS ); + nOpenId = pHS->Insert( "WB_OPEN" ); + aWinBits.SetConstant( nOpenId, WB_OPEN ); + nScrollId = pHS->Insert( "WB_SCROLL" ); + aWinBits.SetConstant( nScrollId, WB_SCROLL ); + nZoomableId = pHS->Insert( "WB_ZOOMABLE" ); + aWinBits.SetConstant( nZoomableId, WB_ROLLABLE ); + nHideWhenDeactivateId = pHS->Insert( "WB_HIDEWHENDEACTIVATE" ); + aWinBits.SetConstant( nHideWhenDeactivateId, WB_HIDEWHENDEACTIVATE ); + nAutoHScrollId = pHS->Insert( "WB_AUTOHSCROLL" ); + aWinBits.SetConstant( nAutoHScrollId, WB_AUTOHSCROLL ); + nDDExtraWidthId = pHS->Insert( "WB_DDEXTRAWIDTH" ); + aWinBits.SetConstant( nDDExtraWidthId, WB_DDEXTRAWIDTH ); + nWordBreakId = pHS->Insert( "WB_WORDBREAK" ); + aWinBits.SetConstant( nWordBreakId, WB_WORDBREAK ); + nLeftLabelId = pHS->Insert( "WB_LEFTLABEL" ); + aWinBits.SetConstant( nLeftLabelId, WB_LEFTLABEL ); + nHasLinesId = pHS->Insert( "WB_HASLINES" ); + aWinBits.SetConstant( nHasLinesId, WB_HASLINES ); + nHasButtonsId = pHS->Insert( "WB_HASBUTTONS" ); + aWinBits.SetConstant( nHasButtonsId, WB_HASBUTTONS ); + nRectStyleId = pHS->Insert( "WB_RECTSTYLE" ); + aWinBits.SetConstant( nRectStyleId, WB_RECTSTYLE ); + nLineSpacingId = pHS->Insert( "WB_LINESPACING" ); + aWinBits.SetConstant( nLineSpacingId, WB_LINESPACING ); + nSmallStyleId = pHS->Insert( "WB_SMALLSTYLE" ); + aWinBits.SetConstant( nSmallStyleId, WB_SMALLSTYLE ); + nEnableResizingId = pHS->Insert( "WB_ENABLERESIZING" ); + aWinBits.SetConstant( nEnableResizingId, WB_ENABLERESIZING ); + nDockableId = pHS->Insert( "WB_DOCKABLE" ); + aWinBits.SetConstant( nDockableId, WB_DOCKABLE ); + nScaleId = pHS->Insert( "WB_SCALE" ); + aWinBits.SetConstant( nScaleId, WB_SCALE ); + nIgnoreTabId = pHS->Insert( "WB_IGNORETAB" ); + aWinBits.SetConstant( nIgnoreTabId, WB_IGNORETAB ); + nNoSplitDrawId = pHS->Insert( "WB_NOSPLITDRAW" ); + aWinBits.SetConstant( nNoSplitDrawId, WB_NOSPLITDRAW ); + nTopImageId = pHS->Insert( "WB_TOPIMAGE" ); + aWinBits.SetConstant( nTopImageId, WB_TOPIMAGE ); + nNoLabelId = pHS->Insert( "WB_NOLABEL" ); + aWinBits.SetConstant( nNoLabelId, WB_NOLABEL ); +} +{ + /********** I n i t B a s i c T y p e s **************************/ + InitLangType(); + aBaseLst.Insert( pDateFormat = InitDateFormatType(), LIST_APPEND ); + aBaseLst.Insert( pTimeFormat = InitTimeFormatType(), LIST_APPEND ); + aBaseLst.Insert( pWeekDayFormat = InitWeekDayFormatType(), LIST_APPEND ); + aBaseLst.Insert( pMonthFormat = InitMonthFormatType(), LIST_APPEND ); + aBaseLst.Insert( pFieldUnits = InitFieldUnitsType(), LIST_APPEND ); + aBaseLst.Insert( pDayOfWeek = InitDayOfWeekType(), LIST_APPEND ); + aBaseLst.Insert( pTimeFieldFormat = InitTimeFieldFormat(), LIST_APPEND ); + aBaseLst.Insert( pColor = InitColor(), LIST_APPEND ); + aBaseLst.Insert( pMapUnit = InitMapUnit(), LIST_APPEND ); + aBaseLst.Insert( pKey = InitKey(), LIST_APPEND ); + aBaseLst.Insert( pTriState = InitTriState(), LIST_APPEND ); + aBaseLst.Insert( pMessButtons = InitMessButtons(), LIST_APPEND ); + aBaseLst.Insert( pMessDefButton = InitMessDefButton(), LIST_APPEND ); + + aBaseLst.Insert( pGeometry = InitGeometry(), LIST_APPEND ); + aBaseLst.Insert( pLangGeometry = InitLangGeometry( pGeometry ), + LIST_APPEND ); + aBaseLst.Insert( pStringList = InitStringList(), LIST_APPEND ); + aBaseLst.Insert( pLangStringList = InitLangStringList( pStringList ), + LIST_APPEND ); + aBaseLst.Insert( pStringTupel = InitStringTupel(), LIST_APPEND ); + aBaseLst.Insert( pStringTupelList = InitStringTupelList( pStringTupel ), + LIST_APPEND ); + aBaseLst.Insert( pLangStringTupelList = + InitLangStringTupelList( pStringTupelList ), LIST_APPEND ); + aBaseLst.Insert( pStringLongTupel = InitStringLongTupel(), LIST_APPEND ); + aBaseLst.Insert( pStringLongTupelList = InitStringLongTupelList( pStringLongTupel ), + LIST_APPEND ); + aBaseLst.Insert( pLangStringLongTupelList = + InitLangStringLongTupelList( pStringLongTupelList ), LIST_APPEND ); +} +{ + /********** R E S O U R C E T Y P E N ******************************/ + /********** R S C M G R **********************************************/ + pRoot = pClassMgr = InitClassMgr(); + + /********** V e r s i o n s k o n t r o l l e ************************/ + aVersion.pClass = new RscClass( pHS->Insert( "VersionControl" ), + RSC_VERSIONCONTROL, pClassMgr ); + aVersion = aVersion.pClass->Create( NULL, RSCINST() ); + + /********** S T R I N G **********************************************/ + pClassString = InitClassString( pClassMgr ); + pRoot->Insert( pClassString ); + + // String als Referenzklasse des Basisstrings einsetzen + aString.SetRefClass( pClassString ); + + /********** S T R I N G L I S T **************************************/ + // Klasse anlegen + nId = pHS->Insert( "StringArray" ); + pClassStringArray = new RscClass( nId, RSC_STRINGARRAY, pClassMgr ); + pClassStringArray->SetCallPar( *pStdPar1, *pStdPar2, *pStdParType ); + aNmTb.Put( nId, CLASSNAME, pClassStringArray ); + pRoot->Insert( pClassStringArray ); + + // Variablen anlegen + nId = aNmTb.Put( "ItemList", VARNAME ); + pClassStringArray->SetVariable( nId, pLangStringLongTupelList ); + + /********** B I T M A P **********************************************/ + pClassBitmap = InitClassBitmap( pClassMgr ); + pRoot->Insert( pClassBitmap ); + +} +{ + /********** C O L O R ************************************************/ + pClassColor = InitClassColor( pClassMgr, pColor ); + pRoot->Insert( pClassColor ); + + /********** I M A G E ************************************************/ + pClassImage = InitClassImage( pClassMgr, pClassBitmap, pClassColor ); + pRoot->Insert( pClassImage ); + + /********** I M A G E L I S T ****************************************/ + pClassImageList = InitClassImageList( pClassMgr, pClassBitmap, pClassColor ); + pRoot->Insert( pClassImageList ); + + /********** W I N D O W **********************************************/ + pClassWindow = InitClassWindow( pClassMgr, pMapUnit, + pLangGeometry ); + pRoot->Insert( pClassWindow ); +} +{ + + /********** S Y S T E M W I N D O W **********************************/ + pClassSystemWindow = InitClassSystemWindow( pClassWindow ); + //aBaseLst.Insert( pClassSystemWindow, LIST_APPEND ); + pRoot->Insert( pClassSystemWindow ); + + /********** W O R K W I N D O W **************************************/ + pClassWorkWindow = InitClassWorkWindow( pClassSystemWindow ); + pRoot->Insert( pClassWorkWindow ); + + /********** D I A L O G **********************************************/ + // Klasse anlegen + pClassDialog = new RscClass( pHS->Insert( "Dialog" ), + RSC_DIALOG, pClassSystemWindow ); + pClassDialog->SetCallPar( *pWinPar1, *pWinPar2, *pWinParType ); + aBaseLst.Insert( pClassDialog, LIST_APPEND ); + + /********** M O D A L D I A L O G ***********************************/ + // Klasse anlegen + pClassModalDialog = InitClassModalDialog( pClassDialog ); + pRoot->Insert( pClassModalDialog ); + + /********** M O D E L E S S D I A L O G ******************************/ + // Klasse anlegen + pClassModelessDialog = InitClassModelessDialog( pClassDialog ); + pRoot->Insert( pClassModelessDialog ); +} +{ + /********** C O N T R O L ********************************************/ + pClassControl = InitClassControl( pClassWindow ); + pRoot->Insert( pClassControl ); + + /********** B U T T O N **********************************************/ + // Klasse anlegen + nId = pHS->Insert( "Button" ); + pClassButton = new RscClass( nId, RSC_BUTTON, pClassControl ); + pClassButton->SetCallPar( *pWinPar1, *pWinPar2, *pWinParType ); + aNmTb.Put( nId, CLASSNAME, pClassButton ); + pRoot->Insert( pClassButton ); + + /********** C H E C K B O X ******************************************/ + // Klasse anlegen + nId = pHS->Insert( "CheckBox" ); + pClassCheckBox = new RscClass( nId, RSC_CHECKBOX, pClassButton ); + pClassCheckBox->SetCallPar( *pWinPar1, *pWinPar2, *pWinParType ); + aNmTb.Put( nId, CLASSNAME, pClassCheckBox ); + pRoot->Insert( pClassCheckBox ); + + // Variablen anlegen + nId = aNmTb.Put( "Check", VARNAME ); + pClassCheckBox->SetVariable( nId, &aBool ); + + /********** P U S H B U T T O N **************************************/ + // Klasse anlegen + pClassPushButton = InitClassPushButton( pClassButton ); + pRoot->Insert( pClassPushButton ); + + /********** H E L P B U T T O N **************************************/ + // Klasse anlegen + nId = pHS->Insert( "HelpButton" ); + pClassHelpButton = new RscClass( nId, RSC_HELPBUTTON, + pClassPushButton ); + pClassHelpButton->SetCallPar( *pWinPar1, *pWinPar2, *pWinParType ); + aNmTb.Put( nId, CLASSNAME, pClassHelpButton ); + pRoot->Insert( pClassHelpButton ); + + /********** O K B U T T O N ******************************************/ + // Klasse anlegen + nId = pHS->Insert( "OKButton" ); + pClassOKButton = new RscClass( nId, RSC_OKBUTTON, + pClassPushButton ); + pClassOKButton->SetCallPar( *pWinPar1, *pWinPar2, *pWinParType ); + aNmTb.Put( nId, CLASSNAME, pClassOKButton ); + pRoot->Insert( pClassOKButton ); + + /********** C A N C E L B U T T O N **********************************/ + // Klasse anlegen + nId = pHS->Insert( "CancelButton" ); + pClassCancelButton = new RscClass( nId, RSC_CANCELBUTTON, + pClassPushButton ); + pClassCancelButton->SetCallPar( *pWinPar1, *pWinPar2, *pWinParType ); + aNmTb.Put( nId, CLASSNAME, pClassCancelButton ); + pRoot->Insert( pClassCancelButton ); +} +{ + /********** R A D I O B U T T O N ************************************/ + // Klasse anlegen + nId = pHS->Insert( "RadioButton" ); + pClassRadioButton = new RscClass( nId, RSC_RADIOBUTTON, pClassButton ); + pClassRadioButton->SetCallPar( *pWinPar1, *pWinPar2, *pWinParType ); + aNmTb.Put( nId, CLASSNAME, pClassRadioButton ); + pRoot->Insert( pClassRadioButton ); + + // Variablen anlegen + nId = aNmTb.Put( "Check", VARNAME ); + pClassRadioButton->SetVariable( nId, &aBool ); + + /********** I m a g e R a d i o B u t t o n **************************/ + nId = pHS->Insert( "ImageRadioButton" ); + pClassImageRadioButton = InitClassImageRadioButton( pClassRadioButton, + pClassImage ); + pRoot->Insert( pClassImageRadioButton ); + + /********** T R I S T A T E B O X ************************************/ + pClassTriStateBox = InitClassTriStateBox( pClassControl, pTriState ); + pRoot->Insert( pClassTriStateBox ); + + /********** I M A G E B U T T O N ************************************/ + pClassImageButton = InitClassImageButton( pClassPushButton, + pClassImage, pTriState ); + pRoot->Insert( pClassImageButton ); + + /********** E D I T **************************************************/ + pClassEdit = InitClassEdit( pClassControl ); + pRoot->Insert( pClassEdit ); + + /********** M U L T I L I N E E D I T ********************************/ + pClassMultiLineEdit = InitClassMultiLineEdit( pClassEdit ); + pRoot->Insert( pClassMultiLineEdit ); + + /********** S C R O L L B A R ****************************************/ + pClassScrollBar = InitClassScrollBar( pClassControl ); + pRoot->Insert( pClassScrollBar ); + +} +{ + /********** L I S T B O X ********************************************/ + pClassListBox = InitClassListBox( pClassControl, pLangStringLongTupelList ); + pRoot->Insert( pClassListBox ); + + /********** M U L T I L I S T B O X **********************************/ + pClassMultiListBox = InitClassMultiListBox( pClassListBox); + pRoot->Insert( pClassMultiListBox ); + + /********** C O M B O B O X ******************************************/ + pClassComboBox = InitClassComboBox( pClassEdit, pLangStringList ); + pRoot->Insert( pClassComboBox ); + + /********** F I X E D T E X T ****************************************/ + pClassFixedText = InitClassFixedText( pClassControl ); + pRoot->Insert( pClassFixedText ); + + /********** F i x e d B i t m a p ************************************/ + pClassFixedBitmap = InitClassFixedBitmap( pClassControl, pClassBitmap ); + pRoot->Insert( pClassFixedBitmap ); + + /********** F i x e d I m a g e **************************************/ + pClassFixedImage = InitClassFixedImage( pClassControl, pClassImage ); + pRoot->Insert( pClassFixedImage ); + + /********** G R O U P B O X ******************************************/ + // Klasse anlegen + nId = pHS->Insert( "GroupBox" ); + pClassGroupBox = new RscClass( nId, RSC_GROUPBOX, pClassControl ); + pClassGroupBox->SetCallPar( *pWinPar1, *pWinPar2, *pWinParType ); + aNmTb.Put( nId, CLASSNAME, pClassGroupBox ); + pRoot->Insert( pClassGroupBox ); + + /********** K E Y C O D E ********************************************/ + pClassKeyCode = InitClassKeyCode( pClassMgr, pKey ); + pRoot->Insert( pClassKeyCode ); + { + pLangClassKeyCode = new RscClassArray( pHS->Insert( "LangKeyCode" ), + RSC_KEYCODE, pClassKeyCode, &aLangType, + &nLangTypeId, &nDfltLangTypeId ); + aBaseLst.Insert( pLangClassKeyCode ); + } + + /********** A C C E L I T E M ***************************************/ + pClassAccelItem = InitClassAccelItem( pClassMgr, pLangClassKeyCode ); + pRoot->Insert( pClassAccelItem ); +} +{ + /********** A C C E L E R A T O R ************************************/ + pClassAccel = InitClassAccel( pClassMgr, pClassAccelItem ); + pRoot->Insert( pClassAccel ); + + /********** A C C E L I T E M ***************************************/ + // pClassAccel ist erst hier definiert + nId = aNmTb.Put( "SubAccelerator", VARNAME ); + pClassAccelItem->SetVariable( nId, pClassAccel, NULL, VAR_SVDYNAMIC, + ACCELITEM_ACCEL ); + + /********** M E N U I T E M ******************************************/ + pClassMenuItem = InitClassMenuItem( pClassMgr, pClassBitmap, + pLangClassKeyCode ); + pRoot->Insert( pClassMenuItem ); + + /********** M E N U **************************************************/ + pClassMenu = InitClassMenu( pClassMgr, pClassMenuItem ); + pRoot->Insert( pClassMenu ); + + /********** M E N U I T E M ******************************************/ + // pClassMenu ist erst hier definiert + nId = aNmTb.Put( "SubMenu", VARNAME ); + pClassMenuItem->SetVariable( nId, pClassMenu, NULL, VAR_SVDYNAMIC, + RSC_MENUITEM_MENU ); + + /********** M E N U B U T T O N **************************************/ + pClassMenuButton = InitClassMenuButton( pClassControl, pClassMenu ); + pRoot->Insert( pClassMenuButton ); + + /********** M E S S A G E B O X **************************************/ + pClassMessBox = InitClassMessBox( pClassMgr, pMessButtons, + pMessDefButton ); + pRoot->Insert( pClassMessBox ); + + /********** I N F O B O X ********************************************/ + // Klasse anlegen + nId = pHS->Insert( "InfoBox" ); + pClassInfoBox = new RscClass( nId, RSC_INFOBOX, pClassMessBox ); + pClassInfoBox->SetCallPar( *pWinPar1, *pWinPar2, *pWinParType ); + aNmTb.Put( nId, CLASSNAME, pClassInfoBox ); + pRoot->Insert( pClassInfoBox ); + + /********** W A R N I N G B O X **************************************/ + // Klasse anlegen + nId = pHS->Insert( "WarningBox" ); + pClassWarningBox = new RscClass( nId, RSC_WARNINGBOX, pClassMessBox ); + pClassWarningBox->SetCallPar( *pWinPar1, *pWinPar2, *pWinParType ); + aNmTb.Put( nId, CLASSNAME, pClassWarningBox ); + pRoot->Insert( pClassWarningBox ); + + /********** E R R O R B O X ******************************************/ + // Klasse anlegen + nId = pHS->Insert( "ErrorBox" ); + pClassErrorBox = new RscClass( nId, RSC_ERRORBOX, pClassMessBox ); + pClassErrorBox->SetCallPar( *pWinPar1, *pWinPar2, *pWinParType ); + aNmTb.Put( nId, CLASSNAME, pClassErrorBox ); + pRoot->Insert( pClassErrorBox ); + + /********** Q U E R Y B O X ******************************************/ + // Klasse anlegen + nId = pHS->Insert( "QueryBox" ); + pClassQueryBox = new RscClass( nId, RSC_QUERYBOX, pClassMessBox ); + pClassQueryBox->SetCallPar( *pWinPar1, *pWinPar2, *pWinParType ); + aNmTb.Put( nId, CLASSNAME, pClassQueryBox ); + pRoot->Insert( pClassQueryBox ); +} +{ + /********** S P L I T T E R ******************************************/ + pClassSplitter = InitClassSplitter( pClassWindow ); + pRoot->Insert( pClassSplitter ); + + /********** S P L I T W I N D O W ************************************/ + pClassSplitWindow = InitClassSplitWindow( pClassWindow ); + pRoot->Insert( pClassSplitWindow ); + + /********** S P I N B U T T O N **************************************/ + // Klasse anlegen + nId = pHS->Insert( "SpinButton" ); + pClassSpinButton = new RscClass( nId, RSC_SPINBUTTON, pClassControl ); + pClassSpinButton->SetCallPar( *pWinPar1, *pWinPar2, *pWinParType ); + aNmTb.Put( nId, CLASSNAME, pClassSpinButton ); + { + RscClient * pClient; + + // Clientvariablen einfuegen + // Sysmodal + aBaseLst.Insert( + pClient = new RscClient( pHS->Insert( "BOOL" ), RSC_NOTYPE, + &aWinBits, nRepeatId ), + LIST_APPEND ); + nId = aNmTb.Put( "Repeat", VARNAME ); + pClassSpinButton->SetVariable( nId, pClient, NULL, + VAR_NODATAINST, 0, nWinBitVarId ); + } + pRoot->Insert( pClassSpinButton ); +} +{ + /********** T I M E **************************************************/ + pClassTime = InitClassTime( pClassMgr ); + pRoot->Insert( pClassTime ); + + /********** D A T E **************************************************/ + pClassDate = InitClassDate( pClassMgr, pDayOfWeek ); + pRoot->Insert( pClassDate ); +} +{ + /********** I N T E R N A T I O N A L ********************************/ + { + RscTop * pClassInt1; + + pClassInt1 = InitClassInt1( pClassMgr, + pDateFormat, pTimeFormat, + pWeekDayFormat, pMonthFormat ); + aBaseLst.Insert( pClassInt1, LIST_APPEND ); + pClassI12 = InitClassInternational( pClassInt1, + pDateFormat, pTimeFormat, + pWeekDayFormat, pMonthFormat ); + pRoot->Insert( pClassI12 ); + } + { + pLangClassI12 = new RscClassArray( pHS->Insert( "LangInternational" ), + RSC_INTERNATIONAL, pClassI12, &aLangType, + &nLangTypeId, &nDfltLangTypeId ); + aBaseLst.Insert( pLangClassI12 ); + } + + /********** S P I N F I E L D ****************************************/ + pClassSpinField = InitClassSpinField( pClassEdit ); + pRoot->Insert( pClassSpinField ); +} +{ + /********** P A T T E R N F I E L D **********************************/ + { // Mehrfachvererbung von Hand + RscTop * pClassTmp = InitClassPatternFormatter( pClassSpinField ); + aBaseLst.Insert( pClassTmp, LIST_APPEND ); + + pClassPatternField = InitClassPatternField( pClassTmp ); + pRoot->Insert( pClassPatternField ); + } + /********** N U M E R I C F I E L D **********************************/ + { // Mehrfachvererbung von Hand + RscTop * pClassTmp = InitClassNumericFormatter( pClassSpinField, + pClassI12 ); + aBaseLst.Insert( pClassTmp, LIST_APPEND ); + + pClassNumericField = InitClassNumericField( pClassTmp ); + pRoot->Insert( pClassNumericField ); + } + /********** M E T R I C F I E L D ************************************/ + { // Mehrfachvererbung von Hand + RscTop * pClassTmp = InitClassNumericFormatter( pClassSpinField, + pClassI12 ); + aBaseLst.Insert( pClassTmp, LIST_APPEND ); + pClassTmp = InitClassMetricFormatter( pClassTmp, pFieldUnits ); + aBaseLst.Insert( pClassTmp, LIST_APPEND ); + + pClassMetricField = InitClassMetricField( pClassTmp ); + pRoot->Insert( pClassMetricField ); + } + /********** C U R R E N C Y F I E L D ********************************/ + { // Mehrfachvererbung von Hand + RscTop * pClassTmp = InitClassNumericFormatter( pClassSpinField, + pClassI12 ); + aBaseLst.Insert( pClassTmp, LIST_APPEND ); + pClassTmp = InitClassCurrencyFormatter( pClassTmp, pFieldUnits ); + aBaseLst.Insert( pClassTmp, LIST_APPEND ); + + pClassCurrencyField = InitClassCurrencyField( "CurrencyField", RSC_CURRENCYFIELD, pClassTmp ); + pRoot->Insert( pClassCurrencyField ); + + pClassLongCurrencyField = InitClassCurrencyField( "LongCurrencyField", RSC_LONGCURRENCYFIELD, pClassTmp ); + pRoot->Insert( pClassLongCurrencyField ); + + } + /********** D A T E F I E L D ****************************************/ + { // Mehrfachvererbung von Hand + RscTop * pClassTmp = InitClassDateFormatter( pClassSpinField, pClassDate, + pClassI12 ); + aBaseLst.Insert( pClassTmp, LIST_APPEND ); + + pClassDateField = InitClassDateField( pClassTmp, pClassDate ); + pRoot->Insert( pClassDateField ); + } + /********** T I M E F I E L D ****************************************/ + { // Mehrfachvererbung von Hand + RscTop * pClassTmp = InitClassTimeFormatter( pClassSpinField, pClassTime, + pClassI12, pTimeFieldFormat ); + aBaseLst.Insert( pClassTmp, LIST_APPEND ); + + pClassTimeField = InitClassTimeField( pClassTmp, pClassTime ); + pRoot->Insert( pClassTimeField ); + } + /********** P A T T E R N B O X **************************************/ + { // Mehrfachvererbung von Hand + RscTop * pClassTmp = InitClassPatternFormatter( pClassComboBox ); + aBaseLst.Insert( pClassTmp, LIST_APPEND ); + + pClassPatternBox = InitClassPatternBox( pClassTmp ); + pRoot->Insert( pClassPatternBox ); + } + /********** N U M E R I C B O X **************************************/ + { // Mehrfachvererbung von Hand + RscTop * pClassTmp = InitClassNumericFormatter( pClassComboBox, + pClassI12 ); + aBaseLst.Insert( pClassTmp, LIST_APPEND ); + + pClassNumericBox = InitClassNumericBox( pClassTmp ); + pRoot->Insert( pClassNumericBox ); + } +} +{ + /********** M E T R I C B O X ****************************************/ + { // Mehrfachvererbung von Hand + RscTop * pClassTmp = InitClassNumericFormatter( pClassComboBox, + pClassI12 ); + aBaseLst.Insert( pClassTmp, LIST_APPEND ); + pClassTmp = InitClassMetricFormatter( pClassTmp, pFieldUnits ); + aBaseLst.Insert( pClassTmp, LIST_APPEND ); + + pClassMetricBox = InitClassMetricBox( pClassTmp ); + pRoot->Insert( pClassMetricBox ); + } + /********** C U R R E N C Y B O X ************************************/ + { // Mehrfachvererbung von Hand + RscTop * pClassTmp = InitClassNumericFormatter( pClassComboBox, + pClassI12 ); + aBaseLst.Insert( pClassTmp, LIST_APPEND ); + pClassTmp = InitClassCurrencyFormatter( pClassTmp, pFieldUnits ); + aBaseLst.Insert( pClassTmp, LIST_APPEND ); + + pClassCurrencyBox = InitClassCurrencyBox( "CurrencyBox", RSC_CURRENCYBOX, pClassTmp ); + pRoot->Insert( pClassCurrencyBox ); + + pClassLongCurrencyBox = InitClassCurrencyBox( "LongCurrencyBox", RSC_LONGCURRENCYBOX, pClassTmp ); + pRoot->Insert( pClassLongCurrencyBox ); + } + /********** D A T E B O X ********************************************/ + { // Mehrfachvererbung von Hand + RscTop * pClassTmp = InitClassDateFormatter( pClassComboBox, pClassDate, + pClassI12 ); + aBaseLst.Insert( pClassTmp, LIST_APPEND ); + + pClassDateBox = InitClassDateBox( pClassTmp, pClassDate ); + pRoot->Insert( pClassDateBox ); + } + /********** T I M E B O X ********************************************/ + { // Mehrfachvererbung von Hand + RscTop * pClassTmp = InitClassTimeFormatter( pClassComboBox, pClassTime, + pClassI12, pTimeFieldFormat ); + aBaseLst.Insert( pClassTmp, LIST_APPEND ); + + pClassTimeBox = InitClassTimeBox( pClassTmp, pClassTime ); + pRoot->Insert( pClassTimeBox ); + } + /********** D O C K I N G W I N D O W ********************************/ + pClassDockingWindow = InitClassDockingWindow( pClassWindow, pMapUnit ); + pRoot->Insert( pClassDockingWindow ); + + /********** T O O L B O X I T E M ************************************/ + pClassToolBoxItem = InitClassToolBoxItem( pClassMgr, pClassBitmap, + pClassImage, pTriState ); + pRoot->Insert( pClassToolBoxItem ); + + /********** T O O L B O X ********************************************/ + pClassToolBox = InitClassToolBox( pClassDockingWindow, pClassToolBoxItem, + pClassImageList ); + pRoot->Insert( pClassToolBox ); + + /********** S T A T U S B A R ****************************************/ + pClassStatusBar = InitClassStatusBar( pClassWindow ); + pRoot->Insert( pClassStatusBar ); + + /********** M O R E B U T T O N **************************************/ + pClassMoreButton = InitClassMoreButton( pClassPushButton, pMapUnit ); + pRoot->Insert( pClassMoreButton ); + + /********** F L O A T W I N D O W ************************************/ + pClassFloatingWindow = InitClassFloatingWindow( pClassSystemWindow, + pMapUnit ); + pRoot->Insert( pClassFloatingWindow ); + + /********** T A B P A G E ********************************************/ + // Klasse anlegen + nId = pHS->Insert( "TabPage" ); + pClassTabPage = + new RscClass( nId, RSC_TABPAGE, pClassWindow ); + pClassTabPage->SetCallPar( *pWinPar1, *pWinPar2, *pWinParType ); + aNmTb.Put( nId, CLASSNAME, pClassTabPage ); + pRoot->Insert( pClassTabPage ); + + /********** T A B D I A L O G ****************************************/ + // Klasse anlegen + nId = pHS->Insert( "TabDialog" ); + pClassTabDialog = + new RscClass( nId, RSC_TABDIALOG, pClassModalDialog ); + pClassTabDialog->SetCallPar( *pWinPar1, *pWinPar2, *pWinParType ); + aNmTb.Put( nId, CLASSNAME, pClassTabDialog ); + pRoot->Insert( pClassTabDialog ); + + /********** T A B C O N T R O L I T E M *******************************/ + pClassTabControlItem = InitClassTabControlItem( pClassMgr, + pClassTabPage ); + pRoot->Insert( pClassTabControlItem ); + + /********** T A B C O N T R O L **************************************/ + pClassTabControl = InitClassTabControl( pClassControl, + pClassTabControlItem ); + pRoot->Insert( pClassTabControl ); + + /********** F I X E D L I N E ****************************************/ + // Klasse anlegen + nId = pHS->Insert( "FixedLine" ); + pClassFixedLine = + new RscClass( nId, RSC_FIXEDLINE, pClassControl ); + pClassFixedLine->SetCallPar( *pWinPar1, *pWinPar2, *pWinParType ); + aNmTb.Put( nId, CLASSNAME, pClassFixedLine ); + pRoot->Insert( pClassFixedLine ); + + /********** S C R O L L B A R B O X **********************************/ + // Klasse anlegen + nId = pHS->Insert( "ScrollBarBox" ); + pClassScrollBarBox = + new RscClass( nId, RSC_SCROLLBARBOX, pClassWindow ); + pClassScrollBarBox->SetCallPar( *pWinPar1, *pWinPar2, *pWinParType ); + aNmTb.Put( nId, CLASSNAME, pClassScrollBarBox ); + pRoot->Insert( pClassScrollBarBox ); + INS_WINBIT(pClassScrollBarBox,Sizeable) + + /********** S F X S T Y L E F A M I L Y I T E M **********************/ + pClassSfxStyleFamilyItem = InitClassSfxStyleFamilyItem( pClassMgr, + pClassBitmap, + pClassImage, + pLangStringLongTupelList ); + pRoot->Insert( pClassSfxStyleFamilyItem ); + + /********** S F X T E M P L A T E D I A L O G ************************/ + pClassSfxTemplateDialog = InitClassSfxTemplateDialog( pClassMgr, + pClassSfxStyleFamilyItem ); + pRoot->Insert( pClassSfxTemplateDialog ); + + /********** S F X I N F O I T E M ************************************/ + pClassSfxSlotInfo = InitClassSfxSlotInfo( pClassMgr ); + pRoot->Insert( pClassSfxSlotInfo ); +} + NameToVerCtrl( aVersion, pRoot, pClassString ); + + aNmTb.SetSort(); +} + diff --git a/rsc/source/parser/rsckey.cxx b/rsc/source/parser/rsckey.cxx new file mode 100644 index 000000000000..43a40e89ad66 --- /dev/null +++ b/rsc/source/parser/rsckey.cxx @@ -0,0 +1,297 @@ +/************************************************************************* + * + * $RCSfile: rsckey.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: hr $ $Date: 2000-09-18 16:42:55 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +/************************************************************************ + + Source Code Control System - Header + + $Header: /zpool/svn/migration/cvs_rep_09_09_08/code/rsc/source/parser/rsckey.cxx,v 1.1.1.1 2000-09-18 16:42:55 hr Exp $ + + Source Code Control System - Update + + $Log: not supported by cvs2svn $ + Revision 1.13 2000/09/17 12:51:11 willem.vandorp + OpenOffice header added. + + Revision 1.12 2000/07/26 17:13:21 willem.vandorp + Headers/footers replaced + + Revision 1.11 1999/10/25 11:48:18 mh + changes for VC6 + + Revision 1.10 1997/08/27 18:17:12 MM + neue Headerstruktur + + + Rev 1.9 27 Aug 1997 18:17:12 MM + neue Headerstruktur + + Rev 1.8 03 Jan 1997 17:07:16 MH + Calling Convention + + Rev 1.7 12 Jan 1996 17:23:40 TRI + WNTWTC Anpassung + + Rev 1.6 21 Nov 1995 19:49:48 TLX + Neuer Link + + Rev 1.5 27 Jul 1995 16:57:36 MM + LongEnumRange + + Rev 1.4 16 Feb 1995 19:51:06 MM + char * -> const char * + +**************************************************************************/ +/****************** I N C L U D E S **************************************/ +#pragma hdrstop + +#include +#include +#include +#include + +#ifndef _RSCALL_H +#include +#endif +#ifndef _RSCTOOLS_HXX +#include +#endif +#ifndef _RSCHASH_HXX +#include +#endif +#ifndef _RSCKEY_HXX +#include +#endif + +#if defined(_MSC_VER) && (_MSC_VER >= 1200 ) +#define _cdecl __cdecl +#endif + +/****************** C o d e **********************************************/ +/****************** keyword sort function ********************************/ +extern "C" { +#if defined( ZTC ) && defined( PM2 ) + int __CLIB KeyCompare( const void * pFirst, const void * pSecond ); +#else +#if defined( WNT ) && !defined( WTC ) && !defined (ICC) + int _cdecl KeyCompare( const void * pFirst, const void * pSecond ); +#else + int KeyCompare( const void * pFirst, const void * pSecond ); +#endif +#endif +} + +#if defined( WNT ) && !defined( WTC ) && !defined(ICC) +int _cdecl KeyCompare( const void * pFirst, const void * pSecond ){ +#else +int KeyCompare( const void * pFirst, const void * pSecond ){ +#endif + if( ((KEY_STRUCT *)pFirst)->nName > ((KEY_STRUCT *)pSecond)->nName ) + return( 1 ); + else if( ((KEY_STRUCT *)pFirst)->nName < ((KEY_STRUCT *)pSecond)->nName ) + return( -1 ); + else + return( 0 ); +} + +/************************************************************************* +|* +|* RscNameTable::RscNameTable() +|* +|* Beschreibung RES.DOC +|* Ersterstellung MM 28.02.91 +|* Letzte Aenderung MM 28.02.91 +|* +*************************************************************************/ +RscNameTable::RscNameTable() { + bSort = TRUE; + nEntries = 0; + pTable = NULL; +}; + +/************************************************************************* +|* +|* RscNameTable::~RscNameTable() +|* +|* Beschreibung +|* Ersterstellung MM 15.05.91 +|* Letzte Aenderung MM 15.05.91 +|* +*************************************************************************/ +RscNameTable::~RscNameTable() { + if( pTable ) + RscMem::Free( pTable ); +}; + + +/************************************************************************* +|* +|* RscNameTable::SetSort() +|* +|* Beschreibung RES.DOC +|* Ersterstellung MM 28.02.91 +|* Letzte Aenderung MM 28.02.91 +|* +*************************************************************************/ +void RscNameTable::SetSort( BOOL bSorted ){ + bSort = bSorted; + if( bSort && pTable){ + // Schluesselwort Feld sortieren + qsort( (void *)pTable, nEntries, + sizeof( KEY_STRUCT ), KeyCompare ); + }; +}; + +/************************************************************************* +|* +|* RscNameTable::Put() +|* +|* Beschreibung RES.DOC +|* Ersterstellung MM 28.02.91 +|* Letzte Aenderung MM 28.02.91 +|* +*************************************************************************/ +HASHID RscNameTable::Put( HASHID nName, USHORT nTyp, long nValue ){ + if( pTable ) + pTable = (KEY_STRUCT *) + RscMem::Realloc( (void *)pTable, + (USHORT)((nEntries +1) * sizeof( KEY_STRUCT )) ); + else + pTable = (KEY_STRUCT *) + RscMem::Malloc( (USHORT)((nEntries +1) + * sizeof( KEY_STRUCT )) ); + pTable[ nEntries ].nName = nName; + pTable[ nEntries ].nTyp = nTyp; + pTable[ nEntries ].yylval = nValue; + nEntries++; + if( bSort ) + SetSort(); + return( nName ); +}; + +HASHID RscNameTable::Put( const char * pName, USHORT nTyp, long nValue ) +{ + return( Put( pHS->Insert( pName ), nTyp, nValue ) ); +}; + +HASHID RscNameTable::Put( HASHID nName, USHORT nTyp ) +{ + return( Put( nName, nTyp, (long)nName ) ); +}; + +HASHID RscNameTable::Put( const char * pName, USHORT nTyp ) +{ + HASHID nId; + + nId = pHS->Insert( pName ); + return( Put( nId, nTyp, (long)nId ) ); +}; + +HASHID RscNameTable::Put( HASHID nName, USHORT nTyp, RscTop * pClass ) +{ + return( Put( nName, nTyp, (long)pClass ) ); +}; + +HASHID RscNameTable::Put( const char * pName, USHORT nTyp, RscTop * pClass ) +{ + return( Put( pHS->Insert( pName ), nTyp, (long)pClass ) ); +}; + +/************************************************************************* +|* +|* RscNameTable::Get() +|* +|* Beschreibung RES.DOC +|* Ersterstellung MM 28.02.91 +|* Letzte Aenderung MM 28.02.91 +|* +*************************************************************************/ +BOOL RscNameTable::Get( HASHID nName, KEY_STRUCT * pEle ){ + KEY_STRUCT * pKey = NULL; + KEY_STRUCT aSearchName; + USHORT i; + + if( bSort ){ + // Suche nach dem Schluesselwort + aSearchName.nName = nName; + pKey = (KEY_STRUCT *)bsearch( +#ifdef UNX + (const char *) &aSearchName, (char *)pTable, +#else + (const void *) &aSearchName, (const void *)pTable, +#endif + nEntries, sizeof( KEY_STRUCT ), KeyCompare ); + } + else{ + i = 0; + while( i < nEntries && !pKey ){ + if( pTable[ i ].nName == nName ) + pKey = &pTable[ i ]; + i++; + }; + }; + + if( pKey ){ // Schluesselwort gefunden + *pEle = *pKey; + return( TRUE ); + }; + return( FALSE ); +}; + diff --git a/rsc/source/parser/rsclex.cxx b/rsc/source/parser/rsclex.cxx new file mode 100644 index 000000000000..33a14d309d57 --- /dev/null +++ b/rsc/source/parser/rsclex.cxx @@ -0,0 +1,588 @@ +/************************************************************************* + * + * $RCSfile: rsclex.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: hr $ $Date: 2000-09-18 16:42:55 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +/************************************************************************ + + Source Code Control System - Header + + $Header: /zpool/svn/migration/cvs_rep_09_09_08/code/rsc/source/parser/rsclex.cxx,v 1.1.1.1 2000-09-18 16:42:55 hr Exp $ + +**************************************************************************/ +#pragma hdrstop +#include +#include +#include +#include +#include + +#ifdef _RSCERROR_H +#include +#endif +#ifndef _RSCHASH_HXX +#include +#endif +#ifndef _RSCDB_HXX +#include +#endif +#ifndef _RSCTOP_HXX +#include +#endif +#ifndef _RSCKEY_HXX +#include +#endif +#ifndef _RSCPAR_HXX +#include +#endif +#ifndef _RSCDEF_HXX +#include +#endif + +#include "rsclex.hxx" +#include + +#include +#include + +DECLARE_LIST( RscCharList, char * ); +/*************************************************************************/ +int c; +BOOL bLastInclude;// War letztes Symbol INCLUDE +RscFileInst* pFI; +RscTypCont* pTC; +RscCharStack * pCS; +RscExpression * pExp; +struct { + int nKeyWord; + YYSTYPE aYYSType; +} aKeyVal[ 1 ]; +BOOL bTargetDefined; + + +/****************** C O D E **********************************************/ +ULONG GetNumber(){ + ULONG l = 0; + short nLog = 10; + + if( '0' == c ){ + c = pFI->GetFastChar(); + if( 'x' == c ){ + nLog = 16; + c = pFI->GetFastChar(); + } + }; + + if( nLog == 16 ){ + while( isxdigit( c ) ){ + if( isdigit( c ) ) + l = l * nLog + (c - '0'); + else + l = l * nLog + (toupper( c ) - 'A' + 10 ); + c = pFI->GetFastChar(); + } + } + else{ + while( isdigit( c ) || 'x' == c ){ + l = l * nLog + (c - '0'); + c = pFI->GetFastChar(); + } + } + + while( c=='U' || c=='u' || c=='l' || c=='L' ) //Wg. Unsigned Longs + c = pFI->GetFastChar(); + + if( l > LONG_MAX ) //Oberstes bit gegebenenfalls abschneiden; + l &= LONG_MAX; + + return( l ); +} + +char * MallocString(){ + char * pRet; + + if( NULL == (pRet = pCS->Pop()) ) + pRet = (char *)RscMem::Malloc( MINBUF ); + + *pRet = '\0'; + + return( pRet ); +} + +void PutStringBack( char * pStr ){ + //pCS->Push( pStr ); +} + +int MakeToken( YYSTYPE * pTokenVal ){ + int c1; + USHORT i; + char * pStr; + + while( TRUE ){ // Kommentare und Leerzeichen ueberlesen + while( isspace( c ) ) + c = pFI->GetFastChar(); + if( '/' == c ){ + c1 = c; + c = pFI->GetFastChar(); + if( '/' == c ){ + while( '\n' != c && !pFI->IsEof() ) + c = pFI->GetFastChar(); + c = pFI->GetFastChar(); + } + else if( '*' == c ){ + c = pFI->GetFastChar(); + do { + while( '*' != c && !pFI->IsEof() ) + c = pFI->GetFastChar(); + c = pFI->GetFastChar(); + } while( '/' != c && !pFI->IsEof() ); + c = pFI->GetFastChar(); + } + else + return( c1 ); + } + else + break; + }; + + if( c == pFI->IsEof() ){ + return( 0 ); + } + + if( bLastInclude ){ + bLastInclude = FALSE; //Zuruecksetzten + if( '<' == c ){ + USHORT nBufLen = MINBUF; + char * pBuf = MallocString(); + + i = 0; + c = pFI->GetFastChar(); + while( '>' != c && !pFI->IsEof() ) + { + if( nBufLen <= (USHORT)(i +1) ) + { + nBufLen += MINBUF; + pBuf = (char *)RscMem::Realloc( pBuf, nBufLen ); + } + pBuf[i++] = c; + c = pFI->GetFastChar(); + }; + c = pFI->GetFastChar(); + pBuf[i] = '\0'; + pTokenVal->string = pBuf; + return( INCLUDE_STRING ); + }; + } + + if( c == '"' ) + { + USHORT nBufLen = MINBUF; + char * pBuf = MallocString(); + + i = 0; + BOOL bDone = FALSE; + while( !bDone && !pFI->IsEof() && c ) + { + if( nBufLen <= (USHORT)(i +2) ) + { + nBufLen += MINBUF; + pBuf = (char *)RscMem::Realloc( pBuf, nBufLen ); + } + c = pFI->GetFastChar(); + if( c == '"' ) + { + c = pFI->GetFastChar(); + if( c == '"' ) + { + pBuf[i++] = '"'; + pBuf[i++] = '"'; + } + else + bDone = TRUE; + } + else if( c == '\\' ) + { + pBuf[i++] = '\\'; + c = pFI->GetFastChar(); + if( c ) + { + pBuf[i++] = c; + } + } + else + pBuf[i++] = c; + } + pBuf[i++] = '\0'; + //pStr = pTokenVal->string = RscChar::MakeUTF8( pBuf, pFI->GetCharSet() ); + pStr = pTokenVal->string = pBuf; + //PutStringBack( pBuf ); + return( STRING ); + } + if (isdigit (c)){ + pTokenVal->value = GetNumber(); + return( NUMBER ); + } + + if( isalpha (c) || (c == '_') ){ + HASHID nHashId; + USHORT nBufLen = MINBUF; + char * pBuf = MallocString(); + + + i = 0; + while( isalnum (c) || (c == '_') ) + { + if( nBufLen <= (USHORT)(i +1) ) + { + nBufLen += MINBUF; + pBuf = (char *)RscMem::Realloc( pBuf, nBufLen ); + } + pBuf[i++] = c; + c = pFI->GetFastChar(); + } + /* + if( pBuf[0] == 'L' && i == 1 && c == '"' ) + { + // it is an L string + + i = 0; + BOOL bDone = FALSE; + while( !bDone && !pFI->IsEof() && c ) + { + if( nBufLen <= (USHORT)(i +2) ) + { + nBufLen += MINBUF; + pBuf = (char *)RscMem::Realloc( pBuf, nBufLen ); + } + c = pFI->GetFastChar(); + if( c == '"' ) + { + c = pFI->GetFastChar(); + if( c == '"' ) + { + pBuf[i++] = '"'; + pBuf[i++] = '"'; + } + else + bDone = TRUE; + } + else if( c == '\\' ) + { + pBuf[i++] = '\\'; + c = pFI->GetFastChar(); + if( c ) + { + pBuf[i++] = c; + } + } + else + pBuf[i++] = c; + } + pBuf[i++] = '\0'; + pStr = pTokenVal->string = RscChar::MakeUTF8FromL( pBuf ); + PutStringBack( pBuf ); + return( STRING ); + } + else + */ + { + pBuf[i++] = '\0'; + + nHashId = pHS->Test( pBuf ); + if( HASH_NONAME != nHashId ) + { + KEY_STRUCT aKey; + + // Suche nach dem Schluesselwort + if( pTC->aNmTb.Get( nHashId, &aKey ) ) + { + + // Schluesselwort gefunden + switch( aKey.nTyp ) + { + case CLASSNAME: + pTokenVal->pClass = (RscTop *)aKey.yylval; + break; + case VARNAME: + pTokenVal->varid = aKey.nName; + break; + case CONSTNAME: + pTokenVal->constname.hashid = aKey.nName; + pTokenVal->constname.nValue = aKey.yylval; + break; + case BOOLEAN: + pTokenVal->svbool = (BOOL)aKey.yylval; + break; + case INCLUDE: + bLastInclude = TRUE; + default: + pTokenVal->value = aKey.yylval; + }; + + // String zurueckgeben + PutStringBack( pBuf ); + return( aKey.nTyp ); + } + else{ + pTokenVal->string = pBuf; + return( SYMBOL ); + } + } + else{ // Symbol + RscDefine * pDef; + + pDef = pTC->aFileTab.FindDef( pBuf ); + if( pDef ){ + pTokenVal->defineele = pDef; + + // String zurueckgeben + PutStringBack( pBuf ); + return( RSCDEFINE ); + } + + pTokenVal->string = pBuf; + return( SYMBOL ); + } + } + } + + if( c=='<' ) + { + c = pFI->GetFastChar(); + if( c=='<' ) + { + c = pFI->GetFastChar(); + return LEFTSHIFT; + } + else + return '<'; + } + + if( c=='>' ) + { + c = pFI->GetFastChar(); + if( c=='>' ) + { + c = pFI->GetFastChar(); + return RIGHTSHIFT; + } + else + return '>'; + } + + c1 = c; + c = pFI->GetFastChar(); + return( c1 ); +} + +#if defined( RS6000 ) || defined( HP9000 ) || defined( SCO ) +extern "C" int yylex() +#else +int yylex() +#endif +{ + if( bTargetDefined ) + bTargetDefined = FALSE; + else + aKeyVal[ 0 ].nKeyWord = + MakeToken( &aKeyVal[ 0 ].aYYSType ); + + yylval = aKeyVal[ 0 ].aYYSType; + return( aKeyVal[ 0 ].nKeyWord ); +} + +/****************** yyerror **********************************************/ +#ifdef RS6000 +extern "C" void yyerror( char* pMessage ) +#elif defined HP9000 || defined SCO || defined IRIX || defined SOLARIS +extern "C" void yyerror( const char* pMessage ) +#else +void yyerror( char* pMessage ) +#endif +{ + pTC->pEH->Error( ERR_YACC, NULL, RscId(), pMessage ); +} + +/****************** parser start function ********************************/ +void InitParser( RscFileInst * pFileInst ) +{ + pTC = pFileInst->pTypCont; // Datenkontainer setzten + pFI = pFileInst; + pCS = new RscCharStack(); //Puffer Vorrat + pExp = NULL; //fuer MacroParser + bTargetDefined = FALSE; + + // Anfangszeichen initialisieren + bLastInclude = FALSE; + c = pFI->GetFastChar(); +} + +void EndParser(){ + char * pStr; + + // Stack abraeumen + while( ! S.IsEmpty() ) + S.Pop(); + + // Speicher freigeben + while( NULL != (pStr = pCS->Pop()) ) + RscMem::Free( pStr ); + delete pCS; + if( pExp ) + delete pExp; + pTC = NULL; + pFI = NULL; + pCS = NULL; + pExp = NULL; + +} + +void IncludeParser( RscFileInst * pFileInst ) +{ + int nToken; // Wert des Tokens + YYSTYPE aYYSType; // Daten des Tokens + RscFile * pFName; // Filestruktur + ULONG lKey; // Fileschluessel + RscTypCont * pTypCon = pFileInst->pTypCont; + + pFName = pTypCon->aFileTab.Get( pFileInst->GetFileIndex() ); + InitParser( pFileInst ); + + nToken = MakeToken( &aYYSType ); + while( 0 != nToken && CLASSNAME != nToken ){ + if( '#' == nToken ){ + if( INCLUDE == (nToken = MakeToken( &aYYSType )) ){ + if( STRING == (nToken = MakeToken( &aYYSType )) ){ + lKey = pTypCon->aFileTab.NewIncFile( aYYSType.string, + aYYSType.string ); + pFName->InsertDependFile( lKey, LIST_APPEND ); + } + else if( INCLUDE_STRING == nToken ){ + lKey = pTypCon->aFileTab.NewIncFile( aYYSType.string, + ByteString() ); + pFName->InsertDependFile( lKey, LIST_APPEND ); + }; + }; + }; + switch( nToken ){ + case STRING: + case INCLUDE_STRING: + case SYMBOL: + // String zurueckgeben + pCS->Push( aYYSType.string ); + break; + }; + nToken = MakeToken( &aYYSType ); + }; + + EndParser(); +} + +ERRTYPE parser( RscFileInst * pFileInst ) +{ + ERRTYPE aError; + + InitParser( pFileInst ); + + aError = yyparse(); + + EndParser(); + + // yyparser gibt 0 zurueck, wenn erfolgreich + if( 0 == (USHORT)aError ) + aError.Clear(); + if( pFileInst->pTypCont->pEH->nErrors ) + aError = ERR_ERROR; + pFileInst->SetError( aError ); + return( aError ); +} + +RscExpression * MacroParser( RscFileInst & rFileInst ) +{ + ERRTYPE aError; + RscExpression * pExpression; + + InitParser( &rFileInst ); + + //Ziel auf macro_expression setzen + aKeyVal[ 0 ].nKeyWord = MACROTARGET; + bTargetDefined = TRUE; + aError = yyparse(); + + pExpression = pExp; + //EndParser() wuerde pExp loeschen + if( pExp ) + pExp = NULL; + + EndParser(); + + // yyparser gibt 0 zurueck, wenn erfolgreich + if( 0 == (USHORT)aError ) + aError.Clear(); + if( rFileInst.pTypCont->pEH->nErrors ) + aError = ERR_ERROR; + rFileInst.SetError( aError ); + + //im Fehlerfall pExpression loeschen + if( aError.IsError() && pExpression ){ + delete pExpression; + pExpression = NULL; + }; + return( pExpression ); +} + diff --git a/rsc/source/parser/rsclex.hxx b/rsc/source/parser/rsclex.hxx new file mode 100644 index 000000000000..e1b4704746ca --- /dev/null +++ b/rsc/source/parser/rsclex.hxx @@ -0,0 +1,217 @@ +/************************************************************************* + * + * $RCSfile: rsclex.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: hr $ $Date: 2000-09-18 16:42:55 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +/************************************************************************ + + Source Code Control System - Update + + $Log: not supported by cvs2svn $ + Revision 1.18 2000/09/17 12:51:11 willem.vandorp + OpenOffice header added. + + Revision 1.17 2000/07/26 17:13:21 willem.vandorp + Headers/footers replaced + + Revision 1.16 1999/09/24 13:15:07 hr + forward decl. + + Revision 1.15 1998/09/24 17:51:52 HR + GCC braucht richtige Vorwaertsdeklaration + + + Rev 1.14 24 Sep 1998 17:51:52 HR + GCC braucht richtige Vorwaertsdeklaration + + Rev 1.13 27 Aug 1997 18:17:16 MM + neue Headerstruktur + + Rev 1.12 18 Oct 1996 16:27:12 MM + dynamische Member + + Rev 1.11 24 Jul 1996 12:49:02 mda + IRIX + + Rev 1.10 18 Jun 1996 13:38:14 MM + Header Anpassungen + + Rev 1.9 05 Jun 1996 19:22:40 PL + Deklarationen fuer SCO + + Rev 1.8 21 Nov 1995 19:49:50 TLX + Neuer Link + + Rev 1.7 10 Jan 1995 11:23:04 eg + HP9000 yyerror( const char* ) + + Rev 1.6 09 Sep 1994 12:08:06 MH + Watcom + + Rev 1.5 25 Apr 1994 15:02:20 sv + HP9000 needs different declarations for yyerror and yylex (extern C) + + Rev 1.4 12 Jan 1994 15:20:44 mm + Alignementprobleme und Warnings fuer DEC-Alpha beseitigt + + Rev 1.3 21 Sep 1993 10:03:44 mm + RS6000 needs different prototyps (extern "C") + + Rev 1.2 25 Aug 1993 15:25:02 mm + Fehler und Warnings beseitigt + + Rev 1.1 23 Dec 1992 14:05:44 mm + Sprachaenderung + + Rev 1.0 10 Aug 1992 07:22:46 MM + Initial revision. + +**************************************************************************/ +#include + +#define MINBUF 256 +#define MAXBUF 256 + +enum MODE_ENUM { MODE_MODELESS, MODE_APPLICATIONMODAL, MODE_SYSTEMMODAL }; + +enum JUSTIFY_ENUM { JUST_CENTER, JUST_RIGHT, JUST_LEFT }; + +enum SHOW_ENUM { SHOW_NORMAL, SHOW_MINIMIZED, SHOW_MAXIMIZED }; + +enum ENUMHEADER { HEADER_NAME, HEADER_NUMBER }; + +enum REF_ENUM { TYPE_NOTHING, TYPE_REF, TYPE_COPY }; + +struct RSCHEADER { + RscTop * pClass; + RscExpType nName1; + REF_ENUM nTyp; + RscTop * pRefClass; + RscExpType nName2; +}; + +DECLARE_STACK( RscCharStack, char * ) +void PutStringBack( char * pStr ); + +/************** O b j e c t s t a c k ************************************/ +struct Node { + Node* pPrev; + RSCINST aInst; + USHORT nTupelRec; // Rekursionstiefe fuer Tupel + Node() { pPrev = NULL; nTupelRec = 0; }; +}; + +class ObjectStack { + private : + Node* pRoot; + public : + + ObjectStack () { pRoot = NULL; } + + const RSCINST & Top () { return pRoot->aInst; } + BOOL IsEmpty() { return( pRoot == NULL ); } + void IncTupelRec() { pRoot->nTupelRec++; } + void DecTupelRec() { pRoot->nTupelRec--; } + USHORT TupelRecCount() const { return pRoot->nTupelRec; } + void Push( RSCINST aInst ) + { + Node* pTmp; + + pTmp = pRoot; + pRoot = new Node; + pRoot->aInst = aInst; + pRoot->pPrev = pTmp; + } + void Pop() + { + Node* pTmp; + + pTmp = pRoot; + pRoot = pTmp->pPrev; + delete pTmp; + } +}; + +/****************** F o r w a r d s **************************************/ +#if defined( RS6000 ) +extern "C" int yyparse(); // forward Deklaration fuer erzeugte Funktion +extern "C" void yyerror( char * ); +extern "C" int yylex( void ); +#elif defined( HP9000 ) || defined( SCO ) || defined ( IRIX ) || defined ( SOLARIS ) +extern "C" int yyparse(); // forward Deklaration fuer erzeugte Funktion +extern "C" void yyerror( const char * ); +extern "C" int yylex( void ); +#else +#if defined ( WTC ) || defined ( GCC ) +int yyparse(); // forward Deklaration fuer erzeugte Funktion +#else +yyparse(); // forward Deklaration fuer erzeugte Funktion +#endif +void yyerror( char * ); +int yylex( void ); +#endif + +class RscTypCont; +class RscFileInst; +class RscCharStack; + +extern RscTypCont* pTC; +extern RscFileInst * pFI; +extern RscCharStack * pCS; +extern RscExpression * pExp; +extern ObjectStack S; diff --git a/rsc/source/parser/rscpar.cxx b/rsc/source/parser/rscpar.cxx new file mode 100644 index 000000000000..a0c3fd7d71a7 --- /dev/null +++ b/rsc/source/parser/rscpar.cxx @@ -0,0 +1,299 @@ +/************************************************************************* + * + * $RCSfile: rscpar.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: hr $ $Date: 2000-09-18 16:42:55 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +/************************************************************************ + + Source Code Control System - Header + + $Header: /zpool/svn/migration/cvs_rep_09_09_08/code/rsc/source/parser/rscpar.cxx,v 1.1.1.1 2000-09-18 16:42:55 hr Exp $ + + Source Code Control System - Update + + $Log: not supported by cvs2svn $ + Revision 1.19 2000/09/17 12:51:11 willem.vandorp + OpenOffice header added. + + Revision 1.18 2000/07/26 17:13:21 willem.vandorp + Headers/footers replaced + + Revision 1.17 2000/07/12 11:35:51 th + Unicode + + Revision 1.16 1999/09/07 13:30:04 mm + UniCode + + Revision 1.15 1997/08/27 18:17:18 MM + neue Headerstruktur + +**************************************************************************/ +/****************** I N C L U D E S **************************************/ +#pragma hdrstop + +// C and C++ Includes. +#include + +#ifndef _RSCPAR_HXX +#include +#endif +#ifndef _RSCDB_HXX +#include +#endif + +/****************** R s c F i l e I n s t ********************************/ +/****************** C O D E **********************************************/ +/************************************************************************* +|* +|* RscFileInst::Init() +|* +|* Beschreibung +|* Ersterstellung MM 05.11.91 +|* Letzte Aenderung MM 17.02.93 +|* +*************************************************************************/ +void RscFileInst::Init() +{ + SetCharSet( RTL_TEXTENCODING_MS_1252 ); + + nLineNo = 0; + nLineBufLen = 256; + pLine = (char *)RscMem::Malloc( nLineBufLen ); + *pLine = '\0'; + nScanPos = 0; + cLastChar = '\0'; + bEof = FALSE; +}; + +/************************************************************************* +|* +|* RscFileInst::RscFileInst() +|* +|* Beschreibung +|* Ersterstellung MM 06.06.91 +|* Letzte Aenderung MM 06.06.91 +|* +*************************************************************************/ +RscFileInst::RscFileInst( RscTypCont * pTC, ULONG lIndexSrc, + ULONG lFIndex, FILE * fFile, + rtl_TextEncoding nSourceCharSet ) +{ + pTypCont = pTC; + Init(); + + lFileIndex = lFIndex; + lSrcIndex = lIndexSrc; + fInputFile = fFile; + + SetCharSet( nSourceCharSet ); + + //Status: Zeiger am Ende des Lesepuffers + nInputPos = nInputEndPos = nInputBufLen = READBUFFER_MAX; + pInput = (char *)RscMem::Malloc( nInputBufLen ); +} + +RscFileInst::RscFileInst( RscTypCont * pTC, ULONG lIndexSrc, + ULONG lFIndex, const ByteString& rBuf, + rtl_TextEncoding nSourceCharSet ) +{ + pTypCont = pTC; + Init(); + lFileIndex = lFIndex; + lSrcIndex = lIndexSrc; + fInputFile = NULL; + nInputPos = 0; + nInputEndPos = rBuf.Len(); + + SetCharSet( nSourceCharSet ); + + // Muss groesser sein wegen Eingabeende bei nInputBufLen < nInputEndPos + nInputBufLen = nInputEndPos +1; + pInput = (char *)RscMem::Malloc( nInputBufLen +100 ); + memcpy( pInput, rBuf.GetBuffer(), nInputEndPos ); +} + +/************************************************************************* +|* +|* RscFileInst::~RscFileInst() +|* +|* Beschreibung +|* Ersterstellung MM 06.06.91 +|* Letzte Aenderung MM 06.06.91 +|* +*************************************************************************/ +RscFileInst::~RscFileInst(){ + if( pInput ) + RscMem::Free( pInput ); + if( pLine ) + RscMem::Free( pLine ); +} + +/************************************************************************* +|* +|* RscFileInst::GetChar() +|* +|* Beschreibung +|* Ersterstellung MM 01.06.91 +|* Letzte Aenderung MM 09.08.91 +|* +*************************************************************************/ +int RscFileInst::GetChar() +{ + if( pLine[ nScanPos ] ) + return( pLine[ nScanPos++ ] ); + else if( nInputPos >= nInputEndPos && nInputEndPos != nInputBufLen ) + { + // Dateiende + bEof = TRUE; + return 0; + } + else + { + GetNewLine(); + return( '\n' ); + } +} + +/************************************************************************* +|* +|* RscFileInst::GetNewLine() +|* +|* Beschreibung +|* Ersterstellung MM 06.06.91 +|* Letzte Aenderung MM 06.06.91 +|* +*************************************************************************/ +void RscFileInst::GetNewLine() +{ + nLineNo++; + nScanPos = 0; + + //laeuft bis Dateiende + USHORT nLen = 0; + while( (nInputPos < nInputEndPos) || (nInputEndPos == nInputBufLen) ) + { + if( (nInputPos >= nInputEndPos) && fInputFile ) + { + nInputEndPos = fread( pInput, 1, nInputBufLen, fInputFile ); + nInputPos = 0; + } + + while( nInputPos < nInputEndPos ) + { + //immer eine Zeile lesen + if( nLen >= nLineBufLen ) + { + nLineBufLen += 256; + // einen dazu fuer '\0' + pLine = RscMem::Realloc( pLine, nLineBufLen +1 ); + } + + // cr lf, lf cr, lf oder cr wird '\0' + if( pInput[ nInputPos ] == '\n' ){ + nInputPos++; + if( cLastChar != '\r' ){ + cLastChar = '\n'; + pLine[ nLen++ ] = '\0'; + goto END; + } + } + else if( pInput[ nInputPos ] == '\r' ){ + nInputPos++; + if( cLastChar != '\n' ){ + cLastChar = '\r'; + pLine[ nLen++ ] = '\0'; + goto END; + } + } + else + pLine[ nLen++ ] = pInput[ nInputPos++ ]; + }; + }; + + // Abbruch ueber EOF + pLine[ nLen ] = '\0'; + +END: + if( pTypCont->pEH->GetListFile() ){ + char buf[ 10 ]; + + sprintf( buf, "%5d ", GetLineNo() ); + pTypCont->pEH->LstOut( buf ); + pTypCont->pEH->LstOut( GetLine() ); + pTypCont->pEH->LstOut( "\n" ); + } +} + +/************************************************************************* +|* +|* RscFileInst::SetError() +|* +|* Beschreibung +|* Ersterstellung MM 05.11.91 +|* Letzte Aenderung MM 05.11.91 +|* +*************************************************************************/ +void RscFileInst::SetError( ERRTYPE aError ) +{ + if( aError.IsOk() ) + { + aFirstError = aError; + nErrorLine = GetLineNo(); + nErrorPos = GetScanPos() -1; + }; +}; diff --git a/rsc/source/parser/rscyacc.cxx b/rsc/source/parser/rscyacc.cxx new file mode 100644 index 000000000000..50cc9cd034a7 --- /dev/null +++ b/rsc/source/parser/rscyacc.cxx @@ -0,0 +1,322 @@ +/************************************************************************* + * + * $RCSfile: rscyacc.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: hr $ $Date: 2000-09-18 16:42:55 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +/************************************************************************ + + Source Code Control System - Header + + $Header: /zpool/svn/migration/cvs_rep_09_09_08/code/rsc/source/parser/rscyacc.cxx,v 1.1.1.1 2000-09-18 16:42:55 hr Exp $ + +*************************************************************************/ +#pragma hdrstop + +#include +#include +#include + +#include + +#ifndef _RSCERROR_H +#include +#endif + +#ifndef _RSCTOOLS_HXX +#include +#endif +#ifndef _RSCCLASS_HXX +#include +#endif +#ifndef _RSCCONT_HXX +#include +#endif +#ifndef _RSCTREE_HXX +#include +#endif +#ifndef _RSCDB_HXX +#include +#endif +#ifndef _RSCDEF_HXX +#include +#endif +#ifndef _RSCPAR_HXX +#include +#endif + +#include "rsclex.hxx" + +/************** V a r i a b l e n ****************************************/ +ObjectStack S; +RscTop * pCurClass; +USHORT nCurMask; +char szErrBuf[ 100 ]; + +/************** H i l f s F u n k t i o n e n ****************************/ +RSCINST GetVarInst( const RSCINST & rInst, char * pVarName ) +{ + RSCINST aInst; + + aInst = rInst.pClass->GetVariable( rInst, pHS->Insert( pVarName ), + RSCINST() ); + + if( !aInst.pData ) + pTC->pEH->Error( ERR_NOVARIABLENAME, rInst.pClass, RscId() ); + + return( aInst ); +} + +void SetNumber( const RSCINST & rInst, char * pVarName, long lValue ) +{ + RSCINST aInst; + + aInst = GetVarInst( rInst, pVarName ); + + if( aInst.pData ){ + ERRTYPE aError; + aError = aInst.pClass->SetNumber( aInst, lValue ); + + if( aError.IsError() ) + pTC->pEH->Error( aError, aInst.pClass, RscId() ); + } +} + +void SetConst( const RSCINST & rInst, char * pVarName, + HASHID nValueId, long nVal ) +{ + RSCINST aInst; + + aInst = GetVarInst( rInst, pVarName ); + if( aInst.pData ) + { + ERRTYPE aError; + aError = aInst.pClass->SetConst( aInst, nValueId, nVal ); + + if( aError.IsError() ) + pTC->pEH->Error( aError, aInst.pClass, RscId() ); + } +} + +void SetString( const RSCINST & rInst, char * pVarName, char * pStr ) +{ + RSCINST aInst; + + aInst = GetVarInst( rInst, pVarName ); + if( aInst.pData ){ + ERRTYPE aError; + aError = aInst.pClass->SetString( aInst, pStr ); + + if( aError.IsError() ) + pTC->pEH->Error( aError, aInst.pClass, RscId() ); + } +} + +RscId MakeRscId( RscExpType aExpType ) +{ + if( !aExpType.IsNothing() ){ + long lValue; + + if( !aExpType.Evaluate( &lValue ) ) + pTC->pEH->Error( ERR_ZERODIVISION, NULL, RscId() ); + if( lValue < 1 || lValue > (long)0x7FFF ) + { + pTC->pEH->Error( ERR_IDRANGE, NULL, RscId(), + ByteString::CreateFromInt32( lValue ).GetBuffer() ); + } + + if( aExpType.IsDefinition() ) + return RscId( aExpType.aExp.pDef ); + else + return RscId( lValue ); + } + return RscId(); +} + +BOOL DoClassHeader( RSCHEADER * pHeader, BOOL bMember ) +{ + RSCINST aCopyInst; + RscId aName1 = MakeRscId( pHeader->nName1 ); + RscId aName2 = MakeRscId( pHeader->nName2 ); + + if( pHeader->pRefClass ) + aCopyInst.pClass = pHeader->pRefClass; + else + aCopyInst.pClass = pHeader->pClass; + + if( TYPE_COPY == pHeader->nTyp ) + { + ObjNode * pCopyObj = aCopyInst.pClass->GetObjNode( aName2 ); + + if( !pCopyObj ) + { + ByteString aMsg( pHS->Get( aCopyInst.pClass->GetId() ) ); + aMsg += ' '; + aMsg += aName2.GetName(); + pTC->pEH->Error( ERR_NOCOPYOBJ, pHeader->pClass, aName1, + aMsg.GetBuffer() ); + } + else + aCopyInst.pData = pCopyObj->GetRscObj(); + } + + if( bMember ) + { + // Angabe von Superklassen oder abgeleiteten Klassen ist jetzt erlaubt + if( S.Top().pClass->InHierarchy( pHeader->pClass ) + || pHeader->pClass->InHierarchy( S.Top().pClass) ) + { + if( aCopyInst.IsInst() ) + { + RSCINST aTmpI( S.Top() ); + aTmpI.pClass->Destroy( aTmpI ); + aTmpI.pClass->Create( &aTmpI, aCopyInst ); + }; + } + else + pTC->pEH->Error( ERR_FALSETYPE, S.Top().pClass, aName1, + pHS->Get( pHeader->pClass->GetId() ) ); + } + else + { + if( S.IsEmpty() ) + { + if( (long)aName1 < 256 ) + pTC->pEH->Error( WRN_GLOBALID, pHeader->pClass, aName1 ); + + if( aCopyInst.IsInst() ) + S.Push( pHeader->pClass->Create( NULL, aCopyInst ) ); + else + S.Push( pHeader->pClass->Create( NULL, RSCINST() ) ); + + ObjNode * pNode = new ObjNode( aName1, S.Top().pData, + pFI->GetFileIndex() ); + pTC->pEH->StdOut( "." ); + + if( !aName1.IsId() ) + pTC->pEH->Error( ERR_IDEXPECTED, pHeader->pClass, aName1 ); + else if( !pHeader->pClass->PutObjNode( pNode ) ) + pTC->pEH->Error( ERR_DOUBLEID, pHeader->pClass, aName1 ); + } + else + { + RSCINST aTmpI; + ERRTYPE aError; + + if( (long)aName1 >= 256 && aName1.IsId() ) + pTC->pEH->Error( WRN_LOCALID, pHeader->pClass, aName1 ); + aError = S.Top().pClass->GetElement( S.Top(), aName1, + pHeader->pClass, aCopyInst, &aTmpI ); + + if( aError.IsWarning() ) + pTC->pEH->Error( aError, pHeader->pClass, aName1 ); + else if( aError.IsError() ) + { + if( ERR_CONT_INVALIDTYPE == (USHORT)aError ) + pTC->pEH->Error( aError, S.Top().pClass, aName1, + pHS->Get( pHeader->pClass->GetId() ) ); + else + pTC->pEH->Error( aError, S.Top().pClass, aName1 ); + S.Top().pClass->GetElement( S.Top(), RscId(), + pHeader->pClass, RSCINST(), &aTmpI ); + + if( !aTmpI.IsInst() ) + return( FALSE ); + } + S.Push( aTmpI ); + }; + }; + if( TYPE_REF == pHeader->nTyp ) + { + ERRTYPE aError; + + aError = S.Top().pClass->SetRef( S.Top(), aName2 ); + pTC->pEH->Error( aError, S.Top().pClass, aName1 ); + } + + return( TRUE ); +} + +RSCINST GetFirstTupelEle( const RSCINST & rTop ) +{ // Aufwaertskompatible, Tupel probieren + RSCINST aInst; + ERRTYPE aErr; + + aErr = rTop.pClass->GetElement( rTop, RscId(), NULL, RSCINST(), &aInst ); + if( !aErr.IsError() ) + aInst = aInst.pClass->GetTupelVar( aInst, 0, RSCINST() ); + return aInst; +} + +/************** Y a c c C o d e ****************************************/ +//#define YYDEBUG 1 + +#define TYPE_HASHID 0 +#define TYPE_RESID 1 + +#ifdef UNX +#define YYMAXDEPTH 2000 +#else +#ifdef W30 +#define YYMAXDEPTH 300 +#else +#define YYMAXDEPTH 800 +#endif +#endif + +#include "rscyacc.yxx" + -- cgit v1.2.3