summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2015-06-14 17:53:34 +0300
committerAndrei Karas <akaras@inbox.ru>2015-06-14 17:53:34 +0300
commit456e03c0e942e8082f1fd67c6f852524fe300710 (patch)
tree255e81d7d306cf2559ed70d95698cf790040351f
parent606f836e9d1c17801ed4564a300cdbaa26097383 (diff)
downloadmanaplus-456e03c0e942e8082f1fd67c6f852524fe300710.tar.gz
manaplus-456e03c0e942e8082f1fd67c6f852524fe300710.tar.bz2
manaplus-456e03c0e942e8082f1fd67c6f852524fe300710.tar.xz
manaplus-456e03c0e942e8082f1fd67c6f852524fe300710.zip
Rename CREATEWIDGET* macroses.
-rw-r--r--src/actions/actions.cpp6
-rw-r--r--src/being/being.cpp2
-rw-r--r--src/client.cpp42
-rw-r--r--src/game.cpp48
-rw-r--r--src/gamemodifiers.cpp2
-rw-r--r--src/gui/dialogsmanager.cpp12
-rw-r--r--src/gui/widgets/createwidget.h8
-rw-r--r--src/gui/windowmanager.cpp18
8 files changed, 69 insertions, 69 deletions
diff --git a/src/actions/actions.cpp b/src/actions/actions.cpp
index dd6e57eae..088d0706e 100644
--- a/src/actions/actions.cpp
+++ b/src/actions/actions.cpp
@@ -144,7 +144,7 @@ static int uploadUpdate(void *ptr,
}
else
{
- CREATEWIDGET0(OkDialog,
+ CREATEWIDGET(OkDialog,
// TRANSLATORS: file uploaded message
_("File uploaded"),
str,
@@ -395,7 +395,7 @@ impHandler0(quit)
}
else if (!quitDialog)
{
- CREATEWIDGET(quitDialog, QuitDialog,
+ CREATEWIDGETV(quitDialog, QuitDialog,
&quitDialog);
quitDialog->requestMoveToTop();
return true;
@@ -720,7 +720,7 @@ impHandler(talk)
}
else if (being->getType() == ActorType::Player)
{
- CREATEWIDGET0(BuySellDialog,
+ CREATEWIDGET(BuySellDialog,
being->getName());
}
return true;
diff --git a/src/being/being.cpp b/src/being/being.cpp
index d08d8d5e7..8be720f13 100644
--- a/src/being/being.cpp
+++ b/src/being/being.cpp
@@ -314,7 +314,7 @@ Being::~Being()
void Being::createSpeechBubble()
{
- CREATEWIDGET1(mSpeechBubble, SpeechBubble);
+ CREATEWIDGETV0(mSpeechBubble, SpeechBubble);
}
void Being::setSubtype(const BeingTypeId subtype,
diff --git a/src/client.cpp b/src/client.cpp
index f8ee3652e..e7aeed7e8 100644
--- a/src/client.cpp
+++ b/src/client.cpp
@@ -906,7 +906,7 @@ int Client::gameExec()
if (!top)
break;
- CREATEWIDGET(desktop, Desktop, nullptr);
+ CREATEWIDGETV(desktop, Desktop, nullptr);
top->add(desktop);
int x = top->getWidth() - mButtonPadding;
ADDBUTTON(mSetupButton, new Button(desktop,
@@ -1038,7 +1038,7 @@ int Client::gameExec()
// lower than the default value
theme->setMinimumOpacity(0.8F);
- CREATEWIDGET(mCurrentDialog, ServerDialog,
+ CREATEWIDGETV(mCurrentDialog, ServerDialog,
&mCurrentServer,
settings.configDir);
}
@@ -1059,7 +1059,7 @@ int Client::gameExec()
BLOCK_START("Client::gameExec STATE_CONNECT_SERVER")
logger->log1("State: CONNECT SERVER");
loginData.updateHosts.clear();
- CREATEWIDGET(mCurrentDialog, ConnectionDialog,
+ CREATEWIDGETV(mCurrentDialog, ConnectionDialog,
// TRANSLATORS: connection dialog header
_("Connecting to server"),
STATE_SWITCH_SERVER);
@@ -1087,7 +1087,7 @@ int Client::gameExec()
if (settings.options.username.empty()
|| settings.options.password.empty())
{
- CREATEWIDGET(mCurrentDialog, LoginDialog,
+ CREATEWIDGETV(mCurrentDialog, LoginDialog,
&loginData,
mCurrentServer.hostname,
&settings.options.updateHost);
@@ -1105,7 +1105,7 @@ int Client::gameExec()
case STATE_LOGIN_ATTEMPT:
BLOCK_START("Client::gameExec STATE_LOGIN_ATTEMPT")
logger->log1("State: LOGIN ATTEMPT");
- CREATEWIDGET(mCurrentDialog, ConnectionDialog,
+ CREATEWIDGETV(mCurrentDialog, ConnectionDialog,
// TRANSLATORS: connection dialog header
_("Logging in"),
STATE_SWITCH_SERVER);
@@ -1133,7 +1133,7 @@ int Client::gameExec()
}
else
{
- CREATEWIDGET(mCurrentDialog, WorldSelectDialog,
+ CREATEWIDGETV(mCurrentDialog, WorldSelectDialog,
worlds);
if (settings.options.chooseDefault)
{
@@ -1148,7 +1148,7 @@ int Client::gameExec()
case STATE_WORLD_SELECT_ATTEMPT:
BLOCK_START("Client::gameExec STATE_WORLD_SELECT_ATTEMPT")
logger->log1("State: WORLD SELECT ATTEMPT");
- CREATEWIDGET(mCurrentDialog, ConnectionDialog,
+ CREATEWIDGETV(mCurrentDialog, ConnectionDialog,
// TRANSLATORS: connection dialog header
_("Entering game world"),
STATE_WORLD_SELECT);
@@ -1186,7 +1186,7 @@ int Client::gameExec()
{
settings.oldUpdates = settings.localDataDir
+ dirSeparator + settings.updatesDir;
- CREATEWIDGET(mCurrentDialog, UpdaterWindow,
+ CREATEWIDGETV(mCurrentDialog, UpdaterWindow,
settings.updateHost,
settings.oldUpdates,
settings.options.dataPath.empty(),
@@ -1280,7 +1280,7 @@ int Client::gameExec()
case STATE_GET_CHARACTERS:
BLOCK_START("Client::gameExec STATE_GET_CHARACTERS")
logger->log1("State: GET CHARACTERS");
- CREATEWIDGET(mCurrentDialog, ConnectionDialog,
+ CREATEWIDGETV(mCurrentDialog, ConnectionDialog,
// TRANSLATORS: connection dialog header
_("Requesting characters"),
STATE_SWITCH_SERVER);
@@ -1295,7 +1295,7 @@ int Client::gameExec()
// lower than the default value
theme->setMinimumOpacity(0.8F);
- CREATEWIDGET(mCurrentDialog, CharSelectDialog,
+ CREATEWIDGETV(mCurrentDialog, CharSelectDialog,
&loginData);
if (!(static_cast<CharSelectDialog*>(mCurrentDialog))
@@ -1319,7 +1319,7 @@ int Client::gameExec()
case STATE_CONNECT_GAME:
BLOCK_START("Client::gameExec STATE_CONNECT_GAME")
logger->log1("State: CONNECT GAME");
- CREATEWIDGET(mCurrentDialog, ConnectionDialog,
+ CREATEWIDGETV(mCurrentDialog, ConnectionDialog,
// TRANSLATORS: connection dialog header
_("Connecting to the game server"),
STATE_CHOOSE_SERVER);
@@ -1330,7 +1330,7 @@ int Client::gameExec()
case STATE_CHANGE_MAP:
BLOCK_START("Client::gameExec STATE_CHANGE_MAP")
logger->log1("State: CHANGE_MAP");
- CREATEWIDGET(mCurrentDialog, ConnectionDialog,
+ CREATEWIDGETV(mCurrentDialog, ConnectionDialog,
// TRANSLATORS: connection dialog header
_("Changing game servers"),
STATE_SWITCH_CHARACTER);
@@ -1385,7 +1385,7 @@ int Client::gameExec()
case STATE_LOGIN_ERROR:
BLOCK_START("Client::gameExec STATE_LOGIN_ERROR")
logger->log1("State: LOGIN ERROR");
- CREATEWIDGET(mCurrentDialog, OkDialog,
+ CREATEWIDGETV(mCurrentDialog, OkDialog,
// TRANSLATORS: error dialog header
_("Error"),
errorMessage,
@@ -1404,7 +1404,7 @@ int Client::gameExec()
case STATE_ACCOUNTCHANGE_ERROR:
BLOCK_START("Client::gameExec STATE_ACCOUNTCHANGE_ERROR")
logger->log1("State: ACCOUNT CHANGE ERROR");
- CREATEWIDGET(mCurrentDialog, OkDialog,
+ CREATEWIDGETV(mCurrentDialog, OkDialog,
// TRANSLATORS: error dialog header
_("Error"),
errorMessage,
@@ -1423,7 +1423,7 @@ int Client::gameExec()
case STATE_REGISTER_PREP:
BLOCK_START("Client::gameExec STATE_REGISTER_PREP")
logger->log1("State: REGISTER_PREP");
- CREATEWIDGET(mCurrentDialog, ConnectionDialog,
+ CREATEWIDGETV(mCurrentDialog, ConnectionDialog,
// TRANSLATORS: connection dialog header
_("Requesting registration details"),
STATE_LOGIN);
@@ -1433,7 +1433,7 @@ int Client::gameExec()
case STATE_REGISTER:
logger->log1("State: REGISTER");
- CREATEWIDGET(mCurrentDialog, RegisterDialog,
+ CREATEWIDGETV(mCurrentDialog, RegisterDialog,
&loginData);
break;
@@ -1447,7 +1447,7 @@ int Client::gameExec()
case STATE_CHANGEPASSWORD:
BLOCK_START("Client::gameExec STATE_CHANGEPASSWORD")
logger->log1("State: CHANGE PASSWORD");
- CREATEWIDGET(mCurrentDialog, ChangePasswordDialog,
+ CREATEWIDGETV(mCurrentDialog, ChangePasswordDialog,
&loginData);
mCurrentDialog->setVisible(Visible_true);
BLOCK_END("Client::gameExec STATE_CHANGEPASSWORD")
@@ -1466,7 +1466,7 @@ int Client::gameExec()
BLOCK_START("Client::gameExec "
"STATE_CHANGEPASSWORD_SUCCESS")
logger->log1("State: CHANGE PASSWORD SUCCESS");
- CREATEWIDGET(mCurrentDialog, OkDialog,
+ CREATEWIDGETV(mCurrentDialog, OkDialog,
// TRANSLATORS: password change message header
_("Password Change"),
// TRANSLATORS: password change message text
@@ -1487,7 +1487,7 @@ int Client::gameExec()
case STATE_CHANGEEMAIL:
logger->log1("State: CHANGE EMAIL");
- CREATEWIDGET(mCurrentDialog, ChangeEmailDialog,
+ CREATEWIDGETV(mCurrentDialog, ChangeEmailDialog,
&loginData);
mCurrentDialog->setVisible(Visible_true);
break;
@@ -1499,7 +1499,7 @@ int Client::gameExec()
case STATE_CHANGEEMAIL_SUCCESS:
logger->log1("State: CHANGE EMAIL SUCCESS");
- CREATEWIDGET(mCurrentDialog, OkDialog,
+ CREATEWIDGETV(mCurrentDialog, OkDialog,
// TRANSLATORS: email change message header
_("Email Change"),
// TRANSLATORS: email change message text
@@ -1517,7 +1517,7 @@ int Client::gameExec()
case STATE_UNREGISTER:
logger->log1("State: UNREGISTER");
- CREATEWIDGET(mCurrentDialog, UnRegisterDialog,
+ CREATEWIDGETV(mCurrentDialog, UnRegisterDialog,
&loginData);
break;
diff --git a/src/game.cpp b/src/game.cpp
index ca12252f6..b364bd2e3 100644
--- a/src/game.cpp
+++ b/src/game.cpp
@@ -182,31 +182,31 @@ static void createGuiWindows()
GameModifiers::init();
// Create dialogs
- CREATEWIDGET1(emoteWindow, EmoteWindow);
- CREATEWIDGET1(chatWindow, ChatWindow);
- CREATEWIDGET1(tradeWindow, TradeWindow);
- CREATEWIDGET(equipmentWindow, EquipmentWindow,
+ CREATEWIDGETV0(emoteWindow, EmoteWindow);
+ CREATEWIDGETV0(chatWindow, ChatWindow);
+ CREATEWIDGETV0(tradeWindow, TradeWindow);
+ CREATEWIDGETV(equipmentWindow, EquipmentWindow,
PlayerInfo::getEquipment(),
localPlayer);
- CREATEWIDGET(beingEquipmentWindow, EquipmentWindow,
+ CREATEWIDGETV(beingEquipmentWindow, EquipmentWindow,
nullptr, nullptr, true);
beingEquipmentWindow->setVisible(Visible_false);
- CREATEWIDGET1(statusWindow, StatusWindow);
- CREATEWIDGET1(miniStatusWindow, MiniStatusWindow);
- CREATEWIDGET(inventoryWindow, InventoryWindow,
+ CREATEWIDGETV0(statusWindow, StatusWindow);
+ CREATEWIDGETV0(miniStatusWindow, MiniStatusWindow);
+ CREATEWIDGETV(inventoryWindow, InventoryWindow,
PlayerInfo::getInventory());
#ifdef EATHENA_SUPPORT
if (serverFeatures->haveCart())
{
- CREATEWIDGET(cartWindow, InventoryWindow,
+ CREATEWIDGETV(cartWindow, InventoryWindow,
PlayerInfo::getCartInventory());
}
#endif
- CREATEWIDGET1(shopWindow, ShopWindow);
- CREATEWIDGET1(skillDialog, SkillDialog);
- CREATEWIDGET1(minimap, Minimap);
- CREATEWIDGET1(debugWindow, DebugWindow);
- CREATEWIDGET(itemShortcutWindow, ShortcutWindow,
+ CREATEWIDGETV0(shopWindow, ShopWindow);
+ CREATEWIDGETV0(skillDialog, SkillDialog);
+ CREATEWIDGETV0(minimap, Minimap);
+ CREATEWIDGETV0(debugWindow, DebugWindow);
+ CREATEWIDGETV(itemShortcutWindow, ShortcutWindow,
"ItemShortcut", "items.xml", 83, 460);
for (unsigned f = 0; f < SHORTCUT_TABS; f ++)
@@ -220,17 +220,17 @@ static void createGuiWindows()
didYouKnowWindow->loadData();
}
- CREATEWIDGET(emoteShortcutWindow, ShortcutWindow,
+ CREATEWIDGETV(emoteShortcutWindow, ShortcutWindow,
"EmoteShortcut",
new EmoteShortcutContainer(nullptr),
"emotes.xml",
130, 480);
- CREATEWIDGET1(outfitWindow, OutfitWindow);
- CREATEWIDGET(dropShortcutWindow, ShortcutWindow,
+ CREATEWIDGETV0(outfitWindow, OutfitWindow);
+ CREATEWIDGETV(dropShortcutWindow, ShortcutWindow,
"DropShortcut",
new VirtShortcutContainer(nullptr, dropShortcut),
"drops.xml");
- CREATEWIDGET(spellShortcutWindow, ShortcutWindow,
+ CREATEWIDGETV(spellShortcutWindow, ShortcutWindow,
"SpellShortcut",
"spells.xml",
265, 328);
@@ -241,13 +241,13 @@ static void createGuiWindows()
}
#ifdef EATHENA_SUPPORT
- CREATEWIDGET1(bankWindow, BankWindow);
- CREATEWIDGET1(mailWindow, MailWindow);
+ CREATEWIDGETV0(bankWindow, BankWindow);
+ CREATEWIDGETV0(mailWindow, MailWindow);
#endif
- CREATEWIDGET1(whoIsOnline, WhoIsOnline);
- CREATEWIDGET1(killStats, KillStats);
- CREATEWIDGET1(socialWindow, SocialWindow);
- CREATEWIDGET1(questsWindow, QuestsWindow);
+ CREATEWIDGETV0(whoIsOnline, WhoIsOnline);
+ CREATEWIDGETV0(killStats, KillStats);
+ CREATEWIDGETV0(socialWindow, SocialWindow);
+ CREATEWIDGETV0(questsWindow, QuestsWindow);
// TRANSLATORS: chat tab header
localChatTab = new ChatTab(chatWindow, _("General"),
diff --git a/src/gamemodifiers.cpp b/src/gamemodifiers.cpp
index d4880e9f2..ba0bdaab6 100644
--- a/src/gamemodifiers.cpp
+++ b/src/gamemodifiers.cpp
@@ -432,7 +432,7 @@ void GameModifiers::changeAwayMode(const bool forward A_UNUSED)
localPlayer->navigateClean();
if (outfitWindow)
outfitWindow->wearAwayOutfit();
- OkDialog *const dialog = CREATEWIDGET2(OkDialog,
+ OkDialog *const dialog = CREATEWIDGETR(OkDialog,
// TRANSLATORS: away message box header
_("Away"),
config.getStringValue("afkMessage"),
diff --git a/src/gui/dialogsmanager.cpp b/src/gui/dialogsmanager.cpp
index 6604d0586..745ef2cc2 100644
--- a/src/gui/dialogsmanager.cpp
+++ b/src/gui/dialogsmanager.cpp
@@ -85,7 +85,7 @@ void DialogsManager::closeDialogs()
void DialogsManager::createUpdaterWindow()
{
- CREATEWIDGET(updaterWindow, UpdaterWindow,
+ CREATEWIDGETV(updaterWindow, UpdaterWindow,
settings.updateHost,
settings.oldUpdates,
false,
@@ -98,7 +98,7 @@ Window *DialogsManager::openErrorDialog(const std::string &header,
{
if (settings.supportUrl.empty() || config.getBoolValue("hidesupport"))
{
- OkDialog *const dialog = CREATEWIDGET2(OkDialog,
+ OkDialog *const dialog = CREATEWIDGETR(OkDialog,
header,
message,
// TRANSLATORS: ok dialog button
@@ -112,7 +112,7 @@ Window *DialogsManager::openErrorDialog(const std::string &header,
}
else
{
- ConfirmDialog *const dialog = CREATEWIDGET2(ConfirmDialog,
+ ConfirmDialog *const dialog = CREATEWIDGETR(ConfirmDialog,
header,
strprintf("%s %s", message.c_str(),
// TRANSLATORS: error message question
@@ -129,7 +129,7 @@ void DialogsManager::playerDeath()
if (!deathNotice)
{
// TRANSLATORS: message header
- CREATEWIDGET(deathNotice, OkDialog,
+ CREATEWIDGETV(deathNotice, OkDialog,
_("Message"),
DeadDB::getRandomString(),
// TRANSLATORS: ok dialog button
@@ -157,7 +157,7 @@ void DialogsManager::attributeChanged(const AttributesT id,
if (newVal >= max && total < max)
{
weightNoticeTime = cur_time + 5;
- CREATEWIDGET(weightNotice, OkDialog,
+ CREATEWIDGETV(weightNotice, OkDialog,
// TRANSLATORS: message header
_("Message"),
// TRANSLATORS: weight message
@@ -177,7 +177,7 @@ void DialogsManager::attributeChanged(const AttributesT id,
else if (newVal < max && total >= max)
{
weightNoticeTime = cur_time + 5;
- CREATEWIDGET(weightNotice, OkDialog,
+ CREATEWIDGETV(weightNotice, OkDialog,
// TRANSLATORS: message header
_("Message"),
// TRANSLATORS: weight message
diff --git a/src/gui/widgets/createwidget.h b/src/gui/widgets/createwidget.h
index 70722a9e3..54d92d2cb 100644
--- a/src/gui/widgets/createwidget.h
+++ b/src/gui/widgets/createwidget.h
@@ -21,18 +21,18 @@
#ifndef GUI_WIDGETS_CREATEWIDGET_H
#define GUI_WIDGETS_CREATEWIDGET_H
-#define CREATEWIDGET(var, type, ...) \
+#define CREATEWIDGETV(var, type, ...) \
var = new type(__VA_ARGS__); \
var->postInit()
-#define CREATEWIDGET0(type, ...) \
+#define CREATEWIDGET(type, ...) \
(new type(__VA_ARGS__))->postInit()
-#define CREATEWIDGET1(var, type) \
+#define CREATEWIDGETV0(var, type) \
var = new type; \
var->postInit()
-#define CREATEWIDGET2(type, ...) \
+#define CREATEWIDGETR(type, ...) \
static_cast<type*>(Widget::callPostInit(new type(__VA_ARGS__)))
#define CREATEWIDGETR0(type) \
diff --git a/src/gui/windowmanager.cpp b/src/gui/windowmanager.cpp
index 6f1f223bc..d61ffea6e 100644
--- a/src/gui/windowmanager.cpp
+++ b/src/gui/windowmanager.cpp
@@ -95,15 +95,15 @@ void WindowManager::init()
void WindowManager::createWindows()
{
userPalette = new UserPalette;
- CREATEWIDGET1(setupWindow, SetupWindow);
- CREATEWIDGET1(helpWindow, HelpWindow);
- CREATEWIDGET1(didYouKnowWindow, DidYouKnowWindow);
- CREATEWIDGET1(popupMenu, PopupMenu);
- CREATEWIDGET1(beingPopup, BeingPopup);
- CREATEWIDGET1(textPopup, TextPopup);
- CREATEWIDGET1(textBoxPopup, TextBoxPopup);
- CREATEWIDGET1(itemPopup, ItemPopup);
- CREATEWIDGET1(spellPopup, SpellPopup);
+ CREATEWIDGETV0(setupWindow, SetupWindow);
+ CREATEWIDGETV0(helpWindow, HelpWindow);
+ CREATEWIDGETV0(didYouKnowWindow, DidYouKnowWindow);
+ CREATEWIDGETV0(popupMenu, PopupMenu);
+ CREATEWIDGETV0(beingPopup, BeingPopup);
+ CREATEWIDGETV0(textPopup, TextPopup);
+ CREATEWIDGETV0(textBoxPopup, TextBoxPopup);
+ CREATEWIDGETV0(itemPopup, ItemPopup);
+ CREATEWIDGETV0(spellPopup, SpellPopup);
}
void WindowManager::deleteWindows()