4 * Created by Toshi Nagata on 2008/11/05.
5 * Copyright 2005-2008 Toshi Nagata. All rights reserved.
7 This program is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation version 2 of the License.
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
17 #ifndef __Molby_extern_h__
18 #define __Molby_extern_h__
24 #include "../MolLib.h"
26 /* This definition is to work around 'VALUE' type in sources without "ruby.h" */
27 typedef void *RubyValue;
29 extern char *gRubyVersion;
30 extern char *gRubyCopyright;
32 extern void Molby_startup(const char *script_path, const char *dir);
33 extern char *Molby_getDescription(void);
34 extern void Molby_showError(int status);
35 extern RubyValue Molby_evalRubyScriptOnMolecule(const char *script, Molecule *mol, const char *fname, int *status);
36 /* extern RubyValue Molby_evalRubyScript(const char *script, int *status);
37 extern RubyValue Molby_evalRubyScriptOnActiveMoleculeWithInterrupt(const char *script, int *status); */
38 extern void Molby_showRubyValue(RubyValue value, char **outValueString);
39 extern int Ruby_methodType(const char *className, const char *methodName);
40 extern void Molby_buildARGV(int argc, const char **argv);
42 STUB char *MyAppCallback_getGUIDescriptionString(void);
43 STUB char *MyAppCallback_getGlobalSettings(const char *key);
44 STUB void MyAppCallback_setGlobalSettings(const char *key, const char *value);
45 STUB int MyAppCallback_getGlobalSettingsWithType(const char *key, int type, void *ptr);
46 STUB int MyAppCallback_setGlobalSettingsWithType(const char *key, int type, const void *ptr);
47 STUB int MyAppCallback_showScriptMessage(const char *fmt, ...);
48 STUB void MyAppCallback_setConsoleColor(int color);
49 STUB void MyAppCallback_showRubyPrompt(void);
50 STUB int MyAppCallback_checkInterrupt(void);
51 STUB void MyAppCallback_showProgressPanel(const char *msg);
52 STUB void MyAppCallback_hideProgressPanel(void);
53 STUB void MyAppCallback_setProgressValue(double dval);
54 STUB void MyAppCallback_setProgressMessage(const char *msg);
55 //STUB int MyAppCallback_processUIWithTimeout(double seconds);
56 STUB int MyAppCallback_getTextWithPrompt(const char *prompt, char *buf, int bufsize);
57 STUB int MyAppCallback_messageBox(const char *message, const char *title, int flags, int icon);
58 STUB void MyAppCallback_errorMessageBox(const char *fmt, ...);
59 STUB char *MyAppCallback_getHomeDir(void);
60 STUB char *MyAppCallback_getDocumentHomeDir(void);
61 STUB void MyAppCallback_registerScriptMenu(const char *cmd, const char *title);
62 STUB int MyAppCallback_lookupScriptMenu(const char *title);
63 STUB RubyValue MyAppCallback_executeScriptFromFile(const char *path, int *status);
64 STUB int MyAppCallback_callSubProcess(const char *cmdline, const char *procname, int (*callback)(void *), void *callback_data);
65 STUB void MyAppCallback_beginUndoGrouping(void);
66 STUB void MyAppCallback_endUndoGrouping(void);
67 STUB int MyAppCallback_switchToFilterMode(void);
68 STUB void MyAppCallback_showConsoleWindow(void);
69 STUB void MyAppCallback_hideConsoleWindow(void);
71 #define DUMMY_CALLBACK ((int (*)(void *))1)
77 #endif /* __Molby_h__ */