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

« back to all changes in this revision

Viewing changes to src/gui/RomInfoWidget.hxx

  • 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: RomInfoWidget.hxx,v 1.4 2008/03/13 22:58:07 stephena Exp $
 
17
// $Id: RomInfoWidget.hxx 2001 2010-04-10 21:37:23Z stephena $
17
18
//============================================================================
18
19
 
19
20
#ifndef ROM_INFO_WIDGET_HXX
21
22
 
22
23
#include <fstream>
23
24
 
24
 
class GUI::Surface;
25
 
 
26
25
#include "Props.hxx"
27
26
#include "Widget.hxx"
28
27
#include "Command.hxx"
39
38
 
40
39
    void setProperties(const Properties& props);
41
40
    void clearProperties();
42
 
    void initialize();
43
41
    void loadConfig();
44
42
 
45
43
  protected:
47
45
 
48
46
  private:
49
47
    void parseProperties();
50
 
    static bool isValidPNGHeader(uInt8* header);
51
 
    static void readPNGChunk(ifstream& in, string& type, uInt8** data, int& size);
52
 
    static bool parseIHDR(int& width, int& height, uInt8* data, int size);
53
 
    static bool parseIDATChunk(const FrameBuffer& fb, GUI::Surface* surface,
54
 
                               int width, int height, uInt8* data, int size);
55
 
    static string parseTextChunk(uInt8* data, int size);
 
48
    bool isValidPNGHeader(uInt8* header);
 
49
    void readPNGChunk(ifstream& in, string& type, uInt8** data, int& size);
 
50
    bool parseIHDR(int& width, int& height, uInt8* data, int size);
 
51
    bool parseIDATChunk(FBSurface* surface, int width, int height,
 
52
                        uInt8* data, int size);
 
53
    string parseTextChunk(uInt8* data, int size);
56
54
 
57
55
  private:
58
 
    // Surface holding the scaled PNG image
59
 
    GUI::Surface* mySurface;
 
56
    // Surface id and pointer holding the scaled PNG image
 
57
    FBSurface* mySurface;
 
58
    int mySurfaceID;
 
59
 
 
60
    // How much to zoom the PNG image
 
61
    int myZoomLevel;
60
62
 
61
63
    // Whether the surface should be redrawn by drawWidget()
62
 
    bool myDrawSurface;
 
64
    bool mySurfaceIsValid;
63
65
 
64
66
    // Some ROM properties info, as well as 'tEXt' chunks from the PNG image
65
67
    StringList myRomInfo;