1 /* -*- mode: C; indent-tabs-mode: t; tab-width: 8; c-basic-offset: 2; -*- */
4 * This file is part of Seed, the GObject Introspection<->Javascript bindings.
6 * Seed is free software: you can redistribute it and/or modify
7 * it under the terms of the GNU Lesser General Public License as
8 * published by the Free Software Foundation, either version 3 of
9 * the License, or (at your option) any later version.
10 * Seed is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public License
15 * along with Seed. If not, see <http://www.gnu.org/licenses/>.
17 * Copyright (C) Robert Carr 2009 <carrr@rpi.edu>
23 #include "seed-private.h"
25 extern GQuark js_ref_quark;
27 JSValueRef seed_value_from_gvalue (JSContextRef ctx,
28 GValue * gval, JSValueRef * exception);
30 JSValueRef seed_object_get_property (JSContextRef ctx,
31 JSObjectRef val, const gchar * name);
33 gboolean seed_object_set_property (JSContextRef ctx, JSObjectRef object,
34 const gchar * name, JSValueRef value);
35 gboolean seed_gvalue_from_seed_value (JSContextRef ctx,
36 JSValueRef val, GType type,
37 GValue * gval, JSValueRef * exception);
39 gboolean seed_gi_make_argument (JSContextRef ctx,
41 GITypeInfo * type_info,
42 GArgument * arg, JSValueRef * exception);
43 JSValueRef seed_gi_argument_make_js (JSContextRef ctx,
45 GITypeInfo * type_info,
46 JSValueRef * exception);
48 gboolean seed_gi_release_arg (GITransfer transfer,
49 GITypeInfo * type_info, GArgument * arg);
51 gboolean seed_gi_release_in_arg (GITransfer transfer,
52 GITypeInfo * type_info, GArgument * arg);
54 gboolean seed_value_to_boolean (JSContextRef ctx,
55 JSValueRef val, JSValueRef * exception);
57 JSValueRef seed_value_from_boolean (JSContextRef ctx,
58 gboolean val, JSValueRef * exception);
60 guint seed_value_to_uint (JSContextRef ctx,
61 JSValueRef val, JSValueRef * exception);
63 JSValueRef seed_value_from_uint (JSContextRef ctx,
64 guint val, JSValueRef * exception);
66 gint seed_value_to_int (JSContextRef ctx,
67 JSValueRef val, JSValueRef * exception);
69 JSValueRef seed_value_from_int (JSContextRef ctx,
70 gint val, JSValueRef * exception);
72 gchar seed_value_to_char (JSContextRef ctx,
73 JSValueRef val, JSValueRef * exception);
74 JSValueRef seed_value_from_char (JSContextRef ctx,
75 gchar val, JSValueRef * exception);
77 guchar seed_value_to_uchar (JSContextRef ctx,
78 JSValueRef val, JSValueRef * exception);
79 JSValueRef seed_value_from_uchar (JSContextRef ctx,
80 guchar val, JSValueRef * exception);
82 glong seed_value_to_long (JSContextRef ctx,
83 JSValueRef val, JSValueRef * exception);
84 JSValueRef seed_value_from_long (JSContextRef ctx,
85 glong val, JSValueRef * exception);
87 gulong seed_value_to_ulong (JSContextRef ctx,
88 JSValueRef val, JSValueRef * exception);
89 JSValueRef seed_value_from_ulong (JSContextRef ctx,
90 gulong val, JSValueRef * exception);
92 gint64 seed_value_to_int64 (JSContextRef ctx,
93 JSValueRef val, JSValueRef * exception);
94 JSValueRef seed_value_from_int64 (JSContextRef ctx,
95 gint64 val, JSValueRef * exception);
97 guint64 seed_value_to_uint64 (JSContextRef ctx,
98 JSValueRef val, JSValueRef * exception);
99 JSValueRef seed_value_from_uint64 (JSContextRef ctx,
100 guint64 val, JSValueRef * exception);
102 gfloat seed_value_to_float (JSContextRef ctx,
103 JSValueRef val, JSValueRef * exception);
104 JSValueRef seed_value_from_float (JSContextRef ctx,
105 gfloat val, JSValueRef * exception);
107 gdouble seed_value_to_double (JSContextRef ctx,
108 JSValueRef val, JSValueRef * exception);
109 JSValueRef seed_value_from_double (JSContextRef ctx,
110 gdouble val, JSValueRef * exception);
112 gsize seed_value_to_size (JSContextRef ctx,
113 JSValueRef val, JSValueRef * exception);
114 JSValueRef seed_value_from_size (JSContextRef ctx,
115 gsize val, JSValueRef * exception);
117 gssize seed_value_to_ssize (JSContextRef ctx,
118 JSValueRef val, JSValueRef * exception);
119 JSValueRef seed_value_from_ssize (JSContextRef ctx,
120 gssize val, JSValueRef * exception);
122 gchar *seed_value_to_filename (JSContextRef ctx,
123 JSValueRef val, JSValueRef * exception);
124 JSValueRef seed_value_from_filename (JSContextRef ctx,
125 const gchar * filename,
126 JSValueRef * exception);
128 gchar *seed_value_to_string (JSContextRef ctx,
129 JSValueRef val, JSValueRef * exception);
131 JSValueRef seed_value_from_string (JSContextRef ctx,
132 const gchar * val, JSValueRef * exception);
134 time_t seed_value_to_time_t (JSContextRef ctx,
135 JSValueRef val, JSValueRef * exception);
137 JSValueRef seed_value_from_time_t (JSContextRef ctx,
138 time_t time, JSValueRef * exception);
140 GObject *seed_value_to_object (JSContextRef ctx,
141 JSValueRef val, JSValueRef * exception);
142 JSValueRef seed_value_from_object (JSContextRef ctx,
143 GObject * val, JSValueRef * exception);
145 void seed_toggle_ref (gpointer data, GObject * object, gboolean is_last_ref);
147 gboolean seed_validate_enum (GIEnumInfo * info, long val);
150 seed_value_from_binary_string (JSContextRef ctx,
152 gint n_bytes, JSValueRef * exception);
154 JSObjectRef seed_make_wrapper_for_type (JSContextRef ctx, GType type);