]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/math_macro.h
Hopefully fix the problem with stateText() in lyxfont.C
[lyx.git] / src / mathed / math_macro.h
index 7c25643a0cfa13ddf228ea619bebccee5276c37f..b0f062f7b0b7cbec9dc5b54ce81a12615de2e5ae 100644 (file)
@@ -8,7 +8,7 @@
  *
  *  Dependencies: Mathed
  *
- *  Copyright: (c) 1996, 1997 Alejandro Aguilar Sierra
+ *  Copyright: 1996, 1997 Alejandro Aguilar Sierra
  *
  *   Version: 0.2, Mathed & Lyx project.
  *
@@ -35,10 +35,12 @@ class MathMacroTemplate;
 /// This class contains the data for a macro
 class MathMacro : public MathParInset
 {
- public:
+public:
     /// A macro can only be builded from an existing template
+       explicit
     MathMacro(MathMacroTemplate *);
     /// or from another macro.
+       explicit
     MathMacro(MathMacro *);
        ///
     ~MathMacro();
@@ -49,9 +51,7 @@ class MathMacro : public MathParInset
        ///
     MathedInset * Clone();
        ///
-    void Write(ostream &);
-       ///
-    void Write(string &);
+    void Write(std::ostream &, bool fragile);
        ///
     bool setArgumentIdx(int);
        ///
@@ -75,7 +75,7 @@ class MathMacro : public MathParInset
        ///
     bool Permit(short);
     
- private:
+private:
        ///
        MathMacroTemplate * tmplate;
        ///
@@ -102,15 +102,15 @@ class MathMacro : public MathParInset
 
 
 /// An argument
-class MathMacroArgument: public MathParInset
-{
- public:
+class MathMacroArgument: public MathParInset {
+public:
     ///
     MathMacroArgument() { expnd_mode = false; number = 1;  SetType(LM_OT_MACRO_ARG); }
     ///
+       explicit
     MathMacroArgument(int);
     ///
-       ~MathMacroArgument() { lyxerr << "help, destroyme!" << endl; }
+       ~MathMacroArgument() { lyxerr << "help, destroyme!" << std::endl; }
     ///
     MathedInset * Clone() { return this; }
        ///
@@ -118,17 +118,14 @@ class MathMacroArgument: public MathParInset
        ///
     void draw(Painter &, int x, int baseline);
        ///
-    void Write(ostream &);
-       ///
-    void Write(string &);
+    void Write(std::ostream &, bool fragile);
     ///
     void setNumber(int n) { number = n; }
     /// Is expanded or not
     void setExpand(bool e) { expnd_mode = e; }
     /// Is expanded or not
     bool getExpand() { return expnd_mode; }
-    
- private:
+private:
        ///
     bool expnd_mode;
        ///
@@ -137,10 +134,10 @@ class MathMacroArgument: public MathParInset
 
 
 /// This class contains the macro definition
-class MathMacroTemplate: public MathParInset
-{
- public:
+class MathMacroTemplate: public MathParInset {
+public:
     /// A template constructor needs all the data
+       explicit
     MathMacroTemplate(char const *, int na = 0, int f = 0);
        ///
     ~MathMacroTemplate();
@@ -149,9 +146,7 @@ class MathMacroTemplate: public MathParInset
        ///
     void Metrics();
        ///
-    void WriteDef(ostream &);
-       ///
-    void WriteDef(string &); 
+    void WriteDef(std::ostream &, bool fragile);
     /// useful for special insets
     void  setTCode(MathedTextCodes t) { tcode = t; }
     ///
@@ -172,7 +167,7 @@ class MathMacroTemplate: public MathParInset
     /// Replace the appropriate arguments with a specific macro's data
     void update(MathMacro * m = 0);
       
- private:
+private:
     ///
     short flags;
     ///
@@ -192,10 +187,10 @@ typedef MathMacro * MathMacroP;
 typedef MathMacroTemplate * MathMacroTemplateP;
 
 ///
-class MathMacroTable 
-{
- public:
+class MathMacroTable {
+public:
        ///
+       explicit
     MathMacroTable(int);
        ///
     ~MathMacroTable();
@@ -212,7 +207,7 @@ class MathMacroTable
        ///
     static bool built;
     
- private:
+private:
        ///
     const int max_macros;
        ///
@@ -264,10 +259,10 @@ void MathMacro::SetData(LyxArrayBase * a)
 
 inline 
 MathMacro * MathMacroTable::getMacro(char const * name) const
- {
-     MathMacroTemplate * mt = getTemplate(name);
-     return (mt) ? new MathMacro(mt): 0;
- }
+{
+       MathMacroTemplate * mt = getTemplate(name);
+       return (mt) ? new MathMacro(mt): 0;
+}
 
 
 #endif