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...> - 2004-07-30 16:47:34
|
Update of /cvsroot/gtk2hs/gtk2hs In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12487 Modified Files: ChangeLog Log Message: new files to mark unbound functions, for use with the api coverage tool. Also, change makefile to filter gtk.coverage so we get less noise in the diff. Index: ChangeLog =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/ChangeLog,v retrieving revision 1.197 retrieving revision 1.198 diff -u -d -r1.197 -r1.198 --- ChangeLog 30 Jul 2004 16:38:51 -0000 1.197 +++ ChangeLog 30 Jul 2004 16:46:54 -0000 1.198 @@ -17,6 +17,14 @@ * gtk/general/Structs.hsc: remove unneeded CheckMenuItem function. + * tk/misc/api.ignore, gtk/treeList/api.ignore, gtk/entry/api.ignore + gtk/abstract/api.ignore, gtk/general/api.ignore, gtk/windows/api.ignore + gtk/menuComboToolbar/api.ignore, gtk/layout/api.ignore: new files to + mark unbound functions, for use with the api coverage tool. + + * tools/apicoverage/Makefile: filter gtk.coverage too to reduce noise. + This ignores where we are currently implementing deprecated functions. + 2004-07-29 Duncan Coutts <du...@co...> * gtk/general/General.chs: don't use depreciated gtk main loop |
From: Duncan C. <dun...@us...> - 2004-07-30 16:47:07
|
Update of /cvsroot/gtk2hs/gtk2hs/tools/apicoverage In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12487/tools/apicoverage Modified Files: Makefile Log Message: new files to mark unbound functions, for use with the api coverage tool. Also, change makefile to filter gtk.coverage so we get less noise in the diff. Index: Makefile =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/tools/apicoverage/Makefile,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- Makefile 29 Jul 2004 14:33:18 -0000 1.1 +++ Makefile 30 Jul 2004 16:46:57 -0000 1.2 @@ -35,6 +35,9 @@ gtk.def.filtered : gtk.def exclude gtk.ignore.combined ./exclude gtk.ignore.combined < gtk.def > gtk.def.filtered +gtk.coverage.filtered : gtk.coverage exclude gtk.ignore.combined + ./exclude gtk.ignore.combined < gtk.coverage > gtk.coverage.filtered + exclude : Exclude.hs ghc --make Exclude.hs -o exclude @@ -45,12 +48,13 @@ gtk_total=$(shell wc -l < gtk.def.filtered) gtk2hs_total=$(shell wc -l < gtk.coverage) -stats : gtk.def.filtered gtk.coverage +stats : gtk.def.filtered gtk.coverage.filtered @echo "**** gtk2hs API coverage report (for gtk-$(GTK_VERSION)) ****" @echo " total gtk functions :" $(gtk_total) @echo " total gtk2hs functions :" $(gtk2hs_total) @echo " difference :" `echo $(gtk_total) - $(gtk2hs_total) | bc` @echo; echo "run 'diff gtk.def.filtered gtk.coverage' to see in detail" + @echo " or 'diff gtk.def.filtered gtk.coverage.filtered' for less noise" debug: @echo GTK_IGNORE_FILES = $(GTK_IGNORE_FILES) |
From: Duncan C. <dun...@us...> - 2004-07-30 16:47:06
|
Update of /cvsroot/gtk2hs/gtk2hs/gtk/layout In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12487/gtk/layout Added Files: api.ignore Log Message: new files to mark unbound functions, for use with the api coverage tool. Also, change makefile to filter gtk.coverage so we get less noise in the diff. --- NEW FILE: api.ignore --- #deprecated button box functions exclude gtk_[hv]button_box_[gs]et_spacing_default exclude gtk_[hv]button_box_[gs]et_layout_default |
From: Duncan C. <dun...@us...> - 2004-07-30 16:47:05
|
Update of /cvsroot/gtk2hs/gtk2hs/gtk/menuComboToolbar In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12487/gtk/menuComboToolbar Added Files: api.ignore Log Message: new files to mark unbound functions, for use with the api coverage tool. Also, change makefile to filter gtk.coverage so we get less noise in the diff. --- NEW FILE: api.ignore --- #deprecated exclude gtk_check_menu_item_set_show_toggle #emits the signal, seems internal exclude gtk_check_menu_item_toggled |
From: Duncan C. <dun...@us...> - 2004-07-30 16:47:05
|
Update of /cvsroot/gtk2hs/gtk2hs/gtk/general In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12487/gtk/general Added Files: api.ignore Log Message: new files to mark unbound functions, for use with the api coverage tool. Also, change makefile to filter gtk.coverage so we get less noise in the diff. --- NEW FILE: api.ignore --- #internal functions exclude gtk_binary_age exclude gtk_interface_age exclude gtk_check_version |
From: Duncan C. <dun...@us...> - 2004-07-30 16:47:05
|
Update of /cvsroot/gtk2hs/gtk2hs/gtk/abstract In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12487/gtk/abstract Added Files: api.ignore Log Message: new files to mark unbound functions, for use with the api coverage tool. Also, change makefile to filter gtk.coverage so we get less noise in the diff. --- NEW FILE: api.ignore --- #deprecated button box functions exclude gtk_button_box_[gs]et_child_size exclude gtk_button_box_[gs]et_child_ipadding #deprecated container functions exclude gtk_container_foreach_full #cannot bind varargs functions exclude gtk_container_add_with_properties #internal/implementation stuff exclude gtk_container_class exclude gtk_container_propagate_expose exclude gtk_container_forall exclude gtk_scale_get_layout #somewhat internal api exclude gtk_container_child do not exclude gtk_container_child_[sg]et_property |
From: Duncan C. <dun...@us...> - 2004-07-30 16:47:04
|
Update of /cvsroot/gtk2hs/gtk2hs/gtk/windows In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12487/gtk/windows Added Files: api.ignore Log Message: new files to mark unbound functions, for use with the api coverage tool. Also, change makefile to filter gtk.coverage so we get less noise in the diff. --- NEW FILE: api.ignore --- # these functins are totally undocumented # I suspect they may be for the frame buffer backend exclude gtk_decorated_window #don't add any new functions to old file slection dialog API exclude gtk_file_selection #can't bind varargs functions, they are only for convenience anyway exclude gtk_dialog_add_buttons exclude gtk_dialog_new_with_buttons |
From: Duncan C. <dun...@us...> - 2004-07-30 16:47:04
|
Update of /cvsroot/gtk2hs/gtk2hs/gtk/entry In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12487/gtk/entry Added Files: api.ignore Log Message: new files to mark unbound functions, for use with the api coverage tool. Also, change makefile to filter gtk.coverage so we get less noise in the diff. --- NEW FILE: api.ignore --- #deprecated exclude gtk_entry_new_with_max_length exclude gtk_entry_append_text exclude gtk_entry_prepend_text exclude gtk_entry_set_position exclude gtk_entry_select_region exclude gtk_entry_set_editable #these seem like they're only useful internally exclude gtk_entry_layout_index_to_text_index exclude gtk_entry_text_index_to_layout_index exclude gtk_entry_get_layout exclude gtk_entry_get_layout_offsets |
From: Duncan C. <dun...@us...> - 2004-07-30 16:47:03
|
Update of /cvsroot/gtk2hs/gtk2hs/gtk/treeList In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12487/gtk/treeList Added Files: api.ignore Log Message: new files to mark unbound functions, for use with the api coverage tool. Also, change makefile to filter gtk.coverage so we get less noise in the diff. --- NEW FILE: api.ignore --- # only new renderer widgets need to implement these interfaces exclude gtk_cell_editable exclude gtk_cell_layout # don't exclude whole of gtk_cell_renderer because there are several # interesting subclasses and the will be more in furture version, so exclude # individual functions exclude gtk_cell_renderer_activate exclude gtk_cell_renderer_editing_canceled exclude gtk_cell_renderer_get_ exclude gtk_cell_renderer_get_ exclude gtk_cell_renderer_render exclude gtk_cell_renderer_set_fixed_size exclude gtk_cell_renderer_start_editing #cannot find documentation on this, assume it internal exclude gtk_cell_view #a bit specialised, we dont need it exclude gtk_cell_renderer_text_set_fixed_height_from_font |
From: Duncan C. <dun...@us...> - 2004-07-30 16:47:03
|
Update of /cvsroot/gtk2hs/gtk2hs/gtk/misc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12487/gtk/misc Added Files: api.ignore Log Message: new files to mark unbound functions, for use with the api coverage tool. Also, change makefile to filter gtk.coverage so we get less noise in the diff. --- NEW FILE: api.ignore --- #for GtkAdjustment, these manually emit a signal. This is only useful if #one modifies values in the object other than the value and we do not #provide any way of doing that so ignore these functions. exclude gtk_adjustment_changed exclude gtk_adjustment_value_changed #as of 2.4 deprecated exclude gtk_calendar_display_options |
From: Duncan C. <dun...@us...> - 2004-07-30 16:39:31
|
Update of /cvsroot/gtk2hs/gtk2hs In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10993 Modified Files: ChangeLog 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: ChangeLog =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/ChangeLog,v retrieving revision 1.196 retrieving revision 1.197 diff -u -d -r1.196 -r1.197 --- ChangeLog 30 Jul 2004 16:32:00 -0000 1.196 +++ ChangeLog 30 Jul 2004 16:38:51 -0000 1.197 @@ -10,6 +10,13 @@ * gtk/general/Gtk.hs: export new Editable module. + * gtk/buttons/Button.chs, gtk/menuComboToolbar/CheckMenuItem.chs, + gtk/misc/Calendar.chs, gtk/misc/EventBox.chs, gtk/misc/HandleBox.chs + gtk/entry/HScale, gtk/entry/VScale, gtk/ornaments/Frame.chs, + gtk/treeList/CellRendererToggle.chs: add missing functions. + + * gtk/general/Structs.hsc: remove unneeded CheckMenuItem function. + 2004-07-29 Duncan Coutts <du...@co...> * gtk/general/General.chs: don't use depreciated gtk main loop |
From: Duncan C. <dun...@us...> - 2004-07-30 16:39:04
|
Update of /cvsroot/gtk2hs/gtk2hs/gtk/menuComboToolbar In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10993/gtk/menuComboToolbar Modified Files: CheckMenuItem.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: CheckMenuItem.chs =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/menuComboToolbar/CheckMenuItem.chs,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- CheckMenuItem.chs 23 May 2004 16:05:21 -0000 1.6 +++ CheckMenuItem.chs 30 Jul 2004 16:38:54 -0000 1.7 @@ -1,3 +1,4 @@ +{-# OPTIONS -cpp #-} -- -*-haskell-*- -- GIMP Toolkit (GTK) Widget CheckMenuItem -- @@ -23,16 +24,22 @@ -- -- This widget implements a 'MenuItem' with a check next to it. -- +#include <gtk/gtkversion.h> module CheckMenuItem( CheckMenuItem, CheckMenuItemClass, checkMenuItemNew, checkMenuItemNewWithLabel, + checkMenuItemNewWithMnemonic, checkMenuItemSetActive, checkMenuItemGetActive, checkMenuItemSetInconsistent, checkMenuItemGetInconsistent +#if GTK_CHECK_VERSION(2,4,0) + ,checkMenuItemGetDrawAsRadio, + checkMenuItemSetDrawAsRadio +#endif ) where import Monad (liftM) @@ -41,47 +48,70 @@ import Object (makeNewObject) {#import Hierarchy#} {#import Signal#} -import Structs (checkMenuItemGetActive) {#context lib="gtk" prefix="gtk" #} -- methods --- | Create a new 'MenuItem' with a check --- next to it. +-- | Create a new 'MenuItem' with a check next to it. -- checkMenuItemNew :: IO CheckMenuItem checkMenuItemNew = makeNewObject mkCheckMenuItem $ liftM castPtr $ {#call unsafe check_menu_item_new#} --- | Create a new 'CheckMenuItem' --- with a 'Label' inside. +-- | Create a new 'CheckMenuItem' with a 'Label' inside. -- checkMenuItemNewWithLabel :: String -> IO CheckMenuItem checkMenuItemNewWithLabel str = withUTFString str $ \strPtr -> makeNewObject mkCheckMenuItem $ liftM castPtr $ {#call unsafe check_menu_item_new_with_label#} strPtr +-- | Create a new 'CheckMenuItem' with a 'Label' inside. Underscores in the +-- label string indicate the mnemonic for the menu item. +-- +checkMenuItemNewWithMnemonic :: String -> IO CheckMenuItem +checkMenuItemNewWithMnemonic str = + withUTFString str $ \strPtr -> + makeNewObject mkCheckMenuItem $ liftM castPtr $ + {#call unsafe check_menu_item_new_with_mnemonic#} strPtr --- | Set the state of the menu item check. +-- | Sets the active state of the menu item's check box. -- checkMenuItemSetActive :: CheckMenuItemClass mi => mi -> Bool -> IO () checkMenuItemSetActive mi active = {#call check_menu_item_set_active#} (toCheckMenuItem mi) (fromBool active) --- | Set the state of the menu item check --- to \`inconsistent'. +-- | Returns whether the check menu item is active. +-- +checkMenuItemGetActive :: CheckMenuItemClass mi => mi -> IO Bool +checkMenuItemGetActive mi = + liftM toBool $ {#call unsafe check_menu_item_get_active#} (toCheckMenuItem mi) + +-- | Set the state of the menu item check to \`inconsistent'. -- checkMenuItemSetInconsistent :: CheckMenuItemClass mi => mi -> Bool -> IO () checkMenuItemSetInconsistent mi inconsistent = {#call check_menu_item_set_inconsistent#} (toCheckMenuItem mi) (fromBool inconsistent) --- | Query if the menu check is --- inconsistent (inbetween). +-- | Query if the menu check is inconsistent (inbetween). -- checkMenuItemGetInconsistent :: CheckMenuItemClass mi => mi -> IO Bool checkMenuItemGetInconsistent mi = liftM toBool $ {#call unsafe check_menu_item_get_inconsistent#} (toCheckMenuItem mi) +#if GTK_CHECK_VERSION(2,4,0) +-- | Sets whether the menu item is drawn like a 'RadioMenuItem'. +-- +checkMenuItemSetDrawAsRadio :: CheckMenuItemClass mi => mi -> Bool -> IO () +checkMenuItemSetDrawAsRadio mi asRadio = + {#call check_menu_item_set_draw_as_radio#} (toCheckMenuItem mi) + (fromBool asRadio) + +-- | Returns whether the menu item is drawn like a 'RadioMenuItem'. +-- +checkMenuItemGetDrawAsRadio :: CheckMenuItemClass mi => mi -> IO Bool +checkMenuItemGetDrawAsRadio mi = liftM toBool $ + {#call unsafe check_menu_item_get_draw_as_radio#} (toCheckMenuItem mi) +#endif |
From: Duncan C. <dun...@us...> - 2004-07-30 16:39:04
|
Update of /cvsroot/gtk2hs/gtk2hs/gtk/entry In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10993/gtk/entry Modified Files: HScale.chs VScale.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: VScale.chs =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/entry/VScale.chs,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- VScale.chs 23 May 2004 15:51:53 -0000 1.4 +++ VScale.chs 30 Jul 2004 16:38:54 -0000 1.5 @@ -31,7 +31,8 @@ VScale, VScaleClass, castToVScale, - vScaleNew + vScaleNew, + vScaleNewWithRange ) where import Monad (liftM) @@ -51,3 +52,15 @@ vScaleNew adj = makeNewObject mkVScale $ liftM castPtr $ {#call unsafe vscale_new#} adj +-- | Create a new VScale widget with @min@, @max@ and @step@ values rather than +-- an "Adjustment" object. +-- +vScaleNewWithRange :: Double -- ^ Minimum value + -> Double -- ^ Maximum value + -> Double -- ^ Step increment (tick size) used with keyboard + -- shortcuts. Must be nonzero. + -> IO VScale +vScaleNewWithRange min max step = + makeNewObject mkVScale $ liftM castPtr $ + {#call unsafe vscale_new_with_range#} (realToFrac min) (realToFrac max) + (realToFrac step) Index: HScale.chs =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/entry/HScale.chs,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- HScale.chs 23 May 2004 15:51:53 -0000 1.4 +++ HScale.chs 30 Jul 2004 16:38:54 -0000 1.5 @@ -31,7 +31,8 @@ HScale, HScaleClass, castToHScale, - hScaleNew + hScaleNew, + hScaleNewWithRange ) where import Monad (liftM) @@ -51,3 +52,15 @@ hScaleNew adj = makeNewObject mkHScale $ liftM castPtr $ {#call unsafe hscale_new#} adj +-- | Create a new HScale widget with @min@, @max@ and @step@ values rather than +-- an "Adjustment" object. +-- +hScaleNewWithRange :: Double -- ^ Minimum value + -> Double -- ^ Maximum value + -> Double -- ^ Step increment (tick size) used with keyboard + -- shortcuts. Must be nonzero. + -> IO HScale +hScaleNewWithRange min max step = + makeNewObject mkHScale $ liftM castPtr $ + {#call unsafe hscale_new_with_range#} (realToFrac min) (realToFrac max) + (realToFrac step) |
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. -- |
From: Duncan C. <dun...@us...> - 2004-07-30 16:39:03
|
Update of /cvsroot/gtk2hs/gtk2hs/gtk/ornaments In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10993/gtk/ornaments Modified Files: Frame.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: Frame.chs =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/ornaments/Frame.chs,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- Frame.chs 23 May 2004 16:10:57 -0000 1.4 +++ Frame.chs 30 Jul 2004 16:38:53 -0000 1.5 @@ -31,11 +31,14 @@ castToFrame, frameNew, frameSetLabel, + frameGetLabel, frameSetLabelWidget, + frameGetLabelWidget, frameSetLabelAlign, + frameGetLabelAlign, ShadowType(..), frameSetShadowType, - frameGetLabel + frameGetShadowType ) where import Monad (liftM) @@ -70,6 +73,15 @@ frameSetLabelWidget f w = {#call frame_set_label_widget#} (toFrame f) (toWidget w) +-- | Get the label widget for the frame. +-- +frameGetLabelWidget :: FrameClass f => f -> IO (Maybe Widget) +frameGetLabelWidget f = do + widgetPtr <- {#call frame_get_label_widget#} (toFrame f) + if widgetPtr == nullPtr + then return Nothing + else liftM Just $ makeNewObject mkWidget (return widgetPtr) + -- | Specify where the label should be placed. -- -- * A value of 0.0 means left justified (the default), a value of 1.0 means @@ -79,12 +91,27 @@ frameSetLabelAlign f align = {#call frame_set_label_align#} (toFrame f) (realToFrac align) 0.0 +-- | Get the label's horazontal alignment. +-- +frameGetLabelAlign :: FrameClass f => f -> IO Float +frameGetLabelAlign f = + alloca $ \alignPtr -> do + {#call unsafe frame_get_label_align#} (toFrame f) alignPtr nullPtr + align <- peek alignPtr + return (realToFrac align) + -- | Set the shadow type of the frame. -- frameSetShadowType :: FrameClass f => f -> ShadowType -> IO () frameSetShadowType f shadow = {#call frame_set_shadow_type#} (toFrame f) ((fromIntegral.fromEnum) shadow) +-- | Set the shadow type of the frame. +-- +frameGetShadowType :: FrameClass f => f -> IO ShadowType +frameGetShadowType f = liftM (toEnum.fromIntegral) $ + {#call unsafe frame_get_shadow_type#} (toFrame f) + -- | Retrieve the label of the frame. -- -- * An exception is thrown if a non-Label widget was set. |
From: Duncan C. <dun...@us...> - 2004-07-30 16:39:03
|
Update of /cvsroot/gtk2hs/gtk2hs/gtk/treeList In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10993/gtk/treeList Modified Files: CellRendererToggle.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: CellRendererToggle.chs =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/treeList/CellRendererToggle.chs,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- CellRendererToggle.chs 23 May 2004 16:16:43 -0000 1.8 +++ CellRendererToggle.chs 30 Jul 2004 16:38:53 -0000 1.9 @@ -27,6 +27,7 @@ CellRendererToggleClass, castToCellRendererToggle, cellRendererToggleNew, + cellRendererToggleGetRadio, cellRendererToggleSetRadio, cellRendererToggleGetActive, cellRendererToggleSetActive, @@ -54,16 +55,20 @@ cellRendererToggleNew = makeNewObject mkCellRendererToggle $ liftM castPtr $ {#call unsafe cell_renderer_toggle_new#} --- | Determine whether the button is drawn --- as 'RadioButton' or not. +-- | Determine whether the button is drawn as 'RadioButton' or not. -- cellRendererToggleSetRadio :: CellRendererToggleClass crt => crt -> Bool -> IO () cellRendererToggleSetRadio crt radio = {#call cell_renderer_toggle_set_radio#} (toCellRendererToggle crt) (fromBool radio) --- | Retrieve the current state of the --- button. +-- | Returns wether the button is drawn as 'RadioButton' or not. +-- +cellRendererToggleGetRadio :: CellRendererToggleClass crt => crt -> IO Bool +cellRendererToggleGetRadio crt = liftM toBool $ + {#call cell_renderer_toggle_get_radio#} (toCellRendererToggle crt) + +-- | Retrieve the current state of the button. -- cellRendererToggleGetActive :: CellRendererToggleClass crt => crt -> IO Bool cellRendererToggleGetActive crt = liftM toBool $ @@ -84,8 +89,7 @@ (return.(\x -> [x]).GVboolean) (\[GVboolean b] -> return b) --- | Define the attribute that reflects the state of the --- button. +-- | Define the attribute that reflects the state of the button. -- cellActive :: Attribute CellRendererToggle Bool cellActive = binAttr ["active"] |
From: Duncan C. <dun...@us...> - 2004-07-30 16:39:02
|
Update of /cvsroot/gtk2hs/gtk2hs/gtk/buttons In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10993/gtk/buttons Modified Files: Button.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: Button.chs =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/buttons/Button.chs,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- Button.chs 23 May 2004 15:48:35 -0000 1.5 +++ Button.chs 30 Jul 2004 16:38:52 -0000 1.6 @@ -1,3 +1,4 @@ +{-# OPTIONS -cpp #-} -- -*-haskell-*- -- GIMP Toolkit (GTK) Widget Button -- @@ -21,6 +22,7 @@ -- -- | -- +#include <gtk/gtkversion.h> module Button( Button, @@ -44,6 +46,12 @@ buttonGetUseStock, buttonSetUseUnderline, buttonGetUseUnderline, +#if GTK_CHECK_VERSION(2,4,0) + buttonSetFocusOnClick, + buttonGetFocusOnClick, + buttonSetAlignment, + buttonGetAlignment, +#endif onButtonActivate, afterButtonActivate, onClicked, @@ -191,6 +199,38 @@ buttonGetUseUnderline b = liftM toBool $ {#call unsafe button_get_use_underline#} (toButton b) +#if GTK_CHECK_VERSION(2,4,0) +-- | Sets whether the button will grab focus when it is clicked with the mouse. +-- +buttonSetFocusOnClick :: ButtonClass b => b -> Bool -> IO () +buttonSetFocusOnClick b focus = + {#call unsafe button_set_focus_on_click#} (toButton b) (fromBool focus) + +-- | Gets whether the button grabs focus when it is clicked with the mouse. +-- +buttonGetFocusOnClick :: ButtonClass b => b -> IO Bool +buttonGetFocusOnClick b = liftM toBool $ + {#call unsafe button_get_focus_on_click#} (toButton b) + +-- | Sets the alignment of the child. This has no effect unless the child +-- derives from "Misc" "Aligment". +-- +buttonSetAlignment :: ButtonClass b => b -> (Float, Float) -> IO () +buttonSetAlignment b (xalign, yalign) = + {#call unsafe button_set_alignment#} (toButton b) + (realToFrac xalign) (realToFrac yalign) + +-- | Gets the alignment of the child in the button. +-- +buttonGetAlignment :: ButtonClass b => b -> IO (Float, Float) +buttonGetAlignment b = + alloca $ \xalignPtr -> alloca $ \yalignPtr -> do + {#call unsafe button_get_alignment#} (toButton b) xalignPtr yalignPtr + xalign <- peek xalignPtr + yalign <- peek yalignPtr + return (realToFrac xalign, realToFrac yalign) +#endif + -- signals |
From: Duncan C. <dun...@us...> - 2004-07-30 16:39:02
|
Update of /cvsroot/gtk2hs/gtk2hs/gtk/general In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10993/gtk/general Modified Files: Structs.hsc 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: Structs.hsc =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/general/Structs.hsc,v retrieving revision 1.24 retrieving revision 1.25 diff -u -d -r1.24 -r1.25 --- Structs.hsc 16 Jul 2004 15:12:59 -0000 1.24 +++ Structs.hsc 30 Jul 2004 16:38:52 -0000 1.25 @@ -74,7 +74,6 @@ iconSizeLargeToolbar, iconSizeButton, iconSizeDialog, - checkMenuItemGetActive, comboGetList, priorityLow, priorityDefault, @@ -599,20 +598,6 @@ iconSizeDialog :: IconSize iconSizeDialog = #const GTK_ICON_SIZE_DIALOG --- entry Widget CheckMenuItem - --- | Return the current checked state. --- --- * Return the state of the check of --- the 'CheckMenuItem'. --- -checkMenuItemGetActive :: CheckMenuItemClass mi => mi -> IO Bool -checkMenuItemGetActive mi = - withForeignPtr ((unCheckMenuItem.toCheckMenuItem) mi) $ \miPtr -> do - let actPtr = miPtr `plusPtr` #const sizeof(GtkMenuItem) - act <- peek (actPtr::Ptr #type guint) - return $ testBit act 1 - -- entry Widget Combo -- | Extract the List container from a 'Combo' |
From: Duncan C. <dun...@us...> - 2004-07-30 16:32:10
|
Update of /cvsroot/gtk2hs/gtk2hs/gtk/entry In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9661/gtk/entry Modified Files: Entry.chs SpinButton.chs Added Files: Editable.chs Log Message: Split Editable interface out of Entry.chs and into a new module. Also added some missing functions to Entry.chs & Editable.chs. Added interface to hierarchy.list. Make SpinButton implement this interface. Export new module from gtk/Gtk.hs. Index: SpinButton.chs =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/entry/SpinButton.chs,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- SpinButton.chs 23 May 2004 15:51:53 -0000 1.5 +++ SpinButton.chs 30 Jul 2004 16:32:01 -0000 1.6 @@ -70,6 +70,9 @@ {# context lib="gtk" prefix="gtk" #} +-- GtkSpinbutton implements the GtkEditable interface +instance EditableClass SpinButton + -- methods -- | Create a new SpinButton. --- NEW FILE: Editable.chs --- {-# OPTIONS -cpp #-} -- -*-haskell-*- -- GIMP Toolkit (GTK) Interface Editable -- -- Author : Axel Simon, Duncan Coutts -- -- Created: 30 July 2004 -- split off from Entry.chs -- -- Copyright (c) 1999..2002 Axel Simon -- modified 2004 Duncan Coutts -- -- 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 is an interface for simple single-line text editing widgets. It is -- implemented by "Entry" and "SpinButton". -- -- * TODO -- -- * Find out if \"insert-text\" signal is useful and how to bind it. It is -- tricky because it has an in-out parameter. -- #include <gtk/gtkversion.h> module Editable( -- * Data types Editable, EditableClass, castToEditable, -- * Methods editableSelectRegion, editableGetSelectionBounds, editableInsertText, editableDeleteText, editableGetChars, editableCutClipboard, editableCopyClipboard, editablePasteClipboard, editableDeleteSelection, editableSetEditable, editableGetEditable, editableSetPosition, editableGetPosition, -- * Signals onEditableChanged, afterEditableChanged, onDeleteText, afterDeleteText, ) where import Monad (liftM) import FFI import Object (makeNewObject) import GObject (makeNewGObject) {#import Hierarchy#} {#import Signal#} {# context lib="gtk" prefix="gtk" #} -- | Select a span of text. -- -- * A negative @end@ position will make the selection extend to the -- end of the buffer. -- -- * Calling this function with @start@=1 and @end@=4 it will -- mark \"ask\" in the string \"Haskell\". (FIXME: verify) -- editableSelectRegion :: EditableClass ed => ed -> Int -> Int -> IO () editableSelectRegion ed start end = {#call editable_select_region#} (toEditable ed) (fromIntegral start) (fromIntegral end) -- | Get the span of the current selection. -- -- * The returned tuple is not ordered. The second index represents the -- position of the cursor. The first index is the other end of the -- selection. If both numbers are equal there is in fact no selection. -- editableGetSelectionBounds :: EditableClass ed => ed -> IO (Int,Int) editableGetSelectionBounds ed = alloca $ \startPtr -> alloca $ \endPtr -> do {#call unsafe editable_get_selection_bounds#} (toEditable ed) startPtr endPtr start <- liftM fromIntegral $ peek startPtr end <- liftM fromIntegral $ peek endPtr return (start,end) -- | Insert new text at the specified position. -- -- * If the position is invalid the text will be inserted at the end of the -- buffer. The returned value reflects the actual insertion point. -- editableInsertText :: EditableClass ed => ed -> String -> Int -> IO Int editableInsertText ed str pos = withObject (fromIntegral pos) $ \posPtr -> withUTFStringLen str $ \(strPtr,len) -> do {#call editable_insert_text#} (toEditable ed) strPtr (fromIntegral len) posPtr liftM fromIntegral $ peek posPtr -- | Delete a given range of text. -- -- * If the @end@ position is invalid, it is set to the lenght of the -- buffer. -- -- * @start@ is restricted to 0..@end@. -- editableDeleteText :: EditableClass ed => ed -> Int -> Int -> IO () editableDeleteText ed start end = {#call editable_delete_text#} (toEditable ed) (fromIntegral start) (fromIntegral end) -- | Retrieve a range of characters. -- -- * Set @end@ to a negative value to reach the end of the buffer. -- editableGetChars :: EditableClass ed => ed -> Int -> Int -> IO String editableGetChars ed start end = do strPtr <- {#call unsafe editable_get_chars#} (toEditable ed) (fromIntegral start) (fromIntegral end) str <- peekUTFString strPtr {#call unsafe g_free#} (castPtr strPtr) return str -- | Cut the selected characters to the Clipboard. -- editableCutClipboard :: EditableClass ed => ed -> IO () editableCutClipboard = {#call editable_cut_clipboard#}.toEditable -- | Copy the selected characters to the Clipboard. -- editableCopyClipboard :: EditableClass ed => ed -> IO () editableCopyClipboard = {#call editable_copy_clipboard#}.toEditable -- | Paste the selected characters to the -- Clipboard. -- editablePasteClipboard :: EditableClass ed => ed -> IO () editablePasteClipboard = {#call editable_paste_clipboard#}.toEditable -- | Delete the current selection. -- editableDeleteSelection :: EditableClass ed => ed -> IO () editableDeleteSelection = {#call editable_delete_selection#}.toEditable -- | Set the cursor to a specific position. -- editableSetPosition :: EditableClass ed => ed -> Int -> IO () editableSetPosition ed pos = {#call editable_set_position#} (toEditable ed) (fromIntegral pos) -- | Get the current cursor position. -- editableGetPosition :: EditableClass ed => ed -> IO Int editableGetPosition ed = liftM fromIntegral $ {#call unsafe editable_get_position#} (toEditable ed) -- | Make the widget insensitive. -- -- * Called with False will make the text uneditable. -- editableSetEditable :: EditableClass ed => ed -> Bool -> IO () editableSetEditable ed isEditable = {#call editable_set_editable#} (toEditable ed) (fromBool isEditable) -- | Retrieves whether the text is editable. -- editableGetEditable :: EditableClass ed => ed -> IO Bool editableGetEditable ed = liftM toBool $ {#call editable_get_editable#} (toEditable ed) -- signals -- | Emitted when the settings of the 'Editable' widget changes. -- onEditableChanged, afterEditableChanged :: EditableClass ec => ec -> IO () -> IO (ConnectId ec) onEditableChanged = connect_NONE__NONE "changed" False afterEditableChanged = connect_NONE__NONE "changed" True -- | Emitted when a piece of text is deleted from the 'Editable' widget. -- onDeleteText, afterDeleteText :: EditableClass ec => ec -> (Int -> Int -> IO ()) -> IO (ConnectId ec) onDeleteText = connect_INT_INT__NONE "delete_text" False afterDeleteText = connect_INT_INT__NONE "delete_text" True Index: Entry.chs =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/entry/Entry.chs,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- Entry.chs 23 May 2004 15:51:52 -0000 1.9 +++ Entry.chs 30 Jul 2004 16:32:01 -0000 1.10 @@ -24,8 +24,6 @@ -- -- * This widget lets the user enter a single line of text. -- --- --- -- * TODO -- -- * A couple of signals are not bound because I could not figure out what @@ -37,23 +35,15 @@ Entry, EntryClass, castToEntry, - entrySelectRegion, - entryGetSelectionBounds, - entryInsertText, - entryDeleteText, - entryGetChars, - entryCutClipboard, - entryCopyClipboard, - entryPasteClipboard, - entryDeleteSelection, - entrySetEditable, entryNew, entrySetText, entryGetText, entryAppendText, entryPrependText, entrySetVisibility, + entryGetVisibility, entrySetInvisibleChar, + entryGetInvisibleChar, entrySetMaxLength, entryGetActivatesDefault, entrySetActivatesDefault, @@ -67,16 +57,12 @@ #endif onEntryActivate, afterEntryActivate, - onEntryChanged, - afterEntryChanged, onCopyClipboard, afterCopyClipboard, onCutClipboard, afterCutClipboard, onPasteClipboard, afterPasteClipboard, - onDeleteText, - afterDeleteText, onInsertAtCursor, afterInsertAtCursor, onToggleOverwrite, @@ -90,118 +76,12 @@ import GObject (makeNewGObject) {#import Hierarchy#} {#import Signal#} -import Char (ord) +import Char (ord, chr) {# context lib="gtk" prefix="gtk" #} --- methods originating in the Editable base class which is not really a base --- class of in the Gtk Hierarchy (it is non-existant). I renamed -{#pointer *Editable foreign newtype#} - -toEditable :: EntryClass ed => ed -> Editable -toEditable = Editable . castForeignPtr . unEntry . toEntry - --- | Select a span of text. --- --- * A negative @end@ position will make the selection extend to the --- end of the buffer. --- --- * Calling this function with @start@=1 and @end@=4 it will --- mark \"ask\" in the string \"Haskell\". (FIXME: verify) --- -entrySelectRegion :: EntryClass ed => ed -> Int -> Int -> IO () -entrySelectRegion ed start end = {#call editable_select_region#} - (toEditable ed) (fromIntegral start) (fromIntegral end) - --- | Get the span of the current selection. --- --- * The returned tuple is not ordered. The second index represents the --- position of the cursor. The first index is the other end of the --- selection. If both numbers are equal there is in fact no selection. --- -entryGetSelectionBounds :: EntryClass ed => ed -> IO (Int,Int) -entryGetSelectionBounds ed = alloca $ \startPtr -> alloca $ \endPtr -> do - {#call unsafe editable_get_selection_bounds#} (toEditable ed) startPtr endPtr - start <- liftM fromIntegral $ peek startPtr - end <- liftM fromIntegral $ peek endPtr - return (start,end) - --- | Insert new text at the specified position. --- --- * If the position is invalid the text will be inserted at the end of the --- buffer. The returned value reflects the actual insertion point. --- -entryInsertText :: EntryClass ed => ed -> String -> Int -> IO Int -entryInsertText ed str pos = withObject (fromIntegral pos) $ \posPtr -> - withUTFStringLen str $ \(strPtr,len) -> do - {#call editable_insert_text#} (toEditable ed) strPtr (fromIntegral len) - posPtr - liftM fromIntegral $ peek posPtr - --- | Delete a given range of text. --- --- * If the @end@ position is invalid, it is set to the lenght of the --- buffer. --- --- * @start@ is restricted to 0..@end@. --- -entryDeleteText :: EntryClass ed => ed -> Int -> Int -> IO () -entryDeleteText ed start end = {#call editable_delete_text#} (toEditable ed) - (fromIntegral start) (fromIntegral end) - --- | Retrieve a range of characters. --- --- * Set @end@ to a negative value to reach the end of the buffer. --- -entryGetChars :: EntryClass ed => ed -> Int -> Int -> IO String -entryGetChars ed start end = do - strPtr <- {#call unsafe editable_get_chars#} (toEditable ed) - (fromIntegral start) (fromIntegral end) - str <- peekUTFString strPtr - {#call unsafe g_free#} (castPtr strPtr) - return str - --- | Cut the selected characters to the Clipboard. --- -entryCutClipboard :: EntryClass ed => ed -> IO () -entryCutClipboard = {#call editable_cut_clipboard#}.toEditable - --- | Copy the selected characters to the Clipboard. --- -entryCopyClipboard :: EntryClass ed => ed -> IO () -entryCopyClipboard = {#call editable_copy_clipboard#}.toEditable - --- | Paste the selected characters to the --- Clipboard. --- -entryPasteClipboard :: EntryClass ed => ed -> IO () -entryPasteClipboard = {#call editable_paste_clipboard#}.toEditable - --- | Delete the current selection. --- -entryDeleteSelection :: EntryClass ed => ed -> IO () -entryDeleteSelection = {#call editable_delete_selection#}.toEditable - --- | Set the cursor to a specific position. --- -entrySetPosition :: EntryClass ed => ed -> Int -> IO () -entrySetPosition ed pos = - {#call editable_set_position#} (toEditable ed) (fromIntegral pos) - --- | Get the current cursor position. --- -entryGetPosition :: EntryClass ed => ed -> IO Int -entryGetPosition ed = liftM fromIntegral $ - {#call unsafe editable_get_position#} (toEditable ed) - --- | Make an 'Entry' insensitive. --- --- * Called with False will make the text uneditable. --- -entrySetEditable :: EntryClass ed => ed -> Bool -> IO () -entrySetEditable ed isEditable = {#call editable_set_editable#} - (toEditable ed) (fromBool isEditable) - +-- GtkEntry implements the GtkEditable interface +instance EditableClass Entry -- methods @@ -232,23 +112,33 @@ entryPrependText ec str = withUTFString str $ {#call entry_prepend_text#} (toEntry ec) --- | Set whether to use password mode (display stars --- instead of the text). +-- | Set whether to use password mode (display stars instead of the text). -- --- * The replacement character can be changed with --- 'entrySetInvisibleChar'. +-- * The replacement character can be changed with 'entrySetInvisibleChar'. -- entrySetVisibility :: EntryClass ec => ec -> Bool -> IO () entrySetVisibility ec visible = {#call entry_set_visibility#} (toEntry ec) (fromBool visible) --- | Set the replacement character for invisible --- text. +-- | Get whether widget is in password mode. +-- +entryGetVisibility :: EntryClass ec => ec -> IO Bool +entryGetVisibility ec = + liftM toBool $ {#call entry_get_visibility#} (toEntry ec) + +-- | Set the replacement character for invisible text. -- entrySetInvisibleChar :: EntryClass ec => ec -> Char -> IO () entrySetInvisibleChar ec ch = {#call unsafe entry_set_invisible_char#} (toEntry ec) ((fromIntegral.ord) ch) +-- | Get the current replacement character for invisible text, +-- or 0 if not in password mode. +-- +entryGetInvisibleChar :: EntryClass ec => ec -> IO Char +entryGetInvisibleChar ec = liftM (chr.fromIntegral) $ + {#call unsafe entry_get_invisible_char#} (toEntry ec) + -- | Sets a maximum length the text may grow to. -- -- * A negative number resets the restriction. @@ -257,8 +147,13 @@ entrySetMaxLength ec max = {#call entry_set_max_length#} (toEntry ec) (fromIntegral max) --- | Query whether pressing return will --- activate the default widget. +-- | Gets a maximum length the text is allowed to grow to. +-- +entryGetMaxLength :: EntryClass ec => ec -> IO Int +entryGetMaxLength ec = + liftM fromIntegral $ {#call unsafe entry_get_max_length#} (toEntry ec) + +-- | Query whether pressing return will activate the default widget. -- entryGetActivatesDefault :: EntryClass ec => ec -> IO Bool entryGetActivatesDefault ec = liftM toBool $ @@ -274,29 +169,25 @@ entrySetActivatesDefault ec setting = {#call entry_set_activates_default#} (toEntry ec) (fromBool setting) --- | Query if the text 'Entry' is displayed --- with a frame around it. +-- | Query if the text 'Entry' is displayed with a frame around it. -- entryGetHasFrame :: EntryClass ec => ec -> IO Bool entryGetHasFrame ec = liftM toBool $ {#call unsafe entry_get_has_frame#} (toEntry ec) --- | Specifies whehter the 'Entry' should be --- in an etched-in frame. +-- | Specifies whehter the 'Entry' should be in an etched-in frame. -- entrySetHasFrame :: EntryClass ec => ec -> Bool -> IO () entrySetHasFrame ec setting = {#call entry_set_has_frame#} (toEntry ec) (fromBool setting) --- | Retrieve the number of characters the widget --- should ask for. +-- | Retrieve the number of characters the widget should ask for. -- entryGetWidthChars :: EntryClass ec => ec -> IO Int entryGetWidthChars ec = liftM fromIntegral $ {#call unsafe entry_get_width_chars#} (toEntry ec) --- | Specifies how large the 'Entry' should --- be in characters. +-- | Specifies how large the 'Entry' should be in characters. -- -- * This setting is only considered when the widget formulates its size -- request. Make sure that it is not mapped (shown) before you change this @@ -306,6 +197,20 @@ entrySetWidthChars ec setting = {#call entry_set_width_chars#} (toEntry ec) (fromIntegral setting) +-- | Sets the alignment for the contents of the entry. This controls the +-- horizontal positioning of the contents when the displayed text is shorter +-- than the width of the entry. +-- +entrySetAlignment :: EntryClass ec => ec -> Float -> IO () +entrySetAlignment ec xalign = + {#call entry_set_alignment#} (toEntry ec) (realToFrac xalign) + +-- | Gets the value set by 'entrySetAlignment'. +-- +entryGetAlignment :: EntryClass ec => ec -> IO Float +entryGetAlignment ec = + liftM realToFrac $ {#call unsafe entry_get_alignment#} (toEntry ec) + #if GTK_CHECK_VERSION(2,4,0) -- | Sets the auxiliary completion object to use with -- the entry. All further configuration of the completion mechanism is done on |
From: Duncan C. <dun...@us...> - 2004-07-30 16:32:10
|
Update of /cvsroot/gtk2hs/gtk2hs/tools/hierarchyGen In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9661/tools/hierarchyGen Modified Files: hierarchy.list Log Message: Split Editable interface out of Entry.chs and into a new module. Also added some missing functions to Entry.chs & Editable.chs. Added interface to hierarchy.list. Make SpinButton implement this interface. Export new module from gtk/Gtk.hs. Index: hierarchy.list =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/tools/hierarchyGen/hierarchy.list,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- hierarchy.list 26 Jul 2004 15:24:25 -0000 1.7 +++ hierarchy.list 30 Jul 2004 16:32:01 -0000 1.8 @@ -163,6 +163,7 @@ GladeXML as GladeXML, glade_xml_get_type if libglade GConfClient as GConf if gconf # These ones are actualy interfaces, but interface implementations are GObjects + GtkEditable GtkSourceStyleScheme if sourceview GtkFileChooser if gtk-2.4 # This became a GObject in version 2: |
From: Duncan C. <dun...@us...> - 2004-07-30 16:32:10
|
Update of /cvsroot/gtk2hs/gtk2hs/gtk/general In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9661/gtk/general Modified Files: Gtk.hs Log Message: Split Editable interface out of Entry.chs and into a new module. Also added some missing functions to Entry.chs & Editable.chs. Added interface to hierarchy.list. Make SpinButton implement this interface. Export new module from gtk/Gtk.hs. Index: Gtk.hs =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/general/Gtk.hs,v retrieving revision 1.25 retrieving revision 1.26 diff -u -d -r1.25 -r1.26 --- Gtk.hs 23 May 2004 15:58:48 -0000 1.25 +++ Gtk.hs 30 Jul 2004 16:32:01 -0000 1.26 @@ -34,8 +34,6 @@ -- Item : The only child of this abstract class is MenuItem. The -- three signals Item defines are therefore bound in -- MenuItem. --- Editable : This should be the base class of Entry, but it is not. --- I moved everything into Entry. -- -- TODO -- @@ -78,6 +76,7 @@ module RadioButton, module ToggleButton, -- * Numeric\/text data entry + module Editable, module Entry, #if GTK_CHECK_VERSION(2,4,0) module EntryCompletion, @@ -225,6 +224,7 @@ import RadioButton import ToggleButton -- numeric\/text data entry +import Editable import Entry #if GTK_CHECK_VERSION(2,4,0) import EntryCompletion |
From: Duncan C. <dun...@us...> - 2004-07-30 16:32:09
|
Update of /cvsroot/gtk2hs/gtk2hs In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9661 Modified Files: ChangeLog Log Message: Split Editable interface out of Entry.chs and into a new module. Also added some missing functions to Entry.chs & Editable.chs. Added interface to hierarchy.list. Make SpinButton implement this interface. Export new module from gtk/Gtk.hs. Index: ChangeLog =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/ChangeLog,v retrieving revision 1.195 retrieving revision 1.196 diff -u -d -r1.195 -r1.196 --- ChangeLog 29 Jul 2004 14:33:18 -0000 1.195 +++ ChangeLog 30 Jul 2004 16:32:00 -0000 1.196 @@ -1,3 +1,15 @@ +2004-07-30 Duncan Coutts <du...@co...> + + * gtk/entry/Editable.chs, gtk/entry/Entry.chs: split off editable + functions into separate module and make Entry an instance of the + EditableClass. Also add missing functions. + + * gtk/entry/SpinButton.chs: make SpinButton an EditableClass instance. + + * tools/hierarchyGen/hierarchy.list: add GtkEditable as an interface. + + * gtk/general/Gtk.hs: export new Editable module. + 2004-07-29 Duncan Coutts <du...@co...> * gtk/general/General.chs: don't use depreciated gtk main loop |
From: Duncan C. <dun...@us...> - 2004-07-29 14:33:27
|
Update of /cvsroot/gtk2hs/gtk2hs/tools/apicoverage In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16344/tools/apicoverage Added Files: Exclude.hs Makefile README gtk.ignore Log Message: new tool to check on our coverage of the gtk api. See README for details. --- NEW FILE: README --- The tools in this directory are to help investigate gtk2hs's coverage of the gtk API. You should modify the Makefile to set which version of gtk you'd like to check aginst. Running 'make' will then download the tarball from the gtk website and extract the gtk.def file which contains a complete list of the exported gtk functions. It also scans all the files in the gtk directory for calls to gtk APIs. It filters the list of gtk APIs to get rid of deprecated, internal or other functions we don't care about. So what you want to do is $ make to get a summary and then $ diff gtk.def.filtered gtk.coverage to get a list of what is currently implemented vs what is not. If something should not be implemented you can exclude it from the list by modifying the gtk.ignore file. You can also put api.ignore files in any directory under gtk/ and they will be used too. For excluding individual functions it's probably better to use a local api.ignore file, to stop the main gtk.ignore file becoming unmanagebly large. The central one should be for excluding entire sections of the gtk api and general stuff. The syntax of these files is as follows: * empty lines or lines beginning with # are ignored * lines like: exclude gtk_some_group_of_functions give an instruction to ignore functions with a name that matches the regex. Note that functions will be excluded if the regex matches any part of the function name, so saying 'gtk_text' will exclude all functions with that prefix. Standard posix regex syntax applies so you can use ^ and $ to anchor the regex if you need, eg '_get_type$' will only match things things ending in '_get_type' * lines like: do not exclude gtk_some_function can be used where using 'exclude' has excluded too much and you need some exceptions. eg to exclude gtk_progress but not gtk_progress_box * finally: always exclude _gtk_type$ can be used where you really really want to exclude something even if a 'do not exclude' would have caused it not to be excluded. This is mostly only useful for the above example and a couple similar ones. --- NEW FILE: Makefile --- # system to help check gtk2hs's api coverage # which vesion of gtk+ to compare against GTK_MAJOR_VERSION = 2 GTK_MINOR_VERSION = 4 GTK_MICRO_VERSION = 4 GTK_VERSION = $(GTK_MAJOR_VERSION).$(GTK_MINOR_VERSION).$(GTK_MICRO_VERSION) main: stats tars/gtk+-$(GTK_VERSION).tar.bz2 : wget ftp://ftp.gtk.org/pub/gtk/v2.$(GTK_MINOR_VERSION)/gtk+-$(GTK_VERSION).tar.bz2 \ --directory-prefix=tars gtk.def : tars/gtk+-$(GTK_VERSION).tar.bz2 tar --file tars/gtk+-$(GTK_VERSION).tar.bz2 -j --get gtk+-$(GTK_VERSION)/gtk/gtk.def -O > gtk.def sed -i 's:\(\t\|EXPORTS\)::' gtk.def GTK_CHS_FILES = $(shell find ../../gtk -name '*.chs') gtk.coverage : $(GTK_CHS_FILES) grep -h 'foreign import ccall \(unsafe \)\?" \?&\?.*"' `find ../../gtk -name '*.hs'` | \ sed 's:foreign import ccall \(unsafe \)\?" \?&\?\(.*\)".*:\2:' | \ sort -u | grep '^gtk_' | grep --invert-match '_get_type$$' > gtk.coverage # We can have (optional) api.ignore files in the gtk directories to have a # local place to record functions we don't want to bind, that'd stop the # central one getting huge. GTK_IGNORE_FILES = $(shell find ../../gtk -name 'api.ignore') gtk.ignore.combined : gtk.ignore $(GTK_IGNORE_FILES) cat $^ > gtk.ignore.combined gtk.def.filtered : gtk.def exclude gtk.ignore.combined ./exclude gtk.ignore.combined < gtk.def > gtk.def.filtered exclude : Exclude.hs ghc --make Exclude.hs -o exclude clean : rm -f Exclude.hi Exclude.o exclude rm -f gtk.coverage gtk.def.filtered gtk.def gtk.ignore.combined gtk_total=$(shell wc -l < gtk.def.filtered) gtk2hs_total=$(shell wc -l < gtk.coverage) stats : gtk.def.filtered gtk.coverage @echo "**** gtk2hs API coverage report (for gtk-$(GTK_VERSION)) ****" @echo " total gtk functions :" $(gtk_total) @echo " total gtk2hs functions :" $(gtk2hs_total) @echo " difference :" `echo $(gtk_total) - $(gtk2hs_total) | bc` @echo; echo "run 'diff gtk.def.filtered gtk.coverage' to see in detail" debug: @echo GTK_IGNORE_FILES = $(GTK_IGNORE_FILES) --- NEW FILE: Exclude.hs --- module Main (main) where import Char (isSpace) import Maybe (catMaybes, isJust) import List (isPrefixOf, intersperse) import System (getArgs) import Text.Regex main = do [filterFileName] <- getArgs filterFile <- readFile filterFileName let match = matcher (parseFilterFile filterFile) interact (unlines . filter match . lines) data FilterSpec = Exclude String | NotExclude String -- override Exclude but not AlwaysExclude | AlwaysExclude String parseFilterFile :: String -> [FilterSpec] parseFilterFile = catMaybes . map parseLine . lines where parseLine [] = Nothing parseLine ('#':_) = Nothing parseLine line | "exclude " `isPrefixOf` line = Just $ Exclude $ trim $ drop 8 line | "do not exclude " `isPrefixOf` line = Just $ NotExclude $ trim $ drop 15 line | "always exclude " `isPrefixOf` line = Just $ AlwaysExclude $ trim $ drop 15 line parseLine line = error $ "cannot parse line: " ++ line trim = takeWhile (not . isSpace) . dropWhile isSpace matcher :: [FilterSpec] -> (String -> Bool) matcher spec = match where excludeRegex = mkRegex $ concat $ intersperse "|" [ regex | Exclude regex <- spec ] noExcludeRegex = mkRegex $ concat $ intersperse "|" [ regex | NotExclude regex <- spec ] alwaysExcludeRegex = mkRegex $ concat $ intersperse "|" [ regex | AlwaysExclude regex <- spec ] match line = not $ ((isJust $ matchRegex excludeRegex line) && (not $ isJust $ matchRegex noExcludeRegex line)) || (isJust $ matchRegex alwaysExcludeRegex line) --- NEW FILE: gtk.ignore --- # all functions matching these regexps are ignored from gtk.def #deprecated exclude gtk_object do not exclude gtk_object_sink exclude gtk_ctree exclude gtk_clist exclude gtk_tree exclude gtk_list do not exclude gtk_list_store do not exclude gtk_tree_store do not exclude gtk_tree_view do not exclude gtk_tree_model do not exclude gtk_tree_sortable do not exclude gtk_tree_selection do not exclude gtk_tree_row do not exclude gtk_tree_path exclude gtk_pixmap exclude gtk_item_factory exclude gtk_old_editable exclude gtk_preview exclude gtk_progress do not exclude gtk_progress_bar_new do not exclude gtk_progress_bar_pulse do not exclude gtk_progress_bar_set_text do not exclude gtk_progress_bar_set_fraction do not exclude gtk_progress_bar_set_pulse_step do not exclude gtk_progress_bar_set_orientation do not exclude gtk_progress_bar_get_text do not exclude gtk_progress_bar_get_fraction do not exclude gtk_progress_bar_get_pulse_step do not exclude gtk_progress_bar_get_orientation exclude gtk_text do not exclude gtk_text_iter do not exclude gtk_text_mark do not exclude gtk_text_buffer do not exclude gtk_text_tag do not exclude gtk_text_tag_table do not exclude gtk_text_view exclude gtk_tips_query exclude gtk_accel_group_ref exclude gtk_accel_group_unref exclude gtk_idle exclude gtk_timeout exclude gtk_input exclude gtk_exit exclude gtk_type exclude gtk_color_selection_set_update_policy #deprecated as of 2.4 exclude gtk_combo do not exclude gtk_combo_box exclude gtk_option_menu #special purpose features (hangovers in gtk from the GIMP) exclude gtk_curve exclude gtk_gamma_curve exclude gtk_ruler exclude gtk_hruler exclude gtk_vruler #low level exclude gtk_marshal exclude gtk_false exclude gtk_true exclude gtk_.*_version exclude gtk_requisition #for gtk extensions & widget implementations exclude gtk_draw do not exclude gtk_drawing exclude gtk_style exclude gtk_paint exclude gtk_file_info exclude gtk_file_system exclude gtk_file_folder exclude gtk_im exclude gtk_invisible exclude gtk_widget_realize exclude gtk_widget_unrealize #sometimes there are several ways of doing the same thing #so lets ignore the other ways of doing it exclude gtk_init do not exclude gtk_init_check$ #dont think we need these ? TODO check this exclude gtk_gc exclude gtk_key_snooper exclude gtk_rc #appear to be internal, they're not well documented exclude gtk_binding exclude gtk_debug #stuff that we do not call directly, but instead simulate #usually because the function is varargs exclude gtk_file_chooser_dialog_new #these are sometimes bound if necessary but otherwise we can ignore them always exclude _get_type$ always exclude _valist$ always exclude _newv$ always exclude _copy$ always exclude _free$ exclude _ref$ exclude _unref$ |
From: Duncan C. <dun...@us...> - 2004-07-29 14:33:26
|
Update of /cvsroot/gtk2hs/gtk2hs In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16344 Modified Files: ChangeLog Log Message: new tool to check on our coverage of the gtk api. See README for details. Index: ChangeLog =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/ChangeLog,v retrieving revision 1.194 retrieving revision 1.195 diff -u -d -r1.194 -r1.195 --- ChangeLog 29 Jul 2004 12:15:55 -0000 1.194 +++ ChangeLog 29 Jul 2004 14:33:18 -0000 1.195 @@ -10,6 +10,10 @@ * gtk2hs/gtk/abstract/Box.chs, gtk/misc/Adjustment.chs, gtk/layout/Alignment.chs: implement missing functions + * tools/apicoverage/Makefile, tools/apicoverage/Exclude.hs, + tools/apicoverage/gtk.ignore, tools/apicoverage/README: new tool to + check on our coverage of the gtk api. + 2004-07-28 Duncan Coutts <du...@co...> * Makefile: only build filechooser demo with gtk-2.4 |
From: Duncan C. <dun...@us...> - 2004-07-29 14:30:14
|
Update of /cvsroot/gtk2hs/gtk2hs/tools/apicoverage In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15901/apicoverage Log Message: Directory /cvsroot/gtk2hs/gtk2hs/tools/apicoverage added to the repository |