예제 #1
0
XFE_CALLBACK_DEFN(XFE_TaskBar, updateFloatingBusyState)
	(XFE_NotificationCenter *	/* obj */,
	 void *						clientData,
	 void *						/* callData */)
{
	XP_Bool busy = (XP_Bool) (int) clientData;

	Widget floatingShell = XfeAncestorFindByClass(m_widget,
												  shellWidgetClass,
												  XfeFIND_ANY);

	// Dont update busy state if not realized/alive or undocked
	if (!XfeIsAlive(floatingShell) || 
		!XtIsRealized(floatingShell) ||
		XFE_Dashboard::isTaskBarDocked())
	{
		return;
	}

	if (busy)
	{
		MWContext *	context = m_parentFrame->getContext();
		Cursor		cursor = CONTEXT_DATA(context)->busy_cursor;

		XDefineCursor(XtDisplay(floatingShell),
					  XtWindow(floatingShell),
					  cursor);
	}
	else
	{
		XUndefineCursor(XtDisplay(floatingShell),XtWindow(floatingShell));
	}
}
예제 #2
0
/*----------------------------------------------------------------------*/
static Widget
ShellCreate(Widget w)
{
	Widget		shell = NULL;
	Widget		frame_shell;

	/* Look for a XfeFrameShell ancestor */
	frame_shell = XfeAncestorFindByClass(w,
										 xfeFrameShellWidgetClass,
										 XfeFIND_ANY);

	/* If found, use it */
	if (_XfeIsAlive(frame_shell))
	{
		shell = XfeFrameShellGetBypassShell(frame_shell);
	}
	else
	{
		shell = XfeCreateBypassShell(w,SHELL_NAME,NULL,0);

		XtRealizeWidget(shell);
	}

	assert( _XfeIsAlive(shell) );


	if (!_XfeIsRealized(shell))
	{
		XtRealizeWidget(shell);
	}

	return shell;
}
예제 #3
0
/*----------------------------------------------------------------------*/
/* extern */ void
_XfeBmProcWithoutDrawing(Widget w,XtWidgetProc proc)
{
	Widget shell;
	Window window;

	assert( _XfeIsAlive(w) );
	assert( proc != NULL );

	/*
	 * We pretend that the closest shell's window is the button's.  This is 
	 * a hack so that the widget procedure 'proc' does not draw anything.
	 */
	shell = XfeAncestorFindByClass(w,shellWidgetClass,XfeFIND_ANY);

	window = _XfeWindow(w);

	/*
	 * We change the width to 0, so that the real Enter() 
	 * action does not draw anything in the cascade button so that
	 * we can draw the accent lines.
	 */
	_XfeWindow(w) = _XfeWindow(shell);
		
	(*proc)(w);
		
	_XfeWindow(w) = window;
}
예제 #4
0
/*----------------------------------------------------------------------*/
/* extern */ void
_XfeBmActionWithoutDrawing(Widget			w,
						   XtActionProc		proc,
						   XEvent *			event,
						   char **			params,
						   Cardinal *		nparams)
{
	Widget shell;
	Window window;

	assert( _XfeIsAlive(w) );
	assert( proc != NULL );

	shell = XfeAncestorFindByClass(w,shellWidgetClass,XfeFIND_ANY);

	window = _XfeWindow(w);

	/*
	 * We change the width to 0, so that the real Enter() 
	 * action does not draw anything in the cascade button so that
	 * we can draw the accent lines.
	 */
	_XfeWindow(w) = _XfeWindow(shell);
		
	(*proc)(w,event,params,nparams);
		
	_XfeWindow(w) = window;
}
예제 #5
0
void
XFE_TaskBar::setFloatingTitle(const char * title)
{
	XP_ASSERT( XfeIsAlive(m_widget) );
	XP_ASSERT( m_isFloating == True );
	XP_ASSERT( m_isFloating == True );

	Widget shell_widget = XfeAncestorFindByClass(m_widget,
												 shellWidgetClass,
												 XfeFIND_ANY);

	XtVaSetValues(shell_widget,XmNtitle,title,NULL);
}
예제 #6
0
/*----------------------------------------------------------------------*/
Visual *
XfeVisual(Widget w)
{
	Widget shell;

	assert( w != NULL );

	shell = XfeAncestorFindByClass(w,shellWidgetClass,XfeFIND_ANY);

	assert( _XfeIsAlive(shell) );

	if (!_XfeIsAlive(w))
	{
		return NULL;
	}

	return ((ShellWidget) shell) -> shell . visual;
}
예제 #7
0
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);

	// Floating undock image
	IconGroup_createAllIcons(&TaskSm_Handle_group,

							 XfeAncestorFindByClass(m_widget,
													shellWidgetClass,
													XfeFIND_ANY),

							 XfeForeground(m_widget),

							 XfeBackground(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 the floating taskbar does not have any enabled buttons, then 
	// we dont need to show the action button.
	XFE_TaskBar * ftb = XFE_Dashboard::getFloatingTaskBar();

	if (!ftb || !ftb->numEnabledButtons())
	{
		XtVaSetValues(m_widget,XmNshowActionButton,False,NULL);
	}
}
예제 #8
0
void
XFE_Toolbox::createMain(Widget parent)
{
	XP_ASSERT( XfeIsAlive(parent) );

	// The main frame
	m_widget = XtVaCreateWidget("toolBox",
								xfeToolBoxWidgetClass,
								parent,
								XmNusePreferredWidth,		False,
//								XmNusePreferredHeight,		True,
								XmNusePreferredHeight,		False,
								XmNheight,					200,
								NULL);

	// Create all the tab icons
	Pixel	fg = XfeForeground(m_widget);
	Pixel	bg = XfeBackground(m_widget);
	Widget	shell = XfeAncestorFindByClass(parent,
										   shellWidgetClass,
										   XfeFIND_ANY);

	IconGroup_createAllIcons(&BOTTOM_ICON,shell,fg,bg);
	IconGroup_createAllIcons(&HORIZONTAL_ICON,shell,fg,bg);
	IconGroup_createAllIcons(&LEFT_ICON,shell,fg,bg);
	IconGroup_createAllIcons(&RIGHT_ICON,shell,fg,bg);
	IconGroup_createAllIcons(&TOP_ICON,shell,fg,bg);
	IconGroup_createAllIcons(&VERTICAL_ICON,shell,fg,bg);

	XtVaSetValues(
		m_widget,
		XmNbottomPixmap,			BOTTOM_ICON.pixmap_icon.pixmap,
		XmNbottomRaisedPixmap,		BOTTOM_ICON.pixmap_mo_icon.pixmap,
		XmNtopPixmap,				TOP_ICON.pixmap_icon.pixmap,
		XmNtopRaisedPixmap,			TOP_ICON.pixmap_mo_icon.pixmap,
		XmNleftPixmap,				LEFT_ICON.pixmap_icon.pixmap,
		XmNleftRaisedPixmap,		LEFT_ICON.pixmap_mo_icon.pixmap,
		XmNrightPixmap,				RIGHT_ICON.pixmap_icon.pixmap,
		XmNrightRaisedPixmap,		RIGHT_ICON.pixmap_mo_icon.pixmap,
		XmNverticalPixmap,			VERTICAL_ICON.pixmap_icon.pixmap,
		XmNverticalRaisedPixmap, 	VERTICAL_ICON.pixmap_mo_icon.pixmap,
		XmNhorizontalPixmap,		HORIZONTAL_ICON.pixmap_icon.pixmap,
		XmNhorizontalRaisedPixmap,	HORIZONTAL_ICON.pixmap_mo_icon.pixmap,
		NULL);

#if notyet
	// Set the hand cursor
	Cursor hand_cursor = XfeCursorGetDragHand(parent);

	if (hand_cursor != None)
	{
		XtVaSetValues(m_widget,XmNdragCursor,hand_cursor,NULL);
	}
#endif

	// Add new item callback
	XtAddCallback(m_widget,
				  XmNnewItemCallback,
				  &XFE_Toolbox::newItemCallback,
				  (XtPointer) this);

	// Add swap callback
	XtAddCallback(m_widget,
				  XmNswapCallback,
				  &XFE_Toolbox::swapCallback,
				  (XtPointer) this);


	// Add snap callback
	XtAddCallback(m_widget,
				  XmNsnapCallback,
				  &XFE_Toolbox::snapCallback,
				  (XtPointer) this);

	// Add close callback
	XtAddCallback(m_widget,
				  XmNcloseCallback,
				  &XFE_Toolbox::closeCallback,
				  (XtPointer) this);

	// Add open callback
	XtAddCallback(m_widget,
				  XmNopenCallback,
				  &XFE_Toolbox::openCallback,
				  (XtPointer) this);


	installDestroyHandler();
}