| 1 |
/* |
| 2 |
* MDRubyExtern.h |
| 3 |
* Alchemusica |
| 4 |
* |
| 5 |
* Created by Toshi Nagata on 09/08/23. |
| 6 |
* Copyright 2009-2017 Toshi Nagata. All rights reserved. |
| 7 |
* |
| 8 |
This program is free software; you can redistribute it and/or modify |
| 9 |
it under the terms of the GNU General Public License as published by |
| 10 |
the Free Software Foundation version 2 of the License. |
| 11 |
|
| 12 |
This program is distributed in the hope that it will be useful, |
| 13 |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 14 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 15 |
GNU General Public License for more details. |
| 16 |
*/ |
| 17 |
|
| 18 |
#ifndef __MDRubyExtern__ |
| 19 |
#define __MDRubyExtern__ |
| 20 |
|
| 21 |
#ifdef __cplusplus |
| 22 |
extern "C" { |
| 23 |
#endif |
| 24 |
|
| 25 |
#ifndef STUB |
| 26 |
#define STUB extern |
| 27 |
#endif |
| 28 |
|
| 29 |
/* This definition is intended to work around 'VALUE' type in sources without "ruby.h" */ |
| 30 |
#ifndef RubyValue_is_Defined |
| 31 |
#define RubyValue_is_Defined |
| 32 |
typedef void *RubyValue; |
| 33 |
#define RubyNil (RubyValue)4 |
| 34 |
#define RubyFalse (RubyValue)0 |
| 35 |
#endif |
| 36 |
|
| 37 |
extern int gRubyRunLevel; |
| 38 |
extern int gRubyIsCheckingInterrupt; |
| 39 |
|
| 40 |
extern void Ruby_startup(void); |
| 41 |
extern void Ruby_showError(int status); |
| 42 |
//extern RubyValue MDRuby_evalRubyScript(const char *script, int *status); |
| 43 |
//extern RubyValue MDRuby_evalRubyScriptOnActiveDocumentWithInterrupt(const char *script, int *status); |
| 44 |
extern int Ruby_callMethodOfDocument(const char *name, void *doc, int isSingleton, const char *argfmt,...); |
| 45 |
extern RubyValue Ruby_evalRubyScriptOnDocument(const char *script, void *doc, int *status); |
| 46 |
extern int Ruby_showValue(RubyValue value, char **outValueString); |
| 47 |
extern int Ruby_methodType(const char *className, const char *methodName); |
| 48 |
extern int Ruby_callValidatorForDocument(int32_t validator, void *doc); |
| 49 |
|
| 50 |
/* Housekeeping "Document" type Ruby values */ |
| 51 |
extern int MRSequenceRegister(void *myDocument); |
| 52 |
extern int MRSequenceUnregister(void *myDocument); |
| 53 |
|
| 54 |
void Ruby_getVersionStrings(const char **version, const char **copyright); |
| 55 |
|
| 56 |
STUB const char *MyAppCallback_getGlobalSettings(const char *key); |
| 57 |
STUB void MyAppCallback_setGlobalSettings(const char *key, const char *value); |
| 58 |
STUB void MyAppCallback_saveGlobalSettings(void); |
| 59 |
STUB int MyAppCallback_showScriptMessage(const char *fmt, ...); |
| 60 |
STUB void MyAppCallback_setConsoleColor(int color); |
| 61 |
STUB void MyAppCallback_showRubyPrompt(void); |
| 62 |
STUB int MyAppCallback_checkInterrupt(void); |
| 63 |
STUB int MyAppCallback_showProgressPanel(const char *msg); |
| 64 |
STUB void MyAppCallback_hideProgressPanel(void); |
| 65 |
STUB void MyAppCallback_setProgressValue(double dval); |
| 66 |
STUB void MyAppCallback_setProgressMessage(const char *msg); |
| 67 |
STUB void MyAppCallback_registerScriptMenu(const char *cmd, const char *title, int32_t validator); |
| 68 |
STUB RubyValue MyAppCallback_executeScriptFromFile(const char *path, int *status); |
| 69 |
STUB int MyAppCallback_messageBox(const char *message, const char *title, int flags, int icon); |
| 70 |
|
| 71 |
#ifdef __cplusplus |
| 72 |
} |
| 73 |
#endif |
| 74 |
|
| 75 |
#endif /* __MDRubyExtern__ */ |