Remove taskbar widget and use toolbar instead. UNBLOAT.

This commit is contained in:
ramiro%netscape.com 1998-09-20 11:05:00 +00:00
parent 4694781f61
commit 0251601951
19 changed files with 175 additions and 1298 deletions

View File

@ -336,6 +336,7 @@ XfeCreateLoadedTaskBar(Widget pw,
WidgetList * task_items_out)
{
Widget task_bar = NULL;
Widget undock_button;
unsigned char layout =
large ? XmBUTTON_LABEL_ON_BOTTOM : XmBUTTON_PIXMAP_ONLY;
@ -344,17 +345,20 @@ XfeCreateLoadedTaskBar(Widget pw,
task_bar = XtVaCreateManagedWidget(
"TaskBar",
xfeTaskBarWidgetClass,
xfeToolBarWidgetClass,
pw,
XmNbackground, XfeBackground(pw),
XmNbuttonLayout, layout,
NULL);
XtVaSetValues(task_bar,
XmNactionPixmap, XfeGetPixmap(task_bar,"task_small_handle"),
NULL);
undock_button = XtVaCreateManagedWidget(
"undockButton",
xfeButtonWidgetClass,
task_bar,
XmNpixmap, XfeGetPixmap(task_bar,"task_small_handle"),
XmNbuttonLayout, XmBUTTON_PIXMAP_ONLY,
NULL);
if (task_count)
{
XfeLoadTaskBar(task_bar,

View File

@ -53,7 +53,6 @@
#include <Xfe/Chrome.h>
#include <Xfe/DashBoard.h>
#include <Xfe/Tab.h>
#include <Xfe/TaskBar.h>
#include <Xfe/ToolBar.h>
#include <Xfe/ToolBox.h>
#include <Xfe/ToolItem.h>

View File

@ -29,7 +29,6 @@
#include <Xfe/ToolBox.h>
#include <Xfe/DashBoard.h>
#include <Xfe/TaskBar.h>
#include <Xm/RowColumn.h>
XFE_BEGIN_CPLUSPLUS_PROTECTION

View File

@ -27,7 +27,7 @@
#include <stdio.h>
#include <Xfe/DashBoardP.h>
#include <Xfe/TaskBarP.h>
/* #include <Xfe/TaskBarP.h> */
#include <Xm/DrawingA.h>
#include <Xm/Form.h>
@ -43,7 +43,7 @@
#define MESSAGE4 "XmNstatusBar is a read-only resource."
#define MESSAGE5 "XmNtaskBar is a read-only resource."
#define MESSAGE6 "XmNtoolBar is a read-only resource."
#define MESSAGE7 "The XmNfloatingShell must have a vali XfeTaskBar descendant."
#define MESSAGE7 "The XmNfloatingShell must have a valid XfeToolBar descendant."
#define MESSAGE8 "The class of XmNfloatingShell must be XmDialogShell."
#define MESSAGE9 "The XmNfloatingShell must have a single valid child."
@ -615,15 +615,10 @@ AcceptStaticChild(Widget child)
XfeDashBoardPart * dp = _XfeDashBoardPart(w);
Boolean accept = False;
/* Look for task bar */
if (XfeIsTaskBar(child))
/* Look for tool bar and task bar */
if (XfeIsToolBar(child))
{
accept = !dp->docked_task_bar;
}
/* Look for button tool bar */
else if (XfeIsToolBar(child))
{
accept = !dp->tool_bar;
accept = (!dp->docked_task_bar || !dp->tool_bar);
}
/* Look for progress bar */
else if (ChildIsProgressBar(child))
@ -646,24 +641,28 @@ InsertStaticChild(Widget child)
XfeDashBoardPart * dp = _XfeDashBoardPart(w);
Boolean layout = False;
/* Task bar */
if (XfeIsTaskBar(child))
/* Tool Bars bar */
if (XfeIsToolBar(child))
{
dp->docked_task_bar = child;
/* Add undock callback to docked task bar */
XtAddCallback(dp->docked_task_bar,XmNactionCallback,
TaskBarActionCB,(XtPointer) w);
/* Make sure the action button does show */
XtVaSetValues(dp->docked_task_bar,XmNshowActionButton,True,NULL);
layout = True;
}
/* Button tool bar */
else if (XfeIsToolBar(child))
{
dp->tool_bar = child;
/* Task bar */
if (!dp->tool_bar)
{
dp->docked_task_bar = child;
#if FUCK
/* Add undock callback to docked task bar */
XtAddCallback(dp->docked_task_bar,XmNactionCallback,
TaskBarActionCB,(XtPointer) w);
/* Make sure the action button does show */
XtVaSetValues(dp->docked_task_bar,XmNshowActionButton,True,NULL);
#endif
}
/* Tool bar */
else
{
dp->tool_bar = child;
}
layout = True;
}
@ -770,7 +769,10 @@ CheckFloatingWidgets(Widget w,Widget shell)
target = _XfemChildren(shell)[0];
/* The docked taskbar is the first descendant of task bar class */
task_bar = XfeDescendantFindByClass(shell,xfeTaskBarWidgetClass,
/* task_bar = XfeDescendantFindByClass(shell,xfeTaskBarWidgetClass, */
/* XfeFIND_ALIVE,False); */
task_bar = XfeDescendantFindByClass(shell,xfeToolBarWidgetClass,
XfeFIND_ALIVE,False);
/* Make sure the target is valid */
@ -784,7 +786,8 @@ CheckFloatingWidgets(Widget w,Widget shell)
}
/* Make sure the docked task bar is valid */
if (_XfeIsAlive(task_bar) && XfeIsTaskBar(task_bar))
/* if (_XfeIsAlive(task_bar) && XfeIsTaskBar(task_bar)) */
if (_XfeIsAlive(task_bar) && XfeIsToolBar(task_bar))
{
result = True;
}
@ -820,12 +823,15 @@ AddFloatingShell(Widget w,Widget shell)
dp->floating_shell = shell;
dp->floating_target = _XfemChildren(shell)[0];
dp->floating_task_bar = XfeDescendantFindByClass(shell,
xfeTaskBarWidgetClass,
xfeToolBarWidgetClass,
/* xfeTaskBarWidgetClass, */
XfeFIND_ALIVE,
False);
#if FUCK
/* Make sure the action button does not show */
XtVaSetValues(dp->floating_task_bar,XmNshowActionButton,False,NULL);
#endif
/* Handle changes in view window structure */
XtAddEventHandler(dp->floating_shell,
@ -1148,6 +1154,7 @@ UpdateUndockPixmap(Widget w)
{
XfeDashBoardPart * dp = _XfeDashBoardPart(w);
#if 0
if (dp->docked_task_bar)
{
if (_XfePixmapGood(dp->undock_pixmap))
@ -1157,6 +1164,7 @@ UpdateUndockPixmap(Widget w)
NULL);
}
}
#endif
}
/*----------------------------------------------------------------------*/
static void

View File

@ -31,7 +31,7 @@
#include <Xfe/Button.h>
#include <Xfe/Label.h>
#include <Xfe/ProgressBar.h>
#include <Xfe/TaskBar.h>
/* #include <Xfe/TaskBar.h> */
#include <Xfe/ToolBar.h>
XFE_BEGIN_CPLUSPLUS_PROTECTION

View File

@ -38,7 +38,6 @@ CSRCS = \
Chrome.c \
DashBoard.c \
Tab.c \
TaskBar.c \
ToolBar.c \
ToolBox.c \
ToolItem.c \
@ -56,8 +55,6 @@ EXPORTS = \
DashBoardP.h \
Tab.h \
TabP.h \
TaskBar.h \
TaskBarP.h \
ToolBar.h \
ToolBarP.h \
ToolBox.h \

View File

@ -43,7 +43,6 @@ CSRCS = \
Chrome.c \
DashBoard.c \
Tab.c \
TaskBar.c \
ToolBar.c \
ToolBox.c \
ToolItem.c \
@ -62,8 +61,6 @@ EXPORTS = \
DashBoardP.h \
Tab.h \
TabP.h \
TaskBar.h \
TaskBarP.h \
ToolBar.h \
ToolBarP.h \
ToolBox.h \

View File

@ -1,670 +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: <Xfe/TaskBar.c> */
/* Description: XfeTaskBar widget source. */
/* Author: Ramiro Estrugo <ramiro@netscape.com> */
/* */
/*----------------------------------------------------------------------*/
#include <stdio.h>
#include <Xfe/TaskBarP.h>
#include <Xfe/Button.h>
#include <Xfe/Tab.h>
#include <Xm/AtomMgr.h>
#include <Xm/Protocols.h>
#define MESSAGE1 "Widget is not an XfeTaskBar."
#define MESSAGE2 "XmNactionButton is a read-only resource."
#define MESSAGE3 "XmNfirstWidget is a read-only resource."
#define MESSAGE4 "XmNrightWidget is a read-only resource."
#define MESSAGE5 "XmNmaxPosition is too big."
#define MESSAGE6 "XmNminPosition is too small."
#define ACTION_BUTTON_NAME "ActionButton"
#define SHADOW_OFFSET 3
/*----------------------------------------------------------------------*/
/* */
/* Core Class Methods */
/* */
/*----------------------------------------------------------------------*/
static void Initialize (Widget,Widget,ArgList,Cardinal *);
static void Destroy (Widget);
static Boolean SetValues (Widget,Widget,Widget,ArgList,
Cardinal *);
/*----------------------------------------------------------------------*/
/* */
/* XfeManager Class Methods */
/* */
/*----------------------------------------------------------------------*/
static void PreferredGeometry (Widget,Dimension *,Dimension *);
static void LayoutComponents (Widget);
/*----------------------------------------------------------------------*/
/* */
/* XfeDynamicManager class methods */
/* */
/*----------------------------------------------------------------------*/
static void LayoutDynamicChildren (Widget);
/*----------------------------------------------------------------------*/
/* */
/* Misc XfeTaskBar functions */
/* */
/*----------------------------------------------------------------------*/
static void LayoutComponentsVertical (Widget);
static void LayoutComponentsHorizontal (Widget);
static void UpdateActionPixmap (Widget);
static void UpdateActionCursor (Widget);
/*----------------------------------------------------------------------*/
/* */
/* Action Button callbacks and event handlers */
/* */
/*----------------------------------------------------------------------*/
static void ActionCallback (Widget,XtPointer,XtPointer);
/*----------------------------------------------------------------------*/
/* */
/* XfeTaskBar Resources */
/* */
/*----------------------------------------------------------------------*/
static const XtResource resources[] =
{
/* Callback resources */
{
XmNactionCallback,
XmCCallback,
XmRCallback,
sizeof(XtCallbackList),
XtOffsetOf(XfeTaskBarRec , xfe_task_bar . action_callback),
XmRImmediate,
(XtPointer) NULL
},
/* Resources */
{
XmNactionButton,
XmCReadOnly,
XmRWidget,
sizeof(Widget),
XtOffsetOf(XfeTaskBarRec , xfe_task_bar . action_button),
XmRImmediate,
(XtPointer) NULL
},
{
XmNactionCursor,
XmCCursor,
XmRCursor,
sizeof(Cursor),
XtOffsetOf(XfeTaskBarRec , xfe_task_bar . action_cursor),
XmRImmediate,
(XtPointer) None
},
{
XmNactionPixmap,
XmCActionPixmap,
XmRPixmap,
sizeof(Pixmap),
XtOffsetOf(XfeTaskBarRec , xfe_task_bar . action_pixmap),
XmRImmediate,
(XtPointer) XmUNSPECIFIED_PIXMAP
},
{
XmNshowActionButton,
XmCShowActionButton,
XmRBoolean,
sizeof(Boolean),
XtOffsetOf(XfeTaskBarRec , xfe_task_bar . show_action_button),
XmRImmediate,
(XtPointer) False
},
/* Force all the margins to 0 */
{
XmNmarginBottom,
XmCMarginBottom,
XmRVerticalDimension,
sizeof(Dimension),
XtOffsetOf(XfeTaskBarRec , xfe_manager . margin_bottom),
XmRImmediate,
(XtPointer) 0
},
{
XmNmarginLeft,
XmCMarginLeft,
XmRHorizontalDimension,
sizeof(Dimension),
XtOffsetOf(XfeTaskBarRec , xfe_manager . margin_left),
XmRImmediate,
(XtPointer) 0
},
{
XmNmarginRight,
XmCMarginRight,
XmRHorizontalDimension,
sizeof(Dimension),
XtOffsetOf(XfeTaskBarRec , xfe_manager . margin_right),
XmRImmediate,
(XtPointer) 0
},
{
XmNmarginTop,
XmCMarginTop,
XmRVerticalDimension,
sizeof(Dimension),
XtOffsetOf(XfeTaskBarRec , xfe_manager . margin_top),
XmRImmediate,
(XtPointer) 0
},
};
/*----------------------------------------------------------------------*/
/* */
/* Widget Class Record Initialization */
/* */
/*----------------------------------------------------------------------*/
_XFE_WIDGET_CLASS_RECORD(taskbar,TaskBar) =
{
{
(WidgetClass) &xfeToolBarClassRec, /* superclass */
"XfeTaskBar", /* class_name */
sizeof(XfeTaskBarRec), /* widget_size */
NULL, /* class_initialize */
NULL, /* class_part_initiali */
FALSE, /* class_inited */
Initialize, /* initialize */
NULL, /* initialize_hook */
XtInheritRealize, /* realize */
NULL, /* actions */
0, /* num_actions */
(XtResource *)resources, /* resources */
XtNumber(resources), /* num_resources */
NULLQUARK, /* xrm_class */
TRUE, /* compress_motion */
XtExposeCompressMaximal, /* compress_exposure */
TRUE, /* compress_enterleave */
FALSE, /* visible_interest */
Destroy, /* destroy */
XtInheritResize, /* resize */
XtInheritExpose, /* expose */
SetValues, /* set_values */
NULL, /* set_values_hook */
XtInheritSetValuesAlmost, /* set_values_almost */
NULL, /* get_values_hook */
NULL, /* accexfe_focus */
XtVersion, /* version */
NULL, /* callback_private */
XtInheritTranslations, /* tm_table */
XtInheritQueryGeometry, /* query_geometry */
XtInheritDisplayAccelerator, /* display accel */
NULL, /* extension */
},
/* Composite Part */
{
XtInheritGeometryManager, /* geometry_manager */
XtInheritChangeManaged, /* change_managed */
XtInheritInsertChild, /* insert_child */
XtInheritDeleteChild, /* delete_child */
NULL /* extension */
},
/* Constraint Part */
{
NULL, /* resource list */
0, /* num resources */
sizeof(XfeToolBarConstraintRec), /* constraint size */
NULL, /* init proc */
NULL, /* destroy proc */
NULL, /* set values proc */
NULL, /* extension */
},
/* XmManager Part */
{
XtInheritTranslations,
NULL, /* syn resources */
0, /* num syn_resources */
NULL, /* syn_cont_resources */
0, /* num_syn_cont_resource*/
XmInheritParentProcess, /* parent_process */
NULL, /* extension */
},
/* XfeManager Part */
{
XfeInheritBitGravity, /* bit_gravity */
PreferredGeometry, /* preferred_geometry */
XfeInheritUpdateBoundary, /* update_boundary */
XfeInheritUpdateChildrenInfo, /* update_children_info */
XfeInheritLayoutWidget, /* layout_widget */
NULL, /* accept_static_child */
NULL, /* insert_static_child */
NULL, /* delete_static_child */
NULL, /* layout_static_children */
XfeInheritChangeManaged, /* change_managed */
NULL, /* prepare_components */
LayoutComponents, /* layout_components */
NULL, /* draw_background */
XfeInheritDrawShadow, /* draw_shadow */
XfeInheritDrawComponents, /* draw_components */
NULL, /* extension */
},
/* XfeDynamicManager Part */
{
XfeInheritAcceptDynamicChild, /* accept_dynamic_child */
XfeInheritInsertDynamicChild, /* insert_dynamic_child */
XfeInheritDeleteDynamicChild, /* delete_dynamic_child */
LayoutDynamicChildren, /* layout_dynamic_children */
NULL, /* extension */
},
/* XfeOriented Part */
{
NULL, /* enter */
NULL, /* leave */
NULL, /* motion */
NULL, /* drag_start */
NULL, /* drag_end */
NULL, /* drag_motion */
NULL, /* des_enter */
NULL, /* des_leave */
NULL, /* des_motion */
NULL, /* des_drag_start */
NULL, /* des_drag_end */
NULL, /* des_drag_motion */
NULL, /* extension */
},
/* XfeToolBar Part */
{
XfeInheritDrawRaiseBorder, /* draw_raise_border */
XfeInheritLayoutIndicator, /* layout_indicator */
NULL, /* extension */
},
/* XfeTaskBar Part */
{
NULL, /* extension */
},
};
/*----------------------------------------------------------------------*/
/* */
/* xfeTaskBarWidgetClass declaration. */
/* */
/*----------------------------------------------------------------------*/
_XFE_WIDGET_CLASS(taskbar,TaskBar);
/*----------------------------------------------------------------------*/
/* */
/* Core Class Methods */
/* */
/*----------------------------------------------------------------------*/
static void
Initialize(Widget rw,Widget nw,ArgList args,Cardinal *nargs)
{
XfeTaskBarPart * tp = _XfeTaskBarPart(nw);
/* Create the action button */
tp->action_button =
XtVaCreateWidget(ACTION_BUTTON_NAME,
xfeTabWidgetClass,
nw,
XmNmarginLeft, 0,
XmNmarginRight, 0,
XmNmarginTop, 0,
XmNmarginBottom, 0,
/* XmNprivateComponent, True, */
XmNtraversalOn, False,
XmNhighlightThickness, 0,
XmNarmOffset, 0,
XmNraiseOffset, 0,
XmNbackground, _XfeBackgroundPixel(nw),
NULL);
/* Update the pixmaps */
UpdateActionPixmap(nw);
/* Add callback to action button */
XtAddCallback(tp->action_button,
XmNactivateCallback,
ActionCallback,
(XtPointer) nw);
/* Finish of initialization */
_XfeManagerChainInitialize(rw,nw,xfeTaskBarWidgetClass);
}
/*----------------------------------------------------------------------*/
static void
Destroy(Widget w)
{
/* XfeTaskBarPart * tp = _XfeTaskBarPart(w); */
/* XtRemoveCallback(tp->action_button, */
/* XmNactivateCallback, */
/* ActionCallback, */
/* (XtPointer) nw); */
/* XtRemoveEventHandler(nw, */
/* StructureNotifyMask, */
/* True, */
/* MappingEH, */
/* (XtPointer) nw); */
}
/*----------------------------------------------------------------------*/
static Boolean
SetValues(Widget ow,Widget rw,Widget nw,ArgList args,Cardinal *nargs)
{
XfeTaskBarPart * np = _XfeTaskBarPart(nw);
XfeTaskBarPart * op = _XfeTaskBarPart(ow);
/* action_button */
if (np->action_button != op->action_button)
{
np->action_button = op->action_button;
}
/* action_pixmap */
if (np->action_pixmap != op->action_pixmap)
{
UpdateActionPixmap(nw);
_XfemConfigFlags(nw) |= XfeConfigGLE;
}
/* action_cursor */
if (np->action_cursor != op->action_cursor)
{
UpdateActionCursor(nw);
}
/* show_action_button */
if (np->show_action_button != op->show_action_button)
{
_XfemConfigFlags(nw) |= XfeConfigGLE;
}
return _XfeManagerChainSetValues(ow,rw,nw,xfeTaskBarWidgetClass);
}
/*----------------------------------------------------------------------*/
/*----------------------------------------------------------------------*/
/* */
/* XfeManager Class Methods */
/* */
/*----------------------------------------------------------------------*/
static void
PreferredGeometry(Widget w,Dimension * width,Dimension * height)
{
XfeTaskBarPart * tp = _XfeTaskBarPart(w);
XfeToolBarWidgetClass tbc = (XfeToolBarWidgetClass)xfeToolBarWidgetClass;
(*tbc->xfe_manager_class.preferred_geometry)(w,width,height);
if (tp->show_action_button)
{
switch (_XfeOrientedOrientation(w))
{
case XmHORIZONTAL:
*width += _XfeWidth(tp->action_button);
break;
case XmVERTICAL:
*height += _XfeHeight(tp->action_button);
break;
}
}
}
/*----------------------------------------------------------------------*/
static void
LayoutComponents(Widget w)
{
XfeTaskBarPart * tp = _XfeTaskBarPart(w);
/* Invoke layout_indicator method */
_XfeToolBarLayoutIndicator(w);
/* Make sure our one and only component alive and kicking */
if (!_XfeIsAlive(tp->action_button))
{
return;
}
/* Horizontal */
if (_XfeOrientedOrientation(w) == XmHORIZONTAL)
{
LayoutComponentsHorizontal(w);
}
/* Vertical */
else
{
LayoutComponentsVertical(w);
}
}
/*----------------------------------------------------------------------*/
/*----------------------------------------------------------------------*/
/* */
/* XfeDynamicManager class methods */
/* */
/*----------------------------------------------------------------------*/
static void
LayoutDynamicChildren(Widget w)
{
XfeTaskBarPart * tp = _XfeTaskBarPart(w);
Dimension action_width;
Dimension action_height;
if (tp->show_action_button && _XfeIsAlive(tp->action_button))
{
action_width = _XfeWidth(tp->action_button);
action_height = _XfeHeight(tp->action_button);
}
else
{
action_width = 0;
action_height = 0;
}
/* Horizontal */
if (_XfeOrientedOrientation(w) == XmHORIZONTAL)
{
/* Add the action button's dimensions to the left margin */
_XfemMarginLeft(w) += action_width;
(*xfeToolBarClassRec.xfe_dynamic_manager_class.layout_dynamic_children)(w);
/* Restore the left margin */
_XfemMarginLeft(w) -= action_width;
}
else
{
/* Add the action button's dimensions to the top margin */
_XfemMarginTop(w) += action_height;
(*xfeToolBarClassRec.xfe_dynamic_manager_class.layout_dynamic_children)(w);
/* Restore the top margin */
_XfemMarginTop(w) -= action_height;
}
}
/*----------------------------------------------------------------------*/
/*----------------------------------------------------------------------*/
/* */
/* Action Button callbacks */
/* */
/*----------------------------------------------------------------------*/
static void
ActionCallback(Widget child,XtPointer client_data,XtPointer call_data)
{
Widget w = XtParent(child);
XfeTaskBarPart * tp = _XfeTaskBarPart(w);
XfeButtonCallbackStruct * cbs = (XfeButtonCallbackStruct *) call_data;
if (_XfeIsAlive(w))
{
/* Invoke the action callbacks */
_XfeInvokeCallbacks(w,tp->action_callback,XmCR_ACTION,
cbs->event,False);
}
}
/*----------------------------------------------------------------------*/
/*----------------------------------------------------------------------*/
/* */
/* Misc XfeTaskBar functions */
/* */
/*----------------------------------------------------------------------*/
static void
LayoutComponentsVertical(Widget w)
{
XfeTaskBarPart * tp = _XfeTaskBarPart(w);
XtVaSetValues(tp->action_button,
XmNusePreferredWidth, True,
NULL);
/* Layout the action button */
_XfeConfigureWidget(tp->action_button,
0,
0,
_XfeWidth(w),
_XfeHeight(tp->action_button));
/* Show the action button as needed */
_XfemIgnoreConfigure(w) = True;
if (tp->show_action_button)
{
XtManageChild(tp->action_button);
}
else
{
XtUnmanageChild(tp->action_button);
}
_XfemIgnoreConfigure(w) = False;
}
/*----------------------------------------------------------------------*/
static void
LayoutComponentsHorizontal(Widget w)
{
XfeTaskBarPart * tp = _XfeTaskBarPart(w);
XtVaSetValues(tp->action_button,
XmNusePreferredWidth, True,
NULL);
/* Layout the action button */
_XfeConfigureWidget(tp->action_button,
0,
0,
_XfeWidth(tp->action_button),
_XfeHeight(w));
/* Show the action button as needed */
_XfemIgnoreConfigure(w) = True;
if (tp->show_action_button)
{
XtManageChild(tp->action_button);
}
else
{
XtUnmanageChild(tp->action_button);
}
_XfemIgnoreConfigure(w) = False;
}
/*----------------------------------------------------------------------*/
static void
UpdateActionPixmap(Widget w)
{
XfeTaskBarPart * tp = _XfeTaskBarPart(w);
if (_XfePixmapGood(tp->action_pixmap))
{
XtVaSetValues(tp->action_button,
XmNpixmap, tp->action_pixmap,
NULL);
}
else
{
_XfeResizeWidget(tp->action_button,16,16);
}
}
/*----------------------------------------------------------------------*/
static void
UpdateActionCursor(Widget w)
{
XfeTaskBarPart * tp = _XfeTaskBarPart(w);
if (tp->action_pixmap != None)
{
XtVaSetValues(tp->action_button,
XmNcursor, tp->action_cursor,
XmNcursorOn, True,
NULL);
}
else
{
XtVaSetValues(tp->action_button,
XmNcursor, None,
XmNcursorOn, False,
NULL);
}
}
/*----------------------------------------------------------------------*/
/*----------------------------------------------------------------------*/
/* */
/* XfeTaskBar Public Methods */
/* */
/*----------------------------------------------------------------------*/
Widget
XfeCreateTaskBar(Widget parent,char *name,Arg *args,Cardinal count)
{
return (XtCreateWidget(name,xfeTaskBarWidgetClass,parent,args,count));
}
/*----------------------------------------------------------------------*/

View File

@ -1,80 +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: <Xfe/TaskBar.h> */
/* Description: XfeTaskBar widget public header file. */
/* Author: Ramiro Estrugo <ramiro@netscape.com> */
/* */
/*----------------------------------------------------------------------*/
#ifndef _XfeTaskBar_h_ /* start TaskBar.h */
#define _XfeTaskBar_h_
#include <Xfe/Xfe.h>
XFE_BEGIN_CPLUSPLUS_PROTECTION
/*----------------------------------------------------------------------*/
/* */
/* XfeTaskBar resource names */
/* */
/*----------------------------------------------------------------------*/
#define XmNactionCallback "actionCallback"
#define XmNactionButton "actionButton"
#define XmNactionPixmap "actionPixmap"
#define XmNshowActionButton "showActionButton"
#define XmNactionCursor "actionCursor"
#define XmCActionPixmap "ActionPixmap"
#define XmCShowActionButton "ShowActionButton"
/*----------------------------------------------------------------------*/
/* */
/* XfeBox class names */
/* */
/*----------------------------------------------------------------------*/
externalref WidgetClass xfeTaskBarWidgetClass;
typedef struct _XfeTaskBarClassRec * XfeTaskBarWidgetClass;
typedef struct _XfeTaskBarRec * XfeTaskBarWidget;
/*----------------------------------------------------------------------*/
/* */
/* XfeBox subclass test macro */
/* */
/*----------------------------------------------------------------------*/
#define XfeIsTaskBar(w) XtIsSubclass(w,xfeTaskBarWidgetClass)
/*----------------------------------------------------------------------*/
/* */
/* XfeTaskBar Public Methods */
/* */
/*----------------------------------------------------------------------*/
extern Widget
XfeCreateTaskBar (Widget parent,
String name,
Arg * args,
Cardinal num_args);
/*----------------------------------------------------------------------*/
XFE_END_CPLUSPLUS_PROTECTION
#endif /* end TaskBar.h */

View File

@ -1,112 +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: <Xfe/TaskBarP.h> */
/* Description: XfeTaskBar widget private header file. */
/* Author: Ramiro Estrugo <ramiro@netscape.com> */
/* */
/*----------------------------------------------------------------------*/
#ifndef _XfeTaskBarP_h_ /* start TaskBarP.h */
#define _XfeTaskBarP_h_
#include <Xfe/ToolBarP.h>
#include <Xfe/TaskBar.h>
XFE_BEGIN_CPLUSPLUS_PROTECTION
/*----------------------------------------------------------------------*/
/* */
/* XfeTaskBarClassPart */
/* */
/*----------------------------------------------------------------------*/
typedef struct
{
XtPointer extension; /* Extension */
} XfeTaskBarClassPart;
/*----------------------------------------------------------------------*/
/* */
/* XfeTaskBarClassRec */
/* */
/*----------------------------------------------------------------------*/
typedef struct _XfeTaskBarClassRec
{
CoreClassPart core_class;
CompositeClassPart composite_class;
ConstraintClassPart constraint_class;
XmManagerClassPart manager_class;
XfeManagerClassPart xfe_manager_class;
XfeDynamicManagerClassPart xfe_dynamic_manager_class;
XfeOrientedClassPart xfe_oriented_class;
XfeToolBarClassPart xfe_tool_bar_class;
XfeTaskBarClassPart xfe_task_bar_class;
} XfeTaskBarClassRec;
externalref XfeTaskBarClassRec xfeTaskBarClassRec;
/*----------------------------------------------------------------------*/
/* */
/* XfeTaskBarPart */
/* */
/*----------------------------------------------------------------------*/
typedef struct _XfeTaskBarPart
{
/* Callbacks */
XtCallbackList action_callback; /* Action callbacks */
/* Resource Data Members */
Widget action_button; /* Dock Button */
Cursor action_cursor; /* Action cursor */
Pixmap action_pixmap; /* Action pixmap */
Boolean show_action_button; /* Show action btn ?*/
/* Private data -- Dont even look past this comment -- */
} XfeTaskBarPart;
/*----------------------------------------------------------------------*/
/* */
/* XfeTaskBarRec */
/* */
/*----------------------------------------------------------------------*/
typedef struct _XfeTaskBarRec
{
CorePart core;
CompositePart composite;
ConstraintPart constraint;
XmManagerPart manager;
XfeManagerPart xfe_manager;
XfeDynamicManagerPart xfe_dynamic_manager;
XfeOrientedPart xfe_oriented;
XfeToolBarPart xfe_tool_bar;
XfeTaskBarPart xfe_task_bar;
} XfeTaskBarRec;
/*----------------------------------------------------------------------*/
/* */
/* XfeTaskBarPart Access Macro */
/* */
/*----------------------------------------------------------------------*/
#define _XfeTaskBarPart(w) &(((XfeTaskBarWidget) w) -> xfe_task_bar)
XFE_END_CPLUSPLUS_PROTECTION
#endif /* end TaskBarP.h */

View File

@ -23,8 +23,7 @@ DEPTH = ../../../../..
CSRCS = \
ChromeTest.c \
DashBoardTest.c \
TaskBarTestOne.c \
TaskBarTestTwo.c \
TaskBarTest.c \
ToolBarTest.c \
ToolBoxTest.c \
ToolScrollTest.c \

View File

@ -28,8 +28,7 @@ include $(DEPTH)/config/autoconf.mk
CSRCS = \
ChromeTest.c \
DashBoardTest.c \
TaskBarTestOne.c \
TaskBarTestTwo.c \
TaskBarTest.c \
ToolBarTest.c \
ToolBoxTest.c \
ToolScrollTest.c \

View File

@ -17,7 +17,7 @@
!
TaskBarTestTwo*MainForm.width: 500
TaskBarTestTwo*MainForm.height: 400
TaskBarTestTwo*MainForm.background: Gray70
TaskBarTestTwo*MainForm.shadowThickness: 0
TaskBarTest*MainForm.width: 500
TaskBarTest*MainForm.height: 400
TaskBarTest*MainForm.background: Gray70
TaskBarTest*MainForm.shadowThickness: 0

View File

@ -18,7 +18,7 @@
/*----------------------------------------------------------------------*/
/* */
/* Name: TaskBarTestTwo.c */
/* Name: TaskBarTest.c */
/* Description: Test for XfeTaskBar widget. */
/* Author: Ramiro Estrugo <ramiro@netscape.com> */
/* */
@ -35,7 +35,7 @@ main(int argc,char *argv[])
Widget form;
Widget frame;
XfeAppCreateSimple("TaskBarTestTwo",&argc,argv,"MainFrame",&frame,&form);
XfeAppCreateSimple("TaskBarTest",&argc,argv,"MainFrame",&frame,&form);
_docked_tb = XfeCreateLoadedTaskBar(form,
"DockedTaskBar",

View File

@ -1,80 +0,0 @@
! -*- Mode: Fundamental; tab-width: 8; indent-tabs-mode: nil -*-
!
! 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.
!
TaskBarTestOne*MainForm.width: 500
TaskBarTestOne*MainForm.height: 400
TaskBarTestOne*MainForm.background: Gray70
TaskBarTestOne*MainForm.shadowThickness: 0
TaskBarTestOne*MainForm.shadowType: shadow_in
TaskBarTestOne*fontList: -*-helvetica-medium-r-*-*-*-140-*-*-*-*-iso8859-*
TaskBarTestOne*labelFontList: -*-helvetica-medium-r-*-*-*-140-*-*-*-*-iso8859-*
TaskBarTestOne*foreground: Black
TaskBarTestOne*DockedTaskBar.leftAttachment: attach_form
TaskBarTestOne*DockedTaskBar.rightAttachment: attach_none
TaskBarTestOne*DockedTaskBar.bottomAttachment: attach_none
TaskBarTestOne*DockedTaskBar.topAttachment: attach_form
TaskBarTestOne*DockedTaskBar.leftOffset: 5
TaskBarTestOne*DockedTaskBar.rightOffset: 5
TaskBarTestOne*DockedTaskBar.topOffset: 5
TaskBarTestOne*DockedTaskBar.shadowThickness: 1
TaskBarTestOne*DockedTaskBar.shadowType: shadow_out
TaskBarTestOne*DockedTaskBar.background: Gray75
TaskBarTestOne*DockedTaskBar.orientation: horizontal
!TaskBarTestOne*DockedTaskBar.buttonLayout: button_pixmap_only
TaskBarTestOne*DockedTaskBar.usePreferredWidth: true
TaskBarTestOne*DockedTaskBar.usePreferredHeight: true
!TaskBarTestOne*DockedTaskBar.spacing: 100
TaskBarTestOne*FloatingShell.title: Tasks
TaskBarTestOne*FloatingTaskBar.shadowThickness: 1
TaskBarTestOne*FloatingTaskBar.shadowType: shadow_out
TaskBarTestOne*FloatingTaskBar.background: Gray75
TaskBarTestOne*FloatingTaskBar.orientation: vertical
TaskBarTestOne*FloatingTaskBar.usePreferredWidth: true
TaskBarTestOne*FloatingTaskBar.usePreferredHeight: true
!TaskBarTestOne*FloatingTaskBar.spacing: 100
!TaskBarTestOne*FloatingTaskBar.buttonLayout: button_pixmap_only
TaskBarTestOne*XfeButton*traversalOn: False
TaskBarTestOne*XfeButton*highlightThickness: 1
TaskBarTestOne*XfeButton*shadowThickness: 1
TaskBarTestOne*XfeButton*highlightColor: Gray20
TaskBarTestOne*XfeButton*background: Gray75
TaskBarTestOne*XfeButton*buttonType: button_push
!TaskBarTestOne*XfeButton*bufferType: buffer_private
TaskBarTestOne*Two*leftOffset: 10
TaskBarTestOne*Two*topOffset: 10
TaskBarTestOne*Four*leftOffset: 10
TaskBarTestOne*Four*topOffset: 10
TaskBarTestOne*Five*leftOffset: 10
TaskBarTestOne*Five*topOffset: 10

View File

@ -1,254 +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: TaskBarTestOne.c */
/* Description: Test for XfeTaskBar widget. */
/* Author: Ramiro Estrugo <ramiro@netscape.com> */
/* */
/*----------------------------------------------------------------------*/
#include <Xfe/XfeTest.h>
#include <Xm/MwmUtil.h>
#include <X11/Shell.h>
#include <Xfe/XfeP.h>
static String names[] =
{
"One",
"Two",
"Three",
"Four",
"Five",
"Six"
};
static String icons_large[] =
{
"icons/bar_web.xpm",
"icons/bar_news.xpm",
"icons/bar_mail.xpm",
"icons/bar_web.xpm",
"icons/bar_news.xpm",
"icons/bar_mail.xpm",
};
#define LOGO_PIXMAP "icons/logo.xpm"
#define DRAG_PIXMAP "icons/drag_tile.xpm"
#define UNDOCK_PIXMAP "icons/undock.xpm"
static void undock_callback (Widget,XtPointer,XtPointer);
static void dock_callback (Widget,XtPointer,XtPointer);
static void tool_active_callback (Widget,XtPointer,XtPointer);
static Widget create_docked_task_bar (String,Widget);
static Widget create_foating_task_bar (String,Widget);
static Widget _floating_tb = NULL;
static Widget _floating_shell = NULL;
static Widget _docked_tb = NULL;
/*----------------------------------------------------------------------*/
int
main(int argc,char *argv[])
{
Widget form;
Widget frame;
XfeAppCreateSimple("TaskBarTestOne",&argc,argv,"MainFrame",&frame,&form);
_docked_tb = create_docked_task_bar("DockedTaskBar",form);
_floating_tb = create_foating_task_bar("FloatingShell",_docked_tb);
XtAddCallback(_docked_tb,XmNactionCallback,undock_callback,NULL);
#if 0
XtAddCallback(_floating_tb,XmNactionCallback,dock_callback,NULL);
#else
XtAddCallback(_floating_tb,XmNcloseCallback,dock_callback,NULL);
#endif
XtManageChild(_docked_tb);
XtPopup(frame,XtGrabNone);
XfeAppMainLoop();
return 0;
}
/*----------------------------------------------------------------------*/
static Widget
create_docked_task_bar(String name,Widget parent)
{
Widget tb;
Cardinal i;
Pixmap action_pixmap;
tb = XtVaCreateWidget(name,
xfeTaskBarWidgetClass,
parent,
XmNshowActionButton, True,
NULL);
action_pixmap = XfeGetPixmapFromFile(tb,UNDOCK_PIXMAP);
XtVaSetValues(tb,
XmNactionPixmap, action_pixmap,
NULL);
for (i = 0; i < XtNumber(names); i++)
{
Widget w;
Pixmap p_normal;
Pixmap p_raised;
Pixmap p_armed;
w = XtVaCreateManagedWidget(names[i],
xfeButtonWidgetClass,
tb,
NULL);
p_normal = XfeGetPixmapFromFile(w,icons_large[i]);
p_raised = XfeGetPixmapFromFile(w,icons_large[i]);
p_armed = XfeGetPixmapFromFile(w,icons_large[i]);
XtVaSetValues(w,
XmNpixmap, p_normal,
XmNraisedPixmap, p_raised,
XmNarmedPixmap, p_armed,
NULL);
XtAddCallback(w,XmNactivateCallback,tool_active_callback,NULL);
}
return tb;
}
/*----------------------------------------------------------------------*/
static Widget
create_foating_task_bar(String name,Widget parent)
{
Widget tb;
Pixmap action_pixmap;
Pixmap drag_pixmap;
int mask;
int mode;
int func;
mask = MWM_DECOR_BORDER | MWM_DECOR_TITLE | MWM_DECOR_MENU;
mode = MWM_INPUT_PRIMARY_APPLICATION_MODAL;
func = MWM_FUNC_CLOSE | MWM_FUNC_MOVE;
/* mask = 0;*/
_floating_shell =
XtVaCreatePopupShell(name,
xmDialogShellWidgetClass,
XfeAncestorFindTopLevelShell(parent),
XmNmwmDecorations, mask,
XmNmwmInputMode, mode,
XmNmwmFunctions, func,
XmNallowShellResize, True,
XmNdeleteResponse, XmDO_NOTHING,
NULL);
tb = create_docked_task_bar("FloatingTaskBar",_floating_shell);
XtVaSetValues(tb,XmNshowActionButton,False,NULL);
action_pixmap = XfeGetPixmapFromFile(tb,LOGO_PIXMAP);
drag_pixmap = XfeGetPixmapFromFile(tb,DRAG_PIXMAP);
#if 0
XtVaSetValues(tb,
XmNactionPixmap, action_pixmap,
XmNdragPixmap, drag_pixmap,
NULL);
#endif
return tb;
}
/*----------------------------------------------------------------------*/
static void
tool_active_callback(Widget w,XtPointer client_data,XtPointer call_data)
{
/* I want more siblings */
XtVaCreateManagedWidget("New Task",
xfeButtonWidgetClass,
XtParent(w),
NULL);
}
/*----------------------------------------------------------------------*/
static void
undock_callback(Widget w,XtPointer client_data,XtPointer call_data)
{
static first_map = True;
XtUnmanageChild(_docked_tb);
#if 0
XtResizeWidget(_floating_shell,
_XfeWidth(_floating_tb),
_XfeHeight(_floating_tb),
0);
#endif
if (first_map)
{
Widget top_shell = XfeAncestorFindTopLevelShell(_docked_tb);
Position x =
XfeRootX(top_shell) +
XfeWidth(top_shell) -
XfeWidth(_floating_tb) -
0;
Position y =
XfeRootY(top_shell) +
XfeHeight(top_shell) -
XfeHeight(_floating_tb) -
0;
XtVaSetValues(_floating_shell,
XmNx, x,
XmNy, y,
NULL);
first_map = False;
}
XtManageChild(_floating_tb);
}
/*----------------------------------------------------------------------*/
static void
dock_callback(Widget w,XtPointer client_data,XtPointer call_data)
{
XtManageChild(_docked_tb);
XtUnmanageChild(_floating_tb);
}
/*----------------------------------------------------------------------*/

View File

@ -31,9 +31,9 @@
#include "PopupMenu.h"
#include "BookmarkFrame.h"
#ifdef MOZ_TASKBAR
#include "TaskBar.h"
#endif
// #ifdef MOZ_TASKBAR
// #include "TaskBar.h"
// #endif
#include <Xm/Form.h>
#include <Xm/MwmUtil.h>
@ -487,10 +487,11 @@ XFE_Dashboard::createDockedTaskBar()
// Create the docked taskbar here
m_dockedTaskBar = new XFE_TaskBar(m_widget,m_parentFrame,False);
// Add action cb to dashboard
XtAddCallback(m_dockedTaskBar->getBaseWidget(),
XmNactionCallback,
// XtAddCallback(m_dockedTaskBar->getBaseWidget(),
XtAddCallback(m_dockedTaskBar->getUndockButton(),
XmNactivateCallback,
XFE_Dashboard::floatingActionCB,
(XtPointer) this);

View File

@ -40,8 +40,7 @@
#include "xfe2_extern.h"
#include "prefapi.h"
#include <Xfe/TaskBar.h>
#include <Xfe/Button.h>
#include <Xfe/ToolBar.h>
#ifdef MOZ_MAIL_NEWS
#define SM_BIFF_UNKNOWN_ICONS TaskSm_MailU_group
@ -53,9 +52,6 @@
#define LG_BIFF_NOMAIL_ICONS Task_MailN_group
#endif
#define FLOATING_TASK_BAR_NAME "floatingTaskBar"
#define DOCKED_TASK_BAR_NAME "dockedTaskBar"
//////////////////////////////////////////////////////////////////////////
//
// Small icons.
@ -101,7 +97,7 @@ XFE_TaskBar::XFE_TaskBar(Widget parent,
XFE_Component(parent_frame),
m_isFloating(is_floating),
m_parentFrame(parent_frame),
m_actionButton(NULL)
m_undockButton(NULL)
#ifdef MOZ_MAIL_NEWS
,m_biffNoticeInstalled(False)
#endif
@ -250,9 +246,7 @@ static void DropSiteDestroyCb(Widget,XtPointer cd,XtPointer)
if (cd)
delete (XFE_TaskBarDrop*)cd;
}
//////////////////////////////////////////////////////////////////////////
Widget
XFE_TaskBar::createTaskBarButton(TaskBarSpec *spec)
{
@ -329,40 +323,97 @@ XFE_TaskBar::createTaskBarButton(TaskBarSpec *spec)
}
//////////////////////////////////////////////////////////////////////////
void
XFE_TaskBar::createBaseToolBar(Widget parent,String name)
{
XP_ASSERT( XfeIsAlive(parent) );
XP_ASSERT( name != NULL );
Widget toolbar = XtVaCreateWidget(name,
xfeToolBarWidgetClass,
parent,
XmNusePreferredWidth, True,
XmNusePreferredHeight, True,
NULL);
setBaseWidget(toolbar);
}
//////////////////////////////////////////////////////////////////////////
void
XFE_TaskBar::createUndockButton(Widget parent)
{
XP_ASSERT( XfeIsAlive(parent) );
m_undockButton = XtVaCreateWidget("undockButton",
xfeButtonWidgetClass,
parent,
NULL);
// Create the undock pixmap
if (!XfePixmapGood(TaskSm_Handle_group.pixmap_icon.pixmap))
{
IconGroup_createAllIcons(&TaskSm_Handle_group,
XfeAncestorFindByClass(parent,
shellWidgetClass,
XfeFIND_ANY),
XfeForeground(m_widget),
XfeBackground(m_widget));
}
// Set the undock pixmap on the button if valid
if (XfePixmapGood(TaskSm_Handle_group.pixmap_icon.pixmap))
{
XtVaSetValues(m_undockButton,
XmNpixmap, TaskSm_Handle_group.pixmap_icon.pixmap,
NULL);
}
XtManageChild(m_undockButton);
}
//////////////////////////////////////////////////////////////////////////
void
XFE_TaskBar::createDockedWidgets(Widget parent)
{
XP_ASSERT( XfeIsAlive(parent) );
// Create a horizontal task bar
m_widget = XtVaCreateWidget(DOCKED_TASK_BAR_NAME,
xfeTaskBarWidgetClass,
parent,
XmNorientation, XmHORIZONTAL,
XmNusePreferredWidth, True,
XmNusePreferredHeight, True,
NULL);
// m_widget = XtVaCreateWidget("dockedTaskBar",
// xfeTaskBarWidgetClass,
// parent,
// XmNorientation, XmHORIZONTAL,
// XmNusePreferredWidth, True,
// XmNusePreferredHeight, True,
// NULL);
// Floating undock image
IconGroup_createAllIcons(&TaskSm_Handle_group,
// IconGroup_createAllIcons(&TaskSm_Handle_group,
XfeAncestorFindByClass(m_widget,
shellWidgetClass,
XfeFIND_ANY),
// XfeAncestorFindByClass(m_widget,
// shellWidgetClass,
// XfeFIND_ANY),
XfeForeground(m_widget),
// XfeForeground(m_widget),
XfeBackground(m_widget));
// XfeBackground(m_widget));
createBaseToolBar(parent,"dockedTaskBar");
XP_ASSERT( XfeIsAlive(m_widget) );
createUndockButton(m_widget);
// Create floating buttons
createButtons(m_dockedSpec);
if (XfePixmapGood(TaskSm_Handle_group.pixmap_icon.pixmap))
{
XtVaSetValues(m_widget,
XmNactionPixmap, TaskSm_Handle_group.pixmap_icon.pixmap,
NULL);
}
// if (XfePixmapGood(TaskSm_Handle_group.pixmap_icon.pixmap))
// {
// XtVaSetValues(m_widget,
// XmNactionPixmap, TaskSm_Handle_group.pixmap_icon.pixmap,
// NULL);
// }
#if 0
// If the floating taskbar does not have any enabled buttons, then
// we dont need to show the action button.
XFE_TaskBar * ftb = XFE_Dashboard::getFloatingTaskBar();
@ -371,6 +422,7 @@ XFE_TaskBar::createDockedWidgets(Widget parent)
{
XtVaSetValues(m_widget,XmNshowActionButton,False,NULL);
}
#endif
}
//////////////////////////////////////////////////////////////////////////
void
@ -382,14 +434,20 @@ XFE_TaskBar::createFloatingWidgets(Widget parent)
fe_globalPrefs.task_bar_horizontal ? XmHORIZONTAL : XmVERTICAL;
// Create the floating task bar
m_widget = XtVaCreateWidget(FLOATING_TASK_BAR_NAME,
xfeTaskBarWidgetClass,
parent,
XmNorientation, orientation,
XmNusePreferredWidth, True,
XmNusePreferredHeight, True,
NULL);
// m_widget = XtVaCreateWidget("floatingTaskBar",
// xfeTaskBarWidgetClass,
// parent,
// XmNorientation, orientation,
// XmNusePreferredWidth, True,
// XmNusePreferredHeight, True,
// NULL);
createBaseToolBar(parent,"dockedTaskBar");
XP_ASSERT( XfeIsAlive(m_widget) );
XtVaSetValues(m_widget,XmNorientation,orientation,NULL);
// Create floating buttons
createButtons(m_floatingSpec);
@ -514,6 +572,12 @@ XFE_TaskBar::numEnabledButtons()
return num_managed;
}
//////////////////////////////////////////////////////////////////////////
Widget
XFE_TaskBar::getUndockButton()
{
return m_undockButton;
}
//////////////////////////////////////////////////////////////////////////
XFE_CALLBACK_DEFN(XFE_TaskBar,updateIconAppearance)
(XFE_NotificationCenter * /*obj*/,

View File

@ -60,6 +60,8 @@ public:
void updateFloatingAppearance ();
Cardinal numEnabledButtons ();
Widget getUndockButton ();
private:
@ -68,7 +70,7 @@ private:
XP_Bool m_isFloating;
XFE_Frame * m_parentFrame;
Widget m_actionButton;
Widget m_undockButton;
#ifdef MOZ_MAIL_NEWS
XP_Bool m_biffNoticeInstalled;
@ -77,13 +79,17 @@ private:
XFE_CALLBACK_DECL(updateBiffStateNotice)
#endif
void setIconGroupForCommand(CommandType cmd, IconGroup *icons);
void setIconGroupForCommand (CommandType cmd,
IconGroup * icons);
Widget createTaskBarButton (TaskBarSpec *spec);
void createButtons (TaskBarSpec * spec);
void createBaseToolBar (Widget parent,String name);
void createUndockButton (Widget parent);
void createFloatingWidgets (Widget parent);
void createDockedWidgets (Widget parent);
Widget createTaskBarButton (TaskBarSpec * spec);
void createButtons (TaskBarSpec * spec);
void createFloatingWidgets (Widget parent);
void createDockedWidgets (Widget parent);
// update the icon appearance
XFE_CALLBACK_DECL(updateIconAppearance)