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

« back to all changes in this revision

Viewing changes to src/gui/Launcher.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: Launcher.cxx,v 1.22 2008/03/12 22:04:51 stephena Exp $
 
17
// $Id: Launcher.cxx 2001 2010-04-10 21:37:23Z stephena $
17
18
//============================================================================
18
19
 
19
 
#include <sstream>
20
 
 
21
 
class Properties;
22
 
 
23
20
#include "LauncherDialog.hxx"
24
21
#include "Version.hxx"
25
22
#include "OSystem.hxx"
26
23
#include "Settings.hxx"
27
24
#include "FrameBuffer.hxx"
28
25
#include "bspf.hxx"
 
26
 
29
27
#include "Launcher.hxx"
30
28
 
31
29
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
32
30
Launcher::Launcher(OSystem* osystem)
33
 
  : DialogContainer(osystem),
34
 
    myWidth(400),
35
 
    myHeight(300)
 
31
  : DialogContainer(osystem)
36
32
{
37
 
  int w, h;
38
 
  myOSystem->settings().getSize("launcherres", w, h);
39
 
  myWidth = BSPF_max(w, 0);
40
 
  myHeight = BSPF_max(h, 0);
 
33
  myOSystem->settings().getSize("launcherres", (int&)myWidth, (int&)myHeight);
41
34
 
42
 
  // Error check the resolution
43
 
  myWidth = BSPF_max(myWidth, 320u);
44
 
  myWidth = BSPF_min(myWidth, osystem->desktopWidth());
45
 
  myHeight = BSPF_max(myHeight, 240u);
 
35
  // The launcher dialog is resizable, within certain bounds
 
36
  // We check those bounds now
 
37
  myWidth  = BSPF_max(myWidth, osystem->desktopWidth() >= 640 ? 640u : 320u);
 
38
  myHeight = BSPF_max(myHeight, osystem->desktopHeight() >= 480 ? 480u : 240u);
 
39
  myWidth  = BSPF_min(myWidth, osystem->desktopWidth());
46
40
  myHeight = BSPF_min(myHeight, osystem->desktopHeight());
 
41
 
47
42
  myOSystem->settings().setSize("launcherres", myWidth, myHeight);
48
43
 
49
44
  myBaseDialog = new LauncherDialog(myOSystem, this, 0, 0, myWidth, myHeight);
55
50
}
56
51
 
57
52
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
58
 
void Launcher::initializeVideo()
 
53
bool Launcher::initializeVideo()
59
54
{
60
55
  string title = string("Stella ") + STELLA_VERSION;
61
 
  myOSystem->frameBuffer().initialize(title, myWidth, myHeight);
 
56
  return myOSystem->frameBuffer().initialize(title, myWidth, myHeight);
62
57
}
63
58
 
64
59
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -