From: Duncan C. <dun...@us...> - 2004-07-30 16:39:03
|
Update of /cvsroot/gtk2hs/gtk2hs/gtk/misc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10993/gtk/misc Modified Files: Calendar.chs EventBox.chs HandleBox.chs Log Message: added missing functions, or functions that were new in gtk-2.4 removed a function that is no longer needed from general/Structs.hsc Index: EventBox.chs =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/misc/EventBox.chs,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- EventBox.chs 23 May 2004 16:07:53 -0000 1.5 +++ EventBox.chs 30 Jul 2004 16:38:52 -0000 1.6 @@ -1,3 +1,4 @@ +{-# OPTIONS -cpp #-} -- -*-haskell-*- -- GIMP Toolkit (GTK) Widget EventBox -- @@ -28,11 +29,19 @@ -- -- * check: Is this widget useful? -- +#include <gtk/gtkversion.h> + module EventBox( EventBox, EventBoxClass, castToEventBox, eventBoxNew +#if GTK_CHECK_VERSION(2,4,0) + ,eventBoxSetVisibleWindow, + eventBoxGetVisibleWindow, + eventBoxSetAboveChild, + eventBoxGetAboveChild +#endif ) where import Monad (liftM) @@ -52,3 +61,36 @@ eventBoxNew = makeNewObject mkEventBox $ liftM castPtr {#call unsafe event_box_new#} +#if GTK_CHECK_VERSION(2,4,0) +-- | Set whether the event box uses a visible or invisible child window. The +-- default is to use visible windows. The C documentation for details of what +-- difference this makes. +-- +eventBoxSetVisibleWindow :: EventBox -> Bool -> IO () +eventBoxSetVisibleWindow ebox visible = + {#call event_box_set_visible_window#} ebox (fromBool visible) + +-- | Returns whether the event box has a visible window. +-- +eventBoxGetVisibleWindow :: EventBox -> IO Bool +eventBoxGetVisibleWindow ebox = + liftM toBool $ {#call unsafe event_box_get_visible_window#} ebox + +-- | Set whether the event box window is positioned above the windows of its +-- child, as opposed to below it. +-- +-- * If the window is above, all events inside the event box will go to the +-- event box. If the window is below, events in windows of child widgets will +-- first got to that widget, and then to its parents. +-- +eventBoxSetAboveChild :: EventBox -> Bool -> IO () +eventBoxSetAboveChild ebox above = + {#call event_box_set_above_child#} ebox (fromBool above) + +-- | Returns whether the event box window is above or below the windows of its +-- child. See 'eventBoxSetAboveChild' for details. +-- +eventBoxGetAboveChild :: EventBox -> IO Bool +eventBoxGetAboveChild ebox = + liftM toBool $ {#call unsafe event_box_get_above_child#} ebox +#endif Index: HandleBox.chs =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/misc/HandleBox.chs,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- HandleBox.chs 23 May 2004 16:07:53 -0000 1.7 +++ HandleBox.chs 30 Jul 2004 16:38:52 -0000 1.8 @@ -51,9 +51,12 @@ handleBoxNew, ShadowType(..), handleBoxSetShadowType, + handleBoxGetShadowType, PositionType(..), handleBoxSetHandlePosition, + handleBoxGetHandlePosition, handleBoxSetSnapEdge, + handleBoxGetSnapEdge, onChildAttached, afterChildAttached, onChildDetached, @@ -84,12 +87,24 @@ handleBoxSetShadowType hb shadow = {#call handle_box_set_shadow_type#} (toHandleBox hb) ((fromIntegral.fromEnum) shadow) +-- | Get the shadow type of the detached box. +-- +handleBoxGetShadowType :: HandleBoxClass hb => hb -> IO ShadowType +handleBoxGetShadowType hb = liftM (toEnum.fromIntegral) $ + {#call unsafe handle_box_get_shadow_type#} (toHandleBox hb) + -- | Set the position of the handle. -- handleBoxSetHandlePosition :: HandleBoxClass hb => hb -> PositionType -> IO () handleBoxSetHandlePosition hb pos = {#call handle_box_set_handle_position#} (toHandleBox hb) ((fromIntegral.fromEnum) pos) +-- | Get the position of the handle. +-- +handleBoxGetHandlePosition :: HandleBoxClass hb => hb -> IO PositionType +handleBoxGetHandlePosition hb = liftM (toEnum.fromIntegral) $ + {#call unsafe handle_box_get_handle_position#} (toHandleBox hb) + -- | Set the snap edge of the HandleBox. -- -- * The snap edge is the edge of the detached child that must be aligned with @@ -105,6 +120,13 @@ handleBoxSetSnapEdge hb pos = {#call handle_box_set_snap_edge#} (toHandleBox hb) ((fromIntegral.fromEnum) pos) +-- | Gets the edge used for determining reattachment of the handle box. See +-- 'handleBoxSetSnapEdge'. +-- +handleBoxGetSnapEdge :: HandleBoxClass hb => hb -> IO PositionType +handleBoxGetSnapEdge hb = liftM (toEnum.fromIntegral) $ + {#call unsafe handle_box_get_snap_edge#} (toHandleBox hb) + -- signals -- | Emitted when the contents of the handlebox Index: Calendar.chs =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/misc/Calendar.chs,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- Calendar.chs 23 May 2004 16:07:53 -0000 1.4 +++ Calendar.chs 30 Jul 2004 16:38:52 -0000 1.5 @@ -1,3 +1,4 @@ +{-# OPTIONS -cpp #-} -- -*-haskell-*- -- GIMP Toolkit (GTK) Widget Calendar -- @@ -23,6 +24,7 @@ -- -- This widget shows a calendar. -- +#include <gtk/gtkversion.h> module Calendar( Calendar, @@ -35,6 +37,10 @@ calendarUnmarkDay, calendarClearMarks, calendarDisplayOptions, +#if GTK_CHECK_VERSION(2,4,0) + calendarSetDisplayOptions, + calendarGetDisplayOptions, +#endif calendarGetDate, onDaySelected, afterDaySelected, @@ -58,7 +64,7 @@ import Object (makeNewObject) {#import Hierarchy#} {#import Signal#} -import Enums (CalendarDisplayOptions(..), fromFlags) +import Enums (CalendarDisplayOptions(..), fromFlags, toFlags) {# context lib="gtk" prefix="gtk" #} @@ -112,13 +118,36 @@ calendarClearMarks :: CalendarClass c => c -> IO () calendarClearMarks cal = {#call calendar_clear_marks#} (toCalendar cal) --- | Specifies how the calendar should be --- displayed. +#if GTK_CHECK_VERSION(2,4,0) +-- | Specifies how the calendar should be displayed. +-- +calendarSetDisplayOptions :: CalendarClass c => c + -> [CalendarDisplayOptions] -> IO () +calendarSetDisplayOptions cal opts = + {#call calendar_set_display_options#} (toCalendar cal) + ((fromIntegral.fromFlags) opts) + +-- | Returns the current display options for the calendar. +-- +calendarGetDisplayOptions :: CalendarClass c => c + -> IO [CalendarDisplayOptions] +calendarGetDisplayOptions cal = liftM (toFlags.fromIntegral) $ + {#call calendar_get_display_options#} (toCalendar cal) + +-- | Depreciaded, use 'calendarSetDisplayOptions'. +-- +calendarDisplayOptions :: CalendarClass c => c + -> [CalendarDisplayOptions] -> IO () +calendarDisplayOptions = calendarSetDisplayOptions +#else + +-- | Specifies how the calendar should be displayed. -- calendarDisplayOptions :: CalendarClass c => c -> [CalendarDisplayOptions] -> IO () calendarDisplayOptions cal opts = {#call calendar_display_options#} (toCalendar cal) ((fromIntegral.fromFlags) opts) +#endif -- | Retrieve the currently selected date. -- |