pwrc.h
上传用户:hzhsqp
上传日期:2007-01-06
资源大小:1600k
文件大小:26k
- /*
- * pwrc.h
- *
- * Portable Windows Resource Compiler
- *
- * Portable Windows Library
- *
- * Copyright (c) 1993-1998 Equivalence Pty. Ltd.
- *
- * The contents of this file are subject to the Mozilla Public License
- * Version 1.0 (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.mozilla.org/MPL/
- *
- * Software distributed under the License is distributed on an "AS IS"
- * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
- * the License for the specific language governing rights and limitations
- * under the License.
- *
- * The Original Code is Portable Windows Library.
- *
- * The Initial Developer of the Original Code is Equivalence Pty. Ltd.
- *
- * Portions are Copyright (C) 1993 Free Software Foundation, Inc.
- * All Rights Reserved.
- *
- * Contributor(s): ______________________________________.
- *
- * $Log: pwrc.h,v $
- * Revision 1.33 1999/10/19 07:08:23 robertj
- * Added #ifdef/#ifndef condition compile functionality
- *
- * Revision 1.32 1999/10/18 04:41:09 robertj
- * Added decompile of .BMP and .ICO files and fixed ability to have 64x64 icons
- *
- * Revision 1.31 1998/12/21 08:02:12 robertj
- * New directory structure
- *
- * Revision 1.30 1998/09/26 01:24:16 robertj
- * Added open source license
- *
- * Revision 1.29 1998/09/26 00:41:10 robertj
- * Fixed name space conflict with type Cursor.
- *
- * Revision 1.28 1998/09/14 13:48:15 robertj
- * Allowed suppression of some warnings.
- *
- * Revision 1.27 1996/05/23 10:06:40 robertj
- * Fixed bug in OK/Cancel buttons of dialogs not being set as special buttons.
- *
- * Revision 1.26 1996/01/23 13:32:46 robertj
- * More changes for editor
- *
- * Revision 1.25 1996/01/02 13:05:16 robertj
- * Changes to support editor.
- *
- * Revision 1.24 1995/12/10 12:12:06 robertj
- * Changes to support graphical resource file editor.
- *
- * Revision 1.23 1995/10/14 15:19:14 robertj
- * Fixed missing font size on font keyword.
- * Changes required by move of standard buttons to PDialog.
- *
- * Revision 1.22 1995/08/24 12:48:51 robertj
- * Added general control type for arbitrary dialog controls.
- * Added output file extension variable.
- *
- * Revision 1.21 1995/07/31 12:30:14 robertj
- * Changed all generated resource IDs to be in the same "number space". This
- * is to avoid problems with IDs being used for more than one type of resource
- * eg a menu item and an image for a toolbar.
- * Fixed the generated #line commands to include a relative path instead of an
- * absolute one.
- *
- * Revision 1.20 1995/04/02 09:28:16 robertj
- * Added "balloon" help.
- *
- * Revision 1.19 1995/02/19 04:17:58 robertj
- * Moved most inline code from header file to cxx file.
- *
- * Revision 1.18 1995/02/11 04:13:58 robertj
- * Strange problem with variable "small" in MSVC 2.0.
- *
- * Revision 1.17 1995/01/27 11:25:44 robertj
- * Added pattern resource.
- *
- * Revision 1.16 1995/01/11 09:45:20 robertj
- * Documentation and normalisation.
- *
- * Revision 1.15 1994/12/12 13:14:06 robertj
- * Changed RealEdit to FloatEdit.
- *
- * Revision 1.14 1994/12/12 10:16:33 robertj
- * Restructuring and documentation of container classes.
- * Renaming of some macros for declaring container classes.
- * Added some extra functionality to PString.
- * Added start to 2 byte characters in PString.
- * Fixed incorrect overrides in PCaselessString.
- *
- * Revision 1.13 1994/12/05 11:38:03 robertj
- * Added #line to generated code.
- *
- * Revision 1.12 1994/10/31 11:26:09 robertj
- * Added interface pragma for GNU C
- *
- * Revision 1.11 1994/06/25 12:31:31 robertj
- * Unix synchronisation
- *
- * Revision 1.10 1994/01/03 05:00:57 robertj
- * Added P to DECLARE_CLASS
- *
- * Revision 1.9 1993/12/31 07:05:07 robertj
- * Changed pixmap images for one pixel one number in PRC file.
- *
- * Revision 1.8 1993/12/01 16:12:09 robertj
- * Windows NT port.
- *
- * Revision 1.7 1993/11/30 18:40:23 robertj
- * Uppercased all macros.
- *
- * Revision 1.6 1993/08/21 04:42:42 robertj
- * Clone() function made optional and removed.
- *
- * Revision 1.5 1993/08/20 21:31:56 robertj
- * Added function to get original literal text string in resource objects.
- *
- * Revision 1.4 1993/07/16 12:48:13 robertj
- * Added converted form of resource string (translated from C literal).
- * Changed resource string dictionary to ResourceObject as consequence of above.
- *
- * Revision 1.3 1993/07/15 04:38:31 robertj
- * Rationalised lex.h, parse.h and main.h out of existance.
- *
- * Revision 1.2 1993/07/14 01:57:48 robertj
- * Removed unused parameters.
- *
- * Revision 1.1 1993/07/03 06:01:08 robertj
- * Initial revision
- *
- */
- #ifndef _PWRC_H
- #define _PWRC_H
- #ifdef __GNUC__
- #pragma interface
- #endif
- /////////////////////////////////////////
- //
- // key code for menu accelerators
- //
- #include <pwlib/keycode.h>
- #ifndef _PKEYCODE
- };
- #endif
- PDECLARE_CLASS(AccelCode, PKeyCode)
- public:
- AccelCode(const PString & resrcStr);
- };
- PLIST(AccelList, AccelCode);
- /////////////////////////////////////////
- //
- // Line numbers from parser
- //
- class StdError;
- PDECLARE_CLASS(LineNumber, PObject)
- public:
- LineNumber() { Set(); }
- void Set();
- protected:
- PFilePath filename;
- unsigned number;
- friend ostream & operator<<(ostream & out, const LineNumber & line);
- friend ostream & operator<<(ostream & out, const StdError & e);
- };
- /////////////////////////////////////////
- //
- // standard error output from parser
- //
- enum StdErrorType { Info, Warning, Fatal };
- class StdError {
- public:
- StdError(StdErrorType ne) : e(ne) { }
- StdError(StdErrorType ne, LineNumber & ln) : e(ne), l(ln) { }
- friend ostream & operator<<(ostream & out, const StdError & e);
- protected:
- StdErrorType e;
- LineNumber l;
- };
- /////////////////////////////////////////
- //
- // point for resource position
- //
- PDECLARE_CLASS(Point, PObject)
- public:
- Point() { x = -1; y = -1; }
- Point(long nx, long ny);
- Point(const Point & pt) { x = pt.x; y = pt.y; }
- Point & operator=(const Point & pt);
- int X() const { return x; }
- int Y() const { return y; }
- void SetX(long nx);
- void SetY(long ny);
- protected:
- virtual void PrintOn(ostream & out) const;
- int x;
- int y;
- };
- /////////////////////////////////////////
- //
- // #define values
- //
- PDECLARE_CLASS(DefineValue, PObject)
- public:
- DefineValue(long newIval, BOOL aut) { ival = newIval; automatic = aut; }
- DefineValue(const PString & newSval) { sval = newSval; automatic = FALSE; }
- operator long() const { return ival; }
- operator PString() const { return sval; }
- BOOL IsString() const { return !sval.IsEmpty(); }
- BOOL WasAutomatic() const { return automatic; }
- protected:
- long ival; // calculated integer value
- PString sval; // string value if literal define
- BOOL automatic;
- };
- /////////////////////////////////////////
- //
- // dictionary to hold #define values
- //
- PDICTIONARY(DefineDict, PString, DefineValue);
- class MainWindow;
- class ResourceFile;
- PDECLARE_CLASS(ResourceID, PObject)
- public:
- ResourceID(long id) : number(id) { }
- ResourceID(long id, const PString & nam) : number(id), identifier(nam) { }
- long GetNum() const { return number; }
- const PString & GetIdent() const { return identifier; }
- private:
- long number;
- PString identifier;
- };
- /////////////////////////////////////////
- //
- // a resource item which has an id and a string
- //
- PDECLARE_CLASS(ResourceObject, PObject)
- public:
- ResourceObject() { id = -1; }
- ResourceObject(ResourceID * newId, PString * newText);
- virtual void EditResource(MainWindow *, ResourceFile *) { PAssertAlways(""); }
- void SetText(PString * newText);
- const PString & GetLiteralText() const { return textLiteral; }
- const PString & GetConvertedText() const { return textConverted; }
- int GetID() const { return id; }
- void SetID(ResourceID * newID);
- PString GetIDString() const;
- protected:
- Comparison Compare(const PObject & obj) const;
- PINDEX HashFunction() const;
- int id;
- PString identifier;
- PString textLiteral;
- PString textConverted;
- };
- PDECLARE_LIST(ResourceList, ResourceObject)
- public:
- enum ResTypes {
- StringRes,
- MenubarRes,
- LayoutRes,
- IconRes,
- CursorRes,
- PatternRes,
- ImageRes,
- DataRes,
- NumResTypes
- };
- ResTypes GetType() const { return type; }
- private:
- ResTypes type;
- friend class ResourceFile;
- };
- /////////////////////////////////////////
- //
- // String resource
- //
- PDECLARE_CLASS(StringResource, ResourceObject)
- public:
- StringResource(ResourceID * newId, PString * newText)
- : ResourceObject(newId, newText) { }
- virtual void EditResource(MainWindow *, ResourceFile *);
- };
- /////////////////////////////////////////
- //
- // dictionary to hold string resources
- //
- PDECLARE_DICTIONARY(StringDict, POrdinalKey, StringResource)
- virtual void PrintOn(ostream & out) const;
- };
- /////////////////////////////////////////
- //
- // A resource with a class specification
- //
- PDECLARE_CLASS(ClassedResource, ResourceObject)
- public:
- ClassedResource(const char * className = "");
- ClassedResource(PString * className);
- ClassedResource(PString * className, PString * ancestorName);
- void SetResClass(const PString & newClassname);
- const PString & GetResClass() const { return resourceClass; }
- void SetAncestorClass(const PString & newClass) { ancestorClass = newClass; }
- PString GetAncestorClass() const { return ancestorClass; }
- protected:
- PString resourceClass;
- PString ancestorClass;
- LineNumber classLine;
- };
- /////////////////////////////////////////
- //
- // menu items
- //
- class MenuBar;
- PDECLARE_CLASS(MenuItem, ResourceObject)
-
- public:
- MenuItem(ResourceID * newID) { SetID(newID); }
- void SetNotify(PString * newNotify);
- void SetFieldName(PString * newFieldname);
- void SetAccelerators(PStringList * accels);
- BOOL NeedsWindowParameter() const;
- void OutputCode(ostream & hdr_stream, ostream & src_stream, MenuBar&mbar);
- protected:
- virtual void PrintOn(ostream & out) const;
-
- PString notifyName;
- LineNumber notifyLine;
- PString fieldName;
- LineNumber fieldLine;
- AccelList accel;
- PStringStream src_before, hdr_before;
- PStringStream src_after, hdr_after;
- friend int yyparse();
- };
- /////////////////////////////////////////
- //
- // list of menu items
- //
- PLIST(MenuItemList, MenuItem);
- PDICTIONARY(MenuItemDict, POrdinalKey, MenuItem);
- /////////////////////////////////////////
- //
- // menu separator
- //
- PDECLARE_CLASS(Separator, MenuItem)
- public:
- Separator() : MenuItem(NULL) { }
- protected:
- virtual void PrintOn(ostream & out) const;
- };
- /////////////////////////////////////////
- //
- // sub-menus
- //
- PDECLARE_CLASS(Menu, MenuItem)
- public:
- Menu(PString * title, MenuItemList * newItems);
- void SetUniqueItemIDs(MenuItemDict & itemDict);
- protected:
- virtual void PrintOn(ostream & out) const;
- MenuItemList items;
- };
- /////////////////////////////////////////
- //
- // list of menus
- //
- PLIST(MenuList, Menu);
- /////////////////////////////////////////
- //
- // menubar
- //
- PDECLARE_CLASS(MenuBar, ClassedResource)
- public:
- MenuBar(ResourceID * newID);
- void AddItem(MenuItem * item);
- void SetMenuList(MenuList * newMenus);
- void SetWindow(PString * newWindow);
- void OutputCode(ostream & hdr_stream, ostream & src_stream);
- virtual void EditResource(MainWindow *, ResourceFile *);
- protected:
- virtual void PrintOn(ostream & out) const;
- LineNumber firstLine;
- PString window;
- MenuList menus;
- MenuItemDict itemDict;
- LineNumber windowLine;
- PStringStream src_before, hdr_before;
- PStringStream src_after, hdr_after;
- friend int yyparse();
- friend void MenuItem::OutputCode(ostream & hdr_stream,
- ostream & src_stream, MenuBar & mbar);
- };
- /////////////////////////////////////////
- //
- // list of menubars
- //
- PDECLARE_DICTIONARY(MenubarDict, POrdinalKey, MenuBar)
- virtual void PrintOn(ostream & out) const;
- };
- /////////////////////////////////////////
- //
- // A resource with a class specification and a position
- //
- PDECLARE_CLASS(ComplexResource, ClassedResource)
- public:
- ComplexResource(const char * className = "");
- void SetDim(Point * newDim);
- Point GetDim() const { return dim; }
- void SetPos(Point * newPos);
- Point GetPos() const { return pos; }
- protected:
- Point pos;
- Point dim;
- BOOL dim_set;
- };
- /////////////////////////////////////////
- //
- // Control
- // The base control type
- //
- enum {
- SortedOption = 1,
- MultiSelectOption = 2,
- MultiColumnOption = 4,
- Special = 8,
- OkButtonOption = 16,
- CancelButtonOption = 32,
- HelpButtonOption = 64,
- DefaultButtonOption = 128,
- };
- class Layout;
- PDECLARE_CLASS(Control, ComplexResource)
- public:
- Control(const char * className, const char * valueType);
- void SetFieldName(PString * newFieldname);
- void SetValueName(PString * newValuename, PString * initialiser);
- void SetNotify(PString * newNotify);
- void SetHelp(PString * newHelp);
- virtual void SetOptions(long option);
- virtual void SetLimits(long min, long max, long sml, long lge);
- virtual void SetStringList(PStringList * strlist);
- virtual void SetIcon(long iconID);
- virtual BOOL Validate() { return TRUE; }
- void OutputCode(ostream & hdr_stream, ostream & src_stream,
- ostream & save, ostream & restore,
- PString & ok_button, PString & cancel_button,
- PString & help_button, Layout & layout);
- protected:
- virtual void PrintOn(ostream & out) const;
- PString valueType;
- PString valueName;
- LineNumber valueLine;
- PString initialiser;
- PString fieldName;
- LineNumber fieldLine;
- PString notifyName;
- LineNumber notifyLine;
- PString balloonHelp;
- long options;
- int iconID;
- PStringStream src_before, hdr_before;
- PStringStream src_after, hdr_after;
- friend int yyparse();
- };
- /////////////////////////////////////////
- //
- // ListControl
- // The base control type for list controls. This class exists because
- // the AddString and SetOptions functions are overrided from Control
- //
- PDECLARE_CLASS(ListControl, Control)
- public:
- ListControl(const char * className, const char * valueType);
- virtual void SetOptions(long option);
- virtual void SetStringList(PStringList * strlist);
- protected:
- virtual void PrintOn(ostream & out) const;
- PStringList strList;
- };
- /////////////////////////////////////////
- //
- // LimitControl
- // The base control type for controls that support limits. This class exists
- // because the SetLimits functions is overrided from Control
- //
- PDECLARE_CLASS(LimitControl, Control)
- public:
- LimitControl(const char * className, const char * valueType);
- virtual void SetLimits(long min, long max, long sml, long lge);
- protected:
- long minimum, maximum, smallNudge, largeNudge;
- };
- /////////////////////////////////////////
- //
- // control types
- //
- // macro for defining controls
- #define DECLARE_CONTROL(CTL, PARENT, TYPE, BASECLASS)
- PDECLARE_CLASS(CTL, PARENT)
- public:
- CTL() : PARENT(BASECLASS, TYPE) { }
- protected:
- virtual void PrintOn(ostream & out) const;
- DECLARE_CONTROL(PushButton, Control, "", "PTextButton")
- public:
- virtual void SetOptions(long option);
- virtual BOOL Validate();
- };
- DECLARE_CONTROL(Check3Way, Control, "PCheck3WayBox::CheckValues", "PCheck3WayBox") };
- DECLARE_CONTROL(CheckBox, Control, "BOOL", "PCheckBox") };
- DECLARE_CONTROL(RadioButton, Control, "PINDEX", "PRadioButton") };
- DECLARE_CONTROL(LeftText, Control, "", "PStaticText") };
- DECLARE_CONTROL(CentreText, Control, "", "PStaticText") };
- DECLARE_CONTROL(RightText, Control, "", "PStaticText") };
- DECLARE_CONTROL(StaticBox, Control, "", "PStaticBox") };
- DECLARE_CONTROL(EditBox, Control, "PString", "PEditBox") };
- DECLARE_CONTROL(TextEditor, Control, "PString", "PMultiLineEditBox") };
- DECLARE_CONTROL(Password, Control, "PString", "PPasswordEditBox") };
- DECLARE_CONTROL(IntEditBox, LimitControl, "long", "PIntegerEditBox") };
- DECLARE_CONTROL(FloatEditBox,LimitControl, "double", "PFloatEditBox") };
- DECLARE_CONTROL(HScrollBar, LimitControl, "PSCROLLBAR_VALUE", "PHorizontalScrollBar") };
- DECLARE_CONTROL(VScrollBar, LimitControl, "PSCROLLBAR_VALUE", "PVerticalScrollBar") };
- DECLARE_CONTROL(ChoiceBox, ListControl, "PINDEX", "PChoiceBox") };
- DECLARE_CONTROL(ListBox, ListControl, "PINDEX", "PStringListBox") };
- DECLARE_CONTROL(ComboBox, ListControl, "PString", "PComboBox") };
- DECLARE_CONTROL(StaticIcon, Control, "", "PStaticIcon")
- public:
- void SetIcon(long icon);
- };
- DECLARE_CONTROL(UserControl, Control, "", "")
- public:
- virtual BOOL Validate();
- };
- /////////////////////////////////////////
- //
- // list of items
- //
- PLIST(ControlList, Control);
- PDICTIONARY(ControlDict, POrdinalKey, Control);
- /////////////////////////////////////////
- //
- // Layout
- //
- PDECLARE_CLASS(Layout, ComplexResource)
- public:
- Layout(const PString & ancestorClass, int option);
- void SetFontInfo(PString * newFontname, int nsize);
- void SetHeader(PString * newHeader);
- void AddControl(Control * newControl);
- void SetUniqueItemIDs();
- void OutputCode(ostream & hdr_stream, ostream & src_stream);
- virtual void EditResource(MainWindow *, ResourceFile *);
- protected:
- virtual void PrintOn(ostream & out) const;
- int subtype;
- LineNumber firstLine;
- ControlList itemList;
- ControlDict itemDict;
- PString header;
- PString fontName;
- int fontSize;
- PStringStream src_before, hdr_before;
- PStringStream src_after, hdr_after;
- friend int yyparse();
- friend void Control::OutputCode(ostream & hdr_stream, ostream & src_stream,
- ostream & save, ostream & restore,
- PString & ok_button, PString & cancel_button,
- PString & help_button, Layout & layout);
- };
- /////////////////////////////////////////
- //
- // dictionary to hold layout resources
- //
- PDECLARE_DICTIONARY(DialogDict, POrdinalKey, Layout)
- virtual void PrintOn(ostream & out) const;
- };
- /////////////////////////////////////////
- //
- // holder for assorted binary data items
- //
- PDECLARE_CLASS(BinaryData, PAbstractArray)
- public:
- BinaryData();
- BinaryData(const BinaryData & array);
- BinaryData & operator=(const BinaryData & array);
- void Append(int newSize, const BYTE * newData);
- void Append(BYTE newByte) { Append(1, &newByte); }
- PINDEX GetSize() const { return realSize; }
-
- operator const char *() const { return theArray; }
- protected:
- virtual void PrintOn(ostream & out) const;
- PINDEX realSize;
- };
- /////////////////////////////////////////
- //
- // all of the pixel map resources contents
- //
- PDECLARE_CLASS(PixData, BinaryData)
- protected:
- virtual void PrintOn(ostream & out) const;
- };
- PDECLARE_CLASS(PixelContents, PObject)
- public:
- PixelContents();
- void SetDimensions(long w, long h, long d);
- void SetHotSpot(long hx, long hy);
- void SetClut(BinaryData * data);
- void SetAndMask(PixData * data);
- void SetXorMask(PixData * data);
- void SetPixels(PixData * data);
- void Verify(int dfltWidth, int dfltHeight, const char*resname,
- BOOL masks, BOOL allowDoubleSize);
-
- protected:
- virtual void PrintOn(ostream & out) const;
- BOOL haveDimensions;
- int width, height, depth;
- BOOL haveHotSpot;
- int x, y;
- BinaryData clut;
- PixData andMask;
- PixData xorMask;
- PixData pixels;
- friend class Icon;
- friend class CursorResource;
- friend class Pattern;
- friend class Image;
- };
-
- /////////////////////////////////////////
- //
- // pixel based resources
- //
- PDECLARE_CLASS(PixelResource, ResourceObject)
- public:
- PixelResource(ResourceID * newId, PixelContents * newContents);
- protected:
- PixelContents contents;
- friend class PixelEditor;
- };
-
- /////////////////////////////////////////
- //
- // icon resources
- //
- PDECLARE_CLASS(Icon, PixelResource)
- public:
- Icon(ResourceID * newId, PixelContents * newContents);
- virtual void EditResource(MainWindow *, ResourceFile *);
- protected:
- virtual void PrintOn(ostream & out) const;
- };
-
- /////////////////////////////////////////
- //
- // dictionary to hold icon resources
- //
- PDECLARE_DICTIONARY(IconDict, POrdinalKey, Icon)
- virtual void PrintOn(ostream & out) const;
- };
- /////////////////////////////////////////
- //
- // cursor resources
- //
- PDECLARE_CLASS(CursorResource, PixelResource)
- public:
- CursorResource(ResourceID * newId, PixelContents * newContents);
- virtual void EditResource(MainWindow *, ResourceFile *);
- protected:
- virtual void PrintOn(ostream & out) const;
- };
-
- /////////////////////////////////////////
- //
- // dictionary to hold cursor resources
- //
- PDECLARE_DICTIONARY(CursorDict, POrdinalKey, CursorResource)
- virtual void PrintOn(ostream & out) const;
- };
- /////////////////////////////////////////
- //
- // pattern resources
- //
- PDECLARE_CLASS(Pattern, PixelResource)
- public:
- Pattern(ResourceID * newId, PixelContents * newContents);
- virtual void EditResource(MainWindow *, ResourceFile *);
- protected:
- virtual void PrintOn(ostream & out) const;
- };
-
- /////////////////////////////////////////
- //
- // dictionary to hold pattern resources
- //
- PDECLARE_DICTIONARY(PatternDict, POrdinalKey, Pattern)
- virtual void PrintOn(ostream & out) const;
- };
- /////////////////////////////////////////
- //
- // image resources
- //
- PDECLARE_CLASS(Image, PixelResource)
- public:
- Image(ResourceID * newId, PixelContents * newContents);
- virtual void EditResource(MainWindow *, ResourceFile *);
- protected:
- virtual void PrintOn(ostream & out) const;
- };
-
- /////////////////////////////////////////
- //
- // dictionary to hold image resources
- //
- PDECLARE_DICTIONARY(ImageDict, POrdinalKey, Image)
- virtual void PrintOn(ostream & out) const;
- };
- /////////////////////////////////////////
- //
- // arbitrary data resources
- //
- PDECLARE_CLASS(DataResource, ResourceObject)
- public:
- DataResource(ResourceID * newId, PString * newText, BinaryData * newData);
- virtual void EditResource(MainWindow *, ResourceFile *);
- protected:
- virtual void PrintOn(ostream & out) const;
- BinaryData data;
- };
-
- /////////////////////////////////////////
- //
- // dictionary to hold data resources
- //
- PDECLARE_DICTIONARY(DataDict, POrdinalKey, DataResource)
- virtual void PrintOn(ostream & out) const;
- };
- /////////////////////////////////////////
- //
- // resource file data
- //
- PDECLARE_CLASS(ResourceFile, PObject)
- public:
- ResourceFile(PFile & prcfile,
- BOOL suppressInfoWarnings,
- const PString & predefinedSymbols);
- ResourceID * GetUniqueIdentifierValue(const PAbstractDictionary & dict);
- void Backend(PFile & out);
- void OutputCode(const PFilePath & hdrname,
- ostream & hdr_stream, ostream & src_stream, BOOL suppressFlag);
- unsigned Warnings() { return warnings; }
- unsigned Fatals() { return fatals; }
- PINDEX GetNumDefines() const { return defineDict.GetSize(); }
- PString GetDefineName(PINDEX idx) { return defineDict.GetKeyAt(idx); }
- BOOL IsNameDefined(const PString & name) const { return defineDict.Contains(name); }
- ResourceList resources[ResourceList::NumResTypes];
-
- private:
- void AddDefineIdentifier(PString * identifer, DefineValue * value);
- int GetIdentifierValue(PString * identifer);
- ResourceID * GetAutoIdentifier(PString * ident,
- const PAbstractDictionary & dict);
- void AddResource(ResourceList::ResTypes res,
- ResourceObject * obj, const char * resname);
- DefineDict defineDict;
- StringDict stringDict;
- MenubarDict menubarDict;
- DialogDict dialogDict;
- IconDict iconDict;
- CursorDict cursorDict;
- PatternDict patternDict;
- ImageDict imageDict;
- DataDict dataDict;
- PAbstractDictionary * resourceDict[ResourceList::NumResTypes];
- PStringStream src_inline, hdr_inline;
- int nextResourceId;
- unsigned warnings;
- unsigned fatals;
- BOOL suppressInfoWarnings;
- friend int yylex();
- friend int yyparse();
- friend ostream & operator<<(ostream & out, const StdError & e);
- };
- extern PStringArray IncludePath;
- #endif
- // End PWRC.H /////////////////////////////////////////////////////////////////