diff --git a/cmd/xfe/XfeWidgets/Makefile b/cmd/xfe/XfeWidgets/Makefile index bc2c364b10be..29c4b487208c 100644 --- a/cmd/xfe/XfeWidgets/Makefile +++ b/cmd/xfe/XfeWidgets/Makefile @@ -33,9 +33,16 @@ TEST_DIRS = \ $(NULL) endif +ifdef eXFE_WIDGETS_BUILD_UNUSED +UNUSED_DIRS = \ + XfeComboBox \ + $(NULL) +endif + DIRS = \ Xfe \ XfeBm \ + $(UNUSED_DIRS) \ $(TEST_DIRS) include $(DEPTH)/config/rules.mk diff --git a/cmd/xfe/XfeWidgets/Xfe/Defaults.h b/cmd/xfe/XfeWidgets/Xfe/Defaults.h index 44919f18a14c..d70b7edf6ccc 100644 --- a/cmd/xfe/XfeWidgets/Xfe/Defaults.h +++ b/cmd/xfe/XfeWidgets/Xfe/Defaults.h @@ -31,10 +31,6 @@ #define XfeDEFAULT_ARM_OFFSET 0 #define XfeDEFAULT_BUFFER_TYPE XmBUFFER_NONE #define XfeDEFAULT_CASCADE_DELAY 250 -#define XfeDEFAULT_COMBO_BOX_LIST_MARGIN_HEIGHT 2 -#define XfeDEFAULT_COMBO_BOX_LIST_MARGIN_WIDTH 2 -#define XfeDEFAULT_COMBO_BOX_LIST_SPACING 2 -#define XfeDEFAULT_COMBO_BOX_LIST_VISIBLE_ITEM_COUNT 10 #define XfeDEFAULT_CYLON_INTERVAL 100 #define XfeDEFAULT_EMULATE_MOTIF True #define XfeDEFAULT_MAPPING_DELAY 250 diff --git a/cmd/xfe/XfeWidgets/Xfe/Makefile b/cmd/xfe/XfeWidgets/Xfe/Makefile index 315f54313632..508e70ddb25b 100644 --- a/cmd/xfe/XfeWidgets/Xfe/Makefile +++ b/cmd/xfe/XfeWidgets/Xfe/Makefile @@ -58,16 +58,10 @@ ifdef XFE_WIDGETS_BUILD_UNUSED XFE_EXTRA_DEFINES += -DXFE_WIDGETS_BUILD_UNUSED UNUSED_CSRCS = \ - ComboBox.c \ - FancyBox.c \ FontChooser.c \ $(NULL) UNUSED_EXPORTS = \ - ComboBox.h \ - ComboBoxP.h \ - FancyBox.h \ - FancyBoxP.h \ FontChooser.h \ FontChooserP.h \ $(NULL) diff --git a/cmd/xfe/XfeWidgets/Xfe/PrepareP.h b/cmd/xfe/XfeWidgets/Xfe/PrepareP.h index 8e46e96086b4..59932e463f59 100644 --- a/cmd/xfe/XfeWidgets/Xfe/PrepareP.h +++ b/cmd/xfe/XfeWidgets/Xfe/PrepareP.h @@ -69,13 +69,6 @@ #define _XFE_PREPARE_TAB_TOP_RAISED_PIXMAP XfePrepare16 #define _XFE_PREPARE_TAB_VERTICAL_RAISED_PIXMAP XfePrepare17 -/*----------------------------------------------------------------------*/ -/* */ -/* XfeComboBox - superclass = XfeManager */ -/* */ -/*----------------------------------------------------------------------*/ -#define _XFE_PREPARE_ARROW XfePrepare1 - /*----------------------------------------------------------------------*/ /* */ /* XfeToolBar - superclass = XfeOriented */ diff --git a/cmd/xfe/XfeWidgets/Xfe/RepType.c b/cmd/xfe/XfeWidgets/Xfe/RepType.c index 3fe02fdda8d0..0d18630bf0a2 100644 --- a/cmd/xfe/XfeWidgets/Xfe/RepType.c +++ b/cmd/xfe/XfeWidgets/Xfe/RepType.c @@ -167,18 +167,6 @@ RegisterLocationType(void) } /*----------------------------------------------------------------------*/ static void -RegisterComboBoxType(void) -{ - static String names[] = - { - "combo_box_editable", - "combo_box_read_only" - }; - - XmRepTypeRegister(XmRComboBoxType,names,NULL,XtNumber(names)); -} -/*----------------------------------------------------------------------*/ -static void RegisterToolScrollArrowPlacement(void) { static String names[] = @@ -318,7 +306,6 @@ XfeRegisterRepresentationTypes(void) RegisterButtonTrigger(); RegisterButtonType(); RegisterChromeChildType(); - RegisterComboBoxType(); RegisterLocationType(); RegisterPaneChildAttachment(); RegisterPaneChildType(); diff --git a/cmd/xfe/XfeWidgets/Xfe/RepType.h b/cmd/xfe/XfeWidgets/Xfe/RepType.h index b823983bfb00..4ed4e82e479e 100644 --- a/cmd/xfe/XfeWidgets/Xfe/RepType.h +++ b/cmd/xfe/XfeWidgets/Xfe/RepType.h @@ -27,7 +27,7 @@ #ifndef _XfeRepType_h_ /* start RepType.h */ #define _XfeRepType_h_ -#include /* Motif public defs */ +#include XFE_BEGIN_CPLUSPLUS_PROTECTION diff --git a/cmd/xfe/XfeWidgets/Xfe/StringDefs.h b/cmd/xfe/XfeWidgets/Xfe/StringDefs.h index be28b3acbca7..94da748ece47 100644 --- a/cmd/xfe/XfeWidgets/Xfe/StringDefs.h +++ b/cmd/xfe/XfeWidgets/Xfe/StringDefs.h @@ -96,7 +96,6 @@ #define XmNarmed "armed" #define XmNarmedPixmap "armedPixmap" #define XmNarmedPixmapMask "armedPixmapMask" -#define XmNarrow "arrow" #define XmNarrowDisplayPolicy "arrowDisplayPolicy" #define XmNarrowHeight "arrowHeight" #define XmNarrowPlacement "arrowPlacement" @@ -202,7 +201,6 @@ #define XmNleftRaisedPixmap "leftRaisedPixmap" #define XmNleftView "leftView" #define XmNlinkNode "linkNode" -#define XmNlistFontList "listFontList" #define XmNlogo "logo" #define XmNmanagedItemCount "managedItemCount" #define XmNmatchSubMenuWidth "matchSubMenuWidth" @@ -260,8 +258,6 @@ #define XmNselectionColor "selectionColor" #define XmNselectionModifiers "selectionModifiers" #define XmNseparatorThickness "separatorThickness" -#define XmNshareShell "shareShell" -#define XmNshell "shell" #define XmNshowActionButton "showActionButton" #define XmNshowDockedTaskBar "showDockedTaskBar" #define XmNshowLogo "showLogo" @@ -275,9 +271,6 @@ #define XmNtabOffset "TabOffset" #define XmNtaskBar "taskBar" #define XmNtaskBarDocked "taskBarDocked" -#define XmNtitleFontList "titleFontList" -#define XmNtitleShadowThickness "titleShadowThickness" -#define XmNtitleShadowType "titleShadowType" #define XmNtoggleBehavior "toggleBehavior" #define XmNtoolBar "toolBar" #define XmNtoolBarPosition "toolBarPosition" @@ -407,7 +400,6 @@ #define XmCLeftPixmap "LeftPixmap" #define XmCLeftRaisedPixmap "LeftRaisedPixmap" #define XmCLinkNode "LinkNode" -#define XmCListFontList "ListFontList" #define XmCMatchSubMenuWidth "MatchSubMenuWidth" #define XmCMaxNumColumns "MaxNumColumns" #define XmCMaxNumRows "MaxNumRows" @@ -449,7 +441,6 @@ #define XmCSelectionColor "SelectionColor" #define XmCSelectionModifiers "SelectionModifiers" #define XmCSeparatorThickness "SeparatorThickness" -#define XmCShareShell "ShareShell" #define XmCShowActionButton "ShowActionButton" #define XmCShowDockedTaskBar "ShowDockedTaskBar" #define XmCShowLogo "ShowLogo" @@ -459,7 +450,6 @@ #define XmCSubMenuLocation "SubMenuLocation" #define XmCSwapThreshold "SwapThreshold" #define XmCTaskBarDocked "TaskBarDocked" -#define XmCTitleFontList "TitleFontList" #define XmCToggleBehavior "ToggleBehavior" #define XmCToolBarPosition "ToolBarPosition" #define XmCToolBarSelectionPolicy "ToolBarSelectionPolicy" @@ -517,18 +507,6 @@ /*----------------------------------------------------------------------*/ #if XmVersion < 2000 #define XmNdragStartCallback "dragStartCallback" -#define XmNcomboBoxType "comboBoxType" -#define XmCComboBoxType "ComboBoxType" -#define XmRComboBoxType "ComboBoxType" -#endif - -/*----------------------------------------------------------------------*/ -/* */ -/* Things that conflict elsewhere */ -/* */ -/*----------------------------------------------------------------------*/ -#ifndef XmNlist -#define XmNlist "list" #endif #endif /* end StringDefs.h */ diff --git a/cmd/xfe/XfeWidgets/Xfe/Translations.c b/cmd/xfe/XfeWidgets/Xfe/Translations.c index 877e0828e6d1..5a8dd81075ac 100644 --- a/cmd/xfe/XfeWidgets/Xfe/Translations.c +++ b/cmd/xfe/XfeWidgets/Xfe/Translations.c @@ -116,37 +116,6 @@ c: Focus()\n\ : Btn3Down()\n\ : Btn3Up()"; -/*----------------------------------------------------------------------*/ -/* */ -/* XfeComboBox translations. */ -/* */ -/*----------------------------------------------------------------------*/ -/* extern */ char _XfeComboBoxTextEditableTranslations[] ="\ -~c s ~m ~a : extend-start()\n\ -c ~s ~m ~a : move-destination()\n\ -~c ~s ~m ~a : grab-focus()\n\ -~c ~m ~a : extend-adjust()\n\ -~c ~m ~a : extend-end()"; - -/* extern */ char _XfeComboBoxTextReadOnlyTranslations[] ="\ -~c ~s ~m ~a : grab-focus() Popup()\n\ -~c ~m ~a : \n\ -~c ~m ~a : Popdown()"; - -#if 0 -/* extern */ char _XfeComboBoxArrowTranslations[] ="\ -~c ~s ~m ~a : Highlight() Arm() Popup()\n\ -~c ~m ~a : Activate() Disarm() Popdown()"; -#else -/* extern */ char _XfeComboBoxArrowTranslations[] ="\ -~c ~s ~m ~a : Highlight() Arm() Popup()\n\ -~c ~m ~a : Activate() Disarm() Popdown()"; -#endif - -/* extern */ char _XfeComboBoxExtraTranslations[] ="\ -~c ~s ~m ~a : Highlight() Popup()\n\ -~c ~m ~a : Popdown()"; - /*----------------------------------------------------------------------*/ /* */ /* Translation / Action functions */ diff --git a/cmd/xfe/XfeWidgets/Xfe/XfeAll.h b/cmd/xfe/XfeWidgets/Xfe/XfeAll.h index fbe0882c202a..fe755174729f 100644 --- a/cmd/xfe/XfeWidgets/Xfe/XfeAll.h +++ b/cmd/xfe/XfeWidgets/Xfe/XfeAll.h @@ -51,8 +51,6 @@ #if defined(XFE_WIDGETS_BUILD_UNUSED) #include -#include -#include #include #endif /* XFE_WIDGETS_BUILD_UNUSED */ diff --git a/cmd/xfe/XfeWidgets/Xfe/XfeP.h b/cmd/xfe/XfeWidgets/Xfe/XfeP.h index a5e4297aa711..1af9fdb79034 100644 --- a/cmd/xfe/XfeWidgets/Xfe/XfeP.h +++ b/cmd/xfe/XfeWidgets/Xfe/XfeP.h @@ -373,10 +373,6 @@ extern char _XfeButtonDefaultTranslations[]; extern char _XfeButtonMotionAddTranslations[]; extern char _XfeButtonMotionRemoveTranslations[]; extern char _XfeBypassShellDefaultTranslations[]; -extern char _XfeComboBoxArrowTranslations[]; -extern char _XfeComboBoxExtraTranslations[]; -extern char _XfeComboBoxTextEditableTranslations[]; -extern char _XfeComboBoxTextReadOnlyTranslations[]; extern char _XfeLabelDefaultTranslations[]; extern char _XfePrimitiveDefaultTranslations[]; extern char _XfeToolBarExtraTranslations[]; diff --git a/cmd/xfe/XfeWidgets/Xfe/ComboBox.c b/cmd/xfe/XfeWidgets/XfeComboBox/ComboBox.c similarity index 95% rename from cmd/xfe/XfeWidgets/Xfe/ComboBox.c rename to cmd/xfe/XfeWidgets/XfeComboBox/ComboBox.c index b5c1df70d5b3..c8867b5454ca 100644 --- a/cmd/xfe/XfeWidgets/Xfe/ComboBox.c +++ b/cmd/xfe/XfeWidgets/XfeComboBox/ComboBox.c @@ -68,6 +68,7 @@ /* Core class methods */ /* */ /*----------------------------------------------------------------------*/ +static void ClassInitialize (void); static void ClassPartInit (WidgetClass); static void Initialize (Widget,Widget,ArgList,Cardinal *); static void Destroy (Widget); @@ -118,6 +119,12 @@ static Widget TitleLabelCreate (Widget); static Widget ArrowCreate (Widget); +/*----------------------------------------------------------------------*/ +/* */ +/* Rep type registration functions */ +/* */ +/*----------------------------------------------------------------------*/ +static void RegisterComboBoxType (void); /*----------------------------------------------------------------------*/ /* */ @@ -474,6 +481,37 @@ static XmSyntheticResource synthetic_resources[] = }, }; +/*----------------------------------------------------------------------*/ +/* */ +/* XfeComboBox translations. */ +/* */ +/*----------------------------------------------------------------------*/ +/* extern */ char _XfeComboBoxTextEditableTranslations[] ="\ +~c s ~m ~a : extend-start()\n\ +c ~s ~m ~a : move-destination()\n\ +~c ~s ~m ~a : grab-focus()\n\ +~c ~m ~a : extend-adjust()\n\ +~c ~m ~a : extend-end()"; + +/* extern */ char _XfeComboBoxTextReadOnlyTranslations[] ="\ +~c ~s ~m ~a : grab-focus() Popup()\n\ +~c ~m ~a : \n\ +~c ~m ~a : Popdown()"; + +#if 0 +/* extern */ char _XfeComboBoxArrowTranslations[] ="\ +~c ~s ~m ~a : Highlight() Arm() Popup()\n\ +~c ~m ~a : Activate() Disarm() Popdown()"; +#else +/* extern */ char _XfeComboBoxArrowTranslations[] ="\ +~c ~s ~m ~a : Highlight() Arm() Popup()\n\ +~c ~m ~a : Activate() Disarm() Popdown()"; +#endif + +/* extern */ char _XfeComboBoxExtraTranslations[] ="\ +~c ~s ~m ~a : Highlight() Popup()\n\ +~c ~m ~a : Popdown()"; + /*----------------------------------------------------------------------*/ /* */ /* XfeComboBox actions */ @@ -497,7 +535,7 @@ _XFE_WIDGET_CLASS_RECORD(combobox,ComboBox) = (WidgetClass) &xfeManagerClassRec, /* superclass */ "XfeComboBox", /* class_name */ sizeof(XfeComboBoxRec), /* widget_size */ - NULL, /* class_initialize */ + ClassInitialize, /* class_initialize */ ClassPartInit, /* class_part_initialize*/ FALSE, /* class_inited */ Initialize, /* initialize */ @@ -644,6 +682,13 @@ SyntheticGetListItemCount(Widget w,int offset, XtArgVal * value) /* */ /*----------------------------------------------------------------------*/ static void +ClassInitialize() +{ + /* Register XfeComboBox Representation Types */ + RegisterComboBoxType(); +} +/*----------------------------------------------------------------------*/ +static void ClassPartInit(WidgetClass wc) { XfeComboBoxWidgetClass cc = (XfeComboBoxWidgetClass) wc; @@ -1168,6 +1213,24 @@ LayoutTitle(Widget w) } /*----------------------------------------------------------------------*/ +/*----------------------------------------------------------------------*/ +/* */ +/* Rep type registration functions */ +/* */ +/*----------------------------------------------------------------------*/ +static void +RegisterComboBoxType(void) +{ + static String names[] = + { + "combo_box_editable", + "combo_box_read_only" + }; + + XmRepTypeRegister(XmRComboBoxType,names,NULL,XtNumber(names)); +} +/*----------------------------------------------------------------------*/ + /*----------------------------------------------------------------------*/ /* */ /* List functions */ diff --git a/cmd/xfe/XfeWidgets/Xfe/ComboBox.h b/cmd/xfe/XfeWidgets/XfeComboBox/ComboBox.h similarity index 86% rename from cmd/xfe/XfeWidgets/Xfe/ComboBox.h rename to cmd/xfe/XfeWidgets/XfeComboBox/ComboBox.h index 5c98f622ab14..048019b7f5d2 100644 --- a/cmd/xfe/XfeWidgets/Xfe/ComboBox.h +++ b/cmd/xfe/XfeWidgets/XfeComboBox/ComboBox.h @@ -28,9 +28,20 @@ #define _XfeComboBox_h_ #include +#include XFE_BEGIN_CPLUSPLUS_PROTECTION +/*----------------------------------------------------------------------*/ +/* */ +/* XfeComboBox reasonable defaults for some resources */ +/* */ +/*----------------------------------------------------------------------*/ +#define XfeDEFAULT_COMBO_BOX_LIST_MARGIN_HEIGHT 2 +#define XfeDEFAULT_COMBO_BOX_LIST_MARGIN_WIDTH 2 +#define XfeDEFAULT_COMBO_BOX_LIST_SPACING 2 +#define XfeDEFAULT_COMBO_BOX_LIST_VISIBLE_ITEM_COUNT 10 + /*----------------------------------------------------------------------*/ /* */ /* XmRComboBoxType */ diff --git a/cmd/xfe/XfeWidgets/Xfe/ComboBoxP.h b/cmd/xfe/XfeWidgets/XfeComboBox/ComboBoxP.h similarity index 94% rename from cmd/xfe/XfeWidgets/Xfe/ComboBoxP.h rename to cmd/xfe/XfeWidgets/XfeComboBox/ComboBoxP.h index 49bb72a31295..c1186966255e 100644 --- a/cmd/xfe/XfeWidgets/Xfe/ComboBoxP.h +++ b/cmd/xfe/XfeWidgets/XfeComboBox/ComboBoxP.h @@ -158,6 +158,15 @@ _XfeComboBoxDrawTitleShadow (Widget w, XRectangle * clip_rect); /*----------------------------------------------------------------------*/ +/*----------------------------------------------------------------------*/ +/* */ +/* XfeComboBox - superclass = XfeManager */ +/* */ +/* Component preparation macros. */ +/* */ +/*----------------------------------------------------------------------*/ +#define _XFE_PREPARE_ARROW XfePrepare1 + XFE_END_CPLUSPLUS_PROTECTION #endif /* end ComboBoxP.h */ diff --git a/cmd/xfe/XfeWidgets/XfeComboBox/ComboBoxStringDefs.h b/cmd/xfe/XfeWidgets/XfeComboBox/ComboBoxStringDefs.h new file mode 100644 index 000000000000..ac23e4cff65f --- /dev/null +++ b/cmd/xfe/XfeWidgets/XfeComboBox/ComboBoxStringDefs.h @@ -0,0 +1,79 @@ +/* -*- 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: */ +/* Description: XfeComboBox string definitions. */ +/* Author: Ramiro Estrugo */ +/* */ +/*----------------------------------------------------------------------*/ + +#ifndef _XfeComboBoxStringDefs_h_ /* start ComboBoxStringDefs.h*/ +#define _XfeComboBoxStringDefs_h_ + +/*----------------------------------------------------------------------*/ +/* */ +/* Callback Names */ +/* */ +/*----------------------------------------------------------------------*/ + +/*----------------------------------------------------------------------*/ +/* */ +/* Resource Names */ +/* */ +/*----------------------------------------------------------------------*/ +#define XmNarrow "arrow" +#define XmNlistFontList "listFontList" +#define XmNshareShell "shareShell" +#define XmNshell "shell" +#define XmNtitleShadowThickness "titleShadowThickness" +#define XmNtitleShadowType "titleShadowType" +#define XmNtitleFontList "titleFontList" + +/*----------------------------------------------------------------------*/ +/* */ +/* Class Names */ +/* */ +/*----------------------------------------------------------------------*/ +#define XmCListFontList "ListFontList" +#define XmCTitleFontList "TitleFontList" +#define XmCShareShell "ShareShell" + +/*----------------------------------------------------------------------*/ +/* */ +/* Things that conflict with Motif 2.x */ +/* */ +/*----------------------------------------------------------------------*/ +#if XmVersion < 2000 +#define XmNcomboBoxType "comboBoxType" +#define XmCComboBoxType "ComboBoxType" +#define XmRComboBoxType "ComboBoxType" +#endif + +/*----------------------------------------------------------------------*/ +/* */ +/* Things that conflict elsewhere */ +/* */ +/*----------------------------------------------------------------------*/ +#ifndef XmNlist +#define XmNlist "list" +#endif + + +#endif /* end ComboBoxStringDefs.h */ diff --git a/cmd/xfe/XfeWidgets/Xfe/FancyBox.c b/cmd/xfe/XfeWidgets/XfeComboBox/FancyBox.c similarity index 100% rename from cmd/xfe/XfeWidgets/Xfe/FancyBox.c rename to cmd/xfe/XfeWidgets/XfeComboBox/FancyBox.c diff --git a/cmd/xfe/XfeWidgets/Xfe/FancyBox.h b/cmd/xfe/XfeWidgets/XfeComboBox/FancyBox.h similarity index 100% rename from cmd/xfe/XfeWidgets/Xfe/FancyBox.h rename to cmd/xfe/XfeWidgets/XfeComboBox/FancyBox.h diff --git a/cmd/xfe/XfeWidgets/Xfe/FancyBoxP.h b/cmd/xfe/XfeWidgets/XfeComboBox/FancyBoxP.h similarity index 100% rename from cmd/xfe/XfeWidgets/Xfe/FancyBoxP.h rename to cmd/xfe/XfeWidgets/XfeComboBox/FancyBoxP.h diff --git a/cmd/xfe/XfeWidgets/XfeWidgets.mk b/cmd/xfe/XfeWidgets/XfeWidgets.mk index c7a8f5afa014..4bacd0bdbff5 100644 --- a/cmd/xfe/XfeWidgets/XfeWidgets.mk +++ b/cmd/xfe/XfeWidgets/XfeWidgets.mk @@ -185,6 +185,57 @@ else endif +## +## XfeCaption Library +## +XFE_STATIC_CAPTION_LIB = $(DIST)/lib/libXfeCaption.a +XFE_SHARED_CAPTION_LIB = $(DIST)/bin/libXfeCaption.$(DLL_SUFFIX) +XFE_CAPTION_REQUIRES = XfeCaption + +## +## XfeCaption required ? +## +ifeq ($(filter $(REQUIRES),$(XFE_CAPTION_REQUIRES)),$(XFE_CAPTION_REQUIRES)) + +XFE_SHARED_LIBS += $(XFE_SHARED_CAPTION_LIB) +XFE_STATIC_LIBS += $(XFE_STATIC_CAPTION_LIB) + +endif + +## +## XfeComboBox Library +## +XFE_STATIC_COMBO_BOX_LIB = $(DIST)/lib/libXfeComboBox.a +XFE_SHARED_COMBO_BOX_LIB = $(DIST)/bin/libXfeComboBox.$(DLL_SUFFIX) +XFE_COMBO_BOX_REQUIRES = XfeComboBox + +## +## XfeComboBox required ? +## +ifeq ($(filter $(REQUIRES),$(XFE_COMBO_BOX_REQUIRES)),$(XFE_COMBO_BOX_REQUIRES)) + +XFE_SHARED_LIBS += $(XFE_SHARED_COMBO_BOX_LIB) +XFE_STATIC_LIBS += $(XFE_STATIC_COMBO_BOX_LIB) + +endif + +## +## Xfe Pref Library +## +XFE_STATIC_PREF_LIB = $(DIST)/lib/libXfePref.a +XFE_SHARED_PREF_LIB = $(DIST)/bin/libXfePref.$(DLL_SUFFIX) +XFE_PREF_REQUIRES = XfePref + +## +## XfePref required ? +## +ifeq ($(filter $(REQUIRES),$(XFE_PREF_REQUIRES)),$(XFE_PREF_REQUIRES)) + +XFE_SHARED_LIBS += $(XFE_SHARED_PREF_LIB) +XFE_STATIC_LIBS += $(XFE_STATIC_PREF_LIB) + +endif + ## ## XfeTest required ? ## diff --git a/cmd/xfe/XfeWidgets/tests/Makefile b/cmd/xfe/XfeWidgets/tests/Makefile index 494f35f8a76d..a50b106f2f8b 100644 --- a/cmd/xfe/XfeWidgets/tests/Makefile +++ b/cmd/xfe/XfeWidgets/tests/Makefile @@ -26,9 +26,16 @@ DEPTH = ../../../.. +ifdef eXFE_WIDGETS_BUILD_UNUSED +UNUSED_DIRS = \ + XfeComboBox \ + $(NULL) +endif + DIRS = \ Xfe \ XfeBm \ - XmL + XmL \ + $(UNUSED_DIRS) include $(DEPTH)/config/rules.mk diff --git a/cmd/xfe/XfeWidgets/tests/XfeComboBox/ComboBoxTest.ad b/cmd/xfe/XfeWidgets/tests/XfeComboBox/ComboBoxTest.ad new file mode 100644 index 000000000000..33f908dbc7f4 --- /dev/null +++ b/cmd/xfe/XfeWidgets/tests/XfeComboBox/ComboBoxTest.ad @@ -0,0 +1,102 @@ +! -*- Mode: Fundamental; tab-width: 4; indent-tabs-mode: nil -*- +! +! 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. + + +ComboBoxTest*MainForm.width: 800 +ComboBoxTest*MainForm.height: 400 +ComboBoxTest*MainForm.background: Gray70 +ComboBoxTest*MainForm.shadowThickness: 0 +ComboBoxTest*MainForm.shadowType: shadow_in + +ComboBoxTest*fontList: -*-helvetica-medium-r-*-*-*-140-*-*-*-*-iso8859-* +ComboBoxTest*foreground: Black + + +!ComboBoxTest*ComboBox*spacing: 0 + +ComboBoxTest*ComboBox1.usePreferredWidth: false +ComboBoxTest*ComboBox1.leftAttachment: attach_form +ComboBoxTest*ComboBox1.rightAttachment: attach_form +ComboBoxTest*ComboBox1.topAttachment: attach_form +ComboBoxTest*ComboBox1.bottomAttachment: attach_none +ComboBoxTest*ComboBox1.leftOffset: 5 +ComboBoxTest*ComboBox1.rightOffset: 5 +ComboBoxTest*ComboBox1.topOffset: 5 +ComboBoxTest*ComboBox1.bottomOffset: 5 +ComboBoxTest*ComboBox1.shadowThickness: 1 +ComboBoxTest*ComboBox1*background: yellow + +ComboBoxTest*ComboBox2.usePreferredWidth: false +ComboBoxTest*ComboBox2.leftAttachment: attach_form +ComboBoxTest*ComboBox2.rightAttachment: attach_form +ComboBoxTest*ComboBox2.topAttachment: attach_widget +ComboBoxTest*ComboBox2.bottomAttachment: attach_none +ComboBoxTest*ComboBox2.topWidget: ComboBox1 +ComboBoxTest*ComboBox2.leftOffset: 5 +ComboBoxTest*ComboBox2.rightOffset: 5 +ComboBoxTest*ComboBox2.topOffset: 10 +ComboBoxTest*ComboBox2.bottomOffset: 5 +ComboBoxTest*ComboBox2.shadowThickness: 1 +ComboBoxTest*ComboBox2*background: green + +ComboBoxTest*ComboBox3.usePreferredWidth: false +ComboBoxTest*ComboBox3.leftAttachment: attach_form +ComboBoxTest*ComboBox3.rightAttachment: attach_form +ComboBoxTest*ComboBox3.topAttachment: attach_widget +ComboBoxTest*ComboBox3.bottomAttachment: attach_none +ComboBoxTest*ComboBox3.topWidget: ComboBox2 +ComboBoxTest*ComboBox3.leftOffset: 5 +ComboBoxTest*ComboBox3.rightOffset: 5 +ComboBoxTest*ComboBox3.topOffset: 10 +ComboBoxTest*ComboBox3.bottomOffset: 5 +!ComboBoxTest*ComboBox3.background: Gray60 +ComboBoxTest*ComboBox3*background: red + +ComboBoxTest*ComboBox4.usePreferredWidth: false +ComboBoxTest*ComboBox4.leftAttachment: attach_form +ComboBoxTest*ComboBox4.rightAttachment: attach_form +ComboBoxTest*ComboBox4.topAttachment: attach_widget +ComboBoxTest*ComboBox4.bottomAttachment: attach_none +ComboBoxTest*ComboBox4.topWidget: ComboBox3 +ComboBoxTest*ComboBox4.leftOffset: 5 +ComboBoxTest*ComboBox4.rightOffset: 5 +ComboBoxTest*ComboBox4.topOffset: 10 +ComboBoxTest*ComboBox4.bottomOffset: 5 +ComboBoxTest*ComboBox4*background: blue + +!ComboBoxTest*XfeComboBox*background: Gray65 + +!ComboBoxTest*XmList*background: red + + +!ComboBoxTest*XfeBypassShell.shadowThickness: 10 +!ComboBoxTest*XfeBypassShell.background: green + + + +ComboBoxTest*ListSW.leftAttachment: attach_form +ComboBoxTest*ListSW.rightAttachment: attach_none +ComboBoxTest*ListSW.topAttachment: attach_widget +ComboBoxTest*ListSW.bottomAttachment: attach_none +ComboBoxTest*ListSW.topWidget: ComboBox3 +ComboBoxTest*ListSW.leftOffset: 10 +ComboBoxTest*ListSW.topOffset: 100 + +ComboBoxTest*List.visibleItemCount: 8 +!ComboBoxTest*List.listMarginWidth: 5 + + diff --git a/cmd/xfe/XfeWidgets/tests/XfeComboBox/ComboBoxTest.c b/cmd/xfe/XfeWidgets/tests/XfeComboBox/ComboBoxTest.c new file mode 100644 index 000000000000..7de0f87a9ee4 --- /dev/null +++ b/cmd/xfe/XfeWidgets/tests/XfeComboBox/ComboBoxTest.c @@ -0,0 +1,244 @@ +/* -*- 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: ComboBoxTest.c */ +/* Description: Test for XfeComboBox widget. */ +/* Author: Ramiro Estrugo */ +/* */ +/*----------------------------------------------------------------------*/ + +#include +#include +#include + +#include + +static void activate_callback (Widget,XtPointer,XtPointer); +static void arm_callback (Widget,XtPointer,XtPointer); +static void disarm_callback (Widget,XtPointer,XtPointer); + +static void combo_add_items (Widget,String *,Cardinal); +static void list_add_items (Widget,String *,Cardinal); + +static String items1[] = +{ + "Item One", + "Item Two", + "Item Three", + "Item Four", + "Item Five", + "Item Six", + "Item Seven", + "Item Eight", + "Item Nine", + "Item Ten", + "Item Eleven", + "Item Twelve", +}; + +static String items2[] = +{ + "Red", + "Green", + "Blue", + "Brown", + "Orange", + "Cyan", + "Magenta", + "Black", + "White", + "Yellow" +}; + +static String items3[] = +{ + "North", + "South", + "East", + "West", + "South East", + "South West", + "North East", + "North West" +}; + +static String items4[] = +{ + "January", + "February", + "March", + "April", + "May", + "June", + "July", + "August", + "September", + "October", + "November", + "December" +}; + +#define num_items1 XtNumber(items1) +#define num_items2 XtNumber(items2) +#define num_items3 XtNumber(items3) +#define num_items4 XtNumber(items4) + +/*----------------------------------------------------------------------*/ +int +main(int argc,char *argv[]) +{ + Widget form; + Widget frame; + Widget cb[4]; + Widget icon; + Widget list; + + XfeAppCreateSimple("ComboBoxTest",&argc,argv,"MainFrame",&frame,&form); + + cb[0] = XtVaCreateManagedWidget("ComboBox1", + xfeComboBoxWidgetClass, + form, + XmNcomboBoxType,XmCOMBO_BOX_EDITABLE, + NULL); + + cb[1] = XtVaCreateManagedWidget("ComboBox2", + xfeComboBoxWidgetClass, + form, + XmNcomboBoxType,XmCOMBO_BOX_READ_ONLY, + NULL); + + cb[2] = XtVaCreateManagedWidget("ComboBox3", + xfeFancyBoxWidgetClass, + form, + XmNcomboBoxType,XmCOMBO_BOX_EDITABLE, + NULL); + + cb[3] = XtVaCreateManagedWidget("ComboBox4", + xfeFancyBoxWidgetClass, + form, + XmNcomboBoxType,XmCOMBO_BOX_READ_ONLY, + NULL); + + icon = XtVaCreateManagedWidget("IC", + xfeButtonWidgetClass, + cb[2], + XmNbackground, XfeBackground(cb[2]), + XmNforeground, XfeForeground(cb[2]), + NULL); + + assert( XfeIsAlive(icon) ); + + XtVaSetValues( + icon, + XmNpixmap, XfeGetPixmap(icon,"proxy"), + XmNpixmapMask, XfeGetMask(icon,"proxy"), + XmNraisedPixmap, XfeGetPixmap(icon,"proxy_raised"), + XmNraisedPixmapMask, XfeGetMask(icon,"proxy_raised"), + XmNbuttonLayout, XmBUTTON_PIXMAP_ONLY, + XmNfillOnEnter, False, + XmNfillOnArm, False, + XmNraiseOnEnter, True, + XmNshadowThickness, 0, + XmNraiseBorderThickness, 0, + NULL); + + + list = XmCreateScrolledList(form,"List",NULL,0); + +/* _XfeXmListAccess(list,BaseX) += 10; */ + +/* lw->list.BaseX = (Position )lw->list.margin_width + */ + + XtManageChild(list); + + combo_add_items(cb[0],items1,num_items1); + combo_add_items(cb[1],items2,num_items2); + combo_add_items(cb[2],items3,num_items3); + combo_add_items(cb[3],items4,num_items4); + + list_add_items(list,items1,num_items1); + + XtPopup(frame,XtGrabNone); + + XfeAppMainLoop(); + + return 0; +} +/*----------------------------------------------------------------------*/ +static void +combo_add_items(Widget w,String * items,Cardinal n) +{ + XmString * table = NULL; + Cardinal i; + + assert( XfeIsAlive(w) ); + assert( XfeIsComboBox(w) ); + assert( items != NULL ); + assert( n > 0 ); + + table = XfeGetXmStringTable(items,n); + + for (i = 0; i < n; i++) + { + XfeComboBoxAddItem(w,table[i],0); + } + + XfeFreeXmStringTable(table,n); +} +/*----------------------------------------------------------------------*/ +static void +list_add_items(Widget w,String * items,Cardinal n) +{ + XmString * table = NULL; + Cardinal i; + + assert( XfeIsAlive(w) ); + assert( XmIsList(w) ); + assert( items != NULL ); + assert( n > 0 ); + + table = XfeGetXmStringTable(items,n); + + for (i = 0; i < n; i++) + { + XmListAddItem(w,table[i],0); + } + + XfeFreeXmStringTable(table,n); +} +/*----------------------------------------------------------------------*/ +static void +activate_callback(Widget w,XtPointer client_data,XtPointer call_data) +{ + printf("Activate(%s)\n",XtName(w)); +} +/*----------------------------------------------------------------------*/ +static void +arm_callback(Widget w,XtPointer client_data,XtPointer call_data) +{ + printf("Arm(%s)\n",XtName(w)); +} +/*----------------------------------------------------------------------*/ +static void +disarm_callback(Widget w,XtPointer client_data,XtPointer call_data) +{ + printf("Disarm(%s)\n",XtName(w)); +} +/*----------------------------------------------------------------------*/ diff --git a/cmd/xfe/XfeWidgets/tests/XfeComboBox/Makefile b/cmd/xfe/XfeWidgets/tests/XfeComboBox/Makefile new file mode 100644 index 000000000000..e958631abcc4 --- /dev/null +++ b/cmd/xfe/XfeWidgets/tests/XfeComboBox/Makefile @@ -0,0 +1,43 @@ +#! gmake +# +# 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. + + +# + +DEPTH = ../../../../.. + +CSRCS = \ + ComboBoxTest.c \ + $(NULL) + +REQUIRES = \ + XfeTest \ + XfeComboBox \ + XfeBm \ + XfeWidgets + +STATIC_PROGS = $(addprefix $(OBJDIR)/, $(CSRCS:.c=.static)) +SHARED_PROGS = $(addprefix $(OBJDIR)/, $(CSRCS:.c=.shared)) + +include $(DEPTH)/config/rules.mk +include $(DEPTH)/cmd/xfe/XfeWidgets/XfeWidgets.mk + +all:: $(STATIC_PROGS) $(SHARED_PROGS) +install:: $(STATIC_PROGS) $(SHARED_PROGS) + +shared: $(SHARED_PROGS) +static: $(STATIC_PROGS)