The Great Chrome Rewrite of 1998. Use a chrome manager instead of

doAttachments().  Fixes numerous toolbox bugs and completely simplifies
the way xfe does chrome.  Reviewed by slamm.


git-svn-id: svn://10.0.0.236/trunk@291 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
ramiro
1998-04-15 02:06:22 +00:00
parent eab23cb735
commit 5bc5ea684f
19 changed files with 238 additions and 384 deletions

View File

@@ -189,21 +189,12 @@ XFE_AddrBookFrame::XFE_AddrBookFrame(Widget toplevel,
* import from XFE_BookmarkFrame::XFE_BookmarkFrame
*/
XFE_AB2PaneView *view = new XFE_AB2PaneView(this,
getViewParent(),
getChromeParent(),
NULL,
m_context,
AB_BOOK);
m_abView = (XFE_AddrBookView *) view->getEntriesListView();
/* Attachment
*/
XtVaSetValues(view->getBaseWidget(),
XmNleftAttachment, XmATTACH_FORM,
XmNtopAttachment, XmATTACH_FORM,
XmNrightAttachment, XmATTACH_FORM,
XmNbottomAttachment, XmATTACH_FORM,
NULL);
setView(view);
setMenubar(menu_bar_spec);

View File

@@ -133,17 +133,12 @@ XFE_BookmarkFrame::XFE_BookmarkFrame(Widget toplevel,
XP_ASSERT( m_bookmarkFrame == NULL );
// create the bookmark view
XFE_BookmarkView *view = new XFE_BookmarkView(this, getViewParent(),
NULL, m_context);
XFE_BookmarkView *view = new XFE_BookmarkView(this,
getChromeParent(),
NULL,
m_context);
setView(view);
XtVaSetValues(view->getBaseWidget(),
XmNleftAttachment, XmATTACH_FORM,
XmNtopAttachment, XmATTACH_FORM,
XmNrightAttachment, XmATTACH_FORM,
XmNbottomAttachment, XmATTACH_FORM,
NULL);
setMenubar(menu_bar_spec);
//
@@ -164,6 +159,7 @@ XFE_BookmarkFrame::XFE_BookmarkFrame(Widget toplevel,
m_dashboard->setShowProgressBar(True);
realize();
resize(600,580); //XXX Default size for now
main_bm_context = m_context;

View File

@@ -229,7 +229,7 @@ XFE_BrowserFrame::XFE_BrowserFrame(Widget toplevel,
#endif /* notyet */
htmlview = new XFE_HTMLView(this, getViewParent(), NULL, m_context);
htmlview = new XFE_HTMLView(this, getChromeParent(), NULL, m_context);
// Create url bar
m_urlBar = new XFE_URLBar(this,m_toolbox);
@@ -259,13 +259,6 @@ XFE_BrowserFrame::XFE_BrowserFrame(Widget toplevel,
if (!chromespec || (chromespec && chromespec->show_url_bar))
m_urlBar->show();
XtVaSetValues(htmlview->getBaseWidget(),
XmNleftAttachment, XmATTACH_FORM,
XmNtopAttachment, XmATTACH_FORM,
XmNrightAttachment, XmATTACH_FORM,
XmNbottomAttachment, XmATTACH_FORM,
NULL);
// register drop site on HTMLView
m_browserDropSite=new XFE_BrowserDrop(htmlview->getBaseWidget(),this);
m_browserDropSite->enable();
@@ -348,9 +341,6 @@ XFE_BrowserFrame::doCommand(CommandType cmd,
// Configure the logo
configureLogo();
// Do the attachments
doAttachments();
// Update prefs
toolboxItemChangeShowing(m_urlBar);
@@ -370,9 +360,6 @@ XFE_BrowserFrame::doCommand(CommandType cmd,
// Configure the logo
configureLogo();
// Do the attachments
doAttachments();
// Update prefs
toolboxItemChangeShowing(m_personalToolbar);

View File

@@ -243,18 +243,16 @@ XDEBUG( printf ("in XFE_ComposeFrame::XFE_ComposeFrame()\n");)
// create the compose view
XFE_ComposeView *view = new XFE_ComposeView(this,
getViewParent(), NULL, m_context,
old_context, fields, NULL,
draftInitialText, preferToUseHtml);
setView(view);
getChromeParent(),
NULL,
m_context,
old_context,
fields,
NULL,
draftInitialText,
preferToUseHtml);
XtVaSetValues(view->getBaseWidget(),
XmNleftAttachment, XmATTACH_FORM,
XmNtopAttachment, XmATTACH_FORM,
XmNrightAttachment, XmATTACH_FORM,
XmNbottomAttachment, XmATTACH_FORM,
NULL);
setView(view);
view->show();

View File

@@ -275,8 +275,10 @@ XFE_DownloadFrame::XFE_DownloadFrame(Widget toplevel, XFE_Frame *parent_frame)
Arg av[10];
int ac;
XFE_DownloadView *v = new XFE_DownloadView(this, getViewParent(),
NULL, m_context);
XFE_DownloadView *v = new XFE_DownloadView(this,
getChromeParent(),
NULL,
m_context);
ac = 0;
XtSetArg(av[ac], XmNdialogType, XmDIALOG_TEMPLATE); ac++;

View File

@@ -713,7 +713,7 @@ XFE_EditorFrame::XFE_EditorFrame(Widget toplevel,
// create html view
XFE_EditorView *editorview = new XFE_EditorView(this,
getViewParent(),
getChromeParent(),
NULL,
m_context);
@@ -721,13 +721,6 @@ XFE_EditorFrame::XFE_EditorFrame(Widget toplevel,
this,
(XFE_FunctionNotification)newPageLoading_cb);
XtVaSetValues(editorview->getBaseWidget(),
XmNleftAttachment, XmATTACH_FORM,
XmNtopAttachment, XmATTACH_FORM,
XmNrightAttachment, XmATTACH_FORM,
XmNbottomAttachment, XmATTACH_FORM,
NULL);
/*
* Hacks to make old XFE code work. These should go away
* as old XFE code is sent to pasture.
@@ -843,15 +836,6 @@ XFE_EditorFrame::doCommand(CommandType cmd,
// Toggle the showing state
m_format_toolbar->toggle();
//
// The doAttachments() call is needed in case the resulting
// toggle operation causes all toolbars to go away. The frame
// needs to attach things accordingly.
//
// Do the attachments
doAttachments();
//
// The toolboxItemChangeShowing() call is needed to make the
// state of toolbars persistent.

View File

@@ -155,7 +155,7 @@ XFE_FolderFrame::XFE_FolderFrame(Widget toplevel,
D( printf ("in XFE_FolderFrame::XFE_FolderFrame()\n");)
// create the folder view
XFE_FolderView *view = new XFE_FolderView(this, getViewParent(), NULL, m_context);
XFE_FolderView *view = new XFE_FolderView(this, getChromeParent(), NULL, m_context);
char banner_title[1024];
m_banner = new XFE_MNBanner(this, m_toolbox);
@@ -177,13 +177,6 @@ D( printf ("in XFE_FolderFrame::XFE_FolderFrame()\n");)
setTitle(title );
XtVaSetValues(view->getBaseWidget(),
XmNleftAttachment, XmATTACH_FORM,
XmNtopAttachment, XmATTACH_FORM,
XmNrightAttachment, XmATTACH_FORM,
XmNbottomAttachment, XmATTACH_FORM,
NULL);
setMenubar(menu_bar_spec);
setToolbar(toolbar_spec);
@@ -263,9 +256,6 @@ XFE_FolderFrame::doCommand(CommandType cmd,
// Configure the logo
configureLogo();
// Do the attachments
doAttachments();
// Update prefs
toolboxItemChangeShowing(m_banner);

View File

@@ -64,8 +64,9 @@
#include <X11/ShellP.h>
#include <Xm/Protocols.h>
#include <Xfe/ToolBox.h>
#include <Xfe/Chrome.h>
#include <Xfe/FrameShell.h>
#include <Xfe/ToolBox.h>
#include <Xm/MwmUtil.h> // For MWM_DECOR_XXX
#include "XmL/Grid.h"
@@ -806,6 +807,7 @@ XFE_Frame::XFE_Frame(char *name,
m_toolbar = NULL;
m_toolbox = NULL;
m_activeLogo = NULL;
m_chrome = NULL;
#ifdef NETCASTER_ZAXIS_HACKERY
m_zaxis_BelowHandlerInstalled = False;
@@ -856,7 +858,14 @@ XFE_Frame::XFE_Frame(char *name,
m_haveHTMLDisplay = haveHTMLDisplay;
createShellAndChromeParent(name, toplevel);
createBaseWidgetShell(toplevel,name);
XP_ASSERT( XfeIsAlive(m_widget) );
createChromeManager(m_widget,"chrome");
XP_ASSERT( XfeIsAlive(m_chrome) );
// XXXX
// now we do all the funky MWContext stuff.
@@ -870,35 +879,16 @@ XFE_Frame::XFE_Frame(char *name,
m_context->restricted_target=chromespec->restricted_target;
if (haveDashboard)
{
m_dashboard = new XFE_Dashboard(this, getChromeParent(), this);
if (!chromespec || (chromespec && chromespec->show_bottom_status_bar))
m_dashboard->show();
}
{
m_dashboard = new XFE_Dashboard(this,m_chrome,this);
if (!chromespec || (chromespec && chromespec->show_bottom_status_bar))
m_dashboard->show();
}
else
m_dashboard = NULL;
// The main form holds the toolbox, m_viewparent and possibly
// the above_view component. This new component is necessary to
// avoid all the annoying problems with toolbars dissapearing.
m_mainform = XtVaCreateManagedWidget("mainForm",
xmFormWidgetClass,
m_chromeparent,
XmNleftAttachment, XmATTACH_FORM,
XmNrightAttachment, XmATTACH_FORM,
NULL);
m_viewparent = XtVaCreateManagedWidget("viewParent",
xmFormWidgetClass,
m_mainform,
XmNleftAttachment, XmATTACH_FORM,
XmNrightAttachment, XmATTACH_FORM,
XmNtopAttachment, XmATTACH_FORM,
XmNbottomAttachment, XmATTACH_FORM,
NULL);
if (chromespec)
{
m_chrome_close_callback = chromespec->close_callback;
@@ -957,20 +947,8 @@ XFE_Frame::XFE_Frame(char *name,
if (needToolbox)
{
// Create the toolbox as a child of the main form
m_toolbox = new XFE_Toolbox(this,m_mainform);
m_toolbox = new XFE_Toolbox(this,m_chrome);
// I was having trouble with the frame geomtry because of the
// dynamic nature of the toolbox (ie, collapsing toolbars) so
// i had to add this function which takes care of all the
// layout for the main form, toolbox and possibly the above_view
// component.
//
// This function installs the event handers and callbacks needed
// to support the this. There is probably a more sane way of
// accomplishing this, bug we ran out of time for 4.x and
// this works.
XfeToolBoxAddLayoutSupport(m_mainform,m_toolbox->getBaseWidget());
// Notify when a toolbox item is snapped in place
m_toolbox->registerInterest(
XFE_Toolbox::toolbarSnap,
@@ -1038,8 +1016,6 @@ XFE_Frame::XFE_Frame(char *name,
m_view = NULL;
m_belowview = NULL;
m_attachmentsNeeded = True;
if (needNavigationToolbar)
{
m_toolbar->registerInterest(Command::doCommandCallback,
@@ -1196,108 +1172,150 @@ XFE_Frame::~XFE_Frame()
//
XFE_MozillaApp::theApp()->unregisterFrame(this);
}
//////////////////////////////////////////////////////////////////////////
//
// This method creates the toplevel shell of this frame. It handles
// modality here as well. So, as an offshoot, we can now support
// any type of modal window, not just dialogs.
//
//////////////////////////////////////////////////////////////////////////
void
XFE_Frame::createShellAndChromeParent(char *name, Widget parent)
XFE_Frame::createBaseWidgetShell(Widget parent,String name)
{
Arg av[20];
int ac;
Widget shell;
XP_ASSERT( XfeIsAlive(parent) );
XP_ASSERT( name != NULL );
ac = 0;
XtSetArg (av[ac], XmNvisual, XFE_DisplayFactory::theFactory()->getVisual()); ac++;
XtSetArg (av[ac], XmNdepth, XFE_DisplayFactory::theFactory()->getVisualDepth()); ac++;
Arg av[20];
Cardinal ac = 0;
Widget shell = NULL;
XtSetArg(av[ac], XmNvisual, XFE_DisplayFactory::theFactory()->getVisual()); ac++;
XtSetArg(av[ac], XmNdepth, XFE_DisplayFactory::theFactory()->getVisualDepth()); ac++;
if (m_haveHTMLDisplay)
{
/* we only need our own colormap if we're displaying html */
m_cmap = XFE_DisplayFactory::theFactory()->getPrivateColormap();
XtSetArg (av[ac], XmNcolormap, fe_getColormap(m_cmap)); ac++;
}
{
/* we only need our own colormap if we're displaying html */
m_cmap = XFE_DisplayFactory::theFactory()->getPrivateColormap();
XtSetArg (av[ac], XmNcolormap, fe_getColormap(m_cmap)); ac++;
}
else
{
m_cmap = XFE_DisplayFactory::theFactory()->getSharedColormap();
XtSetArg (av[ac], XmNcolormap, fe_getColormap(m_cmap)); ac++;
}
{
m_cmap = XFE_DisplayFactory::theFactory()->getSharedColormap();
XtSetArg (av[ac], XmNcolormap, fe_getColormap(m_cmap)); ac++;
}
XtSetArg (av[ac], XmNallowShellResize, False); ac++;
// I think we should deal with modality in XfeFrameShell...that
// would simplify XFE_Frame a lot. -re
if (m_ismodal && m_parentframe)
{
XtSetArg (av[ac], XmNdialogType, XmDIALOG_PROMPT); ac++;
XtSetArg (av[ac], XmNautoUnmanage, False); ac++;
XtSetArg (av[ac], XmNborderWidth, 0); ac++;
XtSetArg (av[ac], XmNautoUnmanage, False); ac++;
XtSetArg (av[ac], XmNmarginWidth, 0); ac++;
XtSetArg (av[ac], XmNmarginHeight, 0); ac++;
XtSetArg (av[ac], XmNdialogStyle, XmDIALOG_PRIMARY_APPLICATION_MODAL); ac++;
XtSetArg (av[ac], XmNnoResize, !m_allowresize); ac++;
XtSetArg (av[ac], XmNresizePolicy, XmRESIZE_ANY); ac++;
shell = XmCreateDialogShell(m_parentframe->getDialogParent(),
name,av,ac);
MWContext *fooContext = fe_WidgetToMWContext(m_parentframe->getDialogParent());
if (fooContext && ViewGlue_getFrame(fooContext) != NULL)
{
XtSetArg (av[ac], XmNdialogType, XmDIALOG_PROMPT); ac++;
XtSetArg (av[ac], XmNautoUnmanage, False); ac++;
XtSetArg (av[ac], XmNborderWidth, 0); ac++;
XtSetArg (av[ac], XmNautoUnmanage, False); ac++;
XtSetArg (av[ac], XmNmarginWidth, 0); ac++;
XtSetArg (av[ac], XmNmarginHeight, 0); ac++;
XtSetArg (av[ac], XmNdialogStyle, XmDIALOG_PRIMARY_APPLICATION_MODAL); ac++;
XtSetArg (av[ac], XmNnoResize, !m_allowresize); ac++;
XtSetArg (av[ac], XmNresizePolicy, XmRESIZE_ANY); ac++;
m_parentframe = ViewGlue_getFrame(fooContext);
m_chromeparent = XmCreateFormDialog(m_parentframe->getDialogParent(),
"form", av, ac);
shell = XtParent(m_chromeparent);
MWContext *fooContext = fe_WidgetToMWContext(m_parentframe->getDialogParent());
if (fooContext && ViewGlue_getFrame(fooContext) != NULL)
{
m_parentframe = ViewGlue_getFrame(fooContext);
fe_ProtectContext(m_parentframe->getContext());
}
fe_ProtectContext(m_parentframe->getContext());
}
}
else
{
m_ismodal = False;
// Warning Warning!!
// This hackery must die. It will go away as soon as the
// XfeFrameShell widget supports all the XmNiconic magic
// and friends.
//
// -ramiro
// Make sure the iconic state is set before the shell gets
// created or else it does not work
if (!fe_GetCommandLineDone() &&
fe_globalData.startup_iconic &&
!m_chromespec_provided)
{
m_ismodal = False;
// Make sure the iconic state is set before the shell gets
// created or else it does not work
if (!fe_GetCommandLineDone() &&
fe_globalData.startup_iconic &&
!m_chromespec_provided)
{
XtSetArg (av[ac], XmNinitialState, IconicState); ac++;
XtSetArg (av[ac], XmNiconic, True); ac++;
}
shell = XfeCreateFrameShell(parent,name,av,ac);
m_chromeparent = XtCreateManagedWidget("form",
xmFormWidgetClass,
shell,
NULL, 0);
XtAddEventHandler(shell, StructureNotifyMask,
True, (XtEventHandler)resizeHandler,
(XtPointer)this);
if (!m_allowresize)
{
XtVaSetValues(shell,
XmNmwmFunctions,
MWM_FUNC_ALL|MWM_FUNC_RESIZE|MWM_FUNC_MAXIMIZE,
NULL);
}
XtSetArg (av[ac], XmNinitialState, IconicState); ac++;
XtSetArg (av[ac], XmNiconic, True); ac++;
}
shell = XfeCreateFrameShell(parent,name,av,ac);
// This hackery must die too. It will go away as soon as the
// XfeFrameShell widget supports XmNresizeCallback and
// XmNmoveCallback.
XtAddEventHandler(shell, StructureNotifyMask,
True, (XtEventHandler)resizeHandler,
(XtPointer)this);
if (!m_allowresize)
{
XtVaSetValues(shell,
XmNmwmFunctions,
MWM_FUNC_ALL|MWM_FUNC_RESIZE|MWM_FUNC_MAXIMIZE,
NULL);
}
}
// This hackery must die too. It will go away as soon as the
// XfeFrameShell widget supports XmNtrackEditres
#ifndef __sgi
XtAddEventHandler(shell, (EventMask)0, True,
(XtEventHandler)_XEditResCheckMessages, 0);
#endif
XP_ASSERT( XfeIsAlive(shell) );
setBaseWidget(shell);
installDestroyHandler();
}
//////////////////////////////////////////////////////////////////////////
//
// This method creates the chrome manager. The chrome manager
// takes care of placing all the chrome elements.
//
//////////////////////////////////////////////////////////////////////////
void
XFE_Frame::createChromeManager(Widget parent,String name)
{
XP_ASSERT( XfeIsAlive(parent) );
XP_ASSERT( name != NULL );
XP_ASSERT( m_chrome == NULL );
m_chrome = XtVaCreateWidget(name,
xfeChromeWidgetClass,
m_widget,
XmNusePreferredWidth, False,
XmNusePreferredHeight, False,
NULL);
// Manage the chrome widget if we are not modal.
if (!m_ismodal)
{
XtManageChild(m_chrome);
}
}
//////////////////////////////////////////////////////////////////////////
static void resizeHandler(Widget, XtPointer p, XEvent *event, Boolean *)
{
if (event->type == ConfigureNotify && p != 0)
@@ -2125,71 +2143,6 @@ XFE_Frame::setToolbar(ToolbarSpec *toolbar_spec)
return;
}
void
XFE_Frame::doAttachments(XP_Bool force)
{
Widget topguy = NULL;
Widget bottomguy = NULL;
if (!force && !isShown())
{
m_attachmentsNeeded = True;
return;
}
// we lay things out from the top and bottom inward, since the view attaches
// to widgets on top and below it.
if (m_menubar && m_menubar->isShown())
{
XtVaSetValues(m_menubar->getBaseWidget(),
XmNleftAttachment, XmATTACH_FORM,
XmNrightAttachment, XmATTACH_FORM,
XmNtopAttachment, XmATTACH_FORM,
XmNbottomAttachment, XmATTACH_NONE,
NULL);
topguy = m_menubar->getBaseWidget();
}
if (m_dashboard && m_dashboard->isShown())
{
XtVaSetValues(m_dashboard->getBaseWidget(),
XmNleftAttachment, XmATTACH_FORM,
XmNrightAttachment, XmATTACH_FORM,
XmNbottomAttachment, XmATTACH_FORM,
XmNtopAttachment, XmATTACH_NONE,
NULL);
bottomguy = m_dashboard->getBaseWidget();
}
if (m_belowview && m_belowview->isShown())
{
XtVaSetValues(m_belowview->getBaseWidget(),
XmNleftAttachment, XmATTACH_FORM,
XmNrightAttachment, XmATTACH_FORM,
XmNtopAttachment, XmATTACH_NONE,
XmNbottomAttachment, (bottomguy ? XmATTACH_WIDGET : XmATTACH_FORM),
XmNbottomWidget, bottomguy,
NULL);
bottomguy = m_belowview->getBaseWidget();
}
// The above view component does not need to be cnfigured, since
// the mainform will take care of it.
// Configure the main form
XtVaSetValues(m_mainform,
XmNleftAttachment, XmATTACH_FORM,
XmNrightAttachment, XmATTACH_FORM,
XmNtopAttachment, (topguy ? XmATTACH_WIDGET : XmATTACH_FORM),
XmNtopWidget, topguy,
XmNbottomAttachment, (bottomguy ? XmATTACH_WIDGET : XmATTACH_FORM),
XmNbottomWidget, bottomguy,
NULL);
// Attachments not needed anymore
m_attachmentsNeeded = False;
}
int
XFE_Frame::getSecurityStatus()
{
@@ -2241,7 +2194,8 @@ XFE_Frame::realize()
{
Widget widget; /* the widget we want to realize */
widget = m_ismodal ? m_chromeparent : m_widget;
// widget = m_ismodal ? m_chromeparent : m_widget;
widget = m_widget;
if (!XtIsRealized(widget))
{
@@ -2250,12 +2204,13 @@ XFE_Frame::realize()
// Configure the logo for the first time
configureLogo();
// Do attachments if needed
if (m_attachmentsNeeded)
{
doAttachments(True);
}
// Warning Warning!!
// All this geometry and command line hackery makes me sick.
// The XfeFrameShell widget will eventually take care of all this
//
// -ramiro
//
// The forcing and saving of prefs should only happen if a chromespec
@@ -2289,6 +2244,11 @@ XFE_Frame::realize()
Position fy;
Dimension fwidth;
Dimension fheight;
// I've found that this does not always work. More
// testing is needed to make sure that this works on
// all window managers. For sure, the function could
// probably be made more robust via some cleverness... -re
// Get geometry from the app shell's XmNgeometry
mask = XfeShellGetGeometryFromResource(shell,&fx,&fy,
@@ -2339,6 +2299,15 @@ XFE_Frame::realize()
XtRealizeWidget(widget);
// Add the most disgusting feature in the universe to XMozilla:
// Z-Axis fascist hackery, puke puke puke.
// Yeah...About a year ago I as given Netcaster koolaid to drink.
// After drinking the sutff, I realized how the webtop would
// take over the universe and added the zaxis hackery support
// needed by the webtop - there remained a funny feeling in my
// stomach, though... -ramiro
// Add z order support if needed
if (XtIsTopLevelShell(m_widget) && m_chromespec_provided)
{
@@ -2367,7 +2336,8 @@ XFE_Frame::realize()
(XFE_FunctionNotification)updateBusyState_cb,
(void*)False);
hackTranslations(m_chromeparent); // XX assumes that the m_chromparent is the child of the shell
// XX assumes that the m_chromparent is the child of the shell
hackTranslations(m_chrome);
notifyInterested(XFE_Component::afterRealizeCallback);
@@ -2423,12 +2393,19 @@ XFE_Frame::show()
for (cons = fe_all_MWContexts ; cons; cons = cons->next)
fe_fixFocusAndGrab(cons->context); // XXXX No looping over contexts!!!
D(printf ("Managing chrome parent\n");)
D(printf ("Managing chrome widget\n");)
XtManageChild(m_chromeparent);
XtManageChild(m_chrome);
}
else
{
// Warning Warning!!
// All this geometry and command line hackery makes me sick.
// The XfeFrameShell widget will eventually take care of all this
//
// -ramiro
// Do not XtPopup() an iconic shell the first time it is
// shown and the command line is still being processed.
//
@@ -2492,7 +2469,7 @@ void
XFE_Frame::hide()
{
if (m_ismodal)
XtUnmanageChild(m_chromeparent);
XtUnmanageChild(m_chrome);
else
XtPopdown(m_widget);
}
@@ -2743,9 +2720,6 @@ XFE_Frame::respectChrome(Chrome * chrome)
else if (m_bottommost)
XLowerWindow(XtDisplay(m_widget), XtWindow(m_widget));
}
// Do the attachments just in case
doAttachments();
}
XFE_View *
@@ -3077,22 +3051,12 @@ XFE_Frame::setHeight(int height)
NULL);
}
Widget
XFE_Frame::getViewParent()
{
return m_viewparent;
}
Widget
XFE_Frame::getMainForm()
{
return m_mainform;
}
Widget
XFE_Frame::getChromeParent()
{
return m_chromeparent;
XP_ASSERT( XfeIsAlive(m_chrome) );
return m_chrome;
}
Widget
@@ -3113,30 +3077,37 @@ XFE_Frame::getContext()
return m_context;
}
//////////////////////////////////////////////////////////////////////////
void
XFE_Frame::setView(XFE_View *new_view)
{
XP_ASSERT(m_view == NULL);
XP_ASSERT( XfeIsAlive(m_chrome) );
m_view = new_view;
doAttachments();
XtVaSetValues(m_chrome,XmNcenterView,m_view->getBaseWidget(),NULL);
}
//////////////////////////////////////////////////////////////////////////
void
XFE_Frame::setAboveViewArea(XFE_Component *above_view)
{
m_aboveview = above_view;
doAttachments();
}
XP_ASSERT( XfeIsAlive(m_chrome) );
m_aboveview = above_view;
XtVaSetValues(m_chrome,XmNtopView,m_aboveview->getBaseWidget(),NULL);
}
//////////////////////////////////////////////////////////////////////////
void
XFE_Frame::setBelowViewArea(XFE_Component *below_view)
{
m_belowview = below_view;
doAttachments();
}
XP_ASSERT( XfeIsAlive(m_chrome) );
m_belowview = below_view;
XtVaSetValues(m_chrome,XmNbottomView,m_belowview->getBaseWidget(),NULL);
}
//////////////////////////////////////////////////////////////////////////
void
XFE_Frame::setTitle(char *title)
{
@@ -3373,10 +3344,6 @@ XFE_Frame::doCommand(CommandType cmd, void *calldata, XFE_CommandInfo* info)
else
m_menubar->show();
// there should probably another way to do this... This seems fairly
// expensive.
doAttachments();
notifyInterested(XFE_View::chromeNeedsUpdating);
}
}
@@ -3389,9 +3356,6 @@ XFE_Frame::doCommand(CommandType cmd, void *calldata, XFE_CommandInfo* info)
// Configure the logo
configureLogo();
// Do the attachments
doAttachments();
// Update prefs
toolboxItemChangeShowing(m_toolbar);
@@ -3537,7 +3501,7 @@ XFE_Frame::doCommand(CommandType cmd, void *calldata, XFE_CommandInfo* info)
if (m_belowview)
delete m_belowview;
minibuffer = new XFE_Minibuffer(this, getChromeParent());
minibuffer = new XFE_Minibuffer(this,m_chrome);
minibuffer->show();
setBelowViewArea(minibuffer);
}

View File

@@ -136,8 +136,6 @@ public:
virtual int getWidth();
virtual int getHeight();
virtual Widget getViewParent();
virtual Widget getMainForm();
virtual Widget getChromeParent();
virtual Widget getDialogParent();
virtual fe_colormap *getColormap();
@@ -224,11 +222,6 @@ public:
// returns False if javascript has said the window is unclosable.
XP_Bool isWMClosable();
// recomputes the attachments for our chunks. If force is false,
// we put off the layout if the Frame is not popped up, until it
// is popped up.
void doAttachments(XP_Bool force = False);
// Returns the index for the security status icon
// (differs between mail & browser)
virtual int getSecurityStatus();
@@ -273,11 +266,14 @@ protected:
// shown, but after it is realized.
void realize();
// this method creates the toplevel shell of this frame. It handles
// This method creates the toplevel shell of this frame. It handles
// modality here as well. So, as an offshoot, we can now support
// any type of modal window, not just dialogs.
void createShellAndChromeParent(char *name,
Widget parent);
void createBaseWidgetShell(Widget parent,String name);
// This method creates the chrome manager. The chrome manager
// takes care of placing all the chrome elements.
void createChromeManager(Widget parent,String name);
// The bastard catch all structure from hell. It is here now, since
// it represents for all the FE code one toplevel window.
@@ -290,19 +286,10 @@ protected:
// Add Z order support
void zaxis_AddSupport();
// baseWidget() in case of a frame points to the shell.
// the widget used as the parent of the view
Widget m_viewparent;
// the widget used as the parent of the m_view_parent, toolbox and above_view
Widget m_mainform;
// the widget used as the parent for all the chrome.
Widget m_chromeparent;
// Widget that manages all the chrome
Widget m_chrome;
XFE_MenuBar * m_menubar;
// XFE_ToolboxItem * m_toolbar;
XFE_Toolbar * m_toolbar;
XFE_Toolbox * m_toolbox;
XFE_Component * m_aboveview;
@@ -385,7 +372,6 @@ protected:
XP_Bool m_haveHTMLDisplay;
XP_Bool m_destroyOnClose;
XP_Bool m_attachmentsNeeded; // if we defer the attachments, this will be true.
Widget m_toplevelWidget; // the parent widget to this window
static MenuSpec new_menu_spec[];

View File

@@ -51,19 +51,12 @@ XFE_HTMLDialogFrame::XFE_HTMLDialogFrame(Widget toplevel,
D(printf ("in XFE_HTMLDialogFrame::XFE_HTMLDialogFrame()\n");)
htmlview = new XFE_HTMLView(this, getViewParent(), NULL, m_context);
htmlview = new XFE_HTMLView(this, getChromeParent(), NULL, m_context);
setView(htmlview);
fe_set_scrolled_default_size(m_context);
XtVaSetValues(htmlview->getBaseWidget(),
XmNleftAttachment, XmATTACH_FORM,
XmNrightAttachment, XmATTACH_FORM,
XmNtopAttachment, XmATTACH_FORM,
XmNbottomAttachment, XmATTACH_FORM,
NULL);
htmlview->show();
respectChrome(chrome_spec);

View File

@@ -110,15 +110,12 @@ XFE_HistoryFrame::XFE_HistoryFrame(Widget toplevel, XFE_Frame *parent_frame, Chr
FRAME_HISTORY, chromespec, False, True, False, True, False)
{
// create the History view
XFE_HistoryView *view = new XFE_HistoryView(this, getViewParent(), NULL, m_context);
setView(view);
XFE_HistoryView *view = new XFE_HistoryView(this,
getChromeParent(),
NULL,
m_context);
XtVaSetValues(view->getBaseWidget(),
XmNleftAttachment, XmATTACH_FORM,
XmNtopAttachment, XmATTACH_FORM,
XmNrightAttachment, XmATTACH_FORM,
XmNbottomAttachment, XmATTACH_FORM,
NULL);
setView(view);
setMenubar(menu_bar_spec);
@@ -138,6 +135,8 @@ XFE_HistoryFrame::XFE_HistoryFrame(Widget toplevel, XFE_Frame *parent_frame, Chr
m_dashboard->setShowStatusBar(True);
m_dashboard->setShowProgressBar(True);
resize(600,580); //XXX Default size for now
}
//////////////////////////////////////////////////////////////////////////
XFE_HistoryFrame::~XFE_HistoryFrame()

View File

@@ -34,7 +34,7 @@ XFE_LdapSearchFrame::XFE_LdapSearchFrame(Widget toplevel,
{
XFE_LdapSearchView *view = new XFE_LdapSearchView(this,
getViewParent(),
getChromeParent(),
this,
NULL,
m_context,

View File

@@ -48,7 +48,7 @@ XFE_MNSearchFrame::XFE_MNSearchFrame(Widget toplevel, XFE_Frame *parent_frame,
XP_ASSERT(mnview != NULL);
XFE_MNSearchView *view = new XFE_MNSearchView(this,
getViewParent(),
getChromeParent(),
this,
mnview,
m_context,

View File

@@ -196,7 +196,7 @@ XFE_MailDownloadFrame::XFE_MailDownloadFrame(Widget toplevel,
{
Widget form;
XFE_MailDownloadView *v = new XFE_MailDownloadView(this, getViewParent(),
XFE_MailDownloadView *v = new XFE_MailDownloadView(this, getChromeParent(),
NULL, m_context, parent_pane);
XFE_Component *belowView;

View File

@@ -266,7 +266,7 @@ XFE_MsgFrame::XFE_MsgFrame(Widget toplevel, XFE_Frame *parent_frame, Chrome *chr
// create the msg view
XFE_MsgView *mview;
mview = new XFE_MsgView(this, getViewParent(), NULL, m_context);
mview = new XFE_MsgView(this, getChromeParent(), NULL, m_context);
mview->registerInterest(XFE_MsgView::spacebarAtMsgBottom,
this,
(XFE_FunctionNotification)spaceAtMsgEnd_cb);
@@ -283,13 +283,6 @@ XFE_MsgFrame::XFE_MsgFrame(Widget toplevel, XFE_Frame *parent_frame, Chrome *chr
setView(mview);
XtVaSetValues(mview->getBaseWidget(),
XmNleftAttachment, XmATTACH_FORM,
XmNtopAttachment, XmATTACH_FORM,
XmNrightAttachment, XmATTACH_FORM,
XmNbottomAttachment, XmATTACH_FORM,
NULL);
setMenubar(menu_bar_spec);
setToolbar(toolbar_spec);
@@ -377,9 +370,6 @@ XFE_MsgFrame::doCommand(CommandType cmd,
// Configure the logo
configureLogo();
// Do the attachments
doAttachments();
// Update prefs
toolboxItemChangeShowing(m_banner);

View File

@@ -62,18 +62,11 @@ XFE_NavCenterFrame::XFE_NavCenterFrame(Widget toplevel,
D(printf("XFE_NavCenterFrame SUB-SYSTEM INSTANCIATING\n");)
// create the bookmark view
XFE_View *view = new XFE_NavCenterView(this, getViewParent(),
XFE_View *view = new XFE_NavCenterView(this, getChromeParent(),
NULL, m_context);
setView(view);
setMenubar(menu_bar_spec);
XtVaSetValues(view->getBaseWidget(),
XmNleftAttachment, XmATTACH_FORM,
XmNtopAttachment, XmATTACH_FORM,
XmNrightAttachment, XmATTACH_FORM,
XmNbottomAttachment, XmATTACH_FORM,
NULL);
//setMenubar(menu_bar_spec);
#ifdef NOTYET

View File

@@ -334,12 +334,12 @@ XFE_ThreadFrame::XFE_ThreadFrame(Widget toplevel, XFE_Frame *parent_frame,
m_banner->setShowFolder(show_folder); /* This has to be set before view
creation */
view3 = new XFE_ThreePaneView(this, getViewParent(), NULL, m_context);
view3 = new XFE_ThreePaneView(this, getChromeParent(), NULL, m_context);
tview = (XFE_ThreadView*)(view3->getThreadView());
#else
tview = new XFE_ThreadView(this, getViewParent(), NULL, m_context);
tview = new XFE_ThreadView(this, getChromeParent(), NULL, m_context);
#endif
@@ -358,21 +358,8 @@ XFE_ThreadFrame::XFE_ThreadFrame(Widget toplevel, XFE_Frame *parent_frame,
#ifdef USE_3PANE
setView(view3);
XtVaSetValues(view3->getBaseWidget(),
XmNleftAttachment, XmATTACH_FORM,
XmNtopAttachment, XmATTACH_FORM,
XmNrightAttachment, XmATTACH_FORM,
XmNbottomAttachment, XmATTACH_FORM,
NULL);
#else
setView(tview);
XtVaSetValues(tview->getBaseWidget(),
XmNleftAttachment, XmATTACH_FORM,
XmNtopAttachment, XmATTACH_FORM,
XmNrightAttachment, XmATTACH_FORM,
XmNbottomAttachment, XmATTACH_FORM,
NULL);
#endif
@@ -896,9 +883,6 @@ XFE_ThreadFrame::doCommand(CommandType cmd,
// Configure the logo
configureLogo();
// Do the attachments
doAttachments();
// Update prefs
toolboxItemChangeShowing(m_banner);

View File

@@ -286,9 +286,7 @@ XFE_Toolbox::createMain(Widget parent)
xfeToolBoxWidgetClass,
parent,
XmNusePreferredWidth, False,
// XmNusePreferredHeight, True,
XmNusePreferredHeight, False,
XmNheight, 200,
XmNusePreferredHeight, True,
NULL);
// Create all the tab icons

View File

@@ -1137,7 +1137,6 @@ FE_UpdateChrome(MWContext *context, /* in */
if (frame == NULL) return;
frame->respectChrome(chrome);
frame->doAttachments();
}
#ifdef MOZ_LDAP