anchor_window.h

Go to the documentation of this file.
00001 #ifndef ANCHOR_WINDOW_CLASS
00002 #define ANCHOR_WINDOW_CLASS
00003 
00004 /*****************************************************************************\
00005 *                                                                             *
00006 *  Name   : anchor_window                                                     *
00007 *  Author : Chris Koeritz                                                     *
00008 *                                                                             *
00009 *******************************************************************************
00010 * Copyright (c) 2000-$now By Author.  This program is free software; you can  *
00011 * redistribute it and/or modify it under the terms of the GNU General Public  *
00012 * License as published by the Free Software Foundation; either version 2 of   *
00013 * the License or (at your option) any later version.  This is online at:      *
00014 *     http://www.fsf.org/copyleft/gpl.html                                    *
00015 * Please send any updates to: fred@gruntose.com                               *
00016 \*****************************************************************************/
00017 
00018 #include "dll_processes.h"
00019 
00020 #include <basis/object_base.h>
00021 #include <basis/portable.h>
00022 #ifdef __LINUX__
00023   #include "shutdown_alerter.h"
00024 #endif
00025 
00026 // forward.
00027 class istring;
00028 
00030 
00038 class PROCESSES_CLASS_STYLE anchor_window
00039 #ifdef __LINUX__
00040 : public shutdown_alerter
00041 #endif
00042 {
00043 public:
00044   anchor_window();
00046 
00047   virtual ~anchor_window();
00048 
00049   IMPLEMENT_CLASS_NAME("anchor_window");
00050 
00051   static bool close_this_program();
00053 
00059   static bool close_app_window(const istring &app_name);
00061 
00066   bool defunct() const;
00068 
00070   void set_defunct();
00072 
00073   bool setup(application_instance handle, const istring &application_name,
00074           int timing_cycle = 0);
00076 
00086   void register_window(window_handle window);
00088 
00093   static bool launch(anchor_window &window, application_instance handle,
00094           const istring &app, int cycle = 0);
00096 
00104   virtual void handle_startup();
00106 
00110   virtual void handle_timer();
00112 
00113   virtual void handle_shutdown();
00115 
00116   static istring make_well_known_title(const istring &application_name);
00118 
00123   static istring make_well_known_class(const istring &application_name);
00125 
00126 private:
00127   application_instance _instance;  
00128   istring *_window_title;  
00129   istring *_window_class;  
00130   ATOM _class_reg;  
00131   window_handle _wind_handle;  
00132   int _cycle;  
00133   bool _defunct;  
00134 
00135   ATOM register_class();
00137 
00138 #ifdef __WIN32__
00139   static LRESULT CALLBACK WndProc(HWND wind, UINT msg, WPARAM wp, LPARAM lp);
00141 #endif
00142 
00143   // not appropriate.
00144   anchor_window(const anchor_window &);
00145   anchor_window &operator =(const anchor_window &);
00146 };
00147 
00148 #endif // outer guard.
00149 

Generated on Thu Nov 20 04:29:05 2008 for HOOPLE Libraries by  doxygen 1.5.1