~sil2100/nux/precise_sru-1

« back to all changes in this revision

Viewing changes to Nux/ProgramFramework/ProgramTemplate.h

  • Committer: Didier Roche
  • Date: 2012-02-17 10:28:35 UTC
  • mfrom: (159.3.34)
  • Revision ID: didier.roche@canonical.com-20120217102835-7fyqcabz0vad239t
New upstream release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * Copyright 2012 Inalogic Inc.
 
3
 *
 
4
 * This program is free software: you can redistribute it and/or modify it
 
5
 * under the terms of the GNU General Public License version 3, as published
 
6
 * by the  Free Software Foundation.
 
7
 *
 
8
 * This program is distributed in the hope that it will be useful, but
 
9
 * WITHOUT ANY WARRANTY; without even the implied warranties of
 
10
 * MERCHANTABILITY, SATISFACTORY QUALITY or FITNESS FOR A PARTICULAR
 
11
 * PURPOSE.  See the GNU General Public License for more details.
 
12
 *
 
13
 * You should have received a copy of the GNU General Public License
 
14
 * version 3 along with this program.  If not, see
 
15
 * <http://www.gnu.org/licenses/>
 
16
 *
 
17
 * Authored by: Jay Taoko <jaytaoko@inalogic.com>
 
18
 *
 
19
 */
 
20
 
 
21
#include "Nux/Nux.h"
 
22
#include "Nux/VLayout.h"
 
23
#include "Nux/HLayout.h"
 
24
#include "Nux/WindowThread.h"
 
25
#include "Nux/TextEntry.h"
 
26
 
 
27
#ifndef PROGRAMTEMPLATE_H
 
28
#define PROGRAMTEMPLATE_H
 
29
 
 
30
class ProgramTemplate
 
31
{
 
32
public:
 
33
  ProgramTemplate(const char* program_name, int window_width, int window_height, int program_life_span);
 
34
  virtual ~ProgramTemplate();
 
35
 
 
36
  virtual void Startup();
 
37
  virtual void UserInterfaceSetup();
 
38
  virtual void Run();
 
39
 
 
40
  bool ReadyToGo();
 
41
 
 
42
  nux::WindowThread* GetWindowThread();
 
43
 
 
44
public:
 
45
  std::string program_name_;
 
46
  int program_life_span_;                  //!< The program will auto-terminate after a delay in milliseconds.
 
47
  nux::TimeOutSignal* timeout_signal_;
 
48
  nux::WindowThread* window_thread_;
 
49
 
 
50
  int window_width_;
 
51
  int window_height_;
 
52
 
 
53
private:
 
54
  void ProgramExitCall(void* data);
 
55
  void WaitForConfigureEvent(int x, int y, int width, int height);
 
56
  bool ready_to_go_;
 
57
};
 
58
 
 
59
#endif // PROGRAMTEMPLATE_H
 
60