Fix Android build, but there is a remaining linking issue in guiConfirmRegistration
authorLoic Blot <loic.blot@unix-experience.fr>
Sun, 11 Mar 2018 16:45:58 +0000 (17:45 +0100)
committerLoic Blot <loic.blot@unix-experience.fr>
Sun, 11 Mar 2018 16:45:58 +0000 (17:45 +0100)
* Also fix variable name overloading in guiConfirmRegistration

build/android/jni/Android.mk
src/gui/guiConfirmRegistration.cpp
src/gui/guiFormSpecMenu.cpp
src/gui/intlGUIEditBox.h

index 6aa658af3ef3d3f7a75f947e54008df5417b4e95..a69c96465f265780d2c2271b1d6772c911cce16b 100644 (file)
@@ -160,12 +160,12 @@ LOCAL_SRC_FILES := \
                jni/src/gui/guiTable.cpp                  \
                jni/src/guiscalingfilter.cpp              \
                jni/src/gui/guiVolumeChange.cpp           \
+               jni/src/gui/intlGUIEditBox.cpp            \
                jni/src/gui/profilergraph.cpp             \
                jni/src/gui/touchscreengui.cpp            \
                jni/src/httpfetch.cpp                     \
                jni/src/hud.cpp                           \
                jni/src/imagefilters.cpp                  \
-               jni/src/gui/intlGUIEditBox.cpp            \
                jni/src/inventory.cpp                     \
                jni/src/inventorymanager.cpp              \
                jni/src/itemdef.cpp                       \
index 3e6fd96c27d5e8df8fb765923e0fb6dbf5c60319..6228ea29bfce5d6f76ca966d50b2ed2a78ff9dfb 100644 (file)
@@ -20,12 +20,11 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 
 #include "guiConfirmRegistration.h"
 #include "client.h"
-#include "intlGUIEditBox.h"
 #include <IGUICheckBox.h>
-#include <IGUIEditBox.h>
 #include <IGUIButton.h>
 #include <IGUIStaticText.h>
 #include <IGUIFont.h>
+#include "intlGUIEditBox.h"
 
 #include "gettext.h"
 
@@ -86,8 +85,8 @@ void GUIConfirmRegistration::regenerateGui(v2u32 screensize)
                std::string address = m_address;
                if (address.empty())
                        address = "localhost";
-               core::rect<s32> rect(0, 0, 540, 180);
-               rect += topleft_client + v2s32(30, ypos);
+               core::rect<s32> rect2(0, 0, 540, 180);
+               rect2 += topleft_client + v2s32(30, ypos);
                static const std::string info_text_template = strgettext(
                                "You are about to join the server at %1$s with the "
                                "name \"%2$s\" for the first time. If you proceed, a "
@@ -100,9 +99,9 @@ void GUIConfirmRegistration::regenerateGui(v2u32 screensize)
                snprintf(info_text_buf, sizeof(info_text_buf), info_text_template.c_str(),
                                address.c_str(), m_playername.c_str());
 
-               gui::intlGUIEditBox *e = new gui::intlGUIEditBox(
+               gui::IGUIEditBox *e = new gui::intlGUIEditBox(
                                utf8_to_wide_c(info_text_buf), true, Environment, this,
-                               ID_message, rect, false, true);
+                               ID_message, rect2, false, true);
                e->drop();
                e->setMultiLine(true);
                e->setWordWrap(true);
@@ -111,34 +110,34 @@ void GUIConfirmRegistration::regenerateGui(v2u32 screensize)
 
        ypos += 210;
        {
-               core::rect<s32> rect(0, 0, 540, 30);
-               rect += topleft_client + v2s32(30, ypos);
+               core::rect<s32> rect2(0, 0, 540, 30);
+               rect2 += topleft_client + v2s32(30, ypos);
                gui::IGUIEditBox *e = Environment->addEditBox(m_pass_confirm.c_str(),
-                               rect, true, this, ID_confirmPassword);
+                       rect2, true, this, ID_confirmPassword);
                e->setPasswordBox(true);
        }
 
        ypos += 60;
        {
-               core::rect<s32> rect(0, 0, 230, 35);
-               rect = rect + v2s32(size.X / 2 - 220, ypos);
+               core::rect<s32> rect2(0, 0, 230, 35);
+               rect2 = rect2 + v2s32(size.X / 2 - 220, ypos);
                text = wgettext("Register and Join");
-               Environment->addButton(rect, this, ID_confirm, text);
+               Environment->addButton(rect2, this, ID_confirm, text);
                delete[] text;
        }
        {
-               core::rect<s32> rect(0, 0, 120, 35);
-               rect = rect + v2s32(size.X / 2 + 70, ypos);
+               core::rect<s32> rect2(0, 0, 120, 35);
+               rect2 = rect2 + v2s32(size.X / 2 + 70, ypos);
                text = wgettext("Cancel");
-               Environment->addButton(rect, this, ID_cancel, text);
+               Environment->addButton(rect2, this, ID_cancel, text);
                delete[] text;
        }
        {
-               core::rect<s32> rect(0, 0, 200, 20);
-               rect += topleft_client + v2s32(30, ypos - 40);
+               core::rect<s32> rect2(0, 0, 200, 20);
+               rect2 += topleft_client + v2s32(30, ypos - 40);
                text = wgettext("Passwords do not match!");
                IGUIElement *e = Environment->addStaticText(
-                               text, rect, false, true, this, ID_message);
+                               text, rect2, false, true, this, ID_message);
                e->setVisible(false);
                delete[] text;
        }
index dfb167ce7f518b905fe1d984b8438de25a1e7c2f..eb80f6ed7bf3c10f554b9f26457c114bc802b15a 100644 (file)
@@ -1039,7 +1039,7 @@ void GUIFormSpecMenu::createTextField(parserData *data, FieldSpec &spec,
        }
 
        if (e) {
-               if (is_editable && spec.fname == data->focused_fieldname) 
+               if (is_editable && spec.fname == data->focused_fieldname)
                        Environment->setFocus(e);
 
                if (is_multiline) {
index aa35e2e71d119128a794c5edb913f42f972373aa..7ebdaf1b7ad044da178b47922d3fe0085159ed28 100644 (file)
@@ -57,9 +57,13 @@ namespace gui
                //! Sets whether to draw the background
                virtual void setDrawBackground(bool draw);
 
+               virtual bool isDrawBackgroundEnabled() const { return true; }
+
                //! Turns the border on or off
                virtual void setDrawBorder(bool border);
 
+               virtual bool isDrawBorderEnabled() const { return Border; }
+
                //! Enables or disables word wrap for using the edit box as multiline text editor.
                virtual void setWordWrap(bool enable);
 
@@ -129,6 +133,14 @@ namespace gui
                //! Reads attributes of the element
                virtual void deserializeAttributes(io::IAttributes* in, io::SAttributeReadWriteOptions* options);
 
+               virtual void setCursorChar(const wchar_t cursorChar) {}
+
+               virtual wchar_t getCursorChar() const { return L'|'; }
+
+               virtual void setCursorBlinkTime(u32 timeMs) {}
+
+               virtual u32 getCursorBlinkTime() const { return 500; }
+
        protected:
                //! Breaks the single text line.
                void breakText();