gdl-dock-placeholder.c revision 946a87d87ab78d94239cf87d386e8595382db822
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
*
* gdl-dock-placeholder.c - Placeholders for docking items
*
* 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 "gdl-tools.h"
#include "gdl-dock-placeholder.h"
#include "gdl-dock-item.h"
#include "gdl-dock-master.h"
#include "libgdltypebuiltins.h"
/* ----- Private prototypes ----- */
GParamSpec *pspec);
GParamSpec *pspec);
GValue *other_data);
/* ----- Private variables and data structures ----- */
enum {
};
struct _GdlDockPlaceholderPrivate {
/* current object this placeholder is pinned to */
/* when the placeholder is moved up the hierarchy, this stack
keeps track of the necessary dock positions needed to get the
placeholder to the original position */
/* Width and height of the attachments */
/* connected signal handlers */
/* Window Coordinates if Dock was floating */
};
/* ----- Private interface ----- */
static void
{
_("Whether the placeholder will stick to its host or "
"move up the hierarchy when the host is redocked"),
_("The dock object this placeholder is attached to"),
/* this will return the top of the placement stack */
_("The position an item will be docked to our host if a "
"request is made to dock to us"),
_("Width for the widget when it's attached to the placeholder"),
_("Height for the widget when it's attached to the placeholder"),
_("Whether the placeholder is standing in for a "
"floating toplevel dock"),
_("X-Coordinate fow dock when floating"),
_("Y-Coordinate fow dock when floating"),
}
static void
{
}
static void
{
switch (prop_id) {
case PROP_STICKY:
break;
case PROP_HOST:
break;
case PROP_NEXT_PLACEMENT:
}
break;
case PROP_WIDTH:
break;
case PROP_HEIGHT:
break;
case PROP_FLOATING:
break;
case PROP_FLOAT_X:
break;
case PROP_FLOAT_Y:
break;
default:
break;
}
}
static void
{
switch (prop_id) {
case PROP_STICKY:
else
break;
case PROP_HOST:
else
break;
case PROP_NEXT_PLACEMENT:
else
break;
case PROP_WIDTH:
break;
case PROP_HEIGHT:
break;
case PROP_FLOATING:
break;
case PROP_FLOAT_X:
break;
case PROP_FLOAT_Y:
break;
default:
break;
}
}
static void
{
}
}
static void
{
pos = GDL_DOCK_TOP;
}
static void
{
/* disconnect handlers */
/* free the placement stack */
}
static void
{
/* placeholders are not reduced */
return;
}
static void
{
while (child) {
continue;
}
if (area > *biggest_child_area) {
}
}
}
static void
{
/* we simply act as a proxy for our host */
} else {
/* If the requested pos is center, we have to make sure that it
* does not colapses existing paned items. Find the larget item
* which is not a paned item to dock to.
*/
gint biggest_child_area = 0;
if (biggest_child) {
/* we simply act as a proxy for our host */
} else {
g_warning ("No suitable child found! Should not be here!");
/* we simply act as a proxy for our host */
}
}
/* Restore dock item's dimention */
switch (placement) {
case GDL_DOCK_LEFT:
}
break;
case GDL_DOCK_RIGHT:
if (complementary_width > 0)
}
break;
case GDL_DOCK_TOP:
}
break;
case GDL_DOCK_BOTTOM:
if (complementary_height > 0)
}
break;
default:
/* nothing */
break;
}
}
static void
{
}
else {
g_warning (_("Attempt to dock a dock object to an unbound placeholder"));
return;
}
/* dock the item as a floating of the controller */
}
}
#ifdef PLACEHOLDER_DEBUG
static void
{
for (; s; s = s->next) {
}
}
#endif
static void
{
/* do nothing */
return;
}
/* ----- Public interface ----- */
{
"name", name,
"sticky", sticky,
NULL));
if (object) {
if (position == GDL_DOCK_NONE)
if (GDL_IS_DOCK (object)) {
/* the top placement will be consumed by the toplevel
dock, so add a dummy placement */
}
/* try a recursion */
do_excursion (ph);
}
return GTK_WIDGET (ph);
}
static void
{
#ifdef PLACEHOLDER_DEBUG
#endif
/* we shouldn't get here, so perform an emergency detach. instead
we should have gotten a detach signal from our host */
/* We didn't get a detach signal from the host. Detach from the
supposedly dead host (consequently attaching to the controller) */
#if 0
/* free the placement stack */
#endif
}
static void
{
/* we go up in the hierarchy and we store the hinted placement in
* the placement stack so we can rebuild the docking layout later
* when we get the host's dock signal. */
g_warning (_("Got a detach signal from an object (%p) who is not "
return;
}
/* skip sticky objects */
return;
if (obj)
/* go up in the hierarchy */
else
/* Detaching from the dead host */
while (new_host) {
/* get placement hint from the new host */
}
else {
g_warning (_("Something weird happened while getting the child "
}
if (!GDL_DOCK_OBJECT_IN_DETACH (new_host))
/* we found a "stable" dock object */
break;
}
/* disconnect host */
if (!new_host) {
#ifdef PLACEHOLDER_DEBUG
g_message ("Detaching from the toplevel. Assignaing to controller");
#endif
/* the toplevel was detached: we attach ourselves to the
controller with an initial placement of floating */
/*
ph->_priv->placement_stack = g_slist_prepend (
ph->_priv->placement_stack, (gpointer) GDL_DOCK_FLOATING);
*/
}
if (new_host)
#ifdef PLACEHOLDER_DEBUG
#endif
}
/**
* do_excursion:
* @ph: placeholder object
*
* Tries to shrink the placement stack by examining the host's
* children and see if any of them matches the placement which is at
* the top of the stack. If this is the case, it tries again with the
* new host.
**/
static void
{
GDL_DOCK_OBJECT (l->data),
&pos);
/* remove the stack position */
/* connect to the new host */
/* recurse... */
if (!GDL_DOCK_OBJECT_IN_REFLOW (l->data))
do_excursion (ph);
break;
}
}
}
}
static void
{
/* see if the given position is compatible for the stack's top
element */
/* the position is compatible: excurse down */
do_excursion (ph);
}
}
}
#ifdef PLACEHOLDER_DEBUG
#endif
}
static void
{
return;
/* remove weak ref to object */
#ifdef PLACEHOLDER_DEBUG
#endif
}
static void
{
"detach",
"dock",
#ifdef PLACEHOLDER_DEBUG
#endif
}
void
{
/* object binding */
/* detach from previous host first */
}