diff --git a/mozilla/cmd/xfe/src/NavCenterFrame.cpp b/mozilla/cmd/xfe/src/NavCenterFrame.cpp index 9c675934a40..88f5f2381ef 100644 --- a/mozilla/cmd/xfe/src/NavCenterFrame.cpp +++ b/mozilla/cmd/xfe/src/NavCenterFrame.cpp @@ -135,7 +135,7 @@ XFE_NavCenterFrame::commandToString(CommandType cmd, void* calldata, ////////////////////////////////////////////////////////////////////////// extern "C" MWContext * -fe_showNavCenter(Widget toplevel, XFE_Frame *parent_frame, Chrome *chromespec, URL_Struct *url) +fe_showNavCenter(Widget toplevel, XFE_Frame *parent_frame, Chrome *chromespec, URL_Struct * /* url */) { // not a static global, since we can have multiple browsers. XFE_NavCenterFrame *theFrame; diff --git a/mozilla/cmd/xfe/src/NavCenterView.cpp b/mozilla/cmd/xfe/src/NavCenterView.cpp index 6e662051831..15f63248c98 100644 --- a/mozilla/cmd/xfe/src/NavCenterView.cpp +++ b/mozilla/cmd/xfe/src/NavCenterView.cpp @@ -150,11 +150,13 @@ XFE_NavCenterView::XFE_NavCenterView(XFE_Component *toplevel_component, m_htview = NULL; m_pane = NULL; - m_rdfview = new XFE_RDFView(this, rdf_parent, this, - context, m_isStandalone); + + m_rdfview = new XFE_RDFView(this, rdf_parent, this, context); + + m_rdfview->setStandAloneState(m_isStandalone); HT_Notification ns = new HT_NotificationStruct; - ns->notifyProc = notify_cb; + ns->notifyProc = &XFE_NavCenterView::notify_cb; ns->data = this; m_pane = HT_NewPane(ns); @@ -186,17 +188,22 @@ XFE_NavCenterView::~XFE_NavCenterView() } ////////////////////////////////////////////////////////////////////////// -void notify_cb(HT_Notification ns, HT_Resource n, - HT_Event whatHappened, void *token, uint32 tokenType) +/* static */ void +XFE_NavCenterView::notify_cb(HT_Notification ns, + HT_Resource n, + HT_Event whatHappened, + void * /* token */, + uint32 /* tokenType */) { - XFE_NavCenterView* theView = (XFE_NavCenterView*)ns->data; + XFE_NavCenterView * theView = (XFE_NavCenterView *) ns->data; - theView->notify(ns, n, whatHappened); + theView->notify(ns, n, whatHappened); } - +////////////////////////////////////////////////////////////////////////// void -XFE_NavCenterView::notify(HT_Notification ns, HT_Resource n, - HT_Event whatHappened) +XFE_NavCenterView::notify(HT_Notification ns, + HT_Resource n, + HT_Event whatHappened) { switch (whatHappened) { case HT_EVENT_VIEW_CLOSED: @@ -286,7 +293,7 @@ void XFE_NavCenterView::addRDFView(HT_View view) { - static int counter=1; +// static int counter=1; XFE_RDFImage * rdfImage = NULL; @@ -365,9 +372,9 @@ XFE_NavCenterView::addRDFView(HT_View view) } ////////////////////////////////////////////////////////////////////// void -XFE_NavCenterView::selector_activate_cb(Widget w, +XFE_NavCenterView::selector_activate_cb(Widget /* w */, XtPointer clientData, - XtPointer callData) + XtPointer /* callData */) { SelectorCBStruct *cbdata = (SelectorCBStruct *)clientData; @@ -375,9 +382,9 @@ XFE_NavCenterView::selector_activate_cb(Widget w, } ////////////////////////////////////////////////////////////////////// void -XFE_NavCenterView::selector_destroy_cb(Widget w, +XFE_NavCenterView::selector_destroy_cb(Widget /* w */, XtPointer clientData, - XtPointer callData) + XtPointer /* callData */) { SelectorCBStruct *cbdata = (SelectorCBStruct *)clientData; diff --git a/mozilla/cmd/xfe/src/NavCenterView.h b/mozilla/cmd/xfe/src/NavCenterView.h index d3b94e9c85c..f35f2942893 100644 --- a/mozilla/cmd/xfe/src/NavCenterView.h +++ b/mozilla/cmd/xfe/src/NavCenterView.h @@ -75,10 +75,15 @@ private: static void imageCacheInitialize(); static const unsigned int MaxRdfImages; + + static void notify_cb(HT_Notification ns, + HT_Resource n, + HT_Event whatHappened, + void * token, + uint32 tokenType); + }; -static void notify_cb(HT_Notification ns, HT_Resource n, - HT_Event whatHappened, void *token, uint32 tokenType); #endif /* _xfe_navcenterview_h */ diff --git a/mozilla/cmd/xfe/src/RDFView.cpp b/mozilla/cmd/xfe/src/RDFView.cpp index f745350a7fa..c7d72c474a8 100644 --- a/mozilla/cmd/xfe/src/RDFView.cpp +++ b/mozilla/cmd/xfe/src/RDFView.cpp @@ -153,10 +153,12 @@ public: static XFE_CommandList* my_commands = 0; -XFE_RDFView::XFE_RDFView(XFE_Component *toplevel, Widget parent, - XFE_View *parent_view, MWContext *context, - XP_Bool isStandalone) - : XFE_View(toplevel, parent_view, context) +XFE_RDFView::XFE_RDFView(XFE_Component * toplevel, + Widget parent, + XFE_View * parent_view, + MWContext * context) : + XFE_View(toplevel, parent_view, context), + _standAloneState(False) { m_rdfview = NULL; m_popup = NULL; @@ -183,7 +185,7 @@ XFE_RDFView::XFE_RDFView(XFE_Component *toplevel, Widget parent, XmNbottomAttachment, XmATTACH_FORM, NULL); - Widget closeRDFView = XtVaCreateManagedWidget("X", + /* Widget closeRDFView = */XtVaCreateManagedWidget("X", xmPushButtonWidgetClass, rdfControlsParent, XmNtopAttachment, XmATTACH_FORM, @@ -213,7 +215,6 @@ XFE_RDFView::XFE_RDFView(XFE_Component *toplevel, Widget parent, XmNheadingRows, 1, XmNvisibleRows, 14, XmNhideUnhideButtons, True, - XmNvisibleColumns, (isStandalone ? 0 : 1), //XmNdebugLevel, 1, /* Form resources */ XmNtopAttachment, XmATTACH_WIDGET, @@ -378,6 +379,7 @@ XFE_RDFView::refresh(HT_Resource node) HT_Resource child; HT_Cursor child_cursor = HT_NewCursor(node); + while (child = HT_GetNextItem(child_cursor)) { add_row(child); @@ -488,7 +490,7 @@ XFE_RDFView::deselect_row(int row) } ////////////////////////////////////////////////////////////////////////// void -XFE_RDFView::notify(HT_Notification ns, HT_Resource n, +XFE_RDFView::notify(HT_Notification /* ns */, HT_Resource n, HT_Event whatHappened) { switch (whatHappened) { @@ -835,7 +837,7 @@ XFE_RDFView::add_column(int index, char *name, uint32 width, } void -XFE_RDFView::delete_column(HT_Resource cursor) +XFE_RDFView::delete_column(HT_Resource /* cursor */) { } @@ -980,13 +982,13 @@ XFE_RDFPopupMenu::XFE_RDFPopupMenu(String name, Widget parent, } void -XFE_RDFPopupMenu::PushButtonActivate(Widget w, XtPointer userData) +XFE_RDFPopupMenu::PushButtonActivate(Widget /* w */, XtPointer userData) { HT_DoMenuCmd(m_pane, (HT_MenuCmd)(int)userData); } void -XFE_RDFView::closeRdfView_cb(Widget, XtPointer clientData, XtPointer callData) +XFE_RDFView::closeRdfView_cb(Widget /* w */, XtPointer clientData, XtPointer /* callData */) { closeRdfViewCBStruct * obj = (closeRdfViewCBStruct *) clientData; @@ -994,7 +996,7 @@ XFE_RDFView::closeRdfView_cb(Widget, XtPointer clientData, XtPointer callData) Widget selector = (Widget )ncview->getSelector(); - Widget nc_base_widget = ncview->getBaseWidget(); +// Widget nc_base_widget = ncview->getBaseWidget(); Widget parent = XtParent(obj->rdfview->rdfControlsParent); @@ -1009,3 +1011,29 @@ XFE_RDFView::closeRdfView_cb(Widget, XtPointer clientData, XtPointer callData) NULL); XtManageChild(selector); } +////////////////////////////////////////////////////////////////////////// +// +// Toggle the stand alone state +// +////////////////////////////////////////////////////////////////////////// +void +XFE_RDFView::setStandAloneState(XP_Bool state) +{ + XP_ASSERT( XfeIsAlive(m_tree) ); + + _standAloneState = state; + + int visibleColumns = (_standAloneState ? 0 : 1); + + XtVaSetValues(m_tree, + XmNvisibleColumns, visibleColumns, + NULL); +} +////////////////////////////////////////////////////////////////////////// +XP_Bool +XFE_RDFView::getStandAloneState() +{ + return _standAloneState; +} +////////////////////////////////////////////////////////////////////////// + diff --git a/mozilla/cmd/xfe/src/RDFView.h b/mozilla/cmd/xfe/src/RDFView.h index 57e849eccc2..e037bb90954 100644 --- a/mozilla/cmd/xfe/src/RDFView.h +++ b/mozilla/cmd/xfe/src/RDFView.h @@ -48,7 +48,7 @@ class XFE_RDFView : public XFE_View { public: XFE_RDFView(XFE_Component *toplevel, Widget parent, - XFE_View *parent_view, MWContext *context, XP_Bool isStandalone); + XFE_View *parent_view, MWContext *context); ~XFE_RDFView(); @@ -74,6 +74,9 @@ public: void doPopup(XEvent *event); + void setStandAloneState(XP_Bool state); + XP_Bool getStandAloneState(); + private: //HT_Pane m_Pane; // The pane that owns this view HT_View m_rdfview; // The view as registered in the hypertree @@ -82,6 +85,9 @@ private: Widget m_tree; // The tree widget XFE_RDFPopupMenu *m_popup; + // Is this a stand alone view ? + XP_Bool _standAloneState; + // icons for use in the bookmark window. static fe_icon bookmark; static fe_icon openedFolder;