Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

portable.h

Go to the documentation of this file.
00001 /***************************************************************************
00002   portable.h  -  various bits that ease porting kpacman to other platforms.
00003   Currently KDE2 and Qtopia ports exist.
00004                              -------------------
00005     begin                : Mon Mar 18 12:35:24 EET 2002
00006     copyright            : (C) 2002 by Catalin Climov
00007     email                : catalin@climov.com
00008  ***************************************************************************/
00009 
00010 /***************************************************************************
00011  *                                                                         *
00012  *   This program is free software; you can redistribute it and/or modify  *
00013  *   it under the terms of the GNU General Public License as published by  *
00014  *   the Free Software Foundation; either version 2 of the License, or     *
00015  *   (at your option) any later version.                                   *
00016  *                                                                         *
00017  ***************************************************************************/
00018 
00019 #ifndef PORTABLE_H
00020 #define PORTABLE_H
00021 
00022 #define QPE_PORT
00023 
00024 #if defined( KDE2_PORT )
00025 
00026 #define APP kapp
00027 
00028 #define APP_CONFIG_BEGIN( cfgname ) KConfig cfgname = kapp->config()
00029 #define APP_CONFIG_END( cfgname ) cfgname->sync()
00030 #define SAVE_CONFIG_GROUP( cfgname, groupname ) QString groupname = configname->group()
00031 #define RESTORE_CONFIG_GROUP( cfgname, groupname ) configname->setGroup( groupname )
00032 
00033 #define FIND_APP_DATA( dataname ) KGlobal::dirs()->findResource( "appdata", dataname )
00034 
00035 #elif defined( QPE_PORT )
00036 
00037 #define i18n( x ) x
00038 #define KTMainWindow QMainWindow
00039 #define KMenuBar QMenuBar
00040 #define KAccel QAccel
00041 #define APP qApp
00042 
00043 #define APP_CONFIG_BEGIN( cfgname ) Config* cfgname = new Config("kpacman"); cfgname->setGroup("Default");
00044 #define APP_CONFIG_END( cfgname ) delete cfgname
00045 #define SAVE_CONFIG_GROUP( cfgname, groupname )
00046 #define RESTORE_CONFIG_GROUP( cfgname, groupname ) cfgname->setGroup("Default")
00047 
00048 #define FIND_APP_DATA( dataname ) (QPEApplication::qpeDir()+"share/kpacman/"+dataname)
00049 
00050 #else
00051 
00052 #error "Err, I don't know what platform to compile for (KDE2 or Qtopia)"
00053 
00054 #endif
00055 
00056 #define APP_QUIT() APP->quit()
00057 
00058 #endif // PORTABLE_H

Generated on Sat Nov 5 16:17:21 2005 for OPIE by  doxygen 1.4.2