You can subscribe to this list here.
2003 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(4) |
Jun
|
Jul
(68) |
Aug
(4) |
Sep
|
Oct
(23) |
Nov
(95) |
Dec
(9) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2004 |
Jan
(3) |
Feb
|
Mar
|
Apr
(51) |
May
(81) |
Jun
(2) |
Jul
(86) |
Aug
(143) |
Sep
(3) |
Oct
(31) |
Nov
(63) |
Dec
(90) |
2005 |
Jan
(277) |
Feb
(157) |
Mar
(99) |
Apr
(195) |
May
(151) |
Jun
(148) |
Jul
(98) |
Aug
(123) |
Sep
(20) |
Oct
(174) |
Nov
(155) |
Dec
(26) |
2006 |
Jan
(51) |
Feb
(19) |
Mar
(16) |
Apr
(12) |
May
(5) |
Jun
|
Jul
(11) |
Aug
(7) |
Sep
(10) |
Oct
(31) |
Nov
(174) |
Dec
(56) |
2007 |
Jan
(45) |
Feb
(52) |
Mar
(10) |
Apr
(5) |
May
(47) |
Jun
(16) |
Jul
(80) |
Aug
(29) |
Sep
(14) |
Oct
(59) |
Nov
(46) |
Dec
(16) |
2008 |
Jan
(10) |
Feb
(1) |
Mar
|
Apr
|
May
(49) |
Jun
(26) |
Jul
(8) |
Aug
(4) |
Sep
(25) |
Oct
(53) |
Nov
(9) |
Dec
(1) |
2009 |
Jan
(66) |
Feb
(11) |
Mar
(1) |
Apr
(14) |
May
(8) |
Jun
(1) |
Jul
(2) |
Aug
(2) |
Sep
(9) |
Oct
(23) |
Nov
(35) |
Dec
|
2010 |
Jan
(7) |
Feb
(2) |
Mar
(39) |
Apr
(19) |
May
(161) |
Jun
(19) |
Jul
(32) |
Aug
(65) |
Sep
(113) |
Oct
(120) |
Nov
(2) |
Dec
|
2012 |
Jan
|
Feb
(5) |
Mar
(4) |
Apr
(7) |
May
(9) |
Jun
(14) |
Jul
(1) |
Aug
|
Sep
(1) |
Oct
(1) |
Nov
(12) |
Dec
(2) |
2013 |
Jan
(1) |
Feb
(17) |
Mar
(4) |
Apr
(4) |
May
(9) |
Jun
|
Jul
(8) |
Aug
|
Sep
(2) |
Oct
|
Nov
|
Dec
|
From: Duncan C. <dun...@us...> - 2005-01-08 16:59:14
|
Update of /cvsroot/gtk2hs/gtk2hs/gconf/System/Gnome/GConf In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21749/gconf/System/Gnome/GConf Modified Files: GConfValue.chs GConfClient.chs Log Message: fixup names of imported modules. Index: GConfValue.chs =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gconf/System/Gnome/GConf/GConfValue.chs,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- GConfValue.chs 8 Dec 2004 00:08:21 -0000 1.4 +++ GConfValue.chs 8 Jan 2005 16:59:03 -0000 1.5 @@ -41,8 +41,10 @@ ) where import Monad (liftM, when) -import FFI -import GList (toGSList, readGSList) + +import System.Glib.FFI +import System.Glib.UTFString +import System.Glib.GList (toGSList, readGSList) --{# context lib="gconf" prefix ="gconf_value" #} {# context lib="gconf" #} Index: GConfClient.chs =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gconf/System/Gnome/GConf/GConfClient.chs,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- GConfClient.chs 8 Dec 2004 00:08:21 -0000 1.6 +++ GConfClient.chs 8 Jan 2005 16:59:04 -0000 1.7 @@ -88,12 +88,13 @@ import Monad (liftM, when) import Data.IORef (newIORef, readIORef, writeIORef) import System.IO.Unsafe (unsafePerformIO) -import FFI -{#import Hierarchy#} -{#import Signal#} -import GObject (makeNewGObject) -import GList -import GError (GErrorDomain, GErrorClass(..), propagateGError) + +import System.Glib.FFI +import System.Glib.UTFString +import System.Glib.GList +import System.Glib.GError (GErrorDomain, GErrorClass(..), propagateGError) +import System.Glib.GObject (makeNewGObject) +{#import Graphics.UI.Gtk.Signals#} {#import System.Gnome.GConf.GConfType#} {#import System.Gnome.GConf.GConfValue#} |
From: Duncan C. <dun...@us...> - 2005-01-08 16:59:13
|
Update of /cvsroot/gtk2hs/gtk2hs In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21749 Modified Files: ChangeLog Log Message: fixup names of imported modules. Index: ChangeLog =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/ChangeLog,v retrieving revision 1.270 retrieving revision 1.271 diff -u -d -r1.270 -r1.271 --- ChangeLog 8 Jan 2005 16:40:15 -0000 1.270 +++ ChangeLog 8 Jan 2005 16:59:02 -0000 1.271 @@ -169,6 +169,10 @@ mogul/Graphics/UI/Gtk/Mogul/WidgetTable.hs, mogul/Graphics/UI/Gtk/Mogul.hs: mogul package namespace conversion. + * gconf/System/Gnome/GConf/GConfValue.chs, + gconf/System/Gnome/GConf/GConfClient.chs: fixup names of imported + modules. + 2005-01-07 Duncan Coutts <du...@co...> * tools/apiGen/ApiGen.hs: several documentation improvements, add |
From: Duncan C. <dun...@us...> - 2005-01-08 16:42:26
|
Update of /cvsroot/gtk2hs/gtk2hs/mogul/Graphics/UI/Gtk In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17520/mogul/Graphics/UI/Gtk Added Files: Mogul.hs Log Message: mogul package namespace conversion. --- NEW FILE: Mogul.hs --- {-# OPTIONS -cpp #-} -- -*-haskell-*- -- The Monad GUI Library (Mogul): The all importing main file. -- -- Author : Axel Simon -- -- Created: 3 June 2001 -- -- Version $Revision: 1.1 $ from $Date: 2005/01/08 16:42:15 $ -- -- Copyright (c) 2001 Axel Simon -- -- This file is free software; you can redistribute it and/or modify -- it under the terms of the GNU General Public License as published by -- the Free Software Foundation; either version 2 of the License, or -- (at your option) any later version. -- -- This file is distributed in the hope that it will be useful, -- but WITHOUT ANY WARRANTY; without even the implied warranty of -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -- GNU General Public License for more details. -- -- | -- -- This module re-exports all unchanged Gtk and Mogul entities. -- #include <config.h> module Graphics.UI.Gtk.Mogul ( module Graphics.UI.Gtk.Mogul.NewWidget, module Graphics.UI.Gtk.Mogul.GetWidget, module Graphics.UI.Gtk.Mogul.MDialog, module Graphics.UI.Gtk.Mogul.TreeList, module Graphics.UI.Gtk ) where import Graphics.UI.Gtk.Mogul.NewWidget import Graphics.UI.Gtk.Mogul.GetWidget import Graphics.UI.Gtk.Mogul.MDialog --import Multiline import Graphics.UI.Gtk.Mogul.TreeList import Graphics.UI.Gtk hiding ( textBufferNew, -- textTagNew, -- textTagTableNew, labelNew, accelLabelNew, arrowNew, imageNewFromFile, alignmentNew, frameNew, buttonNew, buttonNewWithLabel, buttonNewWithMnemonic, buttonNewFromStock, toggleButtonNew, toggleButtonNewWithLabel, checkButtonNew, checkButtonNewWithLabel, checkButtonNewWithMnemonic, radioButtonNew, radioButtonNewWithLabel, radioButtonNewJoinGroup, radioButtonNewJoinGroupWithLabel, #ifndef DISABLE_DEPRECATED optionMenuNew, #endif menuItemNew, menuItemNewWithLabel, checkMenuItemNew, checkMenuItemNewWithLabel, radioMenuItemNew, radioMenuItemNewWithLabel, radioMenuItemNewJoinGroup, radioMenuItemNewJoinGroupWithLabel, tearoffMenuItemNew, windowNew, dialogNew, --colorSelectionDialogNew, --fileSelectionNew, --fontSelectionDialogNew, --plugNew, eventBoxNew, handleBoxNew, scrolledWindowNew, viewportNew, vBoxNew, --colorSelectionNew, --fontSelectionNew, hBoxNew, #ifndef DISABLE_DEPRECATED comboNew, #endif statusbarNew, hPanedNew, vPanedNew, layoutNew, menuNew, menuBarNew, notebookNew, --socketNew, tableNew, textViewNew, toolbarNew, -- the following functions and types are replaced in TreeList.hs treeViewNew, -- TreeModel treeModelGetValue, TreePath, treePathNew, treePathNewFromString, treePathToString, treePathNewFirst, treePathAppendIndex, treePathPrependIndex, treePathGetDepth, treePathGetIndices, treePathCopy, treePathCompare, treePathNext, treePathPrev, treePathUp, treePathDown, treeModelGetIter, treeModelGetPath, -- ListStore listStoreNew, listStoreSetValue, -- TreeStore treeStoreNew, treeStoreSetValue, -- TreeViewColumn treeViewColumnAddAttribute, CellRendererText, onEdited, afterEdited, CellRendererPixbuf, CellRendererToggle, -- TreeView treeViewGetPathAtPos, calendarNew, --drawingAreaNew, entryNew, spinButtonNew, spinButtonNewWithRange, hScaleNew, vScaleNew, hScrollbarNew, vScrollbarNew, hSeparatorNew, vSeparatorNew, progressBarNew, adjustmentNew, --iMContextNew, --iMMulticontextNew, --itemFactoryNew, tooltipsNew, treeStoreNew, listStoreNew, iconFactoryNew) |
From: Duncan C. <dun...@us...> - 2005-01-08 16:42:08
|
Update of /cvsroot/gtk2hs/gtk2hs/mogul/Graphics/UI/Gtk/Mogul In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17400/mogul/Graphics/UI/Gtk/Mogul Added Files: GetWidget.hs MDialog.hs WidgetTable.hs Log Message: mogul package namespace conversion. --- NEW FILE: GetWidget.hs --- {-# OPTIONS -cpp #-} -- -*-haskell-*- -- The Monad GUI Library (Mogul): Retrieving a widget from the global store. -- -- Author : Axel Simon -- -- Created: 4 June 2001 -- -- Version $Revision: 1.1 $ from $Date: 2005/01/08 16:41:58 $ -- -- Copyright (c) 2001 Axel Simon -- -- This file is free software; you can redistribute it and/or modify -- it under the terms of the GNU General Public License as published by -- the Free Software Foundation; either version 2 of the License, or -- (at your option) any later version. -- -- This file is distributed in the hope that it will be useful, -- but WITHOUT ANY WARRANTY; without even the implied warranty of -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -- GNU General Public License for more details. -- -- | -- -- Retrieve a widget by name from the global store. -- #include <config.h> module Graphics.UI.Gtk.Mogul.GetWidget ( getMisc, getLabel, getAccelLabel, #ifndef DISABLE_DEPRECATED getTipsQuery, #endif getArrow, getImage, getContainer, getBin, getAlignment, getFrame, getAspectFrame, getButton, getToggleButton, getCheckButton, getRadioButton, #ifndef DISABLE_DEPRECATED getOptionMenu, #endif getItem, getMenuItem, getCheckMenuItem, getRadioMenuItem, getTearoffMenuItem, #ifndef DISABLE_DEPRECATED getListItem, #endif getWindow, getDialog, getColorSelectionDialog, getFileSelection, getFontSelectionDialog, getInputDialog, getMessageDialog, --getPlug, getEventBox, getHandleBox, getScrolledWindow, getViewport, getBox, getButtonBox, getHButtonBox, getVButtonBox, getVBox, getColorSelection, getFontSelection, getGammaCurve, getHBox, #ifndef DISABLE_DEPRECATED getCombo, #endif getStatusbar, #ifndef DISABLE_DEPRECATED getCList, getCTree, #endif getFixed, getPaned, getHPaned, getVPaned, getLayout, #ifndef DISABLE_DEPRECATED getList, #endif getMenuShell, getMenu, getMenuBar, getNotebook, --getSocket, getTable, getTextView, getToolbar, getTreeView, getCalendar, getDrawingArea, getCurve, getEntry, getSpinButton, getRuler, getHRuler, getVRuler, getRange, getScale, getHScale, getVScale, getScrollbar, getHScrollbar, getVScrollbar, getSeparator, getHSeparator, getVSeparator, getInvisible, #ifndef DISABLE_DEPRECATED getPreview, #endif getProgressBar ) where import Graphics.UI.Gtk.Mogul.WidgetTable (widgetLookup) import Graphics.UI.Gtk.Types -- The get<Name> functions lookup a widget by name in the global store. Only -- widgets created by new<Name> can be retrieved this way. The function throws -- an exception if the widget was not found or is the wrong type. (EXPORTED) -- getMisc :: String -> IO Misc getMisc name = widgetLookup name "Misc" mkMisc getLabel :: String -> IO Label getLabel name = widgetLookup name "Label" mkLabel getAccelLabel :: String -> IO AccelLabel getAccelLabel name = widgetLookup name "AccelLabel" mkAccelLabel #ifndef DISABLE_DEPRECATED getTipsQuery :: String -> IO TipsQuery getTipsQuery name = widgetLookup name "TipsQuery" mkTipsQuery #endif getArrow :: String -> IO Arrow getArrow name = widgetLookup name "Arrow" mkArrow getImage :: String -> IO Image getImage name = widgetLookup name "Image" mkImage getContainer :: String -> IO Container getContainer name = widgetLookup name "Container" mkContainer getBin :: String -> IO Bin getBin name = widgetLookup name "Bin" mkBin getAlignment :: String -> IO Alignment getAlignment name = widgetLookup name "Alignment" mkAlignment getFrame :: String -> IO Frame getFrame name = widgetLookup name "Frame" mkFrame getAspectFrame :: String -> IO AspectFrame getAspectFrame name = widgetLookup name "AspectFrame" mkAspectFrame getButton :: String -> IO Button getButton name = widgetLookup name "Button" mkButton getToggleButton :: String -> IO ToggleButton getToggleButton name = widgetLookup name "ToggleButton" mkToggleButton getCheckButton :: String -> IO CheckButton getCheckButton name = widgetLookup name "CheckButton" mkCheckButton getRadioButton :: String -> IO RadioButton getRadioButton name = widgetLookup name "RadioButton" mkRadioButton #ifndef DISABLE_DEPRECATED getOptionMenu :: String -> IO OptionMenu getOptionMenu name = widgetLookup name "OptionMenu" mkOptionMenu #endif getItem :: String -> IO Item getItem name = widgetLookup name "Item" mkItem getMenuItem :: String -> IO MenuItem getMenuItem name = widgetLookup name "MenuItem" mkMenuItem getCheckMenuItem :: String -> IO CheckMenuItem getCheckMenuItem name = widgetLookup name "CheckMenuItem" mkCheckMenuItem getRadioMenuItem :: String -> IO RadioMenuItem getRadioMenuItem name = widgetLookup name "RadioMenuItem" mkRadioMenuItem getTearoffMenuItem :: String -> IO TearoffMenuItem getTearoffMenuItem name = widgetLookup name "TearoffMenuItem" mkTearoffMenuItem #ifndef DISABLE_DEPRECATED getListItem :: String -> IO ListItem getListItem name = widgetLookup name "ListItem" mkListItem #endif getWindow :: String -> IO Window getWindow name = widgetLookup name "Window" mkWindow getDialog :: String -> IO Dialog getDialog name = widgetLookup name "Dialog" mkDialog getColorSelectionDialog :: String -> IO ColorSelectionDialog getColorSelectionDialog name = widgetLookup name "ColorSelectionDialog" mkColorSelectionDialog getFileSelection :: String -> IO FileSelection getFileSelection name = widgetLookup name "FileSelection" mkFileSelection getFontSelectionDialog :: String -> IO FontSelectionDialog getFontSelectionDialog name = widgetLookup name "FontSelectionDialog" mkFontSelectionDialog getInputDialog :: String -> IO InputDialog getInputDialog name = widgetLookup name "InputDialog" mkInputDialog getMessageDialog :: String -> IO MessageDialog getMessageDialog name = widgetLookup name "MessageDialog" mkMessageDialog --getPlug :: String -> IO Plug --getPlug name = -- widgetLookup name "Plug" mkPlug getEventBox :: String -> IO EventBox getEventBox name = widgetLookup name "EventBox" mkEventBox getHandleBox :: String -> IO HandleBox getHandleBox name = widgetLookup name "HandleBox" mkHandleBox getScrolledWindow :: String -> IO ScrolledWindow getScrolledWindow name = widgetLookup name "ScrolledWindow" mkScrolledWindow getViewport :: String -> IO Viewport getViewport name = widgetLookup name "Viewport" mkViewport getBox :: String -> IO Box getBox name = widgetLookup name "Box" mkBox getButtonBox :: String -> IO ButtonBox getButtonBox name = widgetLookup name "ButtonBox" mkButtonBox getHButtonBox :: String -> IO HButtonBox getHButtonBox name = widgetLookup name "HButtonBox" mkHButtonBox getVButtonBox :: String -> IO VButtonBox getVButtonBox name = widgetLookup name "VButtonBox" mkVButtonBox getVBox :: String -> IO VBox getVBox name = widgetLookup name "VBox" mkVBox getColorSelection :: String -> IO ColorSelection getColorSelection name = widgetLookup name "ColorSelection" mkColorSelection getFontSelection :: String -> IO FontSelection getFontSelection name = widgetLookup name "FontSelection" mkFontSelection getGammaCurve :: String -> IO GammaCurve getGammaCurve name = widgetLookup name "GammaCurve" mkGammaCurve getHBox :: String -> IO HBox getHBox name = widgetLookup name "HBox" mkHBox #ifndef DISABLE_DEPRECATED getCombo :: String -> IO Combo getCombo name = widgetLookup name "Combo" mkCombo #endif getStatusbar :: String -> IO Statusbar getStatusbar name = widgetLookup name "Statusbar" mkStatusbar #ifndef DISABLE_DEPRECATED getCList :: String -> IO CList getCList name = widgetLookup name "CList" mkCList getCTree :: String -> IO CTree getCTree name = widgetLookup name "CTree" mkCTree #endif getFixed :: String -> IO Fixed getFixed name = widgetLookup name "Fixed" mkFixed getPaned :: String -> IO Paned getPaned name = widgetLookup name "Paned" mkPaned getHPaned :: String -> IO HPaned getHPaned name = widgetLookup name "HPaned" mkHPaned getVPaned :: String -> IO VPaned getVPaned name = widgetLookup name "VPaned" mkVPaned getLayout :: String -> IO Layout getLayout name = widgetLookup name "Layout" mkLayout #ifndef DISABLE_DEPRECATED getList :: String -> IO List getList name = widgetLookup name "List" mkList #endif getMenuShell :: String -> IO MenuShell getMenuShell name = widgetLookup name "MenuShell" mkMenuShell getMenu :: String -> IO Menu getMenu name = widgetLookup name "Menu" mkMenu getMenuBar :: String -> IO MenuBar getMenuBar name = widgetLookup name "MenuBar" mkMenuBar getNotebook :: String -> IO Notebook getNotebook name = widgetLookup name "Notebook" mkNotebook --getSocket :: String -> IO Socket --getSocket name = -- widgetLookup name "Socket" mkSocket getTable :: String -> IO Table getTable name = widgetLookup name "Table" mkTable getTextView :: String -> IO TextView getTextView name = widgetLookup name "TextView" mkTextView getToolbar :: String -> IO Toolbar getToolbar name = widgetLookup name "Toolbar" mkToolbar getTreeView :: String -> IO TreeView getTreeView name = widgetLookup name "TreeView" mkTreeView getCalendar :: String -> IO Calendar getCalendar name = widgetLookup name "Calendar" mkCalendar getDrawingArea :: String -> IO DrawingArea getDrawingArea name = widgetLookup name "DrawingArea" mkDrawingArea getCurve :: String -> IO Curve getCurve name = widgetLookup name "Curve" mkCurve getEntry :: String -> IO Entry getEntry name = widgetLookup name "Entry" mkEntry getSpinButton :: String -> IO SpinButton getSpinButton name = widgetLookup name "SpinButton" mkSpinButton getRuler :: String -> IO Ruler getRuler name = widgetLookup name "Ruler" mkRuler getHRuler :: String -> IO HRuler getHRuler name = widgetLookup name "HRuler" mkHRuler getVRuler :: String -> IO VRuler getVRuler name = widgetLookup name "VRuler" mkVRuler getRange :: String -> IO Range getRange name = widgetLookup name "Range" mkRange getScale :: String -> IO Scale getScale name = widgetLookup name "Scale" mkScale getHScale :: String -> IO HScale getHScale name = widgetLookup name "HScale" mkHScale getVScale :: String -> IO VScale getVScale name = widgetLookup name "VScale" mkVScale getScrollbar :: String -> IO Scrollbar getScrollbar name = widgetLookup name "Scrollbar" mkScrollbar getHScrollbar :: String -> IO HScrollbar getHScrollbar name = widgetLookup name "HScrollbar" mkHScrollbar getVScrollbar :: String -> IO VScrollbar getVScrollbar name = widgetLookup name "VScrollbar" mkVScrollbar getSeparator :: String -> IO Separator getSeparator name = widgetLookup name "Separator" mkSeparator getHSeparator :: String -> IO HSeparator getHSeparator name = widgetLookup name "HSeparator" mkHSeparator getVSeparator :: String -> IO VSeparator getVSeparator name = widgetLookup name "VSeparator" mkVSeparator getInvisible :: String -> IO Invisible getInvisible name = widgetLookup name "Invisible" mkInvisible #ifndef DISABLE_DEPRECATED getPreview :: String -> IO Preview getPreview name = widgetLookup name "Preview" mkPreview #endif getProgressBar :: String -> IO ProgressBar getProgressBar name = widgetLookup name "ProgressBar" mkProgressBar --- NEW FILE: WidgetTable.hs --- -- -*-haskell-*- -- The Monad GUI Library (Mogul): The global widget table. -- -- Author : Axel Simon -- -- Created: 2 June 2001 -- -- Version $Revision: 1.1 $ from $Date: 2005/01/08 16:41:58 $ -- -- Copyright (c) 2001 Axel Simon -- -- This file is free software; you can redistribute it and/or modify -- it under the terms of the GNU General Public License as published by -- the Free Software Foundation; either version 2 of the License, or -- (at your option) any later version. -- -- This file is distributed in the hope that it will be useful, -- but WITHOUT ANY WARRANTY; without even the implied warranty of -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -- GNU General Public License for more details. -- -- | -- -- This module provides the possibility to lookup a widget by name. -- -- * This module uses a global variable (unsafePerformIO is lurking). -- module Graphics.UI.Gtk.Mogul.WidgetTable ( WidgetName, widgetLookup, newNamedWidget, isValidName ) where import Monad (liftM) import Foreign import Foreign.ForeignPtr (unsafeForeignPtrToPtr) import Control.Concurrent.MVar (MVar, newMVar, takeMVar, putMVar, readMVar) import System.IO.Unsafe (unsafePerformIO) import Data.FiniteMap (FiniteMap, emptyFM, addToFM, delFromFM, lookupFM, elemFM) import Graphics.UI.Gtk.Abstract.Object (makeNewObject) import Graphics.UI.Gtk.Types import Graphics.UI.Gtk.Abstract.Widget (widgetSetName, onUnrealize) -- We define a synonym for the name of a widget. (EXPORTED) -- type WidgetName = String -- Eventually we might use hash values in addition to strings. Provide this -- functionality today. -- newtype WidgetId = WidgetId String deriving (Eq,Ord) mkWidgetId :: WidgetName -> WidgetId mkWidgetId = WidgetId {-# NOINLINE widgetTable #-} widgetTable :: MVar (FiniteMap WidgetId (Ptr Widget)) widgetTable = unsafePerformIO $ newMVar emptyFM -- Retrieve a widget from the global store. The second argument should -- contain the type name of the object to generate a more meaningful error -- message. -- widgetLookup :: WidgetClass w => WidgetName -> String -> (ForeignPtr w -> w) -> IO w widgetLookup name oType mkObj = do table <- readMVar widgetTable case table `lookupFM` (mkWidgetId name) of Nothing -> error ("fetch"++oType++": "++name++" could not be found.") Just w -> makeNewObject mkObj $ return (castPtr w) -- Create a widget and store its name in the table. -- newNamedWidget :: WidgetClass w => WidgetName -> IO w -> IO w newNamedWidget name new = do w <- new widgetSetName w name let wId = (mkWidgetId name) table <- takeMVar widgetTable putMVar widgetTable (addToFM table wId ((unsafeForeignPtrToPtr.unWidget.toWidget) w)) w `onUnrealize` (do table <- takeMVar widgetTable putMVar widgetTable (table `delFromFM` wId)) return w -- Check if a given name is contained in the table. (EXPORTED) -- isValidName :: WidgetName -> IO Bool isValidName name = liftM (elemFM (mkWidgetId name)) $ readMVar widgetTable --- NEW FILE: MDialog.hs --- -- -*-haskell-*- -- The Monad GUI Library (Mogul): Dialog helper functions. -- -- Author : Axel Simon -- -- Created: 2 June 2001 -- -- Version $Revision: 1.1 $ from $Date: 2005/01/08 16:41:58 $ -- -- Copyright (c) 2001 Axel Simon -- -- This file is free software; you can redistribute it and/or modify -- it under the terms of the GNU General Public License as published by -- the Free Software Foundation; either version 2 of the License, or -- (at your option) any later version. -- -- This file is distributed in the hope that it will be useful, -- but WITHOUT ANY WARRANTY; without even the implied warranty of -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -- GNU General Public License for more details. -- -- | -- -- Simplify the construction of a non-modal dialog. -- module Graphics.UI.Gtk.Mogul.MDialog( assureDialog ) where import Graphics.UI.Gtk.Mogul.GetWidget (getDialog) import Graphics.UI.Gtk.Mogul.NewWidget (newNamedDialog) import Graphics.UI.Gtk.Mogul.WidgetTable (isValidName) import Graphics.UI.Gtk (widgetShowAll, widgetGrabFocus) import Graphics.UI.Gtk.Types -- Move a dialog to the toplevel if it is already onscreen. Otherwise construct -- a new dialog with the given construction function. (EXPORTED) -- assureDialog :: String -> (Dialog -> IO ()) -> (Dialog -> IO ()) -> IO () assureDialog name construct fill = do vn <- isValidName name if vn then do dia <- getDialog name fill dia -- FIXME: focus the window return () else do dia <- newNamedDialog name construct dia fill dia widgetShowAll dia |
From: Duncan C. <dun...@us...> - 2005-01-08 16:40:55
|
Update of /cvsroot/gtk2hs/gtk2hs/mogul/Graphics/UI/Gtk/Mogul In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17141/mogul/Graphics/UI/Gtk/Mogul Added Files: NewWidget.hs Log Message: mogul package namespace conversion. --- NEW FILE: NewWidget.hs --- {-# OPTIONS -cpp #-} -- The Monad GUI Library (Mogul): Creation of new widgets. -- -- Author : Axel Simon -- -- Created: 2 June 2001 -- -- Version $Revision: 1.1 $ from $Date: 2005/01/08 16:40:46 $ -- -- Copyright (c) 2001 Axel Simon -- -- This file is free software; you can redistribute it and/or modify -- it under the terms of the GNU General Public License as published by -- the Free Software Foundation; either version 2 of the License, or -- (at your option) any later version. -- -- This file is distributed in the hope that it will be useful, -- but WITHOUT ANY WARRANTY; without even the implied warranty of -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the [...1110 lines suppressed...] -- --newIMMulticontext :: IO iMMulticontext --newIMMulticontext = iMMulticontextNew -- | see 'itemFactoryNew' -- --newItemFactory :: IO ItemFactory --newItemFactory = itemFactoryNew -- | see 'tooltipsNew' -- newTooltips :: IO Tooltips newTooltips = tooltipsNew -- | see 'name' -- newIconFactory :: IO IconFactory newIconFactory = iconFactoryNew |
From: Duncan C. <dun...@us...> - 2005-01-08 16:40:43
|
Update of /cvsroot/gtk2hs/gtk2hs In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16965 Modified Files: ChangeLog Log Message: mogul package namespace conversion. Index: ChangeLog =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/ChangeLog,v retrieving revision 1.269 retrieving revision 1.270 diff -u -d -r1.269 -r1.270 --- ChangeLog 8 Jan 2005 16:08:58 -0000 1.269 +++ ChangeLog 8 Jan 2005 16:40:15 -0000 1.270 @@ -162,6 +162,13 @@ * mozembed/Graphics/UI/Gtk/MozEmbed.chs: fixup names of imported modules. + * mogul/Graphics/UI/Gtk/Mogul/GetWidget.hs, + mogul/Graphics/UI/Gtk/Mogul/MDialog.hs, + mogul/Graphics/UI/Gtk/Mogul/NewWidget.hs, + mogul/Graphics/UI/Gtk/Mogul/TreeList.hs, + mogul/Graphics/UI/Gtk/Mogul/WidgetTable.hs, + mogul/Graphics/UI/Gtk/Mogul.hs: mogul package namespace conversion. + 2005-01-07 Duncan Coutts <du...@co...> * tools/apiGen/ApiGen.hs: several documentation improvements, add |
From: Duncan C. <dun...@us...> - 2005-01-08 16:40:27
|
Update of /cvsroot/gtk2hs/gtk2hs/mogul/Graphics/UI/Gtk/Mogul In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16965/mogul/Graphics/UI/Gtk/Mogul Added Files: TreeList.hs Log Message: mogul package namespace conversion. --- NEW FILE: TreeList.hs --- -- -*-haskell-*- -- The Monad GUI Library (Mogul): Widget TreeView -- -- Author : Axel Simon -- -- Created: 2 June 2001 -- -- Version $Revision: 1.1 $ from $Date: 2005/01/08 16:40:16 $ -- -- Copyright (c) 2001 Axel Simon -- -- This file is free software; you can redistribute it and/or modify -- it under the terms of the GNU General Public License as published by -- the Free Software Foundation; either version 2 of the License, or -- (at your option) any later version. -- -- This file is distributed in the hope that it will be useful, -- but WITHOUT ANY WARRANTY; without even the implied warranty of -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -- GNU General Public License for more details. -- -- | -- -- This module provides all object for a widget displaying data organized -- in a table. -- -- * There are two flavors: A simple list organizes -- data in rows and a tree which provides the possibility to impose a -- hierarchical structure on the entries of one column. -- -- * The widget is composed of two parts: A database holding rows of data and -- the widget object itself which displays items based on the database. -- Several widgets may use a single storage object. The data in the database -- may be what is directly displayed like strings and images or it may be -- some meta information like the padding or color of an item. Several -- attributes in the storage object may be used to display one column -- in the widget. In contrast each row in the store corresponds to a row -- in the widget. -- -- * The widget that displays the data and can be inserted like any other -- into a container is called 'TreeView'. This widget is itself -- a container for 'TreeViewColumn's which has a title at the top -- of the column. Each 'TreeViewColumn' in turn can contain -- several 'Renderer'. There are currently three -- 'Renderer', one for each of the following items: -- text, 'Pixbuf' and 'ToggleButton'. -- -- * The database is called store, specifically for simple lists it is -- 'ListStore' and for hierachical data it is called -- 'TreeStore'. A store is created from a skeleton. -- '' Attributes can be added to an empty -- 'ListSkel' or 'TreeSkel' skeleton which yields -- a functions to access the attribute and an 'Association'. -- After the skeleton is turned into a store by calling either -- 'newListStore' or 'newTreeStore', -- 'Association's can be inserted together with an appropriate -- 'Renderer' into a 'TreeViewColumn'. -- -- TODO -- -- * Figure out if properties in the store have priority over global -- properties when both are set. -- module Graphics.UI.Gtk.Mogul.TreeList ( -- * ListStore ListSkel, emptyListSkel, listSkelAddAttribute, newListStore, -- * TreeStore TreeSkel, emptyTreeSkel, treeSkelAddAttribute, newTreeStore, -- * Widget Association, Renderer, treeViewColumnNewText, treeViewColumnNewPixbuf, treeViewColumnNewToggle, treeViewColumnAssociate, treeViewGetPathAtPos, -- * CellRenderer cellRendererSetAttribute, cellRendererGetAttribute, -- * CellRendererText onEdited, afterEdited, -- * TreeModel TreePath, treeModelGetIter, treeModelGetPath ) where import Monad (liftM, mapM, mapM_, foldM) import System.Glib.GType (typeInstanceIsA) import Graphics.UI.Gtk hiding ( -- TreeModel treeModelGetValue, TreePath, treePathNew, treePathNewFromString, treePathToString, treePathNewFirst, treePathAppendIndex, treePathPrependIndex, treePathGetDepth, treePathGetIndices, treePathCopy, treePathCompare, treePathNext, treePathPrev, treePathUp, treePathDown, treeModelGetIter, treeModelGetPath, -- ListStore listStoreNew, listStoreSetValue, -- TreeStore treeStoreNew, treeStoreSetValue, -- TreeViewColumn treeViewColumnAddAttribute, -- CellRendererText onEdited, afterEdited, -- TreeView treeViewGetPathAtPos) import Data.IORef (IORef(..), newIORef, readIORef, writeIORef) import Control.Exception (throw, Exception(AssertionFailed)) import qualified Graphics.UI.Gtk as Gtk -- | A skeleton of a 'ListStore' database. -- -- * This datastructure describes what columns the database will have when -- it is finally created by 'newListStore'. -- newtype ListSkel = ListSkel (IORef ListSkelState) data ListSkelState = LSSPrepare [TMType] | LSSActive ListStore -- | Returns an empty 'ListSkel'. -- emptyListSkel :: IO ListSkel emptyListSkel = liftM ListSkel (newIORef (LSSPrepare [])) -- | Reserve a new column in -- 'ListSkel' to hold values for the given attribute. -- -- * The type of the column is determined by the given 'Attribute' -- of the 'ViewColumn' which should be stored here. It is possible -- to associate this column with several 'ViewColumn's. -- listSkelAddAttribute :: CellRendererClass cr => ListSkel -> Attribute cr argTy -> IO (Association cr, TreeIter -> IO argTy, TreeIter -> argTy -> IO ()) listSkelAddAttribute (ListSkel statusRef) (Attribute prop ty toGen fromGen) = do status <- readIORef statusRef case status of LSSPrepare tTree -> do writeIORef statusRef (LSSPrepare (ty++tTree)) let columnNo = length tTree let cols = length ty return (Association prop columnNo, \ti -> do status <- readIORef statusRef case status of LSSPrepare _ -> throw $ AssertionFailed "Modul.TreeStore<readValue>: \ \skeleton was not converted to a TreeStore before data access." LSSActive ls -> mapM (Gtk.treeModelGetValue ls ti) [columnNo..columnNo+cols-1] >>= fromGen, \ti arg -> do status <- readIORef statusRef case status of LSSPrepare _ -> throw $ AssertionFailed "Modul.TreeStore<writeValue>: \ \skeleton was not converted to a TreeStore before data access." LSSActive ls -> liftM (zip [columnNo..]) (toGen arg) >>= mapM_ (uncurry (Gtk.listStoreSetValue ls ti)) ) -- | Create a new 'ListStore' database. -- -- * This method throws an exception if the skeleton has been used before. -- newListStore :: ListSkel -> IO ListStore newListStore (ListSkel statusRef) = do status <- readIORef statusRef case status of LSSPrepare tList -> do ls <- Gtk.listStoreNew (reverse tList) writeIORef statusRef (LSSActive ls) return ls LSSActive _ -> throw $ AssertionFailed "Mogul.newListStore: tried to reuse a ListStore skeleton." -- | A skeleton of a 'TreeStore' database. -- -- * This datastructure describes what columns the database will have when -- it is finally created by 'newTreeStore' -- newtype TreeSkel = TreeSkel (IORef TreeSkelState) data TreeSkelState = TSSPrepare [TMType] | TSSActive TreeStore -- | Returns an empty 'TreeSkel'. -- emptyTreeSkel :: IO TreeSkel emptyTreeSkel = liftM TreeSkel (newIORef (TSSPrepare [])) -- | Reserve a new column in -- 'TreeSkel' to hold values for the given attribute. -- -- * The type of the column is determined by the given 'Attribute' -- of the 'ViewColumn' which should be stored here. It is possible -- to associate this column with several 'ViewColumn's. -- treeSkelAddAttribute :: CellRendererClass r => TreeSkel -> Attribute r argTy -> IO (Association r, TreeIter -> IO argTy, TreeIter -> argTy -> IO ()) treeSkelAddAttribute (TreeSkel statusRef) (Attribute prop ty toGen fromGen) = do status <- readIORef statusRef case status of TSSPrepare tTree -> do writeIORef statusRef (TSSPrepare (ty++tTree)) let columnNo = length tTree let cols = length ty return (Association prop columnNo, \ti -> do status <- readIORef statusRef case status of TSSPrepare _ -> throw $ AssertionFailed "Modul.TreeStore<readValue>: \ \skeleton was not converted to a TreeStore before data access." TSSActive ls -> mapM (Gtk.treeModelGetValue ls ti) [columnNo..columnNo+cols-1] >>= fromGen, \ti arg -> do status <- readIORef statusRef case status of TSSPrepare _ -> throw $ AssertionFailed "Modul.TreeStore<writeValue>: \ \skeleton was not converted to a TreeStore before data access." TSSActive ls -> liftM (zip [columnNo..]) (toGen arg) >>= mapM_ (uncurry $Gtk.treeStoreSetValue ls ti) ) -- | Create a new 'TreeStore' database. -- -- * This method throws an exception if the skeleton has been used before. -- newTreeStore :: TreeSkel -> IO TreeStore newTreeStore (TreeSkel statusRef) = do status <- readIORef statusRef case status of TSSPrepare tTree -> do ls <- Gtk.treeStoreNew (reverse tTree) writeIORef statusRef (TSSActive ls) return ls TSSActive _ -> throw $ AssertionFailed "Mogul.newTreeStore: tried to reuse a TreeStore skeleton." -- | An abstract link between a store and a view. -- data CellRendererClass cr => Association cr = Association [String] Int -- | A renderer for text in a 'TreeView'. -- data CellRendererClass cr => Renderer cr = Renderer cr TreeViewColumn -- | Create a new rederer showing text. -- -- * There can be several 'Renderer' in each -- 'TreeViewColumn'. Each 'Renderer' can reflect -- several 'Attributes' from a 'ListStore' or -- 'TreeStore'. -- treeViewColumnNewText :: TreeViewColumn -> Bool -> Bool -> IO (Renderer CellRendererText) treeViewColumnNewText tvc atStart expand = do ren <- cellRendererTextNew (if atStart then Gtk.treeViewColumnPackStart else Gtk.treeViewColumnPackEnd) tvc ren expand return $ Renderer ren tvc -- | Create a new renderer showing a 'Pixbuf'. -- -- -- * There can be several 'Renderer' in each -- 'TreeViewColumn'. Each 'Renderer' can reflect -- several 'Attributes' from a 'ListStore' or -- 'TreeStore'. -- treeViewColumnNewPixbuf :: TreeViewColumn -> Bool -> Bool -> IO (Renderer CellRendererPixbuf) treeViewColumnNewPixbuf tvc atStart expand = do ren <- cellRendererPixbufNew (if atStart then Gtk.treeViewColumnPackStart else Gtk.treeViewColumnPackEnd) tvc ren expand return $ Renderer ren tvc -- | Create a new renderer showing a 'ToggleButton'. -- -- * There can be several 'Renderer' in each -- 'TreeViewColumn'. Each 'Renderer' can reflect -- several 'Attributes' from a 'ListStore' or -- 'TreeStore'. -- treeViewColumnNewToggle :: TreeViewColumn -> Bool -> Bool -> IO (Renderer CellRendererToggle) treeViewColumnNewToggle tvc atStart expand = do ren <- cellRendererToggleNew (if atStart then Gtk.treeViewColumnPackStart else Gtk.treeViewColumnPackEnd) tvc ren expand return $ Renderer ren tvc -- | Create a link between the store and this model. -- -- * The results are undefined, if this 'TreeViewColumn' was not -- created with the same 'TreeModel' as the 'Association's. -- treeViewColumnAssociate :: CellRendererClass r => Renderer r -> [Association r] -> IO () treeViewColumnAssociate (Renderer ren tvc) assocs = do let assocs' = concatMap (\(Association strs col) -> zip strs [col..]) assocs mapM_ (\(attr,col) -> Gtk.treeViewColumnAddAttribute tvc ren attr col) assocs' -- | Map a pixel to the specific cell. -- -- * Finds the path at the 'Point' @(x, y)@. The -- coordinates @x@ and @y@ are relative to the top left -- corner of the 'TreeView' drawing window. As such, coordinates -- in a mouse click event can be used directly to determine the cell -- which the user clicked on. This is therefore a way to realize for -- popup menus. -- -- * The returned point is the input point relative to the cell's upper -- left corner. The whole 'TreeView' is divided between all cells. -- The returned point is relative to the rectangle this cell occupies -- within the 'TreeView'. -- treeViewGetPathAtPos :: TreeViewClass tv => tv -> Point -> IO (Maybe (TreePath, TreeViewColumn, Point)) treeViewGetPathAtPos tv pt = do maybePath <- Gtk.treeViewGetPathAtPos tv pt case maybePath of Nothing -> return Nothing Just (realPath, col, relPt) -> do -- convert path component to mogul's TreePath representation path <- Gtk.treePathGetIndices realPath return $ Just (path, col, relPt) -- | Set an 'Attribute' globally. -- -- * An 'Attribute' of a 'Renderer' can either be set -- on a row-by-row basis using 'listSkelAddAttribute' and -- 'treeSkelAddAttribute' or globally through this function. -- cellRendererSetAttribute :: CellRendererClass cr => Renderer cr -> Attribute cr val -> val -> IO () cellRendererSetAttribute (Renderer ren _) = Gtk.cellRendererSet ren -- | Get an global 'Attribute'. -- cellRendererGetAttribute :: CellRendererClass cr => Renderer cr -> Attribute cr val -> IO val cellRendererGetAttribute (Renderer ren _) = Gtk.cellRendererGet ren -- | Emitted when the user finished editing a cell. -- -- * This signal is not emitted when editing is disabled (see -- 'cellEditable') or when the user aborts editing. -- onEdited, afterEdited :: TreeModelClass tm => Renderer CellRendererText -> tm -> (TreeIter -> String -> IO ()) -> IO (ConnectId CellRendererText) onEdited (Renderer ren _) = Gtk.onEdited ren afterEdited (Renderer ren _) = Gtk.afterEdited ren -- | A simple way of addressing nodes. -- -- These integer lists are used to address nodes in a hierarchical -- 'ListStore' structure. -- type TreePath = [Int] -- | Turn a 'TreePath' into an abstract 'TreeIter'ator. -- treeModelGetIter :: TreeModelClass tm => tm -> TreePath -> IO (Maybe TreeIter) treeModelGetIter _ [] = throw $ AssertionFailed "Mogul.treeModelGetIter: \ \a path must contain at least one element." treeModelGetIter tm tp = do realPath <- Gtk.treePathNew mapM_ (Gtk.treePathAppendIndex realPath) tp Gtk.treeModelGetIter tm realPath -- | Turn an abstract 'TreeIter' into a 'TreePath'. -- treeModelGetPath :: TreeModelClass tm => tm -> TreeIter -> IO TreePath treeModelGetPath tm ti = do realPath <- Gtk.treeModelGetPath tm ti Gtk.treePathGetIndices realPath |
From: Duncan C. <dun...@us...> - 2005-01-08 16:37:38
|
Update of /cvsroot/gtk2hs/gtk2hs/mogul/Graphics/UI/Gtk/Mogul In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16378/mogul/Graphics/UI/Gtk/Mogul Log Message: Directory /cvsroot/gtk2hs/gtk2hs/mogul/Graphics/UI/Gtk/Mogul added to the repository |
From: Duncan C. <dun...@us...> - 2005-01-08 16:37:38
|
Update of /cvsroot/gtk2hs/gtk2hs/mogul/Graphics/UI In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16378/mogul/Graphics/UI Log Message: Directory /cvsroot/gtk2hs/gtk2hs/mogul/Graphics/UI added to the repository |
From: Duncan C. <dun...@us...> - 2005-01-08 16:37:33
|
Update of /cvsroot/gtk2hs/gtk2hs/mogul/Graphics/UI/Gtk In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16378/mogul/Graphics/UI/Gtk Log Message: Directory /cvsroot/gtk2hs/gtk2hs/mogul/Graphics/UI/Gtk added to the repository |
From: Duncan C. <dun...@us...> - 2005-01-08 16:37:33
|
Update of /cvsroot/gtk2hs/gtk2hs/mogul/Graphics In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16378/mogul/Graphics Log Message: Directory /cvsroot/gtk2hs/gtk2hs/mogul/Graphics added to the repository |
From: Duncan C. <dun...@us...> - 2005-01-08 16:09:08
|
Update of /cvsroot/gtk2hs/gtk2hs In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10380 Modified Files: ChangeLog Log Message: fixup names of imported modules. Index: ChangeLog =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/ChangeLog,v retrieving revision 1.268 retrieving revision 1.269 diff -u -d -r1.268 -r1.269 --- ChangeLog 8 Jan 2005 16:02:56 -0000 1.268 +++ ChangeLog 8 Jan 2005 16:08:58 -0000 1.269 @@ -159,6 +159,9 @@ sourceview/Graphics/UI/Gtk/SourceView.hs: sourceview package hierarchical namespace conversion. + * mozembed/Graphics/UI/Gtk/MozEmbed.chs: fixup names of imported + modules. + 2005-01-07 Duncan Coutts <du...@co...> * tools/apiGen/ApiGen.hs: several documentation improvements, add |
From: Duncan C. <dun...@us...> - 2005-01-08 16:09:07
|
Update of /cvsroot/gtk2hs/gtk2hs/mozembed/Graphics/UI/Gtk In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10380/mozembed/Graphics/UI/Gtk Modified Files: MozEmbed.chs Log Message: fixup names of imported modules. Index: MozEmbed.chs =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/mozembed/Graphics/UI/Gtk/MozEmbed.chs,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- MozEmbed.chs 18 Dec 2004 20:45:50 -0000 1.2 +++ MozEmbed.chs 8 Jan 2005 16:08:58 -0000 1.3 @@ -55,14 +55,15 @@ ) where import Monad (liftM) -import FFI -import ForeignPtr -import Foreign.Marshal.Utils (toBool) -{#import Object#} (makeNewObject) -{#import Signal#} (ConnectId, connect_STRING__BOOL, connect_PTR__INT) +import System.Glib.FFI +import System.Glib.UTFString +{#import Graphics.UI.Gtk.Abstract.Object#} (makeNewObject) +{#import Graphics.UI.Gtk.Signals#} (ConnectId, + connect_STRING__BOOL, + connect_PTR__INT) {#import Graphics.UI.Gtk.MozEmbedType #} -import Widget (Widget) +import Graphics.UI.Gtk.Abstract.Widget (Widget) {#context lib="gtkembedmoz" prefix ="gtk"#} |
From: Duncan C. <dun...@us...> - 2005-01-08 16:05:45
|
Update of /cvsroot/gtk2hs/gtk2hs/sourceview/Graphics/UI/Gtk/SourceView In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9788/sourceview/Graphics/UI/Gtk/SourceView Added Files: SourceIter.chs SourceLanguage.chs SourceLanguagesManager.chs SourceMarker.chs Log Message: sourceview package hierarchical namespace conversion. --- NEW FILE: SourceLanguagesManager.chs --- -- -*-haskell-*- -- GIMP Toolkit (GTK) SourceLanguagesManager -- -- Author : Duncan Coutts -- derived from GtkTextView bindings by Axel Simon -- -- Created: 14 October 2003 -- -- This file is free software; you can redistribute it and/or modify -- it under the terms of the GNU General Public License as published by -- the Free Software Foundation; either version 2 of the License, or -- (at your option) any later version. -- -- This file is distributed in the hope that it will be useful, -- but WITHOUT ANY WARRANTY; without even the implied warranty of -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -- GNU General Public License for more details. -- -- | -- module Graphics.UI.Gtk.SourceView.SourceLanguagesManager ( SourceLanguagesManager, sourceLanguagesManagerNew, sourceLanguagesManagerGetAvailableLanguages, sourceLanguagesManagerGetLanguageFromMimeType, sourceLanguagesManagerGetLangFilesDirs ) where import Monad (liftM, mapM) import System.Glib.FFI import System.Glib.UTFString import System.Glib.GList (readGSList) import System.Glib.GObject (makeNewGObject) {#import Graphics.UI.Gtk.Types#} {#import Graphics.UI.Gtk.SourceView.Types#} {#import Graphics.UI.Gtk.Signals#} {# context lib="gtk" prefix="gtk" #} -- methods -- | Create a new 'SourceLanguagesManager'. -- sourceLanguagesManagerNew :: IO SourceLanguagesManager sourceLanguagesManagerNew = makeNewGObject mkSourceLanguagesManager {#call source_languages_manager_new#} -- | -- sourceLanguagesManagerGetAvailableLanguages :: SourceLanguagesManager -> IO [SourceLanguage] sourceLanguagesManagerGetAvailableLanguages lm = do gList <- {#call source_languages_manager_get_available_languages#} lm wList <- readGSList gList mapM (makeNewGObject mkSourceLanguage) (map return wList) -- | -- sourceLanguagesManagerGetLanguageFromMimeType :: SourceLanguagesManager -> String -> IO (Maybe SourceLanguage) sourceLanguagesManagerGetLanguageFromMimeType lm mimeType = do langPtr <- withCString mimeType $ \strPtr -> {#call source_languages_manager_get_language_from_mime_type#} lm strPtr if langPtr==nullPtr then return Nothing else liftM Just $ makeNewGObject mkSourceLanguage (return langPtr) -- | Retrieve filenames with language specifications. -- sourceLanguagesManagerGetLangFilesDirs :: SourceLanguagesManager -> IO [FilePath] sourceLanguagesManagerGetLangFilesDirs lm = do gsList <- {#call source_languages_manager_get_lang_files_dirs#} lm -- The returned structure is private and nothing is to be freed. dirList <- readGSList gsList mapM peekUTFString dirList --- NEW FILE: SourceMarker.chs --- -- -*-haskell-*- -- GIMP Toolkit (GTK) SourceMarker -- -- Author : Duncan Coutts -- derived from GtkTextView bindings by Axel Simon -- -- Created: 26 October 2003 -- -- This file is free software; you can redistribute it and/or modify -- it under the terms of the GNU General Public License as published by -- the Free Software Foundation; either version 2 of the License, or -- (at your option) any later version. -- -- This file is distributed in the hope that it will be useful, -- but WITHOUT ANY WARRANTY; without even the implied warranty of -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -- GNU General Public License for more details. -- -- | -- module Graphics.UI.Gtk.SourceView.SourceMarker ( SourceMarker, sourceMarkerSetMarkerType, sourceMarkerGetMarkerType, sourceMarkerGetLine, sourceMarkerGetName, sourceMarkerGetBuffer, sourceMarkerNext, sourceMarkerPrev ) where import Monad (liftM) import System.Glib.FFI import System.Glib.UTFString import System.Glib.GObject (makeNewGObject) {#import Graphics.UI.Gtk.Types#} {#import Graphics.UI.Gtk.SourceView.Types#} {# context lib="gtk" prefix="gtk" #} -- methods -- | -- sourceMarkerSetMarkerType :: SourceMarker -> String -> IO () sourceMarkerSetMarkerType mark markType = withCString markType $ \strPtr1 -> {#call unsafe source_marker_set_marker_type#} mark strPtr1 -- | -- sourceMarkerGetMarkerType :: SourceMarker -> IO String sourceMarkerGetMarkerType mark = do strPtr <- {#call unsafe source_marker_get_marker_type#} mark markType <- peekUTFString strPtr {#call unsafe g_free#} (castPtr strPtr) return markType -- | -- sourceMarkerGetLine :: SourceMarker -> IO Int sourceMarkerGetLine mark = liftM fromIntegral $ {#call unsafe source_marker_get_line#} mark -- | -- sourceMarkerGetName :: SourceMarker -> IO String sourceMarkerGetName mark = {#call unsafe source_marker_get_name#} mark >>= peekUTFString -- | -- sourceMarkerGetBuffer :: SourceMarker -> IO SourceBuffer sourceMarkerGetBuffer mark = makeNewGObject mkSourceBuffer $ {#call unsafe source_marker_get_buffer#} mark -- | -- sourceMarkerNext :: SourceMarker -> IO SourceMarker sourceMarkerNext mark = makeNewGObject mkSourceMarker $ {#call unsafe source_marker_next#} mark -- | -- sourceMarkerPrev :: SourceMarker -> IO SourceMarker sourceMarkerPrev mark = makeNewGObject mkSourceMarker $ {#call unsafe source_marker_prev#} mark --- NEW FILE: SourceLanguage.chs --- -- -*-haskell-*- -- GIMP Toolkit (GTK) Widget SourceView -- -- Author : Duncan Coutts -- derived from GtkTextView bindings by Axel Simon -- -- Created: 14 October 2003 -- -- This file is free software; you can redistribute it and/or modify -- it under the terms of the GNU General Public License as published by -- the Free Software Foundation; either version 2 of the License, or -- (at your option) any later version. -- -- This file is distributed in the hope that it will be useful, -- but WITHOUT ANY WARRANTY; without even the implied warranty of -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -- GNU General Public License for more details. -- -- | -- module Graphics.UI.Gtk.SourceView.SourceLanguage ( SourceLanguage, sourceLanguageGetName, sourceLanguageGetSection, sourceLanguageGetTags, sourceLanguageGetEscapeChar, sourceLanguageGetMimeTypes, sourceLanguageSetMimeTypes, sourceLanguageGetStyleScheme, sourceLanguageSetStyleScheme, sourceLanguageGetTagStyle, sourceLanguageSetTagStyle, sourceLanguageGetTagDefaultStyle ) where import Monad (liftM) import System.Glib.FFI import System.Glib.UTFString import System.Glib.GList (fromGSList, toGSList) import System.Glib.GObject (makeNewGObject) import Graphics.UI.Gtk.Abstract.Object (makeNewObject) {#import Graphics.UI.Gtk.Types#} {#import Graphics.UI.Gtk.SourceView.Types#} {#import Graphics.UI.Gtk.Signals#} import Graphics.UI.Gtk.SourceView.SourceStyleScheme import Graphics.UI.Gtk.SourceView.SourceTagStyle {# context lib="gtk" prefix="gtk" #} -- methods -- | -- sourceLanguageGetName :: SourceLanguage -> IO String sourceLanguageGetName sl = {#call unsafe source_language_get_name#} sl >>= peekUTFString -- | -- sourceLanguageGetSection :: SourceLanguage -> IO String sourceLanguageGetSection sl = {#call unsafe source_language_get_section#} sl >>= peekUTFString -- | -- sourceLanguageGetTags :: SourceLanguage -> IO [SourceTag] sourceLanguageGetTags sl = do gList <- {#call unsafe source_language_get_tags#} sl wList <- fromGSList gList mapM (makeNewGObject mkSourceTag) (map return wList) -- | -- sourceLanguageGetEscapeChar :: SourceLanguage -> IO Char sourceLanguageGetEscapeChar sl = liftM (toEnum . fromEnum) $ {#call unsafe source_language_get_escape_char#} sl sourceLanguageGetMimeTypes :: SourceLanguage -> IO [String] sourceLanguageGetMimeTypes sl = do mimeTypesList <- {#call unsafe source_language_get_mime_types#} sl mimeTypesPtrs <- fromGSList mimeTypesList mapM peekUTFString mimeTypesPtrs sourceLanguageSetMimeTypes :: SourceLanguage -> [String] -> IO () sourceLanguageSetMimeTypes sl mimeTypes = do mimeTypesPtrs <- mapM newUTFString mimeTypes mimeTypesList <- toGSList mimeTypesPtrs {#call unsafe source_language_set_mime_types#} sl mimeTypesList {#call unsafe g_slist_free#} mimeTypesList -- | -- sourceLanguageGetStyleScheme :: SourceLanguage -> IO SourceStyleScheme sourceLanguageGetStyleScheme sl = makeNewGObject mkSourceStyleScheme $ {#call unsafe source_language_get_style_scheme#} sl -- | -- sourceLanguageSetStyleScheme :: SourceLanguage -> SourceStyleScheme -> IO () sourceLanguageSetStyleScheme sl ss = {#call unsafe source_language_set_style_scheme#} sl ss -- | -- sourceLanguageGetTagStyle :: SourceLanguage -> String -> IO SourceTagStyle sourceLanguageGetTagStyle sl tag = withCString tag $ \strPtr1 -> do sts <- {#call unsafe source_language_get_tag_style#} sl strPtr1 peek (castPtr sts) -- | -- sourceLanguageSetTagStyle :: SourceLanguage -> String -> SourceTagStyle -> IO () sourceLanguageSetTagStyle sl tag sts = withCString tag $ \strPtr1 -> alloca $ \sts' -> do poke sts' sts {#call unsafe source_language_set_tag_style#} sl strPtr1 (castPtr sts') -- | -- sourceLanguageGetTagDefaultStyle :: SourceLanguage -> String -> IO SourceTagStyle sourceLanguageGetTagDefaultStyle sl tag = withCString tag $ \strPtr1 -> do sts <- {#call unsafe source_language_get_tag_default_style#} sl strPtr1 peek (castPtr sts) --- NEW FILE: SourceIter.chs --- -- -*-haskell-*- -- GIMP Toolkit (GTK) SourceIter -- -- Author : Duncan Coutts -- -- Created: 15 April 2004 -- -- This file is free software; you can redistribute it and/or modify -- it under the terms of the GNU General Public License as published by -- the Free Software Foundation; either version 2 of the License, or -- (at your option) any later version. -- -- This file is distributed in the hope that it will be useful, -- but WITHOUT ANY WARRANTY; without even the implied warranty of -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -- GNU General Public License for more details. -- -- | -- -- Adds extra useful methods for "TextIter" for searching forwards and -- backwards within a region in the buffer and matching brackets. -- -- * There is no SourceIter object, just extra methods for "TextIter" -- module Graphics.UI.Gtk.SourceView.SourceIter ( sourceIterForwardSearch, sourceIterBackwardSearch, sourceIterFindMatchingBracket ) where import Monad (liftM) import Maybe (fromMaybe) import System.Glib.FFI import System.Glib.UTFString import System.Glib.GObject (makeNewGObject) import Graphics.UI.Gtk.Abstract.Object (makeNewObject) {#import Graphics.UI.Gtk.Types#} {#import Graphics.UI.Gtk.SourceView.Types#} {#import Graphics.UI.Gtk.Multiline.TextIter#} import Graphics.UI.Gtk.General.Enums (Flags(fromFlags)) {# context lib="gtk" prefix="gtk" #} {# enum SourceSearchFlags {underscoreToCase} deriving(Bounded) #} instance Flags SourceSearchFlags -- methods -- | same as 'textIterForwardSearch' but allows -- case insensitive search and possibly in the future regular expressions. -- sourceIterForwardSearch :: TextIter -> String -> [SourceSearchFlags] -> Maybe TextIter -> IO (Maybe (TextIter, TextIter)) sourceIterForwardSearch ti str flags limit = do start <- makeEmptyTextIter end <- makeEmptyTextIter found <- liftM toBool $ withUTFString str $ \cStr -> {#call unsafe source_iter_forward_search#} ti cStr ((fromIntegral.fromFlags) flags) start end (fromMaybe (TextIter nullForeignPtr) limit) return $ if found then Just (start,end) else Nothing -- | same as 'textIterForwardSearch' but allows -- case insensitive search and possibly in the future regular expressions. -- sourceIterBackwardSearch :: TextIter -> String -> [SourceSearchFlags] -> Maybe TextIter -> IO (Maybe (TextIter, TextIter)) sourceIterBackwardSearch ti str flags limit = do start <- makeEmptyTextIter end <- makeEmptyTextIter found <- liftM toBool $ withUTFString str $ \cStr -> {#call unsafe source_iter_backward_search#} ti cStr ((fromIntegral.fromFlags) flags) start end (fromMaybe (TextIter nullForeignPtr) limit) return $ if found then Just (start,end) else Nothing -- | Tries to match the bracket character -- currently at the given iter with its opening\/closing counterpart, and if -- found moves iter to the position where it was found. -- -- * the 'TextIter' must belong to a 'SourceBuffer' -- sourceIterFindMatchingBracket :: TextIter -> IO Bool sourceIterFindMatchingBracket ti = liftM toBool $ {# call unsafe source_iter_find_matching_bracket #} ti |
From: Duncan C. <dun...@us...> - 2005-01-08 16:05:17
|
Update of /cvsroot/gtk2hs/gtk2hs/sourceview/Graphics/UI/Gtk/SourceView In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9603/sourceview/Graphics/UI/Gtk/SourceView Added Files: SourceTagStyle.hsc SourceTagTable.chs SourceStyleScheme.chs Log Message: sourceview package hierarchical namespace conversion. --- NEW FILE: SourceTagStyle.hsc --- -- -*-haskell-*- -- GIMP Toolkit (GTK) SourceTagStyle -- -- Author : Duncan Coutts -- derived from GtkTextView bindings by Axel Simon -- -- Created: 20 October 2003 -- -- This file is free software; you can redistribute it and/or modify -- it under the terms of the GNU General Public License as published by -- the Free Software Foundation; either version 2 of the License, or -- (at your option) any later version. -- -- This file is distributed in the hope that it will be useful, -- but WITHOUT ANY WARRANTY; without even the implied warranty of -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -- GNU General Public License for more details. -- -- | -- module Graphics.UI.Gtk.SourceView.SourceTagStyle ( SourceTagStyle(..), ) where import Maybe (isJust, fromMaybe) import Data.Bits (testBit, bit, (.|.)) import System.Glib.FFI import Graphics.UI.Gtk.General.Structs (Color(..)) #include <gtksourceview/gtksourcetagstyle.h> data SourceTagStyleMask = SourceTagStyleUseBackground | SourceTagStyleUseForeground deriving (Eq) instance Enum SourceTagStyleMask where fromEnum SourceTagStyleUseBackground = 1 fromEnum SourceTagStyleUseForeground = 2 toEnum 1 = SourceTagStyleUseBackground toEnum 2 = SourceTagStyleUseForeground toEnum unmatched = error ("SourceTagStyleMask.toEnum: Cannot match " ++ show unmatched) data SourceTagStyle = SourceTagStyle { isDefault :: Bool, -- readonly foreground :: Maybe Color, background :: Maybe Color, italic :: Bool, bold :: Bool, underline :: Bool, strikethrough :: Bool } instance Storable SourceTagStyle where sizeOf _ = #{const sizeof(GtkSourceTagStyle)} alignment _ = alignment (undefined::#type gboolean) peek ptr = do (isDefault'::#type gboolean) <- #{peek GtkSourceTagStyle, is_default} ptr (mask::#type guint) <- #{peek GtkSourceTagStyle, mask} ptr foreground' <- peek (#{ptr GtkSourceTagStyle, foreground} ptr) background' <- peek (#{ptr GtkSourceTagStyle, background} ptr) (italic'::#type gboolean) <- #{peek GtkSourceTagStyle, italic} ptr (bold'::#type gboolean) <- #{peek GtkSourceTagStyle, bold} ptr (underline'::#type gboolean) <- #{peek GtkSourceTagStyle, underline} ptr (strikethrough'::#type gboolean) <- #{peek GtkSourceTagStyle, strikethrough} ptr return SourceTagStyle { isDefault = toBool isDefault', foreground = if mask `testBit` (fromEnum SourceTagStyleUseForeground) then Just foreground' else Nothing, background = if mask `testBit` (fromEnum SourceTagStyleUseBackground) then Just background' else Nothing, italic = toBool italic', bold = toBool bold', underline = toBool underline', strikethrough = toBool strikethrough' } poke ptr tag = do #{poke GtkSourceTagStyle, is_default} ptr (fromBool $ isDefault tag ::#type gboolean) #{poke GtkSourceTagStyle, mask} ptr ((if isJust (foreground tag) then bit (fromEnum SourceTagStyleUseForeground) else 0) .|.(if isJust (background tag) then bit (fromEnum SourceTagStyleUseBackground) else 0) ::#type guint) poke (#{ptr GtkSourceTagStyle, foreground} ptr) (fromMaybe (Color 0 0 0) (foreground tag)) poke (#{ptr GtkSourceTagStyle, background} ptr) (fromMaybe (Color 0 0 0) (background tag)) #{poke GtkSourceTagStyle, italic} ptr (fromBool $ italic tag ::#type gboolean) #{poke GtkSourceTagStyle, bold} ptr (fromBool $ bold tag ::#type gboolean) #{poke GtkSourceTagStyle, underline} ptr (fromBool $ underline tag ::#type gboolean) #{poke GtkSourceTagStyle, strikethrough} ptr (fromBool $ strikethrough tag ::#type gboolean) --- NEW FILE: SourceTagTable.chs --- -- -*-haskell-*- -- GIMP Toolkit (GTK) SourceTagTable -- -- Author : Duncan Coutts -- derived from GtkTextView bindings by Axel Simon -- -- Created: 22 October 2003 -- -- This file is free software; you can redistribute it and/or modify -- it under the terms of the GNU General Public License as published by -- the Free Software Foundation; either version 2 of the License, or -- (at your option) any later version. -- -- This file is distributed in the hope that it will be useful, -- but WITHOUT ANY WARRANTY; without even the implied warranty of -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -- GNU General Public License for more details. -- -- | -- module Graphics.UI.Gtk.SourceView.SourceTagTable ( SourceTagTable, SourceTagTableClass, sourceTagTableNew, sourceTagTableAddTags, sourceTagTableRemoveSourceTags ) where import Monad (liftM) import System.Glib.FFI import System.Glib.GList (fromGSList, toGSList) import System.Glib.GObject (makeNewGObject) {#import Graphics.UI.Gtk.Types#} {#import Graphics.UI.Gtk.SourceView.Types#} {#import Graphics.UI.Gtk.Signals#} import Graphics.UI.Gtk.SourceView.SourceTag {# context lib="gtk" prefix="gtk" #} -- methods -- | Create a new 'SourceTagTable' -- sourceTagTableNew :: IO SourceTagTable sourceTagTableNew = makeNewGObject mkSourceTagTable {#call unsafe source_tag_table_new#} -- | Add a list of tag to the table. -- -- * The added tags are assigned the highest priority in the table. If a tag is -- already present in table or has the same name as an already-added tag, then -- it is not added to the table. -- sourceTagTableAddTags :: SourceTagTable -> [SourceTag] -> IO () sourceTagTableAddTags tt tags = do let tagForeignPtrs = map (unSourceTag . toSourceTag) tags tagList <- toGSList (map foreignPtrToPtr tagForeignPtrs) {#call source_tag_table_add_tags#} tt tagList -- destroy the list fromGSList tagList -- make sure the ForeignPtrs are not gc'd while we are still using the Ptrs mapM_ touchForeignPtr tagForeignPtrs -- | -- sourceTagTableRemoveSourceTags :: SourceTagTable -> IO () sourceTagTableRemoveSourceTags tt = {#call source_tag_table_remove_source_tags#} tt -- | The source tag table has changed. -- onTagChanged, afterTagChanged :: SourceTagTableClass stt => stt -> IO () -> IO (ConnectId stt) onTagChanged = connect_NONE__NONE "changed" False afterTagChanged = connect_NONE__NONE "changed" True --- NEW FILE: SourceStyleScheme.chs --- -- -*-haskell-*- -- GIMP Toolkit (GTK) SourceStyleScheme -- -- Author : Duncan Coutts -- derived from the GtkTextView bindings by Axel Simon -- -- Created: 22 October 2003 -- -- This file is free software; you can redistribute it and/or modify -- it under the terms of the GNU General Public License as published by -- the Free Software Foundation; either version 2 of the License, or -- (at your option) any later version. -- -- This file is distributed in the hope that it will be useful, -- but WITHOUT ANY WARRANTY; without even the implied warranty of -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -- GNU General Public License for more details. -- -- | -- module Graphics.UI.Gtk.SourceView.SourceStyleScheme ( SourceStyleScheme, sourceStyleSchemeGetTagStyle, sourceStyleSchemeGetName, sourceStyleSchemeGetDefault ) where import Monad (liftM) import System.Glib.FFI import System.Glib.UTFString import System.Glib.GObject (makeNewGObject) {#import Graphics.UI.Gtk.Types#} {#import Graphics.UI.Gtk.SourceView.Types#} import Graphics.UI.Gtk.SourceView.SourceTagStyle {# context lib="gtk" prefix="gtk" #} -- methods -- | -- sourceStyleSchemeGetTagStyle :: SourceStyleScheme -> String -> IO SourceTagStyle sourceStyleSchemeGetTagStyle ss styleName = withCString styleName $ \strPtr -> do tsPtr <- {#call source_style_scheme_get_tag_style#} ss strPtr ts <- peek (castPtr tsPtr) {#call unsafe g_free#} tsPtr return ts -- | -- sourceStyleSchemeGetName :: SourceStyleScheme -> IO String sourceStyleSchemeGetName ss = {#call source_style_scheme_get_name#} ss >>= peekUTFString -- | -- sourceStyleSchemeGetDefault :: IO SourceStyleScheme sourceStyleSchemeGetDefault = makeNewGObject mkSourceStyleScheme $ liftM castPtr $ {#call source_style_scheme_get_default#} |
From: Duncan C. <dun...@us...> - 2005-01-08 16:04:32
|
Update of /cvsroot/gtk2hs/gtk2hs/sourceview/Graphics/UI/Gtk/SourceView In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9477/sourceview/Graphics/UI/Gtk/SourceView Added Files: SourceView.chs SourceTag.chs SourceBuffer.chs Log Message: sourceview package hierarchical namespace conversion. --- NEW FILE: SourceTag.chs --- -- -*-haskell-*- -- GIMP Toolkit (GTK) SourceTag -- -- Author : Duncan Coutts -- derived from GtkTextView bindings by Axel Simon -- -- Created: 22 October 2003 -- -- This file is free software; you can redistribute it and/or modify -- it under the terms of the GNU General Public License as published by -- the Free Software Foundation; either version 2 of the License, or -- (at your option) any later version. -- -- This file is distributed in the hope that it will be useful, -- but WITHOUT ANY WARRANTY; without even the implied warranty of -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -- GNU General Public License for more details. -- -- | -- module Graphics.UI.Gtk.SourceView.SourceTag ( SourceTag, syntaxTagNew, patternTagNew, keywordListTagNew, blockCommentTagNew, lineCommentTagNew, stringTagNew, sourceTagGetStyle, sourceTagSetStyle ) where import Monad (liftM) import System.Glib.FFI import System.Glib.UTFString import System.Glib.GList (toGSList, fromGSList) import System.Glib.GObject (makeNewGObject) {#import Graphics.UI.Gtk.Types#} {#import Graphics.UI.Gtk.SourceView.Types#} import Graphics.UI.Gtk.SourceView.SourceTagStyle {# context lib="gtk" prefix="gtk" #} -- methods -- | Create a new 'SourceTag' -- syntaxTagNew :: String -> String -> String -> String -> IO SourceTag syntaxTagNew id name patternStart patternEnd = makeNewGObject mkSourceTag $ liftM castPtr $ withCString id $ \strPtr1 -> withCString name $ \strPtr2 -> withCString patternStart $ \strPtr3 -> withCString patternEnd $ \strPtr4 -> {#call syntax_tag_new#} strPtr1 strPtr2 strPtr3 strPtr4 -- | Create a new 'SourceTag' -- patternTagNew :: String -> String -> String -> IO SourceTag patternTagNew id name pattern = makeNewGObject mkSourceTag $ liftM castPtr $ withCString id $ \strPtr1 -> withCString name $ \strPtr2 -> withCString pattern $ \strPtr3 -> {#call unsafe pattern_tag_new#} strPtr1 strPtr2 strPtr3 -- | Create a new 'SourceTag'. -- keywordListTagNew :: String -> String -> [String] -> Bool -> Bool -> Bool -> String -> String -> IO SourceTag keywordListTagNew id name keywords caseSensitive matchEmptyStringAtBeginning matchEmptyStringAtEnd beginningRegex endRegex = do keywordPtrs <- mapM newUTFString keywords keywordList <- toGSList keywordPtrs obj <- makeNewGObject mkSourceTag $ liftM castPtr $ withCString id $ \strPtr1 -> withCString name $ \strPtr2 -> withCString beginningRegex $ \strPtr3 -> withCString endRegex $ \strPtr4 -> {#call unsafe keyword_list_tag_new#} strPtr1 strPtr2 keywordList (fromBool caseSensitive) (fromBool matchEmptyStringAtBeginning) (fromBool matchEmptyStringAtEnd) strPtr3 strPtr4 -- destory the list fromGSList keywordList -- destory the elements mapM_ free keywordPtrs return obj -- | Create a new 'SourceTag' -- blockCommentTagNew :: String -> String -> String -> String -> IO SourceTag blockCommentTagNew = syntaxTagNew --in the C header this is just a macro -- | Create a new 'SourceTag' -- lineCommentTagNew :: String -> String -> String -> IO SourceTag lineCommentTagNew id name pattern = makeNewGObject mkSourceTag $ liftM castPtr $ withCString id $ \strPtr1 -> withCString name $ \strPtr2 -> withCString pattern $ \strPtr3 -> {#call unsafe line_comment_tag_new#} strPtr1 strPtr2 strPtr3 -- | Create a new 'SourceTag' -- stringTagNew :: String -> String -> String -> String -> Bool -> IO SourceTag stringTagNew id name patternStart patternEnd endAtLineEnd = makeNewGObject mkSourceTag $ liftM castPtr $ withCString id $ \strPtr1 -> withCString name $ \strPtr2 -> withCString patternStart $ \strPtr3 -> withCString patternEnd $ \strPtr4 -> {#call unsafe string_tag_new#} strPtr1 strPtr2 strPtr3 strPtr4 (fromBool endAtLineEnd) -- | -- sourceTagGetStyle :: SourceTag -> IO SourceTagStyle sourceTagGetStyle tag = do tsPtr <- {#call unsafe source_tag_get_style#} tag ts <- peek (castPtr tsPtr) {#call unsafe g_free#} tsPtr return ts -- | -- sourceTagSetStyle :: SourceTag -> SourceTagStyle -> IO () sourceTagSetStyle tag ts = alloca $ \tsPtr -> do poke tsPtr ts {#call unsafe source_tag_set_style#} tag (castPtr tsPtr) --- NEW FILE: SourceView.chs --- -- -*-haskell-*- -- GIMP Toolkit (GTK) Widget SourceView -- -- Author : Duncan Coutts -- derived from GtkTextView bindings by Axel Simon -- -- Created: 14 October 2003 -- -- This file is free software; you can redistribute it and/or modify -- it under the terms of the GNU General Public License as published by -- the Free Software Foundation; either version 2 of the License, or -- (at your option) any later version. -- -- This file is distributed in the hope that it will be useful, -- but WITHOUT ANY WARRANTY; without even the implied warranty of -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -- GNU General Public License for more details. -- -- | -- module Graphics.UI.Gtk.SourceView.SourceView ( SourceView, SourceViewClass, sourceViewNew, sourceViewNewWithBuffer, sourceViewSetShowLineNumbers, sourceViewGetShowLineNumbers, sourceViewSetShowLineMarkers, sourceViewGetShowLineMarkers, sourceViewSetTabsWidth, sourceViewGetTabsWidth, sourceViewSetAutoIndent, sourceViewGetAutoIndent, sourceViewSetInsertSpacesInsteadOfTabs, sourceViewGetInsertSpacesInsteadOfTabs, sourceViewSetShowMargin, sourceViewGetShowMargin, sourceViewSetMargin, sourceViewGetMargin, sourceViewSetMarkerPixbuf, sourceViewGetMarkerPixbuf, sourceViewSetSmartHomeEnd, sourceViewGetSmartHomeEnd, ) where import Monad (liftM) import System.Glib.FFI import Graphics.UI.Gtk.Abstract.Object (makeNewObject) import System.Glib.GObject (makeNewGObject) {#import Graphics.UI.Gtk.Types#} {#import Graphics.UI.Gtk.SourceView.Types#} {#import Graphics.UI.Gtk.Signals#} import Graphics.UI.Gtk.SourceView.SourceBuffer {# context lib="gtk" prefix="gtk" #} -- methods -- | Create a new 'SourceView' widget with a default 'SourceBuffer'. -- sourceViewNew :: IO SourceView sourceViewNew = makeNewGObject mkSourceView $ liftM castPtr {#call unsafe source_view_new#} -- | Create a new 'SourceView' -- widget with the given 'SourceBuffer'. -- sourceViewNewWithBuffer :: SourceBuffer -> IO SourceView sourceViewNewWithBuffer sb = makeNewGObject mkSourceView $ liftM castPtr $ {#call unsafe source_view_new_with_buffer#} sb -- | -- sourceViewSetShowLineNumbers :: SourceViewClass sv => sv -> Bool -> IO () sourceViewSetShowLineNumbers sv newVal = {#call unsafe source_view_set_show_line_numbers#} (toSourceView sv) (fromBool newVal) -- | -- sourceViewGetShowLineNumbers :: SourceViewClass sv => sv -> IO Bool sourceViewGetShowLineNumbers sv = liftM toBool $ {#call unsafe source_view_get_show_line_numbers#} (toSourceView sv) -- | -- sourceViewSetShowLineMarkers :: SourceViewClass sv => sv -> Bool -> IO () sourceViewSetShowLineMarkers sv newVal = {#call unsafe source_view_set_show_line_markers#} (toSourceView sv) (fromBool newVal) -- | -- sourceViewGetShowLineMarkers :: SourceViewClass sv => sv -> IO Bool sourceViewGetShowLineMarkers sv = liftM toBool $ {#call unsafe source_view_get_show_line_markers#} (toSourceView sv) -- | -- sourceViewSetTabsWidth :: SourceViewClass sv => sv -> Int -> IO () sourceViewSetTabsWidth sv width = {#call unsafe source_view_set_tabs_width#} (toSourceView sv) (fromIntegral width) -- | -- sourceViewGetTabsWidth :: SourceViewClass sv => sv -> IO Int sourceViewGetTabsWidth sv = liftM fromIntegral $ {#call unsafe source_view_get_tabs_width#} (toSourceView sv) -- | -- sourceViewSetAutoIndent :: SourceViewClass sv => sv -> Bool -> IO () sourceViewSetAutoIndent sv newVal = {#call unsafe source_view_set_auto_indent#} (toSourceView sv) (fromBool newVal) -- | -- sourceViewGetAutoIndent :: SourceViewClass sv => sv -> IO Bool sourceViewGetAutoIndent sv = liftM toBool $ {#call unsafe source_view_get_auto_indent#} (toSourceView sv) -- | -- sourceViewSetInsertSpacesInsteadOfTabs :: SourceViewClass sv => sv -> Bool -> IO () sourceViewSetInsertSpacesInsteadOfTabs sv newVal = {#call unsafe source_view_set_insert_spaces_instead_of_tabs#} (toSourceView sv) (fromBool newVal) -- | -- sourceViewGetInsertSpacesInsteadOfTabs :: SourceViewClass sv => sv -> IO Bool sourceViewGetInsertSpacesInsteadOfTabs sv = liftM toBool $ {#call unsafe source_view_get_insert_spaces_instead_of_tabs#} (toSourceView sv) -- | -- sourceViewSetShowMargin :: SourceViewClass sv => sv -> Bool -> IO () sourceViewSetShowMargin sv newVal = {#call unsafe source_view_set_show_margin#} (toSourceView sv) (fromBool newVal) -- | -- sourceViewGetShowMargin :: SourceViewClass sv => sv -> IO Bool sourceViewGetShowMargin sv = liftM toBool $ {#call unsafe source_view_get_show_margin#} (toSourceView sv) -- | -- sourceViewSetMargin :: SourceViewClass sv => sv -> Int -> IO () sourceViewSetMargin sv margin = {#call unsafe source_view_set_margin#} (toSourceView sv) (fromIntegral margin) -- | -- sourceViewGetMargin :: SourceViewClass sv => sv -> IO Int sourceViewGetMargin sv = liftM fromIntegral $ {#call unsafe source_view_get_margin#} (toSourceView sv) -- | -- sourceViewSetMarkerPixbuf :: SourceViewClass sv => sv -> String -> Pixbuf -> IO () sourceViewSetMarkerPixbuf sv markerType marker = withCString markerType $ \strPtr -> {#call unsafe source_view_set_marker_pixbuf#} (toSourceView sv) strPtr marker -- | -- sourceViewGetMarkerPixbuf :: SourceViewClass sv => sv -> String -> IO Pixbuf sourceViewGetMarkerPixbuf sv markerType = withCString markerType $ \strPtr -> makeNewGObject mkPixbuf $ {#call unsafe source_view_get_marker_pixbuf#} (toSourceView sv) strPtr -- | -- sourceViewSetSmartHomeEnd :: SourceViewClass sv => sv -> Bool -> IO () sourceViewSetSmartHomeEnd sv newVal = {#call unsafe source_view_set_smart_home_end#} (toSourceView sv) (fromBool newVal) -- | -- sourceViewGetSmartHomeEnd :: SourceViewClass sv => sv -> IO Bool sourceViewGetSmartHomeEnd sv = liftM toBool $ {#call unsafe source_view_get_smart_home_end#} (toSourceView sv) --- NEW FILE: SourceBuffer.chs --- -- -*-haskell-*- -- GIMP Toolkit (GTK) SourceBuffer -- -- Author : Duncan Coutts -- derived from GtkTextView bindings by Axel Simon -- -- Created: 15 October 2003 -- -- This file is free software; you can redistribute it and/or modify -- it under the terms of the GNU General Public License as published by -- the Free Software Foundation; either version 2 of the License, or -- (at your option) any later version. -- -- This file is distributed in the hope that it will be useful, -- but WITHOUT ANY WARRANTY; without even the implied warranty of -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -- GNU General Public License for more details. -- -- | -- module Graphics.UI.Gtk.SourceView.SourceBuffer ( SourceBuffer, SourceBufferClass, sourceBufferNew, sourceBufferNewWithLanguage, sourceBufferSetCheckBrackets, sourceBufferGetCheckBrackets, sourceBufferSetBracketsMatchStyle, sourceBufferSetHighlight, sourceBufferGetHighlight, sourceBufferSetMaxUndoLevels, sourceBufferGetMaxUndoLevels, sourceBufferSetLanguage, sourceBufferGetLanguage, sourceBufferSetEscapeChar, sourceBufferGetEscapeChar, sourceBufferCanUndo, sourceBufferCanRedo, sourceBufferUndo, sourceBufferRedo, sourceBufferBeginNotUndoableAction, sourceBufferEndNotUndoableAction, sourceBufferCreateMarker, sourceBufferMoveMarker, sourceBufferDeleteMarker, sourceBufferGetMarker, sourceBufferGetMarkersInRegion, sourceBufferGetFirstMarker, sourceBufferGetLastMarker, sourceBufferGetIterAtMarker, sourceBufferGetNextMarker, sourceBufferGetPrevMarker ) where import Monad (liftM) import Maybe (fromMaybe) import System.Glib.FFI import System.Glib.GList (fromGSList) import System.Glib.GObject (makeNewGObject) import Graphics.UI.Gtk.Abstract.Object (makeNewObject) {#import Graphics.UI.Gtk.Types#} {#import Graphics.UI.Gtk.SourceView.Types#} {#import Graphics.UI.Gtk.Signals#} import Graphics.UI.Gtk.SourceView.SourceTagStyle import Graphics.UI.Gtk.SourceView.SourceMarker {#import Graphics.UI.Gtk.Multiline.TextIter#} {# context lib="gtk" prefix="gtk" #} -- methods -- | Create a new 'SourceBuffer', possibly -- taking a 'SourceTagTable'. -- sourceBufferNew :: Maybe SourceTagTable -> IO SourceBuffer sourceBufferNew tt = makeNewGObject mkSourceBuffer $ {#call unsafe source_buffer_new#} (fromMaybe (mkSourceTagTable nullForeignPtr) tt) -- | Create a new 'SourceBuffer' -- with a 'SourceLanguage'. -- sourceBufferNewWithLanguage :: SourceLanguage -> IO SourceBuffer sourceBufferNewWithLanguage lang = makeNewGObject mkSourceBuffer $ {#call unsafe source_buffer_new_with_language#} lang -- | -- sourceBufferSetCheckBrackets :: SourceBuffer -> Bool -> IO () sourceBufferSetCheckBrackets sb newVal = {#call unsafe source_buffer_set_check_brackets#} sb (fromBool newVal) -- | -- sourceBufferGetCheckBrackets :: SourceBuffer -> IO Bool sourceBufferGetCheckBrackets sb = liftM toBool $ {#call unsafe source_buffer_get_check_brackets#} sb -- | -- sourceBufferSetBracketsMatchStyle :: SourceBuffer -> SourceTagStyle -> IO () sourceBufferSetBracketsMatchStyle sb ts = alloca $ \tsPtr -> do poke tsPtr ts {#call unsafe source_buffer_set_bracket_match_style#} sb (castPtr tsPtr) -- | -- sourceBufferSetHighlight :: SourceBuffer -> Bool -> IO () sourceBufferSetHighlight sb newVal = {#call unsafe source_buffer_set_highlight#} sb (fromBool newVal) -- | -- sourceBufferGetHighlight :: SourceBuffer -> IO Bool sourceBufferGetHighlight sb = liftM toBool $ {#call unsafe source_buffer_get_highlight#} sb -- | -- sourceBufferSetMaxUndoLevels :: SourceBuffer -> Int -> IO () sourceBufferSetMaxUndoLevels sb newVal = {#call unsafe source_buffer_set_max_undo_levels#} sb (fromIntegral newVal) -- | -- sourceBufferGetMaxUndoLevels :: SourceBuffer -> IO Int sourceBufferGetMaxUndoLevels sb = liftM fromIntegral $ {#call unsafe source_buffer_get_max_undo_levels#} sb -- | -- sourceBufferSetLanguage :: SourceBuffer -> SourceLanguage -> IO () sourceBufferSetLanguage sb lang = {#call unsafe source_buffer_set_language#} sb lang -- | -- sourceBufferGetLanguage :: SourceBuffer -> IO SourceLanguage sourceBufferGetLanguage sb = makeNewGObject mkSourceLanguage $ {#call unsafe source_buffer_get_language#} sb -- | -- sourceBufferSetEscapeChar :: SourceBuffer -> Char -> IO () sourceBufferSetEscapeChar sb char = {#call unsafe source_buffer_set_escape_char#} sb ((toEnum . fromEnum) char) -- | -- sourceBufferGetEscapeChar :: SourceBuffer -> IO Char sourceBufferGetEscapeChar sb = liftM (toEnum . fromEnum) $ {#call unsafe source_buffer_get_escape_char#} sb -- | -- sourceBufferCanUndo :: SourceBuffer -> IO Bool sourceBufferCanUndo sb = liftM toBool $ {#call unsafe source_buffer_can_undo#} sb -- | -- sourceBufferCanRedo :: SourceBuffer -> IO Bool sourceBufferCanRedo sb = liftM toBool $ {#call unsafe source_buffer_can_redo#} sb -- | -- sourceBufferUndo :: SourceBuffer -> IO () sourceBufferUndo sb = {#call source_buffer_undo#} sb -- | -- sourceBufferRedo :: SourceBuffer -> IO () sourceBufferRedo sb = {#call source_buffer_redo#} sb -- | -- sourceBufferBeginNotUndoableAction :: SourceBuffer -> IO () sourceBufferBeginNotUndoableAction sb = {#call source_buffer_begin_not_undoable_action#} sb -- | -- sourceBufferEndNotUndoableAction :: SourceBuffer -> IO () sourceBufferEndNotUndoableAction sb = {#call source_buffer_end_not_undoable_action#} sb -- | -- sourceBufferCreateMarker :: SourceBuffer -> String -> String -> TextIter -> IO SourceMarker sourceBufferCreateMarker sb name markerType iter = makeNewGObject mkSourceMarker $ withCString name $ \strPtr1 -> withCString markerType $ \strPtr2 -> {#call source_buffer_create_marker#} sb strPtr1 strPtr2 iter -- | -- sourceBufferMoveMarker :: SourceBuffer -> SourceMarker -> TextIter -> IO () sourceBufferMoveMarker sb mark iter = {#call source_buffer_move_marker#} sb mark iter -- | -- sourceBufferDeleteMarker :: SourceBuffer -> SourceMarker -> IO () sourceBufferDeleteMarker sb mark = {#call source_buffer_delete_marker#} sb mark -- | -- sourceBufferGetMarker :: SourceBuffer -> String -> IO SourceMarker sourceBufferGetMarker sb name = makeNewGObject mkSourceMarker $ withCString name $ \strPtr1 -> {#call unsafe source_buffer_get_marker#} sb strPtr1 -- | -- sourceBufferGetMarkersInRegion :: SourceBuffer -> TextIter -> TextIter -> IO [SourceMarker] sourceBufferGetMarkersInRegion sb begin end = do gList <- {#call unsafe source_buffer_get_markers_in_region#} sb begin end wList <- fromGSList gList mapM (makeNewGObject mkSourceMarker) (map return wList) -- | -- sourceBufferGetFirstMarker :: SourceBuffer -> IO SourceMarker sourceBufferGetFirstMarker sb = makeNewGObject mkSourceMarker $ {#call unsafe source_buffer_get_first_marker#} sb -- | -- sourceBufferGetLastMarker :: SourceBuffer -> IO SourceMarker sourceBufferGetLastMarker sb = makeNewGObject mkSourceMarker $ {#call unsafe source_buffer_get_last_marker#} sb -- | -- sourceBufferGetIterAtMarker :: SourceBuffer -> SourceMarker -> IO TextIter sourceBufferGetIterAtMarker sb mark = do iter <- makeEmptyTextIter {#call unsafe source_buffer_get_iter_at_marker#} sb iter mark return iter -- | -- sourceBufferGetNextMarker :: SourceBuffer -> TextIter -> IO (Maybe SourceMarker) sourceBufferGetNextMarker sb iter = do markPtr <- {#call unsafe source_buffer_get_next_marker#} sb iter if markPtr==nullPtr then return Nothing else liftM Just $ makeNewGObject mkSourceMarker (return markPtr) -- | -- sourceBufferGetPrevMarker :: SourceBuffer -> TextIter -> IO (Maybe SourceMarker) sourceBufferGetPrevMarker sb iter = do markPtr <- {#call unsafe source_buffer_get_prev_marker#} sb iter if markPtr==nullPtr then return Nothing else liftM Just $ makeNewGObject mkSourceMarker (return markPtr) |
From: Duncan C. <dun...@us...> - 2005-01-08 16:03:08
|
Update of /cvsroot/gtk2hs/gtk2hs In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9130 Modified Files: ChangeLog Log Message: sourceview package hierarchical namespace conversion. Index: ChangeLog =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/ChangeLog,v retrieving revision 1.267 retrieving revision 1.268 diff -u -d -r1.267 -r1.268 --- ChangeLog 8 Jan 2005 15:57:05 -0000 1.267 +++ ChangeLog 8 Jan 2005 16:02:56 -0000 1.268 @@ -145,6 +145,20 @@ * glade/Graphics/UI/Gtk/Glade.chs: glade package hierarchical namespace conversion. + * sourceview/Graphics/UI/Gtk/SourceView/SourceBuffer.chs + sourceview/Graphics/UI/Gtk/SourceView/SourceIter.chs + sourceview/Graphics/UI/Gtk/SourceView/SourceIter.chs + sourceview/Graphics/UI/Gtk/SourceView/SourceLanguage.chs + sourceview/Graphics/UI/Gtk/SourceView/SourceLanguagesManager.chs + sourceview/Graphics/UI/Gtk/SourceView/SourceMarker.chs + sourceview/Graphics/UI/Gtk/SourceView/SourceStyleScheme.chs + sourceview/Graphics/UI/Gtk/SourceView/SourceTag.chs + sourceview/Graphics/UI/Gtk/SourceView/SourceTagStyle.hsc + sourceview/Graphics/UI/Gtk/SourceView/SourceTagTable.chs + sourceview/Graphics/UI/Gtk/SourceView/SourceView.chs + sourceview/Graphics/UI/Gtk/SourceView.hs: sourceview package + hierarchical namespace conversion. + 2005-01-07 Duncan Coutts <du...@co...> * tools/apiGen/ApiGen.hs: several documentation improvements, add |
From: Duncan C. <dun...@us...> - 2005-01-08 16:03:08
|
Update of /cvsroot/gtk2hs/gtk2hs/sourceview/Graphics/UI/Gtk In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9130/sourceview/Graphics/UI/Gtk Added Files: SourceView.hs Log Message: sourceview package hierarchical namespace conversion. --- NEW FILE: SourceView.hs --- -- -*-haskell-*- -- GIMP Toolkit (GTK) Widget SourceView -- -- Author : Duncan Coutts -- derived from GtkTextView bindings by Axel Simon -- -- Created: 14 October 2003 -- -- This file is free software; you can redistribute it and/or modify -- it under the terms of the GNU General Public License as published by -- the Free Software Foundation; either version 2 of the License, or -- (at your option) any later version. -- -- This file is distributed in the hope that it will be useful, -- but WITHOUT ANY WARRANTY; without even the implied warranty of -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -- GNU General Public License for more details. -- -- | -- module Graphics.UI.Gtk.SourceView ( module Graphics.UI.Gtk.SourceView.SourceView, module Graphics.UI.Gtk.SourceView.SourceBuffer, module Graphics.UI.Gtk.SourceView.SourceLanguage, module Graphics.UI.Gtk.SourceView.SourceLanguagesManager, module Graphics.UI.Gtk.SourceView.SourceTag, module Graphics.UI.Gtk.SourceView.SourceTagTable, module Graphics.UI.Gtk.SourceView.SourceTagStyle, module Graphics.UI.Gtk.SourceView.SourceStyleScheme, module Graphics.UI.Gtk.SourceView.SourceIter ) where import Graphics.UI.Gtk.SourceView.SourceView import Graphics.UI.Gtk.SourceView.SourceBuffer import Graphics.UI.Gtk.SourceView.SourceLanguage import Graphics.UI.Gtk.SourceView.SourceLanguagesManager import Graphics.UI.Gtk.SourceView.SourceStyleScheme import Graphics.UI.Gtk.SourceView.SourceTag import Graphics.UI.Gtk.SourceView.SourceTagTable import Graphics.UI.Gtk.SourceView.SourceTagStyle import Graphics.UI.Gtk.SourceView.SourceIter |
From: Duncan C. <dun...@us...> - 2005-01-08 15:58:32
|
Update of /cvsroot/gtk2hs/gtk2hs/sourceview/Graphics/UI/Gtk/SourceView In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8305/sourceview/Graphics/UI/Gtk/SourceView Log Message: Directory /cvsroot/gtk2hs/gtk2hs/sourceview/Graphics/UI/Gtk/SourceView added to the repository |
From: Duncan C. <dun...@us...> - 2005-01-08 15:58:32
|
Update of /cvsroot/gtk2hs/gtk2hs/sourceview/Graphics/UI In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8305/sourceview/Graphics/UI Log Message: Directory /cvsroot/gtk2hs/gtk2hs/sourceview/Graphics/UI added to the repository |
From: Duncan C. <dun...@us...> - 2005-01-08 15:58:32
|
Update of /cvsroot/gtk2hs/gtk2hs/sourceview/Graphics/UI/Gtk In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8305/sourceview/Graphics/UI/Gtk Log Message: Directory /cvsroot/gtk2hs/gtk2hs/sourceview/Graphics/UI/Gtk added to the repository |
From: Duncan C. <dun...@us...> - 2005-01-08 15:58:32
|
Update of /cvsroot/gtk2hs/gtk2hs/sourceview/Graphics In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8305/sourceview/Graphics Log Message: Directory /cvsroot/gtk2hs/gtk2hs/sourceview/Graphics added to the repository |
From: Duncan C. <dun...@us...> - 2005-01-08 15:57:17
|
Update of /cvsroot/gtk2hs/gtk2hs In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8022 Modified Files: ChangeLog Log Message: glade package hierarchical namespace conversion. Index: ChangeLog =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/ChangeLog,v retrieving revision 1.266 retrieving revision 1.267 diff -u -d -r1.266 -r1.267 --- ChangeLog 8 Jan 2005 15:47:08 -0000 1.266 +++ ChangeLog 8 Jan 2005 15:57:05 -0000 1.267 @@ -142,6 +142,9 @@ gtk/Graphics/UI/Gtk/Windows/FileSel.chs, gtk/Graphics/UI/Gtk/Windows/Window.chs.pp: windows selectors + * glade/Graphics/UI/Gtk/Glade.chs: glade package hierarchical + namespace conversion. + 2005-01-07 Duncan Coutts <du...@co...> * tools/apiGen/ApiGen.hs: several documentation improvements, add |
From: Duncan C. <dun...@us...> - 2005-01-08 15:57:16
|
Update of /cvsroot/gtk2hs/gtk2hs/glade/Graphics/UI/Gtk In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8022/glade/Graphics/UI/Gtk Added Files: Glade.chs Log Message: glade package hierarchical namespace conversion. --- NEW FILE: Glade.chs --- -- GIMP Toolkit (GTK) Binding for Haskell: binding to Libglade -*-haskell-*- -- for loading XML widget specifications -- -- Author : Manuel M T Chakravarty -- Created: 13 March 2002 -- -- Version $Revision: 1.1 $ from $Date: 2005/01/08 15:57:06 $ -- -- Copyright (c) 2002 Manuel M T Chakravarty -- Modified 2003 by Duncan Coutts (gtk2hs port) -- -- This library is free software; you can redistribute it and/or -- modify it under the terms of the GNU Library General Public -- License as published by the Free Software Foundation; either -- version 2 of the License, or (at your option) any later version. -- -- This library is distributed in the hope that it will be useful, -- but WITHOUT ANY WARRANTY; without even the implied warranty of -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -- Library General Public License for more details. -- -- | -- -- Libglade facilitates loading of XML specifications of whole widget trees -- that have been interactively designed with the GUI builder Glade. The -- present module exports operations for manipulating 'GladeXML' objects. -- -- @glade_xml_signal_autoconnect()@ is not supported. The C variant is not -- suitable for Haskell as @-rdynamic@ leads to huge executable and we -- usually don't want to connect staticly named functions, but closures. -- -- * @glade_xml_construct()@ is not bound, as it doesn't seem to be useful -- in Haskell. As usual, the @signal_connect_data@ variant for -- registering signal handlers isn't bound either. Moreover, the -- @connect_full@ functions are not bound. -- -- * This binding does not support Libglade functionality that is -- exclusively meant for extending Libglade with new widgets. Like new -- widgets, such functionality is currently expected to be implemented in -- C. -- module Graphics.UI.Gtk.Glade ( -- * Data types -- GladeXMLClass, GladeXML, -- * Creation operations -- xmlNew, xmlNewWithRootAndDomain, -- * Obtaining widget handles -- xmlGetWidget, xmlGetWidgetRaw ) where import Monad (liftM) import System.Glib.FFI import System.Glib.GType import Graphics.UI.Gtk.Abstract.Object (makeNewObject) import System.Glib.GObject (makeNewGObject) {#import Graphics.UI.Gtk.Types#} {#import Graphics.UI.Gtk.Glade.Types#} import System.Glib.GList {#context lib="glade" prefix ="glade"#} -- | Create a new XML object (and the corresponding -- widgets) from the given XML file; corresponds to -- 'xmlNewWithRootAndDomain', but without the ability to specify a root -- widget or translation domain. -- xmlNew :: FilePath -> IO (Maybe GladeXML) xmlNew file = withCString file $ \strPtr1 -> do xmlPtr <- {#call unsafe xml_new#} strPtr1 nullPtr nullPtr if xmlPtr==nullPtr then return Nothing else liftM Just $ makeNewGObject mkGladeXML (return xmlPtr) -- | Create a new GladeXML object (and -- the corresponding widgets) from the given XML file with an optional -- root widget and translation domain. -- -- * If the second argument is not @Nothing@, the interface will only be built -- from the widget whose name is given. This feature is useful if you only -- want to build say a toolbar or menu from the XML file, but not the window -- it is embedded in. Note also that the XML parse tree is cached to speed -- up creating another \'XML\' object for the same file. -- xmlNewWithRootAndDomain :: FilePath -> Maybe String -> Maybe String -> IO (Maybe GladeXML) xmlNewWithRootAndDomain file rootWidgetName domain = withCString file $ \strPtr1 -> withMaybeCString rootWidgetName $ \strPtr2 -> withMaybeCString domain $ \strPtr3 -> do xmlPtr <- {#call unsafe xml_new#} strPtr1 strPtr2 strPtr3 if xmlPtr==nullPtr then return Nothing else liftM Just $ makeNewGObject mkGladeXML (return xmlPtr) -- | Get the widget that has the given name in -- the interface description. If the named widget cannot be found -- or is of the wrong type the result is an error. -- -- * the second parameter is the ID of the widget in the glade xml -- file, eg \"button1\". -- -- * the third parameter should be a dynamic cast function that -- returns the type of object that you expect, eg castToButton -- xmlGetWidget :: (WidgetClass widget) => GladeXML -> (GObject -> widget) -> String -> IO widget xmlGetWidget xml cast name = do maybeWidget <- xmlGetWidgetRaw xml name return $ case maybeWidget of Just widget -> cast (toGObject widget) --the cast will return an error if the object is of the wrong type Nothing -> error $ "glade.xmlGetWidget: no object named " ++ show name ++ " in the glade file" xmlGetWidgetRaw :: GladeXML -> String -> IO (Maybe Widget) xmlGetWidgetRaw xml name = withCString name $ \strPtr1 -> do widgetPtr <- {#call unsafe xml_get_widget#} xml strPtr1 if widgetPtr==nullPtr then return Nothing else liftM Just $ makeNewObject mkWidget (return widgetPtr) -- Auxilliary routines -- ------------------- -- Marshall an optional string -- withMaybeCString :: Maybe String -> (Ptr CChar -> IO a) -> IO a withMaybeCString = maybeWith withCString |
From: Duncan C. <dun...@us...> - 2005-01-08 15:53:14
|
Update of /cvsroot/gtk2hs/gtk2hs/glade/Graphics/UI/Gtk/Glade In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7425/glade/Graphics/UI/Gtk/Glade Log Message: Directory /cvsroot/gtk2hs/gtk2hs/glade/Graphics/UI/Gtk/Glade added to the repository |