module CanBeCasted where { import Graphics.UI.Gtk ; import Graphics.UI.Gtk.Types ; class ( GObjectClass g ) => CanBeCasted g where { glibCast :: ( GObjectClass o ) => o -> Maybe g ; glibCast a = if isA a t then Just ( c a ) else Nothing where { ( t , c ) = castData } ; castData :: ( GObjectClass g1 ) => ( GType , g1 -> g ) } ; instance CanBeCasted AboutDialog where { castData = ( gTypeAboutDialog , castToAboutDialog ) } ; instance CanBeCasted AccelLabel where { castData = ( gTypeAccelLabel , castToAccelLabel ) } ; instance CanBeCasted Action where { castData = ( gTypeAction , castToAction ) } ; instance CanBeCasted ActionGroup where { castData = ( gTypeActionGroup , castToActionGroup ) } ; -- instance CanBeCasted Adapter where { -- castData = ( gTypeAdapter , castToAdapter ) -- } ; instance CanBeCasted Adjustment where { castData = ( gTypeAdjustment , castToAdjustment ) } ; instance CanBeCasted Alignment where { castData = ( gTypeAlignment , castToAlignment ) } ; instance CanBeCasted Arrow where { castData = ( gTypeArrow , castToArrow ) } ; instance CanBeCasted AspectFrame where { castData = ( gTypeAspectFrame , castToAspectFrame ) } ; -- instance CanBeCasted BaseSink where { -- castData = ( gTypeBaseSink , castToBaseSink ) -- } ; -- instance CanBeCasted BaseSrc where { -- castData = ( gTypeBaseSrc , castToBaseSrc ) -- } ; -- instance CanBeCasted BaseTransform where { -- castData = ( gTypeBaseTransform , castToBaseTransform ) -- } ; instance CanBeCasted Bin where { castData = ( gTypeBin , castToBin ) } ; instance CanBeCasted Box where { castData = ( gTypeBox , castToBox ) } ; -- instance CanBeCasted Buffer where { -- castData = ( gTypeBuffer , castToBuffer ) -- } ; -- instance CanBeCasted Bus where { -- castData = ( gTypeBus , castToBus ) -- } ; instance CanBeCasted Button where { castData = ( gTypeButton , castToButton ) } ; instance CanBeCasted ButtonBox where { castData = ( gTypeButtonBox , castToButtonBox ) } ; instance CanBeCasted Calendar where { castData = ( gTypeCalendar , castToCalendar ) } ; instance CanBeCasted CellRenderer where { castData = ( gTypeCellRenderer , castToCellRenderer ) } ; instance CanBeCasted CellRendererCombo where { castData = ( gTypeCellRendererCombo , castToCellRendererCombo ) } ; instance CanBeCasted CellRendererPixbuf where { castData = ( gTypeCellRendererPixbuf , castToCellRendererPixbuf ) } ; instance CanBeCasted CellRendererProgress where { castData = ( gTypeCellRendererProgress , castToCellRendererProgress ) } ; instance CanBeCasted CellRendererText where { castData = ( gTypeCellRendererText , castToCellRendererText ) } ; instance CanBeCasted CellRendererToggle where { castData = ( gTypeCellRendererToggle , castToCellRendererToggle ) } ; instance CanBeCasted CellView where { castData = ( gTypeCellView , castToCellView ) } ; instance CanBeCasted CheckButton where { castData = ( gTypeCheckButton , castToCheckButton ) } ; instance CanBeCasted CheckMenuItem where { castData = ( gTypeCheckMenuItem , castToCheckMenuItem ) } ; instance CanBeCasted Clipboard where { castData = ( gTypeClipboard , castToClipboard ) } ; -- instance CanBeCasted Clock where { -- castData = ( gTypeClock , castToClock ) -- } ; instance CanBeCasted ColorButton where { castData = ( gTypeColorButton , castToColorButton ) } ; instance CanBeCasted ColorSelection where { castData = ( gTypeColorSelection , castToColorSelection ) } ; instance CanBeCasted ColorSelectionDialog where { castData = ( gTypeColorSelectionDialog , castToColorSelectionDialog ) } ; instance CanBeCasted Combo where { castData = ( gTypeCombo , castToCombo ) } ; instance CanBeCasted ComboBox where { castData = ( gTypeComboBox , castToComboBox ) } ; instance CanBeCasted ComboBoxEntry where { castData = ( gTypeComboBoxEntry , castToComboBoxEntry ) } ; instance CanBeCasted Container where { castData = ( gTypeContainer , castToContainer ) } ; instance CanBeCasted Dialog where { castData = ( gTypeDialog , castToDialog ) } ; instance CanBeCasted DragContext where { castData = ( gTypeDragContext , castToDragContext ) } ; instance CanBeCasted DrawWindow where { castData = ( gTypeDrawWindow , castToDrawWindow ) } ; instance CanBeCasted Drawable where { castData = ( gTypeDrawable , castToDrawable ) } ; instance CanBeCasted DrawingArea where { castData = ( gTypeDrawingArea , castToDrawingArea ) } ; -- instance CanBeCasted Drive where { -- castData = ( gTypeDrive , castToDrive ) -- } ; instance CanBeCasted Editable where { castData = ( gTypeEditable , castToEditable ) } ; -- instance CanBeCasted Element where { -- castData = ( gTypeElement , castToElement ) -- } ; -- instance CanBeCasted ElementFactory where { -- castData = ( gTypeElementFactory , castToElementFactory ) -- } ; instance CanBeCasted Entry where { castData = ( gTypeEntry , castToEntry ) } ; instance CanBeCasted EntryCompletion where { castData = ( gTypeEntryCompletion , castToEntryCompletion ) } ; instance CanBeCasted EventBox where { castData = ( gTypeEventBox , castToEventBox ) } ; instance CanBeCasted Expander where { castData = ( gTypeExpander , castToExpander ) } ; instance CanBeCasted FileChooser where { castData = ( gTypeFileChooser , castToFileChooser ) } ; instance CanBeCasted FileChooserButton where { castData = ( gTypeFileChooserButton , castToFileChooserButton ) } ; instance CanBeCasted FileChooserDialog where { castData = ( gTypeFileChooserDialog , castToFileChooserDialog ) } ; instance CanBeCasted FileChooserWidget where { castData = ( gTypeFileChooserWidget , castToFileChooserWidget ) } ; instance CanBeCasted FileFilter where { castData = ( gTypeFileFilter , castToFileFilter ) } ; instance CanBeCasted FileSelection where { castData = ( gTypeFileSelection , castToFileSelection ) } ; instance CanBeCasted Fixed where { castData = ( gTypeFixed , castToFixed ) } ; instance CanBeCasted FontButton where { castData = ( gTypeFontButton , castToFontButton ) } ; instance CanBeCasted FontSelection where { castData = ( gTypeFontSelection , castToFontSelection ) } ; instance CanBeCasted FontSelectionDialog where { castData = ( gTypeFontSelectionDialog , castToFontSelectionDialog ) } ; instance CanBeCasted Frame where { castData = ( gTypeFrame , castToFrame ) } ; instance CanBeCasted GC where { castData = ( gTypeGC , castToGC ) } ; -- instance CanBeCasted GLConfig where { -- castData = ( gTypeGLConfig , castToGLConfig ) -- } ; -- instance CanBeCasted GLContext where { -- castData = ( gTypeGLContext , castToGLContext ) -- } ; -- instance CanBeCasted GLDrawable where { -- castData = ( gTypeGLDrawable , castToGLDrawable ) -- } ; -- instance CanBeCasted GLPixmap where { -- castData = ( gTypeGLPixmap , castToGLPixmap ) -- } ; -- instance CanBeCasted GLWindow where { -- castData = ( gTypeGLWindow , castToGLWindow ) -- } ; -- instance CanBeCasted GhostPad where { -- castData = ( gTypeGhostPad , castToGhostPad ) -- } ; instance CanBeCasted HBox where { castData = ( gTypeHBox , castToHBox ) } ; instance CanBeCasted HButtonBox where { castData = ( gTypeHButtonBox , castToHButtonBox ) } ; instance CanBeCasted HPaned where { castData = ( gTypeHPaned , castToHPaned ) } ; instance CanBeCasted HScale where { castData = ( gTypeHScale , castToHScale ) } ; instance CanBeCasted HScrollbar where { castData = ( gTypeHScrollbar , castToHScrollbar ) } ; instance CanBeCasted HSeparator where { castData = ( gTypeHSeparator , castToHSeparator ) } ; instance CanBeCasted HandleBox where { castData = ( gTypeHandleBox , castToHandleBox ) } ; instance CanBeCasted IconFactory where { castData = ( gTypeIconFactory , castToIconFactory ) } ; instance CanBeCasted IconView where { castData = ( gTypeIconView , castToIconView ) } ; instance CanBeCasted Image where { castData = ( gTypeImage , castToImage ) } ; instance CanBeCasted ImageMenuItem where { castData = ( gTypeImageMenuItem , castToImageMenuItem ) } ; -- instance CanBeCasted ImplementsInterface where { -- castData = ( gTypeImplementsInterface , castToImplementsInterface ) -- } ; -- instance CanBeCasted Index where { -- castData = ( gTypeIndex , castToIndex ) -- } ; -- instance CanBeCasted IndexFactory where { -- castData = ( gTypeIndexFactory , castToIndexFactory ) -- } ; instance CanBeCasted Label where { castData = ( gTypeLabel , castToLabel ) } ; instance CanBeCasted Layout where { castData = ( gTypeLayout , castToLayout ) } ; instance CanBeCasted Menu where { castData = ( gTypeMenu , castToMenu ) } ; instance CanBeCasted MenuBar where { castData = ( gTypeMenuBar , castToMenuBar ) } ; instance CanBeCasted MenuItem where { castData = ( gTypeMenuItem , castToMenuItem ) } ; instance CanBeCasted MenuShell where { castData = ( gTypeMenuShell , castToMenuShell ) } ; instance CanBeCasted MenuToolButton where { castData = ( gTypeMenuToolButton , castToMenuToolButton ) } ; -- instance CanBeCasted Message where { -- castData = ( gTypeMessage , castToMessage ) -- } ; instance CanBeCasted MessageDialog where { castData = ( gTypeMessageDialog , castToMessageDialog ) } ; -- instance CanBeCasted MiniObject where { -- castData = ( gTypeMiniObject , castToMiniObject ) -- } ; instance CanBeCasted Misc where { castData = ( gTypeMisc , castToMisc ) } ; instance CanBeCasted Notebook where { castData = ( gTypeNotebook , castToNotebook ) } ; instance CanBeCasted Object where { castData = ( gTypeObject , castToObject ) } ; instance CanBeCasted OptionMenu where { castData = ( gTypeOptionMenu , castToOptionMenu ) } ; -- instance CanBeCasted Pad where { -- castData = ( gTypePad , castToPad ) -- } ; -- instance CanBeCasted PadTemplate where { -- castData = ( gTypePadTemplate , castToPadTemplate ) -- } ; instance CanBeCasted Paned where { castData = ( gTypePaned , castToPaned ) } ; -- instance CanBeCasted Pipeline where { -- castData = ( gTypePipeline , castToPipeline ) -- } ; instance CanBeCasted Pixbuf where { castData = ( gTypePixbuf , castToPixbuf ) } ; instance CanBeCasted Plug where { castData = ( gTypePlug , castToPlug ) } ; -- instance CanBeCasted Plugin where { -- castData = ( gTypePlugin , castToPlugin ) -- } ; -- instance CanBeCasted PluginFeature where { -- castData = ( gTypePluginFeature , castToPluginFeature ) -- } ; instance CanBeCasted ProgressBar where { castData = ( gTypeProgressBar , castToProgressBar ) } ; -- instance CanBeCasted PushSrc where { -- castData = ( gTypePushSrc , castToPushSrc ) -- } ; -- instance CanBeCasted Query where { -- castData = ( gTypeQuery , castToQuery ) -- } ; instance CanBeCasted RadioAction where { castData = ( gTypeRadioAction , castToRadioAction ) } ; instance CanBeCasted RadioButton where { castData = ( gTypeRadioButton , castToRadioButton ) } ; instance CanBeCasted RadioMenuItem where { castData = ( gTypeRadioMenuItem , castToRadioMenuItem ) } ; instance CanBeCasted RadioToolButton where { castData = ( gTypeRadioToolButton , castToRadioToolButton ) } ; instance CanBeCasted Range where { castData = ( gTypeRange , castToRange ) } ; -- instance CanBeCasted Registry where { -- castData = ( gTypeRegistry , castToRegistry ) -- } ; instance CanBeCasted Scale where { castData = ( gTypeScale , castToScale ) } ; instance CanBeCasted Screen where { castData = ( gTypeScreen , castToScreen ) } ; instance CanBeCasted Scrollbar where { castData = ( gTypeScrollbar , castToScrollbar ) } ; instance CanBeCasted ScrolledWindow where { castData = ( gTypeScrolledWindow , castToScrolledWindow ) } ; instance CanBeCasted Separator where { castData = ( gTypeSeparator , castToSeparator ) } ; instance CanBeCasted SeparatorMenuItem where { castData = ( gTypeSeparatorMenuItem , castToSeparatorMenuItem ) } ; instance CanBeCasted SeparatorToolItem where { castData = ( gTypeSeparatorToolItem , castToSeparatorToolItem ) } ; instance CanBeCasted SizeGroup where { castData = ( gTypeSizeGroup , castToSizeGroup ) } ; instance CanBeCasted Socket where { castData = ( gTypeSocket , castToSocket ) } ; -- instance CanBeCasted SourceBuffer where { -- castData = ( gTypeSourceBuffer , castToSourceBuffer ) -- } ; -- instance CanBeCasted SourceLanguage where { -- castData = ( gTypeSourceLanguage , castToSourceLanguage ) -- } ; -- instance CanBeCasted SourceLanguageManager where { -- castData = ( gTypeSourceLanguageManager , castToSourceLanguageManager ) -- } ; -- instance CanBeCasted SourceMark where { -- castData = ( gTypeSourceMark , castToSourceMark ) -- } ; -- instance CanBeCasted SourceStyleScheme where { -- castData = ( gTypeSourceStyleScheme , castToSourceStyleScheme ) -- } ; -- instance CanBeCasted SourceView where { -- castData = ( gTypeSourceView , castToSourceView ) -- } ; instance CanBeCasted SpinButton where { castData = ( gTypeSpinButton , castToSpinButton ) } ; instance CanBeCasted StatusIcon where { castData = ( gTypeStatusIcon , castToStatusIcon ) } ; instance CanBeCasted Statusbar where { castData = ( gTypeStatusbar , castToStatusbar ) } ; instance CanBeCasted Style where { castData = ( gTypeStyle , castToStyle ) } ; -- instance CanBeCasted SystemClock where { -- castData = ( gTypeSystemClock , castToSystemClock ) -- } ; instance CanBeCasted Table where { castData = ( gTypeTable , castToTable ) } ; instance CanBeCasted TearoffMenuItem where { castData = ( gTypeTearoffMenuItem , castToTearoffMenuItem ) } ; instance CanBeCasted TextBuffer where { castData = ( gTypeTextBuffer , castToTextBuffer ) } ; instance CanBeCasted TextMark where { castData = ( gTypeTextMark , castToTextMark ) } ; instance CanBeCasted TextTag where { castData = ( gTypeTextTag , castToTextTag ) } ; instance CanBeCasted TextTagTable where { castData = ( gTypeTextTagTable , castToTextTagTable ) } ; instance CanBeCasted TextView where { castData = ( gTypeTextView , castToTextView ) } ; instance CanBeCasted ToggleAction where { castData = ( gTypeToggleAction , castToToggleAction ) } ; instance CanBeCasted ToggleButton where { castData = ( gTypeToggleButton , castToToggleButton ) } ; instance CanBeCasted ToggleToolButton where { castData = ( gTypeToggleToolButton , castToToggleToolButton ) } ; instance CanBeCasted ToolButton where { castData = ( gTypeToolButton , castToToolButton ) } ; instance CanBeCasted ToolItem where { castData = ( gTypeToolItem , castToToolItem ) } ; instance CanBeCasted Toolbar where { castData = ( gTypeToolbar , castToToolbar ) } ; instance CanBeCasted Tooltips where { castData = ( gTypeTooltips , castToTooltips ) } ; instance CanBeCasted TreeModel where { castData = ( gTypeTreeModel , castToTreeModel ) } ; instance CanBeCasted TreeModelSort where { castData = ( gTypeTreeModelSort , castToTreeModelSort ) } ; instance CanBeCasted TreeSelection where { castData = ( gTypeTreeSelection , castToTreeSelection ) } ; instance CanBeCasted TreeSortable where { castData = ( gTypeTreeSortable , castToTreeSortable ) } ; instance CanBeCasted TreeView where { castData = ( gTypeTreeView , castToTreeView ) } ; instance CanBeCasted TreeViewColumn where { castData = ( gTypeTreeViewColumn , castToTreeViewColumn ) } ; instance CanBeCasted UIManager where { castData = ( gTypeUIManager , castToUIManager ) } ; instance CanBeCasted VBox where { castData = ( gTypeVBox , castToVBox ) } ; instance CanBeCasted VButtonBox where { castData = ( gTypeVButtonBox , castToVButtonBox ) } ; instance CanBeCasted VPaned where { castData = ( gTypeVPaned , castToVPaned ) } ; instance CanBeCasted VScale where { castData = ( gTypeVScale , castToVScale ) } ; instance CanBeCasted VScrollbar where { castData = ( gTypeVScrollbar , castToVScrollbar ) } ; instance CanBeCasted VSeparator where { castData = ( gTypeVSeparator , castToVSeparator ) } ; instance CanBeCasted Viewport where { castData = ( gTypeViewport , castToViewport ) } ; -- instance CanBeCasted Volume where { -- castData = ( gTypeVolume , castToVolume ) -- } ; instance CanBeCasted Widget where { castData = ( gTypeWidget , castToWidget ) } ; instance CanBeCasted Window where { castData = ( gTypeWindow , castToWindow ) } ; instance CanBeCasted WindowGroup where { castData = ( gTypeWindowGroup , castToWindowGroup ) } }