From 948de95a89254043b9463d5a67bbcd024d67be53 Mon Sep 17 00:00:00 2001 From: ZakatTeamI2P Date: Sun, 19 Apr 2026 19:07:12 +0200 Subject: [PATCH] =?UTF-8?q?=D0=AF=20=D0=BF=D0=BE=D0=B9=D0=B4=D1=83=20?= =?UTF-8?q?=D1=87=D0=B8=D1=82=D0=B0=D1=82=D1=8C=20=D0=B4=D0=BE=D0=BA=D1=83?= =?UTF-8?q?=D0=BC=D0=B5=D0=BD=D1=82=D0=B0=D1=86=D0=B8=D1=8E=20=D1=80=D1=83?= =?UTF-8?q?=D0=B1=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CMakeLists.txt | 1 + binding-mri/binding-mri.cpp | 2 ++ binding-mri/oneshot-binding.cpp | 30 ++++++++++-------------------- binding-mri/sunshine-binding.cpp | 15 +++++++++++++++ binding-mri/wallpaper-binding.cpp | 3 +-- binding-mri/window-binding.cpp | 3 +-- 6 files changed, 30 insertions(+), 24 deletions(-) create mode 100644 binding-mri/sunshine-binding.cpp diff --git a/CMakeLists.txt b/CMakeLists.txt index 1d99d54..2e8a640 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -269,6 +269,7 @@ set(BINDING_SOURCE binding-mri/module_rpg.cpp binding-mri/filesystem-binding.cpp binding-mri/oneshot-binding.cpp + binding-mri/sunshine-binding.cpp binding-mri/steam-binding.cpp binding-mri/wallpaper-binding.cpp binding-mri/journal-binding.cpp diff --git a/binding-mri/binding-mri.cpp b/binding-mri/binding-mri.cpp index e320bee..0f24640 100644 --- a/binding-mri/binding-mri.cpp +++ b/binding-mri/binding-mri.cpp @@ -79,6 +79,7 @@ void wallpaperBindingTerminate(); #endif void nikoBindingInit(); void oneshotBindingInit(); +void SunshineBindingInit(); void steamBindingInit(); void chromaBindingInit(); @@ -114,6 +115,7 @@ static void mriBindingInit(){ wallpaperBindingInit(); nikoBindingInit(); oneshotBindingInit(); + SunshineBindingInit(); steamBindingInit(); chromaBindingInit(); diff --git a/binding-mri/oneshot-binding.cpp b/binding-mri/oneshot-binding.cpp index ed04aad..4c8400d 100644 --- a/binding-mri/oneshot-binding.cpp +++ b/binding-mri/oneshot-binding.cpp @@ -8,8 +8,7 @@ #include #include -RB_METHOD(oneshotSetYesNo) -{ +RB_METHOD(oneshotSetYesNo){ RB_UNUSED_PARAM; const char *yes; const char *no; @@ -18,8 +17,7 @@ RB_METHOD(oneshotSetYesNo) return Qnil; } -RB_METHOD(oneshotMsgBox) -{ +RB_METHOD(oneshotMsgBox){ RB_UNUSED_PARAM; int type; VALUE body; @@ -30,8 +28,7 @@ RB_METHOD(oneshotMsgBox) return rb_bool_new(shState->oneshot().msgbox(type, bodyStr.c_str(), titleStr.c_str())); } -RB_METHOD(oneshotTextInput) -{ +RB_METHOD(oneshotTextInput){ RB_UNUSED_PARAM; VALUE prompt; int char_limit = 100; @@ -42,21 +39,18 @@ RB_METHOD(oneshotTextInput) return rb_str_new2(shState->oneshot().textinput(promptStr.c_str(), char_limit, fontStr.c_str()).c_str()); } -RB_METHOD(oneshotResetObscured) -{ +RB_METHOD(oneshotResetObscured){ RB_UNUSED_PARAM; shState->oneshot().resetObscured(); return Qnil; } -RB_METHOD(oneshotObscuredCleared) -{ +RB_METHOD(oneshotObscuredCleared){ RB_UNUSED_PARAM; return shState->oneshot().obscuredCleared() ? Qtrue : Qfalse; } -RB_METHOD(oneshotAllowExit) -{ +RB_METHOD(oneshotAllowExit){ RB_UNUSED_PARAM; bool allowExit; rb_get_args(argc, argv, "b", &allowExit RB_ARG_END); @@ -64,8 +58,7 @@ RB_METHOD(oneshotAllowExit) return Qnil; } -RB_METHOD(oneshotExiting) -{ +RB_METHOD(oneshotExiting){ RB_UNUSED_PARAM; bool exiting; rb_get_args(argc, argv, "b", &exiting RB_ARG_END); @@ -73,8 +66,7 @@ RB_METHOD(oneshotExiting) return Qnil; } -RB_METHOD(oneshotShake) -{ +RB_METHOD(oneshotShake){ RB_UNUSED_PARAM; int absx, absy; SDL_GetWindowPosition(shState->rtData().window, &absx, &absy); @@ -90,8 +82,7 @@ RB_METHOD(oneshotShake) return Qnil; } -RB_METHOD(oneshotCRC32) -{ +RB_METHOD(oneshotCRC32){ RB_UNUSED_PARAM; VALUE string; boost::crc_32_type result; @@ -101,8 +92,7 @@ RB_METHOD(oneshotCRC32) return UINT2NUM(result.checksum()); } -void oneshotBindingInit() -{ +void oneshotBindingInit(){ VALUE module = rb_define_module("Oneshot"); VALUE msg = rb_define_module_under(module, "Msg"); diff --git a/binding-mri/sunshine-binding.cpp b/binding-mri/sunshine-binding.cpp new file mode 100644 index 0000000..2a49cb7 --- /dev/null +++ b/binding-mri/sunshine-binding.cpp @@ -0,0 +1,15 @@ +#include "oneshot.h" +#include "etc.h" +#include "sharedstate.h" +#include "binding-util.h" +#include "binding-types.h" +#include "eventthread.h" + +#include +#include +//for future use + +void SunshineBindingInit(){ + VALUE module = rb_define_module("Sunshine"); + rb_const_set(module, rb_intern("SDLVersion"), static_cast(SDL_VERSION)); +} diff --git a/binding-mri/wallpaper-binding.cpp b/binding-mri/wallpaper-binding.cpp index e0c272e..348fbe7 100644 --- a/binding-mri/wallpaper-binding.cpp +++ b/binding-mri/wallpaper-binding.cpp @@ -359,8 +359,7 @@ end: return Qnil; } -RB_METHOD(wallpaperReset) -{ +RB_METHOD(wallpaperReset){ RB_UNUSED_PARAM; #ifdef _WIN32 if (isCached) { diff --git a/binding-mri/window-binding.cpp b/binding-mri/window-binding.cpp index ec651ed..8854bb1 100644 --- a/binding-mri/window-binding.cpp +++ b/binding-mri/window-binding.cpp @@ -67,8 +67,7 @@ DEF_PROP_I(Window, BackOpacity) DEF_PROP_I(Window, ContentsOpacity) -void -windowBindingInit(){ +void windowBindingInit(){ VALUE klass = rb_define_class("Window", rb_cObject); rb_define_alloc_func(klass, classAllocate<&WindowType>);