paragui-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[paragui-cvs] CVS: paragui/include pgfactory.h,NONE,1.1 pgsingleton.h,NO


From: Alexander Pipelka <address@hidden>
Subject: [paragui-cvs] CVS: paragui/include pgfactory.h,NONE,1.1 pgsingleton.h,NONE,1.1 paraconfig.h,1.4,1.5 pgapplication.h,1.11,1.12 pgcolors.h,1.3,1.4
Date: Tue, 25 Jun 2002 16:38:44 -0400

Update of /cvsroot/paragui/paragui/include
In directory subversions:/tmp/cvs-serv7373/include

Modified Files:
        paraconfig.h pgapplication.h pgcolors.h 
Added Files:
        pgfactory.h pgsingleton.h 
Log Message:
fixed GCC 3.1 compiling
added PG_Singleton



--- NEW FILE ---
#ifndef PG_FACTORY_H
#define PG_FACTORY_H

#include <string>

class PG_Widget;

class PG_FactoryBaseObject {
public:
        
        PG_FactoryBaseObject();
        
        virtual ~PG_FactoryBaseObject();
};

template<class T> class PG_FactoryObject : public virtual PG_FactoryBaseObject {
public:
        static T* CreateObject(PG_Widget* parent = NULL) {
                return new T(parent);
        }
};

namespace PG_Factory {

        template<class t> void RegisterClass(const std::string& classname);
        
        PG_Widget* CreateObject(const std::string& classname, PG_Widget* parent 
= NULL);
        
} // namespace PG_Factory

#endif // PG_FACTORY_H

--- NEW FILE ---
#ifndef PG_SINGLETON_H
#define PG_SINGLETON_H

template< class T > class PG_Singleton {
public:
        static T& GetInstance() {
                static T obj;
                return obj;
        }

protected:
        PG_Singleton();
        ~PG_Singleton();

private:
        PG_Singleton(const T&);
        T& operator=(const T&);
        
};

#endif

Index: paraconfig.h
===================================================================
RCS file: /cvsroot/paragui/paragui/include/paraconfig.h,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -r1.4 -r1.5
*** paraconfig.h        27 Apr 2002 15:36:54 -0000      1.4
--- paraconfig.h        25 Jun 2002 20:38:42 -0000      1.5
***************
*** 33,36 ****
--- 33,38 ----
  #undef VERSION
  
+ #define PG_VERSIONNUM(X, Y, Z) ((X)*10000 + (Y)*100 + (Z))
+ 
  #if (defined(WIN32) || defined(__WIN32__)) && (defined(_MSC_VER) || 
defined(__BCPLUSPLUS__))
  #include "paraconfig_win32.h"
***************
*** 71,75 ****
--- 73,81 ----
  #define HASH_MAP_INC <ext/hash_map>
  #define MAP_INC <ext/hash_map>
+ #if PG_VERSIONNUM(__GNUC__, __GNUC_MINOR__, 0) >= PG_VERSIONNUM(3, 1, 0)
+ #define STL_MAP __gnu_cxx::hash_map
+ #else
  #define STL_MAP std::hash_map
+ #endif
  #else
  #define MAP_INC <map>

Index: pgapplication.h
===================================================================
RCS file: /cvsroot/paragui/paragui/include/pgapplication.h,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -r1.11 -r1.12
*** pgapplication.h     6 May 2002 11:18:01 -0000       1.11
--- pgapplication.h     25 Jun 2002 20:38:42 -0000      1.12
***************
*** 38,41 ****
--- 38,42 ----
  #include "pgfilearchive.h"
  #include "pgfont.h"
+ #include "pgsingleton.h"
  
  class PG_Theme;
***************
*** 89,95 ****
  */
  
! class DECLSPEC PG_Application : public PG_MessageObject, public 
PG_FileArchive, public PG_FontEngine  {
! public:
  
        /**  */
        PG_Application();
--- 90,96 ----
  */
  
! class DECLSPEC PG_Application : public PG_MessageObject, public 
PG_FileArchive, public PG_FontEngine, public PG_Singleton<PG_Application>  {
  
+ protected:
        /**  */
        PG_Application();
***************
*** 97,100 ****
--- 98,103 ----
        /**  */
        ~PG_Application();
+       
+ public:
  
        /**
***************
*** 549,556 ****
  private:
  
-       // disable the copy operators
-       PG_Application(const PG_Application&);
-       PG_Application& operator=(const PG_Application&);
- 
        bool my_freeBackground;
        static SDL_Surface* my_background;
--- 552,555 ----
***************
*** 561,565 ****
        static PG_Theme* my_Theme;
        static std::string app_path;
!       static PG_Application* pGlobalApp;
        static SDL_Surface* screen;
  
--- 560,564 ----
        static PG_Theme* my_Theme;
        static std::string app_path;
!       //static PG_Application* pGlobalApp;
        static SDL_Surface* screen;
  
***************
*** 576,579 ****
--- 575,580 ----
  
        static PG_Widget* lastwidget;
+       
+       friend class PG_Singleton<PG_Application>;
  };
  

Index: pgcolors.h
===================================================================
RCS file: /cvsroot/paragui/paragui/include/pgcolors.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -r1.3 -r1.4
*** pgcolors.h  15 Apr 2002 13:35:35 -0000      1.3
--- pgcolors.h  25 Jun 2002 20:38:42 -0000      1.4
***************
*** 556,562 ****
  const SDL_Color VioletRed2 = {238, 58, 140};
  const SDL_Color violetred2 = {238, 58, 140};
! #ifndef __BORLANDC__
! const SDL_Color tan = {210, 180, 140};
! #endif
  const SDL_Color SeaGreen2 = {78, 238, 148};
  const SDL_Color seagreen2 = {78, 238, 148};
--- 556,560 ----
  const SDL_Color VioletRed2 = {238, 58, 140};
  const SDL_Color violetred2 = {238, 58, 140};
! const SDL_Color tan1 = {210, 180, 140};
  const SDL_Color SeaGreen2 = {78, 238, 148};
  const SDL_Color seagreen2 = {78, 238, 148};




reply via email to

[Prev in Thread] Current Thread [Next in Thread]