Motifのウィジェットクラス階層

私が触り始めたのがそのバージョンからということで、 本稿で対象としているのはMotif 2.1.xです。

Xtイントリンシクス

以下のクラスについてはMotifではなくイントリンシクスで提供されるものです。 参考のために挙げてあります。

Xtイントリンシクスのクラス階層
ウィジェットクラス継承クラスCヘッダファイル
RectObjなしX11/RectObj.h
CoreRectObjX11/Core.h
CompositeCoreX11/Composite.h
ConstraintCompositeX11/Constraint.h
ShellCompositeX11/Shell.h
OverrideShellShellX11/Shell.h
WMShellShellX11/Shell.h
VendorShellWMShellX11/Shell.h
TransientVendorShellX11/Vendor.h
TopLevelShellVendorShellX11/Shell.h
ApplicationShellTopLevelShellX11/Shell.h
SessionShellApplicationShellX11/Shell.h

Motif シェル ウィジェット

シェルはウィンドウマネージャ(WM;Window Manager)と 通信する上で重要な役目のあるウィジェットです。

Motif シェル
ウィジェットクラス継承クラスCヘッダファイル
VendorShellWMShellXm/VendorS.h
XmGrabShellVendorShellXm/GrabShell.h
XmDialogShellTransientShellXm/DialogS.h
XmMenuShellOverrideShellXm/MenuS.h
XmPrintShellApplicationShellXm/Print.h

その目的のために用意されているから、ある意味当然なのですが、 Motifでは独自のVendorShellが利用されます。 具体的にはこれに X Input Method のためのフックのコードが含まれているみたいです。

プリミティブ ウィジェット

プリミティブはそれ自体でGUI(Graphical User Interface)を提供する部品です。 XmPrimitiveはMotifの都合でCoreのラッパーとして用意したものでしょうか。

Motif プリミティブ
ウィジェットクラス継承クラスCヘッダファイル
XmPrimitiveCoreXm/Primitive.h
XmArrowButtonXmPrimitiveXm/ArrowB.h
XmLabelXmPrimitiveXm/Label.h
XmCascadeButtonXmLabelXm/CascadeB.h
XmDrawnButtonXmLabelXm/DrawnB.h
XmPushButtonXmLabelXm/PushB.h
XmToggleButtonXmLabelXm/ToggleB.h
XmListXmPrimitiveXm/List.h
XmSashXmPrimitiveなし
XmScrollBarXmPrimitiveXm/ScrollBar.h
XmSeparatorXmPrimitiveXm/Separator.h
XmTextXmPrimitiveXm/Text.h
XmTextFieldXmPrimitiveXm/TextF.h

XmSashはXmPanedWindowの内部で利用されているウィジェットなので、 これを生成、操作するためのAPIは存在しません。

ガジェット

ガジェットはXサーバ側のリソースをなるべく消費しないように工夫された (代わりにわクライアント側が必要になりますが…) 対応するプリミティブに代わるウィジェットです。

Motif ガジェット
ウィジェットクラス継承クラスCヘッダファイル
XmGadgetRectObjXm/Gadget.h
XmArrowButtonGadgetXmGadgetXm/ArrowBG.h
XmLabelGadgetXmGadgetXm/LabelG.h
XmCascadeButtonGadgetXmLabelGadgetXm/CascadeBG.h
XmPushButtonGadgetXmLabelGadgetXm/PushBG.h
XmToggleButtonGadgetXmLabelGadgetXm/ToggleBG.h
XmSeparatorGadgetXmGadgetXm/SeparatoG.h
XmIconGadgetXmGadgetXm/IconG.h
XmIconHeaderXmIconGadgetXm/IconH.h

マネージャ ウィジェット

マネージャはそれぞれのポリシーでプリミティブの配置を管理するウィジェットです。

Athenaと違って、MotifではXmManagerをコンストレイントのサブクラスとし、 さらに全てのマネージャをXmManagerのサブクラスとする形で実装されています。 プリミティブと同様コンストレイントのラッパーとして捉えて差し支えないと思います。

Motif マネージャ
ウィジェットクラス継承クラスCヘッダファイル
XmManagerConstraintXm/Manager.h
XmDrawingAreaXmManagerXm/DrawingA.h
XmClipWindowXmDrawingAreaなし
XmFrameXmManagerXm/Frame.h
XmPanedWindowXmManagerXm/PanedW.h
XmRowColumnXmManagerXm/RowColumn.h
XmScaleXmManagerXm/Scale.h
XmScrolledWindowXmManagerXm/ScrolledW.h
XmMainWindowXmScrolledWindowXm/MainW.h
XmComboBoxXmManagerXm/ComboBox.h
XmContainerXmManagerXm/Container.h
XmNotebookXmManagerXm/Notebook.h
XmSpinBoxXmManagerXm/SpinB.h
XmSimpleSpinBoxXmSpinBoxXm/SSpinB.h
XmBulletinBoardXmManagerXm/BulletinB.h
XmFormXmBulletinBoardXm/Form.h
XmMessageBoxXmBulletinBoardXm/MessageB.h
XmSelectionBoxXmBulletinBoardXm/SelectionB.h
XmCommandXmSelectionBoxXm/Command.h
XmFileSelectionBoxXmSelectionBoxXm/FileSB.h

XmClipWindow の存在は無視できないのですが、 通常 XmScrolledWindow の内部で自動的に生成、利用されているので 普段は気にすることはないでしょう。

Motif生成関数とクラスの早見表

ヘッダファイルを見ながら作りました。 おかげでUILを使う上で困らないぐらい覚えられました。 なにせ XmCreateYYYY に対応する形でUILで指示するクラス名が存在するのですから。

基本的に目視によるものなので(さすがに切り貼りはテキストエディタで行ないましたが…) 苦労しました。 もしかしたら抜けているところがあるかも知れません。

Motif生成関数と対応するクラス
生成関数ウィジェットクラス名クラスヘッダファイル
XmCreateArrowButtonXmArrowButtonxmArrowButtonWidgetClassArrowB.h
XmCreateArrowButtonXmArrowButtonxmArrowButtonWidgetClassArrowB.h
XmCreateArrowButtonGadgetXmArrowButtonGadgetxmArrowButtonGadgetClassArrowBG.h
XmCreateBulletinBoardXmBulletinBoardxmBulletinBoardWidgetClassBulletinB.h
XmCreateBulletinBoardDialogXmBulletinBoardxmBulletinBoardWidgetClassBulletinB.h
XmCreateCascadeButtonXmCascadeButtonxmCascadeButtonWidgetClassCascadeB.h
XmCreateCascadeButtonGadgetXmCascadeButtonGadgetxmCascadeButtonGadgetClassCascadeBG.h
XmCreateComboBoxXmComboBoxxmComboBoxWidgetClassComboBox.h
XmCreateDropDownComboBoxXmComboBoxxmComboBoxWidgetClassComboBox.h
XmCreateDropDownListXmComboBoxxmComboBoxWidgetClassComboBox.h
XmCreateCommandXmCommandxmCommandWidgetClassCommand.h
XmCreateCommandDialogXmCommandxmCommandWidgetClassCommand.h
XmCreateContainerXmContainerxmContainerWidgetClassContainer.h
XmCreateDialogShellXmDialogShellxmDialogShellWidgetClassDialogS.h
XmDisplayxmDisplayClassDisplay.h
XmDragContextxmDragContextClassDragC.h
XmCreateDragIconXmDragIconxmDragIconObjectClassDragIcon.h
xmDragOverShellWidgetClassDragOverS.h
XmCreateDrawingAreaXmDrawingAreaxmDrawingAreaWidgetClassDrawingA.h
XmCreateDrawnButtonXmDrawnButtonxmDrawnButtonWidgetClassDrawnB.h
XmDropSitexmDropSiteManagerObjectClassDropSMgr.h
XmDropTransferxmDropTransferObjectClassDropTrans.h
XmCreateFileSelectionBoxXmFileSelectionBoxxmFileSelectionBoxWidgetClassFileSB.h
XmCreateFileSelectionDialogXmFileSelectionBoxxmFileSelectionBoxWidgetClassFileSB.h
XmCreateFormXmFormxmFormWidgetClassForm.h
XmCreateFormDialogXmFormxmFormWidgetClassForm.h
XmCreateFrameXmFramexmFrameWidgetClassFrame.h
XmGadgetxmGadgetClassGadget.h
xmGrabShellWidgetClassGrabShell.h
XmCreateIconGadgetXmIconGadgetxmIconGadgetClassIconG.h
xmIconHeaderClassIconH.h
XmCreateLabelXmLabelxmLabelWidgetClassLabel.h
XmCreateLabelGadgetXmLabelGadgetxmLabelGadgetClassLabelG.h
XmCreateListXmListxmListWidgetClassList.h
XmCreateScrolledListXmListxmListWidgetClassList.h
XmCreateMainWindowXmMainWindowxmMainWindowWidgetClassMainW.h
XmManagerxmManagerWidgetClassManager.h
XmCreateMenuShellXmMenuShellxmMenuShellWidgetClassMenuShell.h
XmCreateMessageBoxXmMessageBoxxmMessageBoxWidgetClassMessageB.h
XmCreateErrorDialogXmMessageBoxxmMessageBoxWidgetClassMessageB.h
XmCreateInformationDialogXmMessageBoxxmMessageBoxWidgetClassMessageB.h
XmCreateMessageDialogXmMessageBoxxmMessageBoxWidgetClassMessageB.h
XmCreateQuestionDialogXmMessageBoxxmMessageBoxWidgetClassMessageB.h
XmCreateTemplateDialogXmMessageBoxxmMessageBoxWidgetClassMessageB.h
XmCreateWarningDialogXmMessageBoxxmMessageBoxWidgetClassMessageB.h
XmCreateWorkingDialogXmMessageBoxxmMessageBoxWidgetClassMessageB.h
XmCreateNotebookXmNotebookxmNotebookWidgetClassNotebook.h
XmCreatePanedWindowXmPanedWindowxmPanedWindowWidgetClassPanedW.h
XmPrimitivexmPrimitiveWidgetClassPrimitive.h
XmPrintShellxmPrintShellWidgetClassPrint.h
xmProtocolObjectClassProtocols.h
XmCreatePushButtonXmPushButtonxmPushButtonWidgetClassPushB.h
XmCreatePushButtonGadgetXmPushButtonGadgetxmPushButtonGadgetClassPushBG.h
XmCreateRowColumnXmRowColumnxmRowColumnWidgetClassRowColumn.h
XmCreateMenuBarXmRowColumnxmRowColumnWidgetClassRowColumn.h
XmCreateOptionMenuXmRowColumnxmRowColumnWidgetClassRowColumn.h
XmCreatePopupMenuXmRowColumnxmRowColumnWidgetClassRowColumn.h
XmCreatePulldownMenuXmRowColumnxmRowColumnWidgetClassRowColumn.h
XmCreateRadioBoxXmRowColumnxmRowColumnWidgetClassRowColumn.h
XmCreateSimpleCheckBoxXmRowColumnxmRowColumnWidgetClassRowColumn.h
XmCreateSimpleMenuBarXmRowColumnxmRowColumnWidgetClassRowColumn.h
XmCreateSimpleOptionMenuXmRowColumnxmRowColumnWidgetClassRowColumn.h
XmCreateSimplePopupMenuXmRowColumnxmRowColumnWidgetClassRowColumn.h
XmCreateSimplePulldownMenuXmRowColumnxmRowColumnWidgetClassRowColumn.h
XmCreateSimpleRadioBoxXmRowColumnxmRowColumnWidgetClassRowColumn.h
XmCreateWorkAreaXmRowColumnxmRowColumnWidgetClassRowColumn.h
XmCreateScaleXmScalexmScaleWidgetClassScale.h
XmScreenxmScreenClassScreen.h
XmCreateScrollBarXmScrollBarxmScrollBarWidgetClassScrollBar.h
XmCreateScrolledWindowXmScrolledWindowxmScrolledWindowWidgetClassScrolledW.h
XmCreateSelectionBoxXmSelectionBoxxmSelectionBoxWidgetClassSelectioB.h
XmCreateSelectionDialogXmSelectionBoxxmSelectionBoxWidgetClassSelectioB.h
XmCreatePromptDialogXmSelectionBoxxmSelectionBoxWidgetClassSelectioB.h
XmCreateSeparatorGadgetXmSeparatorGadgetxmSeparatorGadgetClassSeparatoG.h
XmCreateSeparatorXmSeparatorxmSeparatorWidgetClassSeparator.h
XmCreateSpinBoxXmSpinBoxxmSpinBoxWidgetClassSpinB.h
XmCreateSimpleSpinBoxXmSimpleSpinBoxxmSimpleSpinBoxWidgetClassSSpinB.h
XmCreateTextXmTextxmTextWidgetClassText.h
XmCreateScrolledTextXmTextxmTextWidgetClassText.h
XmCreateTextFieldXmTextFieldxmTextFieldWidgetClassTextF.h
XmCreateToggleButtonXmToggleButtonxmToggleButtonWidgetClassToggleB.h
XmCreateToggleButtonGadgetXmToggleButtonGadgetxmToggleButtonGadgetClassToggleBG.h
vendorShellWidgetClassVendorS.h

参考サイト

The OSF/Motif Widget Class Hierarchy
Motifの世界では有名なKenton Leeさんの資料です。
Motif 2.1 Data Sheet
1997年2月に公開されたものです。