#include "runtime/browser/native_window.h"
+#include <efl_util.h>
#include <Ecore_Wayland.h>
#include <EWebKit.h>
#include <EWebKit_internal.h>
currentViewModeFullScreen_ = mode;
}
+int NativeWindow::SetWindowBrightness(int brightness) {
+ if (brightness > 100)
+ brightness = 100;
+
+ return efl_util_set_window_brightness(window_, brightness);
+}
+
+int NativeWindow::GetWindowBrightness(int& brightness) {
+ return efl_util_get_window_brightness(window_, &brightness);
+}
+
void NativeWindow::Show() {
evas_object_show(window_);
}
void SetRotationLock(ScreenOrientation orientation);
void SetAutoRotation();
void SetCurrentViewModeFullScreen(bool mode);
+ int SetWindowBrightness(int brightness);
+ int GetWindowBrightness(int& brightness);
int AddRotationHandler(RotationHandler handler);
void RemoveRotationHandler(int id);
int rotation() const { return rotation_; }
#include <Ecore.h>
#include <algorithm>
+#include <cstdlib>
#include <map>
#include <memory>
#include <fstream>
+#include <string>
#include <sstream>
#include <vector>
ewk_ipc_wrt_message_data_del(ans);
} else if (TYPE_IS("tizen://hide_splash_screen")) {
splash_screen_->HideSplashScreen(SplashScreen::HideReason::CUSTOM);
+ } else if (TYPE_IS("tizen://set_window_brightness")) {
+ // Brightness value parsing
+ long l_brightness = strtol(msg_value, nullptr, 10);
+ if (l_brightness == 0 && strncmp(msg_value, "0", 1)) {
+ LOGGER(ERROR) << "Received invalid brightness value: " << msg_value;
+ ewk_ipc_wrt_message_data_value_set(msg, "error");
+ }
+
+ int brightness = static_cast<int>(l_brightness);
+ if (!window_->SetWindowBrightness(brightness)) {
+ ewk_ipc_wrt_message_data_value_set(msg, "success");
+ } else {
+ ewk_ipc_wrt_message_data_value_set(msg, "error");
+ }
+ } else if (TYPE_IS("tizen://get_window_brightness")) {
+ int brightness;
+ int status = window_->GetWindowBrightness(brightness);
+ std::string answer = "{\"status\":\"";
+ if (status == 0) {
+ answer += "success\",\"result\":";
+ answer += std::to_string(brightness) + "}";
+ } else {
+ answer += "error\"}";
+ }
+ ewk_ipc_wrt_message_data_value_set(msg, answer.c_str());
}
eina_stringshare_del(msg_ref_id);