зеркало из https://github.com/mozilla/pjs.git
ifdef out the selector bar and use the new RDFBase class
This commit is contained in:
Родитель
9465caab4a
Коммит
c19590cb41
|
@ -43,12 +43,16 @@ void ncview_image_complete_cb(XtPointer client_data);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
#ifdef USE_SELECTOR_BAR
|
||||||
typedef struct _SelectorCBStruct {
|
typedef struct _SelectorCBStruct {
|
||||||
XFE_NavCenterView *ncview;
|
XFE_NavCenterView *ncview;
|
||||||
HT_View view;
|
HT_View view;
|
||||||
} SelectorCBStruct;
|
} SelectorCBStruct;
|
||||||
|
|
||||||
|
// Selector bar images list
|
||||||
|
/* static */ RDFImageList *
|
||||||
|
XFE_NavCenterView::selectorBarImagesCache = NULL;
|
||||||
|
#endif /*USE_SELECTOR_BAR*/
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////
|
||||||
XFE_NavCenterView::XFE_NavCenterView(XFE_Component *toplevel_component,
|
XFE_NavCenterView::XFE_NavCenterView(XFE_Component *toplevel_component,
|
||||||
|
@ -74,6 +78,7 @@ XFE_NavCenterView::XFE_NavCenterView(XFE_Component *toplevel_component,
|
||||||
|
|
||||||
setBaseWidget(navCenterMainForm);
|
setBaseWidget(navCenterMainForm);
|
||||||
|
|
||||||
|
#ifdef USE_SELECTOR_BAR
|
||||||
m_selector = XtVaCreateManagedWidget("selector",
|
m_selector = XtVaCreateManagedWidget("selector",
|
||||||
xfeToolScrollWidgetClass,
|
xfeToolScrollWidgetClass,
|
||||||
navCenterMainForm,
|
navCenterMainForm,
|
||||||
|
@ -94,9 +99,7 @@ XFE_NavCenterView::XFE_NavCenterView(XFE_Component *toplevel_component,
|
||||||
XtVaSetValues(toolbar,
|
XtVaSetValues(toolbar,
|
||||||
XmNshadowThickness, 0,
|
XmNshadowThickness, 0,
|
||||||
NULL);
|
NULL);
|
||||||
|
#endif /*USE_SELECTOR_BAR*/
|
||||||
m_htview = NULL;
|
|
||||||
m_pane = NULL;
|
|
||||||
|
|
||||||
m_rdfview = new XFE_RDFView(this, m_widget, this, context);
|
m_rdfview = new XFE_RDFView(this, m_widget, this, context);
|
||||||
|
|
||||||
|
@ -107,8 +110,12 @@ XFE_NavCenterView::XFE_NavCenterView(XFE_Component *toplevel_component,
|
||||||
#else
|
#else
|
||||||
XmNbottomAttachment, XmATTACH_FORM,
|
XmNbottomAttachment, XmATTACH_FORM,
|
||||||
#endif
|
#endif
|
||||||
|
#ifdef USE_SELECTOR_BAR
|
||||||
XmNleftAttachment, XmATTACH_WIDGET,
|
XmNleftAttachment, XmATTACH_WIDGET,
|
||||||
XmNleftWidget, m_selector,
|
XmNleftWidget, m_selector,
|
||||||
|
#else
|
||||||
|
XmNleftAttachment, XmATTACH_FORM,
|
||||||
|
#endif /*USE_SELECTOR_BAR*/
|
||||||
XmNrightAttachment, XmATTACH_FORM,
|
XmNrightAttachment, XmATTACH_FORM,
|
||||||
|
|
||||||
|
|
||||||
|
@ -132,20 +139,17 @@ XFE_NavCenterView::XFE_NavCenterView(XFE_Component *toplevel_component,
|
||||||
XmNtopWidget, m_rdfview->getBaseWidget(),
|
XmNtopWidget, m_rdfview->getBaseWidget(),
|
||||||
XmNbottomAttachment, XmATTACH_FORM,
|
XmNbottomAttachment, XmATTACH_FORM,
|
||||||
XmNleftAttachment, XmATTACH_WIDGET,
|
XmNleftAttachment, XmATTACH_WIDGET,
|
||||||
|
#ifdef USE_SELECTOR_BAR
|
||||||
|
XmNleftAttachment, XmATTACH_WIDGET,
|
||||||
XmNleftWidget, m_selector,
|
XmNleftWidget, m_selector,
|
||||||
|
#else
|
||||||
|
XmNleftAttachment, XmATTACH_FORM,
|
||||||
|
#endif /*USE_SELECTOR_BAR*/
|
||||||
XmNrightAttachment, XmATTACH_FORM,
|
XmNrightAttachment, XmATTACH_FORM,
|
||||||
NULL);
|
NULL);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
newPane();
|
||||||
|
|
||||||
HT_Notification ns = new HT_NotificationStruct;
|
|
||||||
ns->notifyProc = &XFE_NavCenterView::notify_cb;
|
|
||||||
ns->data = this;
|
|
||||||
|
|
||||||
m_pane = HT_NewPane(ns);
|
|
||||||
|
|
||||||
HT_SetPaneFEData(m_pane, this);
|
|
||||||
|
|
||||||
// Register the MWContext in the XP list.
|
// Register the MWContext in the XP list.
|
||||||
XP_SetLastActiveContext(context);
|
XP_SetLastActiveContext(context);
|
||||||
|
@ -163,11 +167,11 @@ XFE_NavCenterView::XFE_NavCenterView(XFE_Component *toplevel_component,
|
||||||
* what the mode is. Maybe sitemap will be screwed up when we get there.
|
* what the mode is. Maybe sitemap will be screwed up when we get there.
|
||||||
* But we are not there yet.
|
* But we are not there yet.
|
||||||
**/
|
**/
|
||||||
XP_RegisterNavCenter(m_pane, context);
|
XP_RegisterNavCenter(_ht_pane, context);
|
||||||
|
|
||||||
// Need to figure out what to do in popup state
|
// Need to figure out what to do in popup state
|
||||||
if (!m_isStandalone)
|
if (!m_isStandalone)
|
||||||
XP_DockNavCenter(m_pane, context);
|
XP_DockNavCenter(_ht_pane, context);
|
||||||
|
|
||||||
// add our subviews to the list of subviews for command dispatching and
|
// add our subviews to the list of subviews for command dispatching and
|
||||||
// deletion.
|
// deletion.
|
||||||
|
@ -176,7 +180,9 @@ XFE_NavCenterView::XFE_NavCenterView(XFE_Component *toplevel_component,
|
||||||
addView(m_htmlview);
|
addView(m_htmlview);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef USE_SELECTOR_BAR
|
||||||
XtManageChild(m_selector);
|
XtManageChild(m_selector);
|
||||||
|
#endif /*USE_SELECTOR_BAR*/
|
||||||
m_rdfview->show();
|
m_rdfview->show();
|
||||||
#ifdef HTML_PANE
|
#ifdef HTML_PANE
|
||||||
m_htmlview->show();
|
m_htmlview->show();
|
||||||
|
@ -189,34 +195,19 @@ XFE_NavCenterView::XFE_NavCenterView(XFE_Component *toplevel_component,
|
||||||
XFE_NavCenterView::~XFE_NavCenterView()
|
XFE_NavCenterView::~XFE_NavCenterView()
|
||||||
{
|
{
|
||||||
D(printf("XFE_NavCenterView DESTRUCTING\n"););
|
D(printf("XFE_NavCenterView DESTRUCTING\n"););
|
||||||
if (m_pane)
|
if (_ht_pane)
|
||||||
{
|
{
|
||||||
if (!m_isStandalone)
|
if (!m_isStandalone)
|
||||||
XP_UndockNavCenter(m_pane);
|
XP_UndockNavCenter(_ht_pane);
|
||||||
XP_UnregisterNavCenter(m_pane);
|
XP_UnregisterNavCenter(_ht_pane);
|
||||||
HT_DeletePane(m_pane);
|
|
||||||
}
|
}
|
||||||
// Remove yourself from XFE_RDFImage's listener list
|
// Remove yourself from XFE_RDFImage's listener list
|
||||||
XFE_RDFImage::removeListener(this);
|
XFE_RDFImage::removeListener(this);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////////
|
|
||||||
/* 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;
|
|
||||||
|
|
||||||
theView->notify(ns, n, whatHappened);
|
|
||||||
}
|
|
||||||
//////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////
|
||||||
void
|
void
|
||||||
XFE_NavCenterView::notify(HT_Notification ns,
|
XFE_NavCenterView::notify(HT_Resource n,
|
||||||
HT_Resource n,
|
|
||||||
HT_Event whatHappened)
|
HT_Event whatHappened)
|
||||||
{
|
{
|
||||||
switch (whatHappened) {
|
switch (whatHappened) {
|
||||||
|
@ -229,6 +220,7 @@ XFE_NavCenterView::notify(HT_Notification ns,
|
||||||
D(printf("HT_Event: %s on %s\n","HT_EVENT_VIEW_SELECTED",
|
D(printf("HT_Event: %s on %s\n","HT_EVENT_VIEW_SELECTED",
|
||||||
HT_GetNodeName(n)););
|
HT_GetNodeName(n)););
|
||||||
|
|
||||||
|
#ifdef USE_SELECTOR_BAR
|
||||||
HT_View view = HT_GetView(n);
|
HT_View view = HT_GetView(n);
|
||||||
|
|
||||||
/* The following block of code is to make sure that the view that is
|
/* The following block of code is to make sure that the view that is
|
||||||
|
@ -252,14 +244,14 @@ XFE_NavCenterView::notify(HT_Notification ns,
|
||||||
if (toolbar && button)
|
if (toolbar && button)
|
||||||
XfeToolBarSetSelectedButton(toolbar, button);
|
XfeToolBarSetSelectedButton(toolbar, button);
|
||||||
|
|
||||||
if ((m_htview != view) && toolbar && button) {
|
if ((_ht_view != view) && toolbar && button) {
|
||||||
// Set the RDFView
|
// Set the RDFView
|
||||||
setRDFView(view);
|
setRDFView(view);
|
||||||
// Make sure the corresponding button is marked as selected.
|
// Make sure the corresponding button is marked as selected.
|
||||||
XfeToolBarSetSelectedButton(toolbar, button);
|
XfeToolBarSetSelectedButton(toolbar, button);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
#endif /*USE_SELECTOR_BAR*/
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case HT_EVENT_VIEW_ADDED:
|
case HT_EVENT_VIEW_ADDED:
|
||||||
|
@ -267,10 +259,11 @@ XFE_NavCenterView::notify(HT_Notification ns,
|
||||||
D(printf("HT_Event: %s on %s\n","HT_EVENT_VIEW_ADDED",
|
D(printf("HT_Event: %s on %s\n","HT_EVENT_VIEW_ADDED",
|
||||||
HT_GetNodeName(n)););
|
HT_GetNodeName(n)););
|
||||||
|
|
||||||
|
#ifdef USE_SELECTOR_BAR
|
||||||
HT_View view = HT_GetView(n);
|
HT_View view = HT_GetView(n);
|
||||||
|
|
||||||
addRDFView(view);
|
addRDFView(view);
|
||||||
|
#endif
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -288,9 +281,10 @@ XFE_NavCenterView::notify(HT_Notification ns,
|
||||||
}
|
}
|
||||||
// Pass through to the outliner
|
// Pass through to the outliner
|
||||||
// xxxShould check to make sure that it applies to rdfview's view.
|
// xxxShould check to make sure that it applies to rdfview's view.
|
||||||
m_rdfview->notify(ns,n,whatHappened);
|
m_rdfview->notify(n,whatHappened);
|
||||||
}
|
}
|
||||||
//////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////
|
||||||
|
#ifdef USE_SELECTOR_BAR
|
||||||
void
|
void
|
||||||
XFE_NavCenterView::setRDFView(HT_View view)
|
XFE_NavCenterView::setRDFView(HT_View view)
|
||||||
{
|
{
|
||||||
|
@ -299,8 +293,8 @@ XFE_NavCenterView::setRDFView(HT_View view)
|
||||||
XtVaGetValues(m_selector,XmNtoolBar,&toolbar,NULL);
|
XtVaGetValues(m_selector,XmNtoolBar,&toolbar,NULL);
|
||||||
//XfeToolBarSetSelectedButton(toolbar, xxx);
|
//XfeToolBarSetSelectedButton(toolbar, xxx);
|
||||||
|
|
||||||
HT_SetSelectedView(m_pane, view);
|
HT_SetSelectedView(_ht_pane, view);
|
||||||
m_htview = view;
|
_ht_view = view;
|
||||||
}
|
}
|
||||||
//////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////
|
||||||
void
|
void
|
||||||
|
@ -436,6 +430,7 @@ XFE_NavCenterView::getSelector(void)
|
||||||
return (m_selector);
|
return (m_selector);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
#endif /*USE_SELECTOR_BAR*/
|
||||||
|
|
||||||
void
|
void
|
||||||
XFE_NavCenterView::handleDisplayPixmap(Widget w, IL_Pixmap * image, IL_Pixmap * mask, PRInt32 width, PRInt32 height)
|
XFE_NavCenterView::handleDisplayPixmap(Widget w, IL_Pixmap * image, IL_Pixmap * mask, PRInt32 width, PRInt32 height)
|
||||||
|
|
|
@ -27,7 +27,7 @@
|
||||||
|
|
||||||
#include "View.h"
|
#include "View.h"
|
||||||
#include "htrdf.h"
|
#include "htrdf.h"
|
||||||
//#include "RDFView.h"
|
#include "RDFBase.h"
|
||||||
#include "RDFImage.h"
|
#include "RDFImage.h"
|
||||||
|
|
||||||
class XFE_HTMLView;
|
class XFE_HTMLView;
|
||||||
|
@ -35,21 +35,23 @@ class XFE_RDFView;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class XFE_NavCenterView : public XFE_View
|
class XFE_NavCenterView : public XFE_View,
|
||||||
|
public XFE_RDFBase
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
XFE_NavCenterView(XFE_Component *toplevel_component, Widget parent, XFE_View *parent_view, MWContext *context);
|
XFE_NavCenterView(XFE_Component *toplevel_component, Widget parent, XFE_View *parent_view, MWContext *context);
|
||||||
|
|
||||||
virtual ~XFE_NavCenterView();
|
virtual ~XFE_NavCenterView();
|
||||||
|
|
||||||
void notify(HT_Notification ns, HT_Resource n, HT_Event whatHappened);
|
virtual void notify(HT_Resource n, HT_Event whatHappened);
|
||||||
|
|
||||||
|
#ifdef USE_SELECTOR_BAR
|
||||||
void setRDFView(HT_View view);
|
void setRDFView(HT_View view);
|
||||||
void addRDFView(HT_View view);
|
void addRDFView(HT_View view);
|
||||||
Widget getSelector(void);
|
Widget getSelector(void);
|
||||||
|
|
||||||
static void selector_activate_cb(Widget,XtPointer,XtPointer);
|
static void selector_activate_cb(Widget,XtPointer,XtPointer);
|
||||||
static void selector_destroy_cb(Widget,XtPointer,XtPointer);
|
static void selector_destroy_cb(Widget,XtPointer,XtPointer);
|
||||||
|
#endif /*USE_SELECTORY_BAR*/
|
||||||
|
|
||||||
|
|
||||||
virtual void handleDisplayPixmap(Widget, IL_Pixmap *, IL_Pixmap *, PRInt32 width, PRInt32 height);
|
virtual void handleDisplayPixmap(Widget, IL_Pixmap *, IL_Pixmap *, PRInt32 width, PRInt32 height);
|
||||||
|
@ -57,21 +59,13 @@ public:
|
||||||
virtual void handleImageComplete(Widget, IL_Pixmap *);
|
virtual void handleImageComplete(Widget, IL_Pixmap *);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
HT_Pane m_pane;
|
|
||||||
HT_View m_htview;
|
|
||||||
XFE_HTMLView * m_htmlview;
|
XFE_HTMLView * m_htmlview;
|
||||||
XFE_RDFView * m_rdfview;
|
XFE_RDFView * m_rdfview;
|
||||||
|
#ifdef USE_SELECTOR_BAR
|
||||||
Widget m_selector;
|
Widget m_selector;
|
||||||
|
#endif /*USE_SELECTORY_BAR*/
|
||||||
Widget rdf_parent;
|
Widget rdf_parent;
|
||||||
XP_Bool m_isStandalone; // as oppposed to embedded in a browser
|
XP_Bool m_isStandalone; // as oppposed to embedded in a browser
|
||||||
|
|
||||||
|
|
||||||
static void notify_cb(HT_Notification ns,
|
|
||||||
HT_Resource n,
|
|
||||||
HT_Event whatHappened,
|
|
||||||
void * token,
|
|
||||||
uint32 tokenType);
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
Загрузка…
Ссылка в новой задаче