~ubuntu-branches/debian/sid/flightgear/sid

« back to all changes in this revision

Viewing changes to src/Scripting/NasalSys_private.hxx

  • Committer: Package Import Robot
  • Author(s): Markus Wanner, Markus Wanner, Rebecca Palmer
  • Date: 2014-01-21 22:31:02 UTC
  • mfrom: (1.3.1) (15.1.2 experimental)
  • Revision ID: package-import@ubuntu.com-20140121223102-cjw7g9le25acd119
Tags: 3.0.0~git20140204+c99ea4-1
[ Markus Wanner ]
* Upload to unstable.
* Adjust B-D to allow building on kfreebsd-*. Closes: #724686.
* Add a lintian-overrides on autotools; we use cmake.
* Upstream corrected the fgfs manpage. Closes: #556362.
* Drop unnecessary man page for gl-info. Closes: #698308.
* Drop README.Linux: it's outdated to the point of uselessness.
  Closes: #574173.
* Add an upper limit of libsimgear-dev versions that flightgear can be
  built with. Closes: #738436.
* Drop the libsvn-dev dependency, neither flightgear nor simgear depend
  on libsvn, anymore. Closes: #682947.
* List icons in debian/install rather than copying around from rules.
* Update menu entry for flightgear, add one for fgcom; add .xpm icons.
  Closes: #713924.
* flightgear.desktop: add German translation
* Bump Standards-Version to 3.9.5; no changes needed.

[ Rebecca Palmer ]
* New upstream release.
* Install the icons (based on code by Saikrishna Arcot).  (Not a
  complete fix for LP908153 as it only sets the menu/Dash icon, not the
  running window's icon, but better than nothing).
* Disable screensaver while running. Closes: LP#793599. Add required
  libdbus-1-dev dependency.
* Remove outdated README.Debian.
* Terrasync now works after just ticking the box. Closes: #252899.
* Always set Terrasync directory.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
// Copyright (C) 2013  James Turner//
 
2
// This program is free software; you can redistribute it and/or
 
3
// modify it under the terms of the GNU General Public License as
 
4
// published by the Free Software Foundation; either version 2 of the
 
5
// License, or (at your option) any later version.
 
6
//
 
7
// This program is distributed in the hope that it will be useful, but
 
8
// WITHOUT ANY WARRANTY; without even the implied warranty of
 
9
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 
10
// General Public License for more details.
 
11
//
 
12
// You should have received a copy of the GNU General Public License
 
13
// along with this program; if not, write to the Free Software
 
14
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 
15
 
 
16
#ifndef __NASALSYS_PRIVATE_HXX
 
17
#define __NASALSYS_PRIVATE_HXX
 
18
 
 
19
#include <simgear/props/props.hxx>
 
20
#include <simgear/nasal/nasal.h>
 
21
#include <simgear/xml/easyxml.hxx>
 
22
 
 
23
class FGNasalListener : public SGPropertyChangeListener {
 
24
public:
 
25
    FGNasalListener(SGPropertyNode* node, naRef code, FGNasalSys* nasal,
 
26
                    int key, int id, int init, int type);
 
27
    
 
28
    virtual ~FGNasalListener();
 
29
    virtual void valueChanged(SGPropertyNode* node);
 
30
    virtual void childAdded(SGPropertyNode* parent, SGPropertyNode* child);
 
31
    virtual void childRemoved(SGPropertyNode* parent, SGPropertyNode* child);
 
32
    
 
33
private:
 
34
    bool changed(SGPropertyNode* node);
 
35
    void call(SGPropertyNode* which, naRef mode);
 
36
    
 
37
    friend class FGNasalSys;
 
38
    SGPropertyNode_ptr _node;
 
39
    naRef _code;
 
40
    int _gcKey;
 
41
    int _id;
 
42
    FGNasalSys* _nas;
 
43
    int _init;
 
44
    int _type;
 
45
    unsigned int _active;
 
46
    bool _dead;
 
47
    long _last_int;
 
48
    double _last_float;
 
49
    std::string _last_string;
 
50
};
 
51
 
 
52
 
 
53
class NasalXMLVisitor : public XMLVisitor {
 
54
public:
 
55
    NasalXMLVisitor(naContext c, int argc, naRef* args);
 
56
    virtual ~NasalXMLVisitor() { naFreeContext(_c); }
 
57
    
 
58
    virtual void startElement(const char* tag, const XMLAttributes& a);
 
59
    virtual void endElement(const char* tag);
 
60
    virtual void data(const char* str, int len);
 
61
    virtual void pi(const char* target, const char* data);
 
62
    
 
63
private:
 
64
    void call(naRef func, int num, naRef a = naNil(), naRef b = naNil());
 
65
    naRef make_string(const char* s, int n = -1);
 
66
    
 
67
    naContext _c;
 
68
    naRef _start_element, _end_element, _data, _pi;
 
69
};
 
70
 
 
71
#endif // of __NASALSYS_PRIVATE_HXX