~ubuntu-branches/ubuntu/wily/lua-lgi/wily-proposed

« back to all changes in this revision

Viewing changes to lgi/lgi.h

  • Committer: Package Import Robot
  • Author(s): Enrico Tassi
  • Date: 2012-06-25 13:36:04 UTC
  • mto: This revision was merged to the branch mainline in revision 10.
  • Revision ID: package-import@ubuntu.com-20120625133604-3v03ss7t7cwdmp6z
Tags: upstream-0.7.1
ImportĀ upstreamĀ versionĀ 0.7.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
98
98
   requirements. */
99
99
#define LGI_PARENT_IS_RETVAL (G_MAXINT - 1)
100
100
 
 
101
/* Yet another special value for 'parent' argument, meaning that the
 
102
   value already contains address of caller-allocated space into which
 
103
   the result should be marshalled. */
 
104
#define LGI_PARENT_CALLER_ALLOC (G_MAXINT - 2)
 
105
 
101
106
/* Marshalls single value from Lua to GLib/C. Returns number of temporary
102
107
   entries pushed to Lua stack, which should be popped before function call
103
108
   returns. */
114
119
/* Marshalls single value from GLib/C to Lua. If parent is non-0, it
115
120
   is stack index of parent structure/array in which this C value
116
121
   resides. */
117
 
void lgi_marshal_2lua (lua_State *L, GITypeInfo *ti, GITransfer xfer,
 
122
void lgi_marshal_2lua (lua_State *L, GITypeInfo *ti, GIArgInfo *ai,
 
123
                       GIDirection dir, GITransfer xfer,
118
124
                       gpointer source, int parent,
119
125
                       GICallableInfo *ci, void **args);
120
126
 
156
162
   the arg record is part of). */
157
163
void lgi_record_2lua (lua_State *L, gpointer addr, gboolean own, int parent);
158
164
 
159
 
/* Gets pointer to C-structure from given Lua-side object. Expects
160
 
   repo typetable of expected argument pushed on the top of the stack,
161
 
   removes it. */
162
 
gpointer lgi_record_2c (lua_State *L, int narg, gboolean optional,
163
 
                        gboolean nothrow);
 
165
/* Gets pointer to C-structure from given Lua-side object, or copies
 
166
   record to specified address. Expects repo typetable of expected
 
167
   argument pushed on the top of the stack, removes it. */
 
168
void lgi_record_2c (lua_State *L, gint narg, gpointer target, gboolean by_value,
 
169
                    gboolean own, gboolean optional, gboolean nothrow);
164
170
 
165
171
/* Creates Lua-side part (proxy) of given object. If the object is not
166
172
   owned (own == FALSE), an ownership is automatically acquired.  Returns
167
173
   number of elements pushed to the stack, i.e. always 1. */
168
 
int
169
 
lgi_object_2lua (lua_State *L, gpointer obj, gboolean own);
 
174
int lgi_object_2lua (lua_State *L, gpointer obj, gboolean own,
 
175
                     gboolean no_sink);
170
176
 
171
177
/* Gets pointer to C-side object represented by given Lua proxy. If
172
178
   gtype is not G_TYPE_INVALID, the real type is checked to conform to
173
179
   requested type. */
174
 
gpointer
175
 
lgi_object_2c (lua_State *L, int narg, GType gtype, gboolean optional,
176
 
               gboolean nothrow, gboolean transfer);
 
180
gpointer lgi_object_2c (lua_State *L, int narg, GType gtype, gboolean optional,
 
181
                        gboolean nothrow, gboolean transfer);
177
182
 
178
183
#if !GLIB_CHECK_VERSION(2, 30, 0)
179
184
/* Workaround for broken g_struct_info_get_size() for GValue, see