From 145ae2448134f3d5ea971ce6c7ea14a5f54e0e5a Mon Sep 17 00:00:00 2001 From: "ramiro%netscape.com" Date: Wed, 30 Sep 1998 12:55:29 +0000 Subject: [PATCH] Modularize defaults. --- cmd/xfe/XfeWidgets/Xfe/Button.c | 4 ++-- cmd/xfe/XfeWidgets/Xfe/BypassShell.c | 9 ++++----- cmd/xfe/XfeWidgets/Xfe/Cascade.c | 2 +- cmd/xfe/XfeWidgets/Xfe/Defaults.h | 0 cmd/xfe/XfeWidgets/Xfe/Find.h | 1 - cmd/xfe/XfeWidgets/Xfe/Logo.c | 2 +- cmd/xfe/XfeWidgets/Xfe/Makefile | 1 - cmd/xfe/XfeWidgets/Xfe/Makefile.in | 1 - cmd/xfe/XfeWidgets/Xfe/Manager.c | 15 +++++++-------- cmd/xfe/XfeWidgets/Xfe/Primitive.c | 20 ++++++++++---------- cmd/xfe/XfeWidgets/Xfe/PrimitiveP.h | 3 +++ cmd/xfe/XfeWidgets/Xfe/ProgressBar.c | 2 +- cmd/xfe/XfeWidgets/Xfe/Xfe.h | 1 - cmd/xfe/XfeWidgets/XfeComboBox/ComboBox.c | 2 +- cmd/xfe/XfeWidgets/XfeComboBox/FancyBox.c | 2 +- cmd/xfe/XfeWidgets/XfeToolBar/ToolBox.c | 2 +- 16 files changed, 32 insertions(+), 35 deletions(-) delete mode 100644 cmd/xfe/XfeWidgets/Xfe/Defaults.h diff --git a/cmd/xfe/XfeWidgets/Xfe/Button.c b/cmd/xfe/XfeWidgets/Xfe/Button.c index 11dec412059..81d20a14d62 100644 --- a/cmd/xfe/XfeWidgets/Xfe/Button.c +++ b/cmd/xfe/XfeWidgets/Xfe/Button.c @@ -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, diff --git a/cmd/xfe/XfeWidgets/Xfe/BypassShell.c b/cmd/xfe/XfeWidgets/Xfe/BypassShell.c index cf59f41d01b..71b3292f173 100644 --- a/cmd/xfe/XfeWidgets/Xfe/BypassShell.c +++ b/cmd/xfe/XfeWidgets/Xfe/BypassShell.c @@ -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; } diff --git a/cmd/xfe/XfeWidgets/Xfe/Cascade.c b/cmd/xfe/XfeWidgets/Xfe/Cascade.c index e468da6396b..6e90a56858e 100644 --- a/cmd/xfe/XfeWidgets/Xfe/Cascade.c +++ b/cmd/xfe/XfeWidgets/Xfe/Cascade.c @@ -175,7 +175,7 @@ static XtResource resources[] = sizeof(int), XtOffsetOf(XfeCascadeRec , xfe_cascade . mapping_delay), XmRImmediate, - (XtPointer) XfeDEFAULT_MAPPING_DELAY + (XtPointer) 250 }, { XmNsubMenuId, diff --git a/cmd/xfe/XfeWidgets/Xfe/Defaults.h b/cmd/xfe/XfeWidgets/Xfe/Defaults.h deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/cmd/xfe/XfeWidgets/Xfe/Find.h b/cmd/xfe/XfeWidgets/Xfe/Find.h index 9911b64b497..93f709a0091 100644 --- a/cmd/xfe/XfeWidgets/Xfe/Find.h +++ b/cmd/xfe/XfeWidgets/Xfe/Find.h @@ -28,7 +28,6 @@ #define _XfeFind_h_ #include /* Motif public defs */ -#include /* Xfe default res vals */ #include /* Assert */ diff --git a/cmd/xfe/XfeWidgets/Xfe/Logo.c b/cmd/xfe/XfeWidgets/Xfe/Logo.c index 9298a0eab64..5da85cbab47 100644 --- a/cmd/xfe/XfeWidgets/Xfe/Logo.c +++ b/cmd/xfe/XfeWidgets/Xfe/Logo.c @@ -104,7 +104,7 @@ static XtResource resources[] = sizeof(int), XtOffsetOf(XfeLogoRec , xfe_logo . animation_interval), XmRImmediate, - (XtPointer) XfeDEFAULT_ANIMATION_INTERVAL + (XtPointer) 100 }, { XmNanimationRunning, diff --git a/cmd/xfe/XfeWidgets/Xfe/Makefile b/cmd/xfe/XfeWidgets/Xfe/Makefile index 2c186e0741f..dabd18da176 100644 --- a/cmd/xfe/XfeWidgets/Xfe/Makefile +++ b/cmd/xfe/XfeWidgets/Xfe/Makefile @@ -128,7 +128,6 @@ EXPORTS = \ ClientData.h \ Converters.h \ Debug.h \ - Defaults.h \ DialogUtil.h \ Divider.h \ DividerP.h \ diff --git a/cmd/xfe/XfeWidgets/Xfe/Makefile.in b/cmd/xfe/XfeWidgets/Xfe/Makefile.in index 0bee8a674db..2c6f09e1d16 100644 --- a/cmd/xfe/XfeWidgets/Xfe/Makefile.in +++ b/cmd/xfe/XfeWidgets/Xfe/Makefile.in @@ -133,7 +133,6 @@ EXPORTS = \ ClientData.h \ Converters.h \ Debug.h \ - Defaults.h \ DialogUtil.h \ Divider.h \ DividerP.h \ diff --git a/cmd/xfe/XfeWidgets/Xfe/Manager.c b/cmd/xfe/XfeWidgets/Xfe/Manager.c index 884372b8b3a..e357171a222 100644 --- a/cmd/xfe/XfeWidgets/Xfe/Manager.c +++ b/cmd/xfe/XfeWidgets/Xfe/Manager.c @@ -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; } diff --git a/cmd/xfe/XfeWidgets/Xfe/Primitive.c b/cmd/xfe/XfeWidgets/Xfe/Primitive.c index 1850f4c7dba..54a60808cc9 100644 --- a/cmd/xfe/XfeWidgets/Xfe/Primitive.c +++ b/cmd/xfe/XfeWidgets/Xfe/Primitive.c @@ -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; } diff --git a/cmd/xfe/XfeWidgets/Xfe/PrimitiveP.h b/cmd/xfe/XfeWidgets/Xfe/PrimitiveP.h index 9d6fa5248a3..60dc7a8642f 100644 --- a/cmd/xfe/XfeWidgets/Xfe/PrimitiveP.h +++ b/cmd/xfe/XfeWidgets/Xfe/PrimitiveP.h @@ -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 diff --git a/cmd/xfe/XfeWidgets/Xfe/ProgressBar.c b/cmd/xfe/XfeWidgets/Xfe/ProgressBar.c index fda61c381af..c751fe55719 100644 --- a/cmd/xfe/XfeWidgets/Xfe/ProgressBar.c +++ b/cmd/xfe/XfeWidgets/Xfe/ProgressBar.c @@ -123,7 +123,7 @@ static XtResource resources[] = sizeof(int), XtOffsetOf(XfeProgressBarRec , xfe_progress_bar . cylon_interval), XmRImmediate, - (XtPointer) XfeDEFAULT_CYLON_INTERVAL + (XtPointer) 100 }, { XmNcylonOffset, diff --git a/cmd/xfe/XfeWidgets/Xfe/Xfe.h b/cmd/xfe/XfeWidgets/Xfe/Xfe.h index 469c64357ec..3012cbe07ea 100644 --- a/cmd/xfe/XfeWidgets/Xfe/Xfe.h +++ b/cmd/xfe/XfeWidgets/Xfe/Xfe.h @@ -36,7 +36,6 @@ /* so many headers. The convenient organization is worth the penalty. */ /* */ /*----------------------------------------------------------------------*/ -#include /* Xfe default res vals */ #include /* Children utils */ #include /* Converters */ #include /* Dialog utils */ diff --git a/cmd/xfe/XfeWidgets/XfeComboBox/ComboBox.c b/cmd/xfe/XfeWidgets/XfeComboBox/ComboBox.c index 32df777ed2e..bd7db4e9318 100644 --- a/cmd/xfe/XfeWidgets/XfeComboBox/ComboBox.c +++ b/cmd/xfe/XfeWidgets/XfeComboBox/ComboBox.c @@ -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 */ diff --git a/cmd/xfe/XfeWidgets/XfeComboBox/FancyBox.c b/cmd/xfe/XfeWidgets/XfeComboBox/FancyBox.c index fe4111e947d..13231e3e5f5 100644 --- a/cmd/xfe/XfeWidgets/XfeComboBox/FancyBox.c +++ b/cmd/xfe/XfeWidgets/XfeComboBox/FancyBox.c @@ -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 */ diff --git a/cmd/xfe/XfeWidgets/XfeToolBar/ToolBox.c b/cmd/xfe/XfeWidgets/XfeToolBar/ToolBox.c index d37499ca55c..a3c2c6a58fc 100644 --- a/cmd/xfe/XfeWidgets/XfeToolBar/ToolBox.c +++ b/cmd/xfe/XfeWidgets/XfeToolBar/ToolBox.c @@ -334,7 +334,7 @@ static XtResource resources[] = sizeof(Widget), XtOffsetOf(XfeToolBoxRec , xfe_tool_box . drag_cursor), XmRString, - XfeDEFAULT_TOOL_BOX_DRAG_CURSOR + "hand2" }, { XmNdragButton,