1998-03-28 05:44:41 +03:00
|
|
|
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
|
|
|
*
|
1999-11-03 01:43:10 +03:00
|
|
|
* The contents of this file are subject to the Netscape Public
|
|
|
|
* License Version 1.1 (the "License"); you may not use this file
|
|
|
|
* except in compliance with the License. You may obtain a copy of
|
|
|
|
* the License at http://www.mozilla.org/NPL/
|
1998-03-28 05:44:41 +03:00
|
|
|
*
|
1999-11-03 01:43:10 +03:00
|
|
|
* Software distributed under the License is distributed on an "AS
|
|
|
|
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
|
|
|
* implied. See the License for the specific language governing
|
|
|
|
* rights and limitations under the License.
|
1998-03-28 05:44:41 +03:00
|
|
|
*
|
1999-11-03 01:43:10 +03:00
|
|
|
* The Original Code is mozilla.org code.
|
|
|
|
*
|
|
|
|
* The Initial Developer of the Original Code is Netscape
|
1998-03-28 05:44:41 +03:00
|
|
|
* Communications Corporation. Portions created by Netscape are
|
1999-11-03 01:43:10 +03:00
|
|
|
* Copyright (C) 1998 Netscape Communications Corporation. All
|
|
|
|
* Rights Reserved.
|
|
|
|
*
|
|
|
|
* Contributor(s):
|
1998-03-28 05:44:41 +03:00
|
|
|
*/
|
1998-07-29 13:53:53 +04:00
|
|
|
|
|
|
|
/*----------------------------------------------------------------------*/
|
1998-03-28 05:44:41 +03:00
|
|
|
/* */
|
|
|
|
/* Name: <Xfe/CallProcs.c> */
|
|
|
|
/* Description: Misc shared resource call procedures. */
|
|
|
|
/* Author: Ramiro Estrugo <ramiro@netscape.com> */
|
|
|
|
/* */
|
|
|
|
/*----------------------------------------------------------------------*/
|
|
|
|
|
|
|
|
#include <Xfe/XfeP.h>
|
|
|
|
#include <Xfe/PrimitiveP.h>
|
|
|
|
#include <Xfe/ManagerP.h>
|
|
|
|
|
|
|
|
#define HOR_CURSOR "sb_h_double_arrow"
|
|
|
|
#define VER_CURSOR "sb_v_double_arrow"
|
|
|
|
|
|
|
|
/*----------------------------------------------------------------------*/
|
|
|
|
/* */
|
|
|
|
/* Resource call procedures */
|
|
|
|
/* */
|
|
|
|
/*----------------------------------------------------------------------*/
|
|
|
|
/* extern */ void
|
|
|
|
_XfeCallProcCopyBackground(Widget w,int offset,XrmValue * value)
|
|
|
|
{
|
|
|
|
static Pixel pixel;
|
|
|
|
|
|
|
|
pixel = _XfeBackgroundPixel(w);
|
|
|
|
|
|
|
|
value->addr = (XPointer) &pixel;
|
|
|
|
value->size = sizeof(pixel);
|
|
|
|
}
|
|
|
|
/*----------------------------------------------------------------------*/
|
|
|
|
/* extern */ void
|
|
|
|
_XfeCallProcCopyForeground(Widget w,int offset,XrmValue * value)
|
|
|
|
{
|
|
|
|
static Pixel pixel;
|
|
|
|
|
|
|
|
assert( XfeIsPrimitive(w) || XfeIsManager(w) );
|
|
|
|
|
|
|
|
if (XfeIsPrimitive(w))
|
|
|
|
{
|
|
|
|
pixel = _XfeForeground(w);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
pixel = _XfemForeground(w);
|
|
|
|
}
|
|
|
|
|
|
|
|
value->addr = (XPointer) &pixel;
|
|
|
|
value->size = sizeof(pixel);
|
|
|
|
}
|
|
|
|
/*----------------------------------------------------------------------*/
|
|
|
|
/* extern */ void
|
|
|
|
_XfeCallProcCopyShadowThickness(Widget w,int offset,XrmValue * value)
|
|
|
|
{
|
|
|
|
static Dimension shadow_thickness;
|
|
|
|
|
|
|
|
assert( XfeIsPrimitive(w) || XfeIsManager(w) );
|
|
|
|
|
|
|
|
if (XfeIsPrimitive(w))
|
|
|
|
{
|
|
|
|
shadow_thickness = _XfeShadowThickness(w);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
shadow_thickness = _XfemShadowThickness(w);
|
|
|
|
}
|
|
|
|
|
|
|
|
value->addr = (XPointer) &shadow_thickness;
|
|
|
|
value->size = sizeof(shadow_thickness);
|
|
|
|
}
|
|
|
|
/*----------------------------------------------------------------------*/
|
|
|
|
/* extern */ void
|
|
|
|
_XfeCallProcSelectPixel(Widget w,int offset,XrmValue * value)
|
|
|
|
{
|
|
|
|
static Pixel pixel;
|
|
|
|
|
|
|
|
pixel = XfeSelectPixel(w,_XfeBackgroundPixel(w));
|
|
|
|
|
|
|
|
value->addr = (XPointer) &pixel;
|
|
|
|
value->size = sizeof(pixel);
|
|
|
|
}
|
|
|
|
/*----------------------------------------------------------------------*/
|
|
|
|
/* extern */ void
|
1998-04-08 08:22:56 +04:00
|
|
|
_XfeCallProcDefaultLabelFontList(Widget w,int offset,XrmValue * value)
|
|
|
|
{
|
|
|
|
static XmFontList font_list;
|
|
|
|
|
|
|
|
font_list = XmFontListCopy(_XmGetDefaultFontList(w,XmLABEL_FONTLIST));
|
|
|
|
|
|
|
|
value->addr = (XPointer) &font_list;
|
|
|
|
value->size = sizeof(font_list);
|
|
|
|
}
|
|
|
|
/*----------------------------------------------------------------------*/
|
|
|
|
/* extern */ void
|
|
|
|
_XfeCallProcDefaultTextFontList(Widget w,int offset,XrmValue * value)
|
|
|
|
{
|
|
|
|
static XmFontList font_list;
|
|
|
|
|
|
|
|
font_list = XmFontListCopy(_XmGetDefaultFontList(w,XmTEXT_FONTLIST));
|
|
|
|
|
|
|
|
value->addr = (XPointer) &font_list;
|
|
|
|
value->size = sizeof(font_list);
|
|
|
|
}
|
|
|
|
/*----------------------------------------------------------------------*/
|
|
|
|
/* extern */ void
|
1998-03-28 05:44:41 +03:00
|
|
|
_XfeCallProcOrientationCursor(Widget w,int offset,XrmValue * value)
|
|
|
|
{
|
|
|
|
static Cursor drag_cursor;
|
|
|
|
XrmValue xrm_from;
|
|
|
|
XrmValue xrm_to;
|
|
|
|
unsigned char orientation = XmVERTICAL;
|
|
|
|
String cursor_name;
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Determine the orientation. Obviously, this will only work for
|
|
|
|
* widgets that actually have a XmNorientation resource.
|
|
|
|
*/
|
1998-10-20 16:35:44 +04:00
|
|
|
orientation = (unsigned char) XfeGetValue(w,XmNorientation);
|
1998-03-28 05:44:41 +03:00
|
|
|
|
|
|
|
cursor_name = (orientation == XmVERTICAL) ? VER_CURSOR : HOR_CURSOR;
|
|
|
|
|
|
|
|
/* From */
|
|
|
|
xrm_from.addr = (XPointer) cursor_name;
|
|
|
|
xrm_from.size = strlen(cursor_name);
|
|
|
|
|
|
|
|
/* To */
|
|
|
|
xrm_to.addr = (XPointer) &drag_cursor;
|
|
|
|
xrm_to.size = sizeof(drag_cursor);
|
|
|
|
|
|
|
|
/* Try to do the convertion */
|
|
|
|
if (!XtConvertAndStore(w,XmRString,&xrm_from,XmRCursor,&xrm_to))
|
|
|
|
{
|
|
|
|
drag_cursor = None;
|
|
|
|
}
|
|
|
|
|
|
|
|
value->addr = (XPointer) &drag_cursor;
|
|
|
|
value->size = sizeof(drag_cursor);
|
|
|
|
}
|
|
|
|
/*----------------------------------------------------------------------*/
|
|
|
|
|
|
|
|
/*----------------------------------------------------------------------*/
|
|
|
|
/* */
|
|
|
|
/* Synthetic resource call procedures */
|
|
|
|
/* */
|
|
|
|
/*----------------------------------------------------------------------*/
|
|
|
|
|
|
|
|
/*----------------------------------------------------------------------*/
|
|
|
|
/* */
|
|
|
|
/* Synthetic resource import procedures */
|
|
|
|
/* */
|
|
|
|
/*----------------------------------------------------------------------*/
|
|
|
|
/* extern */ XmImportOperator
|
|
|
|
_XfeSyntheticSetResourceForChild(Widget w,int offset,XtArgVal * value)
|
|
|
|
{
|
|
|
|
return XmSYNTHETIC_LOAD;
|
|
|
|
}
|
|
|
|
/*----------------------------------------------------------------------*/
|