зеркало из https://github.com/mozilla/pjs.git
Bring toolbar drag/drop back to life.
This commit is contained in:
Родитель
812bf4b807
Коммит
8f9d02cb35
|
@ -42,6 +42,7 @@
|
||||||
#include "ToolbarSeparator.h"
|
#include "ToolbarSeparator.h"
|
||||||
#include "ToolbarUrlBar.h"
|
#include "ToolbarUrlBar.h"
|
||||||
#include "ToolbarWindowList.h"
|
#include "ToolbarWindowList.h"
|
||||||
|
#include "ToolbarDrop.h"
|
||||||
|
|
||||||
#if DEBUG_radha
|
#if DEBUG_radha
|
||||||
#define D(x) x
|
#define D(x) x
|
||||||
|
@ -112,6 +113,17 @@ XFE_RDFToolbar::XFE_RDFToolbar(XFE_Frame * frame,
|
||||||
|
|
||||||
setHTView(view);
|
setHTView(view);
|
||||||
|
|
||||||
|
|
||||||
|
_toolbarDropSite = new XFE_RDFToolbarDrop(_toolbar, this);
|
||||||
|
_toolbarDropSite->enable();
|
||||||
|
|
||||||
|
// Configure the drop site
|
||||||
|
Arg xargs[1];
|
||||||
|
Cardinal n = 0;
|
||||||
|
|
||||||
|
XtSetArg(xargs[n],XmNanimationStyle, XmDRAG_UNDER_NONE); n++;
|
||||||
|
_toolbarDropSite->update(xargs,n);
|
||||||
|
|
||||||
show();
|
show();
|
||||||
|
|
||||||
_frame->registerInterest(XFE_View::commandNeedsUpdating,
|
_frame->registerInterest(XFE_View::commandNeedsUpdating,
|
||||||
|
@ -140,6 +152,10 @@ XFE_RDFToolbar::XFE_RDFToolbar(XFE_Frame * frame,
|
||||||
|
|
||||||
XFE_RDFToolbar::~XFE_RDFToolbar()
|
XFE_RDFToolbar::~XFE_RDFToolbar()
|
||||||
{
|
{
|
||||||
|
if (_toolbarDropSite)
|
||||||
|
{
|
||||||
|
delete _toolbarDropSite;
|
||||||
|
}
|
||||||
_frame->unregisterInterest(XFE_View::commandNeedsUpdating,
|
_frame->unregisterInterest(XFE_View::commandNeedsUpdating,
|
||||||
this,
|
this,
|
||||||
(XFE_FunctionNotification)updateCommand_cb);
|
(XFE_FunctionNotification)updateCommand_cb);
|
||||||
|
@ -255,6 +271,54 @@ XFE_RDFToolbar::update()
|
||||||
#endif /*NOT_YET*/
|
#endif /*NOT_YET*/
|
||||||
}
|
}
|
||||||
//////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////
|
||||||
|
Widget
|
||||||
|
XFE_RDFToolbar::getFirstItem()
|
||||||
|
{
|
||||||
|
return XfeToolBarGetFirstItem(_toolbar);
|
||||||
|
}
|
||||||
|
//////////////////////////////////////////////////////////////////////////
|
||||||
|
Widget
|
||||||
|
XFE_RDFToolbar::getLastItem()
|
||||||
|
{
|
||||||
|
return XfeToolBarGetLastItem(_toolbar);
|
||||||
|
}
|
||||||
|
//////////////////////////////////////////////////////////////////////////
|
||||||
|
Widget
|
||||||
|
XFE_RDFToolbar::getIndicatorItem()
|
||||||
|
{
|
||||||
|
return XfeToolBarGetIndicatorItem(_toolbar);
|
||||||
|
}
|
||||||
|
//////////////////////////////////////////////////////////////////////////
|
||||||
|
void
|
||||||
|
XFE_RDFToolbar::configureIndicatorItem(HT_Resource entry)
|
||||||
|
{
|
||||||
|
Widget indicator = getIndicatorItem();
|
||||||
|
|
||||||
|
if (XfeIsAlive(indicator))
|
||||||
|
{
|
||||||
|
Pixmap pixmap = XmUNSPECIFIED_PIXMAP;
|
||||||
|
Pixmap pixmapMask = XmUNSPECIFIED_PIXMAP;
|
||||||
|
Pixmap armedPixmap = XmUNSPECIFIED_PIXMAP;
|
||||||
|
Pixmap armedPixmapMask = XmUNSPECIFIED_PIXMAP;
|
||||||
|
|
||||||
|
if (entry)
|
||||||
|
{
|
||||||
|
XFE_RDFUtils::getPixmapsForEntry(_toolbar,
|
||||||
|
entry,
|
||||||
|
&pixmap,
|
||||||
|
&pixmapMask,
|
||||||
|
&armedPixmap,
|
||||||
|
&armedPixmapMask);
|
||||||
|
}
|
||||||
|
|
||||||
|
XtVaSetValues(indicator,
|
||||||
|
XmNpixmap, pixmap,
|
||||||
|
XmNpixmapMask, pixmapMask,
|
||||||
|
XmNbuttonLayout, XmBUTTON_LABEL_ON_RIGHT,
|
||||||
|
NULL);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//////////////////////////////////////////////////////////////////////////
|
||||||
void
|
void
|
||||||
XFE_RDFToolbar::notify(HT_Resource n, HT_Event whatHappened)
|
XFE_RDFToolbar::notify(HT_Resource n, HT_Event whatHappened)
|
||||||
{
|
{
|
||||||
|
@ -587,6 +651,53 @@ XFE_RDFToolbar::updateAppearance()
|
||||||
|
|
||||||
updateRoot();
|
updateRoot();
|
||||||
}
|
}
|
||||||
|
//////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
//
|
||||||
|
// DND feedback methods
|
||||||
|
//
|
||||||
|
Widget
|
||||||
|
XFE_RDFToolbar::getDropTargetItem()
|
||||||
|
{
|
||||||
|
return _dropTargetItem;
|
||||||
|
}
|
||||||
|
//////////////////////////////////////////////////////////////////////////
|
||||||
|
unsigned char
|
||||||
|
XFE_RDFToolbar::getDropTargetLocation()
|
||||||
|
{
|
||||||
|
return _dropTargetLocation;
|
||||||
|
}
|
||||||
|
//////////////////////////////////////////////////////////////////////////
|
||||||
|
void
|
||||||
|
XFE_RDFToolbar::setDropTargetItem(Widget item,int x)
|
||||||
|
{
|
||||||
|
assert( XfeIsAlive(item) );
|
||||||
|
|
||||||
|
_dropTargetItem = item;
|
||||||
|
|
||||||
|
_dropTargetLocation = XfeToolBarXYToIndicatorLocation(_toolbar,
|
||||||
|
_dropTargetItem,
|
||||||
|
x,0);
|
||||||
|
|
||||||
|
int position = XfeChildGetIndex(_dropTargetItem);
|
||||||
|
|
||||||
|
XtVaSetValues(_toolbar,
|
||||||
|
XmNindicatorPosition, position,
|
||||||
|
XmNindicatorLocation, _dropTargetLocation,
|
||||||
|
NULL);
|
||||||
|
}
|
||||||
|
//////////////////////////////////////////////////////////////////////////
|
||||||
|
void
|
||||||
|
XFE_RDFToolbar::clearDropTargetItem()
|
||||||
|
{
|
||||||
|
_dropTargetItem = NULL;
|
||||||
|
|
||||||
|
XtVaSetValues(_toolbar,
|
||||||
|
XmNindicatorPosition, XmINDICATOR_DONT_SHOW,
|
||||||
|
NULL);
|
||||||
|
}
|
||||||
|
//////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////
|
||||||
/* static */
|
/* static */
|
||||||
void
|
void
|
||||||
|
|
|
@ -37,6 +37,7 @@
|
||||||
class XFE_Frame;
|
class XFE_Frame;
|
||||||
class XFE_Logo;
|
class XFE_Logo;
|
||||||
class XFE_Toolbox;
|
class XFE_Toolbox;
|
||||||
|
class XFE_RDFToolbarDrop;
|
||||||
|
|
||||||
class XFE_RDFToolbar : public XFE_ToolboxItem,
|
class XFE_RDFToolbar : public XFE_ToolboxItem,
|
||||||
public XFE_RDFMenuToolbarBase
|
public XFE_RDFMenuToolbarBase
|
||||||
|
@ -48,6 +49,12 @@ public:
|
||||||
|
|
||||||
virtual ~XFE_RDFToolbar ();
|
virtual ~XFE_RDFToolbar ();
|
||||||
|
|
||||||
|
// Access methods
|
||||||
|
Widget getFirstItem ();
|
||||||
|
Widget getLastItem ();
|
||||||
|
Widget getIndicatorItem ();
|
||||||
|
void configureIndicatorItem (HT_Resource entry);
|
||||||
|
|
||||||
#ifdef NOT_YET
|
#ifdef NOT_YET
|
||||||
// update all the commands in the toolbar.
|
// update all the commands in the toolbar.
|
||||||
XFE_CALLBACK_DECL(update)
|
XFE_CALLBACK_DECL(update)
|
||||||
|
@ -68,6 +75,13 @@ public:
|
||||||
//////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////
|
||||||
static const char * navigateToUrlNotice;
|
static const char * navigateToUrlNotice;
|
||||||
|
|
||||||
|
// DND feedback methods
|
||||||
|
Widget getDropTargetItem ();
|
||||||
|
unsigned char getDropTargetLocation ();
|
||||||
|
|
||||||
|
void setDropTargetItem (Widget item,int x);
|
||||||
|
void clearDropTargetItem ();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void setRaised (XP_Bool);
|
void setRaised (XP_Bool);
|
||||||
void destroyToolbarWidgets ();
|
void destroyToolbarWidgets ();
|
||||||
|
@ -86,12 +100,18 @@ protected:
|
||||||
virtual void updateRoot ();
|
virtual void updateRoot ();
|
||||||
|
|
||||||
// Gets called to update icon appearance
|
// Gets called to update icon appearance
|
||||||
virtual void updateAppearance ();
|
virtual void updateAppearance ();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
XFE_Frame * _frame;
|
XFE_Frame * _frame;
|
||||||
Widget _toolbar;
|
Widget _toolbar;
|
||||||
|
XFE_RDFToolbarDrop * _toolbarDropSite;
|
||||||
|
|
||||||
|
// DND feedback members
|
||||||
|
Widget _dropTargetItem; // The drop target item
|
||||||
|
unsigned char _dropTargetLocation; // The drop target location
|
||||||
|
int _dropTargetPosition; // The drop target position
|
||||||
|
|
||||||
// callbacks
|
// callbacks
|
||||||
static void tooltipCB(Widget, XtPointer, XmString *, Boolean *);
|
static void tooltipCB(Widget, XtPointer, XmString *, Boolean *);
|
||||||
|
|
|
@ -26,11 +26,10 @@
|
||||||
|
|
||||||
#include "MozillaApp.h"
|
#include "MozillaApp.h"
|
||||||
#include "ToolbarDrop.h"
|
#include "ToolbarDrop.h"
|
||||||
#ifdef OLD_BOOKMARKS
|
#include "ToolbarItem.h"
|
||||||
#include "PersonalToolbar.h"
|
|
||||||
#endif /*OLD_BOOKMARKS*/
|
|
||||||
#include "BookmarkMenu.h"
|
#include "BookmarkMenu.h"
|
||||||
#include "htrdf.h"
|
#include "htrdf.h"
|
||||||
|
#include "RDFToolbar.h"
|
||||||
#include "RDFUtils.h"
|
#include "RDFUtils.h"
|
||||||
|
|
||||||
#include <Xfe/Cascade.h>
|
#include <Xfe/Cascade.h>
|
||||||
|
@ -182,52 +181,35 @@ XFE_ToolbarDrop::addEntry(const char * /* address */,const char * /* title */)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
//////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////
|
||||||
#if 0
|
|
||||||
//
|
//
|
||||||
// XFE_PersonalDrop class
|
// XFE_RDFToolbarDrop class
|
||||||
//
|
//
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////
|
||||||
XFE_PersonalDrop::XFE_PersonalDrop(Widget dropWidget,
|
XFE_RDFToolbarDrop::XFE_RDFToolbarDrop(Widget dropWidget,
|
||||||
XFE_PersonalToolbar * toolbar) :
|
XFE_RDFToolbar * toolbar) :
|
||||||
XFE_ToolbarDrop(dropWidget),
|
XFE_ToolbarDrop(dropWidget),
|
||||||
_personalToolbar(toolbar),
|
_toolbar(toolbar),
|
||||||
_dropWidget(NULL)
|
_dropWidget(NULL)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
//////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////
|
||||||
XFE_PersonalDrop::~XFE_PersonalDrop()
|
XFE_RDFToolbarDrop::~XFE_RDFToolbarDrop()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
//////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////
|
||||||
/* virtual */ void
|
/* virtual */ void
|
||||||
XFE_PersonalDrop::addEntry(const char * address,const char * title)
|
XFE_RDFToolbarDrop::addEntry(const char * address, const char * title)
|
||||||
{
|
{
|
||||||
XP_ASSERT( address != NULL );
|
XP_ASSERT( address != NULL );
|
||||||
|
|
||||||
XP_ASSERT( XfeIsAlive(_dropWidget) );
|
XP_ASSERT( XfeIsAlive(_dropWidget) );
|
||||||
XP_ASSERT( _personalToolbar != NULL );
|
XP_ASSERT( _toolbar != NULL );
|
||||||
|
|
||||||
char * guessed_title = (char *) title;
|
unsigned char location = _toolbar->getDropTargetLocation();
|
||||||
time_t lastAccess = 0;
|
|
||||||
|
|
||||||
// If no title is given, try to guess a decent one
|
// If the drop occurred on a cascade item, then we need to wait for
|
||||||
if (!guessed_title)
|
|
||||||
{
|
|
||||||
MWContext * context = _personalToolbar->getFrame()->getContext();
|
|
||||||
|
|
||||||
XFE_RDFUtils::guessTitle(context,
|
|
||||||
address,
|
|
||||||
isFromSameShell(),
|
|
||||||
&guessed_title,
|
|
||||||
&lastAccess);
|
|
||||||
}
|
|
||||||
|
|
||||||
XP_ASSERT( guessed_title != NULL );
|
|
||||||
|
|
||||||
unsigned char location = _personalToolbar->getDropTargetLocation();
|
|
||||||
|
|
||||||
// If the drop occurred on a cascade item, then we need to waid for
|
|
||||||
// the drop operation to complete before posting the submenu id and
|
// the drop operation to complete before posting the submenu id and
|
||||||
// allowing the user to place the new bookmark. This will happen
|
// allowing the user to place the new bookmark. This will happen
|
||||||
// in dropCompolete(). Here, we just install the drop parameters that
|
// in dropCompolete(). Here, we just install the drop parameters that
|
||||||
|
@ -240,20 +222,14 @@ XFE_PersonalDrop::addEntry(const char * address,const char * title)
|
||||||
{
|
{
|
||||||
if (location == XmINDICATOR_LOCATION_BEGINNING)
|
if (location == XmINDICATOR_LOCATION_BEGINNING)
|
||||||
{
|
{
|
||||||
_personalToolbar->addEntryBefore(address,
|
HT_DropURLAndTitleAtPos(entry, (char*)address, (char*)title, TRUE);
|
||||||
guessed_title,
|
|
||||||
lastAccess,
|
|
||||||
entry);
|
|
||||||
|
|
||||||
// Clear drop widget so dropComplete() does not get hosed
|
// Clear drop widget so dropComplete() does not get hosed
|
||||||
_dropWidget = NULL;
|
_dropWidget = NULL;
|
||||||
}
|
}
|
||||||
else if (location == XmINDICATOR_LOCATION_END)
|
else if (location == XmINDICATOR_LOCATION_END)
|
||||||
{
|
{
|
||||||
_personalToolbar->addEntryAfter(address,
|
HT_DropURLAndTitleAtPos(entry, (char*)address, (char*)title, FALSE);
|
||||||
guessed_title,
|
|
||||||
lastAccess,
|
|
||||||
entry);
|
|
||||||
|
|
||||||
// Clear drop widget so dropComplete() does not get hosed
|
// Clear drop widget so dropComplete() does not get hosed
|
||||||
_dropWidget = NULL;
|
_dropWidget = NULL;
|
||||||
|
@ -261,12 +237,10 @@ XFE_PersonalDrop::addEntry(const char * address,const char * title)
|
||||||
else if (location == XmINDICATOR_LOCATION_MIDDLE)
|
else if (location == XmINDICATOR_LOCATION_MIDDLE)
|
||||||
{
|
{
|
||||||
// If the folder is empty, then just add the new bm to it
|
// If the folder is empty, then just add the new bm to it
|
||||||
if (HT_IsContainer(entry) && !BM_GetChildren(entry))
|
if (HT_IsContainer(entry)
|
||||||
|
&& !XFE_RDFUtils::ht_FolderHasChildren(entry))
|
||||||
{
|
{
|
||||||
_personalToolbar->addEntryToFolder(address,
|
HT_DropURLAndTitleOn(entry,(char*)address, (char*)title);
|
||||||
guessed_title,
|
|
||||||
lastAccess,
|
|
||||||
entry);
|
|
||||||
|
|
||||||
// Clear drop widget so dropComplete() does not get hosed
|
// Clear drop widget so dropComplete() does not get hosed
|
||||||
_dropWidget = NULL;
|
_dropWidget = NULL;
|
||||||
|
@ -274,9 +248,8 @@ XFE_PersonalDrop::addEntry(const char * address,const char * title)
|
||||||
// Otherwise need to popup the bookmark placement gui later
|
// Otherwise need to popup the bookmark placement gui later
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
_personalToolbar->setDropAddress(address);
|
_toolbar->setDropAddress((char*)address);
|
||||||
_personalToolbar->setDropTitle(guessed_title);
|
_toolbar->setDropTitle((char*)title);
|
||||||
_personalToolbar->setDropLastAccess(lastAccess);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -291,21 +264,15 @@ XFE_PersonalDrop::addEntry(const char * address,const char * title)
|
||||||
{
|
{
|
||||||
if (location == XmINDICATOR_LOCATION_BEGINNING)
|
if (location == XmINDICATOR_LOCATION_BEGINNING)
|
||||||
{
|
{
|
||||||
_personalToolbar->addEntryBefore(address,
|
HT_DropURLAndTitleAtPos(entry, (char*)address, (char*)title, TRUE);
|
||||||
guessed_title,
|
|
||||||
lastAccess,
|
|
||||||
entry);
|
|
||||||
}
|
}
|
||||||
else if (location == XmINDICATOR_LOCATION_END)
|
else if (location == XmINDICATOR_LOCATION_END)
|
||||||
{
|
{
|
||||||
_personalToolbar->addEntryAfter(address,
|
HT_DropURLAndTitleAtPos(entry, (char*)address, (char*)title, FALSE);
|
||||||
guessed_title,
|
|
||||||
lastAccess,
|
|
||||||
entry);
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
_personalToolbar->addEntry(address,guessed_title,lastAccess);
|
HT_DropURLAndTitleAtPos(entry, (char*)address, (char*)title, FALSE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -325,9 +292,9 @@ XFE_PersonalDrop::addEntry(const char * address,const char * title)
|
||||||
}
|
}
|
||||||
//////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////
|
||||||
/* virtual */ void
|
/* virtual */ void
|
||||||
XFE_PersonalDrop::dropComplete()
|
XFE_RDFToolbarDrop::dropComplete()
|
||||||
{
|
{
|
||||||
_personalToolbar->clearDropTargetItem();
|
_toolbar->clearDropTargetItem();
|
||||||
|
|
||||||
// If the drop widget is still alive and kicking, it means that a drop
|
// If the drop widget is still alive and kicking, it means that a drop
|
||||||
// occurred on a cascade item. Here we deal with this unique case.
|
// occurred on a cascade item. Here we deal with this unique case.
|
||||||
|
@ -343,7 +310,7 @@ XFE_PersonalDrop::dropComplete()
|
||||||
XfeSleep(_dropWidget,fe_EventLoop,DROP_POST_SLEEP_LENGTH);
|
XfeSleep(_dropWidget,fe_EventLoop,DROP_POST_SLEEP_LENGTH);
|
||||||
|
|
||||||
// Enable dropping into the personal toolbar
|
// Enable dropping into the personal toolbar
|
||||||
_personalToolbar->enableDropping();
|
_toolbar->enableDropping();
|
||||||
|
|
||||||
// Arm and post the cascade. Once the cascade button's submenu id
|
// Arm and post the cascade. Once the cascade button's submenu id
|
||||||
// is posted, the bookmark menu items it manages will detect
|
// is posted, the bookmark menu items it manages will detect
|
||||||
|
@ -362,21 +329,21 @@ XFE_PersonalDrop::dropComplete()
|
||||||
}
|
}
|
||||||
//////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////
|
||||||
/* virtual */ void
|
/* virtual */ void
|
||||||
XFE_PersonalDrop::dragIn()
|
XFE_RDFToolbarDrop::dragIn()
|
||||||
{
|
{
|
||||||
dragMotion();
|
dragMotion();
|
||||||
}
|
}
|
||||||
//////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////
|
||||||
/* virtual */ void
|
/* virtual */ void
|
||||||
XFE_PersonalDrop::dragOut()
|
XFE_RDFToolbarDrop::dragOut()
|
||||||
{
|
{
|
||||||
_dropWidget = _personalToolbar->getDropTargetItem();
|
_dropWidget = _toolbar->getDropTargetItem();
|
||||||
|
|
||||||
_personalToolbar->clearDropTargetItem();
|
_toolbar->clearDropTargetItem();
|
||||||
}
|
}
|
||||||
//////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////
|
||||||
/* virtual */ void
|
/* virtual */ void
|
||||||
XFE_PersonalDrop::dragMotion()
|
XFE_RDFToolbarDrop::dragMotion()
|
||||||
{
|
{
|
||||||
// Try to find an item at the X,Y that the motion occured
|
// Try to find an item at the X,Y that the motion occured
|
||||||
Widget target = XfeDescendantFindByCoordinates(_widget,
|
Widget target = XfeDescendantFindByCoordinates(_widget,
|
||||||
|
@ -385,39 +352,36 @@ XFE_PersonalDrop::dragMotion()
|
||||||
|
|
||||||
|
|
||||||
// If we found the indicator, ignore it
|
// If we found the indicator, ignore it
|
||||||
if (target != _personalToolbar->getIndicatorItem())
|
if (target != _toolbar->getIndicatorItem())
|
||||||
{
|
{
|
||||||
// If an item is found, use it as the target
|
// If an item is found, use it as the target
|
||||||
if (XfeIsAlive(target))
|
if (XfeIsAlive(target))
|
||||||
{
|
{
|
||||||
_personalToolbar->setDropTargetItem(target,
|
_toolbar->setDropTargetItem(target, _dropEventX - XfeX(target));
|
||||||
_dropEventX - XfeX(target));
|
|
||||||
|
|
||||||
// The argument should really be a (HT_Resource)
|
_toolbar->configureIndicatorItem(NULL);
|
||||||
_personalToolbar->configureIndicatorItem(NULL);
|
|
||||||
}
|
}
|
||||||
// Otherwise use the last item
|
// Otherwise use the last item
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Widget last = _personalToolbar->getLastItem();
|
Widget last = _toolbar->getLastItem();
|
||||||
|
|
||||||
// The 10000 forces the position to be at the END of the item
|
// The 10000 forces the position to be at the END of the item
|
||||||
if (XfeIsAlive(last))
|
if (XfeIsAlive(last))
|
||||||
{
|
{
|
||||||
_personalToolbar->setDropTargetItem(last,10000);
|
_toolbar->setDropTargetItem(last,10000);
|
||||||
|
|
||||||
// The argument should really be a (HT_Resource)
|
_toolbar->configureIndicatorItem(NULL);
|
||||||
_personalToolbar->configureIndicatorItem(NULL);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Assign the drop widget so that addEntry() can do its magic
|
// Assign the drop widget so that addEntry() can do its magic
|
||||||
_dropWidget = _personalToolbar->getDropTargetItem();
|
_dropWidget = _toolbar->getDropTargetItem();
|
||||||
}
|
}
|
||||||
//////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#if 0
|
||||||
//
|
//
|
||||||
// XFE_PersonalTabDrop class
|
// XFE_PersonalTabDrop class
|
||||||
//
|
//
|
||||||
|
@ -425,9 +389,10 @@ XFE_PersonalDrop::dragMotion()
|
||||||
//////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////
|
||||||
XFE_PersonalTabDrop::XFE_PersonalTabDrop(Widget dropWidget,
|
XFE_PersonalTabDrop::XFE_PersonalTabDrop(Widget dropWidget,
|
||||||
XFE_PersonalToolbar * toolbar) :
|
XFE_PersonalToolbar * toolbar) :
|
||||||
XFE_PersonalDrop(dropWidget,toolbar)
|
XFE_RDFToolbarDrop(dropWidget,toolbar)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////
|
||||||
XFE_PersonalTabDrop::~XFE_PersonalTabDrop()
|
XFE_PersonalTabDrop::~XFE_PersonalTabDrop()
|
||||||
{
|
{
|
||||||
|
@ -438,7 +403,7 @@ XFE_PersonalTabDrop::addEntry(const char * address,const char * title)
|
||||||
{
|
{
|
||||||
XP_ASSERT( address != NULL );
|
XP_ASSERT( address != NULL );
|
||||||
|
|
||||||
XP_ASSERT( _personalToolbar != NULL );
|
XP_ASSERT( _toolbar != NULL );
|
||||||
|
|
||||||
char * guessed_title = (char *) title;
|
char * guessed_title = (char *) title;
|
||||||
time_t lastAccess = 0;
|
time_t lastAccess = 0;
|
||||||
|
@ -446,7 +411,7 @@ XFE_PersonalTabDrop::addEntry(const char * address,const char * title)
|
||||||
// If no title is given, try to guess a decent one
|
// If no title is given, try to guess a decent one
|
||||||
if (!guessed_title)
|
if (!guessed_title)
|
||||||
{
|
{
|
||||||
XFE_BookmarkBase::guessTitle(_personalToolbar->getFrame(),
|
XFE_BookmarkBase::guessTitle(_toolbar->getFrame(),
|
||||||
address,
|
address,
|
||||||
isFromSameShell(),
|
isFromSameShell(),
|
||||||
&guessed_title,
|
&guessed_title,
|
||||||
|
@ -465,7 +430,7 @@ XFE_PersonalTabDrop::addEntry(const char * address,const char * title)
|
||||||
// If the first entry exists, add the new entry before it
|
// If the first entry exists, add the new entry before it
|
||||||
if (entry)
|
if (entry)
|
||||||
{
|
{
|
||||||
_personalToolbar->addEntryBefore(address,
|
_toolbar->addEntryBefore(address,
|
||||||
guessed_title,
|
guessed_title,
|
||||||
lastAccess,
|
lastAccess,
|
||||||
entry);
|
entry);
|
||||||
|
@ -473,7 +438,7 @@ XFE_PersonalTabDrop::addEntry(const char * address,const char * title)
|
||||||
// Otherwise add the entry to the personal toolbar folder
|
// Otherwise add the entry to the personal toolbar folder
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
_personalToolbar->addEntry(address,guessed_title,lastAccess);
|
_toolbar->addEntry(address,guessed_title,lastAccess);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -491,15 +456,15 @@ XFE_PersonalTabDrop::dropComplete()
|
||||||
XFE_PersonalTabDrop::dragIn()
|
XFE_PersonalTabDrop::dragIn()
|
||||||
{
|
{
|
||||||
|
|
||||||
Widget first = _personalToolbar->getFirstItem();
|
Widget first = _toolbar->getFirstItem();
|
||||||
|
|
||||||
// The 0 forces the position to be at the first
|
// The 0 forces the position to be at the first
|
||||||
if (XfeIsAlive(first))
|
if (XfeIsAlive(first))
|
||||||
{
|
{
|
||||||
_personalToolbar->setDropTargetItem(first,0);
|
_toolbar->setDropTargetItem(first,0);
|
||||||
|
|
||||||
// The argument should really be a (HT_Resource)
|
// The argument should really be a (HT_Resource)
|
||||||
_personalToolbar->configureIndicatorItem(NULL);
|
_toolbar->configureIndicatorItem(NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
XfeTabDrawRaised(_widget,True);
|
XfeTabDrawRaised(_widget,True);
|
||||||
|
@ -510,7 +475,7 @@ XFE_PersonalTabDrop::dragOut()
|
||||||
{
|
{
|
||||||
XfeTabDrawRaised(_widget,False);
|
XfeTabDrawRaised(_widget,False);
|
||||||
|
|
||||||
_personalToolbar->clearDropTargetItem();
|
_toolbar->clearDropTargetItem();
|
||||||
}
|
}
|
||||||
//////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////
|
||||||
/* virtual */ void
|
/* virtual */ void
|
||||||
|
|
|
@ -59,17 +59,18 @@ private:
|
||||||
};
|
};
|
||||||
|
|
||||||
//
|
//
|
||||||
// XFE_PersonalDrop class
|
// XFE_RDFToolbarDrop class
|
||||||
//
|
//
|
||||||
#if 0
|
class XFE_RDFToolbar;
|
||||||
class XFE_PersonalDrop : public XFE_ToolbarDrop
|
|
||||||
|
class XFE_RDFToolbarDrop : public XFE_ToolbarDrop
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
XFE_PersonalDrop (Widget dropWidget,
|
XFE_RDFToolbarDrop (Widget dropWidget,
|
||||||
XFE_PersonalToolbar * toolbar);
|
XFE_RDFToolbar * toolbar);
|
||||||
|
|
||||||
virtual ~XFE_PersonalDrop ();
|
virtual ~XFE_RDFToolbarDrop ();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
|
@ -81,15 +82,16 @@ protected:
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
XFE_PersonalToolbar * _personalToolbar;
|
XFE_RDFToolbar * _toolbar;
|
||||||
Widget _dropWidget;
|
Widget _dropWidget;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#if 0
|
||||||
//
|
//
|
||||||
// XFE_PersonalTabDrop class
|
// XFE_PersonalTabDrop class
|
||||||
//
|
//
|
||||||
|
|
||||||
class XFE_PersonalTabDrop : public XFE_PersonalDrop
|
class XFE_PersonalTabDrop : public XFE_RDFToolbarDrop
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
|
Загрузка…
Ссылка в новой задаче