[gnome-shell] shell-generic-container: document signals
- From: Dan Winship <danw src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell] shell-generic-container: document signals
- Date: Tue, 6 Sep 2011 18:33:14 +0000 (UTC)
commit cbb3831c7b4c441b481cec6d54459f884a39e8a8
Author: Dan Winship <danw gnome org>
Date: Mon Sep 5 13:29:50 2011 -0400
shell-generic-container: document signals
In particular, document that you can ignore the get-preferred-*
signals if and only if you have a fixed width/height specified by some
other means.
https://bugzilla.gnome.org/show_bug.cgi?id=657986
src/shell-generic-container.c | 44 +++++++++++++++++++++++++++++++++++++++++
1 files changed, 44 insertions(+), 0 deletions(-)
---
diff --git a/src/shell-generic-container.c b/src/shell-generic-container.c
index 479cd05..4f89981 100644
--- a/src/shell-generic-container.c
+++ b/src/shell-generic-container.c
@@ -264,6 +264,22 @@ shell_generic_container_class_init (ShellGenericContainerClass *klass)
container_class->get_focus_chain = shell_generic_container_get_focus_chain;
+ /**
+ * ShellGenericContainer::get-preferred-width:
+ * @self: the #ShellGenericContainer
+ * @for_height: as in clutter_actor_get_preferred_width()
+ * @alloc: a #ShellGenericContainerAllocation to be filled in
+ *
+ * Emitted when clutter_actor_get_preferred_width() is called
+ * on @self. You should fill in the fields of @alloc with the
+ * your minimum and natural widths. #ShellGenericContainer
+ * will deal with taking its borders and padding into account
+ * for you.
+ *
+ * @alloc's fields are initialized to 0, so unless you have a fixed
+ * width specified (via #ClutterActor:width or CSS), you must
+ * connect to this signal and fill in the values.
+ */
shell_generic_container_signals[GET_PREFERRED_WIDTH] =
g_signal_new ("get-preferred-width",
G_TYPE_FROM_CLASS (klass),
@@ -273,6 +289,22 @@ shell_generic_container_class_init (ShellGenericContainerClass *klass)
gi_cclosure_marshal_generic,
G_TYPE_NONE, 2, G_TYPE_FLOAT, SHELL_TYPE_GENERIC_CONTAINER_ALLOCATION);
+ /**
+ * ShellGenericContainer::get-preferred-height:
+ * @self: the #ShellGenericContainer
+ * @for_width: as in clutter_actor_get_preferred_height()
+ * @alloc: a #ShellGenericContainerAllocation to be filled in
+ *
+ * Emitted when clutter_actor_get_preferred_height() is called
+ * on @self. You should fill in the fields of @alloc with the
+ * your minimum and natural heights. #ShellGenericContainer
+ * will deal with taking its borders and padding into account
+ * for you.
+ *
+ * @alloc's fields are initialized to 0, so unless you have a fixed
+ * height specified (via #ClutterActor:height or CSS), you must
+ * connect to this signal and fill in the values.
+ */
shell_generic_container_signals[GET_PREFERRED_HEIGHT] =
g_signal_new ("get-preferred-height",
G_TYPE_FROM_CLASS (klass),
@@ -282,6 +314,18 @@ shell_generic_container_class_init (ShellGenericContainerClass *klass)
gi_cclosure_marshal_generic,
G_TYPE_NONE, 2, G_TYPE_FLOAT, SHELL_TYPE_GENERIC_CONTAINER_ALLOCATION);
+ /**
+ * ShellGenericContainer::allocate:
+ * @self: the #ShellGenericContainer
+ * @box: @self's content box
+ * @flags: the allocation flags.
+ *
+ * Emitted when @self is allocated, after chaining up to the parent
+ * allocate method.
+ *
+ * Note that @box is @self's content box (qv
+ * st_theme_node_get_content_box()), NOT its allocation.
+ */
shell_generic_container_signals[ALLOCATE] =
g_signal_new ("allocate",
G_TYPE_FROM_CLASS (klass),
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]