* generate the bullets in the bullet-panel's.
*
* This file is part of
- *======================================================
+ * ======================================================
*
* LyX, The Document Processor
*
- * Copyright (C) 1997-1998 Allan Rae
+ * Copyright 1997-1998 Allan Rae
* and the LyX Team
*
- *======================================================*/
+ * ====================================================== */
#include <config.h>
#include "Bullet.h"
+/** The four LaTeX itemize environment default bullets
+ */
+extern
+Bullet const ITEMIZE_DEFAULTS[4] = { Bullet( 0, 8 ),//"\\(\\bullet\\)"
+ Bullet( 0, 0 ),//"\\normalfont\\bfseries{--}"
+ Bullet( 0, 6 ),//"\\(\\ast\\)"
+ Bullet( 0, 10 ) };//"\\(\\cdot\\)"
+
// will need these later if still using full text as below
// \usepackage{latexsym,pifont,amssymb}
// and wasysym when that panel is created
-Bullet::Bullet(const int f, const int c, const int s)
+Bullet::Bullet(int f, int c, int s)
: font(f), character(c), size(s), user_text(0)
{
if (f < MIN || f >= FONTMAX) {
size = MIN;
}
generateText();
-#ifdef DEBUG_AS_DEFAULT
+#ifdef ENABLE_ASSERTIONS
testInvariant();
#endif
}
-string Bullet::getText()
+string const & Bullet::getText() const
{
if (user_text == 0) {
generateText();
/*--------------------Private Member Functions-------------------*/
-void Bullet::generateText()
+void Bullet::generateText() const
{
// Assumption:
// user hasn't defined their own text and/or I haven't generated
}
-const string & Bullet::bulletSize(const short & s)
+string Bullet::bulletSize(short int s)
{
// use a parameter rather than hard code `size' in here
// in case some future function may want to retrieve
// an arbitrary entry.
// See additional comments in bulletEntry() below.
- static string const BulletSize[SIZEMAX] = {
+ static char const * BulletSize[SIZEMAX] = {
"\\tiny", "\\scriptsize", "\\footnotesize", "\\small", "\\normalsize",
"\\large", "\\Large", "\\LARGE", "\\huge", "\\Huge"
};
}
-const string & Bullet::bulletEntry(const short & f, const short & c)
+string Bullet::bulletEntry(short int f, short int c)
{
// Despite how this may at first appear the static local variables
// are only initialized once..
// The single 2-dim array had to be changed to multiple 1-dim arrays
// to get around a compiler bug in an earler version of gcc (< 2.7.2.1)
// static string const BulletPanels[FONTMAX][CHARMAX] = {
- static string const BulletPanel0[CHARMAX] = {
+ static char const * BulletPanel0[CHARMAX] = {
/* standard */
"\\normalfont\\bfseries{--}", "\\(\\vdash\\)",
"\\(\\dashv\\)", "\\(\\flat\\)", "\\(\\natural\\)",
"\\(\\rightharpoonup\\)", "\\(\\rightharpoondown\\)",
"\\(\\Rightarrow\\)", "\\(\\succ\\)"
};
- static string const BulletPanel1[CHARMAX] = {
+ static char const * BulletPanel1[CHARMAX] = {
/* amssymb */
"\\(\\Rrightarrow\\)", "\\(\\rightarrowtail\\)",
"\\(\\twoheadrightarrow\\)", "\\(\\rightsquigarrow\\)",
"\\(\\blacktriangledown\\)", "\\(\\blacklozenge\\)",
"\\(\\blacksquare\\)"
};
- static string const BulletPanel2[CHARMAX] = {
+ static char const * BulletPanel2[CHARMAX] = {
/* psnfss1 */
"\\ding{108}", "\\ding{109}",
"\\ding{119}", "\\Pisymbol{psy}{197}",
"\\ding{166}", "\\ding{167}",
"\\ding{226}", "\\ding{227}"
};
- static string const BulletPanel3[CHARMAX] = {
+ static char const * BulletPanel3[CHARMAX] = {
/* psnfss2 */
"\\ding{37}", "\\ding{38}",
"\\ding{34}", "\\ding{36}",
"\\ding{171}", "\\ding{168}",
"\\ding{169}", "\\ding{170}"
};
- static string const BulletPanel4[CHARMAX] = {
+ static char const * BulletPanel4[CHARMAX] = {
/* psnfss3 */
"\\ding{65}", "\\ding{76}",
"\\ding{75}", "\\ding{72}",
"\\ding{102}", "\\ding{96}",
"\\ding{95}", "\\ding{97}"
};
- static string const BulletPanel5[CHARMAX] = {
+ static char const * BulletPanel5[CHARMAX] = {
/* psnfss4 */
"\\ding{223}", "\\ding{224}",
"\\ding{225}", "\\ding{232}",
"\\ding{231}", "\\Pisymbol{psy}{45}"
}; /* string const BulletPanels[][] */
- static string const * BulletPanels[FONTMAX] = {
+ static char const ** BulletPanels[FONTMAX] = {
BulletPanel0, BulletPanel1,
BulletPanel2, BulletPanel3,
BulletPanel4, BulletPanel5