gdl-dock-master.c revision 587397f49165f739c0ff164cbb15aabfc00eb44e
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
*
* gdl-dock-master.c - Object which manages a dock ring
*
* 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-master.h"
#include "gdl-dock.h"
#include "gdl-dock-item.h"
#include "libgdlmarshal.h"
#include "libgdltypebuiltins.h"
#ifdef WIN32
#include "gdl-win32.h"
#endif
/* ----- Private prototypes ----- */
GParamSpec *pspec);
GParamSpec *pspec);
gint x,
gint y,
/* ----- Private data types and variables ----- */
enum {
};
enum {
};
struct _GdlDockMasterPrivate {
/* source id for the idle handler to emit a layout_changed signal */
/* hashes to quickly calculate the overall locked status: i.e.
* if size(unlocked_items) == 0 then locked = 1
* else if size(locked_items) == 0 then locked = 0
* else locked = -1
*/
};
#define COMPUTE_LOCKED(master) \
/* ----- Private interface ----- */
static void
{
_("Default title for newly created floating docks"),
NULL,
_("If is set to 1, all the dock items bound to the master "
"are locked; if it's 0, all are unlocked; -1 indicates "
"inconsistency among the items"),
-1, 1, 0,
_("Switcher buttons style"),
_("Allow the master's dock items to expand their container "
"dock objects in the given direction"),
g_signal_new ("layout-changed",
NULL, /* accumulator */
NULL, /* accu_data */
G_TYPE_NONE, /* return type */
0);
}
static void
{
}
static void
{
if (GDL_IS_DOCK (object)) {
if (found_link)
/* now find some other non-automatic toplevel to use as a
new controller. start from the last dock, since it's
probably a non-floating and manual */
while (last) {
break;
}
};
if (new_controller) {
/* the new controller gets the ref (implicitly of course) */
} else {
/* no controller, no master */
}
}
}
/* disconnect dock object signals */
/* unref the object from the hash if it's there */
if (found_object == object) {
}
}
}
static void
{
}
static void
{
if (master->toplevel_docks) {
}
if (master->dock_objects) {
while (alive_docks) {
}
}
}
}
}
}
static void
{
if (!GDL_IS_DOCK_ITEM (item))
return;
}
static void
{
GList *l;
}
/* just to be sure hidden items are set too */
}
static void
{
switch (prop_id) {
case PROP_DEFAULT_TITLE:
break;
case PROP_LOCKED:
if (g_value_get_int (value) >= 0)
break;
case PROP_SWITCHER_STYLE:
break;
case PROP_EXPANSION_DIRECTION:
break;
default:
break;
}
}
static void
{
switch (prop_id) {
case PROP_DEFAULT_TITLE:
break;
case PROP_LOCKED:
break;
case PROP_SWITCHER_STYLE:
break;
case PROP_EXPANSION_DIRECTION:
break;
default:
break;
}
}
static void
{
/* Set the target to itself so it won't go floating with just a click. */
}
static void
{
/* Erase previously drawn rectangle */
/* cancel conditions */
return;
/* dock object to the requested position */
}
static void
{
gint x, y;
my_request = *request;
/* first look under the pointer */
if (window) {
/* ok, now get the widget who owns that window and see if we can
get to a GdlDock by walking up the hierarchy */
if (GTK_IS_WIDGET (widget)) {
if (widget) {
/* verify that the pointer is still in that dock
(the user could have moved it) */
}
}
}
if (dock) {
/* translate root coordinates into dock object coordinates
(i.e. widget coordinates) */
x, y, &my_request);
}
else {
GList *l;
/* try to dock the item in all the docks in the ring in turn */
/* translate root coordinates into dock object coordinates
(i.e. widget coordinates) */
x, y, &my_request);
if (may_dock)
break;
}
}
if (!may_dock) {
/* Special case for GdlDockItems : they must respect the flags */
if(GDL_IS_DOCK_ITEM(item)
return;
/* setup extra docking information */
}
/* if we want to enforce GDL_DOCK_ITEM_BEH_NEVER_FLOATING */
/* the item must remain attached to the controller, otherwise */
/* it could be inserted in another floating dock */
/* so check for the flag at this moment */
else if(GDL_IS_DOCK_ITEM(item)
return;
/* erase the previous rectangle */
}
/* set the new values */
*request = my_request;
/* draw the previous rectangle */
}
static void
{
(void)key;
struct {
}
static void
{
return;
return;
}
};
#ifdef WIN32
if (is_os_vista())
{
// On Vista the dash-line is increadibly slow to draw, it takes several minutes to draw the tracking lines
// With GDK_LINE_SOLID it is parts of a second
// No performance issue on WinXP
}
#else
#endif
dash_list[0] = 1;
}
static void
{
/* emit "layout-changed" on the controller to notify the user who
* normally shouldn't have access to us */
if (master->controller)
/* remove the idle handler if there is one */
}
}
static gboolean
{
return FALSE;
}
static void
{
/* here we are in fact interested in the requestor, since it's
* assumed that object will not change its visibility... for the
* requestor, however, could mean that it's being shown */
if (!GDL_DOCK_OBJECT_IN_REFLOW (requestor) &&
}
}
static void
{
if (!GDL_DOCK_OBJECT_IN_REFLOW (object) &&
}
}
static void
{
if (item_locked) {
} else {
}
}
/* ----- Public interface ----- */
void
{
if (!GDL_DOCK_OBJECT_AUTOMATIC (object)) {
/* create a name for the object if it doesn't have one */
/* directly set the name, since it's a construction only
property */
/* add the object to our hash list */
g_warning (_("master %p: unable to add object %p[%s] to the hash. "
"There already is an item with that name (%p)."),
}
else {
}
}
if (GDL_IS_DOCK (object)) {
/* if this is the first toplevel we are adding, name it controller */
if (!master->toplevel_docks)
/* the dock should already have the ref */
/* add dock to the toplevel list */
if (floating)
else
/* we are interested in the dock request this toplevel
* receives to update the layout */
}
else if (GDL_IS_DOCK_ITEM (object)) {
/* we need to connect the item's signals */
/* register to "locked" notification if the item has a grip,
* and add the item to the corresponding hash */
}
/* If the item is notebook, set the switcher style */
if (GDL_IS_DOCK_NOTEBOOK (object) &&
{
}
/* post a layout_changed emission if the item is not automatic
* (since it should be added to the items model) */
if (!GDL_DOCK_OBJECT_AUTOMATIC (object)) {
}
}
}
void
{
* that's the case */
}
}
/* ref the master, since removing the controller could cause master disposal */
/* all the interesting stuff happens in _gdl_dock_master_remove */
/* post a layout_changed emission if the item is not automatic
* (since it should be removed from the items model) */
if (!GDL_DOCK_OBJECT_AUTOMATIC (object)) {
}
/* balance ref count */
}
void
{
struct {
} data;
}
void
{
GList *l;
for (l = master->toplevel_docks; l; ) {
l = l->next;
}
}
{
if (!nick_name)
return NULL;
}
{
return master->controller;
}
void
{
if (new_controller) {
g_warning (_("The new dock controller %p is automatic. Only manual "
"dock objects should be named controller."), new_controller);
/* check that the controller is in the toplevel list */
} else {
/* no controller, no master */
}
}
static void
{
if (!GDL_IS_DOCK_ITEM (obj))
return;
if (GDL_IS_DOCK_NOTEBOOK (obj)) {
if (GDL_IS_SWITCHER (child)) {
}
}
}
static void
{
GList *l;
}
/* just to be sure hidden items are set too */
}