2019-06-10 02:58:45 +00:00
|
|
|
/*
|
|
|
|
* Copyright © 2019 Benjamin Otte
|
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2.1 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*
|
|
|
|
* Authors: Benjamin Otte <otte@gnome.org>
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "config.h"
|
|
|
|
|
2019-10-08 22:07:07 +00:00
|
|
|
#include "gtkbuilderlistitemfactory.h"
|
2019-06-10 02:58:45 +00:00
|
|
|
|
|
|
|
#include "gtkbuilder.h"
|
2019-12-23 23:23:59 +00:00
|
|
|
#include "gtkbuilderprivate.h"
|
2019-10-08 22:07:07 +00:00
|
|
|
#include "gtklistitemfactoryprivate.h"
|
2019-06-10 02:58:45 +00:00
|
|
|
#include "gtklistitemprivate.h"
|
|
|
|
|
2019-10-08 22:07:07 +00:00
|
|
|
/**
|
2021-02-27 23:17:37 +00:00
|
|
|
* GtkBuilderListItemFactory:
|
2019-10-08 22:07:07 +00:00
|
|
|
*
|
2021-02-27 23:17:37 +00:00
|
|
|
* `GtkBuilderListItemFactory` is a `GtkListItemFactory` that creates
|
|
|
|
* widgets by instantiating `GtkBuilder` UI templates.
|
|
|
|
*
|
|
|
|
* The templates must be extending `GtkListItem`, and typically use
|
|
|
|
* `GtkExpression`s to obtain data from the items in the model.
|
2019-10-08 22:07:07 +00:00
|
|
|
*
|
|
|
|
* Example:
|
2021-02-27 23:17:37 +00:00
|
|
|
* ```xml
|
2019-10-08 22:07:07 +00:00
|
|
|
* <interface>
|
|
|
|
* <template class="GtkListItem">
|
|
|
|
* <property name="child">
|
|
|
|
* <object class="GtkLabel">
|
|
|
|
* <property name="xalign">0</property>
|
|
|
|
* <binding name="label">
|
|
|
|
* <lookup name="name" type="SettingsKey">
|
|
|
|
* <lookup name="item">GtkListItem</lookup>
|
|
|
|
* </lookup>
|
|
|
|
* </binding>
|
|
|
|
* </object>
|
|
|
|
* </property>
|
|
|
|
* </template>
|
|
|
|
* </interface>
|
2021-02-27 23:17:37 +00:00
|
|
|
* ```
|
2019-10-08 22:07:07 +00:00
|
|
|
*/
|
|
|
|
|
2019-06-10 02:58:45 +00:00
|
|
|
struct _GtkBuilderListItemFactory
|
|
|
|
{
|
|
|
|
GtkListItemFactory parent_instance;
|
|
|
|
|
2019-12-03 06:03:10 +00:00
|
|
|
GtkBuilderScope *scope;
|
2019-06-10 02:58:45 +00:00
|
|
|
GBytes *bytes;
|
2019-12-23 23:23:59 +00:00
|
|
|
GBytes *data;
|
2019-10-18 02:07:04 +00:00
|
|
|
char *resource;
|
2019-06-10 02:58:45 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
struct _GtkBuilderListItemFactoryClass
|
|
|
|
{
|
|
|
|
GtkListItemFactoryClass parent_class;
|
|
|
|
};
|
|
|
|
|
2019-10-18 02:07:04 +00:00
|
|
|
enum {
|
|
|
|
PROP_0,
|
|
|
|
PROP_BYTES,
|
|
|
|
PROP_RESOURCE,
|
2019-12-03 06:03:10 +00:00
|
|
|
PROP_SCOPE,
|
2019-10-18 02:07:04 +00:00
|
|
|
|
|
|
|
N_PROPS
|
|
|
|
};
|
|
|
|
|
2019-06-10 02:58:45 +00:00
|
|
|
G_DEFINE_TYPE (GtkBuilderListItemFactory, gtk_builder_list_item_factory, GTK_TYPE_LIST_ITEM_FACTORY)
|
|
|
|
|
2019-10-18 02:07:04 +00:00
|
|
|
static GParamSpec *properties[N_PROPS] = { NULL, };
|
|
|
|
|
2019-06-10 02:58:45 +00:00
|
|
|
static void
|
|
|
|
gtk_builder_list_item_factory_setup (GtkListItemFactory *factory,
|
2022-06-28 14:34:24 +00:00
|
|
|
GObject *item,
|
|
|
|
gboolean bind,
|
|
|
|
GFunc func,
|
|
|
|
gpointer data)
|
2019-06-10 02:58:45 +00:00
|
|
|
{
|
|
|
|
GtkBuilderListItemFactory *self = GTK_BUILDER_LIST_ITEM_FACTORY (factory);
|
|
|
|
GtkBuilder *builder;
|
|
|
|
GError *error = NULL;
|
|
|
|
|
2022-06-28 14:34:24 +00:00
|
|
|
GTK_LIST_ITEM_FACTORY_CLASS (gtk_builder_list_item_factory_parent_class)->setup (factory, item, bind, func, data);
|
2019-06-10 02:58:45 +00:00
|
|
|
|
|
|
|
builder = gtk_builder_new ();
|
|
|
|
|
2022-06-28 14:34:24 +00:00
|
|
|
gtk_builder_set_current_object (builder, item);
|
2019-12-03 06:03:10 +00:00
|
|
|
if (self->scope)
|
|
|
|
gtk_builder_set_scope (builder, self->scope);
|
2019-06-10 02:58:45 +00:00
|
|
|
|
2022-06-28 14:34:24 +00:00
|
|
|
if (!gtk_builder_extend_with_template (builder, G_OBJECT (item), G_OBJECT_TYPE (item),
|
2019-12-23 23:23:59 +00:00
|
|
|
(const char *)g_bytes_get_data (self->data, NULL),
|
|
|
|
g_bytes_get_size (self->data),
|
|
|
|
&error))
|
2019-06-10 02:58:45 +00:00
|
|
|
{
|
|
|
|
g_critical ("Error building template for list item: %s", error->message);
|
|
|
|
g_error_free (error);
|
|
|
|
|
|
|
|
/* This should never happen, if the template XML cannot be built
|
|
|
|
* then it is a critical programming error.
|
|
|
|
*/
|
|
|
|
g_object_unref (builder);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
g_object_unref (builder);
|
|
|
|
}
|
|
|
|
|
2019-10-18 02:07:04 +00:00
|
|
|
static void
|
|
|
|
gtk_builder_list_item_factory_get_property (GObject *object,
|
|
|
|
guint property_id,
|
|
|
|
GValue *value,
|
|
|
|
GParamSpec *pspec)
|
|
|
|
{
|
|
|
|
GtkBuilderListItemFactory *self = GTK_BUILDER_LIST_ITEM_FACTORY (object);
|
|
|
|
|
|
|
|
switch (property_id)
|
|
|
|
{
|
|
|
|
case PROP_BYTES:
|
|
|
|
g_value_set_boxed (value, self->bytes);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case PROP_RESOURCE:
|
|
|
|
g_value_set_string (value, self->resource);
|
|
|
|
break;
|
|
|
|
|
2019-12-03 06:03:10 +00:00
|
|
|
case PROP_SCOPE:
|
|
|
|
g_value_set_object (value, self->scope);
|
|
|
|
break;
|
|
|
|
|
2019-10-18 02:07:04 +00:00
|
|
|
default:
|
|
|
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static gboolean
|
|
|
|
gtk_builder_list_item_factory_set_bytes (GtkBuilderListItemFactory *self,
|
|
|
|
GBytes *bytes)
|
|
|
|
{
|
|
|
|
if (bytes == NULL)
|
|
|
|
return FALSE;
|
|
|
|
|
|
|
|
if (self->bytes)
|
|
|
|
{
|
|
|
|
g_critical ("Data for GtkBuilderListItemFactory has already been set.");
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
self->bytes = g_bytes_ref (bytes);
|
2019-12-23 23:23:59 +00:00
|
|
|
|
|
|
|
if (!_gtk_buildable_parser_is_precompiled (g_bytes_get_data (bytes, NULL), g_bytes_get_size (bytes)))
|
|
|
|
{
|
|
|
|
GError *error = NULL;
|
|
|
|
GBytes *data;
|
|
|
|
|
|
|
|
data = _gtk_buildable_parser_precompile (g_bytes_get_data (bytes, NULL),
|
|
|
|
g_bytes_get_size (bytes),
|
|
|
|
&error);
|
|
|
|
if (data == NULL)
|
|
|
|
{
|
|
|
|
g_warning ("Failed to precompile template for GtkBuilderListItemFactory: %s", error->message);
|
|
|
|
g_error_free (error);
|
|
|
|
self->data = g_bytes_ref (bytes);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
self->data = data;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-10-18 02:07:04 +00:00
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gtk_builder_list_item_factory_set_property (GObject *object,
|
|
|
|
guint property_id,
|
|
|
|
const GValue *value,
|
|
|
|
GParamSpec *pspec)
|
|
|
|
{
|
|
|
|
GtkBuilderListItemFactory *self = GTK_BUILDER_LIST_ITEM_FACTORY (object);
|
|
|
|
|
|
|
|
switch (property_id)
|
|
|
|
{
|
|
|
|
case PROP_BYTES:
|
|
|
|
gtk_builder_list_item_factory_set_bytes (self, g_value_get_boxed (value));
|
|
|
|
break;
|
|
|
|
|
|
|
|
case PROP_RESOURCE:
|
|
|
|
{
|
|
|
|
GError *error = NULL;
|
|
|
|
GBytes *bytes;
|
|
|
|
const char *resource;
|
|
|
|
|
|
|
|
resource = g_value_get_string (value);
|
|
|
|
if (resource == NULL)
|
|
|
|
break;
|
|
|
|
|
|
|
|
bytes = g_resources_lookup_data (resource, 0, &error);
|
|
|
|
if (bytes)
|
|
|
|
{
|
|
|
|
if (gtk_builder_list_item_factory_set_bytes (self, bytes))
|
|
|
|
self->resource = g_strdup (resource);
|
|
|
|
g_bytes_unref (bytes);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
g_critical ("Unable to load resource for list item template: %s", error->message);
|
|
|
|
g_error_free (error);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
2019-12-03 06:03:10 +00:00
|
|
|
case PROP_SCOPE:
|
|
|
|
self->scope = g_value_dup_object (value);
|
|
|
|
break;
|
|
|
|
|
2019-10-18 02:07:04 +00:00
|
|
|
default:
|
|
|
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-06-10 02:58:45 +00:00
|
|
|
static void
|
|
|
|
gtk_builder_list_item_factory_finalize (GObject *object)
|
|
|
|
{
|
|
|
|
GtkBuilderListItemFactory *self = GTK_BUILDER_LIST_ITEM_FACTORY (object);
|
|
|
|
|
2019-12-03 06:03:10 +00:00
|
|
|
g_clear_object (&self->scope);
|
2019-06-10 02:58:45 +00:00
|
|
|
g_bytes_unref (self->bytes);
|
2019-12-23 23:23:59 +00:00
|
|
|
g_bytes_unref (self->data);
|
2019-10-18 02:07:04 +00:00
|
|
|
g_free (self->resource);
|
2019-06-10 02:58:45 +00:00
|
|
|
|
|
|
|
G_OBJECT_CLASS (gtk_builder_list_item_factory_parent_class)->finalize (object);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gtk_builder_list_item_factory_class_init (GtkBuilderListItemFactoryClass *klass)
|
|
|
|
{
|
2019-10-18 02:07:04 +00:00
|
|
|
GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
|
2019-06-10 02:58:45 +00:00
|
|
|
GtkListItemFactoryClass *factory_class = GTK_LIST_ITEM_FACTORY_CLASS (klass);
|
|
|
|
|
2019-10-18 02:07:04 +00:00
|
|
|
gobject_class->finalize = gtk_builder_list_item_factory_finalize;
|
|
|
|
gobject_class->get_property = gtk_builder_list_item_factory_get_property;
|
|
|
|
gobject_class->set_property = gtk_builder_list_item_factory_set_property;
|
2019-06-10 02:58:45 +00:00
|
|
|
|
|
|
|
factory_class->setup = gtk_builder_list_item_factory_setup;
|
2019-10-18 02:07:04 +00:00
|
|
|
|
|
|
|
/**
|
2021-02-27 23:17:37 +00:00
|
|
|
* GtkBuilderListItemFactory:bytes: (attributes org.gtk.Property.get=gtk_builder_list_item_factory_get_bytes)
|
2019-10-18 02:07:04 +00:00
|
|
|
*
|
2021-02-27 23:17:37 +00:00
|
|
|
* `GBytes` containing the UI definition.
|
2019-10-18 02:07:04 +00:00
|
|
|
*/
|
|
|
|
properties[PROP_BYTES] =
|
2022-05-11 12:19:39 +00:00
|
|
|
g_param_spec_boxed ("bytes", NULL, NULL,
|
2019-10-18 02:07:04 +00:00
|
|
|
G_TYPE_BYTES,
|
|
|
|
G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS);
|
|
|
|
|
|
|
|
/**
|
2021-02-27 23:17:37 +00:00
|
|
|
* GtkBuilderListItemFactory:resource: (attributes org.gtk.Property.get=gtk_builder_list_item_factory_get_resource)
|
2019-10-18 02:07:04 +00:00
|
|
|
*
|
2021-02-27 23:17:37 +00:00
|
|
|
* Path of the resource containing the UI definition.
|
2019-10-18 02:07:04 +00:00
|
|
|
*/
|
|
|
|
properties[PROP_RESOURCE] =
|
2022-05-11 12:19:39 +00:00
|
|
|
g_param_spec_string ("resource", NULL, NULL,
|
2019-10-18 02:07:04 +00:00
|
|
|
NULL,
|
|
|
|
G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS);
|
|
|
|
|
2019-12-03 06:03:10 +00:00
|
|
|
/**
|
2021-02-27 23:17:37 +00:00
|
|
|
* GtkBuilderListItemFactory:scope: (attributes org.gtk.Property.get=gtk_builder_list_item_factory_get_scope)
|
2019-12-03 06:03:10 +00:00
|
|
|
*
|
2021-02-27 23:17:37 +00:00
|
|
|
* `GtkBuilderScope` to use when instantiating listitems
|
2019-12-03 06:03:10 +00:00
|
|
|
*/
|
|
|
|
properties[PROP_SCOPE] =
|
2022-05-11 12:19:39 +00:00
|
|
|
g_param_spec_object ("scope", NULL, NULL,
|
2019-12-03 06:03:10 +00:00
|
|
|
GTK_TYPE_BUILDER_SCOPE,
|
|
|
|
G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS);
|
2019-10-18 02:07:04 +00:00
|
|
|
|
2019-12-03 06:03:10 +00:00
|
|
|
g_object_class_install_properties (gobject_class, N_PROPS, properties);
|
2019-06-10 02:58:45 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gtk_builder_list_item_factory_init (GtkBuilderListItemFactory *self)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2019-10-08 22:07:07 +00:00
|
|
|
/**
|
|
|
|
* gtk_builder_list_item_factory_new_from_bytes:
|
2019-12-03 06:03:10 +00:00
|
|
|
* @scope: (nullable) (transfer none): A scope to use when instantiating
|
2021-02-27 23:17:37 +00:00
|
|
|
* @bytes: the `GBytes` containing the ui file to instantiate
|
2019-10-08 22:07:07 +00:00
|
|
|
*
|
2021-02-27 23:17:37 +00:00
|
|
|
* Creates a new `GtkBuilderListItemFactory` that instantiates widgets
|
|
|
|
* using @bytes as the data to pass to `GtkBuilder`.
|
2019-10-08 22:07:07 +00:00
|
|
|
*
|
2021-02-27 23:17:37 +00:00
|
|
|
* Returns: a new `GtkBuilderListItemFactory`
|
2019-10-08 22:07:07 +00:00
|
|
|
**/
|
2019-06-10 02:58:45 +00:00
|
|
|
GtkListItemFactory *
|
2019-12-03 06:03:10 +00:00
|
|
|
gtk_builder_list_item_factory_new_from_bytes (GtkBuilderScope *scope,
|
|
|
|
GBytes *bytes)
|
2019-06-10 02:58:45 +00:00
|
|
|
{
|
|
|
|
g_return_val_if_fail (bytes != NULL, NULL);
|
|
|
|
|
2019-10-18 02:07:04 +00:00
|
|
|
return g_object_new (GTK_TYPE_BUILDER_LIST_ITEM_FACTORY,
|
|
|
|
"bytes", bytes,
|
2019-12-03 06:03:10 +00:00
|
|
|
"scope", scope,
|
2019-10-18 02:07:04 +00:00
|
|
|
NULL);
|
2019-06-10 02:58:45 +00:00
|
|
|
}
|
|
|
|
|
2019-10-08 22:07:07 +00:00
|
|
|
/**
|
|
|
|
* gtk_builder_list_item_factory_new_from_resource:
|
2019-12-03 06:03:10 +00:00
|
|
|
* @scope: (nullable) (transfer none): A scope to use when instantiating
|
2019-10-08 22:07:07 +00:00
|
|
|
* @resource_path: valid path to a resource that contains the data
|
|
|
|
*
|
2021-02-27 23:17:37 +00:00
|
|
|
* Creates a new `GtkBuilderListItemFactory` that instantiates widgets
|
|
|
|
* using data read from the given @resource_path to pass to `GtkBuilder`.
|
2019-10-08 22:07:07 +00:00
|
|
|
*
|
2021-02-27 23:17:37 +00:00
|
|
|
* Returns: a new `GtkBuilderListItemFactory`
|
2019-10-08 22:07:07 +00:00
|
|
|
**/
|
2019-06-10 02:58:45 +00:00
|
|
|
GtkListItemFactory *
|
2019-12-03 06:03:10 +00:00
|
|
|
gtk_builder_list_item_factory_new_from_resource (GtkBuilderScope *scope,
|
|
|
|
const char *resource_path)
|
2019-06-10 02:58:45 +00:00
|
|
|
{
|
2019-12-03 06:03:10 +00:00
|
|
|
g_return_val_if_fail (scope == NULL || GTK_IS_BUILDER_SCOPE (scope), NULL);
|
2019-06-10 02:58:45 +00:00
|
|
|
g_return_val_if_fail (resource_path != NULL, NULL);
|
|
|
|
|
2019-10-18 02:07:04 +00:00
|
|
|
return g_object_new (GTK_TYPE_BUILDER_LIST_ITEM_FACTORY,
|
|
|
|
"resource", resource_path,
|
2019-12-03 06:03:10 +00:00
|
|
|
"scope", scope,
|
2019-10-18 02:07:04 +00:00
|
|
|
NULL);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2021-02-27 23:17:37 +00:00
|
|
|
* gtk_builder_list_item_factory_get_bytes: (attributes org.gtk.Method.get_property=bytes)
|
|
|
|
* @self: a `GtkBuilderListItemFactory`
|
2019-10-18 02:07:04 +00:00
|
|
|
*
|
2021-02-27 23:17:37 +00:00
|
|
|
* Gets the data used as the `GtkBuilder` UI template for constructing
|
2019-10-18 02:07:04 +00:00
|
|
|
* listitems.
|
|
|
|
*
|
2021-02-27 23:17:37 +00:00
|
|
|
* Returns: (transfer none): The `GtkBuilder` data
|
|
|
|
*/
|
2019-10-18 02:07:04 +00:00
|
|
|
GBytes *
|
|
|
|
gtk_builder_list_item_factory_get_bytes (GtkBuilderListItemFactory *self)
|
|
|
|
{
|
|
|
|
g_return_val_if_fail (GTK_IS_BUILDER_LIST_ITEM_FACTORY (self), NULL);
|
2019-06-10 02:58:45 +00:00
|
|
|
|
2019-10-18 02:07:04 +00:00
|
|
|
return self->bytes;
|
|
|
|
}
|
2019-06-10 02:58:45 +00:00
|
|
|
|
2019-10-18 02:07:04 +00:00
|
|
|
/**
|
2021-02-27 23:17:37 +00:00
|
|
|
* gtk_builder_list_item_factory_get_resource: (attributes org.gtk.Method.get_property=resource)
|
|
|
|
* @self: a `GtkBuilderListItemFactory`
|
2019-10-18 02:07:04 +00:00
|
|
|
*
|
|
|
|
* If the data references a resource, gets the path of that resource.
|
|
|
|
*
|
2021-05-18 21:05:26 +00:00
|
|
|
* Returns: (transfer none) (nullable): The path to the resource
|
2021-02-27 23:17:37 +00:00
|
|
|
*/
|
2019-10-18 02:07:04 +00:00
|
|
|
const char *
|
|
|
|
gtk_builder_list_item_factory_get_resource (GtkBuilderListItemFactory *self)
|
|
|
|
{
|
|
|
|
g_return_val_if_fail (GTK_IS_BUILDER_LIST_ITEM_FACTORY (self), NULL);
|
2019-06-10 02:58:45 +00:00
|
|
|
|
2019-10-18 02:07:04 +00:00
|
|
|
return self->resource;
|
2019-06-10 02:58:45 +00:00
|
|
|
}
|
|
|
|
|
2019-12-03 06:03:10 +00:00
|
|
|
/**
|
2021-02-27 23:17:37 +00:00
|
|
|
* gtk_builder_list_item_factory_get_scope: (attributes org.gtk.Method.get_property=scope)
|
|
|
|
* @self: a `GtkBuilderListItemFactory`
|
2019-12-03 06:03:10 +00:00
|
|
|
*
|
|
|
|
* Gets the scope used when constructing listitems.
|
|
|
|
*
|
|
|
|
* Returns: (transfer none) (nullable): The scope used when constructing listitems
|
2021-02-27 23:17:37 +00:00
|
|
|
*/
|
2019-12-03 06:03:10 +00:00
|
|
|
GtkBuilderScope *
|
|
|
|
gtk_builder_list_item_factory_get_scope (GtkBuilderListItemFactory *self)
|
|
|
|
{
|
|
|
|
g_return_val_if_fail (GTK_IS_BUILDER_LIST_ITEM_FACTORY (self), NULL);
|
|
|
|
|
|
|
|
return self->scope;
|
|
|
|
}
|