Back to index

nux  3.0.0
ProgramTemplate.h
Go to the documentation of this file.
00001 /*
00002  * Copyright 2012 Inalogic Inc.
00003  *
00004  * This program is free software: you can redistribute it and/or modify it
00005  * under the terms of the GNU General Public License version 3, as published
00006  * by the  Free Software Foundation.
00007  *
00008  * This program is distributed in the hope that it will be useful, but
00009  * WITHOUT ANY WARRANTY; without even the implied warranties of
00010  * MERCHANTABILITY, SATISFACTORY QUALITY or FITNESS FOR A PARTICULAR
00011  * PURPOSE.  See the GNU General Public License for more details.
00012  *
00013  * You should have received a copy of the GNU General Public License
00014  * version 3 along with this program.  If not, see
00015  * <http://www.gnu.org/licenses/>
00016  *
00017  * Authored by: Jay Taoko <jaytaoko@inalogic.com>
00018  *
00019  */
00020 
00021 #include "Nux/Nux.h"
00022 #include "Nux/VLayout.h"
00023 #include "Nux/HLayout.h"
00024 #include "Nux/WindowThread.h"
00025 #include "Nux/TextEntry.h"
00026 
00027 #ifndef PROGRAMTEMPLATE_H
00028 #define PROGRAMTEMPLATE_H
00029 
00030 class ProgramTemplate
00031 {
00032 public:
00033   ProgramTemplate(const char* program_name, int window_width, int window_height, int program_life_span);
00034   virtual ~ProgramTemplate();
00035 
00036   virtual void Startup();
00037   virtual void UserInterfaceSetup();
00038   virtual void Run();
00039 
00040   bool ReadyToGo();
00041 
00042   nux::WindowThread* GetWindowThread();
00043 
00044 public:
00045   std::string program_name_;
00046   int program_life_span_;                  
00047   nux::TimeOutSignal* timeout_signal_;
00048   nux::WindowThread* window_thread_;
00049 
00050   int window_width_;
00051   int window_height_;
00052 
00053 private:
00054   void ProgramExitCall(void* data);
00055   void WaitForConfigureEvent(int x, int y, int width, int height);
00056   bool ready_to_go_;
00057 };
00058 
00059 #endif // PROGRAMTEMPLATE_H
00060