summaryrefslogtreecommitdiff
path: root/noncore/games/kpacman/portable.h
blob: b087be541dab73a308a7f32f07af431728ad6286 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
/***************************************************************************
  portable.h  -  various bits that ease porting kpacman to other platforms.
  Currently KDE2 and Qtopia ports exist.
                             -------------------
    begin                : Mon Mar 18 12:35:24 EET 2002
    copyright            : (C) 2002 by Catalin Climov
    email                : catalin@climov.com
 ***************************************************************************/

/***************************************************************************
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
 ***************************************************************************/

#ifndef PORTABLE_H
#define PORTABLE_H

#define QPE_PORT

#if defined( KDE2_PORT )

#define APP kapp

#define APP_CONFIG_BEGIN( cfgname ) KConfig cfgname = kapp->config()
#define APP_CONFIG_END( cfgname ) cfgname->sync()
#define SAVE_CONFIG_GROUP( cfgname, groupname ) QString groupname = configname->group()
#define RESTORE_CONFIG_GROUP( cfgname, groupname ) configname->setGroup( groupname )

#define FIND_APP_DATA( dataname ) KGlobal::dirs()->findResource( "appdata", dataname )

#elif defined( QPE_PORT )

#define i18n( x ) x
#define KTMainWindow QMainWindow
#define KMenuBar QMenuBar
#define KAccel QAccel
#define APP qApp

#define APP_CONFIG_BEGIN( cfgname ) Config* cfgname = new Config("kpacman"); cfgname->setGroup("Default");
#define APP_CONFIG_END( cfgname ) delete cfgname
#define SAVE_CONFIG_GROUP( cfgname, groupname )
#define RESTORE_CONFIG_GROUP( cfgname, groupname ) cfgname->setGroup("Default")

#define FIND_APP_DATA( dataname ) (QPEApplication::qpeDir()+"share/kpacman/"+dataname)

#else

#error "Err, I don't know what platform to compile for (KDE2 or Qtopia)"

#endif

#define APP_QUIT() APP->quit()

#endif // PORTABLE_H