gdl-dock-paned.c revision b5c42580c384b01263eb1a1e199376e15eef7cd3
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
*
*
* 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 <string.h>
#include "gdl-tools.h"
#include "gdl-dock-paned.h"
/* Private prototypes */
GParamSpec *pspec);
GParamSpec *pspec);
gint x,
gint y,
GValue *other_data);
/* ----- Class variables and definitions ----- */
#define SPLIT_RATIO 0.3
enum {
};
/* ----- Private functions ----- */
static void
{
_("Position of the divider in pixels"),
0, G_MAXINT, 0,
}
static void
{
}
static void
{
/* make sure resizing only can be done in the drag direction */
{
return;
}
if (GTK_IS_PANED (widget)) {
}
}
} else if (!GDL_IS_DOCK_OBJECT (widget)) {
break;
}
}
}
static void
{
(void)g_object;
/* chain the notification to the GdlDockPaned */
"expand-direction", &expansion_direction,
NULL);
switch (expansion_direction) {
"max-position", &max_position,
"position", &position,
NULL);
} else {
}
}
break;
default:
;
}
}
}
static gboolean
{
(void)widget;
"expand-direction", &expansion_direction,
NULL);
switch (expansion_direction) {
{
"max-position", &max_position,
"position", &position,
NULL);
/* expand the paned's ancestors a bit if the separator is in max position
* to allow dragging in all directions */
if (position == max_position)
break;
}
default:
;
}
}
}
else {
if (paned->position_changed) {
/* emit pending layout changed signal to track separator position */
}
}
}
return FALSE;
}
static void
{
/* create the container paned */
else
/* get notification for propagation */
}
static GObject *
{
(type,
NULL);
if (g_object) {
item->orientation);
/* otherwise, the orientation was set as a construction
parameter and the child is already created */
}
return g_object;
}
static void
{
switch (prop_id) {
case PROP_POSITION:
break;
default:
break;
}
}
static void
{
switch (prop_id) {
case PROP_POSITION:
else
g_value_set_uint (value, 0);
break;
default:
break;
}
}
static void
{
/* we need to call the virtual first, since in GdlDockDestroy our
children dock objects are detached */
/* after that we can remove the GtkNotebook */
};
}
static void
{
if (pos != GDL_DOCK_NONE)
}
static void
{
if (include_internals) {
/* use GdlDockItem's forall */
}
else {
}
}
static GType
{
return G_TYPE_NONE;
else
return GDL_TYPE_DOCK_ITEM;
}
static void
{
struct {
gint x, y;
if (may_dock) {
}
}
static gboolean
gint x,
gint y,
{
/* we get (x,y) in our allocation coordinates system */
/* Get item's allocation. */
/* Get coordinates relative to our window. */
if (request)
my_request = *request;
/* Check if coordinates are inside the widget. */
/* It's inside our area. */
/* Set docking indicator rectangle to the widget size. */
/* See if it's in the border_width band. */
} else { /* Otherwise try our children. */
struct {
gint x, y;
} data;
/* give them coordinates in their allocation system... the
GtkPaned has no window, so our children allocation
coordinates are our window coordinates */
&data);
if (!may_dock) {
} else {
}
} else {
} else {
}
}
}
}
}
if (may_dock) {
/* adjust returned coordinates so they are relative to
our allocation */
}
}
*request = my_request;
return may_dock;
}
static void
{
if (GDL_IS_DOCK_ITEM (requestor)) {
if (temp == -2)
temp = 0;
if (temp == -2)
}
/* see if we can dock the item in our paned */
}
break;
case GTK_ORIENTATION_VERTICAL:
}
break;
default:
break;
}
if (!done) {
/* this will create another paned and reparent us there */
other_data));
}
else {
}
}
static void
{
}
if (old_paned) {
if (child1) {
}
if (child2) {
}
}
}
static gboolean
{
}
if (pos != GDL_DOCK_NONE) {
if (placement)
return TRUE;
}
else
return FALSE;
}
/* ----- Public interface ----- */
{
return GTK_WIDGET (paned);
}