From 500bcec44d40ee72873cf16d09c5a0b268825a41 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sun, 24 May 2015 15:55:34 +0300 Subject: Move simpletypes.h into directory simpletypes. --- src/CMakeLists.txt | 2 +- src/Makefile.am | 2 +- src/being/playerinfo.h | 3 +- src/enums/simpletypes.h | 72 ------------------------------------- src/enums/simpletypes/simpletypes.h | 72 +++++++++++++++++++++++++++++++++++++ src/gui/dialogsmanager.h | 2 +- src/gui/widgets/dropdown.h | 2 +- src/gui/widgets/inttextfield.h | 2 +- src/gui/widgets/popuplist.h | 2 +- src/gui/widgets/skillinfo.h | 2 +- src/gui/widgets/window.h | 2 +- src/input/inputactiondata.h | 2 +- src/inventory.h | 3 +- src/item.h | 2 +- src/net/ea/inventoryitem.h | 2 +- src/net/homunculushandler.h | 2 +- src/net/mercenaryhandler.h | 2 +- src/statuseffect.h | 2 +- src/utils/xml.h | 2 +- 19 files changed, 91 insertions(+), 89 deletions(-) delete mode 100644 src/enums/simpletypes.h create mode 100644 src/enums/simpletypes/simpletypes.h (limited to 'src') diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 4a354fc7e..bd9afc6a8 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1054,8 +1054,8 @@ SET(SRCS soundmanager.h sprite.h enums/screendensity.h - enums/simpletypes.h enums/state.h + enums/simpletypes/simpletypes.h statuseffect.cpp statuseffect.h render/surfacegraphics.cpp diff --git a/src/Makefile.am b/src/Makefile.am index 16797e1a9..9101b90b7 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1182,8 +1182,8 @@ manaplus_SOURCES += gui/widgets/avatarlistbox.cpp \ soundmanager.h \ sprite.h \ enums/screendensity.h \ - enums/simpletypes.h \ enums/state.h \ + enums/simpletypes/simpletypes.h \ statuseffect.cpp \ statuseffect.h \ render/surfacegraphics.cpp \ diff --git a/src/being/playerinfo.h b/src/being/playerinfo.h index e405dbe06..65e999968 100644 --- a/src/being/playerinfo.h +++ b/src/being/playerinfo.h @@ -25,9 +25,10 @@ #include "equipment.h" #include "enums/guildpositionflags.h" -#include "enums/simpletypes.h" #include "enums/state.h" +#include "enums/simpletypes/simpletypes.h" + #include #ifdef EATHENA_SUPPORT #include diff --git a/src/enums/simpletypes.h b/src/enums/simpletypes.h deleted file mode 100644 index 3a0488684..000000000 --- a/src/enums/simpletypes.h +++ /dev/null @@ -1,72 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2015 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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 - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#ifndef ENUMS_SIMPLETYPES_H -#define ENUMS_SIMPLETYPES_H - -#include "localconsts.h" - -#ifdef ADVGCC - -#define defBoolEnum(name) \ - enum class name : bool \ - { \ - MFalse = false, \ - MTrue = true \ - }; \ - const name name##_true = name::MTrue; \ - const name name##_false = name::MFalse -#define fromBool(val, name) \ - (val) ? name::MTrue : name::MFalse - -#else // ADVGCC - -#define defBoolEnum(name) \ - const bool name##_true = true; \ - const bool name##_false = false; \ - typedef bool name -#define fromBool(val, name) \ - (val) ? true : false - -#endif // ADVGCC - - -defBoolEnum(Identified); -defBoolEnum(Damaged); -defBoolEnum(Favorite); -defBoolEnum(Equipm); -defBoolEnum(Equipped); -defBoolEnum(Modal); -defBoolEnum(ShowCenter); -defBoolEnum(Notify); -defBoolEnum(Trading); -defBoolEnum(Sfx); -defBoolEnum(Keep); -defBoolEnum(Modifiable); -defBoolEnum(AllPlayers); -defBoolEnum(AllowSort); -defBoolEnum(NpcNames); -defBoolEnum(Enable); -defBoolEnum(ForceDisplay); -defBoolEnum(UseResman); -defBoolEnum(SkipError); -defBoolEnum(UseArgs); - -#endif // ENUMS_SIMPLETYPES_H diff --git a/src/enums/simpletypes/simpletypes.h b/src/enums/simpletypes/simpletypes.h new file mode 100644 index 000000000..2d5514d11 --- /dev/null +++ b/src/enums/simpletypes/simpletypes.h @@ -0,0 +1,72 @@ +/* + * The ManaPlus Client + * Copyright (C) 2015 The ManaPlus Developers + * + * This file is part of The ManaPlus Client. + * + * 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 + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#ifndef ENUMS_SIMPLETYPES_SIMPLETYPES_H +#define ENUMS_SIMPLETYPES_SIMPLETYPES_H + +#include "localconsts.h" + +#ifdef ADVGCC + +#define defBoolEnum(name) \ + enum class name : bool \ + { \ + MFalse = false, \ + MTrue = true \ + }; \ + const name name##_true = name::MTrue; \ + const name name##_false = name::MFalse +#define fromBool(val, name) \ + (val) ? name::MTrue : name::MFalse + +#else // ADVGCC + +#define defBoolEnum(name) \ + const bool name##_true = true; \ + const bool name##_false = false; \ + typedef bool name +#define fromBool(val, name) \ + (val) ? true : false + +#endif // ADVGCC + + +defBoolEnum(Identified); +defBoolEnum(Damaged); +defBoolEnum(Favorite); +defBoolEnum(Equipm); +defBoolEnum(Equipped); +defBoolEnum(Modal); +defBoolEnum(ShowCenter); +defBoolEnum(Notify); +defBoolEnum(Trading); +defBoolEnum(Sfx); +defBoolEnum(Keep); +defBoolEnum(Modifiable); +defBoolEnum(AllPlayers); +defBoolEnum(AllowSort); +defBoolEnum(NpcNames); +defBoolEnum(Enable); +defBoolEnum(ForceDisplay); +defBoolEnum(UseResman); +defBoolEnum(SkipError); +defBoolEnum(UseArgs); + +#endif // ENUMS_SIMPLETYPES_SIMPLETYPES_H diff --git a/src/gui/dialogsmanager.h b/src/gui/dialogsmanager.h index ec4ce12a1..4f8780cb4 100644 --- a/src/gui/dialogsmanager.h +++ b/src/gui/dialogsmanager.h @@ -23,7 +23,7 @@ #ifndef GUI_DIALOGSMANAGER_H #define GUI_DIALOGSMANAGER_H -#include "enums/simpletypes.h" +#include "enums/simpletypes/simpletypes.h" #include "listeners/attributelistener.h" #include "listeners/playerdeathlistener.h" diff --git a/src/gui/widgets/dropdown.h b/src/gui/widgets/dropdown.h index 391a49873..979ba024c 100644 --- a/src/gui/widgets/dropdown.h +++ b/src/gui/widgets/dropdown.h @@ -23,7 +23,7 @@ #ifndef GUI_WIDGETS_DROPDOWN_H #define GUI_WIDGETS_DROPDOWN_H -#include "enums/simpletypes.h" +#include "enums/simpletypes/simpletypes.h" #include "gui/widgets/basiccontainer.h" diff --git a/src/gui/widgets/inttextfield.h b/src/gui/widgets/inttextfield.h index 04f34b393..91fe7957d 100644 --- a/src/gui/widgets/inttextfield.h +++ b/src/gui/widgets/inttextfield.h @@ -23,7 +23,7 @@ #ifndef GUI_WIDGETS_INTTEXTFIELD_H #define GUI_WIDGETS_INTTEXTFIELD_H -#include "enums/simpletypes.h" +#include "enums/simpletypes/simpletypes.h" #include "gui/widgets/textfield.h" diff --git a/src/gui/widgets/popuplist.h b/src/gui/widgets/popuplist.h index a15701d57..fa59107af 100644 --- a/src/gui/widgets/popuplist.h +++ b/src/gui/widgets/popuplist.h @@ -21,7 +21,7 @@ #ifndef GUI_WIDGETS_POPUPLIST_H #define GUI_WIDGETS_POPUPLIST_H -#include "enums/simpletypes.h" +#include "enums/simpletypes/simpletypes.h" #include "gui/widgets/popup.h" diff --git a/src/gui/widgets/skillinfo.h b/src/gui/widgets/skillinfo.h index 9cec3aa49..cfe571f37 100644 --- a/src/gui/widgets/skillinfo.h +++ b/src/gui/widgets/skillinfo.h @@ -23,7 +23,7 @@ #ifndef GUI_WIDGETS_SKILLINFO_H #define GUI_WIDGETS_SKILLINFO_H -#include "enums/simpletypes.h" +#include "enums/simpletypes/simpletypes.h" #include "gui/color.h" diff --git a/src/gui/widgets/window.h b/src/gui/widgets/window.h index 83f88f726..a812e135a 100644 --- a/src/gui/widgets/window.h +++ b/src/gui/widgets/window.h @@ -66,7 +66,7 @@ #ifndef GUI_WIDGETS_WINDOW_H #define GUI_WIDGETS_WINDOW_H -#include "enums/simpletypes.h" +#include "enums/simpletypes/simpletypes.h" #include "listeners/mouselistener.h" #include "listeners/widgetlistener.h" diff --git a/src/input/inputactiondata.h b/src/input/inputactiondata.h index dc2ada642..f85b8aee2 100644 --- a/src/input/inputactiondata.h +++ b/src/input/inputactiondata.h @@ -25,7 +25,7 @@ #include "actions/actionfuncptr.h" -#include "enums/simpletypes.h" +#include "enums/simpletypes/simpletypes.h" struct InputActionData final { diff --git a/src/inventory.h b/src/inventory.h index 575ee9f55..7e2f63727 100644 --- a/src/inventory.h +++ b/src/inventory.h @@ -24,7 +24,8 @@ #define INVENTORY_H #include "enums/inventorytype.h" -#include "enums/simpletypes.h" + +#include "enums/simpletypes/simpletypes.h" #include "enums/being/gender.h" diff --git a/src/item.h b/src/item.h index 2b624d6ea..94af1ccdc 100644 --- a/src/item.h +++ b/src/item.h @@ -23,7 +23,7 @@ #ifndef ITEM_H #define ITEM_H -#include "enums/simpletypes.h" +#include "enums/simpletypes/simpletypes.h" #include "resources/db/itemdb.h" diff --git a/src/net/ea/inventoryitem.h b/src/net/ea/inventoryitem.h index bd2d115cd..66abc1347 100644 --- a/src/net/ea/inventoryitem.h +++ b/src/net/ea/inventoryitem.h @@ -23,7 +23,7 @@ #ifndef NET_EA_INVENTORYITEM_H #define NET_EA_INVENTORYITEM_H -#include "enums/simpletypes.h" +#include "enums/simpletypes/simpletypes.h" #if defined(__GXX_EXPERIMENTAL_CXX0X__) #include diff --git a/src/net/homunculushandler.h b/src/net/homunculushandler.h index 1d27afd1a..d26fc7b5d 100644 --- a/src/net/homunculushandler.h +++ b/src/net/homunculushandler.h @@ -23,7 +23,7 @@ #ifdef EATHENA_SUPPORT -#include "enums/simpletypes.h" +#include "enums/simpletypes/simpletypes.h" #include diff --git a/src/net/mercenaryhandler.h b/src/net/mercenaryhandler.h index 104d7e8d2..1abd48aec 100644 --- a/src/net/mercenaryhandler.h +++ b/src/net/mercenaryhandler.h @@ -23,7 +23,7 @@ #ifdef EATHENA_SUPPORT -#include "enums/simpletypes.h" +#include "enums/simpletypes/simpletypes.h" #include diff --git a/src/statuseffect.h b/src/statuseffect.h index 1e20953bc..4af6e039f 100644 --- a/src/statuseffect.h +++ b/src/statuseffect.h @@ -23,7 +23,7 @@ #ifndef STATUSEFFECT_H #define STATUSEFFECT_H -#include "enums/simpletypes.h" +#include "enums/simpletypes/simpletypes.h" #include diff --git a/src/utils/xml.h b/src/utils/xml.h index fdefc1682..105ff19e1 100644 --- a/src/utils/xml.h +++ b/src/utils/xml.h @@ -23,7 +23,7 @@ #ifndef UTILS_XML_H #define UTILS_XML_H -#include "enums/simpletypes.h" +#include "enums/simpletypes/simpletypes.h" #include #include -- cgit v1.2.3-60-g2f50