Modularize defaults.

This commit is contained in:
ramiro%netscape.com 1998-09-30 12:55:29 +00:00
parent d60279cefd
commit 7b4dcea5fd
16 changed files with 32 additions and 85 deletions

View File

@ -362,7 +362,7 @@ static XtResource resources[] =
sizeof(Dimension),
XtOffsetOf(XfeButtonRec , xfe_button . arm_offset),
XmRImmediate,
(XtPointer) XfeDEFAULT_ARM_OFFSET
(XtPointer) 0
},
{
XmNarmed,
@ -428,7 +428,7 @@ static XtResource resources[] =
sizeof(Boolean),
XtOffsetOf(XfeButtonRec , xfe_button . emulate_motif),
XmRImmediate,
(XtPointer) XfeDEFAULT_EMULATE_MOTIF
(XtPointer) True
},
{
XmNspacing,

View File

@ -170,7 +170,7 @@ static XtResource resources[] =
sizeof(Dimension),
XtOffsetOf(XfeBypassShellRec , xfe_bypass_shell . shadow_thickness),
XmRImmediate,
(XtPointer) XfeDEFAULT_SHADOW_THICKNESS
(XtPointer) 1
},
{
XmNshadowType,
@ -179,7 +179,7 @@ static XtResource resources[] =
sizeof(unsigned char),
XtOffsetOf(XfeBypassShellRec , xfe_bypass_shell . shadow_type),
XmRImmediate,
(XtPointer) XfeDEFAULT_SHADOW_TYPE
(XtPointer) XmSHADOW_OUT
},
/* Cursor resources */
@ -379,7 +379,7 @@ Initialize(Widget rw,Widget nw,ArgList args,Cardinal *nargs)
XfeBypassShellPart * bp = _XfeBypassShellPart(nw);
/* Make sure the shadow type is ok */
XfeRepTypeCheck(nw,XmRShadowType,&bp->shadow_type,XfeDEFAULT_SHADOW_TYPE);
XfeRepTypeCheck(nw,XmRShadowType,&bp->shadow_type,XmSHADOW_OUT);
/* Add mapping event handler */
XtAddEventHandler(nw,StructureNotifyMask,True,MappingEH,nw);
@ -467,8 +467,7 @@ SetValues(Widget ow,Widget rw,Widget nw,ArgList args,Cardinal *nargs)
if (np->shadow_type != op->shadow_type)
{
/* Make sure the new shadow type is ok */
XfeRepTypeCheck(nw,XmRShadowType,&np->shadow_type,
XfeDEFAULT_SHADOW_TYPE);
XfeRepTypeCheck(nw,XmRShadowType,&np->shadow_type,XmSHADOW_OUT);
redisplay = True;
}

View File

@ -175,7 +175,7 @@ static XtResource resources[] =
sizeof(int),
XtOffsetOf(XfeCascadeRec , xfe_cascade . mapping_delay),
XmRImmediate,
(XtPointer) XfeDEFAULT_MAPPING_DELAY
(XtPointer) 250
},
{
XmNsubMenuId,

View File

@ -1,50 +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/Defaults.h> */
/* Description: Xfe widgets important default resource values. */
/* Author: Ramiro Estrugo <ramiro@netscape.com> */
/* */
/*----------------------------------------------------------------------*/
#ifndef _XfeDefaults_h_ /* start Defaults.h */
#define _XfeDefaults_h_
#define XfeDEFAULT_ANIMATION_INTERVAL 100
#define XfeDEFAULT_ARM_OFFSET 0
#define XfeDEFAULT_BUFFER_TYPE XmBUFFER_NONE
#define XfeDEFAULT_CASCADE_DELAY 250
#define XfeDEFAULT_CYLON_INTERVAL 100
#define XfeDEFAULT_EMULATE_MOTIF True
#define XfeDEFAULT_MAPPING_DELAY 250
#define XfeDEFAULT_MARGIN_BOTTOM 2
#define XfeDEFAULT_MARGIN_LEFT 2
#define XfeDEFAULT_MARGIN_RIGHT 2
#define XfeDEFAULT_MARGIN_TOP 2
#define XfeDEFAULT_POPUP_CURSOR "arrow"
#define XfeDEFAULT_POPUP_DELAY 50
#define XfeDEFAULT_PREFERRED_HEIGHT 0
#define XfeDEFAULT_PREFERRED_WIDTH 0
#define XfeDEFAULT_SELECTION_COLOR "LightBlue"
#define XfeDEFAULT_SHADOW_THICKNESS 1
#define XfeDEFAULT_SHADOW_TYPE XmSHADOW_OUT
#define XfeDEFAULT_TOOL_BOX_DRAG_CURSOR "hand2"
#endif /* end Defaults.h */

View File

@ -28,7 +28,6 @@
#define _XfeFind_h_
#include <Xm/Xm.h> /* Motif public defs */
#include <Xfe/Defaults.h> /* Xfe default res vals */
#include <assert.h> /* Assert */

View File

@ -104,7 +104,7 @@ static XtResource resources[] =
sizeof(int),
XtOffsetOf(XfeLogoRec , xfe_logo . animation_interval),
XmRImmediate,
(XtPointer) XfeDEFAULT_ANIMATION_INTERVAL
(XtPointer) 100
},
{
XmNanimationRunning,

View File

@ -128,7 +128,6 @@ EXPORTS = \
ClientData.h \
Converters.h \
Debug.h \
Defaults.h \
DialogUtil.h \
Divider.h \
DividerP.h \

View File

@ -133,7 +133,6 @@ EXPORTS = \
ClientData.h \
Converters.h \
Debug.h \
Defaults.h \
DialogUtil.h \
Divider.h \
DividerP.h \

View File

@ -211,7 +211,7 @@ static XtResource resources[] =
sizeof(unsigned char),
XtOffsetOf(XfeManagerRec , xfe_manager . shadow_type),
XmRImmediate,
(XtPointer) XfeDEFAULT_SHADOW_TYPE
(XtPointer) XmSHADOW_OUT
},
/* Layout resources */
@ -289,7 +289,7 @@ static XtResource resources[] =
sizeof(Dimension),
XtOffsetOf(XfeManagerRec , xfe_manager . margin_bottom),
XmRImmediate,
(XtPointer) XfeDEFAULT_MARGIN_BOTTOM
(XtPointer) 2
},
{
XmNmarginLeft,
@ -298,7 +298,7 @@ static XtResource resources[] =
sizeof(Dimension),
XtOffsetOf(XfeManagerRec , xfe_manager . margin_left),
XmRImmediate,
(XtPointer) XfeDEFAULT_MARGIN_LEFT
(XtPointer) 2
},
{
XmNmarginRight,
@ -307,7 +307,7 @@ static XtResource resources[] =
sizeof(Dimension),
XtOffsetOf(XfeManagerRec , xfe_manager . margin_right),
XmRImmediate,
(XtPointer) XfeDEFAULT_MARGIN_RIGHT
(XtPointer) 2
},
{
XmNmarginTop,
@ -316,7 +316,7 @@ static XtResource resources[] =
sizeof(Dimension),
XtOffsetOf(XfeManagerRec , xfe_manager . margin_top),
XmRImmediate,
(XtPointer) XfeDEFAULT_MARGIN_TOP
(XtPointer) 2
},
/* For c++ usage */
@ -764,8 +764,7 @@ CoreInitialize(Widget rw,Widget nw,ArgList args,Cardinal *nargs)
_XfemComponentFlag(nw) = True;
/* Make sure the shadow is ok */
XfeRepTypeCheck(nw,XmRShadowType,&_XfemShadowType(nw),
XfeDEFAULT_SHADOW_TYPE);
XfeRepTypeCheck(nw,XmRShadowType,&_XfemShadowType(nw),XmSHADOW_OUT);
/* Finish of initialization */
_XfeManagerChainInitialize(rw,nw,xfeManagerWidgetClass);
@ -1114,7 +1113,7 @@ CoreSetValues(Widget ow,Widget rw,Widget nw,ArgList args,Cardinal *nargs)
if (_XfemShadowType(nw) != _XfemShadowType(ow))
{
/* Make sure the new shadow type is ok */
XfeRepTypeCheck(nw,XmRShadowType,&_XfemShadowType(nw),XfeDEFAULT_SHADOW_TYPE);
XfeRepTypeCheck(nw,XmRShadowType,&_XfemShadowType(nw),XmSHADOW_OUT);
_XfemConfigFlags(nw) |= XfeConfigExpose;
}

View File

@ -177,7 +177,7 @@ static XtResource resources[] =
sizeof(unsigned char),
XtOffsetOf(XfePrimitiveRec , xfe_primitive . shadow_type),
XmRImmediate,
(XtPointer) XfeDEFAULT_SHADOW_TYPE
(XtPointer) XmSHADOW_OUT
},
{
XmNbufferType,
@ -186,7 +186,7 @@ static XtResource resources[] =
sizeof(unsigned char),
XtOffsetOf(XfePrimitiveRec , xfe_primitive . buffer_type),
XmRImmediate,
(XtPointer) XfeDEFAULT_BUFFER_TYPE
(XtPointer) XmBUFFER_NONE
},
/*
* I just realized this resource is misnamed. It should be
@ -228,7 +228,7 @@ static XtResource resources[] =
sizeof(Dimension),
XtOffsetOf(XfePrimitiveRec , xfe_primitive . margin_bottom),
XmRImmediate,
(XtPointer) XfeDEFAULT_MARGIN_BOTTOM
(XtPointer) 2
},
{
XmNmarginLeft,
@ -237,7 +237,7 @@ static XtResource resources[] =
sizeof(Dimension),
XtOffsetOf(XfePrimitiveRec , xfe_primitive . margin_left),
XmRImmediate,
(XtPointer) XfeDEFAULT_MARGIN_LEFT
(XtPointer) 2
},
{
XmNmarginRight,
@ -246,7 +246,7 @@ static XtResource resources[] =
sizeof(Dimension),
XtOffsetOf(XfePrimitiveRec , xfe_primitive . margin_right),
XmRImmediate,
(XtPointer) XfeDEFAULT_MARGIN_RIGHT
(XtPointer) 2
},
{
XmNmarginTop,
@ -255,7 +255,7 @@ static XtResource resources[] =
sizeof(Dimension),
XtOffsetOf(XfePrimitiveRec , xfe_primitive . margin_top),
XmRImmediate,
(XtPointer) XfeDEFAULT_MARGIN_TOP
(XtPointer) 2
},
/* For c++ usage */
@ -340,7 +340,7 @@ static XtResource resources[] =
sizeof(Dimension),
XtOffsetOf(XfePrimitiveRec , primitive . shadow_thickness),
XmRImmediate,
(XtPointer) XfeDEFAULT_SHADOW_THICKNESS
(XtPointer) 1
},
/* Force the width and height to the preffered values */
@ -583,10 +583,10 @@ static void
Initialize(Widget rw,Widget nw,ArgList args,Cardinal *nargs)
{
/* Make sure the shadow is ok */
XfeRepTypeCheck(nw,XmRShadowType,&_XfeShadowType(nw),XfeDEFAULT_SHADOW_TYPE);
XfeRepTypeCheck(nw,XmRShadowType,&_XfeShadowType(nw),XmSHADOW_OUT);
/* Make sure the buffer is ok */
XfeRepTypeCheck(nw,XmRBufferType,&_XfeBufferType(nw),XfeDEFAULT_BUFFER_TYPE);
XfeRepTypeCheck(nw,XmRBufferType,&_XfeBufferType(nw),XmBUFFER_NONE);
/* Initialize private members */
_XfeBufferPixmap(nw) = XmUNSPECIFIED_PIXMAP;
@ -893,7 +893,7 @@ SetValues(Widget ow,Widget rw,Widget nw,ArgList args,Cardinal *nargs)
if (_XfeShadowType(nw) != _XfeShadowType(ow))
{
/* Make sure the new shadow type is ok */
XfeRepTypeCheck(nw,XmRShadowType,&_XfeShadowType(nw),XfeDEFAULT_SHADOW_TYPE);
XfeRepTypeCheck(nw,XmRShadowType,&_XfeShadowType(nw),XmSHADOW_OUT);
_XfeConfigFlags(nw) |= XfeConfigExpose;
}

View File

@ -494,6 +494,9 @@ _XfePrimitiveFocus (Widget,XEvent *,char **,Cardinal *);
/*----------------------------------------------------------------------*/
#define XfePRIMITIVE_DEFAULT_WIDTH 2
#define XfePRIMITIVE_DEFAULT_HEIGHT 2
#define XfeDEFAULT_PREFERRED_HEIGHT 0
#define XfeDEFAULT_PREFERRED_WIDTH 0
/*----------------------------------------------------------------------*/
XFE_END_CPLUSPLUS_PROTECTION

View File

@ -123,7 +123,7 @@ static XtResource resources[] =
sizeof(int),
XtOffsetOf(XfeProgressBarRec , xfe_progress_bar . cylon_interval),
XmRImmediate,
(XtPointer) XfeDEFAULT_CYLON_INTERVAL
(XtPointer) 100
},
{
XmNcylonOffset,

View File

@ -36,7 +36,6 @@
/* so many headers. The convenient organization is worth the penalty. */
/* */
/*----------------------------------------------------------------------*/
#include <Xfe/Defaults.h> /* Xfe default res vals */
#include <Xfe/ChildrenUtil.h> /* Children utils */
#include <Xfe/Converters.h> /* Converters */
#include <Xfe/DialogUtil.h> /* Dialog utils */

View File

@ -426,7 +426,7 @@ static XtResource resources[] =
sizeof(Dimension),
XtOffsetOf(XfeComboBoxRec , manager . shadow_thickness),
XmRImmediate,
(XtPointer) XfeDEFAULT_SHADOW_THICKNESS
(XtPointer) 1
},
/* Force XmNmarginLeft and XmNmarginRight to 4 */

View File

@ -386,7 +386,7 @@ static XtResource resources[] =
sizeof(Dimension),
XtOffsetOf(XfeFancyBoxRec , manager . shadow_thickness),
XmRImmediate,
(XtPointer) XfeDEFAULT_SHADOW_THICKNESS
(XtPointer) 1
},
/* Force XmNmarginLeft and XmNmarginRight to 4 */

View File

@ -334,7 +334,7 @@ static XtResource resources[] =
sizeof(Widget),
XtOffsetOf(XfeToolBoxRec , xfe_tool_box . drag_cursor),
XmRString,
XfeDEFAULT_TOOL_BOX_DRAG_CURSOR
"hand2"
},
{
XmNdragButton,