2 /******************************************************************************
4 * DESCRIPTION: Scheme objects
5 * COPYRIGHT : (C) 1999 Joris van der Hoeven
6 *******************************************************************************
7 * This software falls under the GNU general public license version 3 or later.
8 * It comes WITHOUT ANY WARRANTY WHATSOEVER. For details, see the file LICENSE
9 * in the root directory or <http://www.gnu.org/licenses/gpl-3.0.html>.
10 ******************************************************************************/
16 #include "command.hpp"
20 // we redefine some symbols to avoid name clashes with Windows headers (included by Guile)
21 #define PATTERN WIN_PATTERN
22 #define STRING WIN_STRING
23 #define GROUP WIN_GROUP
33 #define MY_MENU_EVENT MENU_EVENT
45 #define MENU_EVENT MY_MENU_EVENT
61 class object_rep
: concrete_struct
{
72 inline object (SCM obj
): rep (tm_new
<object_rep
> (obj
)) {}
76 object (const char* s
);
79 object (list
<string
> l
);
80 object (list
<tree
> l
);
84 CONCRETE_CODE(object
);
86 ostream
& operator << (ostream
& out
, object obj
);
87 bool operator == (object obj1
, object obj2
);
88 bool operator != (object obj1
, object obj2
);
90 object
null_object ();
91 object
list_object (object obj1
);
92 object
list_object (object obj1
, object obj2
);
93 object
list_object (object obj1
, object obj2
, object obj3
);
94 object
symbol_object (string s
);
95 object
cons (object obj1
, object obj2
);
96 object
car (object obj
);
97 object
cdr (object obj
);
98 object
caar (object obj
);
99 object
cdar (object obj
);
100 object
cadr (object obj
);
101 object
cddr (object obj
);
102 object
caddr (object obj
);
103 object
cadddr (object obj
);
105 bool is_null (object obj
);
106 bool is_list (object obj
);
107 bool is_bool (object obj
);
108 bool is_int (object obj
);
109 bool is_string (object obj
);
110 bool is_symbol (object obj
);
111 bool is_tree (object obj
);
112 bool is_path (object obj
);
113 bool is_url (object obj
);
115 bool as_bool (object obj
);
116 int as_int (object obj
);
117 string
as_string (object obj
);
118 string
as_symbol (object obj
);
119 tree
as_tree (object obj
);
120 scheme_tree
as_scheme_tree (object obj
);
121 list
<string
> as_list_string (object obj
);
122 list
<tree
> as_list_tree (object obj
);
123 path
as_path (object obj
);
124 url
as_url (object obj
);
125 command
as_command (object obj
);
126 #ifdef WIDGET_H // FIXME: dirty hack
127 widget
as_widget (object obj
);
128 promise
<widget
> as_promise_widget (object obj
);
131 object
tree_to_stree (tree t
);
132 tree
stree_to_tree (object obj
);
133 tree
content_to_tree (object obj
);
134 object
string_to_object (string s
);
135 string
object_to_string (object obj
);
136 object
scheme_cmd (const char* s
);
137 object
scheme_cmd (string s
);
138 object
scheme_cmd (object cmd
);
140 object
eval (const char* expr
);
141 object
eval (string expr
);
142 object
eval (object expr
);
143 object
eval_secure (string expr
);
144 object
eval_file (string name
);
145 bool exec_file (url u
);
146 void exec_delayed (object cmd
);
147 void exec_delayed_pause (object cmd
);
148 void exec_pending_commands ();
150 object
call (const char* fun
);
151 object
call (const char* fun
, object a1
);
152 object
call (const char* fun
, object a1
, object a2
);
153 object
call (const char* fun
, object a1
, object a2
, object a3
);
154 object
call (const char* fun
, object a1
, object a2
, object a3
, object a4
);
155 object
call (const char* fun
, array
<object
> a
);
156 object
call (string fun
);
157 object
call (string fun
, object a1
);
158 object
call (string fun
, object a1
, object a2
);
159 object
call (string fun
, object a1
, object a2
, object a3
);
160 object
call (string fun
, object a1
, object a2
, object a3
, object a4
);
161 object
call (string fun
, array
<object
> a
);
162 object
call (object fun
);
163 object
call (object fun
, object a1
);
164 object
call (object fun
, object a1
, object a2
);
165 object
call (object fun
, object a1
, object a2
, object a3
);
166 object
call (object fun
, object a1
, object a2
, object a3
, object a4
);
167 object
call (object fun
, array
<object
> a
);
169 #endif // defined OBJECT_H