/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
*
* gdl-dock-object.c - Abstract base class for all dock related objects
*
* This file is part of the GNOME Devtools Libraries.
*
* Copyright (C) 2002 Gustavo Gir�ldez <gustavo.giraldez@gmx.net>
*
* 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, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include "gdl-i18n.h"
#include <stdlib.h>
#include <string.h>
#include "gdl-dock-object.h"
#include "gdl-dock-master.h"
#include "libgdltypebuiltins.h"
#include "libgdlmarshal.h"
/* for later use by the registry */
#include "gdl-dock.h"
#include "gdl-dock-item.h"
#include "gdl-dock-paned.h"
#include "gdl-dock-notebook.h"
#include "gdl-dock-placeholder.h"
/* ----- Private prototypes ----- */
GParamSpec *pspec);
GParamSpec *pspec);
GValue *other_data);
/* ----- Private data types and variables ----- */
enum {
};
enum {
DOCK,
};
struct DockRegisterItem {
};
/* ----- Private interface ----- */
static void
{
_("Unique name for identifying the dock object"),
NULL,
_("Human readable name for the dock object"),
NULL,
_("Stock icon for the dock object"),
NULL,
_("Pixbuf icon for the dock object"),
_("Dock master this dock object is bound to"),
g_signal_new ("detach",
NULL,
NULL,
1,
g_signal_new ("dock",
NULL,
NULL,
3,
}
static void
{
object->freeze_count = 0;
}
static void
{
switch (prop_id) {
case PROP_NAME:
break;
case PROP_LONG_NAME:
break;
case PROP_STOCK_ID:
break;
case PROP_PIXBUF_ICON:
break;
case PROP_MASTER:
if (g_value_get_object (value))
else
break;
default:
break;
}
}
static void
{
switch (prop_id) {
case PROP_NAME:
break;
case PROP_LONG_NAME:
break;
case PROP_STOCK_ID:
break;
case PROP_PIXBUF_ICON:
break;
case PROP_MASTER:
break;
default:
break;
}
}
static void
{
}
static void
{
}
static void
{
if (gdl_dock_object_is_compound (object)) {
/* detach our dock object children if we have some, and even
if we are not attached, so they can get notification */
NULL);
}
if (GDL_DOCK_OBJECT_ATTACHED (object)) {
/* detach ourselves */
}
/* finally unbind us */
}
static void
{
if (GDL_DOCK_OBJECT_AUTOMATIC (object))
}
static void
{
}
}
static void
{
}
}
static void
{
/* detach children */
}
/* detach the object itself */
if (gtk_widget_get_parent (widget))
if (parent)
}
static void
{
if (!gdl_dock_object_is_compound (object))
return;
GList *l;
/* detach ourselves and then re-attach our children to our
current parent. if we are not currently attached, the
children are detached */
if (parent)
/* Detach the children before detaching this object, since in this
* way the children can have access to the whole object hierarchy.
* Set the InDetach flag now, so the children know that this object
* is going to be detached. */
if (!GDL_IS_DOCK_OBJECT (l->data))
continue;
if (parent)
}
/* Now it can be detached */
/* After detaching the reduced object, we can add the
children (the only child in fact) to the new parent */
g_object_unref (l->data);
}
/* sink the widget, so any automatic floating widget is destroyed */
/* don't reenter */
if (parent)
}
}
static void
{
g_warning (_("Call to gdl_dock_object_dock in a dock object %p "
"(object type is %s) which hasn't implemented this method"),
}
static void
{
}
/* ----- Public interface ----- */
{
return klass->is_compound;
}
void
{
if (!GDL_IS_DOCK_OBJECT (object))
return;
if (!GDL_DOCK_OBJECT_ATTACHED (object))
return;
/* freeze the object to avoid reducing while detaching children */
}
{
}
}
void
{
if (object->freeze_count == 0) {
destroyed if they are frozen */
}
object->freeze_count++;
}
void
{
object->freeze_count--;
if (object->freeze_count == 0) {
if (object->reduce_pending) {
}
}
}
void
{
if (GDL_DOCK_OBJECT_FROZEN (object)) {
return;
}
}
gint x,
gint y,
{
else
return FALSE;
}
/**
* gdl_dock_object_dock:
* @object:
* @requestor:
* @position:
* @other_data: (allow-none):
**/
void
{
return;
g_warning (_("Dock operation requested in a non-bound object %p. "
"The application might crash"), object);
if (!gdl_dock_object_is_bound (requestor))
g_warning (_("Cannot dock %p to %p because they belong to different masters"),
return;
}
/* first, see if we can optimize things by reordering */
if (position != GDL_DOCK_NONE) {
return;
}
/* freeze the object, since under some conditions it might be destroyed when
detaching the requestor */
/* detach the requestor before docking */
if (position != GDL_DOCK_NONE)
}
void
{
/* nothing to do here */
return;
g_warning (_("Attempt to bind to %p an already bound dock object %p "
return;
}
}
void
{
/* detach the object first */
if (GDL_DOCK_OBJECT_ATTACHED (object))
}
}
{
}
{
else
return FALSE;
}
void
{
if (parent)
/* chain the call to our parent */
}
/**
* gdl_dock_object_child_placement:
* @object: the dock object we are asking for child placement
* @child: the child of the @object we want the placement for
* @placement: where to return the placement information
*
* This function returns information about placement of a child dock
* object inside another dock object. The function returns %TRUE if
* @child is effectively a child of @object. @placement should
* normally be initially setup to %GDL_DOCK_NONE. If it's set to some
* other value, this function will not touch the stored value if the
* specified placement is "compatible" with the actual placement of
* the child.
*
* @placement can be %NULL, in which case the function simply tells if
* @child is attached to @object.
*
* Returns: %TRUE if @child is a child of @object.
*/
{
/* simple case */
if (!gdl_dock_object_is_compound (object))
return FALSE;
else
return FALSE;
}
/* ----- dock param type functions start here ------ */
static void
{
}
static void
{
}
static void
{
}
static void
{
}
static void
{
case GDL_DOCK_NONE:
break;
case GDL_DOCK_TOP:
break;
case GDL_DOCK_BOTTOM:
break;
case GDL_DOCK_LEFT:
break;
case GDL_DOCK_RIGHT:
break;
case GDL_DOCK_CENTER:
break;
case GDL_DOCK_FLOATING:
break;
}
}
static void
{
}
static void
{
}
static void
{
}
static void
{
}
static void
{
else
}
gdl_dock_param_get_type (void)
{
if (our_type == 0) {
/* register known transform functions */
/* exporters */
g_value_register_transform_func (GDL_TYPE_DOCK_PLACEMENT, our_type, gdl_dock_param_export_placement);
/* importers */
g_value_register_transform_func (our_type, GDL_TYPE_DOCK_PLACEMENT, gdl_dock_param_import_placement);
}
return our_type;
}
/* -------------- nick <-> type conversion functions --------------- */
static void
{
guint i = 0;
if (dock_register)
return;
/* add known types */
for (i = 0; i < n_default; i++)
}
/**
* gdl_dock_object_nick_from_type:
* @type: The type for which to find the nickname
*
* Finds the nickname for a given type
*
* Returns: If the object has a nickname, then it is returned.
* Otherwise, the type name.
*/
const gchar *
{
guint i = 0;
if (!dock_register)
for (i=0; i < dock_register->len; i++) {
}
}
/**
* gdl_dock_object_type_from_nick:
* @nick: The nickname for the object type
*
* Finds the object type assigned to a given nickname.
*
* Returns: If the nickname has previously been assigned, then the corresponding
* object type is returned. Otherwise, %G_TYPE_NONE.
*/
{
guint i = 0;
if (!dock_register)
for (i = 0; i < dock_register->len; i++) {
}
}
if (!nick_is_in_register) {
/* try searching in the glib type system */
}
return type;
}
/**
* gdl_dock_object_set_type_for_nick:
* @nick: The nickname for the object type
* @type: The object type
*
* Assigns an object type to a given nickname. If the nickname already exists,
* then it reassigns it to a new object type.
*
* Returns: If the nick was previously assigned, the old type is returned.
* Otherwise, %G_TYPE_NONE.
*/
{
guint i = 0;
if (!dock_register)
for (i = 0; i < dock_register->len; i++) {
}
}
return old_type;
}