~ubuntu-branches/debian/squeeze/stella/squeeze

« back to all changes in this revision

Viewing changes to src/gui/AboutDialog.cxx

  • Committer: Bazaar Package Importer
  • Author(s): Stephen Kitt
  • Date: 2010-07-12 23:49:36 UTC
  • mfrom: (1.1.4 upstream)
  • Revision ID: james.westby@ubuntu.com-20100712234936-juawrr3etzhr2qpv
Tags: 3.1.2-1
* New maintainer (closes: #532039).
* New upstream version (closes: #461121):
  - includes launcher (closes: #396058).
* Fix the reference to the X Window System in the description (closes:
  #411815).
* Move to main, DFSG-free ROMs are available (see README.Debian).
* Enhance the package description.
* Drop the libslang2-dev dependency (closes: #560274).
* Remove the Encoding entry from stella.desktop.
* Avoid ignoring errors when cleaning.
* Add ${misc:Depends} to the package dependencies.
* Provide a doc-base file to install the documentation using doc-base.
* Switch to debhelper 7 with a simplified rules file.
* Use autotools-dev to provide updated configuration files.
* Update to Standards-Version 3.9.0:
  - Move to menu section Applications/Emulators.
  - Move the homepage declaration.
* Re-write the manpage.

Show diffs side-by-side

added added

removed removed

Lines of Context:
8
8
//  SS  SS   tt   ee      ll   ll  aa  aa
9
9
//   SSSS     ttt  eeeee llll llll  aaaaa
10
10
//
11
 
// Copyright (c) 1995-2008 by Bradford W. Mott and the Stella team
 
11
// Copyright (c) 1995-2010 by Bradford W. Mott, Stephen Anthony
 
12
// and the Stella Team
12
13
//
13
 
// See the file "license" for information on usage and redistribution of
 
14
// See the file "License.txt" for information on usage and redistribution of
14
15
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
15
16
//
16
 
// $Id: AboutDialog.cxx,v 1.24 2008/03/23 16:22:45 stephena Exp $
 
17
// $Id: AboutDialog.cxx 2001 2010-04-10 21:37:23Z stephena $
17
18
//
18
19
//   Based on code from ScummVM - Scumm Interpreter
19
20
//   Copyright (C) 2002-2004 The ScummVM project
26
27
 
27
28
#include "AboutDialog.hxx"
28
29
 
29
 
#define ADD_ATEXT(d) do { dsc[i] = d; i++; } while(0)
30
 
#define ADD_ALINE ADD_ATEXT("")
31
 
 
32
30
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
33
31
AboutDialog::AboutDialog(OSystem* osystem, DialogContainer* parent,
34
 
                         const GUI::Font& font, int x, int y, int w, int h)
35
 
    : Dialog(osystem, parent, x, y, w, h),
36
 
      myPage(1),
37
 
      myNumPages(6)
 
32
                         const GUI::Font& font)
 
33
  : Dialog(osystem, parent, 0, 0, 0, 0),
 
34
    myPage(1),
 
35
    myNumPages(5)
38
36
{
 
37
  const int lineHeight   = font.getLineHeight(),
 
38
            fontWidth    = font.getMaxCharWidth(),
 
39
            fontHeight   = font.getFontHeight(),
 
40
            buttonWidth  = font.getStringWidth("Defaults") + 20,
 
41
            buttonHeight = font.getLineHeight() + 4;
 
42
  int xpos, ypos;
39
43
  WidgetArray wid;
40
44
 
 
45
  // Set real dimensions
 
46
  _w = 52 * fontWidth + 8;
 
47
  _h = 11 * lineHeight + 20;
 
48
 
41
49
  // Add Previous, Next and Close buttons
42
 
  myPrevButton = addButton(font, 10, h - 24, "Previous", kPrevCmd);
 
50
  xpos = 10;  ypos = _h - buttonHeight - 10;
 
51
  myPrevButton =
 
52
    new ButtonWidget(this, font, xpos, ypos, buttonWidth, buttonHeight,
 
53
                     "Previous", kPrevCmd);
43
54
  myPrevButton->clearFlags(WIDGET_ENABLED);
44
55
  wid.push_back(myPrevButton);
45
56
 
46
 
  myNextButton = addButton(font, (kButtonWidth + 15), h - 24,
47
 
                           "Next", kNextCmd);
 
57
  xpos += buttonWidth + 7;
 
58
  myNextButton =
 
59
    new ButtonWidget(this, font, xpos, ypos, buttonWidth, buttonHeight,
 
60
                     "Next", kNextCmd);
48
61
  wid.push_back(myNextButton);
49
62
 
50
 
  ButtonWidget* b = addButton(font, w - (kButtonWidth + 10), h - 24,
51
 
                              "Close", kCloseCmd);
 
63
  xpos = _w - buttonWidth - 10;
 
64
  ButtonWidget* b =
 
65
    new ButtonWidget(this, font, xpos, ypos, buttonWidth, buttonHeight,
 
66
                     "Close", kCloseCmd);
52
67
  wid.push_back(b);
53
68
  addOKWidget(b);  addCancelWidget(b);
54
69
 
55
 
  myTitle = new StaticTextWidget(this, font, 5, 5, w - 10, font.getFontHeight(),
 
70
  xpos = 5;  ypos = 5;
 
71
  myTitle = new StaticTextWidget(this, font, xpos, ypos, _w - 10, fontHeight,
56
72
                                 "", kTextAlignCenter);
57
73
  myTitle->setTextColor(kTextColorEm);
58
74
 
59
 
  for(int i = 0; i < LINES_PER_PAGE; i++)
 
75
  xpos = 10;  ypos += lineHeight + 4;
 
76
  for(int i = 0; i < kLINES_PER_PAGE; i++)
60
77
  {
61
 
    myDesc[i] = new StaticTextWidget(this, font, 10, 18 + (10 * i), w - 20,
62
 
                                     font.getFontHeight(), "", kTextAlignLeft);
 
78
    myDesc[i] = new StaticTextWidget(this, font, xpos, ypos, _w - 20,
 
79
                                     fontHeight, "", kTextAlignLeft);
 
80
    ypos += fontHeight;
63
81
  }
64
82
 
65
83
  addToFocusList(wid);
80
98
//                  4 background (black)
81
99
//                  5 emphasized text (red)
82
100
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
83
 
void AboutDialog::updateStrings(int page, int lines, string& title, string* &dsc)
 
101
void AboutDialog::updateStrings(int page, int lines, string& title)
84
102
{
85
 
  dsc = new string[lines];
 
103
#define ADD_ATEXT(d) do { myDescStr[i] = d; i++; } while(0)
 
104
#define ADD_ALINE ADD_ATEXT("")
86
105
 
87
106
  int i = 0;
88
107
  switch(page)
90
109
    case 1:
91
110
      title = string("Stella ") + STELLA_VERSION;
92
111
      ADD_ATEXT("\\CA multi-platform Atari 2600 VCS emulator");
93
 
      ADD_ATEXT(string("\\C\\c2") + instance()->features());
 
112
      ADD_ATEXT(string("\\C\\c2Features: ") + instance().features());
 
113
      ADD_ATEXT(string("\\C\\c2") + instance().buildInfo());
94
114
      ADD_ALINE;
95
 
      ADD_ATEXT("\\CCopyright (C) 1995-2008 The Stella team");
 
115
      ADD_ATEXT("\\CCopyright (C) 1995-2010 The Stella Team");
96
116
      ADD_ATEXT("\\Chttp://stella.sourceforge.net");
97
117
      ADD_ALINE;
98
118
      ADD_ATEXT("Stella is free software released under the GNU GPL");
100
120
      break;
101
121
 
102
122
    case 2:
103
 
      title = "The Stella team";
 
123
      title = "The Stella Team";
104
124
      ADD_ATEXT("\\L\\c0""  Bradford W. Mott");
105
 
      ADD_ATEXT("\\L\\c2""    Original author, lead developer");
 
125
      ADD_ATEXT("\\L\\c2""    Original author");
106
126
      ADD_ATEXT("\\L\\c0""  Stephen Anthony");
107
 
      ADD_ATEXT("\\L\\c2""    Lead developer, Linux/Win32 maintainer");
 
127
      ADD_ATEXT("\\L\\c2""    Lead developer, Linux/MacOS X/Win32 maintainer");
108
128
      ADD_ATEXT("\\L\\c0""  Mark Grebe");
109
 
      ADD_ATEXT("\\L\\c2""    Author/maintainer for OSX port");
 
129
      ADD_ATEXT("\\L\\c2""    Original author for MacOS X port");
110
130
      ADD_ATEXT("\\L\\c0""  Brian Watson");
111
131
      ADD_ATEXT("\\L\\c2""    Emulation core enhancement, debugger support");
 
132
      break;
 
133
 
 
134
    case 3:
 
135
      title = "The Stella Team";
112
136
      ADD_ATEXT("\\L\\c0""  Eckhard Stolberg");
113
137
      ADD_ATEXT("\\L\\c2""    Emulation core development");
114
 
      break;
115
 
 
116
 
    case 3:
117
 
      title = "The Stella team";
118
 
      ADD_ATEXT("\\L\\c0""  Joe D'Andrea");
119
 
      ADD_ATEXT("\\L\\c2""    Maintainer for Solaris port");
120
 
      ADD_ATEXT("\\L\\c0""  Darrell Spice Jr. & Doodle");
121
 
      ADD_ATEXT("\\L\\c2""    Authors for OS/2 port");
122
138
      ADD_ATEXT("\\L\\c0""  Kostas Nakos");
123
139
      ADD_ATEXT("\\L\\c2""    Author/maintainer for WinCE port");
124
 
      ADD_ATEXT("\\L\\c0""  Alex Zaballa");
125
 
      ADD_ATEXT("\\L\\c2""    Maintainer for GP2X port");
126
140
      break;
127
141
 
128
142
    case 4:
129
 
      title = "Retired members / Contributors";
130
 
      ADD_ATEXT("\\L\\c0""See Stella manual for contribution details");
131
 
      ADD_ALINE;
132
 
      ADD_ATEXT("\\L\\c0""  David Aspell, Chris Bennett, Alexander Bilstein");
133
 
      ADD_ATEXT("\\L\\c0""  Dan Boris, Piero Cavina, Bob Colbert");
134
 
      ADD_ATEXT("\\L\\c0""  Renato Ferreira, Ron Fries, Aaron Giles");
135
 
      ADD_ATEXT("\\L\\c0""  Mark Hahn, Kevin Horton, Thomas Jentzsch");
136
 
      ADD_ATEXT("\\L\\c0""  Erik \"Voch\" Kovach, Daniel Marks, James Mcclain");
137
 
      ADD_ATEXT("\\L\\c0""  David McEwen, Jeff Miller, Dan Mowczan");
138
 
      ADD_ATEXT("\\L\\c0""  Jack Nutting, Manuel Polik, Jim Pragit");
139
 
      ADD_ATEXT("\\L\\c0""  John Saeger, Chris Salomon, Jason Scott");
 
143
      title = "Contributors";
 
144
      ADD_ATEXT("\\L\\c0""  See Stella manual for contribution details");
 
145
      ADD_ATEXT("\\L\\c0""  and for many other people not listed here");
 
146
      ADD_ALINE;
 
147
      ADD_ATEXT("\\L\\c0""  Thanks to the ScummVM project for the GUI code");
 
148
      ADD_ALINE;
 
149
      ADD_ATEXT("\\L\\c0""  Thanks to Ian Bogost and the Georgia Tech");
 
150
      ADD_ATEXT("\\L\\c0""  Atari Team for the CRT Simulation effects");
140
151
      break;
141
152
 
142
153
    case 5:
143
 
      title = "Retired members / Contributors";
144
 
      ADD_ATEXT("\\L\\c0""See Stella manual for contribution details");
145
 
      ADD_ALINE;
146
 
      ADD_ATEXT("\\L\\c0""  David Shaw, Raul Silva, Chris Snell, John Stiles");
147
 
      ADD_ATEXT("\\L\\c0""  Matthew Stroup, Joel Sutton, Greg Troutman");
148
 
      ADD_ATEXT("\\L\\c0""  Curt Vendel, Keith Wilkins, Jeff Wisnia");
149
 
      ADD_ALINE;
150
 
      ADD_ATEXT("\\L\\c0""And many others ...");
151
 
      ADD_ALINE;
152
 
      ADD_ATEXT("\\L\\c0""Thanks to the ScummVM project for the GUI code");
153
 
      break;
154
 
 
155
 
    case 6:
156
154
      title = "Cast of thousands";
157
155
      ADD_ATEXT("\\L\\c0""Special thanks to AtariAge for introducing the");
158
156
      ADD_ATEXT("\\L\\c0""Atari 2600 to a whole new generation");
171
169
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
172
170
void AboutDialog::displayInfo()
173
171
{
174
 
  string titleStr, *dscStr;
175
 
 
176
 
  updateStrings(myPage, LINES_PER_PAGE, titleStr, dscStr);
 
172
  string titleStr;
 
173
  updateStrings(myPage, kLINES_PER_PAGE, titleStr);
177
174
 
178
175
  myTitle->setLabel(titleStr);
179
 
  for(int i = 0; i < LINES_PER_PAGE; i++)
 
176
  for(int i = 0; i < kLINES_PER_PAGE; i++)
180
177
  {
181
 
    const char *str = dscStr[i].c_str();
 
178
    const char* str = myDescStr[i].c_str();
182
179
    TextAlignment align = kTextAlignCenter;
183
 
    int color  = kTextColor;
 
180
    uInt32 color  = kTextColor;
184
181
 
185
182
    while (str[0] == '\\')
186
183
    {
236
233
    myDesc[i]->setLabel(str);
237
234
  }
238
235
 
239
 
  delete[] dscStr;
240
 
 
241
236
  // Redraw entire dialog
242
237
  _dirty = true;
243
238
}