packages feed

clutterhs-0.1: Graphics/UI/Clutter/ModelIter.chs

-- -*-haskell-*-
--  Clutter ModelIter
--
--  Author : Matthew Arsenault
--
--  Created: 24 Oct 2009
--
--  Copyright (C) 2009 Matthew Arsenault
--
--  This library is free software; you can redistribute it and/or
--  modify it under the terms of the GNU Lesser General Public
--  License as published by the Free Software Foundation; either
--  version 3 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
--  Lesser General Public License for more details.
--
{-# LANGUAGE ForeignFunctionInterface #-}

#include <clutter/clutter.h>

{# context lib="clutter" prefix="clutter" #}

module Graphics.UI.Clutter.ModelIter (
-- * ModelIter
  ModelIter,
  ModelIterClass,

-- * Methods
  modelIterCopy,
--modelIterGet,
--modelIterGetValue,
--modelIterSet,
--modelIterSetValue,
  modelIterIsFirst,
  modelIterIsLast,
  modelIterNext,
  modelIterPrev,
  modelIterGetModel,
  modelIterGetRow,

-- * Attributes
  modelIterModel,
  modelIterRow
  ) where

{# import Graphics.UI.Clutter.Types #}

import C2HS
import Control.Monad (liftM)
import System.Glib.Attributes
import System.Glib.Properties
import System.Glib.GType
import qualified System.Glib.GTypeConstants as GType

{# fun unsafe model_iter_copy as ^ { withModelIter* `ModelIter' } -> `ModelIter' newModelIter* #}


{# fun unsafe model_iter_is_first as ^ { withModelIter* `ModelIter' } -> `Bool' #}
{# fun unsafe model_iter_is_last as ^ { withModelIter* `ModelIter' } -> `Bool' #}

{# fun unsafe model_iter_next as ^ { withModelIter* `ModelIter' } -> `ModelIter' newModelIter* #}

{# fun unsafe model_iter_prev as ^ { withModelIter* `ModelIter' } -> `ModelIter' newModelIter* #}

{# fun unsafe model_iter_get_model as ^ { withModelIter* `ModelIter' } -> `Model' newModel* #}


{# fun unsafe model_iter_get_row as ^ { withModelIter* `ModelIter' } -> `Word' cIntConv #}


-- Attributes

-- CHECKME: Makes sense to be read only, and no set
--function (but get function), but clutter doc says Read/Write next to
--it

-- | The row number to which this iter points to.
--
-- Default value: 0
--
-- * Since 0.6
--
modelIterRow :: ReadAttr ModelIter Word
modelIterRow = readNamedAttr "row" modelIterGetRow


-- | A reference to the 'Model' that this iter belongs to.
--
-- * Since 0.6
--
modelIterModel :: ReadAttr ModelIter Model
modelIterModel = readNamedAttr "model" modelIterGetModel