mirror of
https://forgejo.xatacraft.ru/Sunshine/mkxp-sunshine.git
synced 2026-08-19 21:39:57 +00:00
Я пойду читать документацию руби
This commit is contained in:
parent
17c3f38685
commit
948de95a89
6 changed files with 30 additions and 24 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
|
||||
|
|
|
|||
|
|
@ -8,8 +8,7 @@
|
|||
#include <SDL3/SDL.h>
|
||||
#include <boost/crc.hpp>
|
||||
|
||||
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");
|
||||
|
||||
|
|
|
|||
15
binding-mri/sunshine-binding.cpp
Normal file
15
binding-mri/sunshine-binding.cpp
Normal file
|
|
@ -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 <SDL3/SDL.h>
|
||||
#include <SDL3/SDL_version.h>
|
||||
//for future use
|
||||
|
||||
void SunshineBindingInit(){
|
||||
VALUE module = rb_define_module("Sunshine");
|
||||
rb_const_set(module, rb_intern("SDLVersion"), static_cast<char>(SDL_VERSION));
|
||||
}
|
||||
|
|
@ -359,8 +359,7 @@ end:
|
|||
return Qnil;
|
||||
}
|
||||
|
||||
RB_METHOD(wallpaperReset)
|
||||
{
|
||||
RB_METHOD(wallpaperReset){
|
||||
RB_UNUSED_PARAM;
|
||||
#ifdef _WIN32
|
||||
if (isCached) {
|
||||
|
|
|
|||
|
|
@ -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>);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue