diff options
author | Jens-Heiner Rechtien <hr@openoffice.org> | 2000-09-18 16:07:07 +0000 |
---|---|---|
committer | Jens-Heiner Rechtien <hr@openoffice.org> | 2000-09-18 16:07:07 +0000 |
commit | d791366863cf9659a01b171ce0e727bfe2f28cdf (patch) | |
tree | c44591abc4bf9e7207814d6d9a7756c37657249a /starmath/inc |
initial import
Diffstat (limited to 'starmath/inc')
-rw-r--r-- | starmath/inc/action.hxx | 105 | ||||
-rw-r--r-- | starmath/inc/applicat.hxx | 160 | ||||
-rw-r--r-- | starmath/inc/config.hxx | 161 | ||||
-rw-r--r-- | starmath/inc/dialog.hxx | 654 | ||||
-rw-r--r-- | starmath/inc/document.hxx | 277 | ||||
-rw-r--r-- | starmath/inc/edit.hxx | 160 | ||||
-rw-r--r-- | starmath/inc/format.hxx | 203 | ||||
-rw-r--r-- | starmath/inc/node.hxx | 867 | ||||
-rw-r--r-- | starmath/inc/parse.hxx | 301 | ||||
-rw-r--r-- | starmath/inc/rect.hxx | 304 | ||||
-rw-r--r-- | starmath/inc/smdll.hxx | 108 | ||||
-rw-r--r-- | starmath/inc/smmod.hxx | 128 | ||||
-rw-r--r-- | starmath/inc/starmath.hrc | 758 | ||||
-rw-r--r-- | starmath/inc/symbol.hxx | 225 | ||||
-rw-r--r-- | starmath/inc/toolbox.hxx | 124 | ||||
-rw-r--r-- | starmath/inc/types.hxx | 216 | ||||
-rw-r--r-- | starmath/inc/unomodel.hxx | 139 | ||||
-rw-r--r-- | starmath/inc/utility.hxx | 471 | ||||
-rw-r--r-- | starmath/inc/view.hxx | 313 |
19 files changed, 5674 insertions, 0 deletions
diff --git a/starmath/inc/action.hxx b/starmath/inc/action.hxx new file mode 100644 index 000000000000..1482372779d2 --- /dev/null +++ b/starmath/inc/action.hxx @@ -0,0 +1,105 @@ +/************************************************************************* + * + * $RCSfile: action.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: hr $ $Date: 2000-09-18 16:57:24 $ + * + * 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): _______________________________________ + * + * + ************************************************************************/ +#ifndef ACTION_HXX +#define ACTION_HXX + +#ifndef _UNDO_HXX //autogen +#include <svtools/undo.hxx> +#endif + +#ifndef FORMAT_HXX +#include "format.hxx" +#endif + +class SmDocShell; + +class SmEditAction: public SfxUndoAction +{ + SmDocShell *pDoc; + String aOldText; + String aNewText; + +public: + SmEditAction(SmDocShell *pDocSh, const String& rOldText, const String& rNewText); + + virtual void Undo(); + virtual void Redo(); + virtual void Repeat(SmDocShell *pDocSh); + virtual String GetComment() const; +}; + +class SmFormatAction: public SfxUndoAction +{ + SmDocShell *pDoc; + SmFormat aOldFormat; + SmFormat aNewFormat; + +public: + SmFormatAction(SmDocShell *pDocSh, const SmFormat& rOldFormat, const SmFormat& rNewFormat); + + virtual void Undo(); + virtual void Redo(); + virtual void Repeat(SmDocShell *pDocSh); + virtual String GetComment() const; +}; + +#endif + diff --git a/starmath/inc/applicat.hxx b/starmath/inc/applicat.hxx new file mode 100644 index 000000000000..21e438ffcb44 --- /dev/null +++ b/starmath/inc/applicat.hxx @@ -0,0 +1,160 @@ +/************************************************************************* + * + * $RCSfile: applicat.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: hr $ $Date: 2000-09-18 16:57:24 $ + * + * 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): _______________________________________ + * + * + ************************************************************************/ + + +#ifndef APPLICAT_HXX +#define APPLICAT_HXX + +class SvxErrorHandler; + +#ifndef _SFXAPP_HXX //autogen +#include <sfx2/app.hxx> +#endif + +/**************************************************************************/ +/* +** +** MACRO DEFINITION +** +**/ + +#define SMDLL 1 + +#define APPLICATIONNAME "smath3" + +/**************************************************************************/ +/* +** +** CLASS DEFINITION +** +**/ + +#ifdef WIN +#define RELEASE "WIN304" +#endif + +#ifdef PM2 +#define RELEASE "PM304" +#endif + +#ifdef MAC +#define RELEASE "MAC304" +#endif + +#ifdef WNT +#define RELEASE "WNT304" +#endif + +#ifdef UNX +#define RELEASE "UNX304" +#endif + +#ifndef SMDLL +class SmResId : public ResId +{ +public: + SmResId(USHORT nId) : + ResId(nId) + { + } + +}; + +#endif + +#ifndef _DLL_ +class SmDLL; + +class SmApplicat: public SfxApplication +{ +protected: + SvxErrorHandler *pSvxErrorHandler; + + // factories + virtual SfxFileDialog* CreateDocFileDialog(ULONG nBits, + const SfxObjectFactory &rFact); + virtual void OpenClients(); + + // initialization / deinitialization +#ifndef VCL + virtual void Init(int nArgs, char* pArgs[]); +#else + virtual void Init(); +#endif + virtual void Exit(); + +public: +#ifndef VCL + void Main(int nArgc, char* pArgv[]); +#else + void Main(); +#endif + + SmApplicat() : + SfxApplication("iso") + { + } + +}; + +#endif +#endif + diff --git a/starmath/inc/config.hxx b/starmath/inc/config.hxx new file mode 100644 index 000000000000..77b6455ccc7e --- /dev/null +++ b/starmath/inc/config.hxx @@ -0,0 +1,161 @@ +/************************************************************************* + * + * $RCSfile: config.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: hr $ $Date: 2000-09-18 16:57:24 $ + * + * 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): _______________________________________ + * + * + ************************************************************************/ +#ifndef CONFIG_HXX +#define CONFIG_HXX + +#ifndef _SFXBRDCST_HXX //autogen +#include <svtools/brdcst.hxx> +#endif +#ifndef _SFXLSTNER_HXX //autogen +#include <svtools/lstner.hxx> +#endif +#ifndef _SFXCFGITEM_HXX //autogen +#include <sfx2/cfgitem.hxx> +#endif + +#ifndef _FORMAT_HXX +#include "format.hxx" +#endif + +#define HINT_CONFIGCHANGED 10002 +#define SMCONFIGITEM (SID_SMA_START+1) + + +class SmPreferenceDialog; +class SmPrintDialog; +class SmPrintOptionDialog; +class SfxItemSet; + +enum SmPrintSize { PRINT_SIZE_NORMAL, PRINT_SIZE_SCALED, PRINT_SIZE_ZOOMED }; + +class SmConfig : public SfxBroadcaster, public SfxListener, public SfxConfigItem +{ + String aSymbolFile; + SmFormat aStandardFormat; + SmFontPickList vFontPickList[7]; + + SmPrintSize ePrintSize; + USHORT nPrintZoom; + + BOOL bPrintTitle, + bPrintText, + bPrintFrame, + bWarnNoSymbols, + bToolBoxVisible, + bCmdBoxWindow, + bAutoRedraw, + bFormulaCursor, + bNoRightSpaces; // ignorieren von ~ und ` am Zeilenende + + virtual void SFX_NOTIFY(SfxBroadcaster &rBC, const TypeId &rBCType, + const SfxHint &rHint, const TypeId &rHintType); + + void ConfigChangedAction(); + void SetValueIfNE(BOOL &rItem, const BOOL bVal); + +public: + SmConfig(); + virtual ~SmConfig(); + + virtual int Load (SvStream &rStream); + virtual BOOL Store(SvStream &rStream); + + virtual void UseDefault(); + virtual String GetName() const; + + SmFormat & GetFormat() { return aStandardFormat; } + SmFontPickList & GetFontPickList(USHORT nIdent) { return vFontPickList[nIdent]; } + + const String & GetSymbolFile() const { return aSymbolFile; } + void SetSymbolFile(const String &rText); + + SmPrintSize GetPrintSize() const { return ePrintSize; } + USHORT GetPrintZoom() const { return nPrintZoom; } + + BOOL IsCmdBoxWindowEnabled() const { return bCmdBoxWindow; } + + BOOL IsPrintTitle() const { return bPrintTitle; } + BOOL IsPrintText() const { return bPrintText; } + BOOL IsPrintFrame() const { return bPrintFrame; } + BOOL IsNoRightSpaces() const { return bNoRightSpaces; } + + BOOL IsToolBoxVisible() const { return bToolBoxVisible; } + void SetToolBoxVisible(BOOL bVal) { SetValueIfNE(bToolBoxVisible, bVal); } + + BOOL IsAutoRedraw() const { return bAutoRedraw; } + void SetAutoRedraw(BOOL bVal) { SetValueIfNE(bAutoRedraw, bVal); } + + BOOL IsWarnNoSymbols() const { return bWarnNoSymbols; } + void SetWarnNoSymbols(BOOL bVal) { SetValueIfNE(bWarnNoSymbols, bVal); } + + BOOL IsShowFormulaCursor() const { return bFormulaCursor; } + void SetShowFormulaCursor(BOOL bVal) { SetValueIfNE(bFormulaCursor, bVal); } + + void ItemSetToConfig(const SfxItemSet &rSet); + void ConfigToItemSet(SfxItemSet &rSet) const; + + friend SvStream & operator << (SvStream &rStream, const SmConfig &rConfig); + friend SvStream & operator >> (SvStream &rStream, SmConfig &rConfig); +}; + +#endif + + diff --git a/starmath/inc/dialog.hxx b/starmath/inc/dialog.hxx new file mode 100644 index 000000000000..6a1591c212bb --- /dev/null +++ b/starmath/inc/dialog.hxx @@ -0,0 +1,654 @@ +/************************************************************************* + * + * $RCSfile: dialog.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: hr $ $Date: 2000-09-18 16:57:24 $ + * + * 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): _______________________________________ + * + * + ************************************************************************/ +#ifndef DIALOG_HXX +#define DIALOG_HXX + +#ifndef _SV_DIALOG_HXX //autogen +#include <vcl/dialog.hxx> +#endif +#ifndef _SV_FIXED_HXX //autogen +#include <vcl/fixed.hxx> +#endif +#ifndef _SV_BUTTON_HXX //autogen +#include <vcl/button.hxx> +#endif +#ifndef _SV_IMAGE_HXX +#include <vcl/image.hxx> +#endif +#ifndef _SFXTABDLG_HXX //autogen +#include <sfx2/tabdlg.hxx> +#endif +#ifndef _SV_GROUP_HXX //autogen +#include <vcl/group.hxx> +#endif +#ifndef _SV_COMBOBOX_HXX //autogen +#include <vcl/combobox.hxx> +#endif +#ifndef _SVX_OPTGENRL_HXX //autogen +#include <svx/optgenrl.hxx> +#endif +#ifndef _BASEDLGS_HXX //autogen +#include <sfx2/basedlgs.hxx> +#endif +#ifndef _SV_FIELD_HXX //autogen +#include <vcl/field.hxx> +#endif +#ifndef _SV_MENUBTN_HXX //autogen +#include <vcl/menubtn.hxx> +#endif +#ifndef _SV_SCRBAR_HXX //autogen +#include <vcl/scrbar.hxx> +#endif +#ifndef _SV_CTRL_HXX //autogen +#include <vcl/ctrl.hxx> +#endif +#ifndef _SV_MENU_HXX //autogen +#include <vcl/menu.hxx> +#endif +#ifndef _CTRLBOX_HXX //autogen +#include <svtools/ctrlbox.hxx> +#endif +#ifndef _CTRLTOOL_HXX //autogen +#include <svtools/ctrltool.hxx> +#endif + +#ifndef UTILITY_HXX +#include "utility.hxx" +#endif +#ifndef FORMAT_HXX +#include "format.hxx" +#endif +#ifndef SYMBOL_HXX +#include "symbol.hxx" +#endif + + +#define CATEGORY_NONE 0xFFFF + +/**************************************************************************/ + +const XubString GetFontStyleName(const Font &rFont); +void SetFontStyle(const XubString &rStyleName, Font &rFont); + +/**************************************************************************/ + +class SmAboutDialog : public ModalDialog +{ + FixedText aFixedText1; + FixedText aFixedText2; + FixedText aFixedText3; + FixedText aFixedText4; + FixedText aFixedText5; + FixedText aFixedText6; + FixedText aReleaseText; + FixedBitmap aFixedBitmap1; + OKButton aOKButton1; + +public: + SmAboutDialog(Window *pParent, BOOL bFreeRes = TRUE); +}; + +/**************************************************************************/ + +class SmPrintOptionsTabPage : public SfxTabPage +{ + GroupBox aGroupBox1; + CheckBox aTitle; + CheckBox aText; + CheckBox aFrame; + GroupBox aGroupBox3; + CheckBox aNoRightSpaces; + GroupBox aGroupBox2; + RadioButton aSizeNormal; + RadioButton aSizeScaled; + RadioButton aSizeZoomed; + MetricField aZoom; + + DECL_LINK(SizeButtonClickHdl, Button *); + + virtual BOOL FillItemSet(SfxItemSet& rSet); + virtual void Reset(const SfxItemSet& rSet); + +public: + static SfxTabPage* Create(Window *pWindow, const SfxItemSet &rSet); + + SmPrintOptionsTabPage(Window *pParent, const SfxItemSet &rOptions); +}; + + +#ifdef NEVER +class SmGeneralTabPage : public SvxGeneralTabPage +{ +public : + static SfxTabPage* Create(Window* pWindow, const SfxItemSet& rSet); + + SmGeneralTabPage (Window *pParent, const SfxItemSet &rAttrSet) : + SvxGeneralTabPage (pParent, rAttrSet) + { + } +}; +#endif //NEVER + +/**************************************************************************/ + +#ifdef NEVER +class SmExtraOptionsTabPage : public SfxTabPage +{ + CheckBox aAutoRedraw; + FixedText aFixedText1; + SmInfoText aSymbolFile; + PushButton aBrowseButton; + + DECL_LINK(SymClickHdl, PushButton*); + + virtual BOOL FillItemSet(SfxItemSet& rOutSet); + virtual void Reset(const SfxItemSet& rOutSet); + +public: + SmExtraOptionsTabPage(const SfxItemSet& rInSet, Window *pParent, BOOL bFreeRes = TRUE); + + static SfxTabPage* Create(Window* pWindow, const SfxItemSet& rSet); +}; +#endif //NEVER + +/**************************************************************************/ + +class SmShowFont : public Control +{ + virtual void Paint(const Rectangle&); + +public: + SmShowFont(Window *pParent, const ResId& rResId) : + Control(pParent, rResId) + { + } + + void SetFont(const Font& rFont); +}; + +class SmFontDialog : public ModalDialog +{ + FixedText aFixedText1; + ComboBox aFontBox; + CheckBox aBoldCheckBox; + CheckBox aItalicCheckBox; + OKButton aOKButton1; + CancelButton aCancelButton1; + SmShowFont aShowFont; + GroupBox aGroupBox1; + GroupBox aGroupBox2; + + Font Face; + + DECL_LINK(FontChangeHdl, ComboBox *); + DECL_LINK(AttrChangeHdl, CheckBox *); + +public: + SmFontDialog(Window * pParent, BOOL bFreeRes = TRUE); + + const Font& GetFont() const { return Face; } + void SetFont(const Font &rFont); +}; + +/**************************************************************************/ + +class SmFontSizeDialog : public ModalDialog +{ + FixedText aFixedText1; + MetricField aBaseSize; + FixedText aFixedText4; + MetricField aTextSize; + FixedText aFixedText5; + MetricField aIndexSize; + FixedText aFixedText6; + MetricField aFunctionSize; + FixedText aFixedText7; + MetricField aOperatorSize; + FixedText aFixedText8; + MetricField aBorderSize; + GroupBox aGroupBox1; + OKButton aOKButton1; + CancelButton aCancelButton1; + PushButton aDefaultButton; + + DECL_LINK(DefaultButtonClickHdl, Button *); + +public: + SmFontSizeDialog(Window *pParent, BOOL bFreeRes = TRUE); + + void ReadFrom(const SmFormat &rFormat); + void WriteTo (SmFormat &rFormat) const; +}; + +/**************************************************************************/ + +class SmFontTypeDialog : public ModalDialog +{ + FixedText aFixedText1; + SmFontPickListBox aVariableFont; + FixedText aFixedText2; + SmFontPickListBox aFunctionFont; + FixedText aFixedText3; + SmFontPickListBox aNumberFont; + FixedText aFixedText4; + SmFontPickListBox aTextFont; + FixedText aFixedText5; + SmFontPickListBox aSerifFont; + FixedText aFixedText6; + SmFontPickListBox aSansFont; + FixedText aFixedText7; + SmFontPickListBox aFixedFont; + GroupBox aGroupBox1; + GroupBox aGroupBox2; + OKButton aOKButton1; + CancelButton aCancelButton1; + MenuButton aMenuButton; + PushButton aDefaultButton; + + DECL_LINK(MenuSelectHdl, Menu *); + DECL_LINK(DefaultButtonClickHdl, Button *); + +public: + SmFontTypeDialog(Window *pParent, BOOL bFreeRes = TRUE); + + void ReadFrom(const SmFormat &rFormat); + void WriteTo (SmFormat &rFormat) const; +}; + +/**************************************************************************/ + +#define NOCATEGORIES 10 + +class SmCategoryDesc : public Resource +{ + XubString Name; + XubString *Strings[4]; + Bitmap *Graphics[4]; + USHORT Minimum[4]; + USHORT Maximum[4]; + USHORT Value[4]; + +public: + SmCategoryDesc(const ResId &rResId, USHORT nCategoryIdx); + ~SmCategoryDesc(); + + const XubString & GetName() const { return Name; } + const XubString * GetString(USHORT Index) const { return Strings[Index]; } + const Bitmap * GetGraphic(USHORT Index) const { return Graphics[Index]; } + USHORT GetMinimum(USHORT Index) { return Minimum[Index]; } + USHORT GetMaximum(USHORT Index) { return Maximum[Index]; } + USHORT GetValue(USHORT Index) const { return Value[Index]; } + void SetValue(USHORT Index, USHORT nVal) { Value[Index] = nVal;} +}; + + +class SmDistanceDialog : public ModalDialog +{ + FixedText aFixedText1; + MetricField aMetricField1; + FixedText aFixedText2; + MetricField aMetricField2; + FixedText aFixedText3; + MetricField aMetricField3; + CheckBox aCheckBox1; + FixedText aFixedText4; + MetricField aMetricField4; + OKButton aOKButton1; + CancelButton aCancelButton1; + MenuButton aMenuButton; + PushButton aDefaultButton; + FixedBitmap aBitmap; + GroupBox aGroupBox; + + SmCategoryDesc *Categories[NOCATEGORIES]; + USHORT nActiveCategory; + BOOL bScaleAllBrackets; + + DECL_LINK(GetFocusHdl, Control *); + DECL_LINK(MenuSelectHdl, Menu *); + DECL_LINK(DefaultButtonClickHdl, Button *); + DECL_LINK(CheckBoxClickHdl, CheckBox *); + + void SetHelpId(MetricField &rField, ULONG nHelpId); + void SetCategory(USHORT Category); + +public: + SmDistanceDialog(Window *pParent, BOOL bFreeRes = TRUE); + ~SmDistanceDialog(); + + void ReadFrom(const SmFormat &rFormat); + void WriteTo (SmFormat &rFormat) /*const*/; +}; + + +/**************************************************************************/ + + +class SmAlignDialog : public ModalDialog +{ + RadioButton aLeft; + RadioButton aCenter; + RadioButton aRight; + GroupBox aGroupBox1; + OKButton aOKButton1; + CancelButton aCancelButton1; + PushButton aDefaultButton; + + DECL_LINK(DefaultButtonClickHdl, Button *); + +public: + SmAlignDialog(Window *pParent, BOOL bFreeRes = TRUE); + + void ReadFrom(const SmFormat &rFormat); + void WriteTo (SmFormat &rFormat) const; +}; + +/**************************************************************************/ + +class SmShowSymbolSet : public Control +{ + SmSymSet aSymbolSet; + ScrollBar aVScrollBar; + Size aOutputSize; + Link aSelectHdlLink; + Link aDblClickHdlLink; + USHORT nLen; + USHORT nRows, nColumns; + USHORT nSelectSymbol; + + virtual void Paint(const Rectangle&); + virtual void MouseButtonDown(const MouseEvent& rMEvt); + virtual void KeyInput(const KeyEvent& rKEvt); + + DECL_LINK( ScrollHdl, ScrollBar* ); + +public: + SmShowSymbolSet(Window *pParent, const ResId& rResId); + + void SetSymbolSet(const SmSymSet& rSymbolSet); + + void SelectSymbol(USHORT nSymbol); + USHORT GetSelectSymbol() const { return nSelectSymbol; } + + void SetSelectHdl(const Link& rLink) { aSelectHdlLink = rLink; } + void SetDblClickHdl(const Link& rLink) { aDblClickHdlLink = rLink; } +}; + +//////////////////////////////////////////////////////////////////////////////// + +class SmShowSymbol : public Control +{ + Link aDblClickHdlLink; + + virtual void Paint(const Rectangle&); + virtual void MouseButtonDown(const MouseEvent& rMEvt); + +public: + SmShowSymbol(Window *pParent, const ResId& rResId) : + Control(pParent, rResId) {} + + void SetSymbol(const SmSym *pSymbol); + void SetDblClickHdl(const Link &rLink) { aDblClickHdlLink = rLink; } +}; + +//////////////////////////////////////////////////////////////////////////////// + +class SmSymDefineDialog; + +class SmSymbolDialog : public ModalDialog +{ + FixedText aSymbolSetText; + ListBox aSymbolSets; + SmShowSymbolSet aSymbolSetDisplay; + GroupBox aGrpBox; + FixedText aSymbolName; + SmShowSymbol aSymbolDisplay; + PushButton aCloseBtn; + PushButton aEditBtn; + PushButton aGetBtn; + + SmSymSetManager &rSymSetMgr; + const SmSymSet *pSymSet; + + DECL_LINK(SymbolSetChangeHdl, ListBox *); + DECL_LINK(SymbolChangeHdl, SmShowSymbolSet *); + DECL_LINK(SymbolDblClickHdl, SmShowSymbolSet *); + DECL_LINK(CloseClickHdl, Button *); + DECL_LINK(EditClickHdl, Button *); + DECL_LINK(GetClickHdl, Button *); + + void FillSymbolSets(BOOL bDeleteText = TRUE); + void SetSymbolSetManager(SmSymSetManager &rMgr); + const SmSym *GetSymbol() const; + +public: + SmSymbolDialog(Window * pParent, SmSymSetManager &rSymSetMgr, BOOL bFreeRes = TRUE); + + BOOL SelectSymbolSet(const XubString &rSymbolSetName); + void SelectSymbol(USHORT nSymbolNo); +}; + +/**************************************************************************/ + +class SmShowCharset : public Control +{ + Link aSelectHdlLink; + Link aDblClickHdlLink; + USHORT nLen; + USHORT nRows, nColumns; + xub_Unicode aChar; + + virtual void Paint(const Rectangle&); + virtual void MouseButtonDown( const MouseEvent& rMEvt ); + virtual void KeyInput(const KeyEvent& rKEvt); + +public: + SmShowCharset(Window *pParent, const ResId& rResId); + + void SetSelectHdl(const Link& rLink) + { + aSelectHdlLink = rLink; + } + + void SetDblClickHdl(const Link& rLink) + { + aDblClickHdlLink = rLink; + } + + void SetFont(const Font &rFont); + void SelectChar(xub_Unicode aChar); + xub_Unicode GetSelectChar() const { return aChar; } +}; + +//////////////////////////////////////////////////////////////////////////////// + +class SmShowChar : public Control +{ + virtual void Paint(const Rectangle&); + +public: + SmShowChar(Window *pParent, const ResId& rResId) + : Control(pParent, rResId) + { + } + + void SetChar(xub_Unicode aChar); + void SetFont(const Font &rFont); +}; + +//////////////////////////////////////////////////////////////////////////////// + +class SmSymDefineDialog : public ModalDialog +{ + FixedText aOldSymbolText; + ComboBox aOldSymbols; + FixedText aOldSymbolSetText; + ComboBox aOldSymbolSets; + SmShowCharset aCharsetDisplay; + FixedText aSymbolText; + ComboBox aSymbols; + FixedText aSymbolSetText; + ComboBox aSymbolSets; + FixedText aFontText; + ListBox aFonts; + FixedText aStyleText; + FontStyleBox aStyles; + FixedText aOldSymbolName; + SmShowChar aOldSymbolDisplay; + FixedText aOldSymbolSetName; + FixedText aSymbolName; + SmShowChar aSymbolDisplay; + FixedText aSymbolSetName; + OKButton aOkBtn; + CancelButton aCancelBtn; + PushButton aAddBtn; + PushButton aChangeBtn; + PushButton aDeleteBtn; + FixedImage aRightArrow; + + SmSymSetManager aSymSetMgrCopy, + &rSymSetMgr; + const SmSym *pOrigSymbol; + + FontList *pFontList; + + DECL_LINK(OldSymbolChangeHdl, ComboBox *); + DECL_LINK(OldSymbolSetChangeHdl, ComboBox *); + DECL_LINK(ModifyHdl, ComboBox *); + DECL_LINK(FontChangeHdl, ListBox *); + DECL_LINK(StyleChangeHdl, ComboBox *); + DECL_LINK(CharSelectHdl, SmShowCharset *); + DECL_LINK(AddClickHdl, Button *); + DECL_LINK(ChangeClickHdl, Button *); + DECL_LINK(DeleteClickHdl, Button *); + + void FillSymbols(ComboBox &rComboBox, BOOL bDeleteText = TRUE); + void FillSymbolSets(ComboBox &rComboBox, BOOL bDeleteText = TRUE); + void FillFonts(BOOL bDeleteText = TRUE); + void FillStyles(BOOL bDeleteText = TRUE); + + void SetSymbolSetManager(const SmSymSetManager &rMgr); + void SetFont(const XubString &rFontName, const XubString &rStyleName); + void SetOrigSymbol(const SmSym *pSymbol, const XubString &rSymbolSetName); + void UpdateButtons(); + + BOOL SelectSymbolSet(ComboBox &rComboBox, const XubString &rSymbolSetName, + BOOL bDeleteText); + BOOL SelectSymbol(ComboBox &rComboBox, const XubString &rSymbolName, + BOOL bDeleteText); + BOOL SelectFont(const XubString &rFontName, BOOL bApplyFont); + BOOL SelectStyle(const XubString &rStyleName, BOOL bApplyFont); + + + SmSymSet *GetSymbolSet(const ComboBox &rComboBox); + inline const SmSymSet *GetSymbolSet(const ComboBox &rComboBox) const; + SmSym *GetSymbol(const ComboBox &rComboBox); + inline const SmSym *GetSymbol(const ComboBox &rComboBox) const; + +public: + SmSymDefineDialog(Window *pParent, SmSymSetManager &rMgr, BOOL bFreeRes = TRUE); + ~SmSymDefineDialog(); + + // Dialog + virtual short Execute(); + + inline BOOL SelectOldSymbolSet(const XubString &rSymbolSetName); + inline BOOL SelectOldSymbol(const XubString &rSymbolName); + inline BOOL SelectSymbolSet(const XubString &rSymbolSetName); + inline BOOL SelectSymbol(const XubString &rSymbolName); + BOOL SelectFont(const XubString &rFontName) { return SelectFont(rFontName, TRUE); } + BOOL SelectStyle(const XubString &rStyleName) { return SelectStyle(rStyleName, TRUE); }; + void SelectChar(xub_Unicode cChar); +}; + +inline const SmSymSet * SmSymDefineDialog::GetSymbolSet(const ComboBox &rComboBox) const +{ + return ((SmSymDefineDialog *) this)->GetSymbolSet(rComboBox); +} + +inline const SmSym * SmSymDefineDialog::GetSymbol(const ComboBox &rComboBox) const +{ + return ((SmSymDefineDialog *) this)->GetSymbol(rComboBox); +} + +inline BOOL SmSymDefineDialog::SelectOldSymbolSet(const XubString &rSymbolSetName) +{ + return SelectSymbolSet(aOldSymbolSets, rSymbolSetName, FALSE); +} + +inline BOOL SmSymDefineDialog::SelectOldSymbol(const XubString &rSymbolName) +{ + return SelectSymbol(aOldSymbols, rSymbolName, FALSE); +} + +inline BOOL SmSymDefineDialog::SelectSymbolSet(const XubString &rSymbolSetName) +{ + return SelectSymbolSet(aSymbolSets, rSymbolSetName, FALSE); +} + +inline BOOL SmSymDefineDialog::SelectSymbol(const XubString &rSymbolName) +{ + return SelectSymbol(aSymbols, rSymbolName, FALSE); +} + + +#endif + diff --git a/starmath/inc/document.hxx b/starmath/inc/document.hxx new file mode 100644 index 000000000000..f33ef8169193 --- /dev/null +++ b/starmath/inc/document.hxx @@ -0,0 +1,277 @@ +/************************************************************************* + * + * $RCSfile: document.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: hr $ $Date: 2000-09-18 16:57:24 $ + * + * 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): _______________________________________ + * + * + ************************************************************************/ +#ifndef DOCUMENT_HXX +#define DOCUMENT_HXX + +#define SMDLL 1 + +#ifndef _SVSTOR_HXX //autogen +#include <so3/svstor.hxx> +#endif +#ifndef _SOT_SOTREF_HXX //autogen +#include <sot/sotref.hxx> +#endif +#ifndef _SFX_OBJSH_HXX //autogen +#include <sfx2/objsh.hxx> +#endif +#ifndef _SFX_INTERNO_HXX //autogen +#include <sfx2/interno.hxx> +#endif +#ifndef _SFXLSTNER_HXX //autogen +#include <svtools/lstner.hxx> +#endif +#ifndef _SFX_OBJFAC_HXX //autogen +#include <sfx2/docfac.hxx> +#endif +#ifndef _SV_VIRDEV_HXX //autogen +#include <vcl/virdev.hxx> +#endif + +#ifndef _FORMAT_HXX +#include "format.hxx" +#endif +#ifndef PARSE_HXX +#include "parse.hxx" +#endif +#ifndef SMMOD_HXX +#include "smmod.hxx" +#endif + +class SmNode; +class SfxPrinter; +class Printer; + + +#ifndef SO2_DECL_SVSTORAGESTREAM_DEFINED +#define SO2_DECL_SVSTORAGESTREAM_DEFINED +SO2_DECL_REF(SvStorageStream) +#endif + +#define HINT_DATACHANGED 1004 + +#define SM30BIDENT ((ULONG)0x534D3033L) +#define SM30IDENT ((ULONG)0x30334d53L) +#define SM304AIDENT ((ULONG)0x34303330L) +#define SM30VERSION ((ULONG)0x00010000L) +#define SM50VERSION ((ULONG)0x00010001L) //Unterschied zur SM30VERSION ist + //der neue Border im Format. + +#define FRMIDENT ((ULONG)0x03031963L) +#define FRMVERSION ((ULONG)0x00010001L) + +/* Zugriff auf den Drucker sollte ausschliesslich ueber diese Klasse erfolgen + * ========================================================================== + * + * Der Drucker kann dem Dokument oder auch dem OLE-Container gehoeren. Wenn + * das Dokument also eine OLE-Dokument ist, so gehoert der Drucker auch + * grundsaetzlich dem Container. Der Container arbeitet aber eventuell mit + * einer anderen MapUnit als der Server. Der Drucker wird bezueglich des MapMode + * im Konstruktor entsprechend eingestellt und im Destruktor wieder restauriert. + * Das bedingt natuerlich, das diese Klasse immer nur kurze Zeit existieren darf + * (etwa waehrend des Paints). + * Die Kontrolle darueber ob der Drucker selbst angelegt, vom Server besorgt + * oder dann auch NULL ist, uebernimmt die DocShell in der Methode GetPrt(), + * fuer die der Access auch Friend der DocShell ist. +*/ +class SmDocShell; + +class SmPrinterAccess +{ + Printer *pPrinter; +public: + SmPrinterAccess( SmDocShell &rDocShell ); + ~SmPrinterAccess(); + Printer *GetPrinter() { return pPrinter; } +}; + + +//////////////////////////////////////////////////////////// + +class SmDocShell : public SfxObjectShell, public SfxInPlaceObject, public SfxListener +{ + friend class SmPrinterAccess; + + String aText; + SmFormat aFormat; + SmParser aInterpreter; + SvDataTypeList aDataTypeList; + SvStorageStreamRef aDocStream; + SmNode *pTree; + SvInPlaceMenuBar *pMenuBar; + SfxMenuBarManager *pMenuMgr; + SfxUndoManager *pUndoMgr; + SfxPrinter *pPrinter; //Siehe Kommentar zum SmPrinter Access! + Printer *pTmpPrinter; //ebenfalls + long nLeftBorder, + nRightBorder, + nTopBorder, + nBottomBorder; + USHORT nModifyCount; + BOOL bIsFormulaArranged; + + + + virtual void SFX_NOTIFY(SfxBroadcaster& rBC, const TypeId& rBCType, + const SfxHint& rHint, const TypeId& rHintType); + + void RestartFocusTimer (); + + BOOL Try3x( SvStorage *pStor, StreamMode eMode); + BOOL Try2x( SvStorage *pStor, StreamMode eMode); + BOOL WriteAsMathType3( SfxMedium& ); + + virtual void Draw(OutputDevice *pDevice, + const JobSetup & rSetup, + USHORT nAspect = ASPECT_CONTENT); + + virtual void FillRegInfo(SvEmbeddedRegistryInfo * pInfo); + virtual void FillClass(SvGlobalName* pClassName, + ULONG* pFormat, + String* pAppName, + String* pFullTypeName, + String* pShortTypeName, + long nFileFormat = SOFFICE_FILEFORMAT_NOW) const; + + virtual const SvDataTypeList& GetTypeList() const; + virtual BOOL GetData(SvData *pData); + virtual BOOL SetData(SvData *pData); + virtual ULONG GetMiscStatus() const; + virtual void OnDocumentPrinterChanged( Printer * ); + virtual BOOL InitNew(SvStorage *); + virtual BOOL Load(SvStorage *); + virtual BOOL Insert(SvStorage *); + void ImplSave( SvStorageStreamRef xStrm ); + virtual BOOL Save(); + virtual BOOL SaveAs( SvStorage *pNewStor ); + virtual BOOL ConvertTo( SfxMedium &rMedium ); + virtual BOOL SaveCompleted( SvStorage *pNewStor ); + virtual void HandsOff(); + + Printer *GetPrt(); + + void Convert40To50Txt(); + + BOOL IsFormulaArranged() const { return bIsFormulaArranged; } + void SetFormulaArranged(BOOL bVal) { bIsFormulaArranged = bVal; } + void ArrangeFormula(); + + virtual BOOL ConvertFrom(SfxMedium &rMedium); + BOOL InsertFrom(SfxMedium &rMedium); + + BOOL ImportSM20File(SvStream *pStream, BOOL bInsert = FALSE); + +public: + TYPEINFO(); + SFX_DECL_INTERFACE(SFX_INTERFACE_SMA_START+1); +#if 0 + SFX_DECL_OBJECTFACTORY(SmDocShell); +#else + SFX_DECL_OBJECTFACTORY_DLL(SmDocShell, SM_MOD()); +#endif + + SmDocShell(SfxObjectCreateMode eMode = SFX_CREATE_MODE_EMBEDDED); + virtual ~SmDocShell(); + + void LoadSymbols(); + void SaveSymbols(); + + //Zugriff fuer die View. Diese Zugriffe sind nur fuer den nicht OLE-Fall! + //und fuer die Kommunikation mit dem SFX! + //Alle internen Verwendungen des Printers sollten ausschlieslich uber + //den SmPrinterAccess funktionieren. + BOOL HasPrinter() { return 0 != pPrinter; } + SfxPrinter *GetPrinter() { GetPrt(); return pPrinter; } + void SetPrinter( SfxPrinter * ); + + const String &GetTitle() const; + const String &GetComment() const; + + void SetText(const String& rBuffer); + String& GetText() { return (aText); } + void SetFormat(SmFormat& rFormat); + SmFormat& GetFormat() { return (aFormat); } + + void Parse(); + SmParser & GetParser() { return aInterpreter; } + const SmNode * GetFormulaTree() const { return pTree; } + + void Draw(OutputDevice &rDev, Point &rPosition); + Size GetSize(); + + void Resize(); + + virtual SfxUndoManager *GetUndoManager (); + + virtual SfxItemPool& GetPool(); + + void Execute( SfxRequest& rReq ); + void GetState(SfxItemSet &); + + virtual SvDataMemberObjectRef CreateSnapshot (); + virtual void SetVisArea (const Rectangle & rVisArea); + virtual void UIActivate (BOOL bActivate); + +virtual void SetModified(BOOL bModified); +}; + + +#endif + diff --git a/starmath/inc/edit.hxx b/starmath/inc/edit.hxx new file mode 100644 index 000000000000..7fee113a88df --- /dev/null +++ b/starmath/inc/edit.hxx @@ -0,0 +1,160 @@ +/************************************************************************* + * + * $RCSfile: edit.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: hr $ $Date: 2000-09-18 16:57:24 $ + * + * 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): _______________________________________ + * + * + ************************************************************************/ +#ifndef EDIT_HXX +#define EDIT_HXX + +#ifndef _SV_WINDOW_HXX //autogen +#include <vcl/window.hxx> +#endif +#ifndef _SV_TIMER_HXX //autogen +#include <vcl/timer.hxx> +#endif +#ifndef _MyEDITDATA_HXX //autogen +#include <svx/editdata.hxx> +#endif + +class SmDocShell; +class SmViewShell; +class EditView; +class EditEngine; +class EditStatus; +class ScrollBar; +class ScrollBarBox; +class DataChangedEvent; +class Menu; + +/**************************************************************************/ + + void SmGetLeftSelectionPart(const ESelection aSelection, + USHORT &nPara, USHORT &nPos); + +/**************************************************************************/ + +class SmEditWindow: public Window +{ + EditView *pEditView; +#if SUPD >= 602 + SfxItemPool *pEditEngineItemPool; +#endif + EditEngine *pEditEngine; + ScrollBar *pHScrollBar, + *pVScrollBar; + ScrollBarBox *pScrollBox; + Timer aModifyTimer, + aCursorMoveTimer; + ESelection aOldSelection; + + virtual void KeyInput(const KeyEvent& rKEvt); + virtual void Command(const CommandEvent& rCEvt); + DECL_LINK(MenuSelectHdl, Menu *); + DECL_LINK(ModifyTimerHdl, Timer *); + DECL_LINK(CursorMoveTimerHdl, Timer *); + + virtual void DataChanged( const DataChangedEvent& ); + virtual void Resize(); + virtual void MouseMove(const MouseEvent &rEvt); + virtual void MouseButtonUp(const MouseEvent &rEvt); + virtual void MouseButtonDown(const MouseEvent &rEvt); + + virtual BOOL Drop(const DropEvent& rEvt); + virtual BOOL QueryDrop(DropEvent & rEvt); + virtual void Paint(const Rectangle& rRect); + + DECL_LINK(EditStatusHdl ,EditStatus *); + DECL_LINK(ScrollHdl, ScrollBar *); + + void CreateEditEngine(); + + Rectangle AdjustScrollBars(); + void SetScrollBarRanges(); + void InitScrollBars(); + void ImplSetFont(); + +public: + SmEditWindow(Window *pParent); + ~SmEditWindow(); + + virtual void SetText(const XubString &rText); + virtual XubString GetText(); + + ESelection GetSelection() const; + void SetSelection(const ESelection &rSel); + + BOOL IsEmpty() const; + BOOL IsSelected() const; + BOOL IsAllSelected() const; + void Cut(); + void Copy(); + void Paste(); + void Delete(); + void SelectAll(); + void InsertText(const String &rText); + void InsertCommand(USHORT nCommand); + void MarkError(const Point &rPos); + void SelNextMark(); + void SelPrevMark(); + BOOL HasMark(const String &rText) const; + + void Flush(); +}; + +#endif + diff --git a/starmath/inc/format.hxx b/starmath/inc/format.hxx new file mode 100644 index 000000000000..8b17d8893fb9 --- /dev/null +++ b/starmath/inc/format.hxx @@ -0,0 +1,203 @@ +/************************************************************************* + * + * $RCSfile: format.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: hr $ $Date: 2000-09-18 16:57:24 $ + * + * 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): _______________________________________ + * + * + ************************************************************************/ +#ifndef FORMAT_HXX +#define FORMAT_HXX + + +#ifndef _SFXSMPLHINT_HXX //autogen +#include <svtools/smplhint.hxx> +#endif +#ifndef _SFXBRDCST_HXX //autogen +#include <svtools/brdcst.hxx> +#endif + +#ifndef UTILITY_HXX +#include "utility.hxx" +#endif + + +#define SM_FMT_VERSION_51 ((BYTE) 0x01) +#define SM_FMT_VERSION_NOW SM_FMT_VERSION_51 + +#ifndef MAC +#define FNTNAME_TIMES "Times New Roman" +#else +#define FNTNAME_TIMES "Times" +#endif +#define FNTNAME_HELV "Helvetica" +#define FNTNAME_COUR "Courier" +#define FNTNAME_MATH "StarMath" + + +// symbolic names used as array indices +#define SIZ_BEGIN 0 +#define SIZ_TEXT 0 +#define SIZ_INDEX 1 +#define SIZ_FUNCTION 2 +#define SIZ_OPERATOR 3 +#define SIZ_LIMITS 4 +#define SIZ_END 4 + +// symbolic names used as array indices +#define FNT_BEGIN 0 +#define FNT_VARIABLE 0 +#define FNT_FUNCTION 1 +#define FNT_NUMBER 2 +#define FNT_TEXT 3 +#define FNT_SERIF 4 +#define FNT_SANS 5 +#define FNT_FIXED 6 +#define FNT_MATH 7 +#define FNT_END 7 + +// symbolic names used as array indices +#define DIS_BEGIN 0 +#define DIS_HORIZONTAL 0 +#define DIS_VERTICAL 1 +#define DIS_ROOT 2 +#define DIS_SUPERSCRIPT 3 +#define DIS_SUBSCRIPT 4 +#define DIS_NUMERATOR 5 +#define DIS_DENOMINATOR 6 +#define DIS_FRACTION 7 +#define DIS_STROKEWIDTH 8 +#define DIS_UPPERLIMIT 9 +#define DIS_LOWERLIMIT 10 +#define DIS_BRACKETSIZE 11 +#define DIS_BRACKETSPACE 12 +#define DIS_MATRIXROW 13 +#define DIS_MATRIXCOL 14 +#define DIS_ORNAMENTSIZE 15 +#define DIS_ORNAMENTSPACE 16 +#define DIS_OPERATORSIZE 17 +#define DIS_OPERATORSPACE 18 +#define DIS_LEFTSPACE 19 +#define DIS_RIGHTSPACE 20 +#define DIS_TOPSPACE 21 +#define DIS_BOTTOMSPACE 22 +#define DIS_NORMALBRACKETSIZE 23 +#define DIS_END 23 + + +// to be broadcastet on format changes: +#define HINT_FORMATCHANGED 10003 + +enum SmHorAlign { AlignLeft, AlignCenter, AlignRight }; + +class SmFormat : public SfxBroadcaster +{ + SmFace vFont[FNT_END + 1]; + Size aBaseSize; + long nVersion; + USHORT vSize[SIZ_END + 1]; + USHORT vDist[DIS_END + 1]; + SmHorAlign eHorAlign; + BOOL bIsTextmode, + bScaleNormalBrackets; + +public: + SmFormat(); + SmFormat(const SmFormat &rFormat) { *this = rFormat; } + + const Size & GetBaseSize() const { return aBaseSize; } + void SetBaseSize(const Size &rSize) { aBaseSize = rSize; } + + const SmFace & GetFont(USHORT nIdent) const { return vFont[nIdent]; } + SmFace & Font (USHORT nIdent) { return vFont[nIdent]; } + void SetFont(USHORT nIdent, const SmFace &rFont) { vFont[nIdent] = rFont; } + + USHORT GetRelSize(USHORT nIdent) const { return vSize[nIdent]; } + void SetRelSize(USHORT nIdent, USHORT nVal) { vSize[nIdent] = nVal;} + + USHORT GetDistance(USHORT nIdent) const { return vDist[nIdent]; } + void SetDistance(USHORT nIdent, USHORT nVal) { vDist[nIdent] = nVal; } + + SmHorAlign GetHorAlign() const { return eHorAlign; } + void SetHorAlign(SmHorAlign eAlign) { eHorAlign = eAlign; } + + BOOL IsTextmode() const { return bIsTextmode; } + void SetTextmode(BOOL bVal) { bIsTextmode = bVal; } + + BOOL IsScaleNormalBrackets() const { return bScaleNormalBrackets; } + void SetScaleNormalBrackets(BOOL bVal) { bScaleNormalBrackets = bVal; } + + long GetVersion() const { return nVersion; } + + //! at time (5.1) use only the lower byte!!! + void SetVersion(long nVer) { nVersion = nVer; } + + SmFormat & operator = (const SmFormat &rFormat); + + void RequestApplyChanges() const + { + ((SmFormat *) this)->Broadcast(SfxSimpleHint(HINT_FORMATCHANGED)); + } + + // functions for compatibility with older versions + void ReadSM20Format(SvStream &rStream); + void From300To304a(); + + friend SvStream & operator << (SvStream &rStream, const SmFormat &rFormat); + friend SvStream & operator >> (SvStream &rStream, SmFormat &rFormat); +}; + +#endif + diff --git a/starmath/inc/node.hxx b/starmath/inc/node.hxx new file mode 100644 index 000000000000..7218c4dc478b --- /dev/null +++ b/starmath/inc/node.hxx @@ -0,0 +1,867 @@ +/************************************************************************* + * + * $RCSfile: node.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: hr $ $Date: 2000-09-18 16:57:24 $ + * + * 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): _______________________________________ + * + * + ************************************************************************/ + + +#ifndef NODE_HXX +#define NODE_HXX + + +#ifndef _DYNARY_HXX //autogen +#include <tools/dynary.hxx> +#endif + +#include "parse.hxx" +#include "xchar.hxx" +#include "types.hxx" +#include "rect.hxx" +#include "format.hxx" + + +#define ATTR_BOLD 0x0001 +#define ATTR_ITALIC 0x0002 + +#define FNTSIZ_ABSOLUT 1 +#define FNTSIZ_PLUS 2 +#define FNTSIZ_MINUS 3 +#define FNTSIZ_MULTIPLY 4 +#define FNTSIZ_DIVIDE 5 + +// flags to interdict respective status changes +#define FLG_FONT 0x0001 +#define FLG_SIZE 0x0002 +#define FLG_BOLD 0x0004 +#define FLG_ITALIC 0x0008 +#define FLG_COLOR 0x0010 +#define FLG_VISIBLE 0x0020 +#define FLG_HORALIGN 0x0040 + + +extern SmFormat *pActiveFormat; + +class SmNode; +DECLARE_DYNARRAY(SmNodeArray, SmNode *); + +enum SmScaleMode { SCALE_NONE, SCALE_WIDTH, SCALE_HEIGHT }; + +enum SmNodeType +{ + NTABLE, NBRACE, NBRACEBODY, NOPER, NALIGN, + NATTRIBUT, NFONT, NUNHOR, NBINHOR, NBINVER, + NBINDIAGONAL, NSUBSUP, NMATRIX, NPLACE, NTEXT, + NSPECIAL, NGLYPH_SPECIAL, NMATH, NBLANK, NERROR, + NLINE, NEXPRESSION, NPOLYGON, NPOLYLINE, NROOT, + NROOTSYMBOL, NRECTANGLE, NVERTICAL_BRACE +}; + + +//////////////////////////////////////////////////////////////////////////////// + + +class SmNode : public SmRect +{ + SmFace aFace; + + SmToken aNodeToken; + SmNodeType eType; + SmScaleMode eScaleMode; + RectHorAlign eRectHorAlign; + USHORT nFlags, + nAttributes; + BOOL bIsPhantom, + bIsDebug; +protected: + SmNode(SmNodeType eNodeType, const SmToken &rNodeToken); + +public: + virtual ~SmNode(); + + virtual BOOL IsVisible() const = 0; + + virtual USHORT GetNumSubNodes() const = 0; + virtual SmNode * GetSubNode(USHORT nIndex) = 0; + const SmNode * GetSubNode(USHORT nIndex) const + { + return ((SmNode *) this)->GetSubNode(nIndex); + } + + virtual SmNode * GetLeftMost(); + const SmNode * GetLeftMost() const + { + return ((SmNode *) this)->GetLeftMost(); + } + + USHORT & Flags() { return nFlags; } + USHORT & Attributes() { return nAttributes; } + + BOOL IsDebug() const { return bIsDebug; } + BOOL IsPhantom() const { return bIsPhantom; } + void SetPhantom(BOOL bIsPhantom); + void SetColor(const Color &rColor); + + void SetAttribut(USHORT nAttrib); + void ClearAttribut(USHORT nAttrib); + + const SmFace & GetFont() const { return aFace; }; + SmFace & GetFont() { return aFace; }; + + void SetFont(const SmFace &rFace); + void SetFontSize(const Fraction &rRelSize, USHORT nType); + void SetSize(const Fraction &rScale); + + virtual void Prepare(const SmFormat &rFormat); + virtual void PrepareAttributes(); + + void ToggleDebug() const; + + void SetRectHorAlign(RectHorAlign eHorAlign); + RectHorAlign GetRectHorAlign() const { return eRectHorAlign; } + + const SmRect & GetRect() const { return *this; } + SmRect & GetRect() { return *this; } + + virtual void Move(const Point &rPosition); + void MoveTo(const Point &rPosition) { Move(rPosition - GetTopLeft()); } + virtual void Arrange(const OutputDevice &rDev, const SmFormat &rFormat); + + virtual void Draw(OutputDevice &rDev, const Point &rPosition) const; + + USHORT GetRow() const { return aNodeToken.nRow; } + USHORT GetColumn() const { return aNodeToken.nCol; } + + SmScaleMode GetScaleMode() const { return eScaleMode; } + void SetScaleMode(SmScaleMode eMode) { eScaleMode = eMode; } + + virtual void AdaptToX(const OutputDevice &rDev, ULONG nWidth) {}; + virtual void AdaptToY(const OutputDevice &rDev, ULONG nHeight) {}; + + SmNodeType GetType() const { return eType; } + const SmToken & GetToken() const { return aNodeToken; } + + const SmNode * FindTokenAt(USHORT nRow, USHORT nCol) const; + const SmNode * FindRectClosestTo(const Point &rPoint) const; +}; + + +//////////////////////////////////////////////////////////////////////////////// + +class SmStructureNode; + +DECLARE_DYNARRAY(SmStructureNodeArray, SmStructureNode *); + +class SmStructureNode : public SmNode +{ + SmNodeArray aSubNodes; + +protected: + SmStructureNode(SmNodeType eNodeType, const SmToken &rNodeToken) + : SmNode(eNodeType, rNodeToken) + {} + +public: + virtual ~SmStructureNode(); + + virtual BOOL IsVisible() const { return FALSE; } + + virtual USHORT GetNumSubNodes() const { return aSubNodes.GetSize(); } + void SetNumSubNodes(USHORT nSize) { aSubNodes.SetSize(nSize); } + + virtual SmNode * GetSubNode(USHORT nIndex) { return aSubNodes.Get(nIndex); } + void SetSubNodes(SmNode *pFirst, SmNode *pSecond, + SmNode *pThird = NULL); + void SetSubNodes(const SmNodeArray &rNodeArray); +}; + + +//////////////////////////////////////////////////////////////////////////////// + + +class SmVisibleNode : public SmNode +{ +protected: + SmVisibleNode(SmNodeType eNodeType, const SmToken &rNodeToken) + : SmNode(eNodeType, rNodeToken) + {} + +public: + + virtual BOOL IsVisible() const { return TRUE; } + virtual USHORT GetNumSubNodes() const { return 0; } + virtual SmNode * GetSubNode(USHORT nIndex) { return NULL; } +}; + + +//////////////////////////////////////////////////////////////////////////////// + + +class SmGraphicNode : public SmVisibleNode +{ +protected: + SmGraphicNode(SmNodeType eNodeType, const SmToken &rNodeToken) + : SmVisibleNode(eNodeType, rNodeToken) + {} + +public: +}; + + +//////////////////////////////////////////////////////////////////////////////// + + +class SmRectangleNode : public SmGraphicNode +{ + Size aToSize; + +public: + SmRectangleNode(const SmToken &rNodeToken) + : SmGraphicNode(NRECTANGLE, rNodeToken) + {} + + virtual void AdaptToX(const OutputDevice &rDev, ULONG nWidth); + virtual void AdaptToY(const OutputDevice &rDev, ULONG nHeight); + + virtual void Arrange(const OutputDevice &rDev, const SmFormat &rFormat); + virtual void Draw(OutputDevice &rDev, const Point &rPosition) const; +}; + + +//////////////////////////////////////////////////////////////////////////////// + + +class SmPolyLineNode : public SmGraphicNode +{ + Polygon aPoly; + Size aToSize; + long nWidth; + +public: + SmPolyLineNode(const SmToken &rNodeToken); + + long GetWidth() const { return nWidth; } + + virtual void AdaptToX(const OutputDevice &rDev, ULONG nWidth); + virtual void AdaptToY(const OutputDevice &rDev, ULONG nHeight); + + virtual void Arrange(const OutputDevice &rDev, const SmFormat &rFormat); + virtual void Draw(OutputDevice &rDev, const Point &rPosition) const; +}; + + +//////////////////////////////////////////////////////////////////////////////// + + +class SmPolygonNode : public SmGraphicNode +{ + SmPolygon aPolygon; + Size aToSize; + +protected: + SmPolygonNode(SmNodeType eNodeType, const SmToken &rNodeToken) + : SmGraphicNode(eNodeType, rNodeToken), + aPolygon(rNodeToken.cMathChar) + {} + +public: + SmPolygonNode(const SmToken &rNodeToken) + : SmGraphicNode(NPOLYGON, rNodeToken), + aPolygon(rNodeToken.cMathChar) + {} + + SmPolygon & GetPolygon() { return aPolygon; } + inline const SmPolygon & GetPolygon() const; + + virtual void AdaptToX(const OutputDevice &rDev, ULONG nWidth); + virtual void AdaptToY(const OutputDevice &rDev, ULONG nHeight); + + virtual void Arrange(const OutputDevice &rDev, const SmFormat &rFormat); + virtual void Draw(OutputDevice &rDev, const Point &rPosition) const; +}; + +inline const SmPolygon & SmPolygonNode::GetPolygon() const +{ + return ((SmPolygonNode *) this)->GetPolygon(); +} + + +//////////////////////////////////////////////////////////////////////////////// + + +class SmRootSymbolNode : public SmPolygonNode +{ + ULONG nBodyWidth; // width of body (argument) of root sign + + void DrawBar(OutputDevice &rDev, const Point &rPosition) const; + +public: + SmRootSymbolNode(const SmToken &rNodeToken) + : SmPolygonNode(NROOTSYMBOL, rNodeToken) + {} + + + virtual void AdaptToX(const OutputDevice &rDev, ULONG nWidth) { nBodyWidth = nWidth; } + virtual void AdaptToY(const OutputDevice &rDev, ULONG nHeight); + + virtual void Draw(OutputDevice &rDev, const Point &rPosition) const; +}; + + +//////////////////////////////////////////////////////////////////////////////// + + +class SmTextNode : public SmVisibleNode +{ + XubString aText; + USHORT nFontDesc; + +protected: + SmTextNode(SmNodeType eNodeType, const SmToken &rNodeToken, USHORT nFontDescP) + : SmVisibleNode(eNodeType, rNodeToken) + { + nFontDesc = nFontDescP; + } + +public: + SmTextNode(const SmToken &rNodeToken, USHORT nFontDescP) + : SmVisibleNode(NTEXT, rNodeToken) + { + nFontDesc = nFontDescP; + } + + + USHORT GetFontDesc() const { return nFontDesc; } + void SetText(const XubString &rText) { aText = rText; } + const XubString & GetText() const { return aText; } + + virtual void Prepare(const SmFormat &rFormat); + virtual void Arrange(const OutputDevice &rDev, const SmFormat &rFormat); + virtual void Draw(OutputDevice &rDev, const Point &rPosition) const; +}; + + +//////////////////////////////////////////////////////////////////////////////// + + +class SmSpecialNode : public SmTextNode +{ +protected: + SmSpecialNode(SmNodeType eNodeType, const SmToken &rNodeToken, USHORT nFontDesc) + : SmTextNode(eNodeType, rNodeToken, nFontDesc) + {} + +public: + SmSpecialNode(const SmToken &rNodeToken) + : SmTextNode(NSPECIAL, rNodeToken, FNT_MATH) //! default Font nicht immer richtig + {} + + virtual void Prepare(const SmFormat &rFormat); + virtual void Arrange(const OutputDevice &rDev, const SmFormat &rFormat); + virtual void Draw(OutputDevice &rDev, const Point &rPosition) const; +}; + + +//////////////////////////////////////////////////////////////////////////////// + + +class SmGlyphSpecialNode : public SmSpecialNode +{ +public: + SmGlyphSpecialNode(const SmToken &rNodeToken) + : SmSpecialNode(NGLYPH_SPECIAL, rNodeToken, FNT_MATH) + {} + + virtual void Arrange(const OutputDevice &rDev, const SmFormat &rFormat); +}; + + +//////////////////////////////////////////////////////////////////////////////// + + +class SmMathSymbolNode : public SmSpecialNode +{ +protected: + SmMathSymbolNode(SmNodeType eNodeType, const SmToken &rNodeToken) + : SmSpecialNode(eNodeType, rNodeToken, FNT_MATH) + {} + +public: + SmMathSymbolNode(const SmToken &rNodeToken); + + virtual void AdaptToX(const OutputDevice &rDev, ULONG nWidth); + virtual void AdaptToY(const OutputDevice &rDev, ULONG nHeight); + + virtual void Prepare(const SmFormat &rFormat); + virtual void Arrange(const OutputDevice &rDev, const SmFormat &rFormat); +}; + + +//////////////////////////////////////////////////////////////////////////////// + + +class SmPlaceNode : public SmMathSymbolNode +{ +public: + SmPlaceNode(const SmToken &rNodeToken) + : SmMathSymbolNode(NPLACE, rNodeToken) + { + SetText((xub_Unicode) MS_PLACE); + } + + virtual void Prepare(const SmFormat &rFormat); + virtual void Arrange(const OutputDevice &rDev, const SmFormat &rFormat); +}; + + +//////////////////////////////////////////////////////////////////////////////// + + +class SmErrorNode : public SmMathSymbolNode +{ +public: + SmErrorNode(SmParseError eError, const SmToken &rNodeToken) + : SmMathSymbolNode(NERROR, rNodeToken) + { + SetText((xub_Unicode) MS_ERROR); + } + + virtual void Prepare(const SmFormat &rFormat); + virtual void Arrange(const OutputDevice &rDev, const SmFormat &rFormat); +}; + + +//////////////////////////////////////////////////////////////////////////////// + + +class SmTableNode : public SmStructureNode +{ +public: + SmTableNode(const SmToken &rNodeToken) + : SmStructureNode(NTABLE, rNodeToken) + {} + + virtual SmNode * GetLeftMost() { return this; } + + virtual void Arrange(const OutputDevice &rDev, const SmFormat &rFormat); +}; + + +//////////////////////////////////////////////////////////////////////////////// + + +class SmLineNode : public SmStructureNode +{ +protected: + SmLineNode(SmNodeType eNodeType, const SmToken &rNodeToken) + : SmStructureNode(eNodeType, rNodeToken) + {} + +public: + SmLineNode(const SmToken &rNodeToken) + : SmStructureNode(NLINE, rNodeToken) + {} + + virtual void Prepare(const SmFormat &rFormat); + virtual void Arrange(const OutputDevice &rDev, const SmFormat &rFormat); +}; + + +//////////////////////////////////////////////////////////////////////////////// + + +class SmExpressionNode : public SmLineNode +{ +public: + SmExpressionNode(const SmToken &rNodeToken) + : SmLineNode(NEXPRESSION, rNodeToken) + {} + + virtual void Arrange(const OutputDevice &rDev, const SmFormat &rFormat); +}; + + +//////////////////////////////////////////////////////////////////////////////// + + +class SmUnHorNode : public SmStructureNode +{ +public: + SmUnHorNode(const SmToken &rNodeToken) + : SmStructureNode(NUNHOR, rNodeToken) + { + SetNumSubNodes(2); + } + + virtual void Arrange(const OutputDevice &rDev, const SmFormat &rFormat); +}; + + +//////////////////////////////////////////////////////////////////////////////// + + +class SmRootNode : public SmStructureNode +{ +protected: + void GetHeightVerOffset(const SmRect &rRect, + long &rHeight, long &rVerOffset) const; + Point GetExtraPos(const SmRect &rRootSymbol, const SmRect &rExtra) const; + +public: + SmRootNode(const SmToken &rNodeToken) + : SmStructureNode(NROOT, rNodeToken) + { + SetNumSubNodes(3); + } + + virtual void Arrange(const OutputDevice &rDev, const SmFormat &rFormat); +}; + + +//////////////////////////////////////////////////////////////////////////////// + + +class SmBinHorNode : public SmStructureNode +{ +public: + SmBinHorNode(const SmToken &rNodeToken) + : SmStructureNode(NBINHOR, rNodeToken) + { + SetNumSubNodes(3); + } + + + + virtual void Arrange(const OutputDevice &rDev, const SmFormat &rFormat); +}; + + +//////////////////////////////////////////////////////////////////////////////// + + +class SmBinVerNode : public SmStructureNode +{ +public: + SmBinVerNode(const SmToken &rNodeToken) + : SmStructureNode(NBINVER, rNodeToken) + { + SetNumSubNodes(3); + } + + virtual SmNode * GetLeftMost() { return this; } + + virtual void Arrange(const OutputDevice &rDev, const SmFormat &rFormat); +}; + + +//////////////////////////////////////////////////////////////////////////////// + + +class SmBinDiagonalNode : public SmStructureNode +{ + BOOL bAscending; + + void GetOperPosSize(Point &rPos, Size &rSize, + const Point &rDiagPoint, double fAngleDeg) const; + +public: + SmBinDiagonalNode(const SmToken &rNodeToken); + + BOOL IsAscending() const { return bAscending; } + void SetAscending(BOOL bVal) { bAscending = bVal; } + + virtual void Arrange(const OutputDevice &rDev, const SmFormat &rFormat); +}; + + +//////////////////////////////////////////////////////////////////////////////// + + +// enums used to index sub-/supscripts in the 'aSubNodes' array +// in 'SmSubSupNode' +// See graphic for positions at char: +// +// CSUP +// +// LSUP H H RSUP +// H H +// HHHH +// H H +// LSUB H H RSUB +// +// CSUB +// +enum SmSubSup +{ CSUB, CSUP, RSUB, RSUP, LSUB, LSUP +}; + +// numbers of entries in the above enum (that is: the number of possible +// sub-/supscripts) +#define SUBSUP_NUM_ENTRIES 6 + + +class SmSubSupNode : public SmStructureNode +{ + BOOL bUseLimits; + +public: + SmSubSupNode(const SmToken &rNodeToken) + : SmStructureNode(NSUBSUP, rNodeToken) + { + SetNumSubNodes(1 + SUBSUP_NUM_ENTRIES); + bUseLimits = FALSE; + } + + SmNode * GetBody() { return GetSubNode(0); } + const SmNode * GetBody() const + { + return ((SmSubSupNode *) this)->GetBody(); + } + + void SetUseLimits(BOOL bVal) { bUseLimits = bVal; } + BOOL IsUseLimits() const { return bUseLimits; }; + + SmNode * GetSubSup(SmSubSup eSubSup) { return GetSubNode(1 + eSubSup); }; + + virtual void Arrange(const OutputDevice &rDev, const SmFormat &rFormat); +}; + + +//////////////////////////////////////////////////////////////////////////////// + + +class SmBraceNode : public SmStructureNode +{ +public: + SmBraceNode(const SmToken &rNodeToken) + : SmStructureNode(NBRACE, rNodeToken) + { + SetNumSubNodes(3); + } + + virtual void Arrange(const OutputDevice &rDev, const SmFormat &rFormat); +}; + + +//////////////////////////////////////////////////////////////////////////////// + + +class SmBracebodyNode : public SmStructureNode +{ + long nBodyHeight; + +public: + inline SmBracebodyNode(const SmToken &rNodeToken); + + virtual void Arrange(const OutputDevice &rDev, const SmFormat &rFormat); + long GetBodyHeight() const { return nBodyHeight; } +}; + + +inline SmBracebodyNode::SmBracebodyNode(const SmToken &rNodeToken) +: SmStructureNode(NBRACEBODY, rNodeToken) +{ + nBodyHeight = 0; +} + + +//////////////////////////////////////////////////////////////////////////////// + + +class SmVerticalBraceNode : public SmStructureNode +{ +public: + inline SmVerticalBraceNode(const SmToken &rNodeToken); + + virtual void Arrange(const OutputDevice &rDev, const SmFormat &rFormat); +}; + + +SmVerticalBraceNode::SmVerticalBraceNode(const SmToken &rNodeToken) +: SmStructureNode(NVERTICAL_BRACE, rNodeToken) +{ + SetNumSubNodes(3); +} + + +//////////////////////////////////////////////////////////////////////////////// + + +class SmOperNode : public SmStructureNode +{ +public: + SmOperNode(const SmToken &rNodeToken) + : SmStructureNode(NOPER, rNodeToken) + { + SetNumSubNodes(2); + } + + SmNode * GetSymbol(); + const SmNode * GetSymbol() const + { + return ((SmOperNode *) this)->GetSymbol(); + } + + long CalcSymbolHeight(const SmNode &rSymbol, const SmFormat &rFormat) const; + + virtual void Arrange(const OutputDevice &rDev, const SmFormat &rFormat); +}; + + +//////////////////////////////////////////////////////////////////////////////// + + +class SmAlignNode : public SmStructureNode +{ +public: + SmAlignNode(const SmToken &rNodeToken) + : SmStructureNode(NALIGN, rNodeToken) + {} + + virtual void Arrange(const OutputDevice &rDev, const SmFormat &rFormat); +}; + + +//////////////////////////////////////////////////////////////////////////////// + + +class SmAttributNode : public SmStructureNode +{ +public: + SmAttributNode(const SmToken &rNodeToken) + : SmStructureNode(NATTRIBUT, rNodeToken) + {} + + virtual void Arrange(const OutputDevice &rDev, const SmFormat &rFormat); +}; + + +//////////////////////////////////////////////////////////////////////////////// + + +class SmFontNode : public SmStructureNode +{ + USHORT nSizeType; + Fraction aFontSize; + +public: + SmFontNode(const SmToken &rNodeToken) + : SmStructureNode(NFONT, rNodeToken) + { + nSizeType = FNTSIZ_MULTIPLY; + aFontSize = Fraction(1L); + } + + void SetSizeParameter(const Fraction &rValue, USHORT nType); + + virtual void Prepare(const SmFormat &rFormat); + virtual void Arrange(const OutputDevice &rDev, const SmFormat &rFormat); +}; + + +//////////////////////////////////////////////////////////////////////////////// + + +class SmMatrixNode : public SmStructureNode +{ + USHORT nNumRows, + nNumCols; + +public: + SmMatrixNode(const SmToken &rNodeToken) + : SmStructureNode(NMATRIX, rNodeToken) + { + nNumRows = nNumCols = 0; + } + + USHORT GetNumRows() {return nNumRows;} + USHORT GetNumCols() {return nNumCols;} + void SetRowCol(USHORT nMatrixRows, USHORT nMatrixCols); + + virtual SmNode * GetLeftMost() { return this; } + + virtual void Arrange(const OutputDevice &rDev, const SmFormat &rFormat); +}; + + +//////////////////////////////////////////////////////////////////////////////// + + +class SmBlankNode : public SmGraphicNode +{ + USHORT nNum; + +public: + SmBlankNode(const SmToken &rNodeToken) + : SmGraphicNode(NBLANK, rNodeToken) + { + nNum = 0; + } + + void IncreaseBy(const SmToken &rToken); + void Clear() { nNum = 0; } + + virtual void Prepare(const SmFormat &rFormat); + virtual void Arrange(const OutputDevice &rDev, const SmFormat &rFormat); +}; + + +//////////////////////////////////////////////////////////////////////////////// + +#endif + + diff --git a/starmath/inc/parse.hxx b/starmath/inc/parse.hxx new file mode 100644 index 000000000000..265fc66699bf --- /dev/null +++ b/starmath/inc/parse.hxx @@ -0,0 +1,301 @@ +/************************************************************************* + * + * $RCSfile: parse.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: hr $ $Date: 2000-09-18 16:57:24 $ + * + * 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): _______________________________________ + * + * + ************************************************************************/ +#ifndef PARSE_HXX +#define PARSE_HXX + + +#include <ctype.h> + +#ifndef _STACK_HXX //autogen +#include <tools/stack.hxx> +#endif +#ifndef _LIST_HXX //autogen +#include <tools/list.hxx> +#endif +#ifndef _STRING_HXX //autogen +#include <tools/string.hxx> +#endif + +#include "types.hxx" + +class SmNode; + + +// TokenGroups +#define TGOPER 0x00000001 +#define TGRELATION 0x00000002 +#define TGSUM 0x00000004 +#define TGPRODUCT 0x00000008 +#define TGUNOPER 0x00000010 +#define TGPOWER 0x00000020 +#define TGATTRIBUT 0x00000040 +#define TGALIGN 0x00000080 +#define TGFUNCTION 0x00000100 +#define TGBLANK 0x00000200 +#define TGLBRACES 0x00000400 +#define TGRBRACES 0x00000800 +#define TGCOLOR 0x00001000 +#define TGFONT 0x00002000 +#define TGSTANDALONE 0x00004000 +#define TGDISCARDED 0x00008000 +#define TGLIMIT 0x00010000 +#define TGFONTATTR 0x00020000 + + +enum SmTokenType +{ + TEND, TLGROUP, TRGROUP, TLPARENT, TRPARENT, + TLBRACKET, TRBRACKET, TPLUS, TMINUS, TMULTIPLY, + TDIVIDEBY, TASSIGN, TPOUND, TSPECIAL, TSLASH, + TBACKSLASH, TBLANK, TSBLANK, TRSUB, TRSUP, + TCSUB, TCSUP, TLSUB, TLSUP, TGT, + TLT, TAND, TOR, TINTERSECT, TUNION, + TNEWLINE, TBINOM, TFROM, TTO, TINT, + TSUM, TOPER, TABS, TSQRT, TFACT, + TNROOT, TOVER, TTIMES, TGE, TLE, + TGG, TLL, TDOTSAXIS, TDOTSLOW, TDOTSVERT, + TDOTSDIAG, TDOTSUP, TDOTSDOWN, TACUTE, TBAR, + TBREVE, TCHECK, TCIRCLE, TDOT, TDDOT, + TDDDOT, TGRAVE, THAT, TTILDE, TVEC, + TUNDERLINE, TOVERLINE, TOVERSTRIKE, TITALIC, TNITALIC, + TBOLD, TNBOLD, TPHANTOM, TFONT, TSIZE, + TCOLOR, TALIGNL, TALIGNC, TALIGNR, TLEFT, + TRIGHT, TLANGLE, TLBRACE, TLLINE, TLDLINE, + TLCEIL, TLFLOOR, TNONE, TMLINE, TRANGLE, + TRBRACE, TRLINE, TRDLINE, TRCEIL, TRFLOOR, + TSIN, TCOS, TTAN, TCOT, TFUNC, + TSTACK, TMATRIX, TMATFORM, TDPOUND, TPLACE, + TTEXT, TNUMBER, TCHARACTER, TIDENT, TNEQ, + TEQUIV, TDEF, TPROP, TSIM, TSIMEQ, + TAPPROX, TPARALLEL, TORTHO, TIN, TNOTIN, + TSUBSET, TSUBSETEQ, TSUPSET, TSUPSETEQ, TPLUSMINUS, + TMINUSPLUS, TOPLUS, TOMINUS, TDIV, TOTIMES, + TODIVIDE, TTRANSL, TTRANSR, TIINT, TIIINT, + TLINT, TLLINT, TLLLINT, TPROD, TCOPROD, + TFORALL, TEXISTS, TLIM, TNABLA, TTOWARD, + TSINH, TCOSH, TTANH, TCOTH, TASIN, + TACOS, TATAN, TLN, TLOG, TUOPER, + TBOPER, TBLACK, TWHITE, TRED, TGREEN, + TBLUE, TCYAN, TMAGENTA, TYELLOW, TFIXED, + TSANS, TSERIF, TPOINT, TASINH, TACOSH, + TATANH, TACOTH, TACOT, TEXP, TCDOT, + TODOT, TLESLANT, TGESLANT, TNSUBSET, TNSUPSET, + TNSUBSETEQ, TNSUPSETEQ, TPARTIAL, TNEG, TNI, + TBACKEPSILON, TALEPH, TIM, TRE, TWP, + TEMPTYSET, TINFINITY, TESCAPE, TLIMSUP, TLIMINF, + TNDIVIDES, TDRARROW, TDLARROW, TDLRARROW, TUNDERBRACE, + TOVERBRACE, TCIRC, TTOP, THBAR, TLAMBDABAR, + TLEFTARROW, TRIGHTARROW, TUPARROW, TDOWNARROW, TDIVIDES, + TNDIBVIDES, TSETN, TSETZ, TSETQ, TSETR, + TSETC, TWIDEVEC, TWIDETILDE, TWIDEHAT, TWIDESLASH, + TWIDEBACKSLASH, TLDBRACKET, TRDBRACKET, + TUNKNOWN, TDEBUG +}; + + +struct SmToken +{ + // token text + XubString aText; + // token info + SmTokenType eType; + xub_Unicode cMathChar; + // parse-help info + ULONG nGroup; + USHORT nLevel; + // token position + USHORT nRow; + USHORT nCol; + + SmToken(); +}; + + +enum SmParseError +{ + PE_NONE, PE_UNEXPECTED_END_OF_INPUT, + PE_UNEXPECTED_CHAR, PE_UNEXPECTED_TOKEN, + PE_FUNC_EXPECTED, PE_UNOPER_EXPECTED, + PE_BINOPER_EXPECTED, PE_SYMBOL_EXPECTED, + PE_IDENTIFIER_EXPECTED, PE_POUND_EXPECTED, + PE_COLOR_EXPECTED, PE_LGROUP_EXPECTED, + PE_RGROUP_EXPECTED, PE_LBRACE_EXPECTED, + PE_RBRACE_EXPECTED, PE_PARENT_MISMATCH, + PE_RIGHT_EXPECTED, PE_FONT_EXPECTED, + PE_SIZE_EXPECTED, PE_DOUBLE_ALIGN, + PE_DOUBLE_SUBSUPSCRIPT +}; + + +struct SmErrorDesc +{ + SmParseError Type; + SmNode *pNode; + XubString Text; +}; + +DECLARE_STACK(SmNodeStack, SmNode *); +DECLARE_LIST(SmErrDescList, SmErrorDesc *); + +/**************************************************************************/ + +class SmParser +{ + XubString BufferString; + SmToken CurToken; + SmNodeStack NodeStack; + SmErrDescList ErrDescList; + int CurError; + xub_StrLen BufferIndex, + nTokenIndex; + USHORT Row, + Column; + xub_Unicode CharLineEnd; + BOOL bConvert40To50; + + // declare copy-constructor and assignment-operator private + SmParser(const SmParser &); + SmParser & operator = (const SmParser &); + +protected: + BOOL IsDelimiter(xub_Unicode cChar); + void NextToken(); + xub_StrLen GetTokenIndex() const { return nTokenIndex; } + void Insert(const XubString &rText, USHORT nPos); + + inline BOOL TokenInGroup(ULONG nGroup); + inline BOOL IsWhiteSpace(const xub_Unicode cChar) const; + inline BOOL IsComment(const xub_Unicode *pPos) const; + + const xub_Unicode * SkipWhiteSpaces(const xub_Unicode *pPos, USHORT &nRow, USHORT &nColumn); + const xub_Unicode * SkipComment(const xub_Unicode *pPos, USHORT &nRow, USHORT &nColumn); + + // grammar + void Table(); + void Line(); + void Expression(); + void Relation(); + void Sum(); + void Product(); + void SubSup(ULONG nActiveGroup); + void OpSubSup(); + void Power(); + void Blank(); + void Term(); + void Escape(); + void Operator(); + void Oper(); + void UnOper(); + void Align(); + void FontAttribut(); + void Attribut(); + void Font(); + void FontSize(); + void Color(); + void Brace(); + void Bracebody(BOOL bIsLeftRight); + void Function(); + void Binom(); + void Stack(); + void Matrix(); + void Special(); + void GlyphSpecial(); + // end of grammar + + void Error(SmParseError Error); + +public: + SmParser(); + + BOOL CheckSyntax(const XubString &rBuffer); + SmNode *Parse(const XubString &rBuffer); + + const XubString & GetText() const { return BufferString; }; + + BOOL IsConvert40To50() const { return bConvert40To50; } + void SetConvert40To50(BOOL bConvert) { bConvert40To50 = bConvert; } + + USHORT AddError(SmParseError Type, SmNode *pNode); + + const SmErrorDesc * NextError(); + const SmErrorDesc * PrevError(); + const SmErrorDesc * GetError(USHORT i = 0xFFFF); +}; + + +inline BOOL SmParser::TokenInGroup(ULONG nGroup) +{ + return (CurToken.nGroup & nGroup) ? TRUE : FALSE; +} + +inline BOOL SmParser::IsWhiteSpace(const xub_Unicode cChar) const +{ + return isspace(cChar) != 0; +} + +inline BOOL SmParser::IsComment(const xub_Unicode *pPos) const +{ + return *pPos == '%' && *(pPos + 1) == '%'; +} + + +#endif + diff --git a/starmath/inc/rect.hxx b/starmath/inc/rect.hxx new file mode 100644 index 000000000000..6e8b9d6b6203 --- /dev/null +++ b/starmath/inc/rect.hxx @@ -0,0 +1,304 @@ +/************************************************************************* + * + * $RCSfile: rect.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: hr $ $Date: 2000-09-18 16:57:24 $ + * + * 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): _______________________________________ + * + * + ************************************************************************/ + +#ifndef RECT_HXX +#define RECT_HXX + +#include <new.h> + + +#ifndef _GEN_HXX //autogen +#include <tools/gen.hxx> +#endif + +#ifndef _SV_OUTDEV_HXX //autogen +#include <vcl/outdev.hxx> +#endif + +#ifndef _SV_METRIC_HXX //autogen +#include <vcl/metric.hxx> +#endif + +#ifndef _TOOLS_DEBUG_HXX //autogen +#include <tools/debug.hxx> +#endif + +#include "format.hxx" + + +class SmPolygon; + +BOOL SmGetGlyphBoundRect(const OutputDevice &rDev, + const XubString &rText, Rectangle &rRect); + +BOOL SmIsMathAlpha(const XubString &rText); + + +inline long SmFromTo(long nFrom, long nTo, double fRelDist) +{ + return nFrom + (long) (fRelDist * (nTo - nFrom)); +} + + +//////////////////////////////////////// +// SmRect +// ... (to be done) +// This Implementation assumes that the x-axis points to the right and the +// y-axis to the bottom. +// Note: however, italic spaces can be negative! +// + +// possible flags for the 'Draw' function below (just for debugging) +#define SM_RECT_CORE 0x0001 +#define SM_RECT_ITALIC 0x0002 +#define SM_RECT_LINES 0x0004 +#define SM_RECT_MID 0x0008 + +// possible positions and alignments for the 'AlignTo' function +enum RectPos + // (RP_LEFT : align the current object to the left of the argument, ...) +{ RP_LEFT, RP_RIGHT, + RP_TOP, RP_BOTTOM, + RP_ATTRIBUT +}; +enum RectHorAlign +{ RHA_LEFT, RHA_CENTER, RHA_RIGHT +}; +enum RectVerAlign +{ RVA_TOP, RVA_MID, RVA_BOTTOM, RVA_BASELINE, RVA_CENTERY, + RVA_ATTRIBUT_HI, RVA_ATTRIBUT_MID, RVA_ATTRIBUT_LO +}; + +// different methods of copying baselines and mid's in 'ExtendBy' function +enum RectCopyMBL +{ RCP_THIS, // keep baseline of current object even if it has none + RCP_ARG, // as above but for the argument + RCP_NONE, // result will have no baseline + RCP_XOR // if current object has a baseline keep it else copy + // the arguments baseline (even if it has none) +}; + + +class SmRect +{ + Point aTopLeft; + Size aSize; + long nBaseline, + nAlignT, + nAlignM, + nAlignB, + nGlyphTop, + nGlyphBottom, + nItalicLeftSpace, + nItalicRightSpace, + nLoAttrFence, + nHiAttrFence; + BOOL bHasBaseline, + bHasAlignInfo; + +protected: + void BuildRect (const OutputDevice &rDev, const SmFormat *pFormat, + const XubString &rText, long nBorderWidth); + void Init(const OutputDevice &rDev, const SmFormat *pFormat, + const XubString &rText, long nBorderWidth); + + void ClearBaseline() { bHasBaseline = FALSE; }; + inline void CopyMBL(const SmRect& rRect); + void CopyAlignInfo(const SmRect& rRect); + + SmRect & Union(const SmRect &rRect); + +public: + SmRect(); + SmRect(const OutputDevice &rDev, const SmFormat *pFormat, + const XubString &rText, long nBorderWidth); + SmRect(const OutputDevice &rDev, const SmFormat *pFormat, + const SmPolygon &rPoly, long nBorderWidth); + SmRect(long nWidth, long nHeight); + SmRect(const SmRect &rRect); + + inline void SetItalicSpaces(long nLeftSpace, long nRightSpace); + + void SetWidth(ULONG nWidth) { aSize.Width() = nWidth; } + void SetHeight(ULONG nHeight) { aSize.Height() = nHeight; } + + void SetLeft(long nLeft); + void SetRight(long nRight); + void SetBottom(long nBottom); + void SetTop(long nTop); + + const Point & GetTopLeft() const { return aTopLeft; } + + long GetTop() const { return GetTopLeft().Y(); } + long GetLeft() const { return GetTopLeft().X(); } + long GetBottom() const { return GetTop() + GetHeight() - 1; } + long GetRight() const { return GetLeft() + GetWidth() - 1; } + long GetCenterX() const { return (GetLeft() + GetRight()) / 2L; } + long GetCenterY() const { return (GetTop() + GetBottom()) / 2L; } + long GetWidth() const { return GetSize().Width(); } + long GetHeight() const { return GetSize().Height(); } + + long GetItalicLeftSpace() const { return nItalicLeftSpace; } + long GetItalicRightSpace() const { return nItalicRightSpace; } + + void SetHiAttrFence(long nVal) { nHiAttrFence = nVal; } + void SetLoAttrFence(long nVal) { nLoAttrFence = nVal; } + long GetHiAttrFence() const { return nHiAttrFence; } + long GetLoAttrFence() const { return nLoAttrFence; } + + long GetItalicLeft() const { return GetLeft() - GetItalicLeftSpace(); } + long GetItalicCenterX() const { return (GetItalicLeft() + GetItalicRight()) / 2; } + long GetItalicRight() const { return GetRight() + GetItalicRightSpace(); } + long GetItalicWidth() const { return GetWidth() + GetItalicLeftSpace() + GetItalicRightSpace(); } + + BOOL HasBaseline() const { return bHasBaseline; } + inline long GetBaseline() const; + long GetBaselineOffset() const { return GetBaseline() - GetTop(); } + + void SetAlignTop(long nVal) { nAlignT = nVal; } + + long GetAlignT() const { return nAlignT; } + long GetAlignM() const { return nAlignM; } + long GetAlignB() const { return nAlignB; } + + void SetAlignT(long nVal) { nAlignT = nVal; } + + const Point GetCenter() const + { return Point(GetCenterX(), GetCenterY()); } + + const Size & GetSize() const { return aSize; } + + const Size GetItalicSize() const + { return Size(GetItalicWidth(), GetHeight()); } + + void Move (const Point &rPosition); + void MoveTo(const Point &rPosition) { Move(rPosition - GetTopLeft()); } + + BOOL IsEmpty() const + { + return GetWidth() == 0 || GetHeight() == 0; + } + + BOOL HasAlignInfo() const { return bHasAlignInfo; } + + const Point AlignTo(const SmRect &rRect, RectPos ePos, + RectHorAlign eHor, RectVerAlign eVer) const; + + SmRect & ExtendBy(const SmRect &rRect, RectCopyMBL eCopyMode); + SmRect & ExtendBy(const SmRect &rRect, RectCopyMBL eCopyMode, + long nNewAlignM); + SmRect & ExtendBy(const SmRect &rRect, RectCopyMBL eCopyMode, + BOOL bKeepVerAlignParams); + SmRect & ExtendBy(const Point &rPoint); + + long OrientedDist(const Point &rPoint) const; + BOOL IsInsideRect(const Point &rPoint) const; + BOOL IsInsideItalicRect(const Point &rPoint) const; + + inline SmRect & operator = (const SmRect &rRect); + + inline Rectangle AsRectangle() const; + SmRect AsGlyphRect() const; + + void Draw(OutputDevice &rDev, const Point &rPosition, int nFlags) const; +}; + + +inline void SmRect::SetItalicSpaces(long nLeftSpace, long nRightSpace) + // set extra spacing to the left and right for (italic) + // letters/text +{ + nItalicLeftSpace = nLeftSpace; + nItalicRightSpace = nRightSpace; +} + + +inline void SmRect::CopyMBL(const SmRect &rRect) + // copy AlignM baseline and value of 'rRect' +{ + nBaseline = rRect.nBaseline; + bHasBaseline = rRect.bHasBaseline; + nAlignM = rRect.nAlignM; +} + + +inline long SmRect::GetBaseline() const +{ + DBG_ASSERT(HasBaseline(), "Sm: Baseline nicht vorhanden"); + return nBaseline; +} + + +inline SmRect & SmRect::operator = (const SmRect &rRect) +{ + new (this) SmRect(rRect); // placement new + return *this; +} + + +inline Rectangle SmRect::AsRectangle() const +{ + return Rectangle(Point(GetItalicLeft(), GetTop()), GetItalicSize()); +} + + + +#endif diff --git a/starmath/inc/smdll.hxx b/starmath/inc/smdll.hxx new file mode 100644 index 000000000000..8d68db066e16 --- /dev/null +++ b/starmath/inc/smdll.hxx @@ -0,0 +1,108 @@ +/************************************************************************* + * + * $RCSfile: smdll.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: hr $ $Date: 2000-09-18 16:57:24 $ + * + * 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): _______________________________________ + * + * + ************************************************************************/ +#ifndef SMDLL_HXX +#define SMDLL_HXX + +#define SMDLL 1 + +#ifndef _SMDLL0_HXX +#include <smdll0.hxx> +#endif +#ifndef _TOOLS_RESID_HXX //autogen +#include <tools/resid.hxx> +#endif +#ifndef _SFXDEFS_HXX +#include <sfx2/sfxdefs.hxx> +#endif + +class SmData; +class SfxMedium; +class SfxFilter; + +class SmDLL +{ + static BOOL bInitialized; +public: + SmDLL(); + ~SmDLL(); + + static void Init(); + static void LibInit(); + static void Exit(); + static void LibExit(); + + static ULONG DetectFilter( SfxMedium& rMedium, const SfxFilter **ppFilter, + SfxFilterFlags nMust, SfxFilterFlags nDont ); +}; + +#ifdef SMDLL +class SmResId : public ResId +{ +public: + SmResId(USHORT nId) : + ResId(nId, SM_MOD()->GetResMgr()) + { + } +}; +#endif + +#endif + diff --git a/starmath/inc/smmod.hxx b/starmath/inc/smmod.hxx new file mode 100644 index 000000000000..a99ca19e654c --- /dev/null +++ b/starmath/inc/smmod.hxx @@ -0,0 +1,128 @@ +/************************************************************************* + * + * $RCSfile: smmod.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: hr $ $Date: 2000-09-18 16:57:24 $ + * + * 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): _______________________________________ + * + * + ************************************************************************/ + +#ifndef _SMMOD_HXX +#define _SMMOD_HXX + + +#ifndef _SMDLL_HXX +#define _SM_DLL // fuer SD_MOD() +#include "smdll.hxx" // fuer SdModuleDummy +#endif + +class SvxErrorHandler; +class SvFactory; + +class SmConfig; +class SmSymSetManager; +class SmModule; + +/************************************************************************* +|* +|* This subclass of <SfxModule> (which is a subclass of <SfxShell>) is +|* linked to the DLL. One instance of this class exists while the DLL is +|* loaded. +|* +|* SdModule is like to be compared with the <SfxApplication>-subclass. +|* +|* Remember: Don`t export this class! It uses DLL-internal symbols. +|* +\************************************************************************/ + +class SmRectCache; + +class SmModule : public SmModuleDummy +{ + SmConfig *pConfig; + SmSymSetManager *pSymSetManager; + SmRectCache *pRectCache; + + virtual void FillStatusBar(StatusBar &rBar); + +public: + TYPEINFO(); + SFX_DECL_INTERFACE(SFX_INTERFACE_SMA_START + 0); + + SmModule(SvFactory* pObjFact); + virtual ~SmModule(); + + virtual SfxModule * Load(); + virtual void Free(); + + SmConfig * GetConfig() { return pConfig; } + SmSymSetManager * GetSymSetManager() { return pSymSetManager; } + SmRectCache * GetRectCache() { return pRectCache; } + + void GetState(SfxItemSet&); + void InitManager(); + + //virtuelle Methoden fuer den Optionendialog + virtual SfxItemSet* CreateItemSet( USHORT nId ); + virtual void ApplyItemSet( USHORT nId, const SfxItemSet& rSet ); + virtual SfxTabPage* CreateTabPage( USHORT nId, Window* pParent, const SfxItemSet& rSet ); +}; + + +#define SM_MOD1() ( *(SmModule**) GetAppData(SHL_SM) ) + + +#endif // _SDMOD_HXX + diff --git a/starmath/inc/starmath.hrc b/starmath/inc/starmath.hrc new file mode 100644 index 000000000000..7ef5fd663018 --- /dev/null +++ b/starmath/inc/starmath.hrc @@ -0,0 +1,758 @@ +/************************************************************************* + * + * $RCSfile: starmath.hrc,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: hr $ $Date: 2000-09-18 16:57:25 $ + * + * 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): _______________________________________ + * + * + ************************************************************************/ +#ifndef _STARMATH_HRC +#define _STARMATH_HRC + +#ifndef _SVX_SVXIDS_HRC +#include <svtools/solar.hrc> +#endif +#ifndef _SFXSIDS_HRC //autogen +#include <sfx2/sfxsids.hrc> +#endif + + +#define SID_NEXTERR (SID_SMA_START + 1) +#define SID_PREVERR (SID_SMA_START + 2) +#define SID_NEXTMARK (SID_SMA_START + 3) +#define SID_PREVMARK (SID_SMA_START + 4) +#define SID_SYMBOLS_CATALOGUE (SID_SMA_START + 5) +#define SID_PREFERENCES (SID_SMA_START + 6) +#define SID_VIEW050 (SID_SMA_START + 7) +#define SID_VIEW100 (SID_SMA_START + 8) +#define SID_VIEW200 (SID_SMA_START + 9) +#define SID_ZOOMIN (SID_SMA_START + 10) +#define SID_ZOOMOUT (SID_SMA_START + 11) +#define SID_DRAW (SID_SMA_START + 12) +#define SID_ADJUST (SID_SMA_START + 13) +#define SID_TOOLBOX (SID_SMA_START + 14) +#define SID_FORMULACURSOR (SID_SMA_START + 15) +#define SID_FONT (SID_SMA_START + 50) +#define SID_FONTSIZE (SID_SMA_START + 51) +#define SID_DISTANCE (SID_SMA_START + 52) +#define SID_ALIGN (SID_SMA_START + 53) +#define SID_SYMBOLS_LOAD (SID_SMA_START + 54) +#define SID_AUTO_REDRAW (SID_SMA_START + 55) +#define SID_SYMBOLS (SID_SMA_START + 56) // Muss erstmal wieder aufgenommen werden ! +#define SID_TEXTMODE (SID_SMA_START + 57) +#define SID_INSERT_FORMULA (SID_SMA_START + 58) +#define SID_TEXT (SID_SMA_START + 100) +#define SID_GRAPHIC (SID_SMA_START + 101) +#define SID_FITINWINDOW (SID_SMA_START + 103) +#define SID_INSERTTEXT (SID_SMA_START + 104) +#define SID_INSERTCOMMAND (SID_SMA_START + 105) + +#define SID_LOADSYMBOLS (SID_SMA_START + 107) +#define SID_SAVESYMBOLS (SID_SMA_START + 108) +#define SID_ZOOMSTATUS (SID_SMA_START + 109) +#define SID_MODIFYSTATUS (SID_SMA_START + 110) +#define SID_TEXTSTATUS (SID_SMA_START + 111) + +#define SID_PRINTTITLE (SID_SMA_START + 112) +#define SID_PRINTTEXT (SID_SMA_START + 113) +#define SID_PRINTFRAME (SID_SMA_START + 114) +#define SID_PRINTSIZE (SID_SMA_START + 115) +#define SID_PRINTZOOM (SID_SMA_START + 116) + +#define SID_COPYOBJECT (SID_SMA_START + 117) +#define SID_PASTEOBJECT (SID_SMA_START + 118) +#define SID_AUTOREDRAW (SID_SMA_START + 119) +#define SID_SYMBOLFILE (SID_SMA_START + 120) +#define SID_GETEDITTEXT (SID_SMA_START + 121) +#define SID_CMDBOXWINDOW (SID_SMA_START + 122) +#define SID_TOOLBOXWINDOW (SID_SMA_START + 123) +#define SID_NO_RIGHT_SPACES (SID_SMA_START + 124) +#define SID_DUMMY (SID_SMA_START + 254) + +//#define GID_FORMEL (RID_GROUPS_OFFSET + 1) +//#define GID_ERROR (RID_GROUPS_OFFSET + 2) + +//#define RID_OPTIONSDIALOG (RID_APP_START + 1) +#define RID_FONTDIALOG (RID_APP_START + 2) +#define RID_FONTSIZEDIALOG (RID_APP_START + 3) +#define RID_FONTTYPEDIALOG (RID_APP_START + 4) +#define RID_DISTANCEDIALOG (RID_APP_START + 5) +#define RID_ALIGNDIALOG (RID_APP_START + 6) +#define RID_PRINTOPTIONPAGE (RID_APP_START + 7) +#define RID_SYMBOLDIALOG (RID_APP_START + 8) +#define RID_SYMDEFINEDIALOG (RID_APP_START + 9) +#define RID_EXTRAOPTIONPAGE (RID_APP_START + 10) +#define RID_MATH_TOOLBOX (RID_APP_START + 50) +// wegen #58705# entfernt +//#define RID_DRAW_OBJECTBAR (RID_APP_START + 51) + +#define RID_DEFAULTSAVEQUERY (RID_APP_START + 102) +#define RID_WRITESYMBOLERROR (RID_APP_START + 202) +#define RID_READSYMBOLERROR (RID_APP_START + 203) +#define RID_NOMATHTYPEFACEWARNING (RID_APP_START + 204) +#define RID_OBJECTNAME (RID_APP_START + 501) +#define RID_VIEWNAME (RID_APP_START + 502) +#define RID_UNDOEDITNAME (RID_APP_START + 503) +#define RID_UNDOFORMATNAME (RID_APP_START + 504) +#define RID_APPICO (RID_APP_START + 601) +#define RID_TMPICO (RID_APP_START + 603) +#define RID_COMMANDMENU (RID_APP_START + 701) +#define RID_VIEWMENU (RID_APP_START + 702) +#define RID_DISTANCEMENU (RID_APP_START + 703) +#define RID_FONTMENU (RID_APP_START + 704) +#define RID_STARTUPWINDOW (RID_APP_START + 800) +#define RID_TOOLBOXWINDOW (RID_APP_START + 801) +#define RID_CMDBOXWINDOW (RID_APP_START + 802) +#define RID_FONTREGULAR (RID_APP_START + 804) +#define RID_FONTITALIC (RID_APP_START + 805) +#define RID_FONTBOLD (RID_APP_START + 806) +//#define RID_PRINTOPTION (RID_APP_START + 807) +#define RID_DOCUMENTSTR (RID_APP_START + 808) +#define RID_SYMBOLFILESSTR (RID_APP_START + 809) +#define RID_ALLFILESSTR (RID_APP_START + 810) +#define RID_CREATORSTR (RID_APP_START + 811) +#define RID_FILESMFTYP (RID_APP_START + 812) +#define RID_FILESYMTYP (RID_APP_START + 813) +#define RID_SMMENU (RID_APP_START + 814) +#define RID_SMACCEL (RID_APP_START + 815) +#define RID_STATUSBAR (RID_APP_START + 816) +#define RID_APPNAMESTR (RID_APP_START + 817) +#define STR_MATH_DOCUMENT_FULLTYPE_40 (RID_APP_START + 818) +#define STR_MATH_DOCUMENT_FULLTYPE_31 (RID_APP_START + 819) +#define STR_MATH_DOCUMENT_FULLTYPE_50 (RID_APP_START + 820) + +#define RID_ERR_IDENT (RID_APP_START + 920) +#define RID_ERR_UNKOWN (RID_APP_START + 921) +#define RID_ERR_UNEXPECTEDCHARACTER (RID_APP_START + 922) +#define RID_ERR_LGROUPEXPECTED (RID_APP_START + 923) +#define RID_ERR_RGROUPEXPECTED (RID_APP_START + 924) +#define RID_ERR_LBRACEEXPECTED (RID_APP_START + 925) +#define RID_ERR_RBRACEEXPECTED (RID_APP_START + 926) +#define RID_ERR_FUNCEXPECTED (RID_APP_START + 927) +#define RID_ERR_UNOPEREXPECTED (RID_APP_START + 928) +#define RID_ERR_BINOPEREXPECTED (RID_APP_START + 929) +#define RID_ERR_SYMBOLEXPECTED (RID_APP_START + 930) +#define RID_ERR_IDENTEXPECTED (RID_APP_START + 931) +#define RID_ERR_POUNDEXPECTED (RID_APP_START + 932) +#define RID_ERR_COLOREXPECTED (RID_APP_START + 933) +#define RID_ERR_LPARENTEXPECTED (RID_APP_START + 934) +#define RID_ERR_RPARENTEXPECTED (RID_APP_START + 935) +#define RID_ERR_RIGHTEXPECTED (RID_APP_START + 936) +#define RID_ERR_OVERFLOW (RID_APP_START + 937) + +#define RID_UNBINOPS_CAT (RID_APP_START + 1101) +#define RID_RELATIONS_CAT (RID_APP_START + 1102) +#define RID_SETOPERATIONS_CAT (RID_APP_START + 1103) +#define RID_FUNCTIONS_CAT (RID_APP_START + 1104) +#define RID_OPERATORS_CAT (RID_APP_START + 1105) +#define RID_ATTRIBUTES_CAT (RID_APP_START + 1106) +#define RID_BRACKETS_CAT (RID_APP_START + 1107) +#define RID_FORMAT_CAT (RID_APP_START + 1108) +#define RID_UNBINOPS_CAT_HLP (RID_APP_START + 1109) +#define RID_RELATIONS_CAT_HLP (RID_APP_START + 1110) +#define RID_SETOPEROPERATIONS_CAT_HLP (RID_APP_START + 1111) +#define RID_FUNCTIONS_CAT_HLP (RID_APP_START + 1112) +#define RID_OPERATORS_CAT_HLP (RID_APP_START + 1113) +#define RID_ATTRIBUTES_CAT_HLP (RID_APP_START + 1114) +#define RID_BRACKETS_CAT_HLP (RID_APP_START + 1115) +#define RID_FORMAT_CAT_HLP (RID_APP_START + 1116) +#define RID_MISC_CAT (RID_APP_START + 1117) +#define RID_MISC_CAT_HLP (RID_APP_START + 1118) + +// new resource ID's +#define RID_PLUSX (RID_APP_START + 1201) +#define RID_MINUSX (RID_APP_START + 1202) +#define RID_PLUSMINUSX (RID_APP_START + 1203) +#define RID_MINUSPLUSX (RID_APP_START + 1204) +#define RID_XPLUSY (RID_APP_START + 1205) +#define RID_XCDOTY (RID_APP_START + 1206) +#define RID_XTIMESY (RID_APP_START + 1207) +#define RID_XSYMTIMESY (RID_APP_START + 1208) +#define RID_XMINUSY (RID_APP_START + 1209) +#define RID_XOVERY (RID_APP_START + 1210) +#define RID_XDIVY (RID_APP_START + 1211) +#define RID_XSYMDIVIDEY (RID_APP_START + 1212) +#define RID_NEGX (RID_APP_START + 1213) +#define RID_XANDY (RID_APP_START + 1214) +#define RID_XORY (RID_APP_START + 1215) +#define RID_XODIVIDEY (RID_APP_START + 1216) +#define RID_XODOTY (RID_APP_START + 1217) +#define RID_XOMINUSY (RID_APP_START + 1218) +#define RID_XOPLUSY (RID_APP_START + 1219) +#define RID_XOTIMESY (RID_APP_START + 1220) +#define RID_XCIRCY (RID_APP_START + 1221) +#define RID_XWIDESLASHY (RID_APP_START + 1222) +#define RID_XWIDEBSLASHY (RID_APP_START + 1223) + +#define RID_XEQY (RID_APP_START + 1301) +#define RID_XNEQY (RID_APP_START + 1302) +#define RID_XEQUIVY (RID_APP_START + 1303) +#define RID_XORTHOY (RID_APP_START + 1304) +#define RID_XLTY (RID_APP_START + 1305) +#define RID_XGTY (RID_APP_START + 1306) +#define RID_XAPPROXY (RID_APP_START + 1307) +#define RID_XPARALLELY (RID_APP_START + 1308) +#define RID_XLESLANTY (RID_APP_START + 1309) +#define RID_XGESLANTY (RID_APP_START + 1310) +#define RID_XSIMEQY (RID_APP_START + 1311) +#define RID_XPROPY (RID_APP_START + 1312) +#define RID_XLEY (RID_APP_START + 1313) +#define RID_XGEY (RID_APP_START + 1314) +#define RID_XSIMY (RID_APP_START + 1315) +#define RID_XTOWARDY (RID_APP_START + 1316) +#define RID_XLLY (RID_APP_START + 1317) +#define RID_XGGY (RID_APP_START + 1318) +#define RID_XDEFY (RID_APP_START + 1319) +#define RID_XTRANSLY (RID_APP_START + 1320) +#define RID_XTRANSRY (RID_APP_START + 1321) +#define RID_XDIVIDESY (RID_APP_START + 1322) +#define RID_XNDIVIDESY (RID_APP_START + 1323) +#define RID_DLARROW (RID_APP_START + 1324) +#define RID_DLRARROW (RID_APP_START + 1325) +#define RID_DRARROW (RID_APP_START + 1326) + +#define RID_XINY (RID_APP_START + 1401) +#define RID_XNOTINY (RID_APP_START + 1402) +#define RID_XOWNSY (RID_APP_START + 1403) +#define RID_XINTERSECTIONY (RID_APP_START + 1405) +#define RID_XUNIONY (RID_APP_START + 1406) +#define RID_XSETMINUSY (RID_APP_START + 1407) +#define RID_XSLASHY (RID_APP_START + 1408) +#define RID_XSUBSETY (RID_APP_START + 1409) +#define RID_XSUBSETEQY (RID_APP_START + 1410) +#define RID_XSUPSETY (RID_APP_START + 1411) +#define RID_XSUPSETEQY (RID_APP_START + 1412) +#define RID_XNSUBSETY (RID_APP_START + 1413) +#define RID_XNSUBSETEQY (RID_APP_START + 1414) +#define RID_XNSUPSETY (RID_APP_START + 1415) +#define RID_XNSUPSETEQY (RID_APP_START + 1416) +#define RID_SETN (RID_APP_START + 1417) +#define RID_SETZ (RID_APP_START + 1418) +#define RID_SETQ (RID_APP_START + 1419) +#define RID_SETR (RID_APP_START + 1420) +#define RID_SETC (RID_APP_START + 1421) + +#define RID_ABSX (RID_APP_START + 1501) +#define RID_FACTX (RID_APP_START + 1502) +#define RID_SQRTX (RID_APP_START + 1503) +#define RID_NROOTXY (RID_APP_START + 1504) +#define RID_EX (RID_APP_START + 1505) +#define RID_LNX (RID_APP_START + 1506) +#define RID_EXPX (RID_APP_START + 1507) +#define RID_LOGX (RID_APP_START + 1508) +#define RID_SINX (RID_APP_START + 1509) +#define RID_COSX (RID_APP_START + 1510) +#define RID_TANX (RID_APP_START + 1511) +#define RID_COTX (RID_APP_START + 1512) +#define RID_SINHX (RID_APP_START + 1513) +#define RID_COSHX (RID_APP_START + 1514) +#define RID_TANHX (RID_APP_START + 1515) +#define RID_COTHX (RID_APP_START + 1516) +#define RID_ARCSINX (RID_APP_START + 1517) +#define RID_ARCCOSX (RID_APP_START + 1518) +#define RID_ARCTANX (RID_APP_START + 1519) +#define RID_ARCCOTX (RID_APP_START + 1520) +#define RID_ARSINHX (RID_APP_START + 1521) +#define RID_ARCOSHX (RID_APP_START + 1522) +#define RID_ARTANHX (RID_APP_START + 1523) +#define RID_ARCOTHX (RID_APP_START + 1524) + +#define RID_LIMX (RID_APP_START + 1601) +#define RID_SUMX (RID_APP_START + 1602) +#define RID_PRODX (RID_APP_START + 1603) +#define RID_COPRODX (RID_APP_START + 1604) +#define RID_INTX (RID_APP_START + 1605) +#define RID_IINTX (RID_APP_START + 1606) +#define RID_IIINTX (RID_APP_START + 1607) +#define RID_LINTX (RID_APP_START + 1609) +#define RID_LLINTX (RID_APP_START + 1610) +#define RID_LLLINTX (RID_APP_START + 1611) +#define RID_FROMXTOY (RID_APP_START + 1613) +#define RID_FROMX (RID_APP_START + 1614) +#define RID_TOX (RID_APP_START + 1615) +#define RID_LIMINFX (RID_APP_START + 1616) +#define RID_LIMSUPX (RID_APP_START + 1617) + +#define RID_ACUTEX (RID_APP_START + 1701) +#define RID_GRAVEX (RID_APP_START + 1702) +#define RID_CHECKX (RID_APP_START + 1703) +#define RID_BREVEX (RID_APP_START + 1704) +#define RID_BARX (RID_APP_START + 1705) +#define RID_VECX (RID_APP_START + 1706) +#define RID_HATX (RID_APP_START + 1707) +#define RID_TILDEX (RID_APP_START + 1708) +#define RID_CIRCLEX (RID_APP_START + 1709) +#define RID_DOTX (RID_APP_START + 1710) +#define RID_DDOTX (RID_APP_START + 1711) +#define RID_DDDOTX (RID_APP_START + 1712) +#define RID_OVERLINEX (RID_APP_START + 1713) +#define RID_UNDERLINEX (RID_APP_START + 1714) +#define RID_OVERSTRIKEX (RID_APP_START + 1715) +#define RID_PHANTOMX (RID_APP_START + 1716) +#define RID_BOLDX (RID_APP_START + 1717) +#define RID_ITALX (RID_APP_START + 1718) +#define RID_SIZEXY (RID_APP_START + 1719) +#define RID_FONTXY (RID_APP_START + 1720) +#define RID_COLORX (RID_APP_START + 1721) +#define RID_WIDEHATX (RID_APP_START + 1722) +#define RID_WIDETILDEX (RID_APP_START + 1723) +#define RID_WIDEVECX (RID_APP_START + 1724) + +#define RID_LRPARENTX (RID_APP_START + 1801) +#define RID_LRBRACKETX (RID_APP_START + 1802) +#define RID_LRANGLEX (RID_APP_START + 1803) +#define RID_LRBRACEX (RID_APP_START + 1804) +#define RID_LRLINEX (RID_APP_START + 1805) +#define RID_LRDLINEX (RID_APP_START + 1806) +#define RID_LRGROUPX (RID_APP_START + 1808) +#define RID_SLRPARENTX (RID_APP_START + 1809) +#define RID_SLRBRACKETX (RID_APP_START + 1810) +#define RID_SLRANGLEX (RID_APP_START + 1811) +#define RID_SLRBRACEX (RID_APP_START + 1812) +#define RID_SLRLINEX (RID_APP_START + 1813) +#define RID_SLRDLINEX (RID_APP_START + 1814) +#define RID_LRCEILX (RID_APP_START + 1817) +#define RID_LRFLOORX (RID_APP_START + 1818) +#define RID_SLRCEILX (RID_APP_START + 1819) +#define RID_SLRFLOORX (RID_APP_START + 1820) +#define RID_LMRANGLEXY (RID_APP_START + 1821) +#define RID_SLMRANGLEXY (RID_APP_START + 1822) +#define RID_LRDBRACKETX (RID_APP_START + 1823) +#define RID_SLRDBRACKETX (RID_APP_START + 1824) +#define RID_XOVERBRACEY (RID_APP_START + 1825) +#define RID_XUNDERBRACEY (RID_APP_START + 1826) + +#define RID_NEWLINE (RID_APP_START + 1901) +#define RID_SBLANK (RID_APP_START + 1902) +#define RID_BLANK (RID_APP_START + 1903) +#define RID_RSUBX (RID_APP_START + 1904) +#define RID_BINOMXY (RID_APP_START + 1905) +#define RID_STACK (RID_APP_START + 1906) +#define RID_MATRIX (RID_APP_START + 1907) +#define RID_RSUPX (RID_APP_START + 1908) +#define RID_ALIGNLX (RID_APP_START + 1909) +#define RID_ALIGNCX (RID_APP_START + 1910) +#define RID_ALIGNRX (RID_APP_START + 1911) +#define RID_LSUBX (RID_APP_START + 1912) +#define RID_LSUPX (RID_APP_START + 1916) +#define RID_CSUBX (RID_APP_START + 1917) +#define RID_CSUPX (RID_APP_START + 1918) + +#define RID_ALEPH (RID_APP_START + 2001) +#define RID_EMPTYSET (RID_APP_START + 2002) +#define RID_RE (RID_APP_START + 2003) +#define RID_IM (RID_APP_START + 2004) +#define RID_INFINITY (RID_APP_START + 2005) +#define RID_PARTIAL (RID_APP_START + 2006) +#define RID_WP (RID_APP_START + 2007) +#define RID_DOTSAXIS (RID_APP_START + 2008) +#define RID_DOTSUP (RID_APP_START + 2009) +#define RID_DOTSDOWN (RID_APP_START + 2010) +#define RID_DOTSLOW (RID_APP_START + 2011) +#define RID_DOTSVERT (RID_APP_START + 2012) +#define RID_NABLA (RID_APP_START + 2013) +#define RID_HBAR (RID_APP_START + 2014) +#define RID_LAMBDABAR (RID_APP_START + 2015) +#define RID_LEFTARROW (RID_APP_START + 2016) +#define RID_RIGHTARROW (RID_APP_START + 2017) +#define RID_UPARROW (RID_APP_START + 2018) +#define RID_DOWNARROW (RID_APP_START + 2019) +#define RID_EXISTS (RID_APP_START + 1608) +#define RID_FORALL (RID_APP_START + 1612) + +// new menue resource ID's +#define RID_UNBINOPS_MENU (RID_APP_START + 2164) +#define RID_RELATIONS_MENU (RID_APP_START + 2165) +#define RID_SETOPERATIONS_MENU (RID_APP_START + 2166) +#define RID_FUNCTIONS_MENU (RID_APP_START + 2167) +#define RID_OPERATORS_MENU (RID_APP_START + 2168) +#define RID_ATTRIBUTES_MENU (RID_APP_START + 2169) +#define RID_BRACKETS_MENU (RID_APP_START + 2170) +#define RID_FORMAT_MENU (RID_APP_START + 2171) +#define RID_MISC_MENU (RID_APP_START + 2172) +#define RID_FUNCTIONSOTHER1_MENU (RID_APP_START + 2173) + +#define RID_XPP_LINE (RID_APP_START + 3000) +#define RID_XPP_DLINE (RID_APP_START + 3001) +#define RID_XPP_SQRT (RID_APP_START + 3002) +#define RID_XPP_SQRT2 (RID_APP_START + 3003) +#define RID_XPP_HAT (RID_APP_START + 3004) +#define RID_XPP_TILDE (RID_APP_START + 3005) +#define RID_XPP_BAR (RID_APP_START + 3006) +#define RID_XPP_VEC (RID_APP_START + 3007) +#define RID_XPP_LBRACE (RID_APP_START + 3008) +#define RID_XPP_RBRACE (RID_APP_START + 3009) +#define RID_XPP_LPARENT (RID_APP_START + 3010) +#define RID_XPP_RPARENT (RID_APP_START + 3011) +#define RID_XPP_LANGLE (RID_APP_START + 3012) +#define RID_XPP_RANGLE (RID_APP_START + 3013) +#define RID_XPP_LBRACKET (RID_APP_START + 3014) +#define RID_XPP_RBRACKET (RID_APP_START + 3015) +#define RID_XPP_LDBRACKET (RID_APP_START + 3016) +#define RID_XPP_RDBRACKET (RID_APP_START + 3017) +#define RID_XPP_LCEIL (RID_APP_START + 3018) +#define RID_XPP_RCEIL (RID_APP_START + 3019) +#define RID_XPP_LFLOOR (RID_APP_START + 3020) +#define RID_XPP_RFLOOR (RID_APP_START + 3021) +#define RID_XPP_OVERBRACE (RID_APP_START + 3022) +#define RID_XPP_UNDERBRACE (RID_APP_START + 3023) + +#define HID_SMA_OPTIONSDIALOG (HID_SMA_START + 1) +#define HID_SMA_FONTDIALOG (HID_SMA_START + 2) +#define HID_SMA_FONTSIZEDIALOG (HID_SMA_START + 3) +#define HID_SMA_FONTTYPEDIALOG (HID_SMA_START + 4) +#define HID_SMA_DISTANCEDIALOG (HID_SMA_START + 5) +#define HID_SMA_ALIGNDIALOG (HID_SMA_START + 6) +#define HID_SMA_PRINTOPTIONPAGE (HID_SMA_START + 7) +#define HID_SMA_SYMBOLDIALOG (HID_SMA_START + 8) +#define HID_SMA_SYMDEFINEDIALOG (HID_SMA_START + 9) +#define HID_SMA_EXTRAOPTIONPAGE (HID_SMA_START + 10) +#define HID_SMA_DOCSAVEQUERY (HID_SMA_START + 11) +#define HID_SMA_OBJECTSAVEQUERY (HID_SMA_START + 12) +#define HID_SMA_DEFAULTSAVEQUERY (HID_SMA_START + 13) +#define HID_SMA_ILLEGALOBJECTERROR (HID_SMA_START + 14) +#define HID_SMA_ILLEGALFILEERROR (HID_SMA_START + 15) +#define HID_SMA_WRITESYMBOLERROR (HID_SMA_START + 16) +#define HID_SMA_READSYMBOLERROR (HID_SMA_START + 17) +#define HID_SMA_NOMATHTYPEFACEWARNING (HID_SMA_START + 18) +#define HID_SMA_OBJECTNAME (HID_SMA_START + 19) +#define HID_SMA_VIEWNAME (HID_SMA_START + 20) +#define HID_SMA_UNDOEDITNAME (HID_SMA_START + 21) +#define HID_SMA_UNDOFORMATNAME (HID_SMA_START + 22) +#define HID_SMA_APPICO (HID_SMA_START + 23) +#define HID_SMA_DOCICO (HID_SMA_START + 24) +#define HID_SMA_TMPICO (HID_SMA_START + 25) +#define HID_SMA_COMMANDMENU (HID_SMA_START + 26) +#define HID_SMA_VIEWMENU (HID_SMA_START + 27) +#define HID_SMA_DISTANCEMENU (HID_SMA_START + 28) +#define HID_SMA_FONTMENU (HID_SMA_START + 29) +#define HID_SMA_STARTUPWINDOW (HID_SMA_START + 30) +#define HID_SMA_TOOLBOXWINDOW (HID_SMA_START + 31) +#define HID_SMA_CMDBOXWINDOW (HID_SMA_START + 32) +#define HID_SMA_UPDATEOBJECT (HID_SMA_START + 33) +#define HID_SMA_FONTREGULAR (HID_SMA_START + 34) +#define HID_SMA_FONTITALIC (HID_SMA_START + 35) +#define HID_SMA_FONTBOLD (HID_SMA_START + 36) +#define HID_SMA_PRINTOPTION (HID_SMA_START + 37) +#define HID_SMA_DOCUMENTSTR (HID_SMA_START + 38) +#define HID_SMA_SYMBOLFILESSTR (HID_SMA_START + 39) +#define HID_SMA_ALLFILESSTR (HID_SMA_START + 40) +#define HID_SMA_CREATORSTR (HID_SMA_START + 41) +#define HID_SMA_FILESMFTYP (HID_SMA_START + 42) +#define HID_SMA_FILESYMTYP (HID_SMA_START + 43) +#define HID_SMA_WIN_DOCUMENT (HID_SMA_START + 44) +#define HID_SMA_COMMAND_WIN_EDIT (HID_SMA_START + 45) + +#define HID_SMA_PLUSX (HID_SMA_START + 50) +#define HID_SMA_MINUSX (HID_SMA_START + 51) +#define HID_SMA_PLUSMINUSX (HID_SMA_START + 52) +#define HID_SMA_MINUSPLUSX (HID_SMA_START + 53) +#define HID_SMA_NEGX (HID_SMA_START + 54) +#define HID_SMA_XPLUSY (HID_SMA_START + 55) +#define HID_SMA_XMINUSY (HID_SMA_START + 56) +#define HID_SMA_XCDOTY (HID_SMA_START + 57) +#define HID_SMA_XTIMESY (HID_SMA_START + 58) +#define HID_SMA_XSYMTIMESY (HID_SMA_START + 59) +#define HID_SMA_XSYMDIVIDEY (HID_SMA_START + 60) +#define HID_SMA_XDIVY (HID_SMA_START + 61) +#define HID_SMA_XOVERY (HID_SMA_START + 62) +#define HID_SMA_XODIVIDEY (HID_SMA_START + 63) +#define HID_SMA_XODOTY (HID_SMA_START + 64) +#define HID_SMA_XOMINUSY (HID_SMA_START + 65) +#define HID_SMA_XOPLUSY (HID_SMA_START + 66) +#define HID_SMA_XOTIMESY (HID_SMA_START + 67) +#define HID_SMA_XANDY (HID_SMA_START + 68) +#define HID_SMA_XORY (HID_SMA_START + 69) +#define HID_SMA_XEQY (HID_SMA_START + 70) +#define HID_SMA_XNEQY (HID_SMA_START + 71) +#define HID_SMA_XLTY (HID_SMA_START + 72) +#define HID_SMA_XGTY (HID_SMA_START + 73) +#define HID_SMA_XLEY (HID_SMA_START + 74) +#define HID_SMA_XGEY (HID_SMA_START + 75) +#define HID_SMA_XLESLANTY (HID_SMA_START + 76) +#define HID_SMA_XGESLANTY (HID_SMA_START + 77) +#define HID_SMA_XLLY (HID_SMA_START + 78) +#define HID_SMA_XGGY (HID_SMA_START + 79) +#define HID_SMA_XDEFY (HID_SMA_START + 80) +#define HID_SMA_XEQUIVY (HID_SMA_START + 81) +#define HID_SMA_XAPPROXY (HID_SMA_START + 82) +#define HID_SMA_XSIMY (HID_SMA_START + 83) +#define HID_SMA_XSIMEQY (HID_SMA_START + 84) +#define HID_SMA_XPROPY (HID_SMA_START + 85) +#define HID_SMA_XORTHOY (HID_SMA_START + 86) +#define HID_SMA_XPARALLELY (HID_SMA_START + 87) +#define HID_SMA_XTOWARDY (HID_SMA_START + 88) +#define HID_SMA_XTRANSLY (HID_SMA_START + 89) +#define HID_SMA_XTRANSRY (HID_SMA_START + 90) +#define HID_SMA_XINY (HID_SMA_START + 91) +#define HID_SMA_XNOTINY (HID_SMA_START + 92) +#define HID_SMA_XOWNSY (HID_SMA_START + 93) +#define HID_SMA_XUNIONY (HID_SMA_START + 94) +#define HID_SMA_XINTERSECTIONY (HID_SMA_START + 95) +#define HID_SMA_XSETMINUSY (HID_SMA_START + 96) +#define HID_SMA_XSLASHY (HID_SMA_START + 97) +#define HID_SMA_XSUBSETY (HID_SMA_START + 98) +#define HID_SMA_XSUBSETEQY (HID_SMA_START + 99) +#define HID_SMA_XSUPSETY (HID_SMA_START + 100) +#define HID_SMA_XSUPSETEQY (HID_SMA_START + 101) +#define HID_SMA_XNSUBSETY (HID_SMA_START + 102) +#define HID_SMA_XNSUBSETEQY (HID_SMA_START + 103) +#define HID_SMA_XNSUPSETY (HID_SMA_START + 104) +#define HID_SMA_XNSUPSETEQY (HID_SMA_START + 105) +#define HID_SMA_ABSX (HID_SMA_START + 106) +#define HID_SMA_FACTX (HID_SMA_START + 107) +#define HID_SMA_SQRTX (HID_SMA_START + 108) +#define HID_SMA_NROOTXY (HID_SMA_START + 109) +#define HID_SMA_EX (HID_SMA_START + 110) +#define HID_SMA_EXPX (HID_SMA_START + 111) +#define HID_SMA_LNX (HID_SMA_START + 112) +#define HID_SMA_LOGX (HID_SMA_START + 113) +#define HID_SMA_SINX (HID_SMA_START + 114) +#define HID_SMA_COSX (HID_SMA_START + 115) +#define HID_SMA_TANX (HID_SMA_START + 116) +#define HID_SMA_COTX (HID_SMA_START + 117) +#define HID_SMA_ARCSINX (HID_SMA_START + 118) +#define HID_SMA_ARCCOSX (HID_SMA_START + 119) +#define HID_SMA_ARCTANX (HID_SMA_START + 120) +#define HID_SMA_ARCCOTX (HID_SMA_START + 121) +#define HID_SMA_SINHX (HID_SMA_START + 122) +#define HID_SMA_COSHX (HID_SMA_START + 123) +#define HID_SMA_TANHX (HID_SMA_START + 124) +#define HID_SMA_COTHX (HID_SMA_START + 125) +#define HID_SMA_ARSINHX (HID_SMA_START + 126) +#define HID_SMA_ARCOSHX (HID_SMA_START + 127) +#define HID_SMA_ARTANHX (HID_SMA_START + 128) +#define HID_SMA_ARCOTHX (HID_SMA_START + 129) +#define HID_SMA_SUMX (HID_SMA_START + 130) +#define HID_SMA_PRODX (HID_SMA_START + 131) +#define HID_SMA_COPRODX (HID_SMA_START + 132) +#define HID_SMA_LIMX (HID_SMA_START + 133) +#define HID_SMA_LIMINFX (HID_SMA_START + 134) +#define HID_SMA_LIMSUPX (HID_SMA_START + 135) +#define HID_SMA_EXISTS (HID_SMA_START + 136) +#define HID_SMA_FORALL (HID_SMA_START + 137) +#define HID_SMA_NABLA (HID_SMA_START + 138) +#define HID_SMA_INTX (HID_SMA_START + 139) +#define HID_SMA_IINTX (HID_SMA_START + 140) +#define HID_SMA_IIINTX (HID_SMA_START + 141) +#define HID_SMA_LINTX (HID_SMA_START + 142) +#define HID_SMA_LLINTX (HID_SMA_START + 143) +#define HID_SMA_LLLINTX (HID_SMA_START + 144) +#define HID_SMA_FROMX (HID_SMA_START + 145) +#define HID_SMA_TOX (HID_SMA_START + 146) +#define HID_SMA_FROMXTOY (HID_SMA_START + 147) +#define HID_SMA_XCIRCY (HID_SMA_START + 148) +#define HID_SMA_XDIVIDESY (HID_SMA_START + 149) +#define HID_SMA_XNDIVIDESY (HID_SMA_START + 150) +#define HID_SMA_DLARROW (HID_SMA_START + 151) +#define HID_SMA_DLRARROW (HID_SMA_START + 152) +#define HID_SMA_DRARROW (HID_SMA_START + 153) + +#define HID_SMA_MISC_CAT (HID_SMA_START + 154) +#define HID_SMA_UNBINOPS_CAT (HID_SMA_START + 155) +#define HID_SMA_RELATIONS_CAT (HID_SMA_START + 156) +#define HID_SMA_SETOPERATIONS_CAT (HID_SMA_START + 157) +#define HID_SMA_FUNCTIONS_CAT (HID_SMA_START + 158) +#define HID_SMA_OPERATORS_CAT (HID_SMA_START + 159) +#define HID_SMA_ATTRIBUTES_CAT (HID_SMA_START + 160) +#define HID_SMA_BRACKETS_CAT (HID_SMA_START + 161) +#define HID_SMA_FORMAT_CAT (HID_SMA_START + 162) + +#define HID_SMA_OPERATOR_WIN (HID_SMA_START + 163) +#define HID_SMA_UNBINOPS_TBX (HID_SMA_START + 164) +#define HID_SMA_RELATIONS_TBX (HID_SMA_START + 165) +#define HID_SMA_SETOPERATIONS_TBX (HID_SMA_START + 166) +#define HID_SMA_FUNCTIONS_TBX (HID_SMA_START + 167) +#define HID_SMA_OPERATORS_TBX (HID_SMA_START + 168) +#define HID_SMA_ATTRIBUTES_TBX (HID_SMA_START + 169) +#define HID_SMA_BRACKETS_TBX (HID_SMA_START + 170) +#define HID_SMA_FORMAT_TBX (HID_SMA_START + 171) +#define HID_SMA_SELECTION_TBX (HID_SMA_START + 172) +#define HID_SMA_COMMAND_WIN (HID_SMA_START + 173) +#define HID_SMA_MISC_MENU (HID_SMA_START + 174) +#define HID_SMA_FUNCTIONSOTHER1_MENU (HID_SMA_START + 175) + +#define HID_SMA_ACUTEX (HID_SMA_START + 180) +#define HID_SMA_BARX (HID_SMA_START + 181) +#define HID_SMA_BREVEX (HID_SMA_START + 182) +#define HID_SMA_CHECKX (HID_SMA_START + 183) +#define HID_SMA_CIRCLEX (HID_SMA_START + 184) +#define HID_SMA_DOTX (HID_SMA_START + 185) +#define HID_SMA_DDOTX (HID_SMA_START + 186) +#define HID_SMA_DDDOTX (HID_SMA_START + 187) +#define HID_SMA_GRAVEX (HID_SMA_START + 188) +#define HID_SMA_HATX (HID_SMA_START + 189) +#define HID_SMA_TILDEX (HID_SMA_START + 190) +#define HID_SMA_VECX (HID_SMA_START + 191) +#define HID_SMA_UNDERLINEX (HID_SMA_START + 192) +#define HID_SMA_OVERLINEX (HID_SMA_START + 193) +#define HID_SMA_OVERSTRIKEX (HID_SMA_START + 194) +#define HID_SMA_PHANTOMX (HID_SMA_START + 195) +#define HID_SMA_BOLDX (HID_SMA_START + 196) +#define HID_SMA_ITALX (HID_SMA_START + 197) +#define HID_SMA_SIZEXY (HID_SMA_START + 198) +#define HID_SMA_FONTXY (HID_SMA_START + 199) +#define HID_SMA_COLORX (HID_SMA_START + 200) +#define HID_SMA_LRGROUPX (HID_SMA_START + 201) +#define HID_SMA_LRPARENTX (HID_SMA_START + 202) +#define HID_SMA_LRBRACKETX (HID_SMA_START + 203) +#define HID_SMA_LRBRACEX (HID_SMA_START + 204) +#define HID_SMA_LRANGLEX (HID_SMA_START + 205) +#define HID_SMA_LRCEILX (HID_SMA_START + 206) +#define HID_SMA_LRFLOORX (HID_SMA_START + 207) +#define HID_SMA_LRLINEX (HID_SMA_START + 208) +#define HID_SMA_LRDLINEX (HID_SMA_START + 209) +#define HID_SMA_SLRPARENTX (HID_SMA_START + 210) +#define HID_SMA_SLRBRACKETX (HID_SMA_START + 211) +#define HID_SMA_SLRBRACEX (HID_SMA_START + 212) +#define HID_SMA_SLRANGLEX (HID_SMA_START + 213) +#define HID_SMA_SLRCEILX (HID_SMA_START + 214) +#define HID_SMA_SLRFLOORX (HID_SMA_START + 215) +#define HID_SMA_SLRLINEX (HID_SMA_START + 216) +#define HID_SMA_SLRDLINEX (HID_SMA_START + 217) +#define HID_SMA_RSUBX (HID_SMA_START + 218) +#define HID_SMA_RSUPX (HID_SMA_START + 219) +#define HID_SMA_LSUBX (HID_SMA_START + 220) +#define HID_SMA_LSUPX (HID_SMA_START + 221) +#define HID_SMA_SBLANK (HID_SMA_START + 222) +#define HID_SMA_BLANK (HID_SMA_START + 223) +#define HID_SMA_NEWLINE (HID_SMA_START + 224) +#define HID_SMA_BINOMXY (HID_SMA_START + 225) +#define HID_SMA_STACK (HID_SMA_START + 226) +#define HID_SMA_MATRIX (HID_SMA_START + 227) +#define HID_SMA_ALIGNLX (HID_SMA_START + 228) +#define HID_SMA_ALIGNCX (HID_SMA_START + 229) +#define HID_SMA_ALIGNRX (HID_SMA_START + 230) +#define HID_SMA_ALEPH (HID_SMA_START + 231) +#define HID_SMA_EMPTYSET (HID_SMA_START + 232) +#define HID_SMA_RE (HID_SMA_START + 233) +#define HID_SMA_IM (HID_SMA_START + 234) +#define HID_SMA_INFINITY (HID_SMA_START + 235) +#define HID_SMA_PARTIAL (HID_SMA_START + 236) +#define HID_SMA_WP (HID_SMA_START + 237) +#define HID_SMA_DOTSAXIS (HID_SMA_START + 238) +#define HID_SMA_DOTSUP (HID_SMA_START + 239) +#define HID_SMA_DOTSDOWN (HID_SMA_START + 240) +#define HID_SMA_DOTSLOW (HID_SMA_START + 241) +#define HID_SMA_DOTSVERT (HID_SMA_START + 242) + +#define HID_SMA_SETN (HID_SMA2_START + 1) +#define HID_SMA_SETZ (HID_SMA2_START + 2) +#define HID_SMA_SETQ (HID_SMA2_START + 3) +#define HID_SMA_SETR (HID_SMA2_START + 4) +#define HID_SMA_SETC (HID_SMA2_START + 5) +#define HID_SMA_WIDEHATX (HID_SMA2_START + 6) +#define HID_SMA_WIDETILDEX (HID_SMA2_START + 7) +#define HID_SMA_WIDEVECX (HID_SMA2_START + 8) +#define HID_SMA_CSUBX (HID_SMA2_START + 9) +#define HID_SMA_CSUPX (HID_SMA2_START + 10) +#define HID_SMA_HBAR (HID_SMA2_START + 11) +#define HID_SMA_LAMBDABAR (HID_SMA2_START + 12) +#define HID_SMA_LEFTARROW (HID_SMA2_START + 13) +#define HID_SMA_RIGHTARROW (HID_SMA2_START + 14) +#define HID_SMA_UPARROW (HID_SMA2_START + 15) +#define HID_SMA_DOWNARROW (HID_SMA2_START + 16) + +#define HID_SMA_DEFAULT_DIST (HID_SMA2_START + 17) +#define HID_SMA_LINE_DIST (HID_SMA2_START + 18) +#define HID_SMA_ROOT_DIST (HID_SMA2_START + 19) +#define HID_SMA_SUP_DIST (HID_SMA2_START + 20) +#define HID_SMA_SUB_DIST (HID_SMA2_START + 21) +#define HID_SMA_NUMERATOR_DIST (HID_SMA2_START + 22) +#define HID_SMA_DENOMINATOR_DIST (HID_SMA2_START + 23) +#define HID_SMA_FRACLINE_EXCWIDTH (HID_SMA2_START + 24) +#define HID_SMA_FRACLINE_LINEWIDTH (HID_SMA2_START + 25) +#define HID_SMA_UPPERLIMIT_DIST (HID_SMA2_START + 26) +#define HID_SMA_LOWERLIMIT_DIST (HID_SMA2_START + 27) +#define HID_SMA_BRACKET_EXCHEIGHT (HID_SMA2_START + 28) +#define HID_SMA_BRACKET_DIST (HID_SMA2_START + 29) +#define HID_SMA_MATRIXROW_DIST (HID_SMA2_START + 30) +#define HID_SMA_MATRIXCOL_DIST (HID_SMA2_START + 31) +#define HID_SMA_ATTRIBUT_DIST (HID_SMA2_START + 32) +#define HID_SMA_INTERATTRIBUT_DIST (HID_SMA2_START + 33) +#define HID_SMA_OPERATOR_EXCHEIGHT (HID_SMA2_START + 34) +#define HID_SMA_OPERATOR_DIST (HID_SMA2_START + 35) +#define HID_SMA_LEFTBORDER_DIST (HID_SMA2_START + 36) +#define HID_SMA_RIGHTBORDER_DIST (HID_SMA2_START + 37) +#define HID_SMA_UPPERBORDER_DIST (HID_SMA2_START + 38) +#define HID_SMA_LOWERBORDER_DIST (HID_SMA2_START + 39) +#define HID_SMA_SCALE_ALL_BRACKETS (HID_SMA2_START + 40) +#define HID_SMA_BRACKET_EXCHEIGHT2 (HID_SMA2_START + 41) +#define HID_SMA_LMRANGLEXY (HID_SMA2_START + 42) +#define HID_SMA_SLMRANGLEXY (HID_SMA2_START + 43) +#define HID_SMA_XWIDESLASHY (HID_SMA2_START + 44) +#define HID_SMA_XWIDEBSLASHY (HID_SMA2_START + 45) +#define HID_SMA_XOVERBRACEY (HID_SMA2_START + 46) +#define HID_SMA_XUNDERBRACEY (HID_SMA2_START + 47) +#define HID_SMA_LRDBRACKETX (HID_SMA2_START + 48) +#define HID_SMA_SLRDBRACKETX (HID_SMA2_START + 49) + + +#define BMP_ARROW_RIGHT 1 + +#define MN_WIN 60 +#define MN_SUB_VIEW 31 +#define MN_SUB_TOOLBAR 32 +#define MN_SUB_GRAPHIC 33 +#define MN_SUB_SPELLING 34 +#define MN_SUB_TEMPLATES 35 +#define MN_SUB_SYMBOLS 90 + +// 342 == SCH_IF_SMAVIEWSHELL, da SFX_INTERFACE_LIB kein +// Define sondern neuerdings ein Enum ist +#define HID_SMA_VIEWSHELL_DOCUMENT (342) + +#endif + diff --git a/starmath/inc/symbol.hxx b/starmath/inc/symbol.hxx new file mode 100644 index 000000000000..b10fd7b67047 --- /dev/null +++ b/starmath/inc/symbol.hxx @@ -0,0 +1,225 @@ +/************************************************************************* + * + * $RCSfile: symbol.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: hr $ $Date: 2000-09-18 16:57:25 $ + * + * 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): _______________________________________ + * + * + ************************************************************************/ +#ifndef SYMBOL_HXX +#define SYMBOL_HXX + +#ifndef _FONT_HXX //autogen +#include <vcl/font.hxx> +#endif +#ifndef _LIST_HXX //autogen +#include <tools/list.hxx> +#endif +#ifndef _TOOLS_DEBUG_HXX //autogen +#include <tools/debug.hxx> +#endif +#ifndef _SFXLSTNER_HXX //autogen +#include <svtools/lstner.hxx> +#endif +#ifndef _DYNARY_HXX //autogen +#include <tools/dynary.hxx> +#endif +#ifndef UTILITY_HXX +#include "utility.hxx" +#endif + + +#define SS_ATTR_ACCESS 0x80 + +#define SYMBOLSET_NONE 0xFFFF +#define SYMBOL_NONE 0xFFFF + +//////////////////////////////////////////////////////////////////////////////// + +class SmSym +{ + friend class SmSymSetManager; + + SmFace Face; + String Name; + SmSym *pHashNext; + SmSymSetManager *pSymSetManager; + sal_Unicode Character; + BYTE Attribut; + +public: + SmSym(); + SmSym(const SmSym& rSymbol); + SmSym(const String& rName, const Font& rFont, sal_Unicode aChar); + + SmSym& operator = (const SmSym& rSymbol); + + void SetSymbolName(const String& rName); + + const Font& GetFace() const { return Face; } + sal_Unicode GetCharacter() const { return Character; } + const String& GetName() const { return Name; } + + Font& GetFace() { return Face; } + sal_Unicode& GetCharacter() { return Character; } + String& GetName() { return Name; } + + friend SvStream& operator << (SvStream& rStream, const SmSym& rSymbol); + friend SvStream& operator >> (SvStream& rStream, SmSym& rSymbol); +}; + +DECLARE_LIST(SmListSym, SmSym *); + +/**************************************************************************/ + +class SmSymSet +{ + friend class SmSymSetManager; + + SmListSym SymbolList; + String Name; + SmSymSetManager *pSymSetManager; + +public: + SmSymSet(); + SmSymSet(const SmSymSet& rSymbolSet); + SmSymSet(const String& rName); + ~SmSymSet(); + + SmSymSet& operator = (const SmSymSet& rSymbolSet); + + const String& GetName() const { return Name; } + void SetName(String& rName); + USHORT GetCount() const { return (USHORT) SymbolList.Count(); } + + const SmSym& GetSymbol(USHORT SymbolNo) const + { + DBG_ASSERT(SymbolList.GetObject(SymbolNo), "Symbol nicht vorhanden"); + return *SymbolList.GetObject(SymbolNo); + } + + USHORT AddSymbol(SmSym* pSymbol); + void DeleteSymbol(USHORT SymbolNo); + void RenameSymbol(USHORT SymbolNo, String& rName); + void ReplaceSymbol(USHORT SymbolNo, SmSym& rSymbol); + SmSym * RemoveSymbol(USHORT SymbolNo); + USHORT GetSymbolPos(const String& rName); + + friend SvStream& operator << (SvStream& rStream, const SmSymSet& rSymbolSet); + friend SvStream& operator >> (SvStream& rStream, SmSymSet& rSymbolSet); +}; + +DECLARE_DYNARRAY(SmArraySymSet, SmSymSet *) + +/**************************************************************************/ + +class SmSymbolDialog; + +class SmSymSetManager : public SfxListener +{ + SmArraySymSet SymbolSets; + String aStreamName; + SmSym **HashEntries; + UINT32 NoSymbolSets; + UINT32 NoHashEntries; + BOOL Modified; + + virtual void SFX_NOTIFY(SfxBroadcaster& rBC, const TypeId& rBCType, + const SfxHint& rHint, const TypeId& rHintType); + + UINT32 GetHashIndex(const String& rSymbolName); + void EnterHashTable(SmSymSet& rSymbolSet); + void FillHashTable(); + +public: + void Init(); + void Exit(); + + SmSymSetManager(UINT32 HashTableSize = 137); + SmSymSetManager(const SmSymSetManager& rSymbolSetManager); + ~SmSymSetManager(); + + SmSymSetManager& operator = (const SmSymSetManager& rSymbolSetManager); + + USHORT GetCount() const { return NoSymbolSets; } + SmSymSet *GetSymbolSet(USHORT SymbolSetNo) const { return SymbolSets.Get(SymbolSetNo);} + + USHORT AddSymbolSet(SmSymSet* pSymbolSet); + void ChangeSymbolSet(SmSymSet* pSymbolSet); + void DeleteSymbolSet(USHORT SymbolSetNo); + USHORT GetSymbolSetPos(const String& rSymbolSetName) const; + + SmSym * GetSymbol(const String& rSymbolName); + const SmSym * GetSymbol(const String& rSymbolName) const + { + return ((SmSymSetManager *) this)->GetSymbol(rSymbolName); + } + + void AppendExtraSymbolSet(SmSymSet* pSymbolSet) {} + void ResetAccessedSymbols() {} + SmSymSet GetAccessedSymbols() { return SmSymSet(); } + + BOOL IsModified() const { return (Modified); } + void SetModified(BOOL Modify) { Modified = Modify; } + + void Load(const String& rURL); + void Save(); + + friend SvStream& operator << (SvStream& rStream, SmSymSetManager& rSymbolSetManager); + friend SvStream& operator >> (SvStream& rStream, SmSymSetManager& rSymbolSetManager); +}; + +#endif + diff --git a/starmath/inc/toolbox.hxx b/starmath/inc/toolbox.hxx new file mode 100644 index 000000000000..8391a8800eb1 --- /dev/null +++ b/starmath/inc/toolbox.hxx @@ -0,0 +1,124 @@ +/************************************************************************* + * + * $RCSfile: toolbox.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: hr $ $Date: 2000-09-18 16:57:25 $ + * + * 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): _______________________________________ + * + * + ************************************************************************/ +#ifndef TOOLBOX_HXX +#define TOOLBOX_HXX + +#ifndef _BASEDLGS_HXX //autogen +#include <sfx2/basedlgs.hxx> +#endif +#ifndef _SFX_CHILDWIN_HXX //autogen +#include <sfx2/childwin.hxx> +#endif +#ifndef _SV_TOOLBOX_HXX //autogen +#include <vcl/toolbox.hxx> +#endif + +#ifndef _SMMOD_HXX +#include "smmod.hxx" +#endif +#ifndef CONFIG_HXX +#include "config.hxx" +#endif + + +#define NUM_TBX_CATEGORIES 9 + +class SmToolBoxWindow : public SfxFloatingWindow +{ + +protected: + ToolBox aToolBoxCat; + ToolBox *pToolBoxCmd; + ToolBox *vToolBoxCategories[NUM_TBX_CATEGORIES]; + USHORT nActiveCategory; + + virtual BOOL Close(); + + DECL_LINK( CategoryClickHdl, ToolBox* ); + DECL_LINK( CmdSelectHdl, ToolBox* ); + +public: + SmToolBoxWindow(SfxBindings *pBindings, + SfxChildWindow *pChildWindow, + Window *pParent); + ~SmToolBoxWindow(); + + // Window + virtual void StateChanged( StateChangedType nStateChange ); + + void AdjustPosition(const Point &rPoint); + void SetCategory(USHORT nCategory); + void ShowWindows(); +}; + +/**************************************************************************/ + +class SmToolBoxWrapper : public SfxChildWindow +{ + SFX_DECL_CHILDWINDOW(SmToolBoxWrapper); + +protected: + SmToolBoxWrapper(Window *pParentWindow, + USHORT, SfxBindings*, SfxChildWinInfo*); +}; + +#endif + diff --git a/starmath/inc/types.hxx b/starmath/inc/types.hxx new file mode 100644 index 000000000000..c7aac531e8bf --- /dev/null +++ b/starmath/inc/types.hxx @@ -0,0 +1,216 @@ +/************************************************************************* + * + * $RCSfile: types.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: hr $ $Date: 2000-09-18 16:57:25 $ + * + * 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): _______________________________________ + * + * + ************************************************************************/ +#ifndef TYPES_HXX +#define TYPES_HXX + + +//////////////////////////////////////// +// enum definitions for characters from the 'StarMath' font +// (some chars have more than one alias!) +//! Note: not listed here does not(!) mean "not used" +//! (see %alpha ... %gamma for example) +// +enum MathSymbol +{ + MS_FACT = (xub_Unicode) 0xF021, + MS_INFINITY = (xub_Unicode) 0xF027, + MS_SLASH = (xub_Unicode) 0xF02F, + + MS_NDIVIDES = (xub_Unicode) 0xF030, + MS_DRARROW = (xub_Unicode) 0xF031, + MS_DLARROW = (xub_Unicode) 0xF032, + MS_DLRARROW = (xub_Unicode) 0xF033, + MS_UNDERBRACE = (xub_Unicode) 0xF034, + MS_OVERBRACE = (xub_Unicode) 0xF035, + MS_CIRC = (xub_Unicode) 0xF036, + MS_ASSIGN = (xub_Unicode) 0xF03D, + MS_ERROR = (xub_Unicode) 0xF03F, + + MS_NEQ = (xub_Unicode) 0xF040, + MS_PLUS = (xub_Unicode) 0xF041, + MS_MINUS = (xub_Unicode) 0xF042, + MS_MULTIPLY = (xub_Unicode) 0xF043, + MS_TIMES = (xub_Unicode) 0xF044, + MS_CDOT = (xub_Unicode) 0xF045, + MS_DIV = (xub_Unicode) 0xF046, + MS_PLUSMINUS = (xub_Unicode) 0xF047, + MS_MINUSPLUS = (xub_Unicode) 0xF048, + MS_OPLUS = (xub_Unicode) 0xF049, + MS_OMINUS = (xub_Unicode) 0xF04A, + MS_OTIMES = (xub_Unicode) 0xF04B, + MS_ODIVIDE = (xub_Unicode) 0xF04C, + MS_ODOT = (xub_Unicode) 0xF04D, + MS_UNION = (xub_Unicode) 0xF04E, + MS_INTERSECT = (xub_Unicode) 0xF04F, + + MS_LT = (xub_Unicode) 0xF050, + MS_GT = (xub_Unicode) 0xF051, + MS_LE = (xub_Unicode) 0xF052, + MS_GE = (xub_Unicode) 0xF053, + MS_LESLANT = (xub_Unicode) 0xF054, + MS_GESLANT = (xub_Unicode) 0xF055, + MS_LL = (xub_Unicode) 0xF056, + MS_GG = (xub_Unicode) 0xF057, + MS_SIM = (xub_Unicode) 0xF058, + MS_SIMEQ = (xub_Unicode) 0xF059, + MS_APPROX = (xub_Unicode) 0xF05A, + MS_DEF = (xub_Unicode) 0xF05B, + MS_EQUIV = (xub_Unicode) 0xF05C, + MS_PROP = (xub_Unicode) 0xF05D, + MS_PARTIAL = (xub_Unicode) 0xF05E, + MS_SUBSET = (xub_Unicode) 0xF05F, + + MS_SUPSET = (xub_Unicode) 0xF060, + MS_SUBSETEQ = (xub_Unicode) 0xF061, + MS_SUPSETEQ = (xub_Unicode) 0xF062, + MS_NSUBSET = (xub_Unicode) 0xF063, + MS_NSUPSET = (xub_Unicode) 0xF064, + MS_NSUBSETEQ = (xub_Unicode) 0xF065, + MS_NSUPSETEQ = (xub_Unicode) 0xF066, + MS_IN = (xub_Unicode) 0xF067, + MS_NOTIN = (xub_Unicode) 0xF068, + MS_EXISTS = (xub_Unicode) 0xF06A, + MS_BACKEPSILON = (xub_Unicode) 0xF06B, + MS_ALEPH = (xub_Unicode) 0xF06C, + MS_IM = (xub_Unicode) 0xF06D, + MS_RE = (xub_Unicode) 0xF06E, + MS_WP = (xub_Unicode) 0xF06F, + + MS_LINE = (xub_Unicode) 0xF073, + MS_DLINE = (xub_Unicode) 0xF074, + MS_ORTHO = (xub_Unicode) 0xF075, + MS_DOTSLOW = (xub_Unicode) 0xF076, + MS_DOTSAXIS = (xub_Unicode) 0xF077, + MS_DOTSVERT = (xub_Unicode) 0xF078, + MS_DOTSUP = (xub_Unicode) 0xF079, + MS_DOTSDOWN = (xub_Unicode) 0xF07A, + MS_TRANSR = (xub_Unicode) 0xF07B, + MS_TRANSL = (xub_Unicode) 0xF07C, + MS_RIGHTARROW = (xub_Unicode) 0xF07D, + MS_BACKSLASH = (xub_Unicode) 0xF07E, + MS_NEG = (xub_Unicode) 0xF07F, + + MS_INT = (xub_Unicode) 0xF080, + MS_IINT = (xub_Unicode) 0xF081, + MS_IIINT = (xub_Unicode) 0xF082, + MS_LINT = (xub_Unicode) 0xF083, + MS_LLINT = (xub_Unicode) 0xF084, + MS_LLLINT = (xub_Unicode) 0xF085, + MS_SQRT = (xub_Unicode) 0xF087, + MS_SQRT2 = (xub_Unicode) 0xF089, + MS_COPROD = (xub_Unicode) 0xF08A, + MS_PROD = (xub_Unicode) 0xF08B, + MS_SUM = (xub_Unicode) 0xF08C, + MS_NABLA = (xub_Unicode) 0xF08D, + MS_FORALL = (xub_Unicode) 0xF08E, + + MS_HAT = (xub_Unicode) 0xF090, + MS_CHECK = (xub_Unicode) 0xF091, + MS_BREVE = (xub_Unicode) 0xF092, + MS_ACUTE = (xub_Unicode) 0xF093, + MS_GRAVE = (xub_Unicode) 0xF094, + MS_TILDE = (xub_Unicode) 0xF095, + MS_BAR = (xub_Unicode) 0xF096, + MS_VEC = (xub_Unicode) 0xF097, + MS_DOT = (xub_Unicode) 0xF098, + MS_DDOT = (xub_Unicode) 0xF099, + MS_DDDOT = (xub_Unicode) 0xF09A, + MS_CIRCLE = (xub_Unicode) 0xF09B, + MS_AND = (xub_Unicode) 0xF09C, + MS_OR = (xub_Unicode) 0xF09D, + MS_NI = (xub_Unicode) 0xF09E, + MS_EMPTYSET = (xub_Unicode) 0xF09F, + + MS_LBRACE = (xub_Unicode) 0xF0A0, + MS_RBRACE = (xub_Unicode) 0xF0A1, + MS_LPARENT = (xub_Unicode) 0xF0A2, + MS_RPARENT = (xub_Unicode) 0xF0A3, + MS_LANGLE = (xub_Unicode) 0xF0A4, + MS_RANGLE = (xub_Unicode) 0xF0A5, + MS_LBRACKET = (xub_Unicode) 0xF0A6, + MS_RBRACKET = (xub_Unicode) 0xF0A7, + + MS_LDBRACKET = (xub_Unicode) 0xF0B2, + MS_RDBRACKET = (xub_Unicode) 0xF0B3, + MS_PLACE = (xub_Unicode) 0xF0BF, + + MS_LCEIL = (xub_Unicode) 0xF0C0, + MS_LFLOOR = (xub_Unicode) 0xF0C1, + MS_RCEIL = (xub_Unicode) 0xF0C2, + MS_RFLOOR = (xub_Unicode) 0xF0C3, + MS_SQRT2_X = (xub_Unicode) 0xF0C5, + + MS_TOP = (xub_Unicode) 0xF0F5, + MS_HBAR = (xub_Unicode) 0xF0F6, + MS_LAMBDABAR = (xub_Unicode) 0xF0F7, + MS_LEFTARROW = (xub_Unicode) 0xF0F8, + MS_UPARROW = (xub_Unicode) 0xF0F9, + MS_DOWNARROW = (xub_Unicode) 0xF0FA, + MS_SETN = (xub_Unicode) 0xF0FB, + MS_SETZ = (xub_Unicode) 0xF0FC, + MS_SETQ = (xub_Unicode) 0xF0FD, + MS_SETR = (xub_Unicode) 0xF0FE, + MS_SETC = (xub_Unicode) 0xF0FF +}; + + +#endif + diff --git a/starmath/inc/unomodel.hxx b/starmath/inc/unomodel.hxx new file mode 100644 index 000000000000..b4629caff162 --- /dev/null +++ b/starmath/inc/unomodel.hxx @@ -0,0 +1,139 @@ +/************************************************************************* + * + * $RCSfile: unomodel.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: hr $ $Date: 2000-09-18 16:57:25 $ + * + * 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): _______________________________________ + * + * + ************************************************************************/ +#ifndef UNOMODEL_HXX +#define UNOMODEL_HXX + +#ifndef _COM_SUN_STAR_BEANS_XPROPERTYSET_HPP_ +#include <com/sun/star/beans/XPropertySet.hpp> +#endif +#ifndef _COM_SUN_STAR_LANG_XSERVICEINFO_HPP_ +#include <com/sun/star/lang/XServiceInfo.hpp> +#endif +#ifndef _COM_SUN_STAR_LANG_XUNOTUNNEL_HPP_ +#include <com/sun/star/lang/XUnoTunnel.hpp> +#endif +#ifndef _SFX_SFXBASEMODEL_HXX_ +#include <sfx2/sfxbasemodel.hxx> +#endif +#ifndef _CPPUHELPER_IMPLBASE3_HXX_ +#include <cppuhelper/implbase3.hxx> // helper for implementations +#endif + +struct SfxItemPropertyMap; + +//----------------------------------------------------------------------------- +typedef +cppu::WeakImplHelper3 +< + ::com::sun::star::beans::XPropertySet, + ::com::sun::star::lang::XServiceInfo, + ::com::sun::star::lang::XUnoTunnel +> +SmModelBaseClass; +class SmModel : public SmModelBaseClass, + public SfxBaseModel +{ + + SfxItemPropertyMap* _pMap; + +public: + SmModel( SfxObjectShell *pObjSh = 0 ); + virtual ~SmModel(); + + //XInterface + virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type& aType ) throw(::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL acquire( ) throw(::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL release( ) throw(::com::sun::star::uno::RuntimeException); + + //XTypeProvider + virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes( ) throw(::com::sun::star::uno::RuntimeException); + + static const ::com::sun::star::uno::Sequence< sal_Int8 > & getUnoTunnelId(); + + //XUnoTunnel + virtual sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& aIdentifier ) throw(::com::sun::star::uno::RuntimeException); + + //XPropertySet + virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setPropertyValue( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Any& aValue ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Any SAL_CALL getPropertyValue( const ::rtl::OUString& PropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL addPropertyChangeListener( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& xListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL removePropertyChangeListener( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& aListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL addVetoableChangeListener( const ::rtl::OUString& PropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& aListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL removeVetoableChangeListener( const ::rtl::OUString& PropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& aListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + + //XServiceInfo + virtual rtl::OUString SAL_CALL getImplementationName(void) throw( ::com::sun::star::uno::RuntimeException ); + virtual BOOL SAL_CALL supportsService(const rtl::OUString& ServiceName) throw( ::com::sun::star::uno::RuntimeException ); + virtual ::com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL getSupportedServiceNames(void) throw( ::com::sun::star::uno::RuntimeException ); + + inline ::rtl::OUString SmModel::getImplementationName_Static() throw( ); + + void * SAL_CALL operator new( size_t ) throw(); + void SAL_CALL operator delete( void * ) throw(); +}; + +inline ::rtl::OUString SmModel::getImplementationName_Static() throw( ) +{ + return rtl::OUString::createFromAscii("math.SmModel"); +} + +#endif diff --git a/starmath/inc/utility.hxx b/starmath/inc/utility.hxx new file mode 100644 index 000000000000..bde78f80d4f1 --- /dev/null +++ b/starmath/inc/utility.hxx @@ -0,0 +1,471 @@ +/************************************************************************* + * + * $RCSfile: utility.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: hr $ $Date: 2000-09-18 16:57:25 $ + * + * 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): _______________________________________ + * + * + ************************************************************************/ +#ifndef UTILITY_HXX +#define UTILITY_HXX + +#ifndef _SFXVARARR_HXX //autogen +#include <sfx2/minarray.hxx> +#endif +#ifndef _FONT_HXX //autogen +#include <vcl/font.hxx> +#endif +#ifndef _SV_FIXED_HXX //autogen +#include <vcl/fixed.hxx> +#endif +#ifndef _SV_COMBOBOX_HXX //autogen +#include <vcl/combobox.hxx> +#endif +#ifndef _SV_LSTBOX_HXX //autogen +#include <vcl/lstbox.hxx> +#endif +#ifndef _STREAM_HXX //autogen +#include <tools/stream.hxx> +#endif +#ifndef _FRACT_HXX //autogen +#include <tools/fract.hxx> +#endif + + +class SmRect; +class String; + +#define C2S(cChar) String::CreateFromAscii(RTL_CONSTASCII_STRINGPARAM(cChar)) + +const ByteString ExportString(const String& rString); + + +inline long SmPtsTo100th_mm(long nNumPts) + // returns the length (in 100th of mm) that corresponds to the length + // 'nNumPts' (in units points). + // 72.27 [pt] = 1 [inch] = 2,54 [cm] = 2540 [100th of mm]. + // result is being rounded to the nearest integer. +{ + DBG_ASSERT(nNumPts >= 0, "Sm : Ooops..."); + // broken into multiple and fraction of 'nNumPts' to reduce chance + // of overflow + // (7227 / 2) is added in order to round to the nearest integer + return 35 * nNumPts + (nNumPts * 1055L + (7227 / 2)) / 7227L; +} + + +inline long SmPtsTo100th_mm(const Fraction &rNumPts) + // as above but with argument 'rNumPts' as 'Fraction' +{ + Fraction aTmp (254000L, 7227L); + return aTmp *= rNumPts; +} + + +inline Fraction Sm100th_mmToPts(long nNum100th_mm) + // returns the length (in points) that corresponds to the length + // 'nNum100th_mm' (in 100th of mm). +{ + DBG_ASSERT(nNum100th_mm >= 0, "Sm : Ooops..."); + Fraction aTmp (7227L, 254000L); + return aTmp *= Fraction(nNum100th_mm); +} + + +inline long SmRoundFraction(const Fraction &rFrac) +{ + DBG_ASSERT(rFrac > Fraction(), "Sm : Ooops..."); + return (rFrac.GetNumerator() + rFrac.GetDenominator() / 2) / rFrac.GetDenominator(); +} + + +class SmViewShell; +SmViewShell * SmGetActiveView(); + + +//////////////////////////////////////////////////////////// + +class SmFace; + +SvStream& operator << (SvStream& rStream, const SmFace& rFont); +SvStream& operator >> (SvStream& rStream, SmFace& rFont); + +void ReadSM20Font(SvStream& rStream, Font& rFont); + + +//////////////////////////////////////////////////////////// +// +// SmRectCache +// + +class SmRectCache +{ + VirtualDevice *pVirDev; + + SmRectCache(const SmRectCache &); + SmRectCache & operator = (const SmRectCache &); + +public: + struct Key + { XubString aText, + aFontName; + Size aFontSize; + FontWeight eFontWeight; + FontItalic eFontItalic; + + Key(const XubString &rText, const Font &rFont); + + BOOL operator < (const Key &rKey) const; + BOOL operator == (const Key &rKey) const; + }; + + SmRectCache(); + ~SmRectCache(); + + const SmRect * Search(const Key &rKey) const; + const SmRect * Add(const Key &rKey, const SmRect &rRect); + + VirtualDevice * GetVirDev(); + + void Reset(); +}; + + +//////////////////////////////////////////////////////////// +// +// SmFace +// + + +class SmFace : public Font +{ + long nBorderWidth; + +public: + SmFace() : + Font(), nBorderWidth(-1) {} + SmFace(const Font& rFont) : + Font(rFont), nBorderWidth(-1) { SetSize(GetSize()); } + SmFace(const String& rName, const Size& rSize) : + Font(rName, rSize), nBorderWidth(-1) { SetSize(GetSize()); } + SmFace( FontFamily eFamily, const Size& rSize) : + Font(eFamily, rSize), nBorderWidth(-1) { SetSize(GetSize()); } + + SmFace(const SmFace &rFace) : + Font(rFace), nBorderWidth(-1) { SetSize(GetSize()); } + + // overloaded version in order to supply a min value + // for font size (height). (Also used in ctor's to do so.) + void SetSize(const Size& rSize); + + void SetBorderWidth(long nWidth) { nBorderWidth = nWidth; } + long GetBorderWidth() const; + long GetDefaultBorderWidth() const { return GetSize().Height() / 20 ; } + void FreezeBorderWidth() { nBorderWidth = GetDefaultBorderWidth(); } + + SmFace & operator = (const SmFace &rFace); +}; + +SmFace & operator *= (SmFace &rFace, const Fraction &rFrac); + + +#ifdef NEVER +//////////////////////////////////////////////////////////// +// +// SmInfoText +// + +class SmInfoText : public FixedText +{ +protected: + USHORT nMaxLen; + String aText; + +public: + SmInfoText(Window* pParent, WinBits nWinStyle = 0, USHORT nMax = 128); + SmInfoText(Window* pParent, const ResId& rResId, USHORT nMax = 128); + + void SetText(const String& rStr); + + XubString GetText() const { return (aText); } +}; +#endif + + +//////////////////////////////////////////////////////////// +// +// SmPickList +// + +class SmPickList : public SfxPtrArr +{ +protected: + USHORT nSize; + + virtual void *CreateItem(const String& rString) = 0; + virtual void *CreateItem(const void *pItem) = 0; + virtual void DestroyItem(void *pItem) = 0; + + virtual BOOL CompareItem(const void *pFirstItem, const void *pSecondItem) const = 0; + + virtual String GetStringItem(void *pItem) = 0; + + virtual void LoadItem(SvStream& rStream, void *pItem) = 0; + virtual void SaveItem(SvStream& rStream, const void *pItem) const = 0; + + void *GetPtr(USHORT nPos) const { return SfxPtrArr::GetObject(nPos); } + void *&GetPtr(USHORT nPos) { return SfxPtrArr::GetObject(nPos); } + void InsertPtr(USHORT nPos, void *pItem) { SfxPtrArr::Insert(nPos, pItem); } + void RemovePtr(USHORT nPos, USHORT nCount = 1) { SfxPtrArr::Remove(nPos, nCount); } + +public: + SmPickList(USHORT nInitSize = 0, USHORT nMaxSize = 5); + ~SmPickList(); + + SmPickList& operator = (const SmPickList& rList); + + void *Get(USHORT nPos = 0) const { return GetPtr(nPos); } + void Insert(const void* pItem); + void Update(const void* pItem, const void *pNewItem); + void Remove(const void* pItem); + + void *operator [] (USHORT nPos) const { return GetPtr(nPos); } + + void SetSize(USHORT nNewSize); + USHORT GetSize() const { return nSize; } + USHORT Count() const { return SfxPtrArr::Count(); } + + BOOL Contains(const void *pItem) const; + void Clear(); + + friend SvStream& operator << (SvStream& rStream, const SmPickList& rPickList); + friend SvStream& operator >> (SvStream& rStream, SmPickList& rPickList); +}; + + +//////////////////////////////////////////////////////////// +// +// SmStringPickList +// +#ifdef NEVER +class SmStringPickList : public SmPickList +{ +protected: + virtual void *CreateItem(const String& rString); + virtual void *CreateItem(const void *pItem); + virtual void DestroyItem(void *pItem); + + virtual BOOL CompareItem(const void *pFirstItem, const void *pSecondItem) const; + + virtual String GetStringItem(void *pItem); + + virtual void LoadItem(SvStream& rStream, void *pItem); + virtual void SaveItem(SvStream& rStream, const void *pItem) const; + +public: + SmStringPickList() + : SmPickList(0, 5) {} + SmStringPickList(USHORT nInitSize, USHORT nMaxSize) + : SmPickList(nInitSize, nMaxSize) {} + SmStringPickList(const SmPickList& rOrig ) + : SmPickList(rOrig) {} + ~SmStringPickList() { Clear(); } + + virtual void Insert(const String &rString); + virtual void Update(const String &rString, const String &rNewString); + virtual void Remove(const String &rString); + + inline BOOL Contains(const String &rString) const; + inline String Get(USHORT nPos = 0) const; + + inline SmStringPickList& operator = (const SmStringPickList& rList); + inline String operator [] (USHORT nPos) const; +}; + +inline SmStringPickList& SmStringPickList::operator = (const SmStringPickList& rList) +{ + *(SmPickList *)this = *(SmPickList *)&rList; return *this; +} + +inline String SmStringPickList::operator [] (USHORT nPos) const +{ + return *((String *)SmPickList::operator[](nPos)); +} + +inline String SmStringPickList::Get(USHORT nPos) const +{ + return nPos < Count() ? *((String *)SmPickList::Get(nPos)) : String(); +} + +inline BOOL SmStringPickList::Contains(const String &rString) const +{ + return SmPickList::Contains((void *)&rString); +} +#endif + +//////////////////////////////////////////////////////////// +// +// SmFontPickList +// + +class SmFontDialog; + +class SmFontPickList : public SmPickList +{ +protected: + virtual void *CreateItem(const String& rString); + virtual void *CreateItem(const void *pItem); + virtual void DestroyItem(void *pItem); + + virtual BOOL CompareItem(const void *pFirstItem, const void *pSecondItem) const; + + virtual String GetStringItem(void *pItem); + + virtual void LoadItem(SvStream& rStream, void *pItem); + virtual void SaveItem(SvStream& rStream, const void *pItem) const; + +public: + SmFontPickList() + : SmPickList(0, 5) {} + SmFontPickList(USHORT nInitSize, USHORT nMaxSize) + : SmPickList(nInitSize, nMaxSize) {} + SmFontPickList(const SmPickList& rOrig ) + : SmPickList(rOrig) {} + ~SmFontPickList() { Clear(); } + + virtual void Insert(const Font &rFont); + virtual void Update(const Font &rFont, const Font &rNewFont); + virtual void Remove(const Font &rFont); + + inline BOOL Contains(const Font &rFont) const; + inline Font Get(USHORT nPos = 0) const; + + inline SmFontPickList& operator = (const SmFontPickList& rList); + inline Font operator [] (USHORT nPos) const; + + void ReadFrom(const SmFontDialog& rDialog); + void WriteTo(SmFontDialog& rDialog) const; +}; + +inline SmFontPickList& SmFontPickList::operator = (const SmFontPickList& rList) +{ + *(SmPickList *)this = *(SmPickList *)&rList; return *this; +} + +inline Font SmFontPickList::operator [] (USHORT nPos) const +{ + return *((Font *)SmPickList::operator[](nPos)); +} + +inline Font SmFontPickList::Get(USHORT nPos) const +{ + return nPos < Count() ? *((Font *)SmPickList::Get(nPos)) : Font(); +} + +inline BOOL SmFontPickList::Contains(const Font &rFont) const +{ + return SmPickList::Contains((void *)&rFont); +} + + +//////////////////////////////////////////////////////////// +// +// SmStringPickComboBox +// +#ifdef NEVER +class SmStringPickComboBox : public SmStringPickList, public ComboBox +{ +protected: + virtual void LoseFocus(); + + DECL_LINK(SelectHdl, ComboBox *); + +public: + SmStringPickComboBox(Window* pParent, WinBits nWinStyle = 0, USHORT nMax = 4); + SmStringPickComboBox(Window* pParent, const ResId& rResId, USHORT nMax = 4); + + SmStringPickComboBox& operator = (const SmStringPickList& rList); + + void SetText(const String& rStr); + + virtual void Insert(const String &rString); + virtual void Update(const String &rString, const String &rNewString); + virtual void Remove(const String &rString); +}; +#endif + +//////////////////////////////////////////////////////////// +// +// SmFontPickListBox +// + +class SmFontPickListBox : public SmFontPickList, public ListBox +{ +protected: + DECL_LINK(SelectHdl, ListBox *); + +public: + SmFontPickListBox(Window* pParent, WinBits nWinStyle = 0, USHORT nMax = 4); + SmFontPickListBox(Window* pParent, const ResId& rResId, USHORT nMax = 4); + + SmFontPickListBox& operator = (const SmFontPickList& rList); + + virtual void Insert(const Font &rFont); + virtual void Update(const Font &rFont, const Font &rNewFont); + virtual void Remove(const Font &rFont); +}; + +#endif + diff --git a/starmath/inc/view.hxx b/starmath/inc/view.hxx new file mode 100644 index 000000000000..34a2cd4f19d9 --- /dev/null +++ b/starmath/inc/view.hxx @@ -0,0 +1,313 @@ +/************************************************************************* + * + * $RCSfile: view.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: hr $ $Date: 2000-09-18 16:57:25 $ + * + * 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): _______________________________________ + * + * + ************************************************************************/ +#ifndef VIEW_HXX +#define VIEW_HXX + + +#ifndef _SFXDOCKWIN_HXX //autogen +#include <sfx2/dockwin.hxx> +#endif +#ifndef _SFXVIEWSH_HXX //autogen +#include <sfx2/viewsh.hxx> +#endif +#ifndef _SCRWIN_HXX //autogen +#include <svtools/scrwin.hxx> +#endif +#ifndef _SFXCTRLITEM_HXX //autogen +#include <sfx2/ctrlitem.hxx> +#endif +#ifndef _SFX_SHELL_HXX //autogen +#include <sfx2/shell.hxx> +#endif +#ifndef _VIEWFAC_HXX //autogen +#include <sfx2/viewfac.hxx> +#endif +#ifndef _SFXVIEWFRM_HXX //autogen +#include <sfx2/viewfrm.hxx> +#endif + +#ifndef EDIT_HXX +#include "edit.hxx" +#endif + +#ifndef NODE_HXX +#include "node.hxx" +#endif + +class Menu; +class DataChangedEvent; +class SmDocShell; +class SmViewShell; + +/**************************************************************************/ + +class SmGraphicWindow: public ScrollableWindow +{ + Point aFormulaDrawPos; + Rectangle aCursorRect; + SmViewShell *pViewShell; + USHORT nZoom; + short nModifyCount; + BOOL bIsCursorVisible; + +protected: + void SetFormulaDrawPos(const Point &rPos) { aFormulaDrawPos = rPos; } + Point GetFormulaDrawPos() const { return aFormulaDrawPos; } + void SetIsCursorVisible(BOOL bVis) { bIsCursorVisible = bVis; } + void SetCursor(const SmNode *pNode); + void SetCursor(const Rectangle &rRect); + + virtual void DataChanged( const DataChangedEvent& ); + virtual void Paint(const Rectangle&); + virtual void KeyInput(const KeyEvent& rKEvt); + virtual void Command(const CommandEvent& rCEvt); + virtual void StateChanged( StateChangedType eChanged ); + DECL_LINK(MenuSelectHdl, Menu *); + +public: + SmGraphicWindow(SmViewShell* pShell); + + virtual void MouseButtonDown(const MouseEvent &rMEvt); + + void SetZoom(USHORT Factor); + USHORT GetZoom() const { return nZoom; } + + void ZoomToFitInWindow(); + void SetTotalSize(); + + BOOL IsCursorVisible() const { return bIsCursorVisible; } + void ShowCursor(BOOL bShow); + const SmNode * SetCursorPos(USHORT nRow, USHORT nCol); +}; + +/**************************************************************************/ + +class SmGraphicController: public SfxControllerItem +{ +protected: + SmGraphicWindow &rGraphic; +public: + SmGraphicController(SmGraphicWindow &, USHORT, SfxBindings & ); + virtual void StateChanged(USHORT nSID, + SfxItemState eState, + const SfxPoolItem* pState); +}; + +/**************************************************************************/ + +class SmEditController: public SfxControllerItem +{ +protected: + SmEditWindow &rEdit; + +public: + SmEditController(SmEditWindow &, USHORT, SfxBindings & ); + virtual void StateChanged(USHORT nSID, + SfxItemState eState, + const SfxPoolItem* pState); +}; + +/**************************************************************************/ + +class SmCmdBoxWindow : public SfxDockingWindow +{ + SmEditWindow aEdit; + SmEditController aController; + Timer aGrabTimer; + + virtual void Resize(); + virtual void Paint(const Rectangle& rRect); + virtual Size CalcDockingSize(SfxChildAlignment eAlign); + virtual SfxChildAlignment CheckAlignment(SfxChildAlignment eActual, + SfxChildAlignment eWish); + +protected : + DECL_LINK(UpdateTimeoutHdl, Timer *); + +public: + SmCmdBoxWindow(SfxBindings *pBindings, + SfxChildWindow *pChildWindow, + Window *pParent); + + virtual ~SmCmdBoxWindow (); + + void AdjustPosition(); + + SmEditWindow *GetEditWindow() { return (&aEdit); } + + void ShowWindows (); + + void RestartFocusTimer () + { + aGrabTimer.SetTimeout (100); + aGrabTimer.Start (); + } + + virtual void ToggleFloatingMode(); + + // Window + virtual void StateChanged( StateChangedType nStateChange ); + + void Grab (); + +}; + +/**************************************************************************/ + +class SmCmdBoxWrapper : public SfxChildWindow +{ + SFX_DECL_CHILDWINDOW(SmCmdBoxWrapper); + +protected: + SmCmdBoxWrapper(Window *pParentWindow, + USHORT nId, + SfxBindings *pBindings, + SfxChildWinInfo *pInfo); + +public: + Size aSize; + + SmEditWindow *GetEditWindow() + { + return (((SmCmdBoxWindow *)pWindow)->GetEditWindow()); + } + + void RestartFocusTimer () + { + ((SmCmdBoxWindow *)pWindow)->RestartFocusTimer (); + } + +// virtual void FillInfo(SfxChildWinInfo &rInfo) const; + + void Grab (); +}; + +/**************************************************************************/ + +class SmViewShell: public SfxViewShell +{ + SmGraphicWindow aGraphic; + SmGraphicController aGraphicController; + String StatusText; + Window *pViewFrame; + +protected: + + Size GetTextLineSize(OutputDevice& rDevice, + const String& rLine); + Size GetTextSize(OutputDevice& rDevice, + const String& rText, + long MaxWidth); + void DrawTextLine(OutputDevice& rDevice, + const Point& rPosition, + const String& rLine); + void DrawText(OutputDevice& rDevice, + const Point& rPosition, + const String& rText, + USHORT MaxWidth); + + virtual USHORT Print(SfxProgress &rProgress, + PrintDialog *pPrintDialog = 0); + virtual SfxPrinter *GetPrinter(BOOL bCreate = FALSE); + virtual USHORT SetPrinter(SfxPrinter *pNewPrinter, + USHORT nDiffFlags = SFX_PRINTER_ALL); + + virtual SfxTabPage *CreatePrintOptionsPage(Window *pParent, + const SfxItemSet &rOptions); + virtual void Deactivate(BOOL IsMDIActivate); + virtual void Activate(BOOL IsMDIActivate); + virtual Size GetOptimalSizePixel() const; + virtual void AdjustPosSizePixel(const Point &rPos, const Size &rSize); + virtual void InnerResizePixel(const Point &rOfs, const Size &rSize); + virtual void OuterResizePixel(const Point &rOfs, const Size &rSize); + virtual void QueryObjAreaPixel( Rectangle& rRect ) const; + virtual void SetZoomFactor( const Fraction &rX, const Fraction &rY ); + +public: + TYPEINFO(); + + SmDocShell * GetDoc() + { + return (SmDocShell *) GetViewFrame()->GetObjectShell(); + } + + SmEditWindow * GetEditWindow(); + SmGraphicWindow & GetGraphicWindow() { return aGraphic; } + const SmGraphicWindow & GetGraphicWindow() const { return aGraphic; } + + void SetStatusText(const String& Text); + + void ShowError( const SmErrorDesc *pErrorDesc ); + void NextError(); + void PrevError(); + + SFX_DECL_INTERFACE(SFX_INTERFACE_SMA_START+2); + SFX_DECL_VIEWFACTORY(SmViewShell); + + virtual void Execute( SfxRequest& rReq ); + virtual void GetState(SfxItemSet &); + + SmViewShell(SfxViewFrame *pFrame, SfxViewShell *pOldSh); + ~SmViewShell(); +}; + +#endif + |