gdl-dock-master.c revision 3a5a301950ddd3362739f96efbd17118ef09ea17
97N/A/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- 97N/A * This file is part of the GNOME Devtools Libraries. 97N/A * Copyright (C) 2002 Gustavo Gir�ldez <gustavo.giraldez@gmx.net> 97N/A * This library is free software; you can redistribute it and/or 97N/A * modify it under the terms of the GNU Lesser General Public 97N/A * License as published by the Free Software Foundation; either 97N/A * version 2.1 of the License, or (at your option) any later version. 97N/A * This library is distributed in the hope that it will be useful, 97N/A * but WITHOUT ANY WARRANTY; without even the implied warranty of 97N/A * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 97N/A * Lesser General Public License for more details. 97N/A * You should have received a copy of the GNU Lesser General Public 97N/A * License along with this library; if not, write to the Free Software 3732N/A * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 181N/A/* ----- Private prototypes ----- */ /* ----- Private data types and variables ----- */ gint number;
/* for naming nameless manual objects */ /* 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 /* ----- Private interface ----- */ _(
"Default title for newly created floating docks"),
_(
"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"),
_(
"Switcher buttons style"),
_(
"Allow the master's dock items to expand their container " "dock objects in the given direction"),
/* 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 */ /* the new controller gets the ref (implicitly of course) */ /* no controller, no master */ /* disconnect dock object signals */ /* unref the object from the hash if it's there */ /* just to be sure hidden items are set too */ /* Set the target to itself so it won't go floating with just a click. */ /* Erase previously drawn rectangle */ /* dock object to the requested position */ /* first look under the pointer */ /* ok, now get the widget who owns that window and see if we can get to a GdlDock by walking up the hierarchy */ /* verify that the pointer is still in that dock (the user could have moved it) */ /* translate root coordinates into dock object coordinates (i.e. widget coordinates) */ /* 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) */ /* Special case for GdlDockItems : they must respect the flags */ /* 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 */ /* erase the previous rectangle */ /* draw the previous rectangle */ // 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 /* emit "layout-changed" on the controller to notify the user who * normally shouldn't have access to us */ /* remove the idle handler if there is one */ /* 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 */ /* ----- Public interface ----- */ /* create a name for the object if it doesn't have one */ /* directly set the name, since it's a construction only /* 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)."),
/* if this is the first toplevel we are adding, name it controller */ /* the dock should already have the ref */ /* add dock to the toplevel list */ /* we are interested in the dock request this toplevel * receives to update the layout */ /* 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 */ /* post a layout_changed emission if the item is not automatic * (since it should be added to the items model) */ /* 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) */ g_warning (_(
"The new dock controller %p is automatic. Only manual " /* check that the controller is in the toplevel list */ /* no controller, no master */ /* just to be sure hidden items are set too */