module Graphics.UI.Gtk.SourceView.SourceGutter (
SourceGutter,
SourceGutterClass,
sourceGutterGetWindow,
sourceGutterInsert,
sourceGutterReorder,
sourceGutterRemove,
sourceGutterQueueDraw,
sourceGutterView,
sourceGutterWindowType,
sourceGutterCellActivated,
sourceGutterQueryTooltip,
) where
import Control.Monad (liftM)
import Control.Monad.Reader ( runReaderT )
import Graphics.UI.Gtk.Gdk.EventM (EventM, EAny)
import Graphics.UI.Gtk.Multiline.TextView (TextWindowType (..))
import Graphics.UI.GtkInternals ( TextIter, mkTextIterCopy )
import System.Glib.Attributes
import System.Glib.FFI
import System.Glib.GObject (makeNewGObject)
import System.Glib.Properties
import System.Glib.UTFString
import Graphics.UI.Gtk.SourceView.Signals
import Graphics.UI.Gtk.SourceView.Types
sourceGutterGetWindow :: SourceGutterClass sg => sg -> IO (Maybe DrawWindow)
sourceGutterGetWindow sb =
maybeNull (makeNewGObject mkDrawWindow) $
(\(SourceGutter arg1) -> withForeignPtr arg1 $ \argPtr1 ->gtk_source_gutter_get_window argPtr1) (toSourceGutter sb)
sourceGutterInsert :: (CellRendererClass cell, SourceGutterClass sg) => sg
-> cell
-> Int
-> IO ()
sourceGutterInsert gutter renderer position =
(\(SourceGutter arg1) (CellRenderer arg2) arg3 -> withForeignPtr arg1 $ \argPtr1 ->withForeignPtr arg2 $ \argPtr2 ->gtk_source_gutter_insert argPtr1 argPtr2 arg3)
(toSourceGutter gutter)
(toCellRenderer renderer)
(fromIntegral position)
sourceGutterReorder :: (CellRendererClass cell, SourceGutterClass sg) => sg
-> cell
-> Int
-> IO ()
sourceGutterReorder gutter renderer position =
(\(SourceGutter arg1) (CellRenderer arg2) arg3 -> withForeignPtr arg1 $ \argPtr1 ->withForeignPtr arg2 $ \argPtr2 ->gtk_source_gutter_reorder argPtr1 argPtr2 arg3)
(toSourceGutter gutter)
(toCellRenderer renderer)
(fromIntegral position)
sourceGutterRemove :: (CellRendererClass cell, SourceGutterClass sg) => sg
-> cell
-> IO ()
sourceGutterRemove gutter renderer =
(\(SourceGutter arg1) (CellRenderer arg2) -> withForeignPtr arg1 $ \argPtr1 ->withForeignPtr arg2 $ \argPtr2 ->gtk_source_gutter_remove argPtr1 argPtr2)
(toSourceGutter gutter)
(toCellRenderer renderer)
sourceGutterQueueDraw :: SourceGutterClass sg => sg -> IO ()
sourceGutterQueueDraw sb =
(\(SourceGutter arg1) -> withForeignPtr arg1 $ \argPtr1 ->gtk_source_gutter_queue_draw argPtr1) (toSourceGutter sb)
sourceGutterView :: SourceGutterClass sg => Attr sg SourceView
sourceGutterView = newAttrFromObjectProperty "view"
gtk_source_view_get_type
sourceGutterWindowType :: SourceGutterClass sg => Attr sg TextWindowType
sourceGutterWindowType = newAttrFromEnumProperty "window-type"
gtk_text_window_type_get_type
sourceGutterCellActivated :: SourceGutterClass sg => Signal sg (CellRenderer -> TextIter -> EventM EAny ())
sourceGutterCellActivated =
Signal (\after obj fun ->
connect_OBJECT_PTR_BOXED__NONE "cell-activated" mkTextIterCopy after obj
(\cr eventPtr iter -> runReaderT (fun cr iter) eventPtr)
)
sourceGutterQueryTooltip :: SourceGutterClass sg => Signal sg (CellRenderer -> TextIter -> Tooltip -> IO Bool)
sourceGutterQueryTooltip =
Signal $ connect_OBJECT_BOXED_OBJECT__BOOL "query-tooltip" mkTextIterCopy
foreign import ccall safe "gtk_source_gutter_get_window"
gtk_source_gutter_get_window :: ((Ptr SourceGutter) -> (IO (Ptr DrawWindow)))
foreign import ccall safe "gtk_source_gutter_insert"
gtk_source_gutter_insert :: ((Ptr SourceGutter) -> ((Ptr CellRenderer) -> (CInt -> (IO ()))))
foreign import ccall safe "gtk_source_gutter_reorder"
gtk_source_gutter_reorder :: ((Ptr SourceGutter) -> ((Ptr CellRenderer) -> (CInt -> (IO ()))))
foreign import ccall safe "gtk_source_gutter_remove"
gtk_source_gutter_remove :: ((Ptr SourceGutter) -> ((Ptr CellRenderer) -> (IO ())))
foreign import ccall safe "gtk_source_gutter_queue_draw"
gtk_source_gutter_queue_draw :: ((Ptr SourceGutter) -> (IO ()))
foreign import ccall unsafe "gtk_source_view_get_type"
gtk_source_view_get_type :: CUInt
foreign import ccall unsafe "gtk_text_window_type_get_type"
gtk_text_window_type_get_type :: CUInt