monotone

monotone Mtn Source Tree

Root/app_state.hh

1#ifndef __APP_STATE_HH__
2#define __APP_STATE_HH__
3
4// Copyright (C) 2002 Graydon Hoare <graydon@pobox.com>
5//
6// This program is made available under the GNU GPL version 2.0 or
7// greater. See the accompanying file COPYING for details.
8//
9// This program is distributed WITHOUT ANY WARRANTY; without even the
10// implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
11// PURPOSE.
12
13#include "options.hh"
14#include "lua_hooks.hh"
15
16// This class used to hold most of the state of the application (hence the
17// name) but now it's just a wrapper around the options and lua_hooks
18// objects, plus one bit of state needed by the Lua extension interfaces.
19//
20// It is not quite possible to eliminate this object altogether. The major
21// remaining use is the Lua interface, which has a back-mapping from
22// lua_state (not lua_hooks) objects to app_state objects. This is mainly
23// needed for the mtn_automate() function, which allows lua-coded extension
24// commands to call the automate commands.
25//
26// Since the options and lua_hooks objects are so frequently required
27// together, it may make sense to merge them together and have that merged
28// object replace the app_state. Or we could just go back to passing this
29// around instead of separate options and lua_hooks objects.
30
31class app_state
32{
33public:
34 explicit app_state();
35 ~app_state();
36
37 options opts;
38 lua_hooks lua;
39 bool mtn_automate_allowed;
40};
41
42// Local Variables:
43// mode: C++
44// fill-column: 76
45// c-file-style: "gnu"
46// indent-tabs-mode: nil
47// End:
48// vim: et:sw=2:sts=2:ts=2:cino=>2s,{s,\:s,+s,t0,g0,^-2,e-2,n-2,p2s,(0,=s:
49
50#endif // __APP_STATE_HH__

Archive Download this file

Branches

Tags

Quick Links:     www.monotone.ca    -     Downloads    -     Documentation    -     Wiki    -     Code Forge    -     Build Status