diff --git a/addons/gdcef/gdcef/src/browser_io.cpp b/addons/gdcef/gdcef/src/browser_io.cpp index ed854af..caaad25 100644 --- a/addons/gdcef/gdcef/src/browser_io.cpp +++ b/addons/gdcef/gdcef/src/browser_io.cpp @@ -249,7 +249,7 @@ void GDBrowserView::keyPress(int key, bool pressed, bool shift, bool alt, bool c if ((key >= 32) && (key <= 126)) // ASCII { - // BROWSER_DEBUG_VAL("ASCII CODE"); + BROWSER_DEBUG_VAL("ASCII CODE"); event.windows_key_code = key; event.character = key16b; event.unmodified_character = key16b; @@ -259,7 +259,7 @@ void GDBrowserView::keyPress(int key, bool pressed, bool shift, bool alt, bool c else if (key == godot::KEY_SPACE || key == godot::KEY_TAB) { - // BROWSER_DEBUG_VAL("KEY_SPACE / KEY_TAB"); + BROWSER_DEBUG_VAL("KEY_SPACE / KEY_TAB"); event.windows_key_code = key; event.character = key16b; event.native_key_code = key; @@ -273,19 +273,19 @@ void GDBrowserView::keyPress(int key, bool pressed, bool shift, bool alt, bool c key == godot::KEY_KP_ENTER ) { if (key == godot::KEY_BACKSPACE) { - // BROWSER_DEBUG_VAL("KEY_BACKSPACE"); + BROWSER_DEBUG_VAL("KEY_BACKSPACE"); event.windows_key_code = 8; event.character = 8; event.unmodified_character = 8; } else if (key == godot::KEY_ENTER) { - // BROWSER_DEBUG_VAL("KEY_ENTER"); + BROWSER_DEBUG_VAL("KEY_ENTER"); event.windows_key_code = 13; event.character = 13; event.unmodified_character = 13; } else if (key == godot::KEY_KP_ENTER) { - // BROWSER_DEBUG_VAL("KEY_KP_ENTER"); + BROWSER_DEBUG_VAL("KEY_KP_ENTER"); event.windows_key_code = 13; event.character = 13; event.unmodified_character = 13; @@ -300,7 +300,7 @@ void GDBrowserView::keyPress(int key, bool pressed, bool shift, bool alt, bool c } else if (key >= 320 && key <= 329) // NUMBERS & NUMPAD { - // BROWSER_DEBUG_VAL("NUMBERS and NUMPAD"); + BROWSER_DEBUG_VAL("NUMBERS and NUMPAD"); event.windows_key_code = key; event.character = key16b; event.native_key_code = key; @@ -324,43 +324,43 @@ void GDBrowserView::keyPress(int key, bool pressed, bool shift, bool alt, bool c // https://keycode.info/ if (key == godot::KEY_RIGHT) { - // BROWSER_DEBUG_VAL("KEY_RIGHT"); + BROWSER_DEBUG_VAL("KEY_RIGHT"); event.windows_key_code = 39; } else if (key == godot::KEY_LEFT) { - // BROWSER_DEBUG_VAL("KEY_LEFT"); + BROWSER_DEBUG_VAL("KEY_LEFT"); event.windows_key_code = 37; } else if (key == godot::KEY_UP) { - // BROWSER_DEBUG_VAL("KEY_UP"); + BROWSER_DEBUG_VAL("KEY_UP"); event.windows_key_code = 38; } else if (key == godot::KEY_DOWN) { - // BROWSER_DEBUG_VAL("KEY_DOWN"); + BROWSER_DEBUG_VAL("KEY_DOWN"); event.windows_key_code = 40; } else if (key == godot::KEY_PAGEUP) { - // BROWSER_DEBUG_VAL("KEY_PAGEUP"); + BROWSER_DEBUG_VAL("KEY_PAGEUP"); event.windows_key_code = 33; } else if (key == godot::KEY_PAGEDOWN) { - // BROWSER_DEBUG_VAL("KEY_PAGEDOWN"); + BROWSER_DEBUG_VAL("KEY_PAGEDOWN"); event.windows_key_code = 34; } else if (key == godot::KEY_HOME) { - // BROWSER_DEBUG_VAL("KEY_HOME"); + BROWSER_DEBUG_VAL("KEY_HOME"); event.windows_key_code = 36; // Debut } else if (key == godot::KEY_END) { - // BROWSER_DEBUG_VAL("KEY_END"); + BROWSER_DEBUG_VAL("KEY_END"); event.windows_key_code = 35; // Fin } else if (key == godot::KEY_INSERT) { - // BROWSER_DEBUG_VAL("KEY_INSERT"); + BROWSER_DEBUG_VAL("KEY_INSERT"); event.windows_key_code = 45; // Insert } else if (key == godot::KEY_DELETE) { - // BROWSER_DEBUG_VAL("KEY_DELETE"); + BROWSER_DEBUG_VAL("KEY_DELETE"); event.windows_key_code = 46; // Del (not dot when no char event) } @@ -371,7 +371,7 @@ void GDBrowserView::keyPress(int key, bool pressed, bool shift, bool alt, bool c } else { - // BROWSER_DEBUG_VAL("Any Char"); + BROWSER_DEBUG_VAL("Any Char"); event.windows_key_code = key; event.character = key16b; event.native_key_code = key; @@ -385,7 +385,7 @@ void GDBrowserView::keyPress(int key, bool pressed, bool shift, bool alt, bool c } else { - // BROWSER_DEBUG_VAL("PRESSED FALSE"); + BROWSER_DEBUG_VAL("PRESSED FALSE"); event.native_key_code |= int(0xC0000000); event.type = KEYEVENT_KEYUP; m_browser->GetHost()->SendKeyEvent(event); diff --git a/addons/gdcef/gdcef/src/gdbrowser.cpp b/addons/gdcef/gdcef/src/gdbrowser.cpp index f0045d7..959dfa7 100644 --- a/addons/gdcef/gdcef/src/gdbrowser.cpp +++ b/addons/gdcef/gdcef/src/gdbrowser.cpp @@ -556,6 +556,8 @@ void GDBrowserView::navigateForward() //------------------------------------------------------------------------------ void GDBrowserView::resize_(int width, int height) { + std::cout << "SIZE: " << width << ", " << height << std::endl; + if (width <= 0) { width = 2; } if (height <= 0) { height = 2; } BROWSER_DEBUG_VAL(width << " x " << height); diff --git a/addons/gdcef/gdcef/src/gdcef.cpp b/addons/gdcef/gdcef/src/gdcef.cpp index 0389ef3..09ab2a3 100644 --- a/addons/gdcef/gdcef/src/gdcef.cpp +++ b/addons/gdcef/gdcef/src/gdcef.cpp @@ -89,7 +89,7 @@ static bool sanity_checks(fs::path const& folder) void GDCef::_bind_methods() { using namespace godot; - GDCEF_DEBUG_VAL("[GDCEF][GDCef::_register_methods]"); + std::cout << "[GDCEF][GDCef::_register_methods]" << std::endl; ClassDB::bind_method(D_METHOD("initialize"), &GDCef::initialize); ClassDB::bind_method(D_METHOD("get_full_version"), &GDCef::version); @@ -233,8 +233,10 @@ static void configureCEF(fs::path const& folder, CefSettings& cef_settings, fs::path sub_process_path = getConfig(config, "browser_subprocess_path", folder / SUBPROCESS_NAME); - GDCEF_DEBUG_VAL("Setting SubProcess path: " << sub_process_path.string()); - CefString(&cef_settings.browser_subprocess_path).FromString(sub_process_path.string()); + std::cout << "[GDCEF][GDCef::configureCEF] Setting SubProcess path: " + << sub_process_path.string() << std::endl; + CefString(&cef_settings.browser_subprocess_path) + .FromString(sub_process_path.string()); // Incognito mode: cache directories not used. if (!getConfig(config, "incognito", false)) @@ -252,7 +254,8 @@ static void configureCEF(fs::path const& folder, CefSettings& cef_settings, fs::path sub_process_cache = getConfig(config, "cache_path", folder / "cache"); - GDCEF_DEBUG_VAL("Setting cache path: " << sub_process_cache.string()); + std::cout << "[GDCEF][GDCef::configureCEF] Setting cache path: " + << sub_process_cache.string() << std::endl; CefString(&cef_settings.cache_path) .FromString(sub_process_cache.string()); diff --git a/addons/gdcef/gdcef/src/helper_files.cpp b/addons/gdcef/gdcef/src/helper_files.cpp index 1c1ef20..7ce53d8 100644 --- a/addons/gdcef/gdcef/src/helper_files.cpp +++ b/addons/gdcef/gdcef/src/helper_files.cpp @@ -45,7 +45,9 @@ bool are_valid_files(fs::path const& folder, // TODO Compute SHA1 on files to check if they are correct if (!fs::exists(f)) { - STATIC_GDCEF_ERROR("File " << f << " does not exist and is needed for CEF"); + std::cout << "[GDCEF] [" << __func__ << "] File " + << f << " does not exist and is needed for CEF" + << std::endl; failure = true; } } diff --git a/addons/gdcef/gdcef/src/helper_log.hpp b/addons/gdcef/gdcef/src/helper_log.hpp index 2f09bd8..b32ee03 100644 --- a/addons/gdcef/gdcef/src/helper_log.hpp +++ b/addons/gdcef/gdcef/src/helper_log.hpp @@ -28,69 +28,27 @@ # include # include -# include "godot_cpp/variant/utility_functions.hpp" // **************************************************************************** // Logging // **************************************************************************** #define GDCEF_DEBUG() \ -do { \ - std::stringstream ss; \ - ss << "[DEBUG][GDCEF][GDCEF::" << __func__ << "]" << std::endl; \ - godot::UtilityFunctions::print_verbose(ss.str().c_str()); \ -} while (0) - + std::cout << "[GDCEF][GDCEF::" << __func__ << "]" << std::endl #define GDCEF_DEBUG_VAL(x) \ -do { \ - std::stringstream ss; \ - ss << "[DEBUG][GDCEF][GDCEF::" << __func__ << "] " << x << std::endl; \ - godot::UtilityFunctions::print_verbose(ss.str().c_str()); \ -} while (0) - + std::cout << "[GDCEF][GDCEF::" << __func__ << "] " << x << std::endl #define GDCEF_ERROR(x) \ -do { \ - m_error.str(std::string()); \ - m_error << "[ERROR][GDCEF][GDCEF::" << __func__ << "] " \ - << x << std::endl; \ - godot::UtilityFunctions::push_error(m_error.str().c_str()); \ -} while (0) - + m_error << "[GDCEF][GDCEF::" << __func__ << "] " << x << std::endl #define GDCEF_WARNING(x) \ -do { \ - std::stringstream ss; \ - ss << "[WARNING][GDCEF][GDCEF::" << __func__ << "] " << x << std::endl; \ - godot::UtilityFunctions::push_warning(ss.str().c_str()); \ -} while (0) - + std::cout << "[GDCEF][GDCEF::" << __func__ << "] " << x << std::endl #define BROWSER_DEBUG() \ -do { \ - std::stringstream ss; \ - ss << "[DEBUG][GDCEF][BrowserView::" << __func__ << "][" << m_id << "]" \ - << std::endl; \ - godot::UtilityFunctions::print_verbose(m_error.str().c_str()); \ -} while (0) - + std::cout << "[GDCEF][BrowserView::" << __func__ << "][" << m_id << "]" \ + << std::endl #define BROWSER_DEBUG_VAL(x) \ -do { \ - std::stringstream ss; \ - ss << "[DEBUG][GDCEF][BrowserView::" << __func__ << "][" \ - << m_id << "] " << x << std::endl; \ - godot::UtilityFunctions::print_verbose(ss.str().c_str()); \ -} while (0) - + std::cout << "[GDCEF][BrowserView::" << __func__ << "][" << m_id << "] " \ + << x << std::endl #define BROWSER_ERROR(x) \ -do { \ - m_error.str(std::string()); \ - m_error << "[ERROR][GDCEF][BrowserView::" << __func__ << "][" \ - << m_id << "] " << x << std::endl; \ - godot::UtilityFunctions::push_error(m_error.str().c_str()); \ -} while (0) - -#define STATIC_GDCEF_ERROR(x) \ -do { \ - std::stringstream ss; \ - ss << "[ERROR][GDCEF][" << __func__ << "]" << x << std::endl; \ - godot::UtilityFunctions::push_error(ss.str().c_str()); \ -} while (0) + m_error << "[GDCEF][BrowserView::" << __func__ << "][" << m_id << "] " \ + << x << std::endl; \ + std::cerr << m_error.str() -#endif // GDCEF_HELPER_LOG_HPP \ No newline at end of file +#endif // GDCEF_HELPER_LOG_HPP