-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Use the userdata so we can support any number of classes/methods using only one callsite for each Wren interface - Add marshalling for a number of types - VMV.expose_class: take Type parameter. Instead of accepting the type as a template parameter, accept it as a straight runtime function parameter. We do not do any compile-time processing in that function, so do not imply that we do. - Add getting and setting of foreign properties on exposed classes Also: - add tests - VMV: add accessor for VM - Rename wrennull.c to shim.c - Add obj_from_ppobj() to shim.c - Add Object to Marshal.to_value_raw() - pretty-print
- Loading branch information
Showing
16 changed files
with
850 additions
and
1,098 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,8 @@ | ||
// wrennull.c: Wren's null type, as a GType | ||
// shim.c: wren-vala routines that are easier to implement in C | ||
// | ||
// Currently contains: | ||
// - A GType representing Wren's null type | ||
// - Object** manipulation | ||
// | ||
// By Christopher White <[email protected]> | ||
// Copyright (c) 2021 Christopher White. All Rights Reserved. | ||
|
@@ -15,15 +19,18 @@ G_BEGIN_DECLS | |
static void value_nop(GValue *v) | ||
{ | ||
} | ||
|
||
static void value_nop2(const GValue *s, GValue *d) | ||
{ | ||
} | ||
|
||
static gchar *value_collect_nop(GValue *value, guint n_collect_values, | ||
GTypeCValue *collect_values, | ||
guint collect_flags) | ||
{ | ||
return (gchar *)NULL; | ||
} | ||
|
||
static gchar *value_collect_nop_const(const GValue *value, guint n_collect_values, | ||
GTypeCValue *collect_values, | ||
guint collect_flags) | ||
|
@@ -93,4 +100,19 @@ wrenget_null_type() | |
return wrennull_type_id__volatile; | ||
} | ||
|
||
/** | ||
* wrenobj_from_ppobj: | ||
* @ppobj: (transfer none): A GObject**, as a void* | ||
* | ||
* Does not touch the refcount of **ppobj. This exists because it was faster | ||
* to write this function than to debug the compile-time errors I was getting | ||
* when I tried to do the same in Vala! :) | ||
* | ||
* Return: (transfer none): A GObject* | ||
*/ | ||
GObject *wrenobj_from_ppobj(void *ppobj) | ||
{ | ||
return *(GObject **)ppobj; | ||
} | ||
|
||
G_END_DECLS |
Oops, something went wrong.