Replace old-style bookmarks and history with RDF.

This commit is contained in:
slamm%netscape.com 1998-08-26 18:34:17 +00:00
Родитель 53ac0024e2
Коммит 794d4bd612
24 изменённых файлов: 73 добавлений и 552 удалений

Просмотреть файл

Просмотреть файл

@ -1,270 +0,0 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
/*---------------------------------------*/
/* */
/* Name: BookmarkBase.h */
/* Description: XFE_BookmarkBase class header. */
/* Base class for components dealing with bookmarks. */
/* Author: Ramiro Estrugo <ramiro@netscape.com> */
/* Date: Tue Mar 4 03:45:16 PST 1997 */
/* */
/*----------------------------------------------------------------------*/
#include "NotificationCenter.h"
#include "Frame.h"
#include "intl_csi.h"
#include "bkmks.h"
#ifndef _xfe_bookmark_base_h_
#define _xfe_bookmark_base_h_
// This class can be used with a DYNA_CASCADEBUTTON or
// DYNA_MENUITEMS.
class XFE_BookmarkBase : public XFE_NotificationCenter
{
public:
XFE_BookmarkBase (MWContext * bookmarkContext,
XFE_Frame * frame,
XP_Bool onlyHeaders,
XP_Bool fancyItems);
virtual ~XFE_BookmarkBase ();
MWContext * getBookmarkContext();
static BM_Entry * BM_FindFolderByName (BM_Entry * root_entry,
char * folder_name);
static BM_Entry * BM_FindEntryByAddress(BM_Entry * root_entry,
const char * entry_name);
static BM_Entry * BM_FindNextEntry (BM_Entry * entry);
static BM_Entry * BM_FindPreviousEntry (BM_Entry * entry);
static XP_Bool BM_EntryHasHeaderChildren (BM_Entry * header);
static void guessTitle (XFE_Frame * frame,
MWContext * bookmarkContext,
const char * address,
XP_Bool sameShell,
char ** resolvedTitleOut,
BM_Date * resolvedLastDateOut);
void addEntryAfter (const char * address,
const char * title,
BM_Date lastAccess,
BM_Entry * entryAfter);
void addEntryBefore (const char * address,
const char * title,
BM_Date lastAccess,
BM_Entry * entryBefore);
void addEntryToFolder (const char * address,
const char * title,
BM_Date lastAccess,
BM_Entry * header);
void setDropAddress (const char * address);
void setDropTitle (const char * title);
void setDropLastAccess (BM_Date lastAccess);
const char * getDropAddress ();
const char * getDropTitle ();
BM_Date getDropLastAccess ();
// Access methods
XFE_Frame * getFrame ();
virtual void enableDropping ();
virtual void disableDropping ();
virtual XP_Bool isDroppingEnabled ();
protected:
static Pixmap _bookmarkPixmap;
static Pixmap _bookmarkMask;
static Pixmap _bookmarkChangedPixmap;
static Pixmap _bookmarkChangedMask;
static Pixmap _mailBookmarkPixmap;
static Pixmap _mailBookmarkMask;
static Pixmap _newsBookmarkPixmap;
static Pixmap _newsBookmarkMask;
static Pixmap _folderArmedPixmap;
static Pixmap _folderArmedMask;
static Pixmap _folderPixmap;
static Pixmap _folderMask;
static Pixmap _personalFolderArmedMask;
static Pixmap _personalFolderArmedPixmap;
static Pixmap _personalFolderMask;
static Pixmap _personalFolderPixmap;
static Pixmap _newFolderArmedMask;
static Pixmap _newFolderArmedPixmap;
static Pixmap _newFolderMask;
static Pixmap _newFolderPixmap;
static Pixmap _menuFolderArmedMask;
static Pixmap _menuFolderArmedPixmap;
static Pixmap _menuFolderMask;
static Pixmap _menuFolderPixmap;
static Pixmap _newMenuFolderArmedMask;
static Pixmap _newMenuFolderArmedPixmap;
static Pixmap _newMenuFolderMask;
static Pixmap _newMenuFolderPixmap;
static Pixmap _newPersonalFolderArmedMask;
static Pixmap _newPersonalFolderArmedPixmap;
static Pixmap _newPersonalFolderMask;
static Pixmap _newPersonalFolderPixmap;
static Pixmap _newPersonalMenuFolderArmedMask;
static Pixmap _newPersonalMenuFolderArmedPixmap;
static Pixmap _newPersonalMenuFolderMask;
static Pixmap _newPersonalMenuFolderPixmap;
void getPixmapsForEntry(BM_Entry * entry,
Pixmap * pixmap,
Pixmap * mask,
Pixmap * armedPixmap,
Pixmap * armedMask);
#if 0
/* static */ Pixmap bookmarkPixmapFromEntry(BM_Entry *entry);
/* static */ Pixmap bookmarkMaskFromEntry(BM_Entry *entry);
#endif
static void getBookmarkPixmaps(Pixmap & pixmap_out,Pixmap & mask_out);
// Access bookmark entries
BM_Entry * getFirstEntry ();
BM_Entry * getTopLevelFolder (const char * name);
// Create a bookmark item menu tree
void createItemTree (Widget menu,BM_Entry * entry);
// Install submenu pane that controls dropping disability
void trackSubmenuMapping (Widget submenu);
// Override in derived class to configure
virtual void entryArmed (Widget,BM_Entry *);
virtual void entryDisarmed (Widget,BM_Entry *);
virtual void entryActivated (Widget,BM_Entry *);
virtual void entryCascading (Widget,BM_Entry *);
virtual void entryEnter (Widget,BM_Entry *);
virtual void entryLeave (Widget,BM_Entry *);
// Gets called when the whole thing needs updating
virtual void prepareToUpdateRoot ();
// Gets called to actually update the whole thing
virtual void reallyUpdateRoot ();
// Gets called to update icon appearance
virtual void updateAppearance ();
// Gets called when the personal toolbar folder's name changes
virtual void updateToolbarFolderName ();
// Configure the items
virtual void configureXfeCascade (Widget,BM_Entry *);
virtual void configureXfeButton (Widget,BM_Entry *);
virtual void configureXfeBmButton (Widget,BM_Entry *);
virtual void configureXfeBmCascade (Widget,BM_Entry *);
virtual void configureButton (Widget,BM_Entry *);
virtual void configureCascade (Widget,BM_Entry *);
virtual void configureSeparator (Widget,BM_Entry *);
// Menu component creation methods
Widget createCascadeButton (Widget menu,BM_Entry * entry,XP_Bool ignore_children);
Widget createPushButton (Widget menu,BM_Entry * entry);
Widget createSeparator (Widget menu);
Widget createMoreButton (Widget menu);
// Toolbar component creation methods
Widget createXfeCascade (Widget parent,BM_Entry * entry);
Widget createXfeButton (Widget parent,BM_Entry * entry);
BM_Entry * getRootFolder ();
BM_Entry * getAddFolder ();
BM_Entry * getMenuFolder ();
private:
MWContext * _bookmarkContext; // Bookmark context
XFE_Frame * _frame; // The ancestor frame
XP_Bool _onlyHeaders; // Only show headers
XP_Bool _fancyItems; // Fancy items (pixmap & label)
INTL_CharSetInfo _charSetInfo; // Char set info
char * _dropAddressBuffer; //
char * _dropTitleBuffer; //
BM_Date _dropLastAccess; //
// Item callbacks
static void item_armed_cb (Widget,XtPointer,XtPointer);
static void item_disarmed_cb (Widget,XtPointer,XtPointer);
static void item_activated_cb (Widget,XtPointer,XtPointer);
static void item_cascading_cb (Widget,XtPointer,XtPointer);
static void item_enter_cb (Widget,XtPointer,XtPointer);
static void item_leave_cb (Widget,XtPointer,XtPointer);
static void item_free_data_cb (Widget,XtPointer,XtPointer);
static void pane_mapping_eh (Widget,XtPointer,XEvent *,Boolean *);
// Format item blah blah blah
static XmString formatItem (MWContext * bookmarkContext,
BM_Entry * entry,
Boolean no_indent,
int16 charset);
// Obtain an internationallized XmString from an entry
static XmString entryToXmString (MWContext * bookmarkContext,
BM_Entry * entry,
INTL_CharSetInfo char_set_info);
void setItemLabelString(Widget menu,BM_Entry * entry);
void createPixmaps();
Widget getLastMoreMenu (Widget menu);
// Bookmarks changed notice invoked by MozillaApp
XFE_CALLBACK_DECL(bookmarksChanged)
// update the icon appearance
XFE_CALLBACK_DECL(updateIconAppearance)
// update the personal toolbar folder
XFE_CALLBACK_DECL(updatePersonalToolbarFolderName)
};
#endif /* _xfe_bookmark_base_h_ */

Просмотреть файл

Просмотреть файл

Просмотреть файл

@ -23,11 +23,7 @@
#include "BookmarkFrame.h"
#include "BookmarkView.h"
#include "xpassert.h"
#include "abdefn.h" // for kMaxFullNameLength
#include "xpgetstr.h" // for XP_GetString()
#include "Dashboard.h"
#if DEBUG_dora
#define D(x) x
@ -35,94 +31,16 @@
#define D(x)
#endif
extern int XFE_BM_FRAME_TITLE;
// The singleton bookmark frame
/* static */ XFE_BookmarkFrame * XFE_BookmarkFrame::m_bookmarkFrame = NULL;
MenuSpec XFE_BookmarkFrame::file_menu_spec[] = {
{ "newSubmenu", CASCADEBUTTON,
(MenuSpec*)&XFE_Frame::new_menu_spec },
{ xfeCmdNewBookmark, PUSHBUTTON },
{ xfeCmdNewFolder, PUSHBUTTON },
{ xfeCmdNewSeparator, PUSHBUTTON },
{ xfeCmdOpenBookmarkFile, PUSHBUTTON },
{ xfeCmdImport, PUSHBUTTON },
MENU_SEPARATOR,
{ xfeCmdSaveAs, PUSHBUTTON },
MENU_SEPARATOR,
{ xfeCmdOpenSelected, PUSHBUTTON },
{ xfeCmdAddToToolbar, PUSHBUTTON },
//{ xfeCmdCreateShortcut, PUSHBUTTON }, // desktop shortcut
{ xfeCmdMakeAlias, PUSHBUTTON },
//MENU_SEPARATOR,
//{ xfeCmdGoOffline, PUSHBUTTON },
//MENU_SEPARATOR,
MENU_SEPARATOR,
{ xfeCmdClose, PUSHBUTTON },
{ xfeCmdExit, PUSHBUTTON },
{ NULL }
};
MenuSpec XFE_BookmarkFrame::edit_menu_spec[] = {
{ xfeCmdUndo, PUSHBUTTON },
{ xfeCmdRedo, PUSHBUTTON },
MENU_SEPARATOR,
{ xfeCmdCut, PUSHBUTTON },
{ xfeCmdCopy, PUSHBUTTON },
{ xfeCmdPaste, PUSHBUTTON },
{ xfeCmdDelete, PUSHBUTTON },
{ xfeCmdSelectAll, PUSHBUTTON },
MENU_SEPARATOR,
{ xfeCmdFindInObject, PUSHBUTTON },
{ xfeCmdFindAgain, PUSHBUTTON },
#ifdef MOZ_MAIL_NEWS
{ xfeCmdSearchAddress, PUSHBUTTON },
#endif
MENU_SEPARATOR,
{ xfeCmdBookmarkProperties, PUSHBUTTON },
{ NULL }
};
MenuSpec XFE_BookmarkFrame::view_menu_spec[] = {
{ xfeCmdSortByTitle, TOGGLEBUTTON, NULL, "sortByRadioGroup", False },
{ xfeCmdSortByLocation, TOGGLEBUTTON, NULL, "sortByRadioGroup", False },
{ xfeCmdSortByDateLastVisited, TOGGLEBUTTON, NULL, "sortByRadioGroup", False },
{ xfeCmdSortByDateCreated, TOGGLEBUTTON, NULL, "sortByRadioGroup", False },
MENU_SEPARATOR,
{ xfeCmdSortAscending, TOGGLEBUTTON, NULL, "ascendDescendRadioGroup", False },
{ xfeCmdSortDescending, TOGGLEBUTTON, NULL, "ascendDescendRadioGroup", False },
MENU_SEPARATOR,
{ xfeCmdMoveBookmarkUp, PUSHBUTTON },
{ xfeCmdMoveBookmarkDown, PUSHBUTTON },
MENU_SEPARATOR,
{ xfeCmdBookmarksWhatsNew, PUSHBUTTON },
MENU_SEPARATOR,
{ xfeCmdSetToolbarFolder, PUSHBUTTON },
{ xfeCmdSetNewBookmarkFolder, PUSHBUTTON },
{ xfeCmdSetBookmarkMenuFolder, PUSHBUTTON },
{ NULL }
};
MenuSpec XFE_BookmarkFrame::menu_bar_spec[] = {
{ xfeMenuFile, CASCADEBUTTON, file_menu_spec },
{ xfeMenuEdit, CASCADEBUTTON, edit_menu_spec },
{ xfeMenuView, CASCADEBUTTON, view_menu_spec },
{ xfeMenuWindow, CASCADEBUTTON, XFE_Frame::window_menu_spec },
{ "bookmarksSubmenu", CASCADEBUTTON, XFE_Frame::bookmark_submenu_spec },
{ xfeMenuHelp, CASCADEBUTTON, XFE_Frame::help_menu_spec },
{ NULL }
};
MWContext *XFE_BookmarkFrame::main_bm_context = NULL;
XFE_BookmarkFrame::XFE_BookmarkFrame(Widget toplevel,
XFE_Frame *parent_frame,
Chrome *chromespec)
: XFE_Frame("bookmarks", toplevel,
parent_frame,
XFE_BookmarkFrame::XFE_BookmarkFrame(Widget toplevel)
: XFE_Frame("bookmarks", toplevel,
NULL, //parent_frame
FRAME_BOOKMARK,
chromespec,
NULL, //chromespec
False,
True,
False,
@ -133,35 +51,6 @@ XFE_BookmarkFrame::XFE_BookmarkFrame(Widget toplevel,
XP_ASSERT( m_bookmarkFrame == NULL );
// create the bookmark view
XFE_BookmarkView *view = new XFE_BookmarkView(this,
getChromeParent(),
NULL,
m_context);
setView(view);
setMenubar(menu_bar_spec);
//
// Make the bookmark frame title more reasonable
//
char title[kMaxFullNameLength+64];
PR_snprintf(title,
sizeof(title),
XP_GetString(XFE_BM_FRAME_TITLE),
FE_UsersFullName());
setTitle(title);
view->show();
m_dashboard->setShowStatusBar(True);
m_dashboard->setShowProgressBar(True);
realize();
resize(600,580); //XXX Default size for now
main_bm_context = m_context;
m_bookmarkFrame = this;
@ -171,60 +60,48 @@ XFE_BookmarkFrame::~XFE_BookmarkFrame()
{
D(printf("XFE_BookmarkFrame SUB-SYSTEM DESTRUCTING\n");)
BM_SaveBookmarks(main_bm_context, NULL);
m_bookmarkFrame = NULL;
main_bm_context = NULL;
}
extern "C" MWContext*
fe_showBookmarks(Widget toplevel, XFE_Frame *parent_frame, Chrome *chromespec)
extern "C" void
fe_showBookmarks(Widget /*toplevel*/)
{
fe_createBookmarks(toplevel, parent_frame, chromespec);
//xxx Replace with NavCenter opened to Bookmarks resource.
#ifdef OLD_BOOKMARKS
XFE_BookmarkFrame * bm_frame = XFE_BookmarkFrame::getBookmarkFrame();
XP_ASSERT( bm_frame != NULL );
bm_frame->show();
return bm_frame->getContext();
#endif /*OLD_BOOKMARKS*/
}
extern "C" void
fe_showHistory(Widget /*toplevel*/)
{
//xxx Replace with NavCenter opened to Bookmarks resource.
//xxx putting this orphaned function here for now.
}
extern "C" MWContext* fe_getBookmarkContext()
{
if (XFE_BookmarkFrame::main_bm_context == NULL)
XFE_BookmarkFrame::createBookmarkFrame(FE_GetToplevelWidget());
return XFE_BookmarkFrame::main_bm_context;
}
extern "C" void
fe_createBookmarks(Widget toplevel,
XFE_Frame *parent_frame,
Chrome *chromespec)
{
XFE_BookmarkFrame::createBookmarkFrame(toplevel,parent_frame,chromespec);
}
//////////////////////////////////////////////////////////////////////////
XP_Bool
XFE_BookmarkFrame::isCommandEnabled(CommandType cmd,
void *calldata, XFE_CommandInfo*)
{
if (cmd == xfeCmdClose)
return True;
else
return XFE_Frame::isCommandEnabled(cmd, calldata);
}
//////////////////////////////////////////////////////////////////////////
/* static */ void
XFE_BookmarkFrame::createBookmarkFrame(Widget toplevel,
XFE_Frame * parent_frame,
Chrome * chromespec)
XFE_BookmarkFrame::createBookmarkFrame(Widget toplevel)
{
if (m_bookmarkFrame == NULL)
{
m_bookmarkFrame = new XFE_BookmarkFrame(toplevel,
parent_frame,
chromespec);
m_bookmarkFrame = new XFE_BookmarkFrame(toplevel);
}
}
//////////////////////////////////////////////////////////////////////////

Просмотреть файл

@ -27,38 +27,24 @@
#include "Frame.h"
#include "xp_core.h"
#include <Xm/Xm.h>
class XFE_BookmarkFrame : public XFE_Frame
{
public:
XFE_BookmarkFrame(Widget toplevel, XFE_Frame *parent_frame, Chrome *chromespec);
XFE_BookmarkFrame(Widget toplevel);
virtual ~XFE_BookmarkFrame();
static MWContext *main_bm_context;
// To allow window close (we need a more graceful way of doing this)
virtual XP_Bool isCommandEnabled(CommandType cmd, void *calldata = NULL,
XFE_CommandInfo* = NULL);
static void createBookmarkFrame(Widget toplevel,
XFE_Frame *parent_frame,
Chrome *chromespec);
static void createBookmarkFrame(Widget toplevel);
static XFE_BookmarkFrame * getBookmarkFrame();
private:
static MenuSpec menu_bar_spec[];
static MenuSpec file_menu_spec[];
static MenuSpec edit_menu_spec[];
static MenuSpec view_menu_spec[];
static XFE_BookmarkFrame * m_bookmarkFrame;
};
extern "C" MWContext* fe_showBookmarks(Widget toplevel, XFE_Frame *parent_frame, Chrome *chromespec);
extern "C" void fe_showBookmarks(Widget toplevel);
extern "C" MWContext* fe_getBookmarkContext();
extern "C" void fe_createBookmarks(Widget toplevel, XFE_Frame *parent_frame, Chrome *chromespec);
#endif /* _xfe_bookmarkframe_h */

Просмотреть файл

@ -23,25 +23,24 @@
#include "BookmarkMenu.h"
#include "BookmarkFrame.h"
#include "BookmarkView.h"
#include "PersonalToolbar.h"
#include "bkmks.h"
#include <Xfe/XfeAll.h>
#include <Xfe/BmButton.h>
#include <Xfe/BmCascade.h>
#include <Xm/CascadeB.h>
#include <Xm/CascadeBG.h>
#include <Xm/PushB.h>
#include <Xm/PushBG.h>
#define IS_CASCADE(w) (XmIsCascadeButton(w) || XmIsCascadeButtonGadget(w))
#define IS_PUSH(w) (XmIsPushButton(w) || XmIsPushButtonGadget(w))
//////////////////////////////////////////////////////////////////////////
XFE_BookmarkMenu::XFE_BookmarkMenu(MWContext * bookmarkContext,
Widget cascade,
XFE_BookmarkMenu::XFE_BookmarkMenu(Widget cascade,
XFE_Frame * frame,
XP_Bool onlyHeaders,
XP_Bool fancyItems) :
XFE_BookmarkBase(bookmarkContext,frame,onlyHeaders,fancyItems),
XFE_RDFMenuToolbarBase(frame,onlyHeaders,fancyItems),
_cascade(cascade),
_subMenu(NULL),
_firstSlot(0)
@ -64,6 +63,9 @@ XFE_BookmarkMenu::XFE_BookmarkMenu(MWContext * bookmarkContext,
// Keep track of the submenu mapping
trackSubmenuMapping(_subMenu);
RDF_Resource bookmarks = RDF_GetResource(NULL,"NC:Bookmarks",PR_TRUE);
newPaneFromResource(bookmarks);
}
//////////////////////////////////////////////////////////////////////////
void
@ -73,8 +75,7 @@ XFE_BookmarkMenu::generate(Widget cascade,
{
XFE_BookmarkMenu * object;
object = new XFE_BookmarkMenu(XFE_BookmarkFrame::main_bm_context,
cascade,
object = new XFE_BookmarkMenu(cascade,
frame,
(int) clientData,
True);
@ -87,8 +88,7 @@ XFE_BookmarkMenu::generateQuickfile(Widget cascade,
{
XFE_BookmarkMenu * object;
object = new XFE_BookmarkMenu(XFE_BookmarkFrame::main_bm_context,
cascade,
object = new XFE_BookmarkMenu(cascade,
frame,
(int) clientData,
True);
@ -120,7 +120,7 @@ XFE_BookmarkMenu::update_cb(Widget cascade,
XtVaGetValues(cascade,XmNsubMenuId,&subMenu,NULL);
// Really update
object->reallyUpdateRoot();
object->updateRoot();
// Make sure the submenu is realized
XtRealizeWidget(subMenu);
@ -153,17 +153,19 @@ XFE_BookmarkMenu::prepareToUpdateRoot()
}
//////////////////////////////////////////////////////////////////////////
/* virtual */ void
XFE_BookmarkMenu::reallyUpdateRoot()
XFE_BookmarkMenu::updateRoot()
{
WidgetList children;
Cardinal numChildren;
BM_Entry * root = getMenuFolder();
HT_Resource root = getMenuFolder();
#ifdef OLD_BOOKMARKS
// Ignore the root header (ie, "Joe's Bookmarks")
if (root && BM_IsHeader(root))
if (root && HT_IsContainer(root))
{
root = BM_GetChildren(root);
}
#endif
XfeChildrenGet(_subMenu,&children,&numChildren);
@ -199,7 +201,7 @@ XFE_BookmarkMenu::enableDropping()
update_cb(_cascade,(XtPointer) this,(XtPointer) NULL);
// Chain
XFE_BookmarkBase::enableDropping();
XFE_RDFMenuToolbarBase::enableDropping();
// Make all the fixed items insensitive
setFixedItemSensitive(False);
@ -209,7 +211,7 @@ XFE_BookmarkMenu::enableDropping()
XFE_BookmarkMenu::disableDropping()
{
// Chain
XFE_BookmarkBase::disableDropping();
XFE_RDFMenuToolbarBase::disableDropping();
// Make all the fixed items sensitive
setFixedItemSensitive(True);

Просмотреть файл

@ -22,7 +22,9 @@
#include "BookmarkBase.h"
#include "RDFMenuToolbarBase.h"
#include "xp_core.h"
#include <X11/Intrinsic.h>
#ifndef _xfe_bookmarkmenu_h
#define _xfe_bookmarkmenu_h
@ -30,7 +32,9 @@
// This class can be used with a DYNA_CASCADEBUTTON or
// DYNA_MENUITEMS.
class XFE_BookmarkMenu : public XFE_BookmarkBase
class XFE_Frame;
class XFE_BookmarkMenu : public XFE_RDFMenuToolbarBase
{
public:
@ -48,12 +52,11 @@ public:
protected:
virtual void prepareToUpdateRoot ();
virtual void reallyUpdateRoot ();
virtual void updateRoot ();
private:
XFE_BookmarkMenu (MWContext * bookmarkContext,
Widget cascade,
XFE_BookmarkMenu (Widget cascade,
XFE_Frame * frame,
XP_Bool onlyHeaders,
XP_Bool fancyItems);

Просмотреть файл

Просмотреть файл

Просмотреть файл

Просмотреть файл

Просмотреть файл

Просмотреть файл

Просмотреть файл

@ -46,8 +46,6 @@
#include "ThreadView.h"
#include "BrowserFrame.h"
#include "BookmarkView.h"
#include "HistoryView.h"
// from lib/libmsg
extern "C" XP_Bool MSG_RequiresMailMsgWindow(const char*);
@ -948,74 +946,6 @@ int XFE_ComposeAttachDrop::processTargets(Atom *targets,const char **data,int nu
//
void XFE_ComposeAttachFolderView::processBookmarkDrop(fe_dnd_Source *source)
{
XFE_BookmarkView* bookmarkView=( XFE_BookmarkView*)source->closure;
if (!bookmarkView)
return;
MWContext *context=bookmarkView->getContext();
XFE_Outliner *outliner=bookmarkView->getOutliner();
const int *selectedList;
int numSelected;
if (outliner->getSelection(&selectedList, &numSelected)) {
char **items=new char*[numSelected];
int numItems=0;
int i;
for (i=0; i<numSelected; i++) {
BM_Entry* entry=BM_AtIndex(context,selectedList[i]+1);
if (BM_GetType(entry)==BM_TYPE_URL ||
BM_GetType(entry)==BM_TYPE_ALIAS) {
const char *address=BM_GetAddress(entry);
if (address) {
XDEBUG(printf(" %d:%s\n",selectedList[i],address));
items[numItems++]=XP_STRDUP(address);
}
}
}
if (numItems>0)
addAttachments((const char **) items,numItems);
for (i=0; i<numItems; i++)
XP_FREE(items[i]);
delete items;
}
}
void XFE_ComposeAttachFolderView::processHistoryDrop(fe_dnd_Source *source)
{
XFE_HistoryView *historyView = (XFE_HistoryView*)source->closure;
if (!historyView)
return;
MWContext *context=historyView->getContext();
XFE_Outliner *outliner=historyView->getOutliner();
const int *selectedList;
int numSelected;
if (outliner->getSelection(&selectedList, &numSelected)) {
char **items=new char*[numSelected];
int numItems=0;
int i;
for (i=0; i<numSelected; i++) {
gh_HistEntry *entry=historyView->getEntry(selectedList[i]);
if (entry && entry->address) {
XDEBUG(printf(" %d:%s\n",selectedList[i],entry->address));
items[numItems++]=XP_STRDUP(entry->address);
}
}
if (numItems>0)
addAttachments((const char **) items,numItems);
for (i=0; i<numItems; i++)
XP_FREE(items[i]);
delete items;
}
}
void XFE_ComposeAttachFolderView::processMessageDrop(fe_dnd_Source *source)
{
XFE_ThreadView *threadView=(XFE_ThreadView*)source->closure;
@ -1062,10 +992,10 @@ void XFE_ComposeAttachFolderView::attachDropCb(fe_dnd_Source *source)
processMessageDrop(source);
break;
case FE_DND_BOOKMARK:
processBookmarkDrop(source);
/*xxxslamm: ripped out old bookmarks. To be replaced by RDF*/
break;
case FE_DND_HISTORY:
processHistoryDrop(source);
/*xxxslamm: ripped out old history. To be replaced by RDF*/
break;
// maybe interesting

Просмотреть файл

@ -24,7 +24,7 @@
#include "EditorFrame.h"
#include "EditorView.h"
#include "SpellHandler.h"
#include "htrdf.h" // for HT_AddBookmark()
#include <Xm/Label.h>
#include <Xfe/Xfe.h>
@ -2795,8 +2795,7 @@ public:
if (href_data != NULL) {
if (href_data->pURL != NULL) {
fe_AddToBookmark(context, 0,
NET_CreateURLStruct(href_data->pURL, NET_DONT_RELOAD), 0);
HT_AddBookmark (href_data->pURL, NULL /*Title*/);
}
EDT_FreeHREFData(href_data);
}

Просмотреть файл

Просмотреть файл

Просмотреть файл

Просмотреть файл

Просмотреть файл

@ -69,14 +69,9 @@ endif
CPPSRCS = \
plugin.cpp \
BackForwardMenu.cpp \
BookmarkBase.cpp \
BookmarkFindDialog.cpp \
BookmarkMenu.cpp \
BookmarkPropDialog.cpp \
BookmarkWhatsNewDialog.cpp \
Button.cpp \
BookmarkFrame.cpp \
BookmarkView.cpp \
BookmarkMenu.cpp \
Button.cpp \
BrowserDrop.cpp \
BrowserFrame.cpp \
BrowserView.cpp \
@ -94,10 +89,8 @@ CPPSRCS = \
Frame.cpp \
HTMLDialogFrame.cpp \
HistoryMenu.cpp \
HistoryView.cpp \
HTMLDrag.cpp \
HTMLView.cpp \
HistoryFrame.cpp \
IconGroup.cpp \
Image.cpp \
LocationDrag.cpp \
@ -111,7 +104,6 @@ CPPSRCS = \
Netcaster.cpp \
NotificationCenter.cpp \
Outliner.cpp \
PersonalToolbar.cpp \
PopupMenu.cpp \
PrefsDialogAppl.cpp \
PropertyTabView.cpp \
@ -123,9 +115,13 @@ CPPSRCS = \
PrefsDialogMailnews.cpp \
PrefsLang.cpp \
PrefsProxiesView.cpp \
RDFBase.cpp \
RDFImage.cpp \
RDFView.cpp \
RDFMenuToolbarBase.cpp \
RDFTreeView.cpp \
RDFToolbar.cpp \
RDFToolbox.cpp \
RDFView.cpp \
RadioGroup.cpp \
Splash.cpp \
Toolbar.cpp \

Просмотреть файл

@ -74,14 +74,9 @@ endif
CPPSRCS = \
plugin.cpp \
BackForwardMenu.cpp \
BookmarkBase.cpp \
BookmarkFindDialog.cpp \
BookmarkMenu.cpp \
BookmarkPropDialog.cpp \
BookmarkWhatsNewDialog.cpp \
Button.cpp \
BookmarkFrame.cpp \
BookmarkView.cpp \
BookmarkMenu.cpp \
Button.cpp \
BrowserDrop.cpp \
BrowserFrame.cpp \
BrowserView.cpp \
@ -99,7 +94,6 @@ CPPSRCS = \
Frame.cpp \
HTMLDialogFrame.cpp \
HistoryMenu.cpp \
HistoryView.cpp \
HTMLDrag.cpp \
HTMLView.cpp \
HistoryFrame.cpp \
@ -116,7 +110,6 @@ CPPSRCS = \
Netcaster.cpp \
NotificationCenter.cpp \
Outliner.cpp \
PersonalToolbar.cpp \
PopupMenu.cpp \
PrefsDialogAppl.cpp \
PropertyTabView.cpp \
@ -128,9 +121,13 @@ CPPSRCS = \
PrefsDialogMailnews.cpp \
PrefsLang.cpp \
PrefsProxiesView.cpp \
RDFBase.cpp \
RDFImage.cpp \
RDFView.cpp \
RDFMenuToolbarBase.cpp \
RDFTreeView.cpp \
RDFToolbar.cpp \
RDFToolbox.cpp \
RDFView.cpp \
RadioGroup.cpp \
Splash.cpp \
Toolbar.cpp \

Просмотреть файл

@ -352,7 +352,6 @@ XFE_MozillaApp::byebye(int status)
GH_FreeGlobalHistory ();
NET_ShutdownNetLib ();
NPL_Shutdown ();
HOT_FreeBookmarks ();
GH_FreeGlobalHistory ();
/* Mailcap and MimeType have been written out when the prefdialog was closed */

Просмотреть файл

@ -40,13 +40,15 @@ XP_BEGIN_PROTOS
extern MWContext* fe_showAddrBook(Widget toplevel, XFE_Frame *parent_frame, Chrome *chromespec);
/* bookmarks */
extern MWContext* fe_showBookmarks(Widget toplevel, XFE_Frame *parent_frame, Chrome *chromespec);
extern void fe_showBookmarks(Widget toplevel);
extern MWContext* fe_getBookmarkContext();
#ifdef OLD_BOOKMARKS
extern void fe_createBookmarks(Widget toplevel, XFE_Frame *parent_frame, Chrome *chromespec);
#endif /*OLD_BOOKMARKS*/
extern char *fe_getDefaultBookmarks(void);
/* history */
extern MWContext* fe_showHistory(Widget toplevel, XFE_Frame *parent_frame, Chrome *chromespec);
extern void fe_showHistory(Widget toplevel);
extern void fe_createHistory(Widget toplevel, XFE_Frame *parent_frame, Chrome *chromespec);