1 : /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 : /* ***** BEGIN LICENSE BLOCK *****
3 : * Version: MPL 1.1/GPL 2.0/LGPL 2.1
4 : *
5 : * The contents of this file are subject to the Mozilla Public License Version
6 : * 1.1 (the "License"); you may not use this file except in compliance with
7 : * the License. You may obtain a copy of the License at
8 : * http://www.mozilla.org/MPL/
9 : *
10 : * Software distributed under the License is distributed on an "AS IS" basis,
11 : * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
12 : * for the specific language governing rights and limitations under the
13 : * License.
14 : *
15 : * The Original Code is Mozilla MathML Project.
16 : *
17 : * The Initial Developer of the Original Code is
18 : * The University Of Queensland.
19 : * Portions created by the Initial Developer are Copyright (C) 1999
20 : * the Initial Developer. All Rights Reserved.
21 : *
22 : * Contributor(s):
23 : * Roger B. Sidje <rbs@maths.uq.edu.au>
24 : * David J. Fiddes <D.J.Fiddes@hw.ac.uk>
25 : * Vilya Harvey <vilya@nag.co.uk>
26 : * Shyjan Mahamud <mahamud@cs.cmu.edu>
27 : * Karl Tomlinson <karlt+@karlt.net>, Mozilla Corporation
28 : *
29 : * Alternatively, the contents of this file may be used under the terms of
30 : * either of the GNU General Public License Version 2 or later (the "GPL"),
31 : * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
32 : * in which case the provisions of the GPL or the LGPL are applicable instead
33 : * of those above. If you wish to allow use of your version of this file only
34 : * under the terms of either the GPL or the LGPL, and not to allow others to
35 : * use your version of this file under the terms of the MPL, indicate your
36 : * decision by deleting the provisions above and replace them with the notice
37 : * and other provisions required by the GPL or the LGPL. If you do not delete
38 : * the provisions above, a recipient may use your version of this file under
39 : * the terms of any one of the MPL, the GPL or the LGPL.
40 : *
41 : * ***** END LICENSE BLOCK ***** */
42 :
43 : #include "nsMathMLmsqrtFrame.h"
44 :
45 : //
46 : // <msqrt> -- form a radical - implementation
47 : //
48 :
49 : //NOTE:
50 : // The code assumes that TeX fonts are picked.
51 : // There is no fall-back to draw the branches of the sqrt explicitly
52 : // in the case where TeX fonts are not there. In general, there are no
53 : // fall-back(s) in MathML when some (freely-downloadable) fonts are missing.
54 : // Otherwise, this will add much work and unnecessary complexity to the core
55 : // MathML engine. Assuming that authors have the free fonts is part of the
56 : // deal. We are not responsible for cases of misconfigurations out there.
57 :
58 : nsIFrame*
59 0 : NS_NewMathMLmsqrtFrame(nsIPresShell* aPresShell, nsStyleContext* aContext)
60 : {
61 0 : return new (aPresShell) nsMathMLmsqrtFrame(aContext);
62 : }
63 :
64 0 : NS_IMPL_FRAMEARENA_HELPERS(nsMathMLmsqrtFrame)
65 :
66 0 : nsMathMLmsqrtFrame::nsMathMLmsqrtFrame(nsStyleContext* aContext) :
67 0 : nsMathMLmencloseFrame(aContext)
68 : {
69 0 : }
70 :
71 0 : nsMathMLmsqrtFrame::~nsMathMLmsqrtFrame()
72 : {
73 0 : }
74 :
75 : NS_IMETHODIMP
76 0 : nsMathMLmsqrtFrame::Init(nsIContent* aContent,
77 : nsIFrame* aParent,
78 : nsIFrame* aPrevInFlow)
79 : {
80 0 : nsresult rv = nsMathMLContainerFrame::Init(aContent, aParent, aPrevInFlow);
81 0 : AllocateMathMLChar(NOTATION_RADICAL);
82 0 : mNotationsToDraw |= NOTATION_RADICAL;
83 :
84 0 : return rv;
85 : }
86 :
87 : NS_IMETHODIMP
88 0 : nsMathMLmsqrtFrame::InheritAutomaticData(nsIFrame* aParent)
89 : {
90 0 : nsMathMLContainerFrame::InheritAutomaticData(aParent);
91 :
92 0 : mPresentationData.flags |= NS_MATHML_STRETCH_ALL_CHILDREN_VERTICALLY;
93 :
94 0 : return NS_OK;
95 : }
96 :
97 : NS_IMETHODIMP
98 0 : nsMathMLmsqrtFrame::AttributeChanged(PRInt32 aNameSpaceID,
99 : nsIAtom* aAttribute,
100 : PRInt32 aModType)
101 : {
102 : return nsMathMLContainerFrame::
103 0 : AttributeChanged(aNameSpaceID, aAttribute, aModType);
104 : }
|