[gdl] Deprecate GDL_DOCK_ATTACHED
- From: Sebastien Granjoux <sgranjoux src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gdl] Deprecate GDL_DOCK_ATTACHED
- Date: Fri, 3 Aug 2012 17:14:42 +0000 (UTC)
commit 92f0fcde53b8a6d05aecdc070a9d146cca70909b
Author: SÃbastien Granjoux <seb sfo free fr>
Date: Fri Aug 3 14:06:01 2012 +0200
Deprecate GDL_DOCK_ATTACHED
gdl/gdl-dock-item.c | 10 +++++-----
gdl/gdl-dock-object.c | 28 ++++++++++++++++++++++++++--
gdl/gdl-dock-object.h | 6 ++++++
gdl/gdl-dock.c | 4 ++--
gdl/gdl-dock.h | 6 +++---
5 files changed, 42 insertions(+), 12 deletions(-)
---
diff --git a/gdl/gdl-dock-item.c b/gdl/gdl-dock-item.c
index 52c5c06..9cd23da 100644
--- a/gdl/gdl-dock-item.c
+++ b/gdl/gdl-dock-item.c
@@ -782,7 +782,7 @@ gdl_dock_item_get_property (GObject *g_object,
g_value_set_boolean (value, GDL_DOCK_ITEM_ICONIFIED (item));
break;
case PROP_CLOSED:
- g_value_set_boolean (value, !GDL_DOCK_OBJECT_ATTACHED (item));
+ g_value_set_boolean (value, gdl_dock_item_is_closed (item));
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (g_object, prop_id, pspec);
@@ -2271,7 +2271,7 @@ gdl_dock_item_show_item (GdlDockItem *item)
toplevel = gdl_dock_master_get_controller
(GDL_DOCK_OBJECT_GET_MASTER (item));
- if (toplevel == item) return;
+ if (toplevel == GDL_DOCK_OBJECT (item)) return;
if (item->behavior & GDL_DOCK_ITEM_BEH_NEVER_FLOATING) {
g_warning("Object %s has no default position and flag GDL_DOCK_ITEM_BEH_NEVER_FLOATING is set.\n",
@@ -2396,8 +2396,8 @@ gdl_dock_item_is_placeholder (GdlDockItem *item)
* gdl_dock_item_is_closed:
* @item: The dock item to be checked
*
- * Checks whether a given #GdlDockItem is closed: still in the widget hierarchy
- * and hidden or detached.
+ * Checks whether a given #GdlDockItem is closed. It can be only hidden or
+ * detached.
*
* Returns: %TRUE if the dock item is closed.
*
@@ -2406,7 +2406,7 @@ gdl_dock_item_is_placeholder (GdlDockItem *item)
gboolean
gdl_dock_item_is_closed (GdlDockItem *item)
{
- return (GDL_DOCK_OBJECT_FLAGS (item) & GDL_DOCK_ATTACHED) == 0;
+ return gdl_dock_object_is_closed (GDL_DOCK_OBJECT (item));
}
diff --git a/gdl/gdl-dock-object.c b/gdl/gdl-dock-object.c
index d3c2ef8..4883c6d 100644
--- a/gdl/gdl-dock-object.c
+++ b/gdl/gdl-dock-object.c
@@ -938,8 +938,29 @@ gdl_dock_object_child_placement (GdlDockObject *object,
return FALSE;
}
+/* Access functions
+ *---------------------------------------------------------------------------*/
-/* ----- dock param type functions start here ------ */
+/**
+ * gdl_dock_object_is_closed:
+ * @object: The dock object to be checked
+ *
+ * Checks whether a given #GdlDockObject is closed. It can be only hidden and
+ * still in the widget hierarchy or detached.
+ *
+ * Returns: %TRUE if the dock object is closed.
+ *
+ * Since: 3.6
+ */
+gboolean
+gdl_dock_object_is_closed (GdlDockObject *object)
+{
+ return (object->flags & GDL_DOCK_ATTACHED) == 0;
+}
+
+
+/* Dock param type functions
+ *---------------------------------------------------------------------------*/
static void
gdl_dock_param_export_int (const GValue *src,
@@ -1073,7 +1094,10 @@ gdl_dock_param_get_type (void)
return our_type;
}
-/* -------------- nick <-> type conversion functions --------------- */
+
+
+/* Nick <-> Type conversion
+ *---------------------------------------------------------------------------*/
static void
gdl_dock_object_register_init (void)
diff --git a/gdl/gdl-dock-object.h b/gdl/gdl-dock-object.h
index 8436981..6e67a4c 100644
--- a/gdl/gdl-dock-object.h
+++ b/gdl/gdl-dock-object.h
@@ -194,14 +194,18 @@ struct _GdlDockObjectClass {
#define GDL_DOCK_OBJECT_AUTOMATIC(obj) \
((GDL_DOCK_OBJECT_FLAGS (obj) & GDL_DOCK_AUTOMATIC) != 0)
+#ifndef GDL_DISABLE_DEPRECATED
/**
* GDL_DOCK_OBJECT_ATTACHED:
* @obj: A #GdlDockObject
*
* Evaluates to %TRUE if the object has a parent.
+ *
+ * Deprecated: 3.6: Use !gdl_dock_object_is_closed()
*/
#define GDL_DOCK_OBJECT_ATTACHED(obj) \
((GDL_DOCK_OBJECT_FLAGS (obj) & GDL_DOCK_ATTACHED) != 0)
+#endif
/**
* GDL_DOCK_OBJECT_IN_REFLOW:
@@ -293,6 +297,8 @@ gboolean gdl_dock_object_child_placement (GdlDockObject *object,
GdlDockObject *child,
GdlDockPlacement *placement);
+gboolean gdl_dock_object_is_closed (GdlDockObject *object);
+
/* other types */
/* this type derives from G_TYPE_STRING and is meant to be the basic
diff --git a/gdl/gdl-dock.c b/gdl/gdl-dock.c
index 6269d8e..2859497 100644
--- a/gdl/gdl-dock.c
+++ b/gdl/gdl-dock.c
@@ -834,7 +834,7 @@ gdl_dock_reduce (GdlDockObject *object)
if (GDL_DOCK_OBJECT_AUTOMATIC (dock)) {
gtk_widget_destroy (GTK_WIDGET (dock));
- } else if (!GDL_DOCK_OBJECT_ATTACHED (dock)) {
+ } else if (gdl_dock_object_is_closed (GDL_DOCK_OBJECT (dock))) {
/* if the user explicitly detached the object */
if (dock->priv->floating)
gtk_widget_hide (GTK_WIDGET (dock));
@@ -1304,7 +1304,7 @@ gdl_dock_add_item (GdlDock *dock,
/* Check if a placeholder widget already exist in the same dock */
placeholder = gdl_dock_master_get_object (GDL_DOCK_OBJECT_GET_MASTER (dock), GDL_DOCK_OBJECT (item)->name);
- if ((placeholder != item) && (placeholder != NULL)) {
+ if ((placeholder != GDL_DOCK_OBJECT (item)) && (placeholder != NULL)) {
if (gdl_dock_object_get_toplevel (placeholder) == dock) {
parent = gdl_dock_object_get_parent_object (placeholder);
} else {
diff --git a/gdl/gdl-dock.h b/gdl/gdl-dock.h
index 292689c..02dd47c 100644
--- a/gdl/gdl-dock.h
+++ b/gdl/gdl-dock.h
@@ -91,9 +91,6 @@ void gdl_dock_add_floating_item (GdlDock *dock,
GdlDockItem *gdl_dock_get_item_by_name (GdlDock *dock,
const gchar *name);
-GdlDockPlaceholder *gdl_dock_get_placeholder_by_name (GdlDock *dock,
- const gchar *name);
-
GList *gdl_dock_get_named_items (GdlDock *dock);
GdlDock *gdl_dock_object_get_toplevel (GdlDockObject *object);
@@ -105,6 +102,9 @@ void gdl_dock_hide_preview (GdlDock *dock);
void gdl_dock_set_skip_taskbar (GdlDock *dock,
gboolean skip);
#ifndef GDL_DISABLE_DEPRECATED
+GdlDockPlaceholder *gdl_dock_get_placeholder_by_name (GdlDock *dock,
+ const gchar *name);
+
void gdl_dock_xor_rect (GdlDock *dock,
GdkRectangle *rect) G_GNUC_DEPRECATED_FOR(gdl_dock_show_preview);
void gdl_dock_xor_rect_hide (GdlDock *dock) G_GNUC_DEPRECATED_FOR(gdl_dock_hide_preview);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]