]> git.lyx.org Git - lyx.git/blob - src/mathed/math_atom.C
use stream-like syntax for LaTeX output
[lyx.git] / src / mathed / math_atom.C
1 /*
2  *  File:        math_inset.C
3  *  Purpose:     Implementation of insets for mathed
4  *  Author:      Alejandro Aguilar Sierra <asierra@servidor.unam.mx> 
5  *  Created:     January 1996
6  *  Description: 
7  *
8  *  Dependencies: Xlib, XForms
9  *
10  *  Copyright: 1996, 1997 Alejandro Aguilar Sierra
11  *
12  *   Version: 0.8beta.
13  *
14  *   You are free to use and modify this code under the terms of
15  *   the GNU General Public Licence version 2 or later.
16  */
17
18 #ifdef __GNUG__
19 #pragma implementation
20 #endif
21
22 #include "math_atom.h"
23 #include "math_inset.h"
24 #include "support/LAssert.h"
25
26
27 MathAtom::MathAtom()
28         : nucleus_(0)
29 {}
30
31
32 MathAtom::MathAtom(MathInset * p)
33         : nucleus_(p)
34 {}
35
36
37 MathAtom::MathAtom(MathAtom const & p)
38 {
39         copy(p);
40 }
41
42
43 void MathAtom::operator=(MathAtom const & p)
44 {
45         if (this != &p) {
46                 done();
47                 copy(p);
48         }
49 }
50
51
52 MathAtom::~MathAtom()
53 {
54         done();
55 }
56
57
58 void MathAtom::done()
59 {
60         delete nucleus_;
61 }
62
63
64 void MathAtom::copy(MathAtom const & p)
65 {
66         //cerr << "calling MathAtom::copy\n";
67         nucleus_   = p.nucleus_;
68         if (nucleus_)
69                 nucleus_ = nucleus_->clone();
70 }
71
72
73 MathInset * MathAtom::nucleus() const
74 {
75         lyx::Assert(nucleus_);
76         return nucleus_;
77 }
78
79
80 MathInset * MathAtom::operator->() const
81 {
82         return nucleus();
83 }
84
85 /*
86 void MathAtom::userSetSize(MathStyles sz)
87 {
88         if (sz >= 0) {
89                 size_ = sz;      
90                 flag = flag & ~LMPF_FIXED_SIZE;
91         }
92 }
93 */