[gnome-builder] build: make egg introspectable
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder] build: make egg introspectable
- Date: Wed, 30 Sep 2015 01:48:16 +0000 (UTC)
commit 2883aab595c59cda916d9542b32fe2a37de3bada
Author: Christian Hergert <christian hergert me>
Date: Tue Sep 29 18:42:25 2015 -0700
build: make egg introspectable
contrib/egg/egg-binding-group.c | 2 +-
contrib/egg/egg-binding-group.h | 2 +-
contrib/egg/egg-counter.c | 2 +
contrib/egg/egg-counter.h | 3 +-
contrib/egg/egg-private.h | 39 ++++++++++++++++++++++++++++++++
contrib/egg/egg-search-bar.c | 5 ++++
contrib/egg/egg-settings-sandwich.c | 15 ++++++++++++
contrib/egg/egg-signal-group.c | 34 ++++++++++++++--------------
contrib/egg/egg-state-machine-action.h | 3 --
contrib/egg/egg-state-machine.c | 25 ++++++++++++++++++++
contrib/egg/egg-task-cache.c | 18 +++++++++++---
11 files changed, 121 insertions(+), 27 deletions(-)
---
diff --git a/contrib/egg/egg-binding-group.c b/contrib/egg/egg-binding-group.c
index 1c8f0c9..7bea670 100644
--- a/contrib/egg/egg-binding-group.c
+++ b/contrib/egg/egg-binding-group.c
@@ -375,7 +375,7 @@ egg_binding_group_new (void)
*
* Gets the source object used for binding properties.
*
- * Returns: (nullable): the source object.
+ * Returns: (transfer none) (nullable): the source object.
*/
GObject *
egg_binding_group_get_source (EggBindingGroup *self)
diff --git a/contrib/egg/egg-binding-group.h b/contrib/egg/egg-binding-group.h
index 58dd30e..b1f18df 100644
--- a/contrib/egg/egg-binding-group.h
+++ b/contrib/egg/egg-binding-group.h
@@ -48,7 +48,7 @@ void egg_binding_group_bind_full (EggBindingGroup *self,
GBindingTransformFunc transform_to,
GBindingTransformFunc transform_from,
gpointer user_data,
- GDestroyNotify notify);
+ GDestroyNotify user_data_destroy);
void egg_binding_group_bind_with_closures
(EggBindingGroup *self,
const gchar *source_property,
diff --git a/contrib/egg/egg-counter.c b/contrib/egg/egg-counter.c
index f5ba438..146a353 100644
--- a/contrib/egg/egg-counter.c
+++ b/contrib/egg/egg-counter.c
@@ -39,6 +39,8 @@
#include "egg-counter.h"
+G_DEFINE_BOXED_TYPE (EggCounterArena, egg_counter_arena, egg_counter_arena_ref, egg_counter_arena_unref)
+
#define NAME_FORMAT "/EggCounters-%u"
#define MAGIC 0x71167125
#define COUNTER_MAX_SHM (1024 * 1024 * 4)
diff --git a/contrib/egg/egg-counter.h b/contrib/egg/egg-counter.h
index 6901872..f519093 100644
--- a/contrib/egg/egg-counter.h
+++ b/contrib/egg/egg-counter.h
@@ -19,7 +19,7 @@
#ifndef EGG_COUNTER_H
#define EGG_COUNTER_H
-#include <glib.h>
+#include <glib-object.h>
/*
* History
@@ -267,6 +267,7 @@ struct _EggCounterValue
gint64 padding [7];
} __attribute__ ((aligned(8)));
+GType egg_counter_arena_get_type (void);
guint egg_get_current_cpu_call (void);
EggCounterArena *egg_counter_arena_get_default (void);
EggCounterArena *egg_counter_arena_new_for_pid (GPid pid);
diff --git a/contrib/egg/egg-private.h b/contrib/egg/egg-private.h
new file mode 100644
index 0000000..19a0aeb
--- /dev/null
+++ b/contrib/egg/egg-private.h
@@ -0,0 +1,39 @@
+/* egg-private.h
+ *
+ * Copyright (C) 2015 Christian Hergert <christian hergert me>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef EGG_PRIVATE_H
+#define EGG_PRIVATE_H
+
+G_BEGIN_DECLS
+
+#include "egg-animation.h"
+#include "egg-binding-group.h"
+#include "egg-counter.h"
+#include "egg-frame-source.h"
+#include "egg-heap.h"
+#include "egg-search-bar.h"
+#include "egg-settings-sandwich.h"
+#include "egg-signal-group.h"
+#include "egg-state-machine-action.h"
+#include "egg-state-machine-buildable.h"
+#include "egg-state-machine.h"
+#include "egg-task-cache.h"
+
+G_END_DECLS
+
+#endif /* EGG_PRIVATE_H */
diff --git a/contrib/egg/egg-search-bar.c b/contrib/egg/egg-search-bar.c
index f2f2d89..6ca4cac 100644
--- a/contrib/egg/egg-search-bar.c
+++ b/contrib/egg/egg-search-bar.c
@@ -463,6 +463,11 @@ egg_search_bar_set_show_close_button (EggSearchBar *self,
g_object_notify_by_pspec (G_OBJECT (self), gParamSpecs [PROP_SHOW_CLOSE_BUTTON]);
}
+/**
+ * egg_search_bar_get_entry:
+ *
+ * Returns: (transfer none) (type Gtk.SearchEntry): A #GtkSearchEntry.
+ */
GtkWidget *
egg_search_bar_get_entry (EggSearchBar *self)
{
diff --git a/contrib/egg/egg-settings-sandwich.c b/contrib/egg/egg-settings-sandwich.c
index 2091a8b..4af79d6 100644
--- a/contrib/egg/egg-settings-sandwich.c
+++ b/contrib/egg/egg-settings-sandwich.c
@@ -421,6 +421,21 @@ egg_settings_sandwich_bind (EggSettingsSandwich *self,
NULL, NULL, NULL, NULL);
}
+/**
+ * egg_settings_sandwich_bind_with_mapping:
+ * @self: An #EggSettingsSandwich.
+ * @key: the settings key to bind.
+ * @object (type GObject.Object): the target object.
+ * @property: the property on @object to apply.
+ * @flags: flags for the binding.
+ * @get_mapping: (scope async): the get mapping function
+ * @set_mapping: (scope async): the set mapping function
+ * @user_data: user data for @get_mapping and @set_mapping.
+ * @destroy: (destroy user_data): destroy notify for @user_data.
+ *
+ * Creates a new binding similar to g_settings_bind_with_mapping() but applying
+ * from the resolved value via the settings sandwich.
+ */
void
egg_settings_sandwich_bind_with_mapping (EggSettingsSandwich *self,
const gchar *key,
diff --git a/contrib/egg/egg-signal-group.c b/contrib/egg/egg-signal-group.c
index 84ec6d7..3407d8c 100644
--- a/contrib/egg/egg-signal-group.c
+++ b/contrib/egg/egg-signal-group.c
@@ -647,7 +647,7 @@ egg_signal_group_connect_full (EggSignalGroup *self,
* egg_signal_group_connect_object:
* @self: a #EggSignalGroup
* @detailed_signal: a string of the form "signal-name::detail"
- * @callback: the #GCallback to connect
+ * @c_handler: (scope async): the #GCallback to connect
* @object: the #GObject to pass as data to @callback calls
*
* Connects @callback to the signal @detailed_signal
@@ -662,13 +662,13 @@ egg_signal_group_connect_full (EggSignalGroup *self,
void
egg_signal_group_connect_object (EggSignalGroup *self,
const gchar *detailed_signal,
- GCallback callback,
+ GCallback c_handler,
gpointer object,
GConnectFlags flags)
{
g_return_if_fail (G_IS_OBJECT (object));
- egg_signal_group_connect_full (self, detailed_signal, callback, object, NULL,
+ egg_signal_group_connect_full (self, detailed_signal, c_handler, object, NULL,
flags, TRUE);
}
@@ -676,9 +676,9 @@ egg_signal_group_connect_object (EggSignalGroup *self,
* egg_signal_group_connect_data:
* @self: a #EggSignalGroup
* @detailed_signal: a string of the form "signal-name::detail"
- * @callback: the #GCallback to connect
- * @data: the data to pass to @callback calls
- * @notify: function to be called when disposing of @self
+ * @c_handler: (scope async): the #GCallback to connect
+ * @data: (closure c_handler): the data to pass to @callback calls
+ * @notify: (destroy data): function to be called when disposing of @self
* @flags: the flags used to create the signal connection
*
* Connects @callback to the signal @detailed_signal
@@ -689,12 +689,12 @@ egg_signal_group_connect_object (EggSignalGroup *self,
void
egg_signal_group_connect_data (EggSignalGroup *self,
const gchar *detailed_signal,
- GCallback callback,
+ GCallback c_handler,
gpointer data,
GClosureNotify notify,
GConnectFlags flags)
{
- egg_signal_group_connect_full (self, detailed_signal, callback, data, notify,
+ egg_signal_group_connect_full (self, detailed_signal, c_handler, data, notify,
flags, FALSE);
}
@@ -702,7 +702,7 @@ egg_signal_group_connect_data (EggSignalGroup *self,
* egg_signal_group_connect:
* @self: a #EggSignalGroup
* @detailed_signal: a string of the form "signal-name::detail"
- * @callback: the #GCallback to connect
+ * @c_handler: (scope async): the #GCallback to connect
* @data: the data to pass to @callback calls
*
* Connects @callback to the signal @detailed_signal
@@ -713,10 +713,10 @@ egg_signal_group_connect_data (EggSignalGroup *self,
void
egg_signal_group_connect (EggSignalGroup *self,
const gchar *detailed_signal,
- GCallback callback,
+ GCallback c_handler,
gpointer data)
{
- egg_signal_group_connect_full (self, detailed_signal, callback, data, NULL,
+ egg_signal_group_connect_full (self, detailed_signal, c_handler, data, NULL,
0, FALSE);
}
@@ -724,7 +724,7 @@ egg_signal_group_connect (EggSignalGroup *self,
* egg_signal_group_connect_after:
* @self: a #EggSignalGroup
* @detailed_signal: a string of the form "signal-name::detail"
- * @callback: the #GCallback to connect
+ * @c_handler: (scope async): the #GCallback to connect
* @data: the data to pass to @callback calls
*
* Connects @callback to the signal @detailed_signal
@@ -737,10 +737,10 @@ egg_signal_group_connect (EggSignalGroup *self,
void
egg_signal_group_connect_after (EggSignalGroup *self,
const gchar *detailed_signal,
- GCallback callback,
+ GCallback c_handler,
gpointer data)
{
- egg_signal_group_connect_full (self, detailed_signal, callback,
+ egg_signal_group_connect_full (self, detailed_signal, c_handler,
data, NULL, G_CONNECT_AFTER, FALSE);
}
@@ -748,7 +748,7 @@ egg_signal_group_connect_after (EggSignalGroup *self,
* egg_signal_group_connect_swapped:
* @self: a #EggSignalGroup
* @detailed_signal: a string of the form "signal-name::detail"
- * @callback: the #GCallback to connect
+ * @c_handler: (scope async): the #GCallback to connect
* @data: the data to pass to @callback calls
*
* Connects @callback to the signal @detailed_signal
@@ -762,9 +762,9 @@ egg_signal_group_connect_after (EggSignalGroup *self,
void
egg_signal_group_connect_swapped (EggSignalGroup *self,
const gchar *detailed_signal,
- GCallback callback,
+ GCallback c_handler,
gpointer data)
{
- egg_signal_group_connect_full (self, detailed_signal, callback, data, NULL,
+ egg_signal_group_connect_full (self, detailed_signal, c_handler, data, NULL,
G_CONNECT_SWAPPED, FALSE);
}
diff --git a/contrib/egg/egg-state-machine-action.h b/contrib/egg/egg-state-machine-action.h
index a806448..c14202d 100644
--- a/contrib/egg/egg-state-machine-action.h
+++ b/contrib/egg/egg-state-machine-action.h
@@ -27,9 +27,6 @@ G_BEGIN_DECLS
G_DECLARE_FINAL_TYPE (EggStateMachineAction, egg_state_machine_action, EGG, STATE_MACHINE_ACTION, GObject)
-GAction *egg_state_machine_action_new (EggStateMachine *state_machine,
- const gchar *name);
-
G_END_DECLS
#endif /* EGG_STATE_MACHINE_ACTION_H */
diff --git a/contrib/egg/egg-state-machine.c b/contrib/egg/egg-state-machine.c
index 073eb50..44ecfcf 100644
--- a/contrib/egg/egg-state-machine.c
+++ b/contrib/egg/egg-state-machine.c
@@ -513,6 +513,18 @@ egg_state_machine_set_state (EggStateMachine *self,
}
}
+/**
+ * egg_state_machine_create_action:
+ * @self: An #EggStateMachine
+ * @name: the name of the action.
+ *
+ * Creates a new #GAction with the name of @name.
+ *
+ * Setting the state of this action will toggle the state of the state machine.
+ * You should use g_variant_new_string() or similar to create the state.
+ *
+ * Returns: (transfer full): A newly created #GAction.
+ */
GAction *
egg_state_machine_create_action (EggStateMachine *self,
const gchar *name)
@@ -691,6 +703,19 @@ egg_state_machine_add_style (EggStateMachine *self,
}
}
+/**
+ * egg_state_machine_connect_object:
+ * @self: A #EggStateMachine.
+ * @state: The state the signal connection should exist within
+ * @source: the source object to connect to
+ * @detailed_signal: The detailed signal of @source to connect.
+ * @callback: (scope async): The callback to execute upon signal emission.
+ * @user_data: (closure callback): The user data for @callback.
+ * @flags: signal connection flags.
+ *
+ * Connects to the @detailed_signal of @source only when the current
+ * state of the state machine is @state.
+ */
void
egg_state_machine_connect_object (EggStateMachine *self,
const gchar *state,
diff --git a/contrib/egg/egg-task-cache.c b/contrib/egg/egg-task-cache.c
index 3864958..d27ef03 100644
--- a/contrib/egg/egg-task-cache.c
+++ b/contrib/egg/egg-task-cache.c
@@ -275,8 +275,8 @@ egg_task_cache_evict (EggTaskCache *self,
* For that reason, it is important to remember that this function
* may only be called from the main thread.
*
- * Returns: (type GObject) (nullable): A #GObject or %NULL if the
- * key was not found in the cache.
+ * Returns: (type GObject.Object) (nullable) (transfer none): A #GObject or
+ * %NULL if the key was not found in the cache.
*/
gpointer
egg_task_cache_peek (EggTaskCache *self,
@@ -487,6 +487,13 @@ egg_task_cache_get_async (EggTaskCache *self,
}
}
+/**
+ * egg_task_cache_get_finish:
+ *
+ * Finish a call to egg_task_cache_get_async().
+ *
+ * Returns: (transfer full): The result from the cache.
+ */
gpointer
egg_task_cache_get_finish (EggTaskCache *self,
GAsyncResult *result,
@@ -819,6 +826,9 @@ egg_task_cache_init (EggTaskCache *self)
cache_item_compare_evict_at);
}
+/**
+ * egg_task_cache_new: (skip)
+ */
EggTaskCache *
egg_task_cache_new (GHashFunc key_hash_func,
GEqualFunc key_equal_func,
@@ -852,13 +862,13 @@ egg_task_cache_new (GHashFunc key_hash_func,
}
/**
- * egg_task_cache_get_values:
+ * egg_task_cache_get_values: (skip)
*
* Gets all the values in the cache.
*
* The caller owns the resulting GPtrArray, which itself owns a reference to the children.
*
- * Returns: (transfer container) (element-type gpointer): The values.
+ * Returns: (transfer container): The values.
*/
GPtrArray *
egg_task_cache_get_values (EggTaskCache *self)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]