~pac72/ubuntu/lucid/ddd/devel

« back to all changes in this revision

Viewing changes to ddd/StringBox.C

  • Committer: Bazaar Package Importer
  • Author(s): Daniel Schepler
  • Date: 2004-07-22 03:49:37 UTC
  • mfrom: (1.2.1 upstream) (2.1.1 warty)
  • Revision ID: james.westby@ubuntu.com-20040722034937-cysl08t1jvba4jrx
Tags: 1:3.3.9-3
USERINFO has been renamed to USERINFO.txt; adjust debian/rules code
to match, to get correct information on the About DDD dialog.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
// $Id: StringBox.C,v 1.13 2000/12/11 12:21:47 zeller Exp $ 
 
1
// $Id$ 
2
2
// StringBox class
3
3
 
4
4
// Copyright (C) 1995 Technische Universitaet Braunschweig, Germany.
27
27
// or send a mail to the DDD developers <ddd@gnu.org>.
28
28
 
29
29
char StringBox_rcsid[] = 
30
 
    "$Id: StringBox.C,v 1.13 2000/12/11 12:21:47 zeller Exp $";
31
 
 
32
 
#ifdef __GNUG__
33
 
#pragma implementation
34
 
#endif
35
 
 
 
30
    "$Id$";
36
31
 
37
32
#include "StringBox.h"
38
33
#include "printBox.h"
44
39
#include <X11/Xlib.h>
45
40
#include <X11/Intrinsic.h>
46
41
#include <ctype.h>
47
 
#include <strstream.h>
 
42
#include <sstream>
48
43
 
49
44
#include "VSEFlags.h"
50
45
 
102
97
}
103
98
 
104
99
 
105
 
void StringBox::dump(ostream& s) const
 
100
void StringBox::dump(std::ostream& s) const
106
101
{
107
102
    const char *quote = "\"";
108
103
    if (StringBox::quoted)
125
120
void StringBox::newFont(const string& fontname)
126
121
{
127
122
    _fontname = fontname;
 
123
    newFont();
 
124
}
 
125
 
 
126
void StringBox::newFont()
 
127
{
128
128
    if (fontTable != 0)
129
129
        _newFont((*fontTable)[_fontname]);
130
130
}
137
137
} FONTMAP ;
138
138
 
139
139
// mapping between X11 fonts, PostScript fonts and xfig font numbers
140
 
static FONTMAP map[] = {
 
140
static FONTMAP const map[] = {
141
141
{"fixed",                                "/Courier",                     12},
142
142
{"-*-times-medium-r-*-",                 "/Times-Roman",                  0},
143
143
{"-*-times-medium-*-*-",                 "/Times-Italic",                 1},
168
168
 * matchFont
169
169
 */
170
170
 
171
 
static FONTMAP *matchFont(const char *xfont) 
 
171
static const FONTMAP *matchFont(const char *xfont) 
172
172
{
173
 
    FONTMAP *fmap = &map[0] ;
 
173
    const FONTMAP *fmap = &map[0] ;
174
174
    int match = 1;
175
175
    int i = 0;
176
176
    
185
185
}
186
186
 
187
187
 
188
 
void StringBox::_print(ostream& os, 
 
188
void StringBox::_print(std::ostream& os, 
189
189
                       const BoxRegion& region, 
190
190
                       const PrintGC& gc) const
191
191
{
192
192
    // Don't draw empty strings
193
 
    if (str() == "")
 
193
    if (str().empty())
194
194
        return;
195
195
 
196
196
    BoxPoint origin = region.origin() ;
197
 
    FONTMAP *fmap = matchFont (fontName_c());
 
197
    const FONTMAP *fmap = matchFont (fontName_c());
198
198
 
199
199
    if (gc.isFig()) {
200
200
        os << TEXTHEAD1 << fmap->figfont << " "