Lines Matching refs:Window
63 static bool on_touch_handler(intptr_t owner, Window::InputState state, float x, float y, void* user… in on_touch_handler()
76 static bool on_mouse_handler(int x, int y, Window::InputState state, uint32_t modifiers, in on_mouse_handler()
81 if (Window::kDown_InputState == state) { in on_mouse_handler()
83 } else if (Window::kUp_InputState == state) { in on_mouse_handler()
95 static bool on_key_handler(Window::Key key, Window::InputState state, uint32_t modifiers, in on_key_handler()
98 io.KeysDown[static_cast<int>(key)] = (Window::kDown_InputState == state); in on_key_handler()
159 const char *kBackendTypeStrings[sk_app::Window::kBackendTypeCount] = {
167 static sk_app::Window::BackendType get_backend_type(const char* str) { in get_backend_type()
170 return sk_app::Window::kVulkan_BackendType; in get_backend_type()
174 return sk_app::Window::kNativeGL_BackendType; in get_backend_type()
176 return sk_app::Window::kRaster_BackendType; in get_backend_type()
179 return sk_app::Window::kRaster_BackendType; in get_backend_type()
244 , fBackendType(sk_app::Window::kNativeGL_BackendType) in Viewer()
286 fWindow = Window::CreateNativeWindow(platformData); in Viewer()
338 fCommands.addCommand(Window::Key::kRight, "Right", "Navigation", "Next slide", [this]() { in Viewer()
346 fCommands.addCommand(Window::Key::kLeft, "Left", "Navigation", "Previous slide", [this]() { in Viewer()
354 fCommands.addCommand(Window::Key::kUp, "Up", "Transform", "Zoom in", [this]() { in Viewer()
358 fCommands.addCommand(Window::Key::kDown, "Down", "Transform", "Zoom out", [this]() { in Viewer()
363 sk_app::Window::BackendType newBackend = fBackendType; in Viewer()
365 if (sk_app::Window::kRaster_BackendType == fBackendType) { in Viewer()
366 newBackend = sk_app::Window::kNativeGL_BackendType; in Viewer()
368 } else if (sk_app::Window::kNativeGL_BackendType == fBackendType) { in Viewer()
369 newBackend = sk_app::Window::kVulkan_BackendType; in Viewer()
372 newBackend = sk_app::Window::kRaster_BackendType; in Viewer()
376 if (sk_app::Window::kRaster_BackendType == fBackendType) { in Viewer()
377 newBackend = sk_app::Window::kNativeGL_BackendType; in Viewer()
378 } else if (sk_app::Window::kNativeGL_BackendType == fBackendType) { in Viewer()
379 newBackend = sk_app::Window::kRaster_BackendType; in Viewer()
401 io.KeyMap[ImGuiKey_Tab] = (int)Window::Key::kTab; in Viewer()
402 io.KeyMap[ImGuiKey_LeftArrow] = (int)Window::Key::kLeft; in Viewer()
403 io.KeyMap[ImGuiKey_RightArrow] = (int)Window::Key::kRight; in Viewer()
404 io.KeyMap[ImGuiKey_UpArrow] = (int)Window::Key::kUp; in Viewer()
405 io.KeyMap[ImGuiKey_DownArrow] = (int)Window::Key::kDown; in Viewer()
406 io.KeyMap[ImGuiKey_PageUp] = (int)Window::Key::kPageUp; in Viewer()
407 io.KeyMap[ImGuiKey_PageDown] = (int)Window::Key::kPageDown; in Viewer()
408 io.KeyMap[ImGuiKey_Home] = (int)Window::Key::kHome; in Viewer()
409 io.KeyMap[ImGuiKey_End] = (int)Window::Key::kEnd; in Viewer()
410 io.KeyMap[ImGuiKey_Delete] = (int)Window::Key::kDelete; in Viewer()
411 io.KeyMap[ImGuiKey_Backspace] = (int)Window::Key::kBack; in Viewer()
412 io.KeyMap[ImGuiKey_Enter] = (int)Window::Key::kOK; in Viewer()
413 io.KeyMap[ImGuiKey_Escape] = (int)Window::Key::kEscape; in Viewer()
414 io.KeyMap[ImGuiKey_A] = (int)Window::Key::kA; in Viewer()
415 io.KeyMap[ImGuiKey_C] = (int)Window::Key::kC; in Viewer()
416 io.KeyMap[ImGuiKey_V] = (int)Window::Key::kV; in Viewer()
417 io.KeyMap[ImGuiKey_X] = (int)Window::Key::kX; in Viewer()
418 io.KeyMap[ImGuiKey_Y] = (int)Window::Key::kY; in Viewer()
419 io.KeyMap[ImGuiKey_Z] = (int)Window::Key::kZ; in Viewer()
686 void Viewer::setBackend(sk_app::Window::BackendType backendType) { in setBackend()
694 if (sk_app::Window::kVulkan_BackendType == fBackendType) { in setBackend()
696 fWindow = Window::CreateNativeWindow(nullptr); in setBackend()
825 io.KeyAlt = io.KeysDown[static_cast<int>(Window::Key::kOption)]; in onPaint()
826 io.KeyCtrl = io.KeysDown[static_cast<int>(Window::Key::kCtrl)]; in onPaint()
827 io.KeyShift = io.KeysDown[static_cast<int>(Window::Key::kShift)]; in onPaint()
849 bool Viewer::onTouch(intptr_t owner, Window::InputState state, float x, float y) { in onTouch()
853 case Window::kUp_InputState: { in onTouch()
857 case Window::kDown_InputState: { in onTouch()
861 case Window::kMove_InputState: { in onTouch()
1009 ImGui::RadioButton("Raster", &newBackend, sk_app::Window::kRaster_BackendType); in drawImGui()
1011 ImGui::RadioButton("OpenGL", &newBackend, sk_app::Window::kNativeGL_BackendType); in drawImGui()
1014 ImGui::RadioButton("Vulkan", &newBackend, sk_app::Window::kVulkan_BackendType); in drawImGui()
1018 this->setBackend(static_cast<sk_app::Window::BackendType>(newBackend)); in drawImGui()
1273 if (sk_app::Window::kRaster_BackendType == fBackendType) { in updateUIState()
1375 for (int i = 0; i < sk_app::Window::kBackendTypeCount; i++) { in onUIStateChanged()
1378 fBackendType = (sk_app::Window::BackendType)i; in onUIStateChanged()
1433 bool Viewer::onKey(sk_app::Window::Key key, sk_app::Window::InputState state, uint32_t modifiers) { in onKey()