Пример #1
0
/*----------------------------------------------------------------------*/
static void
DrawTitleShadow(Widget w,XEvent * event,Region region,XRectangle * clip_rect)
{
    XfeFancyBoxPart *	fp = _XfeFancyBoxPart(w);
    XfeComboBoxPart *	cp = _XfeComboBoxPart(w);

	/* Make sure the shadow is needed */
	if (!cp->title_shadow_thickness)
	{
		return;
	}

	if (_XfeIsAlive(fp->icon))
	{
		Dimension icon_x1 = _XfeX(fp->icon) - cp->spacing;
		Dimension title_x2 = _XfeX(cp->title) + _XfeWidth(cp->title);

		/* Draw the shadow around the icon and text */
		_XmDrawShadows(XtDisplay(w),
					   _XfeWindow(w),
					   _XfemTopShadowGC(w),_XfemBottomShadowGC(w),
					   
					   CB_OFFSET_LEFT(w,cp),
					   
					   _XfeY(cp->title) - 
					   cp->title_shadow_thickness,

					   (title_x2 - icon_x1) + 
					   2 * cp->title_shadow_thickness,
					   
					   _XfeHeight(cp->title) + 
					   2 * cp->title_shadow_thickness,
					   
					   cp->title_shadow_thickness,
					   cp->title_shadow_type);
	}
	else
	{
		/* Draw the shadow around the text only */
		XfeDrawShadowsAroundWidget(w,
								   cp->title,
								   _XfemTopShadowGC(w),
								   _XfemBottomShadowGC(w),
								   0,
								   cp->title_shadow_thickness,
								   cp->title_shadow_type);
	}
}
Пример #2
0
/*----------------------------------------------------------------------*/
/* extern */ void
XfeDrawShadowsAroundWidget(Widget			parent,
						   Widget			child,
						   GC				top_gc,
						   GC				bottom_gc,
						   Dimension		offset,
						   Dimension		shadow_thickness,
						   unsigned char	shadow_type)
{
	assert( _XfeIsAlive(parent) );
	assert( _XfeIsAlive(child) );
	assert( shadow_thickness > 0 );
	assert( XmIsManager(parent) );

	_XmDrawShadows(XtDisplay(parent),
				   _XfeWindow(parent),
				   _XfemTopShadowGC(parent),
				   _XfemBottomShadowGC(parent),
				   _XfeX(child) - shadow_thickness - offset,
				   _XfeY(child) - shadow_thickness - offset,
				   _XfeWidth(child) + 2 * shadow_thickness + 2 * offset,
				   _XfeHeight(child) + 2 * shadow_thickness + 2 * offset,
				   shadow_thickness,
				   shadow_type);
}
Пример #3
0
/*----------------------------------------------------------------------*/
static void
DrawTitleShadow(Widget w,XEvent * event,Region region,XRectangle * clip_rect)
{
    XfeComboBoxPart *	cp = _XfeComboBoxPart(w);

	/* Make sure the shadow is needed */
	if (!cp->title_shadow_thickness)
	{
		return;
	}

	/* Draw the shadow around the text only */
	XfeDrawShadowsAroundWidget(w,
							   cp->title,
							   _XfemTopShadowGC(w),
							   _XfemBottomShadowGC(w),
							   0,
							   cp->title_shadow_thickness,
							   cp->title_shadow_type);
}
Пример #4
0
/*----------------------------------------------------------------------*/
static void
DrawShadow(Widget w,XEvent * event,Region region,XRectangle * clip_rect)
{
    XfeComboBoxPart *	cp = _XfeComboBoxPart(w);

	if (!_XfemShadowThickness(w))
 	{
 		return;
 	}

    /* Draw the shadow */
    _XmDrawShadows(XtDisplay(w),
				   _XfeWindow(w),
				   _XfemTopShadowGC(w),_XfemBottomShadowGC(w),
				   cp->highlight_thickness,
				   cp->highlight_thickness,
				   _XfeWidth(w) - 2 * cp->highlight_thickness,
				   _XfeHeight(w) - 2 * cp->highlight_thickness,
				   _XfemShadowThickness(w),
				   _XfemShadowType(w));
}
Пример #5
0
/*----------------------------------------------------------------------*/
/* extern */ void
XfeMenuItemDrawAccent(Widget			item,
					  unsigned char		accent_type,
					  Dimension			offset_left,
					  Dimension			offset_right,
					  Dimension			shadow_thickness,
					  Dimension			accent_thickness)
{
	Widget		pw;
	GC			top_gc;
	GC			bottom_gc;
	XGCValues	values;
	int			top_subwindow_mode;
	int			bottom_subwindow_mode;

	/* duh */
	if (accent_type == XmACCENT_NONE)
	{
		return;
	}

	assert( _XfeIsAlive(item) );
	assert( XmIsPushButton(item) || XmIsCascadeButton(item) );

	pw = _XfeParent(item);

	assert( XmIsRowColumn(pw) );

	top_gc		= _XfemTopShadowGC(pw);
	bottom_gc	= _XfemBottomShadowGC(pw);

	/* Remember the old wubwindow mode values */
	XGetGCValues(XtDisplay(item),top_gc,GCSubwindowMode,&values);

	top_subwindow_mode = values.subwindow_mode;

	XGetGCValues(XtDisplay(item),bottom_gc,GCSubwindowMode,&values);

	bottom_subwindow_mode = values.subwindow_mode;

	/* Force the subwindow mode to IncludeInferiors */
	XSetSubwindowMode(XtDisplay(item),top_gc,IncludeInferiors);
	XSetSubwindowMode(XtDisplay(item),bottom_gc,IncludeInferiors);

	switch(accent_type)
	{
	case XmACCENT_BOTTOM:
		AccentBottom(item,top_gc,bottom_gc,offset_left,offset_right,
					 shadow_thickness,accent_thickness,ACCENT_DRAW);
		break;

	case XmACCENT_ALL:
		AccentAll(item,top_gc,bottom_gc,offset_left,offset_right,
				  shadow_thickness,accent_thickness,ACCENT_DRAW);
		break;

	case XmACCENT_TOP:
		AccentTop(item,top_gc,bottom_gc,offset_left,offset_right,
				  shadow_thickness,accent_thickness,ACCENT_DRAW);
		break;

	default:
		break;
	}

	/* Restore the old subwindow mode */
	XSetSubwindowMode(XtDisplay(item),top_gc,top_subwindow_mode);
	XSetSubwindowMode(XtDisplay(item),bottom_gc,bottom_subwindow_mode);
}