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-04-06 20:20:26
|
Update of /cvsroot/gtk2hs/gtk2hs In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14635 Modified Files: ChangeLog Log Message: Add support for an alternative way of doing signals. We have one single 'generic' marshaler implemented in C using glib's GClosure system. It uses GHC's public rts api to invoke Haskell callbacks, passing parameters of the appropriate types. Index: ChangeLog =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/ChangeLog,v retrieving revision 1.424 retrieving revision 1.425 diff -u -d -r1.424 -r1.425 --- ChangeLog 6 Apr 2005 20:14:21 -0000 1.424 +++ ChangeLog 6 Apr 2005 20:20:15 -0000 1.425 @@ -5,6 +5,12 @@ * tools/hierarchyGen/hierarchy.list: add an extra class to hierarchy. + * glib/System/Glib/hsgclosure.c, glib/System/Glib/hsgclosure.h: add + support for an alternative way of doing signals. We have one single + 'generic' marshaler implemented in C using glib's GClosure system. It + uses GHC's public rts api to invoke Haskell callbacks, passing + parameters of the appropriate types. + 2005-04-5 Duncan Coutts <du...@co...> * glib/System/Glib/UTFString.hs: add some extra functions for |
From: Duncan C. <dun...@us...> - 2005-04-06 20:20:25
|
Update of /cvsroot/gtk2hs/gtk2hs/glib/System/Glib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14635/glib/System/Glib Added Files: hsgclosure.c hsgclosure.h Log Message: Add support for an alternative way of doing signals. We have one single 'generic' marshaler implemented in C using glib's GClosure system. It uses GHC's public rts api to invoke Haskell callbacks, passing parameters of the appropriate types. --- NEW FILE: hsgclosure.c --- /* GIMP Toolkit (GTK) HsGClosure implementation * * Author : Duncan Coutts * * Created: 22 March 2005 * * Version $Revision: 1.1 $ from $Date: 2005/04/06 20:20:16 $ * * Copyright (C) 2005 Duncan Coutts * * 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 2.1 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. */ /* GHC's semi-public Rts API */ #include <Rts.h> #include "hsgclosure.h" #ifdef DEBUG #include <stdio.h> #define WHEN_DEBUG(a) a #else #define WHEN_DEBUG(a) #endif /* HsGClosure is a _private_ structure */ typedef struct _HsGClosure HsGClosure; struct _HsGClosure { GClosure closure; HsStablePtr callback; }; /* TODO: check if we should be using invalidate or finalise */ static void hsg_closure_invalidate(gpointer data, GClosure *closure) { HsGClosure *hc = (HsGClosure *)closure; WHEN_DEBUG(fprintf(stderr, "hsg_closure_invalidate: enter, callback=%p\n", hc->callback)); /* I think invalidate can be called more than once in the case of cycles * so be safe and allow that */ if (hc->callback) hs_free_stable_ptr(hc->callback); hc->callback = NULL; WHEN_DEBUG(fprintf(stderr, "hsg_closure_invalidate: leave\n")); } /* forward defs */ static HaskellObj hsg_value_as_haskellobj(const GValue *value); static void hsg_value_from_haskellobj(GValue *value, HaskellObj obj); extern StgClosure * GHCziStable_deRefStablePtr_closure; static void hsg_closure_marshal(GClosure *closure, GValue *return_value, guint n_param_values, const GValue *param_values, gpointer invocation_hint, gpointer marshal_data) { HsGClosure *hc = (HsGClosure *)closure; HaskellObj call, ret; SchedulerStatus rc; guint i; WHEN_DEBUG(fprintf(stderr, "hsg_closure_marshal: about to run callback=%p, n_param_values=%d\n", hc->callback, n_param_values)); rts_lock(); call = (StgClosure *)deRefStablePtr(hc->callback); /* construct the function call */ for (i = 0; i < n_param_values; i++) { #ifdef DEBUG gchar * value_str_rep = g_strdup_value_contents(¶m_values[i]); fprintf(stderr, "hsg_closure_marshal: param_values[%d]=%s :: %s\n", i, value_str_rep, g_type_name(G_VALUE_TYPE(¶m_values[i]))); g_free(value_str_rep); #endif call = rts_apply(call, hsg_value_as_haskellobj(¶m_values[i])); } WHEN_DEBUG(fprintf(stderr, "hsg_closure_marshal: about to rts_evalIO\n")); /* perform the call */ rc=rts_evalIO(rts_apply((HaskellObj)runIO_closure, call),&ret); WHEN_DEBUG(fprintf(stderr, "hsg_closure_marshal: about to rts_checkSchedStatus\n")); /* barf if anything went wrong */ /* TODO: pass a sensible value for call site so we get better error messages */ /* or perhaps we can propogate any error? */ rts_checkSchedStatus("", rc); if (return_value) { WHEN_DEBUG(fprintf(stderr, "hsg_closure_marshal: type of return_value=%s\n", g_type_name(G_VALUE_TYPE(return_value)))); hsg_value_from_haskellobj(return_value, ret); } rts_unlock(); WHEN_DEBUG(fprintf(stderr, "hsg_closure_marshal: done running callback\n")); } GClosure * hsg_closure_new(HsStablePtr callback) { GClosure *closure; WHEN_DEBUG(fprintf(stderr, "hsg_closure_new: enter, callback=%p\n", callback)); closure = g_closure_new_simple(sizeof(HsGClosure), NULL); /* TODO: check if we should be using invalidate or finalise notifier */ g_closure_add_invalidate_notifier(closure, NULL, hsg_closure_invalidate); g_closure_set_marshal(closure, hsg_closure_marshal); ((HsGClosure *)closure)->callback = callback; WHEN_DEBUG(fprintf(stderr, "hsg_closure_new: leave\n")); return closure; } /* GValue <-> HaskellObj marshaling functions */ static HaskellObj hsg_value_as_haskellobj(const GValue *value) { switch (G_TYPE_FUNDAMENTAL(G_VALUE_TYPE(value))) { case G_TYPE_INTERFACE: if (g_type_is_a(G_VALUE_TYPE(value), G_TYPE_OBJECT)) return rts_mkPtr(g_value_get_object(value)); else break; case G_TYPE_CHAR: return rts_mkChar(g_value_get_char(value)); case G_TYPE_UCHAR: return rts_mkChar(g_value_get_uchar(value)); case G_TYPE_BOOLEAN: return rts_mkBool(g_value_get_boolean(value)); case G_TYPE_INT: return rts_mkInt(g_value_get_int(value)); case G_TYPE_UINT: return rts_mkWord(g_value_get_uint(value)); case G_TYPE_LONG: return rts_mkInt(g_value_get_long(value)); case G_TYPE_ULONG: return rts_mkWord(g_value_get_ulong(value)); /* case G_TYPE_INT64: return rts_mkInt64(g_value_get_int64(value)); case G_TYPE_UINT64: return rts_mkWord64(g_value_get_uint64(value)); */ case G_TYPE_ENUM: return rts_mkInt(g_value_get_enum(value)); case G_TYPE_FLAGS: return rts_mkWord(g_value_get_enum(value)); case G_TYPE_FLOAT: return rts_mkFloat(g_value_get_float(value)); case G_TYPE_DOUBLE: return rts_mkDouble(g_value_get_double(value)); case G_TYPE_STRING: return rts_mkPtr((char *)g_value_get_string(value)); /* CHECKME: is the string freed? */ case G_TYPE_POINTER: return rts_mkPtr(g_value_get_pointer(value)); case G_TYPE_BOXED: return rts_mkPtr(g_value_get_boxed(value)); case G_TYPE_PARAM: break; /* TODO */ /* return g_value_get_param(value); */ case G_TYPE_OBJECT: return rts_mkPtr(g_value_get_object(value)); default: break; } WHEN_DEBUG(fprintf(stderr, "hsg_value_as_haskellobj: unable to handle GValue: %s\n", g_strdup_value_contents(value))); exit(1); } void hsg_value_from_haskellobj(GValue *value, HaskellObj obj) { switch (G_TYPE_FUNDAMENTAL(G_VALUE_TYPE(value))) { case G_TYPE_INTERFACE: /* we only handle interface types that have a GObject prereq */ if (g_type_is_a(G_VALUE_TYPE(value), G_TYPE_OBJECT)) { g_value_set_object(value, rts_getPtr(obj)); } else { break; } return; case G_TYPE_CHAR: g_value_set_char(value, rts_getChar(obj)); return; case G_TYPE_UCHAR: g_value_set_char(value, rts_getChar(obj)); return; case G_TYPE_BOOLEAN: g_value_set_boolean(value, rts_getBool(obj)); return; case G_TYPE_INT: g_value_set_int(value, rts_getInt(obj)); return; case G_TYPE_UINT: g_value_set_uint(value, rts_getWord(obj)); return; case G_TYPE_LONG: g_value_set_long(value, rts_getInt(obj)); return; case G_TYPE_ULONG: g_value_set_ulong(value, rts_getWord(obj)); return; /* case G_TYPE_INT64: g_value_set_int64(value, rts_getInt64(obj)); return; case G_TYPE_UINT64: g_value_set_uint64(value, rts_getWord64(obj)); return; */ case G_TYPE_ENUM: g_value_set_enum(value, rts_getInt(obj)); return; case G_TYPE_FLAGS: g_value_set_flags(value, rts_getInt(obj)); return; case G_TYPE_FLOAT: g_value_set_float(value, rts_getFloat(obj)); return; case G_TYPE_DOUBLE: g_value_set_double(value, rts_getDouble(obj)); return; case G_TYPE_STRING: g_value_set_string(value, rts_getPtr(obj)); return; case G_TYPE_POINTER: g_value_set_pointer(value, rts_getPtr(obj)); return; case G_TYPE_BOXED: { /* g_value_set_boxed(value, obj); */ break; /* TODO */ } case G_TYPE_PARAM: /* g_value_set_param(value, (obj)); */ break; /* TODO */ case G_TYPE_OBJECT: g_value_set_object(value, rts_getPtr(obj)); return; default: break; } /* FIXME: improve error handling here */ WHEN_DEBUG(fprintf(stderr, "hsg_value_from_haskellobj: unable to handle GValue with type %s\n", g_type_name(G_VALUE_TYPE((value))))); exit(1); } --- NEW FILE: hsgclosure.h --- /* GIMP Toolkit (GTK) HSGClosure interface * * Author : Duncan Coutts * * Created: 22 March 2005 * * Version $Revision: 1.1 $ from $Date: 2005/04/06 20:20:16 $ * * Copyright (C) 2005 Duncan Coutts * * 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 2.1 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. */ #include <glib-object.h> GClosure * hsg_closure_new(HsStablePtr callback); |
From: Duncan C. <dun...@us...> - 2005-04-06 20:14:42
|
Update of /cvsroot/gtk2hs/gtk2hs In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10345 Modified Files: ChangeLog Log Message: gtkmarshal.list: tidy up slightly, and add extra marshaler since it'll be needed soon. hierarchy.list: add an extra class to hierarchy. Index: ChangeLog =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/ChangeLog,v retrieving revision 1.423 retrieving revision 1.424 diff -u -d -r1.423 -r1.424 --- ChangeLog 5 Apr 2005 18:38:21 -0000 1.423 +++ ChangeLog 6 Apr 2005 20:14:21 -0000 1.424 @@ -1,3 +1,10 @@ +2005-04-6 Duncan Coutts <du...@co...> + + * tools/callbackGen/gtkmarshal.list: tidy up slightly, and add + extra marshaler since it'll be needed soon. + + * tools/hierarchyGen/hierarchy.list: add an extra class to hierarchy. + 2005-04-5 Duncan Coutts <du...@co...> * glib/System/Glib/UTFString.hs: add some extra functions for |
From: Duncan C. <dun...@us...> - 2005-04-06 20:14:40
|
Update of /cvsroot/gtk2hs/gtk2hs/tools/callbackGen In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10345/tools/callbackGen Modified Files: gtkmarshal.list Log Message: gtkmarshal.list: tidy up slightly, and add extra marshaler since it'll be needed soon. hierarchy.list: add an extra class to hierarchy. Index: gtkmarshal.list =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/tools/callbackGen/gtkmarshal.list,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- gtkmarshal.list 26 Mar 2005 00:10:55 -0000 1.5 +++ gtkmarshal.list 6 Apr 2005 20:14:22 -0000 1.6 @@ -26,7 +26,7 @@ BOOLEAN:BOXED BOOLEAN:BOXED,BOXED -#BOOLEAN:ENUM +BOOLEAN:ENUM #BOOLEAN:ENUM,INT #BOOLEAN:OBJECT,UINT,FLAGS #BOOLEAN:OBJECT,INT,INT,UINT @@ -45,7 +45,7 @@ VOID:BOOLEAN #VOID:ENUM VOID:INT -#VOID:INT,BOOL +#VOID:INT,BOOLEAN VOID:INT,INT VOID:VOID #VOID:STRING,INT,POINTER @@ -100,7 +100,7 @@ # callback "text-insert" in TextBuffer. VOID:BOXED,POINTER,INT # This one is needed in TextView: -VOID:INT,BOOL +VOID:INT,BOOLEAN # This is for the "edited" signal in CellRendererText: VOID:POINTER,STRING # This is for the GConfClient value_changed signal |
From: Duncan C. <dun...@us...> - 2005-04-06 20:14:40
|
Update of /cvsroot/gtk2hs/gtk2hs/tools/hierarchyGen In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10345/tools/hierarchyGen Modified Files: hierarchy.list Log Message: gtkmarshal.list: tidy up slightly, and add extra marshaler since it'll be needed soon. hierarchy.list: add an extra class to hierarchy. Index: hierarchy.list =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/tools/hierarchyGen/hierarchy.list,v retrieving revision 1.15 retrieving revision 1.16 diff -u -d -r1.15 -r1.16 --- hierarchy.list 5 Apr 2005 18:38:22 -0000 1.15 +++ hierarchy.list 6 Apr 2005 20:14:22 -0000 1.16 @@ -33,6 +33,7 @@ GtkTextTagTable GtkSourceTagTable if sourceview GtkStyle + GtkRcStyle GdkDragContext GdkPixbuf GtkTextChildAnchor |
From: Duncan C. <dun...@us...> - 2005-04-05 18:39:07
|
Update of /cvsroot/gtk2hs/gtk2hs In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25015 Modified Files: ChangeLog Makefile.am Log Message: Makefile.am: Also add _stub.o files to libHSgtk_a_LIBADD. hierarchy.list: add new classes to hierarchy. Index: Makefile.am =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/Makefile.am,v retrieving revision 1.61 retrieving revision 1.62 diff -u -d -r1.61 -r1.62 --- Makefile.am 5 Apr 2005 18:29:51 -0000 1.61 +++ Makefile.am 5 Apr 2005 18:38:22 -0000 1.62 @@ -469,7 +469,10 @@ gtk/Graphics/UI/Gtk/TreeList/TreeModel_stub.o \ gtk/Graphics/UI/Gtk/Signals_stub.o \ gtk/Graphics/UI/Gtk/TreeList/TreeSelection_stub.o \ - gtk/Graphics/UI/Gtk/TreeList/TreeView_stub.o + gtk/Graphics/UI/Gtk/TreeList/TreeView_stub.o \ + gtk/Graphics/UI/Gtk/TreeList/IconView_stub.o \ + gtk/Graphics/UI/Gtk/Selectors/FileFilter_stub.o \ + gtk/Graphics/UI/Gtk/Windows/AboutDialog_stub.o # Pretend these stub files can be created by a simple rule. $(libHSgtk_a_LIBADD) : Index: ChangeLog =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/ChangeLog,v retrieving revision 1.422 retrieving revision 1.423 diff -u -d -r1.422 -r1.423 --- ChangeLog 5 Apr 2005 18:29:51 -0000 1.422 +++ ChangeLog 5 Apr 2005 18:38:21 -0000 1.423 @@ -15,7 +15,10 @@ * gtk/Graphics/UI/Gtk.hs: export the new modules. - * Makefile.am: add the new modules to libHSgtk_a_SOURCES. + * Makefile.am: add the new modules to libHSgtk_a_SOURCES. Also add + _stub.o files to libHSgtk_a_LIBADD. + + * tools/hierarchyGen/hierarchy.list: add new classes to hierarchy. 2005-04-4 Duncan Coutts <du...@co...> |
From: Duncan C. <dun...@us...> - 2005-04-05 18:38:46
|
Update of /cvsroot/gtk2hs/gtk2hs/tools/hierarchyGen In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25015/tools/hierarchyGen Modified Files: hierarchy.list Log Message: Makefile.am: Also add _stub.o files to libHSgtk_a_LIBADD. hierarchy.list: add new classes to hierarchy. Index: hierarchy.list =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/tools/hierarchyGen/hierarchy.list,v retrieving revision 1.14 retrieving revision 1.15 diff -u -d -r1.14 -r1.15 --- hierarchy.list 12 Jan 2005 18:19:53 -0000 1.14 +++ hierarchy.list 5 Apr 2005 18:38:22 -0000 1.15 @@ -55,6 +55,8 @@ GtkToggleButton GtkCheckButton GtkRadioButton + GtkColorButton if gtk-2.6 + GtkFontButton if gtk-2.6 GtkOptionMenu if deprecated GtkItem GtkMenuItem @@ -66,6 +68,7 @@ # GtkTreeItem GtkWindow GtkDialog + GtkAboutDialog if gtk-2.6 GtkColorSelectionDialog GtkFileSelection GtkFileChooserDialog if gtk-2.4 @@ -97,6 +100,7 @@ GtkFileChooserWidget if gtk-2.4 GtkHBox GtkCombo if deprecated + GtkFileChooserButton if gtk-2.6 GtkStatusbar GtkCList if deprecated GtkCTree if deprecated @@ -104,6 +108,7 @@ GtkPaned GtkHPaned GtkVPaned + GtkIconView if gtk-2.6 GtkLayout GtkList if deprecated GtkMenuShell @@ -118,7 +123,8 @@ GtkToolbar GtkTreeView GtkCalendar - GtkDrawingArea + GtkCellView if gtk-2.6 + GtkDrawingArea GtkCurve GtkEntry GtkSpinButton @@ -175,6 +181,7 @@ GtkRadioAction if gtk-2.4 GtkActionGroup if gtk-2.4 GtkUIManager if gtk-2.4 + GtkWindowGroup if gtk-2.4 GtkSourceLanguage if sourceview GtkSourceLanguagesManager if sourceview GladeXML as GladeXML, glade_xml_get_type if libglade |
From: Duncan C. <dun...@us...> - 2005-04-05 18:30:03
|
Update of /cvsroot/gtk2hs/gtk2hs/gtk/Graphics/UI/Gtk/Windows In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22213/gtk/Graphics/UI/Gtk/Windows Added Files: AboutDialog.chs WindowGroup.chs Log Message: Add several new modules. This adds ~2.6 Kloc. gtk/Graphics/UI/Gtk.hs: export the new modules. Makefile.am: add the new modules to libHSgtk_a_SOURCES. --- NEW FILE: AboutDialog.chs --- -- -*-haskell-*- -- GIMP Toolkit (GTK) Widget AboutDialog -- -- Author : Duncan Coutts -- -- Created: 1 March 2005 -- -- Version $Revision: 1.1 $ from $Date: 2005/04/05 18:29:53 $ -- -- Copyright (C) 2005 Duncan Coutts -- -- 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 2.1 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. -- -- | -- Maintainer : gtk...@li... -- Stability : provisional -- Portability : portable (depends on GHC) -- -- Display information about an application -- -- * Module available since Gtk+ version 2.6 -- module Graphics.UI.Gtk.Windows.AboutDialog ( -- * Detail -- -- | The 'AboutDialog' offers a simple way to display information about a -- program like its logo, name, copyright, website and license. It is also -- possible to give credits to the authors, documenters, translators and -- artists who have worked on the program. An about dialog is typically opened -- when the user selects the @About@ option from the @Help@ menu. All parts of -- the dialog are optional. -- -- About dialog often contain links and email addresses. 'AboutDialog' -- supports this by offering global hooks, which are called when the user -- clicks on a link or email address, see 'aboutDialogSetEmailHook' and -- 'aboutDialogSetUrlHook'. Email addresses in the authors, documenters and -- artists properties are recognized by looking for @\<user\@host>@, URLs are -- recognized by looking for @http:\/\/url@, with @url@ extending to the next -- space, tab or line break. -- * Class Hierarchy -- | -- @ -- | 'GObject' -- | +----'Object' -- | +----'Widget' -- | +----'Container' -- | +----'Bin' -- | +----'Window' -- | +----'Dialog' -- | +----AboutDialog -- @ -- * Types AboutDialog, AboutDialogClass, castToAboutDialog, -- * Constructors aboutDialogNew, -- * Methods aboutDialogGetName, aboutDialogSetName, aboutDialogGetVersion, aboutDialogSetVersion, aboutDialogGetCopyright, aboutDialogSetCopyright, aboutDialogGetComments, aboutDialogSetComments, aboutDialogGetLicense, aboutDialogSetLicense, aboutDialogGetWebsite, aboutDialogSetWebsite, aboutDialogGetWebsiteLabel, aboutDialogSetWebsiteLabel, aboutDialogSetAuthors, aboutDialogSetArtists, aboutDialogSetDocumenters, aboutDialogGetTranslatorCredits, aboutDialogSetTranslatorCredits, aboutDialogGetLogo, aboutDialogSetLogo, aboutDialogGetLogoIconName, aboutDialogSetLogoIconName, aboutDialogSetEmailHook, aboutDialogSetUrlHook, -- * Properties aboutDialogName, aboutDialogVersion, aboutDialogCopyright, aboutDialogComments, aboutDialogWebsite, aboutDialogWebsiteLabel, aboutDialogTranslatorCredits, -- aboutDialogLogoIconName ) where import Monad (liftM) import Maybe (fromMaybe) import System.Glib.FFI import System.Glib.UTFString import System.Glib.Attributes (Attr(..)) import System.Glib.GObject (makeNewGObject, mkFunPtrDestructor) import Graphics.UI.Gtk.Abstract.Object (makeNewObject) {#import Graphics.UI.Gtk.Types#} {# context lib="gtk" prefix="gtk" #} -------------------- -- Constructors -- | Creates a new 'AboutDialog'. -- aboutDialogNew :: IO AboutDialog aboutDialogNew = makeNewObject mkAboutDialog $ liftM (castPtr :: Ptr Widget -> Ptr AboutDialog) $ {# call gtk_about_dialog_new #} -------------------- -- Methods -- | Returns the program name displayed in the about dialog. -- aboutDialogGetName :: AboutDialogClass self => self -> IO String -- ^ returns The program name. aboutDialogGetName self = {# call gtk_about_dialog_get_name #} (toAboutDialog self) >>= peekUTFString -- | Sets the name to display in the about dialog. If this is not set, it -- defaults to the program executable name. -- aboutDialogSetName :: AboutDialogClass self => self -> String -- ^ @name@ - the program name -> IO () aboutDialogSetName self name = withUTFString name $ \namePtr -> {# call gtk_about_dialog_set_name #} (toAboutDialog self) namePtr -- | Returns the version string. -- aboutDialogGetVersion :: AboutDialogClass self => self -> IO String -- ^ returns The version string. aboutDialogGetVersion self = {# call gtk_about_dialog_get_version #} (toAboutDialog self) >>= peekUTFString -- | Sets the version string to display in the about dialog. -- aboutDialogSetVersion :: AboutDialogClass self => self -> String -- ^ @version@ - the version string -> IO () aboutDialogSetVersion self version = withUTFString version $ \versionPtr -> {# call gtk_about_dialog_set_version #} (toAboutDialog self) versionPtr -- | Returns the copyright string. -- aboutDialogGetCopyright :: AboutDialogClass self => self -> IO String -- ^ returns The copyright string. aboutDialogGetCopyright self = {# call gtk_about_dialog_get_copyright #} (toAboutDialog self) >>= peekUTFString -- | Sets the copyright string to display in the about dialog. This should be -- a short string of one or two lines. -- aboutDialogSetCopyright :: AboutDialogClass self => self -> String -- ^ @copyright@ - the copyright string -> IO () aboutDialogSetCopyright self copyright = withUTFString copyright $ \copyrightPtr -> {# call gtk_about_dialog_set_copyright #} (toAboutDialog self) copyrightPtr -- | Returns the comments string. -- aboutDialogGetComments :: AboutDialogClass self => self -> IO String -- ^ returns The comments. aboutDialogGetComments self = {# call gtk_about_dialog_get_comments #} (toAboutDialog self) >>= peekUTFString -- | Sets the comments string to display in the about dialog. This should be a -- short string of one or two lines. -- aboutDialogSetComments :: AboutDialogClass self => self -> String -- ^ @comments@ - a comments string -> IO () aboutDialogSetComments self comments = withUTFString comments $ \commentsPtr -> {# call gtk_about_dialog_set_comments #} (toAboutDialog self) commentsPtr -- | Returns the license information. -- aboutDialogGetLicense :: AboutDialogClass self => self -> IO String -- ^ returns The license information. aboutDialogGetLicense self = {# call gtk_about_dialog_get_license #} (toAboutDialog self) >>= peekUTFString -- | Sets the license information to be displayed in the secondary license -- dialog. If @license@ is @Nothing@, the license button is hidden. -- aboutDialogSetLicense :: AboutDialogClass self => self -> Maybe String -- ^ @license@ - the license information or @Nothing@ -> IO () aboutDialogSetLicense self license = maybeWith withUTFString license $ \licensePtr -> {# call gtk_about_dialog_set_license #} (toAboutDialog self) licensePtr -- | Returns the website URL. -- aboutDialogGetWebsite :: AboutDialogClass self => self -> IO String -- ^ returns The website URL. aboutDialogGetWebsite self = {# call gtk_about_dialog_get_website #} (toAboutDialog self) >>= peekUTFString -- | Sets the URL to use for the website link. -- aboutDialogSetWebsite :: AboutDialogClass self => self -> String -- ^ @website@ - a URL string starting with \"http:\/\/\" -> IO () aboutDialogSetWebsite self website = withUTFString website $ \websitePtr -> {# call gtk_about_dialog_set_website #} (toAboutDialog self) websitePtr -- | Returns the label used for the website link. -- aboutDialogGetWebsiteLabel :: AboutDialogClass self => self -> IO String -- ^ returns The label used for the website link. aboutDialogGetWebsiteLabel self = {# call gtk_about_dialog_get_website_label #} (toAboutDialog self) >>= peekUTFString -- | Sets the label to be used for the website link. It defaults to the -- website URL. -- aboutDialogSetWebsiteLabel :: AboutDialogClass self => self -> String -- ^ @websiteLabel@ - the label used for the website link -> IO () aboutDialogSetWebsiteLabel self websiteLabel = withUTFString websiteLabel $ \websiteLabelPtr -> {# call gtk_about_dialog_set_website_label #} (toAboutDialog self) websiteLabelPtr -- | Sets the strings which are displayed in the authors tab of the secondary -- credits dialog. -- aboutDialogSetAuthors :: AboutDialogClass self => self -> [String] -- ^ @authors@ - a list of author names -> IO () aboutDialogSetAuthors self authors = withUTFStringArray0 authors $ \authorsPtr -> {# call gtk_about_dialog_set_authors #} (toAboutDialog self) authorsPtr -- | Sets the strings which are displayed in the artists tab of the secondary -- credits dialog. -- aboutDialogSetArtists :: AboutDialogClass self => self -> [String] -- ^ @artists@ - a list of artist names -> IO () aboutDialogSetArtists self artists = withUTFStringArray0 artists $ \artistsPtr -> {# call gtk_about_dialog_set_artists #} (toAboutDialog self) artistsPtr -- | Sets the strings which are displayed in the documenters tab of the -- secondary credits dialog. -- aboutDialogSetDocumenters :: AboutDialogClass self => self -> [String] -- ^ @artists@ - a list of documenter names -> IO () aboutDialogSetDocumenters self documenters = withUTFStringArray0 documenters $ \documentersPtr -> {# call gtk_about_dialog_set_documenters #} (toAboutDialog self) documentersPtr -- | Returns the translator credits string which is displayed in the -- translators tab of the secondary credits dialog. -- aboutDialogGetTranslatorCredits :: AboutDialogClass self => self -> IO String -- ^ returns The translator credits string. aboutDialogGetTranslatorCredits self = {# call gtk_about_dialog_get_translator_credits #} (toAboutDialog self) >>= peekUTFString -- | Sets the translator credits string which is displayed in the translators -- tab of the secondary credits dialog. -- -- The intended use for this string is to display the translator of the -- language which is currently used in the user interface. -- aboutDialogSetTranslatorCredits :: AboutDialogClass self => self -> String -- ^ @translatorCredits@ - the translator credits -> IO () aboutDialogSetTranslatorCredits self translatorCredits = withUTFString translatorCredits $ \translatorCreditsPtr -> {# call gtk_about_dialog_set_translator_credits #} (toAboutDialog self) translatorCreditsPtr -- | Returns the pixbuf displayed as logo in the about dialog. -- aboutDialogGetLogo :: AboutDialogClass self => self -> IO Pixbuf -- ^ returns the pixbuf displayed as logo. aboutDialogGetLogo self = makeNewGObject mkPixbuf $ {# call gtk_about_dialog_get_logo #} (toAboutDialog self) -- | Sets the pixbuf to be displayed as logo in the about dialog. If it is -- @Nothing@, the default window icon set with 'windowSetDefaultIcon' will be -- used. -- aboutDialogSetLogo :: AboutDialogClass self => self -> Maybe Pixbuf -- ^ @logo@ - a 'Pixbuf', or @Nothing@ -> IO () aboutDialogSetLogo self logo = {# call gtk_about_dialog_set_logo #} (toAboutDialog self) (fromMaybe (Pixbuf nullForeignPtr) logo) -- | Returns the icon name displayed as logo in the about dialog. -- aboutDialogGetLogoIconName :: AboutDialogClass self => self -> IO String -- ^ returns the icon name displayed as logo. aboutDialogGetLogoIconName self = {# call gtk_about_dialog_get_logo_icon_name #} (toAboutDialog self) >>= peekUTFString -- | Sets the pixbuf to be displayed as logo in the about dialog. If it is -- @Nothing@, the default window icon set with 'windowSetDefaultIcon' will be -- used. -- aboutDialogSetLogoIconName :: AboutDialogClass self => self -> Maybe String -- ^ @iconName@ - an icon name, or @Nothing@ -> IO () aboutDialogSetLogoIconName self iconName = maybeWith withUTFString iconName $ \iconNamePtr -> {# call gtk_about_dialog_set_logo_icon_name #} (toAboutDialog self) iconNamePtr -- | Installs a global function to be called whenever the user activates an -- email link in an about dialog. -- aboutDialogSetEmailHook :: (String -> IO ()) -- ^ @(\url -> ...)@ - a function to call when an email -- link is activated. -> IO () aboutDialogSetEmailHook func = do funcPtr <- mkAboutDialogActivateLinkFunc (\_ linkPtr _ -> do link <- peekUTFString linkPtr func link ) destroyPtr <- mkFunPtrDestructor funcPtr {# call gtk_about_dialog_set_email_hook #} funcPtr nullPtr destroyPtr return () -- | Installs a global function to be called whenever the user activates a URL -- link in an about dialog. -- aboutDialogSetUrlHook :: (String -> IO ()) -- ^ @(\url -> ...)@ - a function to call when a URL link -- is activated. -> IO () aboutDialogSetUrlHook func = do funcPtr <- mkAboutDialogActivateLinkFunc (\_ linkPtr _ -> do link <- peekUTFString linkPtr func link ) destroyPtr <- mkFunPtrDestructor funcPtr {# call gtk_about_dialog_set_url_hook #} funcPtr nullPtr destroyPtr return () {# pointer AboutDialogActivateLinkFunc #} foreign import ccall "wrapper" mkAboutDialogActivateLinkFunc :: (Ptr AboutDialog -> CString -> Ptr () -> IO ()) -> IO AboutDialogActivateLinkFunc -------------------- -- Properties -- | The name of the program. If this is not set, it defaults to -- 'gGetApplicationName'. -- aboutDialogName :: AboutDialogClass self => Attr self String aboutDialogName = Attr aboutDialogGetName aboutDialogSetName -- | The version of the program. -- aboutDialogVersion :: AboutDialogClass self => Attr self String aboutDialogVersion = Attr aboutDialogGetVersion aboutDialogSetVersion -- | Copyright information for the program. -- aboutDialogCopyright :: AboutDialogClass self => Attr self String aboutDialogCopyright = Attr aboutDialogGetCopyright aboutDialogSetCopyright -- | Comments about the program. This string is displayed in a label in the -- main dialog, thus it should be a short explanation of the main purpose of -- the program, not a detailed list of features. -- aboutDialogComments :: AboutDialogClass self => Attr self String aboutDialogComments = Attr aboutDialogGetComments aboutDialogSetComments -- | The URL for the link to the website of the program. This should be a -- string starting with \"http:\/\/. -- aboutDialogWebsite :: AboutDialogClass self => Attr self String aboutDialogWebsite = Attr aboutDialogGetWebsite aboutDialogSetWebsite -- | The label for the link to the website of the program. If this is not set, -- it defaults to the URL specified in the website property. -- aboutDialogWebsiteLabel :: AboutDialogClass self => Attr self String aboutDialogWebsiteLabel = Attr aboutDialogGetWebsiteLabel aboutDialogSetWebsiteLabel -- | Credits to the translators. This string should be marked as translatable. -- The string may contain email addresses and URLs, which will be displayed as -- links, see the introduction for more details. -- aboutDialogTranslatorCredits :: AboutDialogClass self => Attr self String aboutDialogTranslatorCredits = Attr aboutDialogGetTranslatorCredits aboutDialogSetTranslatorCredits --- NEW FILE: WindowGroup.chs --- -- -*-haskell-*- -- GIMP Toolkit (GTK) Widget WindowGroup -- -- Author : Duncan Coutts -- -- Created: 25 March 2005 -- -- Version $Revision: 1.1 $ from $Date: 2005/04/05 18:29:53 $ -- -- Copyright (C) 2005 Duncan Coutts -- -- 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 2.1 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. -- -- | -- Maintainer : gtk...@li... -- Stability : provisional -- Portability : portable (depends on GHC) -- -- Limit the effect of grabs -- module Graphics.UI.Gtk.Windows.WindowGroup ( -- * Class Hierarchy -- | -- @ -- | 'GObject' -- | +----WindowGroup -- @ -- * Types WindowGroup, WindowGroupClass, castToWindowGroup, -- * Constructors windowGroupNew, -- * Methods windowGroupAddWindow, windowGroupRemoveWindow, ) where import Monad (liftM) import System.Glib.FFI import System.Glib.GObject (makeNewGObject) {#import Graphics.UI.Gtk.Types#} {# context lib="gtk" prefix="gtk" #} -------------------- -- Constructors -- | Creates a new 'WindowGroup' object. Grabs added with 'grabAdd' only -- affect windows within the same 'WindowGroup'. -- windowGroupNew :: IO WindowGroup windowGroupNew = makeNewGObject mkWindowGroup $ {# call gtk_window_group_new #} -------------------- -- Methods -- | Adds a window to a 'WindowGroup'. -- windowGroupAddWindow :: (WindowGroupClass self, WindowClass window) => self -> window -- ^ @window@ - the 'Window' to add -> IO () windowGroupAddWindow self window = {# call gtk_window_group_add_window #} (toWindowGroup self) (toWindow window) -- | Removes a window from a 'WindowGroup'. -- windowGroupRemoveWindow :: (WindowGroupClass self, WindowClass window) => self -> window -- ^ @window@ - the 'Window' to remove -> IO () windowGroupRemoveWindow self window = {# call gtk_window_group_remove_window #} (toWindowGroup self) (toWindow window) |
From: Duncan C. <dun...@us...> - 2005-04-05 18:30:03
|
Update of /cvsroot/gtk2hs/gtk2hs/gtk/Graphics/UI/Gtk/Selectors In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22213/gtk/Graphics/UI/Gtk/Selectors Added Files: ColorButton.chs.pp FontButton.chs.pp FileChooserButton.chs.pp FileFilter.chs.pp Log Message: Add several new modules. This adds ~2.6 Kloc. gtk/Graphics/UI/Gtk.hs: export the new modules. Makefile.am: add the new modules to libHSgtk_a_SOURCES. --- NEW FILE: FontButton.chs.pp --- -- -*-haskell-*- -- GIMP Toolkit (GTK) Widget FontButton -- -- Author : Duncan Coutts -- -- Created: 5 April 2005 -- -- Version $Revision: 1.1 $ from $Date: 2005/04/05 18:29:52 $ -- -- Copyright (C) 2005 Duncan Coutts -- -- 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 2.1 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. -- -- | -- Maintainer : gtk...@li... -- Stability : provisional -- Portability : portable (depends on GHC) -- -- A button to launch a font selection dialog -- -- * Module available since Gtk+ version 2.4 -- module Graphics.UI.Gtk.Selectors.FontButton ( -- * Detail -- -- | The 'FontButton' is a button which displays the currently selected font -- an allows to open a font selection dialog to change the font. It is suitable -- widget for selecting a font in a preference dialog. -- * Class Hierarchy -- | -- @ -- | 'GObject' -- | +----'Object' -- | +----'Widget' -- | +----'Container' -- | +----'Bin' -- | +----'Button' -- | +----FontButton -- @ #if GTK_CHECK_VERSION(2,4,0) -- * Types FontButton, FontButtonClass, castToFontButton, -- * Constructors fontButtonNew, fontButtonNewWithFont, -- * Methods fontButtonSetFontName, fontButtonGetFontName, fontButtonSetShowStyle, fontButtonGetShowStyle, fontButtonSetShowSize, fontButtonGetShowSize, fontButtonSetUseFont, fontButtonGetUseFont, fontButtonSetUseSize, fontButtonGetUseSize, fontButtonSetTitle, fontButtonGetTitle, -- * Properties fontButtonTitle, fontButtonUseFont, fontButtonUseSize, fontButtonShowStyle, fontButtonShowSize, -- * Signals onFontSet, afterFontSet, #endif ) where import Monad (liftM) import System.Glib.FFI import System.Glib.UTFString import System.Glib.Attributes (Attr(..)) import Graphics.UI.Gtk.Abstract.Object (makeNewObject) {#import Graphics.UI.Gtk.Types#} {#import Graphics.UI.Gtk.Signals#} {# context lib="gtk" prefix="gtk" #} #if GTK_CHECK_VERSION(2,4,0) -------------------- -- Constructors -- | Creates a new font picker widget. -- fontButtonNew :: IO FontButton fontButtonNew = makeNewObject mkFontButton $ liftM (castPtr :: Ptr Widget -> Ptr FontButton) $ {# call gtk_font_button_new #} -- | Creates a new font picker widget. -- fontButtonNewWithFont :: String -- ^ @fontname@ - Name of font to display in font selection -- dialog -> IO FontButton fontButtonNewWithFont fontname = makeNewObject mkFontButton $ liftM (castPtr :: Ptr Widget -> Ptr FontButton) $ withUTFString fontname $ \fontnamePtr -> {# call gtk_font_button_new_with_font #} fontnamePtr -------------------- -- Methods -- | Sets or updates the currently-displayed font in font picker dialog. -- fontButtonSetFontName :: FontButtonClass self => self -> String -- ^ @fontname@ - Name of font to display in font selection dialog -> IO Bool -- ^ returns Return value of 'fontSelectionDialogSetFontName' if -- the font selection dialog exists, otherwise @False@. fontButtonSetFontName self fontname = liftM toBool $ withUTFString fontname $ \fontnamePtr -> {# call gtk_font_button_set_font_name #} (toFontButton self) fontnamePtr -- | Retrieves the name of the currently selected font. -- fontButtonGetFontName :: FontButtonClass self => self -> IO String -- ^ returns an internal copy of the font name which must not be -- freed. fontButtonGetFontName self = {# call gtk_font_button_get_font_name #} (toFontButton self) >>= peekUTFString -- | If @showStyle@ is @True@, the font style will be displayed along with -- name of the selected font. -- fontButtonSetShowStyle :: FontButtonClass self => self -> Bool -- ^ @showStyle@ - @True@ if font style should be displayed in -- label. -> IO () fontButtonSetShowStyle self showStyle = {# call gtk_font_button_set_show_style #} (toFontButton self) (fromBool showStyle) -- | Returns whether the name of the font style will be shown in the label. -- fontButtonGetShowStyle :: FontButtonClass self => self -> IO Bool -- ^ returns whether the font style will be shown in the label. fontButtonGetShowStyle self = liftM toBool $ {# call gtk_font_button_get_show_style #} (toFontButton self) -- | If @showSize@ is @True@, the font size will be displayed along with the -- name of the selected font. -- fontButtonSetShowSize :: FontButtonClass self => self -> Bool -- ^ @showSize@ - @True@ if font size should be displayed in dialog. -> IO () fontButtonSetShowSize self showSize = {# call gtk_font_button_set_show_size #} (toFontButton self) (fromBool showSize) -- | Returns whether the font size will be shown in the label. -- fontButtonGetShowSize :: FontButtonClass self => self -> IO Bool -- ^ returns whether the font size will be shown in the label. fontButtonGetShowSize self = liftM toBool $ {# call gtk_font_button_get_show_size #} (toFontButton self) -- | If @useFont@ is @True@, the font name will be written using the selected -- font. -- fontButtonSetUseFont :: FontButtonClass self => self -> Bool -- ^ @useFont@ - If @True@, font name will be written using font -- chosen. -> IO () fontButtonSetUseFont self useFont = {# call gtk_font_button_set_use_font #} (toFontButton self) (fromBool useFont) -- | Returns whether the selected font is used in the label. -- fontButtonGetUseFont :: FontButtonClass self => self -> IO Bool -- ^ returns whether the selected font is used in the label. fontButtonGetUseFont self = liftM toBool $ {# call gtk_font_button_get_use_font #} (toFontButton self) -- | If @useSize@ is @True@, the font name will be written using the selected -- size. -- fontButtonSetUseSize :: FontButtonClass self => self -> Bool -- ^ @useSize@ - If @True@, font name will be written using the -- selected size. -> IO () fontButtonSetUseSize self useSize = {# call gtk_font_button_set_use_size #} (toFontButton self) (fromBool useSize) -- | Returns whether the selected size is used in the label. -- fontButtonGetUseSize :: FontButtonClass self => self -> IO Bool -- ^ returns whether the selected size is used in the label. fontButtonGetUseSize self = liftM toBool $ {# call gtk_font_button_get_use_size #} (toFontButton self) -- | Sets the title for the font selection dialog. -- fontButtonSetTitle :: FontButtonClass self => self -> String -- ^ @title@ - a string containing the font selection dialog title -> IO () fontButtonSetTitle self title = withUTFString title $ \titlePtr -> {# call gtk_font_button_set_title #} (toFontButton self) titlePtr -- | Retrieves the title of the font selection dialog. -- fontButtonGetTitle :: FontButtonClass self => self -> IO String -- ^ returns an internal copy of the title string which must not -- be freed. fontButtonGetTitle self = {# call gtk_font_button_get_title #} (toFontButton self) >>= peekUTFString -------------------- -- Properties -- | The title of the font selection dialog. -- -- Default value: \"Pick a Font\" -- fontButtonTitle :: FontButtonClass self => Attr self String fontButtonTitle = Attr fontButtonGetTitle fontButtonSetTitle -- | If this property is set to @True@, the label will be drawn in the -- selected font. -- -- Default value: @False@ -- fontButtonUseFont :: FontButtonClass self => Attr self Bool fontButtonUseFont = Attr fontButtonGetUseFont fontButtonSetUseFont -- | If this property is set to @True@, the label will be drawn with the -- selected font size. -- -- Default value: @False@ -- fontButtonUseSize :: FontButtonClass self => Attr self Bool fontButtonUseSize = Attr fontButtonGetUseSize fontButtonSetUseSize -- | If this property is set to @True@, the name of the selected font style -- will be shown in the label. For a more WYSIWIG way to show the selected -- style, see the ::use-font property. -- -- Default value: @True@ -- fontButtonShowStyle :: FontButtonClass self => Attr self Bool fontButtonShowStyle = Attr fontButtonGetShowStyle fontButtonSetShowStyle -- | If this property is set to @True@, the selected font size will be shown -- in the label. For a more WYSIWIG way to show the selected size, see the -- ::use-size property. -- -- Default value: @True@ -- fontButtonShowSize :: FontButtonClass self => Attr self Bool fontButtonShowSize = Attr fontButtonGetShowSize fontButtonSetShowSize -------------------- -- Signals -- | The ::font-set signal is emitted when the user selects a font. When -- handling this signal, use 'fontButtonGetFontName' to find out which font was -- just selected. -- onFontSet, afterFontSet :: FontButtonClass self => self -> IO () -> IO (ConnectId self) onFontSet = connect_NONE__NONE "font_set" False afterFontSet = connect_NONE__NONE "font_set" True #endif --- NEW FILE: FileFilter.chs.pp --- -- -*-haskell-*- -- GIMP Toolkit (GTK) Widget FileFilter -- -- Author : Duncan Coutts -- -- Created: 26 February 2005 -- -- Version $Revision: 1.1 $ from $Date: 2005/04/05 18:29:52 $ -- -- Copyright (C) 2005 Duncan Coutts -- -- 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 2.1 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. -- -- | -- Maintainer : gtk...@li... -- Stability : provisional -- Portability : portable (depends on GHC) -- -- A filter for selecting a file subset -- -- * Module available since Gtk+ version 2.4 -- module Graphics.UI.Gtk.Selectors.FileFilter ( -- * Detail -- -- | A 'FileFilter' can be used to restrict the files being shown in a -- 'FileChooser'. Files can be filtered based on their name (with -- 'fileFilterAddPattern'), on their mime type (with 'fileFilterAddMimeType'), -- or by a custom filter function (with 'fileFilterAddCustom'). -- -- Filtering by mime types handles aliasing and subclassing of mime types; -- e.g. a filter for \"text\/plain\" also matches a file with mime type -- \"application\/rtf\", since \"application\/rtf\" is a subclass of -- \"text\/plain\". Note that 'FileFilter' allows wildcards for the subtype of -- a mime type, so you can e.g. filter for \"image\/\*\". -- -- Normally, filters are used by adding them to a 'FileChooser', see -- 'fileChooserAddFilter', but it is also possible to manually use a filter on -- a file with 'fileFilterFilter'. -- * Class Hierarchy -- | -- @ -- | 'GObject' -- | +----'Object' -- | +----FileFilter -- @ #if GTK_CHECK_VERSION(2,4,0) -- * Types FileFilter, FileFilterClass, castToFileFilter, -- * Constructors fileFilterNew, -- * Methods fileFilterSetName, fileFilterGetName, fileFilterAddMimeType, fileFilterAddPattern, fileFilterAddCustom, #if GTK_CHECK_VERSION(2,6,0) fileFilterAddPixbufFormats, #endif -- * Properties fileFilterName, #endif ) where import Monad (liftM) import System.Glib.FFI import System.Glib.UTFString import System.Glib.Attributes (Attr(..)) import System.Glib.GObject (mkFunPtrDestructor) {#import Graphics.UI.Gtk.Types#} import Graphics.UI.Gtk.Abstract.Object (makeNewObject) import Graphics.UI.Gtk.Gdk.Enums (Flags(..)) {# context lib="gtk" prefix="gtk" #} #if GTK_CHECK_VERSION(2,4,0) {# enum FileFilterFlags {underscoreToCase} deriving(Bounded) #} instance Flags FileFilterFlags -------------------- -- Constructors -- | Creates a new 'FileFilter' with no rules added to it. Such a filter -- doesn't accept any files, so is not particularly useful until you add rules -- with 'fileFilterAddMimeType', 'fileFilterAddPattern', or -- 'fileFilterAddCustom'. -- fileFilterNew :: IO FileFilter fileFilterNew = makeNewObject mkFileFilter $ {# call gtk_file_filter_new #} -------------------- -- Methods -- | Sets the human-readable name of the filter; this is the string that will -- be displayed in the file selector user interface if there is a selectable -- list of filters. -- fileFilterSetName :: FileFilter -> String -- ^ @name@ - the human-readable-name for the filter -> IO () fileFilterSetName self name = withUTFString name $ \namePtr -> {# call gtk_file_filter_set_name #} self namePtr -- | Gets the human-readable name for the filter. See 'fileFilterSetName'. -- fileFilterGetName :: FileFilter -> IO String -- ^ returns The human-readable name of the filter fileFilterGetName self = {# call gtk_file_filter_get_name #} self >>= peekUTFString -- | Adds a rule allowing a given mime type to @filter@. -- fileFilterAddMimeType :: FileFilter -> String -- ^ @mimeType@ - name of a MIME type -> IO () fileFilterAddMimeType self mimeType = withUTFString mimeType $ \mimeTypePtr -> {# call gtk_file_filter_add_mime_type #} self mimeTypePtr -- | Adds a rule allowing a shell style glob to a filter. -- fileFilterAddPattern :: FileFilter -> String -- ^ @pattern@ - a shell style glob -> IO () fileFilterAddPattern self pattern = withUTFString pattern $ \patternPtr -> {# call gtk_file_filter_add_pattern #} self patternPtr -- | Adds rule to a filter that allows files based on a custom callback -- function. The list of flags @needed@ which is passed in provides information -- about what sorts of information that the filter function needs; this allows -- Gtk+ to avoid retrieving expensive information when it isn't needed by the -- filter. -- fileFilterAddCustom :: FileFilter -> [FileFilterFlags] -- ^ @needed@ - list of flags indicating the -- information that the custom filter function needs. -> ( Maybe String -- filename -> Maybe String -- uri -> Maybe String -- display name -> Maybe String -- mime type -> IO Bool) -- ^ @(\filename uri displayName mimeType -> ...)@ - -- filter function; if the function -- returns @True@, then the file will be displayed. -> IO () fileFilterAddCustom self needed func = do hPtr <- mkHandler_GtkFileFilterFunc (\filterInfoPtr _ -> do filenamePtr <- {# get GtkFileFilterInfo->filename #} filterInfoPtr uriPtr <- {# get GtkFileFilterInfo->uri #} filterInfoPtr displayNamePtr <- {# get GtkFileFilterInfo->display_name #} filterInfoPtr mimeTypePtr <- {# get GtkFileFilterInfo->mime_type #} filterInfoPtr filename <- maybePeek peekUTFString filenamePtr uri <- maybePeek peekUTFString uriPtr displayName <- maybePeek peekUTFString displayNamePtr mimeType <- maybePeek peekUTFString mimeTypePtr liftM fromBool $ func filename uri displayName mimeType) dPtr <- mkFunPtrDestructor hPtr {# call gtk_file_filter_add_custom #} self ((fromIntegral . fromFlags) needed) hPtr nullPtr dPtr {#pointer GDestroyNotify#} {#pointer *GtkFileFilterInfo as GtkFileFilterInfoPtr #} foreign import ccall "wrapper" mkDestructor :: IO () -> IO GDestroyNotify type GtkFileFilterFunc = GtkFileFilterInfoPtr -> --GtkFileFilterInfo *filter_info Ptr () -> --gpointer user_data IO CInt foreign import ccall "wrapper" mkHandler_GtkFileFilterFunc :: GtkFileFilterFunc -> IO (FunPtr GtkFileFilterFunc) #if GTK_CHECK_VERSION(2,6,0) -- | Adds a rule allowing image files in the formats supported by 'Pixbuf'. -- -- * Available since Gtk version 2.6 -- fileFilterAddPixbufFormats :: FileFilter -> IO () fileFilterAddPixbufFormats self = {# call gtk_file_filter_add_pixbuf_formats #} self #endif -------------------- -- Properties -- | \'name\' property. See 'fileFilterGetName' and 'fileFilterSetName' -- fileFilterName :: Attr FileFilter String fileFilterName = Attr fileFilterGetName fileFilterSetName #endif --- NEW FILE: ColorButton.chs.pp --- -- -*-haskell-*- -- GIMP Toolkit (GTK) Widget ColorButton -- -- Author : Duncan Coutts -- -- Created: 5 April 2005 -- -- Version $Revision: 1.1 $ from $Date: 2005/04/05 18:29:52 $ -- -- Copyright (C) 2005 Duncan Coutts -- -- 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 2.1 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. -- -- | -- Maintainer : gtk...@li... -- Stability : provisional -- Portability : portable (depends on GHC) -- -- A button to launch a color selection dialog -- -- * Module available since Gtk+ version 2.4 -- module Graphics.UI.Gtk.Selectors.ColorButton ( -- * Detail -- -- | The 'ColorButton' is a button which displays the currently selected color -- an allows to open a color selection dialog to change the color. It is -- suitable widget for selecting a color in a preference dialog. -- * Class Hierarchy -- | -- @ -- | 'GObject' -- | +----'Object' -- | +----'Widget' -- | +----'Container' -- | +----'Bin' -- | +----'Button' -- | +----ColorButton -- @ #if GTK_CHECK_VERSION(2,4,0) -- * Types ColorButton, ColorButtonClass, castToColorButton, -- * Constructors colorButtonNew, colorButtonNewWithColor, -- * Methods colorButtonSetColor, colorButtonGetColor, colorButtonSetAlpha, colorButtonGetAlpha, colorButtonSetUseAlpha, colorButtonGetUseAlpha, colorButtonSetTitle, colorButtonGetTitle, -- * Properties colorButtonUseAlpha, colorButtonTitle, colorButtonAlpha, -- * Signals onColorSet, afterColorSet, #endif ) where import Monad (liftM) import System.Glib.FFI import System.Glib.UTFString import System.Glib.Attributes (Attr(..)) import Graphics.UI.Gtk.Abstract.Object (makeNewObject) {#import Graphics.UI.Gtk.Types#} {#import Graphics.UI.Gtk.Signals#} import Graphics.UI.Gtk.General.Structs (Color) {# context lib="gtk" prefix="gtk" #} #if GTK_CHECK_VERSION(2,4,0) -------------------- -- Constructors -- | Creates a new color button. This returns a widget in the form of a small -- button containing a swatch representing the current selected color. When the -- button is clicked, a color-selection dialog will open, allowing the user to -- select a color. The swatch will be updated to reflect the new color when the -- user finishes. -- colorButtonNew :: IO ColorButton colorButtonNew = makeNewObject mkColorButton $ liftM (castPtr :: Ptr Widget -> Ptr ColorButton) $ {# call gtk_color_button_new #} -- | Creates a new color button. -- colorButtonNewWithColor :: Color -- ^ @color@ - A 'Color' to set the current color with. -> IO ColorButton colorButtonNewWithColor color = makeNewObject mkColorButton $ liftM (castPtr :: Ptr Widget -> Ptr ColorButton) $ with color $ \colorPtr -> {# call gtk_color_button_new_with_color #} (castPtr colorPtr) -------------------- -- Methods -- | Sets the current color to be @color@. -- colorButtonSetColor :: ColorButtonClass self => self -> Color -- ^ @color@ - A 'Color' to set the current color with. -> IO () colorButtonSetColor self color = with color $ \colorPtr -> {# call gtk_color_button_set_color #} (toColorButton self) (castPtr colorPtr) -- | Sets @color@ to be the current color in the 'ColorButton' widget. -- colorButtonGetColor :: ColorButtonClass self => self -> IO Color colorButtonGetColor self = alloca $ \colorPtr -> {# call gtk_color_button_get_color #} (toColorButton self) (castPtr colorPtr) >> peek colorPtr >>= \color -> return color -- | Sets the current opacity to be @alpha@. -- colorButtonSetAlpha :: ColorButtonClass self => self -> Word16 -- ^ @alpha@ - an integer between 0 and 65535. -> IO () colorButtonSetAlpha self alpha = {# call gtk_color_button_set_alpha #} (toColorButton self) (fromIntegral alpha) -- | Returns the current alpha value. -- colorButtonGetAlpha :: ColorButtonClass self => self -> IO Word16 -- ^ returns an integer between 0 and 65535. colorButtonGetAlpha self = liftM fromIntegral $ {# call gtk_color_button_get_alpha #} (toColorButton self) -- | Sets whether or not the color button should use the alpha channel. -- colorButtonSetUseAlpha :: ColorButtonClass self => self -> Bool -- ^ @useAlpha@ - @True@ if color button should use alpha channel, -- @False@ if not. -> IO () colorButtonSetUseAlpha self useAlpha = {# call gtk_color_button_set_use_alpha #} (toColorButton self) (fromBool useAlpha) -- | Does the color selection dialog use the alpha channel? -- colorButtonGetUseAlpha :: ColorButtonClass self => self -> IO Bool -- ^ returns @True@ if the color sample uses alpha channel, -- @False@ if not. colorButtonGetUseAlpha self = liftM toBool $ {# call gtk_color_button_get_use_alpha #} (toColorButton self) -- | Sets the title for the color selection dialog. -- colorButtonSetTitle :: ColorButtonClass self => self -> String -- ^ @title@ - String containing new window title. -> IO () colorButtonSetTitle self title = withUTFString title $ \titlePtr -> {# call gtk_color_button_set_title #} (toColorButton self) titlePtr -- | Gets the title of the color selection dialog. -- colorButtonGetTitle :: ColorButtonClass self => self -> IO String -- ^ returns An internal string, do not free the return value colorButtonGetTitle self = {# call gtk_color_button_get_title #} (toColorButton self) >>= peekUTFString -------------------- -- Properties -- | If this property is set to @True@, the color swatch on the button is -- rendered against a checkerboard background to show its opacity and the -- opacity slider is displayed in the color selection dialog. -- -- Default value: @False@ -- colorButtonUseAlpha :: ColorButtonClass self => Attr self Bool colorButtonUseAlpha = Attr colorButtonGetUseAlpha colorButtonSetUseAlpha -- | The title of the color selection dialog -- -- Default value: \"Pick a Color\" -- colorButtonTitle :: ColorButtonClass self => Attr self String colorButtonTitle = Attr colorButtonGetTitle colorButtonSetTitle -- | The selected opacity value (0 fully transparent, 65535 fully opaque). -- -- Allowed values: \<= 65535 -- -- Default value: 65535 -- colorButtonAlpha :: ColorButtonClass self => Attr self Word16 colorButtonAlpha = Attr colorButtonGetAlpha colorButtonSetAlpha -------------------- -- Signals -- | The ::color-set signal is emitted when the user selects a color. When -- handling this signal, use 'colorButtonGetColor' and 'colorButtonGetAlpha' to -- find out which color was just selected. -- onColorSet, afterColorSet :: ColorButtonClass self => self -> IO () -> IO (ConnectId self) onColorSet = connect_NONE__NONE "color_set" False afterColorSet = connect_NONE__NONE "color_set" True #endif --- NEW FILE: FileChooserButton.chs.pp --- -- -*-haskell-*- -- GIMP Toolkit (GTK) Widget FileChooserButton -- -- Author : [Insert your full name here] -- -- Created: 5 April 2005 -- -- Version $Revision: 1.1 $ from $Date: 2005/04/05 18:29:52 $ -- -- Copyright (C) 2005 [Insert your full name here] -- -- 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 2.1 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. -- -- | -- Maintainer : gtk...@li... -- Stability : provisional -- Portability : portable (depends on GHC) -- -- A button to launch a file selection dialog -- -- * Module available since Gtk+ version 2.6 -- module Graphics.UI.Gtk.Selectors.FileChooserButton ( -- * Detail -- -- | The 'FileChooserButton' is a widget that lets the user select a file. It -- implements the 'FileChooser' interface. Visually, it is a file name with a -- button to bring up a 'FileChooserDialog'. The user can then use that dialog -- to change the file associated with that button. This widget does not support -- setting the \"select-multiple\" property to @True@. -- -- The 'FileChooserButton' supports the 'FileChooserAction's -- 'FileChooserActionOpen' and 'FileChooserActionSelectFolder'. -- * Class Hierarchy -- | -- @ -- | 'GObject' -- | +----'Object' -- | +----'Widget' -- | +----'Container' -- | +----'Box' -- | +----'HBox' -- | +----FileChooserButton -- @ #if GTK_CHECK_VERSION(2,6,0) -- * Types FileChooserButton, FileChooserButtonClass, castToFileChooserButton, -- * Constructors fileChooserButtonNew, fileChooserButtonNewWithBackend, fileChooserButtonNewWithDialog, -- * Methods fileChooserButtonGetTitle, fileChooserButtonSetTitle, fileChooserButtonGetWidthChars, fileChooserButtonSetWidthChars, -- * Properties fileChooserButtonTitle, fileChooserButtonWidthChars, #endif ) where import Monad (liftM) import System.Glib.FFI import System.Glib.UTFString import System.Glib.Attributes (Attr(..)) import Graphics.UI.Gtk.Abstract.Object (makeNewObject) {#import Graphics.UI.Gtk.Types#} {#import Graphics.UI.Gtk.Selectors.FileChooser#} (FileChooserAction) {# context lib="gtk" prefix="gtk" #} #if GTK_CHECK_VERSION(2,6,0) -------------------- -- Constructors -- | Creates a new file-selecting button widget. -- fileChooserButtonNew :: String -- ^ @title@ - the title of the browse dialog. -> FileChooserAction -- ^ @action@ - the open mode for the widget. -> IO FileChooserButton fileChooserButtonNew title action = makeNewObject mkFileChooserButton $ liftM (castPtr :: Ptr Widget -> Ptr FileChooserButton) $ withUTFString title $ \titlePtr -> {# call gtk_file_chooser_button_new #} titlePtr ((fromIntegral . fromEnum) action) -- | Creates a new file-selecting button widget using @backend@. -- fileChooserButtonNewWithBackend :: String -- ^ @title@ - the title of the browse dialog. -> FileChooserAction -- ^ @action@ - the open mode for the widget. -> String -- ^ @backend@ - the name of the file system backend -- to use. -> IO FileChooserButton fileChooserButtonNewWithBackend title action backend = makeNewObject mkFileChooserButton $ liftM (castPtr :: Ptr Widget -> Ptr FileChooserButton) $ withUTFString backend $ \backendPtr -> withUTFString title $ \titlePtr -> {# call gtk_file_chooser_button_new_with_backend #} titlePtr ((fromIntegral . fromEnum) action) backendPtr -- | Creates a 'FileChooserButton' widget which uses @dialog@ as it's -- file-picking window. -- fileChooserButtonNewWithDialog :: FileChooserDialogClass dialog => dialog -- ^ @dialog@ - the 'FileChooserDialog' widget to -- use. -> IO FileChooserButton fileChooserButtonNewWithDialog dialog = makeNewObject mkFileChooserButton $ liftM (castPtr :: Ptr Widget -> Ptr FileChooserButton) $ {# call gtk_file_chooser_button_new_with_dialog #} (toWidget dialog) -------------------- -- Methods -- | Retrieves the title of the browse dialog used by the button. -- fileChooserButtonGetTitle :: FileChooserButtonClass self => self -> IO String -- ^ returns a pointer to the browse dialog's title. fileChooserButtonGetTitle self = {# call gtk_file_chooser_button_get_title #} (toFileChooserButton self) >>= peekUTFString -- | Modifies the @title@ of the browse dialog used by the button. -- fileChooserButtonSetTitle :: FileChooserButtonClass self => self -> String -- ^ @title@ - the new browse dialog title. -> IO () fileChooserButtonSetTitle self title = withUTFString title $ \titlePtr -> {# call gtk_file_chooser_button_set_title #} (toFileChooserButton self) titlePtr -- | Retrieves the width in characters of the @button@ widget's entry and\/or -- label. -- fileChooserButtonGetWidthChars :: FileChooserButtonClass self => self -> IO Int -- ^ returns an integer width (in characters) that the button will -- use to size itself. fileChooserButtonGetWidthChars self = liftM fromIntegral $ {# call gtk_file_chooser_button_get_width_chars #} (toFileChooserButton self) -- | Sets the width (in characters) that the button will use to @nChars@. -- fileChooserButtonSetWidthChars :: FileChooserButtonClass self => self -> Int -- ^ @nChars@ - the new width, in characters. -> IO () fileChooserButtonSetWidthChars self nChars = {# call gtk_file_chooser_button_set_width_chars #} (toFileChooserButton self) (fromIntegral nChars) -------------------- -- Properties -- | Title to put on the 'FileChooserDialog' associated with the button. -- -- Default value: \"Select A File\" -- fileChooserButtonTitle :: FileChooserButtonClass self => Attr self String fileChooserButtonTitle = Attr fileChooserButtonGetTitle fileChooserButtonSetTitle -- | -- fileChooserButtonWidthChars :: FileChooserButtonClass self => Attr self Int fileChooserButtonWidthChars = Attr fileChooserButtonGetWidthChars fileChooserButtonSetWidthChars #endif |
From: Duncan C. <dun...@us...> - 2005-04-05 18:30:03
|
Update of /cvsroot/gtk2hs/gtk2hs In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22213 Modified Files: ChangeLog Makefile.am Log Message: Add several new modules. This adds ~2.6 Kloc. gtk/Graphics/UI/Gtk.hs: export the new modules. Makefile.am: add the new modules to libHSgtk_a_SOURCES. Index: Makefile.am =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/Makefile.am,v retrieving revision 1.60 retrieving revision 1.61 diff -u -d -r1.60 -r1.61 --- Makefile.am 25 Mar 2005 19:31:16 -0000 1.60 +++ Makefile.am 5 Apr 2005 18:29:51 -0000 1.61 @@ -386,13 +386,18 @@ gtk/Graphics/UI/Gtk/Scrolling/HScrollbar.chs \ gtk/Graphics/UI/Gtk/Scrolling/ScrolledWindow.chs \ gtk/Graphics/UI/Gtk/Scrolling/VScrollbar.chs \ + gtk/Graphics/UI/Gtk/Selectors/ColorButton.chs.pp \ gtk/Graphics/UI/Gtk/Selectors/ColorSelection.chs \ gtk/Graphics/UI/Gtk/Selectors/ColorSelectionDialog.chs \ + gtk/Graphics/UI/Gtk/Selectors/FontButton.chs.pp \ gtk/Graphics/UI/Gtk/Selectors/FontSelection.chs \ gtk/Graphics/UI/Gtk/Selectors/FontSelectionDialog.chs \ + gtk/Graphics/UI/Gtk/Selectors/FileSelection.chs.pp \ gtk/Graphics/UI/Gtk/Selectors/FileChooser.chs.pp \ + gtk/Graphics/UI/Gtk/Selectors/FileChooserButton.chs.pp \ gtk/Graphics/UI/Gtk/Selectors/FileChooserWidget.chs.pp \ gtk/Graphics/UI/Gtk/Selectors/FileChooserDialog.chs.pp \ + gtk/Graphics/UI/Gtk/Selectors/FileFilter.chs.pp \ gtk/Graphics/UI/Gtk/TreeList/CellRendererPixbuf.chs \ gtk/Graphics/UI/Gtk/TreeList/CellRendererText.chs \ gtk/Graphics/UI/Gtk/TreeList/CellRendererToggle.chs \ @@ -401,9 +406,12 @@ gtk/Graphics/UI/Gtk/TreeList/TreeSelection.chs.pp \ gtk/Graphics/UI/Gtk/TreeList/TreeStore.chs.pp \ gtk/Graphics/UI/Gtk/TreeList/TreeView.chs.pp \ + gtk/Graphics/UI/Gtk/TreeList/IconView.chs.pp \ + gtk/Graphics/UI/Gtk/TreeList/CellView.chs.pp \ + gtk/Graphics/UI/Gtk/Windows/AboutDialog.chs \ gtk/Graphics/UI/Gtk/Windows/Dialog.chs \ - gtk/Graphics/UI/Gtk/Selectors/FileSelection.chs.pp \ gtk/Graphics/UI/Gtk/Windows/Window.chs.pp \ + gtk/Graphics/UI/Gtk/Windows/WindowGroup.chs \ gtk/Graphics/UI/Gtk/Gdk/Drawable.chs.pp \ gtk/Graphics/UI/Gtk/Gdk/GC.chs \ gtk/Graphics/UI/Gtk/Gdk/Gdk.chs \ Index: ChangeLog =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/ChangeLog,v retrieving revision 1.421 retrieving revision 1.422 diff -u -d -r1.421 -r1.422 --- ChangeLog 5 Apr 2005 18:13:41 -0000 1.421 +++ ChangeLog 5 Apr 2005 18:29:51 -0000 1.422 @@ -3,6 +3,20 @@ * glib/System/Glib/UTFString.hs: add some extra functions for marshaling lists and arrays of UTF-8 strings. + * gtk/Graphics/UI/Gtk/Selectors/ColorButton.chs.pp, + gtk/Graphics/UI/Gtk/Selectors/FontButton.chs.pp, + gtk/Graphics/UI/Gtk/Selectors/FileChooserButton.chs.pp, + gtk/Graphics/UI/Gtk/Selectors/FileFilter.chs.pp, + gtk/Graphics/UI/Gtk/TreeList/IconView.chs.pp, + gtk/Graphics/UI/Gtk/TreeList/CellView.chs.pp, + gtk/Graphics/UI/Gtk/Windows/AboutDialog.chs, + gtk/Graphics/UI/Gtk/Windows/WindowGroup.chs: add several new modules. + This adds ~2.6 Kloc. + + * gtk/Graphics/UI/Gtk.hs: export the new modules. + + * Makefile.am: add the new modules to libHSgtk_a_SOURCES. + 2005-04-4 Duncan Coutts <du...@co...> * gtk/Graphics/UI/Gtk/Multiline/TextBuffer.chs, |
From: Duncan C. <dun...@us...> - 2005-04-05 18:30:02
|
Update of /cvsroot/gtk2hs/gtk2hs/gtk/Graphics/UI In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22213/gtk/Graphics/UI Modified Files: Gtk.hs Log Message: Add several new modules. This adds ~2.6 Kloc. gtk/Graphics/UI/Gtk.hs: export the new modules. Makefile.am: add the new modules to libHSgtk_a_SOURCES. Index: Gtk.hs =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/Graphics/UI/Gtk.hs,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- Gtk.hs 26 Feb 2005 02:54:35 -0000 1.5 +++ Gtk.hs 5 Apr 2005 18:29:53 -0000 1.6 @@ -55,6 +55,8 @@ -- * Windows module Graphics.UI.Gtk.Windows.Window, module Graphics.UI.Gtk.Windows.Dialog, + module Graphics.UI.Gtk.Windows.AboutDialog, + module Graphics.UI.Gtk.Windows.WindowGroup, -- * Display widgets, module Graphics.UI.Gtk.Display.AccelLabel, module Graphics.UI.Gtk.Display.Image, @@ -85,6 +87,8 @@ module Graphics.UI.Gtk.TreeList.TreeSelection, module Graphics.UI.Gtk.TreeList.TreeViewColumn, module Graphics.UI.Gtk.TreeList.TreeView, + module Graphics.UI.Gtk.TreeList.IconView, + module Graphics.UI.Gtk.TreeList.CellView, -- module TreeSortable, module Graphics.UI.Gtk.TreeList.TreeModelSort, module Graphics.UI.Gtk.TreeList.CellRenderer, @@ -112,14 +116,18 @@ -- * Selectors (file\/font\/color) module Graphics.UI.Gtk.Selectors.ColorSelection, module Graphics.UI.Gtk.Selectors.ColorSelectionDialog, + module Graphics.UI.Gtk.Selectors.ColorButton, module Graphics.UI.Gtk.Selectors.FileSelection, module Graphics.UI.Gtk.Selectors.FontSelection, module Graphics.UI.Gtk.Selectors.FontSelectionDialog, + module Graphics.UI.Gtk.Selectors.FontButton, -- module InputDialog, -- ** File chooser module Graphics.UI.Gtk.Selectors.FileChooser, module Graphics.UI.Gtk.Selectors.FileChooserDialog, module Graphics.UI.Gtk.Selectors.FileChooserWidget, + module Graphics.UI.Gtk.Selectors.FileChooserButton, + module Graphics.UI.Gtk.Selectors.FileFilter, -- * Layout containers module Graphics.UI.Gtk.Layout.Alignment, module Graphics.UI.Gtk.Layout.AspectFrame, @@ -196,7 +204,8 @@ -- windows import Graphics.UI.Gtk.Windows.Dialog import Graphics.UI.Gtk.Windows.Window ---import WindowGroup +import Graphics.UI.Gtk.Windows.AboutDialog +import Graphics.UI.Gtk.Windows.WindowGroup -- display widgets import Graphics.UI.Gtk.Display.AccelLabel import Graphics.UI.Gtk.Display.Image @@ -235,6 +244,8 @@ import Graphics.UI.Gtk.TreeList.TreeSelection import Graphics.UI.Gtk.TreeList.TreeViewColumn import Graphics.UI.Gtk.TreeList.TreeView +import Graphics.UI.Gtk.TreeList.IconView +import Graphics.UI.Gtk.TreeList.CellView --import TreeSortable import Graphics.UI.Gtk.TreeList.TreeModelSort import Graphics.UI.Gtk.TreeList.CellRenderer @@ -263,12 +274,16 @@ -- selectors (file\/font\/color\/input device) import Graphics.UI.Gtk.Selectors.ColorSelection import Graphics.UI.Gtk.Selectors.ColorSelectionDialog +import Graphics.UI.Gtk.Selectors.ColorButton import Graphics.UI.Gtk.Selectors.FileSelection import Graphics.UI.Gtk.Selectors.FileChooser import Graphics.UI.Gtk.Selectors.FileChooserDialog import Graphics.UI.Gtk.Selectors.FileChooserWidget +import Graphics.UI.Gtk.Selectors.FileChooserButton +import Graphics.UI.Gtk.Selectors.FileFilter import Graphics.UI.Gtk.Selectors.FontSelection import Graphics.UI.Gtk.Selectors.FontSelectionDialog +import Graphics.UI.Gtk.Selectors.FontButton --import InputDialog -- layout containers import Graphics.UI.Gtk.Layout.Alignment |
From: Duncan C. <dun...@us...> - 2005-04-05 18:30:02
|
Update of /cvsroot/gtk2hs/gtk2hs/gtk/Graphics/UI/Gtk/TreeList In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22213/gtk/Graphics/UI/Gtk/TreeList Added Files: IconView.chs.pp CellView.chs.pp Log Message: Add several new modules. This adds ~2.6 Kloc. gtk/Graphics/UI/Gtk.hs: export the new modules. Makefile.am: add the new modules to libHSgtk_a_SOURCES. --- NEW FILE: CellView.chs.pp --- -- -*-haskell-*- -- GIMP Toolkit (GTK) Widget CellView -- -- Author : Duncan Coutts -- -- Created: 4 April 2005 -- -- Version $Revision: 1.1 $ from $Date: 2005/04/05 18:29:52 $ -- -- Copyright (C) 2005 Duncan Coutts -- -- 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 2.1 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. -- -- | -- Maintainer : gtk...@li... -- Stability : provisional -- Portability : portable (depends on GHC) -- -- A widget displaying a single row of a 'TreeModel' -- -- * Module available since Gtk+ version 2.6 -- module Graphics.UI.Gtk.TreeList.CellView ( -- * Detail -- -- | A 'CellView' displays a single row of a 'TreeModel', using cell renderers -- just like 'TreeView'. 'CellView' doesn't support some of the more complex -- features of 'TreeView', like cell editing and drag and drop. -- * Class Hierarchy -- | -- @ -- | 'GObject' -- | +----'Object' -- | +----'Widget' -- | +----CellView -- @ #if GTK_CHECK_VERSION(2,6,0) -- * Types CellView, CellViewClass, castToCellView, -- * Constructors cellViewNew, cellViewNewWithMarkup, cellViewNewWithPixbuf, cellViewNewWithText, -- * Methods cellViewSetModel, cellViewSetDisplayedRow, cellViewGetDisplayedRow, cellViewGetSizeOfRow, cellViewSetBackgroundColor, cellViewGetCellRenderers, -- * Properties cellViewDisplayedRow, #endif ) where import Monad (liftM) import System.Glib.FFI import System.Glib.UTFString import System.Glib.Attributes {#import System.Glib.GList#} {#import Graphics.UI.Gtk.Types#} import Graphics.UI.Gtk.Abstract.Object (makeNewObject) {#import Graphics.UI.Gtk.TreeList.TreeModel#} import Graphics.UI.Gtk.General.Structs (Color, Requisition) {# context lib="gtk" prefix="gtk" #} #if GTK_CHECK_VERSION(2,6,0) -------------------- -- Constructors -- | Creates a new 'CellView' widget. -- cellViewNew :: IO CellView cellViewNew = makeNewObject mkCellView $ liftM (castPtr :: Ptr Widget -> Ptr CellView) $ {# call gtk_cell_view_new #} -- | Creates a new 'CellView' widget, adds a 'CellRendererText' to it, and -- makes its show @markup@. The text can text can be marked up with the Pango -- text markup language. -- cellViewNewWithMarkup :: String -- ^ @markup@ - the text to display in the cell view -> IO CellView cellViewNewWithMarkup markup = makeNewObject mkCellView $ liftM (castPtr :: Ptr Widget -> Ptr CellView) $ withUTFString markup $ \markupPtr -> {# call gtk_cell_view_new_with_markup #} markupPtr -- | Creates a new 'CellView' widget, adds a 'CellRendererPixbuf' to it, and -- makes its show @pixbuf@. -- cellViewNewWithPixbuf :: Pixbuf -- ^ @pixbuf@ - the image to display in the cell view -> IO CellView cellViewNewWithPixbuf pixbuf = makeNewObject mkCellView $ liftM (castPtr :: Ptr Widget -> Ptr CellView) $ {# call gtk_cell_view_new_with_pixbuf #} pixbuf -- | Creates a new 'CellView' widget, adds a 'CellRendererText' to it, and -- makes its show @text@. -- cellViewNewWithText :: String -- ^ @text@ - the text to display in the cell view -> IO CellView cellViewNewWithText text = makeNewObject mkCellView $ liftM (castPtr :: Ptr Widget -> Ptr CellView) $ withUTFString text $ \textPtr -> {# call gtk_cell_view_new_with_text #} textPtr -------------------- -- Methods -- | Sets the model for @cellView@. If @cellView@ already has a model set, it -- will remove it before setting the new model. If @model@ is {@NULL@, FIXME: -- this should probably be converted to a Maybe data type}, then it will unset -- the old model. -- cellViewSetModel :: (CellViewClass self, TreeModelClass model) => self -> model -- ^ @model@ - a 'TreeModel' -> IO () cellViewSetModel self model = {# call gtk_cell_view_set_model #} (toCellView self) (toTreeModel model) -- | Sets the row of the model that is currently displayed by the 'CellView'. -- If the path is unset, then the contents of the cellview \"stick\" at their -- last value; this is not normally a desired result, but may be a needed -- intermediate state if say, the model for the 'CellView' becomes temporarily -- empty. -- cellViewSetDisplayedRow :: CellViewClass self => self -> TreePath -- ^ @path@ - a 'TreePath' or @[]@ to unset. -> IO () cellViewSetDisplayedRow self path = withTreePath path $ \path -> {# call gtk_cell_view_set_displayed_row #} (toCellView self) path cellViewSetDisplayedRow self [] = {# call gtk_cell_view_set_displayed_row #} (toCellView self) (NativeTreePath nullPtr) -- | -- cellViewGetDisplayedRow :: CellViewClass self => self -> IO TreePath cellViewGetDisplayedRow self = do tpPtr <- {# call gtk_cell_view_get_displayed_row #} (toCellView self) if tpPtr==nullPtr then return [] else do path <- nativeTreePathGetIndices (NativeTreePath tpPtr) nativeTreePathFree (NativeTreePath tpPtr) return path -- | Returns the size needed by the cell view to display the model -- row pointed to by @path@. -- cellViewGetSizeOfRow :: CellViewClass self => self -> TreePath -- ^ @path@ - a 'TreePath' -> IO Requisition -- ^ returns the size requisition cellViewGetSizeOfRow self path = alloca $ \requisitionPtr -> withTreePath path $ \path -> do {# call gtk_cell_view_get_size_of_row #} (toCellView self) path (castPtr requisitionPtr) peek requisitionPtr -- | Sets the background color of @view@. -- cellViewSetBackgroundColor :: CellViewClass self => self -> Color -- ^ @color@ - the new background color -> IO () cellViewSetBackgroundColor self color = with color $ \colorPtr -> {# call gtk_cell_view_set_background_color #} (toCellView self) (castPtr colorPtr) -- | Returns the cell renderers which have been added to @cellView@. -- cellViewGetCellRenderers :: CellViewClass self => self -> IO [CellRenderer] -- ^ returns a list of cell renderers. The list, but not -- the renderers has been newly allocated and should be -- freed with 'gListFree' when no longer needed. cellViewGetCellRenderers self = {# call gtk_cell_view_get_cell_renderers #} (toCellView self) >>= fromGList >>= mapM (\elemPtr -> makeNewObject mkCellRenderer (return elemPtr)) -------------------- -- Properties -- | \'displayedRow\' property. See 'cellViewGetDisplayedRow' and -- 'cellViewSetDisplayedRow' -- cellViewDisplayedRow :: CellViewClass self => Attr self TreePath cellViewDisplayedRow = Attr cellViewGetDisplayedRow cellViewSetDisplayedRow #endif --- NEW FILE: IconView.chs.pp --- -- -*-haskell-*- -- GIMP Toolkit (GTK) Widget IconView -- -- Author : Duncan Coutts -- -- Created: 25 March 2005 -- -- Version $Revision: 1.1 $ from $Date: 2005/04/05 18:29:52 $ -- -- Copyright (C) 2005 Duncan Coutts -- -- 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 2.1 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. -- -- | -- Maintainer : gtk...@li... -- Stability : provisional -- Portability : portable (depends on GHC) -- -- A widget which displays a list of icons in a grid -- -- * Module available since Gtk+ version 2.6 -- module Graphics.UI.Gtk.TreeList.IconView ( -- * Detail -- -- | 'IconView' provides an alternative view on a list model. It displays the -- model as a grid of icons with labels. Like 'TreeView', it allows to select -- one or multiple items (depending on the selection mode, see -- 'iconViewSetSelectionMode'). In addition to selection with the arrow keys, -- 'IconView' supports rubberband selection, which is controlled by dragging -- the pointer. -- * Class Hierarchy -- | -- @ -- | 'GObject' -- | +----'Object' -- | +----'Widget' -- | +----'Container' -- | +----IconView -- @ #if GTK_CHECK_VERSION(2,6,0) -- * Types IconView, IconViewClass, castToIconView, -- * Constructors iconViewNew, iconViewNewWithModel, -- * Methods iconViewSetModel, iconViewGetModel, iconViewSetTextColumn, iconViewGetTextColumn, iconViewSetMarkupColumn, iconViewGetMarkupColumn, iconViewSetPixbufColumn, iconViewGetPixbufColumn, iconViewGetPathAtPos, iconViewSelectedForeach, iconViewSetSelectionMode, iconViewGetSelectionMode, iconViewSetOrientation, iconViewGetOrientation, iconViewSetColumns, iconViewGetColumns, iconViewSetItemWidth, iconViewGetItemWidth, iconViewSetSpacing, iconViewGetSpacing, iconViewSetRowSpacing, iconViewGetRowSpacing, iconViewSetColumnSpacing, iconViewGetColumnSpacing, iconViewSetMargin, iconViewGetMargin, iconViewSelectPath, iconViewUnselectPath, iconViewPathIsSelected, iconViewGetSelectedItems, iconViewSelectAll, iconViewUnselectAll, iconViewItemActivated, -- * Properties iconViewSelectionMode, iconViewPixbufColumn, iconViewTextColumn, iconViewMarkupColumn, iconViewModel, iconViewColumns, iconViewItemWidth, iconViewSpacing, iconViewRowSpacing, iconViewColumnSpacing, iconViewMargin, iconViewOrientation, -- * Signals onSelectAll, afterSelectAll, onUnselectAll, afterUnselectAll, onSelectCursorItem, afterSelectCursorItem, onToggleCursorItem, afterToggleCursorItem, onActivateCursorItem, afterActivateCursorItem, #endif ) where import Monad (liftM) import System.Glib.FFI import System.Glib.Attributes {#import System.Glib.GList#} import System.Glib.GObject (makeNewGObject) import Graphics.UI.Gtk.Abstract.Object (makeNewObject) {#import Graphics.UI.Gtk.Types#} {#import Graphics.UI.Gtk.Signals#} {#import Graphics.UI.Gtk.General.Enums#} (Orientation, SelectionMode, MovementStep) {#import Graphics.UI.Gtk.TreeList.TreeModel#} {# context lib="gtk" prefix="gtk" #} #if GTK_CHECK_VERSION(2,6,0) -------------------- -- Constructors -- | Creates a new 'IconView' widget -- iconViewNew :: IO IconView iconViewNew = makeNewObject mkIconView $ liftM (castPtr :: Ptr Widget -> Ptr IconView) $ {# call gtk_icon_view_new #} -- | Creates a new 'IconView' widget with the model @model@. -- iconViewNewWithModel :: TreeModelClass model => model -- ^ @model@ - The model. -> IO IconView iconViewNewWithModel model = makeNewObject mkIconView $ liftM (castPtr :: Ptr Widget -> Ptr IconView) $ {# call gtk_icon_view_new_with_model #} (toTreeModel model) -------------------- -- Methods -- | Sets the model for a 'IconView'. If the @iconView@ already has a model -- set, it will remove it before setting the new model. If @model@ is {@NULL@, -- FIXME: this should probably be converted to a Maybe data type}, then it will -- unset the old model. -- iconViewSetModel :: (IconViewClass self, TreeModelClass model) => self -> model -- ^ @model@ - The model. -> IO () iconViewSetModel self model = {# call gtk_icon_view_set_model #} (toIconView self) (toTreeModel model) -- | Returns the model the 'IconView' is based on. Returns {@NULL@, FIXME: -- this should probably be converted to a Maybe data type} if the model is -- unset. -- iconViewGetModel :: IconViewClass self => self -> IO TreeModel -- ^ returns A 'TreeModel', or {@NULL@, FIXME: this should -- probably be converted to a Maybe data type} if none is -- currently being used. iconViewGetModel self = makeNewGObject mkTreeModel $ {# call gtk_icon_view_get_model #} (toIconView self) -- | Sets the column with text for @iconView@ to be @column@. The text column -- must be of type {G_TYPE_STRING, FIXME: unknown type\/value}. -- iconViewSetTextColumn :: IconViewClass self => self -> Int -- ^ @column@ - A column in the currently used model. -> IO () iconViewSetTextColumn self column = {# call gtk_icon_view_set_text_column #} (toIconView self) (fromIntegral column) -- | Returns the column with text for @iconView@. -- iconViewGetTextColumn :: IconViewClass self => self -> IO Int -- ^ returns the text column, or -1 if it's unset. iconViewGetTextColumn self = liftM fromIntegral $ {# call gtk_icon_view_get_text_column #} (toIconView self) -- | Sets the column with markup information for @iconView@ to be @column@. -- The markup column must be of type {G_TYPE_STRING, FIXME: unknown -- type\/value}. If the markup column is set to something, it overrides the text -- column set by 'iconViewSetTextColumn'. -- iconViewSetMarkupColumn :: IconViewClass self => self -> Int -- ^ @column@ - A column in the currently used model. -> IO () iconViewSetMarkupColumn self column = {# call gtk_icon_view_set_markup_column #} (toIconView self) (fromIntegral column) -- | Returns the column with markup text for @iconView@. -- iconViewGetMarkupColumn :: IconViewClass self => self -> IO Int -- ^ returns the markup column, or -1 if it's unset. iconViewGetMarkupColumn self = liftM fromIntegral $ {# call gtk_icon_view_get_markup_column #} (toIconView self) -- | Sets the column with pixbufs for @iconView@ to be @column@. The pixbuf -- column must be of type {GDK_TYPE_PIXBUF, FIXME: unknown type\/value} -- -- * Available since Gtk version 2.6 -- iconViewSetPixbufColumn :: IconViewClass self => self -> Int -- ^ @column@ - A column in the currently used model. -> IO () iconViewSetPixbufColumn self column = {# call gtk_icon_view_set_pixbuf_column #} (toIconView self) (fromIntegral column) -- | Returns the column with pixbufs for @iconView@. -- iconViewGetPixbufColumn :: IconViewClass self => self -> IO Int -- ^ returns the pixbuf column, or -1 if it's unset. iconViewGetPixbufColumn self = liftM fromIntegral $ {# call gtk_icon_view_get_pixbuf_column #} (toIconView self) -- | Finds the path at the point (@x@, @y@), relative to widget coordinates. -- iconViewGetPathAtPos :: IconViewClass self => self -> Int -- ^ @x@ - The x position to be identified -> Int -- ^ @y@ - The y position to be identified -> IO TreePath -- ^ returns The 'TreePath' corresponding to the icon or @[]@ -- if no icon exists at that position. iconViewGetPathAtPos self x y = do tpPtr <- {# call gtk_icon_view_get_path_at_pos #} (toIconView self) (fromIntegral x) (fromIntegral y) if tpPtr==nullPtr then return [] else do path <- nativeTreePathGetIndices (NativeTreePath tpPtr) nativeTreePathFree (NativeTreePath tpPtr) return path -- | Calls a function for each selected icon. Note that the model or selection -- cannot be modified from within this function. -- iconViewSelectedForeach :: IconViewClass self => self -> (TreePath -> IO ()) -- ^ @(\path -> ...)@ - The funcion to call for each -- selected icon. -> IO () iconViewSelectedForeach self func = do funcPtr <- mkIconViewForeachFunc (\_ tpPtr _ -> do path <- nativeTreePathGetIndices (NativeTreePath tpPtr) nativeTreePathFree (NativeTreePath tpPtr) func path ) {# call gtk_icon_view_selected_foreach #} (toIconView self) funcPtr nullPtr freeHaskellFunPtr funcPtr {# pointer IconViewForeachFunc #} foreign import ccall "wrapper" mkIconViewForeachFunc :: (Ptr IconView -> Ptr NativeTreePath -> Ptr () -> IO ()) -> IO IconViewForeachFunc -- | Sets the selection mode of the @iconView@. -- iconViewSetSelectionMode :: IconViewClass self => self -> SelectionMode -- ^ @mode@ - The selection mode -> IO () iconViewSetSelectionMode self mode = {# call gtk_icon_view_set_selection_mode #} (toIconView self) ((fromIntegral . fromEnum) mode) -- | Gets the selection mode of the @iconView@. -- iconViewGetSelectionMode :: IconViewClass self => self -> IO SelectionMode -- ^ returns the current selection mode iconViewGetSelectionMode self = liftM (toEnum . fromIntegral) $ {# call gtk_icon_view_get_selection_mode #} (toIconView self) -- | Sets the ::orientation property which determines whether the labels are -- drawn beside the icons instead of below. -- iconViewSetOrientation :: IconViewClass self => self -> Orientation -- ^ @orientation@ - the relative position of texts and icons -> IO () iconViewSetOrientation self orientation = {# call gtk_icon_view_set_orientation #} (toIconView self) ((fromIntegral . fromEnum) orientation) -- | Returns the value of the ::orientation property which determines whether -- the labels are drawn beside the icons instead of below. -- iconViewGetOrientation :: IconViewClass self => self -> IO Orientation -- ^ returns the relative position of texts and icons iconViewGetOrientation self = liftM (toEnum . fromIntegral) $ {# call gtk_icon_view_get_orientation #} (toIconView self) -- | -- iconViewSetColumns :: IconViewClass self => self -> Int -- ^ @columns@ - -> IO () iconViewSetColumns self columns = {# call gtk_icon_view_set_columns #} (toIconView self) (fromIntegral columns) -- | -- iconViewGetColumns :: IconViewClass self => self -> IO Int -- ^ returns iconViewGetColumns self = liftM fromIntegral $ {# call gtk_icon_view_get_columns #} (toIconView self) -- | -- iconViewSetItemWidth :: IconViewClass self => self -> Int -- ^ @itemWidth@ - -> IO () iconViewSetItemWidth self itemWidth = {# call gtk_icon_view_set_item_width #} (toIconView self) (fromIntegral itemWidth) -- | -- iconViewGetItemWidth :: IconViewClass self => self -> IO Int -- ^ returns iconViewGetItemWidth self = liftM fromIntegral $ {# call gtk_icon_view_get_item_width #} (toIconView self) -- | -- iconViewSetSpacing :: IconViewClass self => self -> Int -- ^ @spacing@ - -> IO () iconViewSetSpacing self spacing = {# call gtk_icon_view_set_spacing #} (toIconView self) (fromIntegral spacing) -- | -- iconViewGetSpacing :: IconViewClass self => self -> IO Int -- ^ returns iconViewGetSpacing self = liftM fromIntegral $ {# call gtk_icon_view_get_spacing #} (toIconView self) -- | -- iconViewSetRowSpacing :: IconViewClass self => self -> Int -- ^ @rowSpacing@ - -> IO () iconViewSetRowSpacing self rowSpacing = {# call gtk_icon_view_set_row_spacing #} (toIconView self) (fromIntegral rowSpacing) -- | -- iconViewGetRowSpacing :: IconViewClass self => self -> IO Int -- ^ returns iconViewGetRowSpacing self = liftM fromIntegral $ {# call gtk_icon_view_get_row_spacing #} (toIconView self) -- | -- iconViewSetColumnSpacing :: IconViewClass self => self -> Int -- ^ @columnSpacing@ - -> IO () iconViewSetColumnSpacing self columnSpacing = {# call gtk_icon_view_set_column_spacing #} (toIconView self) (fromIntegral columnSpacing) -- | -- iconViewGetColumnSpacing :: IconViewClass self => self -> IO Int -- ^ returns iconViewGetColumnSpacing self = liftM fromIntegral $ {# call gtk_icon_view_get_column_spacing #} (toIconView self) -- | -- iconViewSetMargin :: IconViewClass self => self -> Int -- ^ @margin@ - -> IO () iconViewSetMargin self margin = {# call gtk_icon_view_set_margin #} (toIconView self) (fromIntegral margin) -- | -- iconViewGetMargin :: IconViewClass self => self -> IO Int -- ^ returns iconViewGetMargin self = liftM fromIntegral $ {# call gtk_icon_view_get_margin #} (toIconView self) -- | Selects the row at @path@. -- iconViewSelectPath :: IconViewClass self => self -> TreePath -- ^ @path@ - The 'TreePath' to be selected. -> IO () iconViewSelectPath self path = withTreePath path $ \path -> {# call gtk_icon_view_select_path #} (toIconView self) path -- | Unselects the row at @path@. -- iconViewUnselectPath :: IconViewClass self => self -> TreePath -- ^ @path@ - The 'TreePath' to be unselected. -> IO () iconViewUnselectPath self path = withTreePath path $ \path -> {# call gtk_icon_view_unselect_path #} (toIconView self) path -- | Returns @True@ if the icon pointed to by @path@ is currently selected. If -- @icon@ does not point to a valid location, @False@ is returned. -- iconViewPathIsSelected :: IconViewClass self => self -> TreePath -- ^ @path@ - A 'TreePath' to check selection on. -> IO Bool -- ^ returns @True@ if @path@ is selected. iconViewPathIsSelected self path = liftM toBool $ withTreePath path $ \path -> {# call gtk_icon_view_path_is_selected #} (toIconView self) path -- | Creates a list of paths of all selected items. Additionally, if you are -- planning on modifying the model after calling this function, you may want to -- convert the returned list into a list of {GtkTreeRowReference, FIXME: boxed -- type}s. To do this, you can use 'treeRowReferenceNew'. -- iconViewGetSelectedItems :: IconViewClass self => self -> IO [TreePath] -- ^ returns a list of 'TreePath's, one for each selected row. iconViewGetSelectedItems self = {# call gtk_icon_view_get_selected_items #} (toIconView self) >>= fromGList >>= mapM (\elemPtr -> do path <- nativeTreePathGetIndices (NativeTreePath elemPtr) nativeTreePathFree (NativeTreePath elemPtr) return path ) -- | Selects all the icons. @iconView@ must has its selection mode set to -- 'SelectionMultiple'. -- iconViewSelectAll :: IconViewClass self => self -> IO () iconViewSelectAll self = {# call gtk_icon_view_select_all #} (toIconView self) -- | Unselects all the icons. -- iconViewUnselectAll :: IconViewClass self => self -> IO () iconViewUnselectAll self = {# call gtk_icon_view_unselect_all #} (toIconView self) -- | Activates the item determined by @path@. -- iconViewItemActivated :: IconViewClass self => self -> TreePath -- ^ @path@ - The 'TreePath' to be activated -> IO () iconViewItemActivated self path = withTreePath path $ \path -> {# call gtk_icon_view_item_activated #} (toIconView self) path -------------------- -- Properties -- | The ::selection-mode property specifies the selection mode of icon view. -- If the mode is 'SelectionMultiple', rubberband selection is enabled, for the -- other modes, only keyboard selection is possible. -- -- Default value: 'SelectionSingle' -- iconViewSelectionMode :: IconViewClass self => Attr self SelectionMode iconViewSelectionMode = Attr iconViewGetSelectionMode iconViewSetSelectionMode -- | The ::pixbuf-column property contains the number of the model column -- containing the pixbufs which are displayed. The pixbuf column must be of -- type {GDK_TYPE_PIXBUF, FIXME: unknown type\/value}. Setting this property to -- -1 turns off the display of pixbufs. -- -- Allowed values: >= -1 -- -- Default value: -1 -- iconViewPixbufColumn :: IconViewClass self => Attr self Int iconViewPixbufColumn = Attr iconViewGetPixbufColumn iconViewSetPixbufColumn -- | The ::text-column property contains the number of the model column -- containing the texts which are displayed. The text column must be of type -- {G_TYPE_STRING, FIXME: unknown type\/value}. If this property and the -- :markup-column property are both set to -1, no texts are displayed. -- -- Allowed values: >= -1 -- -- Default value: -1 -- iconViewTextColumn :: IconViewClass self => Attr self Int iconViewTextColumn = Attr iconViewGetTextColumn iconViewSetTextColumn -- | The ::markup-column property contains the number of the model column -- containing markup information to be displayed. The markup column must be of -- type {G_TYPE_STRING, FIXME: unknown type\/value}. If this property and the -- :text-column property are both set to column numbers, it overrides the text -- column. If both are set to -1, no texts are displayed. -- -- Allowed values: >= -1 -- -- Default value: -1 -- iconViewMarkupColumn :: IconViewClass self => Attr self Int iconViewMarkupColumn = Attr iconViewGetMarkupColumn iconViewSetMarkupColumn -- | The model for the icon view. -- iconViewModel :: IconViewClass self => Attr self TreeModel iconViewModel = Attr iconViewGetModel iconViewSetModel -- | The columns property contains the number of the columns in which the -- items should be displayed. If it is -1, the number of columns will be chosen -- automatically to fill the available area. -- -- Allowed values: >= -1 -- -- Default value: -1 -- iconViewColumns :: IconViewClass self => Attr self Int iconViewColumns = Attr iconViewGetColumns iconViewSetColumns -- | The width used for each item. -- -- Allowed values: >= -1 -- -- Default value: -1 -- iconViewItemWidth :: IconViewClass self => Attr self Int iconViewItemWidth = Attr iconViewGetItemWidth iconViewSetItemWidth -- | Space which is inserted between cells of an item. -- -- Allowed values: >= 0 -- -- Default value: 0 -- iconViewSpacing :: IconViewClass self => Attr self Int iconViewSpacing = Attr iconViewGetSpacing iconViewSetSpacing -- | Space which is inserted between grid rows. -- -- Allowed values: >= 0 -- -- Default value: 6 -- iconViewRowSpacing :: IconViewClass self => Attr self Int iconViewRowSpacing = Attr iconViewGetRowSpacing iconViewSetRowSpacing -- | Space which is inserted between grid column. -- -- Allowed values: >= 0 -- -- Default value: 6 -- iconViewColumnSpacing :: IconViewClass self => Attr self Int iconViewColumnSpacing = Attr iconViewGetColumnSpacing iconViewSetColumnSpacing -- | Space which is inserted at the edges of the icon view. -- -- Allowed values: >= 0 -- -- Default value: 6 -- iconViewMargin :: IconViewClass self => Attr self Int iconViewMargin = Attr iconViewGetMargin iconViewSetMargin -- | How the text and icon of each item are positioned relative to each other. -- -- Default value: 'OrientationVertical' -- iconViewOrientation :: IconViewClass self => Attr self Orientation iconViewOrientation = Attr iconViewGetOrientation iconViewSetOrientation -------------------- -- Signals -- | -- onSelectAll, afterSelectAll :: IconViewClass self => self -> IO () -> IO (ConnectId self) onSelectAll = connect_NONE__NONE "select_all" False afterSelectAll = connect_NONE__NONE "select_all" True -- | -- onUnselectAll, afterUnselectAll :: IconViewClass self => self -> IO () -> IO (ConnectId self) onUnselectAll = connect_NONE__NONE "unselect_all" False afterUnselectAll = connect_NONE__NONE "unselect_all" True -- | -- onSelectCursorItem, afterSelectCursorItem :: IconViewClass self => self -> IO () -> IO (ConnectId self) onSelectCursorItem = connect_NONE__NONE "select_cursor_item" False afterSelectCursorItem = connect_NONE__NONE "select_cursor_item" True -- | -- onToggleCursorItem, afterToggleCursorItem :: IconViewClass self => self -> IO () -> IO (ConnectId self) onToggleCursorItem = connect_NONE__NONE "toggle_cursor_item" False afterToggleCursorItem = connect_NONE__NONE "toggle_cursor_item" True -- | -- onActivateCursorItem, afterActivateCursorItem :: IconViewClass self => self -> IO Bool -> IO (ConnectId self) onActivateCursorItem = connect_NONE__BOOL "activate_cursor_item" False afterActivateCursorItem = connect_NONE__BOOL "activate_cursor_item" True #endif |
From: Duncan C. <dun...@us...> - 2005-04-05 18:13:53
|
Update of /cvsroot/gtk2hs/gtk2hs In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18131 Modified Files: ChangeLog Log Message: Add some extra functions for marshaling lists and arrays of UTF-8 strings. Index: ChangeLog =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/ChangeLog,v retrieving revision 1.420 retrieving revision 1.421 diff -u -d -r1.420 -r1.421 --- ChangeLog 4 Apr 2005 01:24:07 -0000 1.420 +++ ChangeLog 5 Apr 2005 18:13:41 -0000 1.421 @@ -1,3 +1,8 @@ +2005-04-5 Duncan Coutts <du...@co...> + + * glib/System/Glib/UTFString.hs: add some extra functions for + marshaling lists and arrays of UTF-8 strings. + 2005-04-4 Duncan Coutts <du...@co...> * gtk/Graphics/UI/Gtk/Multiline/TextBuffer.chs, |
From: Duncan C. <dun...@us...> - 2005-04-05 18:13:53
|
Update of /cvsroot/gtk2hs/gtk2hs/glib/System/Glib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18131/glib/System/Glib Modified Files: UTFString.hs Log Message: Add some extra functions for marshaling lists and arrays of UTF-8 strings. Index: UTFString.hs =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/glib/System/Glib/UTFString.hs,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- UTFString.hs 16 Jan 2005 21:40:33 -0000 1.2 +++ UTFString.hs 5 Apr 2005 18:13:42 -0000 1.3 @@ -33,6 +33,9 @@ peekUTFStringLen, readUTFString, readCString, + withUTFStrings, + withUTFStringArray, + withUTFStringArray0, ) where import Monad (liftM) @@ -87,6 +90,29 @@ free (castPtr strPtr) return str +-- Temporarily allocate a list of UTF-8 Strings. +-- +withUTFStrings :: [String] -> ([CString] -> IO a) -> IO a +withUTFStrings hsStrs = withUTFStrings' hsStrs [] + where withUTFStrings' :: [String] -> [CString] -> ([CString] -> IO a) -> IO a + withUTFStrings' [] cs body = body (reverse cs) + withUTFStrings' (s:ss) cs body = withUTFString s $ \c -> + withUTFStrings' ss (c:cs) body + +-- Temporarily allocate an array of UTF-8 Strings. +-- +withUTFStringArray :: [String] -> (Ptr CString -> IO a) -> IO a +withUTFStringArray hsStr body = + withUTFStrings hsStr $ \cStrs -> do + withArray cStrs body + +-- Temporarily allocate a null-terminated array of UTF-8 Strings. +-- +withUTFStringArray0 :: [String] -> (Ptr CString -> IO a) -> IO a +withUTFStringArray0 hsStr body = + withUTFStrings hsStr $ \cStrs -> do + withArray0 nullPtr cStrs body + -- Convert Unicode characters to UTF-8. -- toUTF :: String -> String |
From: Duncan C. <dun...@us...> - 2005-04-04 01:24:26
|
Update of /cvsroot/gtk2hs/gtk2hs In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19314 Modified Files: ChangeLog Log Message: Large merge from generated modules. Changed code formatting and documentation. In one or two places fix minor bugs. Remove two non-exsistant functions from TextView module. Index: ChangeLog =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/ChangeLog,v retrieving revision 1.419 retrieving revision 1.420 diff -u -d -r1.419 -r1.420 --- ChangeLog 3 Apr 2005 12:56:06 -0000 1.419 +++ ChangeLog 4 Apr 2005 01:24:07 -0000 1.420 @@ -1,3 +1,14 @@ +2005-04-4 Duncan Coutts <du...@co...> + + * gtk/Graphics/UI/Gtk/Multiline/TextBuffer.chs, + gtk/Graphics/UI/Gtk/Multiline/TextMark.chs, + gtk/Graphics/UI/Gtk/Multiline/TextTag.chs.pp, + gtk/Graphics/UI/Gtk/Multiline/TextTagTable.chs, + gtk/Graphics/UI/Gtk/Multiline/TextView.chs: merge from + generated modules. Changed code formatting and documentation. In one + or two places fix minor bugs. Remove two non-exsistant functions from + TextView module. + 2005-04-3 Duncan Coutts <du...@co...> * gtk/Graphics/UI/Gtk/Selectors/ColorSelection.chs, |
From: Duncan C. <dun...@us...> - 2005-04-04 01:24:19
|
Update of /cvsroot/gtk2hs/gtk2hs/gtk/Graphics/UI/Gtk/Multiline In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19314/gtk/Graphics/UI/Gtk/Multiline Modified Files: TextBuffer.chs TextMark.chs TextTag.chs.pp TextTagTable.chs TextView.chs Log Message: Large merge from generated modules. Changed code formatting and documentation. In one or two places fix minor bugs. Remove two non-exsistant functions from TextView module. Index: TextView.chs =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/Graphics/UI/Gtk/Multiline/TextView.chs,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- TextView.chs 13 Mar 2005 19:34:36 -0000 1.5 +++ TextView.chs 4 Apr 2005 01:24:10 -0000 1.6 @@ -31,18 +31,17 @@ -- Widget that displays a 'TextBuffer' -- module Graphics.UI.Gtk.Multiline.TextView ( --- * Description +-- * Detail -- -- | You may wish to begin by reading the text widget conceptual overview -- which gives an overview of all the objects and data types related to the -- text widget and how they work together. -- --- * Throughout we distinguish between buffer coordinates which are pixels [...1379 lines suppressed...] - TextViewClass tv => tv -> (Adjustment -> Adjustment -> IO ()) -> - IO (ConnectId tv) +onSetScrollAdjustments, afterSetScrollAdjustments :: TextViewClass self => self + -> (Adjustment -> Adjustment -> IO ()) + -> IO (ConnectId self) onSetScrollAdjustments = connect_OBJECT_OBJECT__NONE "set_scroll_adjustments" False afterSetScrollAdjustments = @@ -1009,8 +1170,8 @@ -- * The action itself happens when the 'TextView' processes this -- signal. -- -onToggleOverwrite, afterToggleOverwrite :: TextViewClass tv => tv -> IO () -> - IO (ConnectId tv) +onToggleOverwrite, afterToggleOverwrite :: TextViewClass self => self + -> IO () + -> IO (ConnectId self) onToggleOverwrite = connect_NONE__NONE "toggle_overwrite" False afterToggleOverwrite = connect_NONE__NONE "toggle_overwrite" True - Index: TextMark.chs =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/Graphics/UI/Gtk/Multiline/TextMark.chs,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- TextMark.chs 13 Mar 2005 19:34:36 -0000 1.4 +++ TextMark.chs 4 Apr 2005 01:24:10 -0000 1.5 @@ -27,7 +27,7 @@ -- A position in the buffer preserved across buffer modifications -- module Graphics.UI.Gtk.Multiline.TextMark ( --- * Description +-- * Detail -- -- | You may wish to begin by reading the text widget conceptual overview -- which gives an overview of all the objects and data types related to the @@ -92,60 +92,68 @@ -------------------- -- Methods --- | Set the visibility of a 'TextMark'. +-- | Sets the visibility of @mark@; the insertion point is normally visible, +-- i.e. you can see it as a vertical bar. Also, the text widget uses a visible +-- mark to indicate where a drop will occur when dragging-and-dropping text. +-- Most other marks are not visible. Marks are not visible by default. -- -textMarkSetVisible :: TextMarkClass tm => tm -> Bool -> IO () -textMarkSetVisible tm vis = - {#call unsafe text_mark_set_visible#} (toTextMark tm) (fromBool vis) - +textMarkSetVisible :: TextMarkClass self => self -> Bool -> IO () +textMarkSetVisible self setting = + {# call unsafe text_mark_set_visible #} + (toTextMark self) + (fromBool setting) --- | Get the visibility of a 'TextMark'. +-- | Returns @True@ if the mark is visible (i.e. a cursor is displayed for it) -- -textMarkGetVisible :: TextMarkClass tm => tm -> IO Bool -textMarkGetVisible tm = liftM toBool $ - {#call unsafe text_mark_get_visible#} (toTextMark tm) +textMarkGetVisible :: TextMarkClass self => self -> IO Bool +textMarkGetVisible self = + liftM toBool $ + {# call unsafe text_mark_get_visible #} + (toTextMark self) --- | Query if a 'TextMark' is still valid. +-- | Returns @True@ if the mark has been removed from its buffer with +-- 'textBufferDeleteMark'. Marks can't be used once deleted. -- -textMarkGetDeleted :: TextMarkClass tm => tm -> IO Bool -textMarkGetDeleted tm = liftM toBool $ - {#call unsafe text_mark_get_deleted#} (toTextMark tm) +textMarkGetDeleted :: TextMarkClass self => self -> IO Bool +textMarkGetDeleted self = + liftM toBool $ + {# call unsafe text_mark_get_deleted #} + (toTextMark self) --- | Get the name of a 'TextMark'. --- --- * Returns Nothing, if the mark is anonymous. +-- | Returns the mark name; returns @Nothing@ for anonymous marks. -- -textMarkGetName :: TextMarkClass tm => tm -> IO (Maybe String) -textMarkGetName tm = do - strPtr <- {#call unsafe text_mark_get_name#} (toTextMark tm) - if strPtr==nullPtr then return Nothing else liftM Just $ peekUTFString strPtr +textMarkGetName :: TextMarkClass self => self -> IO (Maybe MarkName) +textMarkGetName self = + {# call unsafe text_mark_get_name #} + (toTextMark self) + >>= maybePeek peekUTFString --- | Extract the 'TextBuffer' of the mark. --- --- * Returns Nothing if the mark was deleted. +-- | Gets the buffer this mark is located inside, or @Nothing@ if the mark is +-- deleted. -- -textMarkGetBuffer :: TextMarkClass tm => tm -> IO (Maybe TextBuffer) -textMarkGetBuffer tm = do - bufPtr <- {#call unsafe text_mark_get_buffer#} (toTextMark tm) - if bufPtr==nullPtr then return Nothing else liftM Just $ - makeNewGObject mkTextBuffer (return $ castPtr bufPtr) +textMarkGetBuffer :: TextMarkClass self => self -> IO (Maybe TextBuffer) +textMarkGetBuffer self = + maybeNull (makeNewGObject mkTextBuffer) $ + {# call unsafe text_mark_get_buffer #} + (toTextMark self) --- | Determine whether the mark has gravity --- towards the beginning of a line. +-- | Determines whether the mark has left gravity. -- --- * The name is misleading as Arabic, Hebrew and some other languages have --- the beginning of a line towards the right. +-- The name is misleading as Arabic, Hebrew and some other languages have the +-- beginning of a line towards the right. -- -textMarkGetLeftGravity :: TextMarkClass tm => tm -> IO Bool -textMarkGetLeftGravity tm = liftM toBool $ - {#call unsafe text_mark_get_left_gravity#} (toTextMark tm) +textMarkGetLeftGravity :: TextMarkClass self => self -> IO Bool +textMarkGetLeftGravity self = + liftM toBool $ + {# call unsafe text_mark_get_left_gravity #} + (toTextMark self) -------------------- -- Properties -- | \'visible\' property. See 'textMarkGetVisible' and 'textMarkSetVisible' -- -textMarkVisible :: Attr TextMark Bool +textMarkVisible :: TextMarkClass self => Attr self Bool textMarkVisible = Attr textMarkGetVisible textMarkSetVisible Index: TextTag.chs.pp =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/Graphics/UI/Gtk/Multiline/TextTag.chs.pp,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- TextTag.chs.pp 13 Mar 2005 19:34:36 -0000 1.5 +++ TextTag.chs.pp 4 Apr 2005 01:24:10 -0000 1.6 @@ -28,10 +28,10 @@ -- Stability : provisional -- Portability : portable (depends on GHC) -- --- A tag that can be applied to text in a 'TextBuffer'. +-- A tag that can be applied to text in a 'TextBuffer' -- module Graphics.UI.Gtk.Multiline.TextTag ( --- * Description +-- * Detail -- -- | You may wish to begin by reading the text widget conceptual overview -- which gives an overview of all the objects and data types related to the @@ -91,34 +91,38 @@ -- textTagNew :: TagName -> IO TextTag textTagNew name = - withCString name $ \strPtr -> - makeNewGObject mkTextTag $ {#call unsafe text_tag_new#} strPtr + makeNewGObject mkTextTag $ + withCString name $ \namePtr -> + {# call unsafe text_tag_new #} + namePtr -------------------- -- Methods -- | Get the tag priority. -- -textTagGetPriority :: TextTagClass obj => obj -> IO Int -textTagGetPriority obj = liftM fromIntegral $ - {#call unsafe text_tag_get_priority#} (toTextTag obj) +textTagGetPriority :: TextTagClass self => self -> IO Int +textTagGetPriority self = + liftM fromIntegral $ + {# call unsafe text_tag_get_priority #} + (toTextTag self) --- | Sets the priority of a 'TextTag'. --- --- Valid priorities are start at 0 and go to one less than --- 'textTagTableGetSize'. Each tag in a table has a unique priority; setting the --- priority of one tag shifts the priorities of all the other tags in the table --- to maintain a unique priority for each tag. Higher priority tags \"win\" if --- two tags both set the same text attribute. When adding a tag to a tag table, --- it will be assigned the highest priority in the table by default; so normally --- the precedence of a set of tags is the order in which they were added to the --- table, or created with 'textBufferCreateTag', which adds the tag to the --- buffer's table automatically. +-- | Sets the priority of a 'TextTag'. Valid priorities are start at 0 and go +-- to one less than 'textTagTableGetSize'. Each tag in a table has a unique +-- priority; setting the priority of one tag shifts the priorities of all the +-- other tags in the table to maintain a unique priority for each tag. Higher +-- priority tags \"win\" if two tags both set the same text attribute. When +-- adding a tag to a tag table, it will be assigned the highest priority in the +-- table by default; so normally the precedence of a set of tags is the order +-- in which they were added to the table, or created with +-- 'textBufferCreateTag', which adds the tag to the buffer's table +-- automatically. -- -textTagSetPriority :: TextTagClass obj => obj -> Int -> IO () -textTagSetPriority obj priority = - {#call text_tag_set_priority#} (toTextTag obj) (fromIntegral priority) - +textTagSetPriority :: TextTagClass self => self -> Int -> IO () +textTagSetPriority self priority = + {# call text_tag_set_priority #} + (toTextTag self) + (fromIntegral priority) -- TextAttributes methods @@ -143,14 +147,9 @@ text_attributes_unref :: Ptr TextAttributes -> FinalizerPtr TextAttributes text_attributes_unref _ = text_attributes_unref' -#elif __GLASGOW_HASKELL__>=504 - -foreign import ccall unsafe "gtk_text_attributes_unref" - text_attributes_unref :: Ptr TextAttributes -> IO () - #else -foreign import ccall "gtk_text_attributes_unref" unsafe +foreign import ccall unsafe "gtk_text_attributes_unref" text_attributes_unref :: Ptr TextAttributes -> IO () #endif @@ -160,7 +159,7 @@ -- | \'priority\' property. See 'textTagGetPriority' and 'textTagSetPriority' -- -textTagPriority :: Attr TextTag Int +textTagPriority :: TextTagClass self => Attr self Int textTagPriority = Attr textTagGetPriority textTagSetPriority Index: TextTagTable.chs =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/Graphics/UI/Gtk/Multiline/TextTagTable.chs,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- TextTagTable.chs 25 Feb 2005 01:11:36 -0000 1.3 +++ TextTagTable.chs 4 Apr 2005 01:24:10 -0000 1.4 @@ -27,7 +27,7 @@ -- Collection of tags that can be used together -- module Graphics.UI.Gtk.Multiline.TextTagTable ( --- * Description +-- * Detail -- -- | You may wish to begin by reading the text widget conceptual overview -- which gives an overview of all the objects and data types related to the @@ -72,8 +72,8 @@ -- textTagTableNew :: IO TextTagTable textTagTableNew = - makeNewGObject mkTextTagTable $ - {#call unsafe text_tag_table_new#} + makeNewGObject mkTextTagTable $ + {# call unsafe text_tag_table_new #} -------------------- -- Methods @@ -84,35 +84,46 @@ -- The tag must not be in a tag table already, and may not have the same name as -- an already-added tag. -- -textTagTableAdd :: TextTagTableClass obj => obj -> TextTag -> IO () -textTagTableAdd obj tag = - {#call text_tag_table_add#} (toTextTagTable obj) tag +textTagTableAdd :: (TextTagTableClass self, TextTagClass tag) => self -> tag -> IO () +textTagTableAdd self tag = + {# call text_tag_table_add #} + (toTextTagTable self) + (toTextTag tag) -- | Remove a tag from the table. -- -textTagTableRemove :: TextTagTableClass obj => obj -> TextTag -> IO () -textTagTableRemove obj tag = - {#call text_tag_table_remove#} (toTextTagTable obj) tag +textTagTableRemove :: (TextTagTableClass self, TextTagClass tag) => self -> tag -> IO () +textTagTableRemove self tag = + {# call text_tag_table_remove #} + (toTextTagTable self) + (toTextTag tag) -- | Look up a named tag. -- -textTagTableLookup :: TextTagTableClass obj => obj - -> String -> IO (Maybe TextTag) -textTagTableLookup obj name = - withCString name $ \strPtr -> do - tagPtr <- {#call unsafe text_tag_table_lookup#} (toTextTagTable obj) strPtr - if tagPtr == nullPtr then return Nothing else liftM Just $ - makeNewGObject mkTextTag (return tagPtr) +textTagTableLookup :: TextTagTableClass self => self + -> String -- ^ @name@ - name of a tag + -> IO (Maybe TextTag) -- ^ returns The tag, or @Nothing@ if none by that name + -- is in the table. +textTagTableLookup self name = + maybeNull (makeNewGObject mkTextTag) $ + withCString name $ \namePtr -> + {# call unsafe text_tag_table_lookup #} + (toTextTagTable self) + namePtr --- | Calls func on each tag in table. +-- | Maps over each tag in the table. -- -textTagTableForeach :: TextTagTableClass obj => obj - -> (TextTag -> IO ()) -> IO () -textTagTableForeach obj func = do +textTagTableForeach :: TextTagTableClass self => self + -> (TextTag -> IO ()) + -> IO () +textTagTableForeach self func = do funcPtr <- mkTextTagTableForeach (\tagPtr _ -> do tag <- makeNewGObject mkTextTag (return tagPtr) func tag) - {#call text_tag_table_foreach#} (toTextTagTable obj) funcPtr nullPtr + {# call text_tag_table_foreach #} + (toTextTagTable self) + funcPtr + nullPtr {#pointer TextTagTableForeach#} @@ -121,6 +132,8 @@ -- | Returns the size of the table (the number of tags). -- -textTagTableGetSize :: TextTagTableClass obj => obj -> IO Int -textTagTableGetSize obj = liftM fromIntegral $ - {#call unsafe text_tag_table_get_size#} (toTextTagTable obj) +textTagTableGetSize :: TextTagTableClass self => self -> IO Int +textTagTableGetSize self = + liftM fromIntegral $ + {# call unsafe text_tag_table_get_size #} + (toTextTagTable self) Index: TextBuffer.chs =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/Graphics/UI/Gtk/Multiline/TextBuffer.chs,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- TextBuffer.chs 13 Mar 2005 19:34:35 -0000 1.5 +++ TextBuffer.chs 4 Apr 2005 01:24:09 -0000 1.6 @@ -176,433 +176,643 @@ -------------------- -- Constructors --- | Create a new text buffer, possibly taking a --- table of 'TextTag'. +-- | Creates a new text buffer. -- -textBufferNew :: Maybe TextTagTable -> IO TextBuffer -textBufferNew tt = makeNewGObject mkTextBuffer $ liftM castPtr $ - {#call unsafe text_buffer_new#} - (fromMaybe (mkTextTagTable nullForeignPtr) tt) [...1091 lines suppressed...] -- -onModifiedChanged, afterModifiedChanged :: TextBufferClass tb => tb -> IO () -> - IO (ConnectId tb) +onModifiedChanged, afterModifiedChanged :: TextBufferClass self => self + -> IO () + -> IO (ConnectId self) onModifiedChanged = connect_NONE__NONE "modified_changed" False afterModifiedChanged = connect_NONE__NONE "modified_changed" True -- | A 'TextTag' was removed. -- -onRemoveTag, afterRemoveTag :: TextBufferClass tb => tb -> - (TextTag -> TextIter -> TextIter -> IO ()) -> - IO (ConnectId tb) +onRemoveTag, afterRemoveTag :: TextBufferClass self => self + -> (TextTag -> TextIter -> TextIter -> IO ()) + -> IO (ConnectId self) onRemoveTag = connect_OBJECT_BOXED_BOXED__NONE "remove_tag" mkTextIter mkTextIter False afterRemoveTag = connect_OBJECT_BOXED_BOXED__NONE "remove_tag" |
From: Duncan C. <dun...@us...> - 2005-04-03 14:16:18
|
Update of /cvsroot/gtk2hs/gtk2hs/gtk/Graphics/UI/Gtk/Selectors In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5119/gtk/Graphics/UI/Gtk/Selectors Modified Files: FileChooser.chs.pp Log Message: Reminder to self: fix bugs before comitting, not the other way around. Index: FileChooser.chs.pp =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/Graphics/UI/Gtk/Selectors/FileChooser.chs.pp,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- FileChooser.chs.pp 3 Apr 2005 12:56:07 -0000 1.7 +++ FileChooser.chs.pp 3 Apr 2005 14:15:35 -0000 1.8 @@ -195,8 +195,8 @@ import Monad (liftM, when) import System.Glib.FFI +import System.Glib.UTFString import System.Glib.Attributes (Attr(..)) -import System.Glib.UTFString (readCString) {#import Graphics.UI.Gtk.Types#} import Graphics.UI.Gtk.Abstract.Object (makeNewObject) import Graphics.UI.Gtk.Signals @@ -754,7 +754,7 @@ -> IO () fileChooserRemoveShortcutFolder self folder = propagateGError $ \errorPtr -> - withCString folder $ \folderPtr -> + withCString folder $ \folderPtr -> do #if defined (WIN32) && GTK_CHECK_VERSION(2,6,0) {# call gtk_file_chooser_remove_shortcut_folder_utf8 #} #else |
From: Duncan C. <dun...@us...> - 2005-04-03 12:56:20
|
Update of /cvsroot/gtk2hs/gtk2hs/gtk/Graphics/UI/Gtk/Selectors In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18765/gtk/Graphics/UI/Gtk/Selectors Modified Files: ColorSelection.chs ColorSelectionDialog.chs FileChooser.chs.pp FileChooserDialog.chs.pp FileChooserWidget.chs.pp FileSelection.chs.pp FontSelection.chs FontSelectionDialog.chs Log Message: Merge from generated modules. Changed code formatting and documentation. Index: FontSelection.chs =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/Graphics/UI/Gtk/Selectors/FontSelection.chs,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- FontSelection.chs 13 Mar 2005 19:34:37 -0000 1.4 +++ FontSelection.chs 3 Apr 2005 12:56:07 -0000 1.5 @@ -24,10 +24,10 @@ -- Stability : provisional -- Portability : portable (depends on GHC) -- --- A widget for selecting fonts. +-- A widget for selecting fonts -- module Graphics.UI.Gtk.Selectors.FontSelection ( --- * Description +-- * Detail -- -- | The 'FontSelection' widget lists the available fonts, styles and sizes, -- allowing the user to select a font. It is used in the 'FontSelectionDialog' @@ -90,40 +90,50 @@ -- fontSelectionNew :: IO FontSelection fontSelectionNew = - makeNewObject mkFontSelection $ liftM castPtr $ - {#call unsafe font_selection_new#} + makeNewObject mkFontSelection $ + liftM (castPtr :: Ptr Widget -> Ptr FontSelection) $ + {# call unsafe font_selection_new #} -------------------- -- Methods --- | Gets the currently-selected font name. Returns Nothing if no font is --- selected. +-- | Gets the currently-selected font name. -- -fontSelectionGetFontName :: FontSelectionClass obj => obj -> IO (Maybe String) -fontSelectionGetFontName obj = - {#call unsafe font_selection_get_font_name#} (toFontSelection obj) - >>= maybePeek readUTFString +fontSelectionGetFontName :: FontSelectionClass self => self + -> IO (Maybe String) -- ^ returns @Nothing@ if no font is selected. +fontSelectionGetFontName self = + {# call unsafe font_selection_get_font_name #} + (toFontSelection self) + >>= maybePeek readUTFString --- | Sets the currently-selected font. Returns False if the font was not found. +-- | Sets the currently-selected font. -- -fontSelectionSetFontName :: FontSelectionClass obj => obj -> String -> IO Bool -fontSelectionSetFontName obj fontname = liftM toBool $ - withUTFString fontname $ \strPtr -> - {#call font_selection_set_font_name#} (toFontSelection obj) strPtr +fontSelectionSetFontName :: FontSelectionClass self => self + -> String -- ^ @fontname@ - a fontname. + -> IO Bool -- ^ returns @True@ if the font was found. +fontSelectionSetFontName self fontname = + liftM toBool $ + withUTFString fontname $ \fontnamePtr -> + {# call font_selection_set_font_name #} + (toFontSelection self) + fontnamePtr -- | Gets the text displayed in the preview area. -- -fontSelectionGetPreviewText :: FontSelectionClass obj => obj -> IO String -fontSelectionGetPreviewText obj = - {#call unsafe font_selection_get_preview_text#} (toFontSelection obj) - >>= peekUTFString +fontSelectionGetPreviewText :: FontSelectionClass self => self -> IO String +fontSelectionGetPreviewText self = + {# call unsafe font_selection_get_preview_text #} + (toFontSelection self) + >>= peekUTFString -- | Sets the text displayed in the preview area. -- -fontSelectionSetPreviewText :: FontSelectionClass obj => obj -> String -> IO () -fontSelectionSetPreviewText obj text = - withUTFString text $ \strPtr -> - {#call font_selection_set_preview_text#} (toFontSelection obj) strPtr +fontSelectionSetPreviewText :: FontSelectionClass self => self -> String -> IO () +fontSelectionSetPreviewText self text = + withUTFString text $ \textPtr -> + {# call font_selection_set_preview_text #} + (toFontSelection self) + textPtr -------------------- -- Properties @@ -132,7 +142,7 @@ -- -- Default value: \"abcdefghijk ABCDEFGHIJK\" -- -fontSelectionPreviewText :: Attr FontSelection String +fontSelectionPreviewText :: FontSelectionClass self => Attr self String fontSelectionPreviewText = Attr fontSelectionGetPreviewText fontSelectionSetPreviewText Index: FontSelectionDialog.chs =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/Graphics/UI/Gtk/Selectors/FontSelectionDialog.chs,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- FontSelectionDialog.chs 13 Mar 2005 19:34:37 -0000 1.4 +++ FontSelectionDialog.chs 3 Apr 2005 12:56:07 -0000 1.5 @@ -24,10 +24,10 @@ -- Stability : provisional -- Portability : portable (depends on GHC) -- --- A dialog box for selecting fonts. +-- A dialog box for selecting fonts -- module Graphics.UI.Gtk.Selectors.FontSelectionDialog ( --- * Description +-- * Detail -- -- | The 'FontSelectionDialog' widget is a dialog box for selecting a font. -- @@ -87,48 +87,57 @@ -- | Creates a new 'FontSelectionDialog'. -- -fontSelectionDialogNew :: String -> IO FontSelectionDialog +fontSelectionDialogNew :: + String -- ^ @title@ - the title of the dialog box. + -> IO FontSelectionDialog fontSelectionDialogNew title = - makeNewObject mkFontSelectionDialog $ liftM castPtr $ - withUTFString title $ \strPtr -> - {#call unsafe font_selection_dialog_new#} strPtr + makeNewObject mkFontSelectionDialog $ + liftM (castPtr :: Ptr Widget -> Ptr FontSelectionDialog) $ + withUTFString title $ \titlePtr -> + {# call unsafe font_selection_dialog_new #} + titlePtr -------------------- -- Methods --- | Gets the currently-selected font name. Returns Nothing if no font is --- selected. +-- | Gets the currently-selected font name. -- -fontSelectionDialogGetFontName :: FontSelectionDialogClass obj => obj - -> IO (Maybe String) -fontSelectionDialogGetFontName obj = - {#call font_selection_dialog_get_font_name#} (toFontSelectionDialog obj) - >>= maybePeek readUTFString +fontSelectionDialogGetFontName :: FontSelectionDialogClass self => self + -> IO (Maybe String) -- ^ returns the currently-selected font name, or + -- @Nothing@ if no font is selected. +fontSelectionDialogGetFontName self = + {# call font_selection_dialog_get_font_name #} + (toFontSelectionDialog self) + >>= maybePeek readUTFString --- | Sets the currently-selected font. Returns False if the font was not found. +-- | Sets the currently-selected font. -- -fontSelectionDialogSetFontName :: FontSelectionDialogClass obj => obj -> String -> IO Bool -fontSelectionDialogSetFontName obj fontname = liftM toBool $ - withUTFString fontname $ \strPtr -> - {#call font_selection_dialog_set_font_name#} (toFontSelectionDialog obj) - strPtr +fontSelectionDialogSetFontName :: FontSelectionDialogClass self => self + -> String -- ^ @fontname@ - a fontname. + -> IO Bool -- ^ returns @True@ if the font was found. +fontSelectionDialogSetFontName self fontname = + liftM toBool $ + withUTFString fontname $ \fontnamePtr -> + {# call font_selection_dialog_set_font_name #} + (toFontSelectionDialog self) + fontnamePtr -- | Gets the text displayed in the preview area. -- -fontSelectionDialogGetPreviewText :: FontSelectionDialogClass obj => obj - -> IO String -fontSelectionDialogGetPreviewText obj = - {#call unsafe font_selection_dialog_get_preview_text#} (toFontSelectionDialog obj) - >>= peekUTFString +fontSelectionDialogGetPreviewText :: FontSelectionDialogClass self => self -> IO String +fontSelectionDialogGetPreviewText self = + {# call unsafe font_selection_dialog_get_preview_text #} + (toFontSelectionDialog self) + >>= peekUTFString -- | Sets the text displayed in the preview area. -- -fontSelectionDialogSetPreviewText :: FontSelectionDialogClass obj => obj - -> String -> IO () -fontSelectionDialogSetPreviewText obj text = - withUTFString text $ \strPtr -> - {#call font_selection_dialog_set_preview_text#} (toFontSelectionDialog obj) - strPtr +fontSelectionDialogSetPreviewText :: FontSelectionDialogClass self => self -> String -> IO () +fontSelectionDialogSetPreviewText self text = + withUTFString text $ \textPtr -> + {# call font_selection_dialog_set_preview_text #} + (toFontSelectionDialog self) + textPtr -------------------- -- Properties @@ -136,7 +145,7 @@ -- | \'previewText\' property. See 'fontSelectionDialogGetPreviewText' and -- 'fontSelectionDialogSetPreviewText' -- -fontSelectionDialogPreviewText :: Attr FontSelectionDialog String +fontSelectionDialogPreviewText :: FontSelectionDialogClass self => Attr self String fontSelectionDialogPreviewText = Attr fontSelectionDialogGetPreviewText fontSelectionDialogSetPreviewText Index: FileChooserDialog.chs.pp =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/Graphics/UI/Gtk/Selectors/FileChooserDialog.chs.pp,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- FileChooserDialog.chs.pp 25 Feb 2005 22:53:42 -0000 1.4 +++ FileChooserDialog.chs.pp 3 Apr 2005 12:56:07 -0000 1.5 @@ -24,16 +24,13 @@ -- Stability : provisional -- Portability : portable (depends on GHC) -- --- The file chooser dialog and widget is a replacement --- for the old "FileSel"ection dialog. It provides a better user --- interface and an improved API. --- --- * This is the dialog variant of the 'FileChooser' +-- A file chooser dialog, suitable for \"File\/Open\" or \"File\/Save\" +-- commands -- --- * Added in GTK+ 2.4 +-- * Module available since Gtk+ version 2.4 -- module Graphics.UI.Gtk.Selectors.FileChooserDialog ( --- * Description +-- * Detail -- -- | 'FileChooserDialog' is a dialog box suitable for use with \"File\/Open\" -- or \"File\/Save as\" commands. This widget works by putting a @@ -44,8 +41,6 @@ -- -- Note that 'FileChooserDialog' does not have any methods of its own. -- Instead, you should use the functions that work on a 'FileChooser'. --- --- * Module available since Gtk version 2.4 -- ** Response Codes -- @@ -78,8 +73,6 @@ #endif ) where -#if GTK_CHECK_VERSION(2,4,0) - import Monad (liftM, when) import Maybe (isJust, fromJust) @@ -95,6 +88,7 @@ {# context lib="gtk" prefix="gtk" #} +#if GTK_CHECK_VERSION(2,4,0) -------------------- -- Interfaces @@ -103,6 +97,8 @@ -------------------- -- Constructors +-- | Creates a new 'FileChooserDialog'. +-- fileChooserDialogNew :: Maybe String -- ^ Title of the dialog (or default) -> Maybe Window -- ^ Transient parent of the dialog (or none) @@ -112,6 +108,10 @@ fileChooserDialogNew title parent action buttons = internalFileChooserDialogNew title parent action buttons Nothing +-- | Creates a new 'FileChooserDialog' with a specified backend. This is +-- especially useful if you use 'fileChooserSetLocalOnly' to allow non-local +-- files and you use a more expressive vfs, such as gnome-vfs, to load files. +-- fileChooserDialogNewWithBackend :: Maybe String -- ^ Title of the dialog (or default) -> Maybe Window -- ^ Transient parent of the dialog (or none) @@ -121,7 +121,6 @@ -> IO FileChooserDialog fileChooserDialogNewWithBackend title parent action buttons backend = internalFileChooserDialogNew title parent action buttons (Just backend) - -- Annoyingly, the constructor for FileChooserDialog uses varargs so we can't -- call it using the Haskell FFI. The GTK people do not consider this an api @@ -150,5 +149,4 @@ mapM_ (\(btnName, btnResponse) -> dialogAddButton dialog btnName btnResponse) buttons return dialog - #endif Index: FileSelection.chs.pp =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/Graphics/UI/Gtk/Selectors/FileSelection.chs.pp,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- FileSelection.chs.pp 26 Feb 2005 02:17:27 -0000 1.1 +++ FileSelection.chs.pp 3 Apr 2005 12:56:07 -0000 1.2 @@ -28,12 +28,12 @@ -- Stability : provisional -- Portability : portable (depends on GHC) -- --- Prompt the user for a file or directory name. +-- Prompt the user for a file or directory name -- -- * As of Gtk+ 2.4 this module has been deprecated in favour of 'FileChooser' -- module Graphics.UI.Gtk.Selectors.FileSelection ( --- * Description +-- * Detail -- -- | 'FileSelection' should be used to retrieve file or directory names from -- the user. It will create a new dialog window containing a directory list, @@ -84,30 +84,38 @@ fileSelectionShowFileopButtons, fileSelectionHideFileopButtons, fileSelectionGetButtons, - fileSelectionComplete + fileSelectionComplete, + +-- * Properties + fileSelectionFilename ) where import Monad (liftM) import System.Glib.FFI import System.Glib.UTFString +import System.Glib.Attributes (Attr(..)) {#import Graphics.UI.Gtk.Types#} -import Graphics.UI.Gtk.Abstract.Object (makeNewObject) -import Graphics.UI.Gtk.General.Structs (fileSelectionGetButtons) +import Graphics.UI.Gtk.Abstract.Object (makeNewObject) +import Graphics.UI.Gtk.General.Structs (fileSelectionGetButtons) {# context lib="libgtk" prefix="gtk" #} -------------------- -- Constructors --- | Create a new file selection dialog with --- the given window title. +-- | Creates a new file selection dialog box. By default it will contain a +-- 'TreeView' of the application's current working directory, and a file +-- listing. Operation buttons that allow the user to create a directory, delete +-- files and rename files, are also present. -- -fileSelectionNew :: - String +fileSelectionNew :: + String -- ^ @title@ - a message that will be placed in the file + -- requestor's titlebar. -> IO FileSelection fileSelectionNew title = - makeNewObject mkFileSelection $ liftM castPtr $ + makeNewObject mkFileSelection $ + liftM (castPtr :: Ptr Widget -> Ptr FileSelection) $ withUTFString title $ \titlePtr -> {# call unsafe file_selection_new #} titlePtr @@ -115,46 +123,58 @@ -------------------- -- Methods --- | Set the filename for the given file --- selection dialog. +-- | Sets a default path for the file requestor. If @filename@ includes a +-- directory path, then the requestor will open with that path as its current +-- working directory. -- -fileSelectionSetFilename :: FileSelectionClass fsel => fsel -> String -> IO () -fileSelectionSetFilename fsel str = - withUTFString str $ \strPtr -> +-- This has the consequence that in order to open the requestor with a +-- working directory and an empty filename, @filename@ must have a trailing +-- directory separator. +-- +fileSelectionSetFilename :: FileSelectionClass self => self + -> String -- ^ @filename@ - a string to set as the default file name. + -> IO () +fileSelectionSetFilename self filename = + withUTFString filename $ \filenamePtr -> #if defined (WIN32) && GTK_CHECK_VERSION(2,6,0) - {#call unsafe file_selection_set_filename_utf8#} + {# call unsafe gtk_file_selection_set_filename_utf8 #} #else - {#call unsafe file_selection_set_filename#} + {# call unsafe gtk_file_selection_set_filename #} #endif - (toFileSelection fsel) strPtr + (toFileSelection self) + filenamePtr --- | Get the filename currently selected by --- the given file selection dialog. +-- | This function returns the selected filename. -- -fileSelectionGetFilename :: FileSelectionClass fsel => fsel -> IO String -fileSelectionGetFilename fsel = - do +-- If no file is selected then the selected directory path is returned. +-- +fileSelectionGetFilename :: FileSelectionClass self => self + -> IO String -- ^ returns currently-selected filename +fileSelectionGetFilename self = #if defined (WIN32) && GTK_CHECK_VERSION(2,6,0) - strPtr <- {#call unsafe file_selection_get_filename_utf8#} + {# call unsafe gtk_file_selection_get_filename_utf8 #} #else - strPtr <- {#call unsafe file_selection_get_filename#} + {# call unsafe gtk_file_selection_get_filename #} #endif - (toFileSelection fsel) - peekUTFString strPtr + (toFileSelection self) + >>= peekUTFString --- | Show the file operation buttons --- of the given file selection dialog. +-- | Shows the file operation buttons, if they have previously been hidden. +-- The rest of the widgets in the dialog will be resized accordingly. -- -fileSelectionShowFileopButtons :: FileSelectionClass fsel => fsel -> IO () -fileSelectionShowFileopButtons = - {#call file_selection_show_fileop_buttons#} . toFileSelection +fileSelectionShowFileopButtons :: FileSelectionClass self => self -> IO () +fileSelectionShowFileopButtons self = + {# call file_selection_show_fileop_buttons #} + (toFileSelection self) --- | Hide the file operation buttons --- of the given file selection dialog. +-- | Hides the file operation buttons that normally appear at the top of the +-- dialog. Useful if you wish to create a custom file selector, based on +-- 'FileSelection'. -- -fileSelectionHideFileopButtons :: FileSelectionClass fsel => fsel -> IO () -fileSelectionHideFileopButtons = - {#call file_selection_hide_fileop_buttons#} . toFileSelection +fileSelectionHideFileopButtons :: FileSelectionClass self => self -> IO () +fileSelectionHideFileopButtons self = + {# call file_selection_hide_fileop_buttons #} + (toFileSelection self) -- currently broken -- -- query the widgets of the file selectors buttons @@ -172,9 +192,30 @@ -- cancel <- {#get FileSelection.cancel_button#} ptr -- return (castToButton ok, castToButton cancel) --- | Only show files matching pattern. +-- | Will attempt to match @pattern@ to a valid filenames or subdirectories in +-- the current directory. If a match can be made, the matched filename will +-- appear in the text entry field of the file selection dialog. If a partial +-- match can be made, the \"Files\" list will contain those file names which +-- have been partially matched, and the \"Folders\" list those directories +-- which have been partially matched. -- -fileSelectionComplete :: FileSelectionClass fsel => fsel -> String -> IO () -fileSelectionComplete fsel pattern = +fileSelectionComplete :: FileSelectionClass self => self + -> String -- ^ @pattern@ - a string of characters which may or may not match + -- any filenames in the current directory. + -> IO () +fileSelectionComplete self pattern = withUTFString pattern $ \patternPtr -> - {#call file_selection_complete#} (toFileSelection fsel) patternPtr + {# call file_selection_complete #} + (toFileSelection self) + patternPtr + +-------------------- +-- Properties + +-- | The currently selected filename. +-- +-- +fileSelectionFilename :: FileSelectionClass self => Attr self String +fileSelectionFilename = Attr + fileSelectionGetFilename + fileSelectionSetFilename Index: ColorSelectionDialog.chs =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/Graphics/UI/Gtk/Selectors/ColorSelectionDialog.chs,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- ColorSelectionDialog.chs 25 Feb 2005 01:11:37 -0000 1.3 +++ ColorSelectionDialog.chs 3 Apr 2005 12:56:07 -0000 1.4 @@ -24,10 +24,10 @@ -- Stability : provisional -- Portability : portable (depends on GHC) -- --- A standard dialog box for selecting a color. +-- A standard dialog box for selecting a color -- module Graphics.UI.Gtk.Selectors.ColorSelectionDialog ( --- * Description +-- * Detail -- -- | The 'ColorSelectionDialog' provides a standard dialog which allows the -- user to select a color much like the 'FileSelection' provides a standard @@ -70,8 +70,13 @@ -- | Creates a new 'ColorSelectionDialog'. -- -colorSelectionDialogNew :: String -> IO ColorSelectionDialog +colorSelectionDialogNew :: + String -- ^ @title@ - a string containing the title text + -- for the dialog. + -> IO ColorSelectionDialog colorSelectionDialogNew title = - makeNewObject mkColorSelectionDialog $ liftM castPtr $ - withUTFString title $ \strPtr -> - {#call unsafe color_selection_dialog_new#} strPtr + makeNewObject mkColorSelectionDialog $ + liftM (castPtr :: Ptr Widget -> Ptr ColorSelectionDialog) $ + withUTFString title $ \titlePtr -> + {# call unsafe color_selection_dialog_new #} + titlePtr Index: FileChooser.chs.pp =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/Graphics/UI/Gtk/Selectors/FileChooser.chs.pp,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- FileChooser.chs.pp 13 Mar 2005 19:34:37 -0000 1.6 +++ FileChooser.chs.pp 3 Apr 2005 12:56:07 -0000 1.7 @@ -1,5 +1,5 @@ -- -*-haskell-*- --- GIMP Toolkit (GTK) FileChooser +-- GIMP Toolkit (GTK) Interface FileChooser -- -- Author : Duncan Coutts -- @@ -24,24 +24,20 @@ -- Stability : provisional -- Portability : portable (depends on GHC) -- --- The file chooser dialog and widget is a replacement [...975 lines suppressed...] +-- +-- See also: 'fileChooserGetFilename', 'fileChooserGetFilenames', +-- 'fileChooserGetURI', 'fileChooserGetURIs'. +-- +onFileActivated, afterFileActivated :: FileChooserClass self => self + -> IO () + -> IO (ConnectId self) +onFileActivated = connect_NONE__NONE "file-activated" False +afterFileActivated = connect_NONE__NONE "file-activated" True +#endif ------------------------------------------------------ -- Utility functions that really ought to go elsewhere @@ -576,6 +957,3 @@ toStringGSList strs = do strPtrs <- mapM newCString strs toGSList strPtrs - -#endif - Index: ColorSelection.chs =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/Graphics/UI/Gtk/Selectors/ColorSelection.chs,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- ColorSelection.chs 13 Mar 2005 19:34:37 -0000 1.5 +++ ColorSelection.chs 3 Apr 2005 12:56:07 -0000 1.6 @@ -24,10 +24,10 @@ -- Stability : provisional -- Portability : portable (depends on GHC) -- --- A widget used to select a color. +-- A widget used to select a color -- module Graphics.UI.Gtk.Selectors.ColorSelection ( --- * Description +-- * Detail -- -- | The 'ColorSelection' is a widget that is used to select a color. It -- consists of a color wheel and number of sliders and entry boxes for color @@ -90,128 +90,152 @@ -------------------- -- Constructors --- | Creates a new ColorSelection widget. +-- | Creates a new 'ColorSelection'. -- colorSelectionNew :: IO ColorSelection colorSelectionNew = - makeNewObject mkColorSelection $ liftM castPtr $ - {#call unsafe color_selection_new#} + makeNewObject mkColorSelection $ + liftM (castPtr :: Ptr Widget -> Ptr ColorSelection) $ + {# call unsafe color_selection_new #} -------------------- -- Methods -- | Returns the current alpha value. -- --- * The alpha value is represented by an integer between 0 and 65535. --- -colorSelectionGetCurrentAlpha :: ColorSelectionClass obj => obj -> IO Int -colorSelectionGetCurrentAlpha obj = liftM fromIntegral $ - {#call unsafe color_selection_get_current_alpha#} (toColorSelection obj) +colorSelectionGetCurrentAlpha :: ColorSelectionClass self => self + -> IO Int -- ^ returns an integer between 0 and 65535. +colorSelectionGetCurrentAlpha self = + liftM fromIntegral $ + {# call unsafe color_selection_get_current_alpha #} + (toColorSelection self) --- | Sets the current opacity. The first time this is called, it will also set --- the original opacity too. --- --- * The alpha value is represented by an integer between 0 and 65535. +-- | Sets the current opacity to be @alpha@. The first time this is called, it +-- will also set the original opacity to be @alpha@ too. -- -colorSelectionSetCurrentAlpha :: ColorSelectionClass obj => obj -> Int -> IO () -colorSelectionSetCurrentAlpha obj alpha = - {#call color_selection_set_current_alpha#} (toColorSelection obj) +colorSelectionSetCurrentAlpha :: ColorSelectionClass self => self + -> Int -- ^ @alpha@ - an integer between 0 and 65535. + -> IO () +colorSelectionSetCurrentAlpha self alpha = + {# call color_selection_set_current_alpha #} + (toColorSelection self) (fromIntegral alpha) --- | Gets the current color in the ColorSelection widget. +-- | Gets the current color in the 'ColorSelection' widget. -- -colorSelectionGetCurrentColor :: ColorSelectionClass obj => obj -> IO Color -colorSelectionGetCurrentColor obj = +colorSelectionGetCurrentColor :: ColorSelectionClass self => self -> IO Color +colorSelectionGetCurrentColor self = alloca $ \colorPtr -> do - {#call unsafe color_selection_get_current_color#} (toColorSelection obj) + {# call unsafe color_selection_get_current_color #} + (toColorSelection self) (castPtr colorPtr) peek colorPtr --- | Sets the current color. The first time this is called, it will also set the --- original color too. +-- | Sets the current color to be @color@. The first time this is called, it +-- will also set the original color to be @color@ too. -- -colorSelectionSetCurrentColor :: ColorSelectionClass obj => obj - -> Color -> IO () -colorSelectionSetCurrentColor obj color = - alloca $ \colorPtr -> do - poke colorPtr color - {#call color_selection_set_current_color#} (toColorSelection obj) +colorSelectionSetCurrentColor :: ColorSelectionClass self => self + -> Color -- ^ @color@ - A 'Color' to set the current color with. + -> IO () +colorSelectionSetCurrentColor self color = + with color $ \colorPtr -> + {# call color_selection_set_current_color #} + (toColorSelection self) (castPtr colorPtr) --- | Sets the ColorSelection widget to use or not use opacity. +-- | Determines whether the 'ColorSelection' widget has an opacity control. -- -colorSelectionGetHasOpacityControl :: ColorSelectionClass obj => obj -> IO Bool -colorSelectionGetHasOpacityControl obj = liftM toBool $ - {#call unsafe color_selection_get_has_opacity_control#} (toColorSelection obj) +colorSelectionGetHasOpacityControl :: ColorSelectionClass self => self + -> IO Bool -- ^ returns @True@ if the color selector has an opacity control. + -- @False@ if it does't. +colorSelectionGetHasOpacityControl self = + liftM toBool $ + {# call unsafe color_selection_get_has_opacity_control #} + (toColorSelection self) --- | Determines whether the ColorSelection widget has an opacity control. +-- | Sets the 'ColorSelection' widget to use or not use opacity. -- -colorSelectionSetHasOpacityControl :: ColorSelectionClass obj => obj - -> Bool -> IO () -colorSelectionSetHasOpacityControl obj hasOpacity = - {#call color_selection_set_has_opacity_control#} (toColorSelection obj) +colorSelectionSetHasOpacityControl :: ColorSelectionClass self => self + -> Bool -- ^ @hasOpacity@ - @True@ if color selector can set the opacity, + -- @False@ otherwise. + -> IO () +colorSelectionSetHasOpacityControl self hasOpacity = + {# call color_selection_set_has_opacity_control #} + (toColorSelection self) (fromBool hasOpacity) -- | Determines whether the color selector has a color palette. -- -colorSelectionGetHasPalette :: ColorSelectionClass obj => obj -> IO Bool -colorSelectionGetHasPalette obj = liftM toBool $ - {#call unsafe color_selection_get_has_palette#} (toColorSelection obj) +colorSelectionGetHasPalette :: ColorSelectionClass self => self + -> IO Bool -- ^ returns @True@ if the selector has a palette. @False@ if it + -- hasn't. +colorSelectionGetHasPalette self = + liftM toBool $ + {# call unsafe color_selection_get_has_palette #} + (toColorSelection self) -- | Sets whether to show or hide the palette. -- -colorSelectionSetHasPalette :: ColorSelectionClass obj => obj -> Bool -> IO () -colorSelectionSetHasPalette obj hasPalette = - {#call color_selection_set_has_palette#} (toColorSelection obj) +colorSelectionSetHasPalette :: ColorSelectionClass self => self + -> Bool -- ^ @hasPalette@ - @True@ if palette is to be visible, @False@ + -- otherwise. + -> IO () +colorSelectionSetHasPalette self hasPalette = + {# call color_selection_set_has_palette #} + (toColorSelection self) (fromBool hasPalette) -- | Returns the previous alpha value. -- -colorSelectionGetPreviousAlpha :: ColorSelectionClass obj => obj -> IO Int -colorSelectionGetPreviousAlpha obj = liftM fromIntegral $ - {#call unsafe color_selection_get_previous_alpha#} (toColorSelection obj) +colorSelectionGetPreviousAlpha :: ColorSelectionClass self => self + -> IO Int -- ^ returns an integer between 0 and 65535. +colorSelectionGetPreviousAlpha self = + liftM fromIntegral $ + {# call unsafe color_selection_get_previous_alpha #} + (toColorSelection self) --- | Sets the \'previous\' alpha to the given value. --- --- * This function should be called with some hesitations, as it might seem --- confusing to have that alpha change. +-- | Sets the \'previous\' alpha to be @alpha@. This function should be called +-- with some hesitations, as it might seem confusing to have that alpha change. -- -colorSelectionSetPreviousAlpha :: ColorSelectionClass obj => obj -> Int -> IO () -colorSelectionSetPreviousAlpha obj alpha = - {#call color_selection_set_previous_alpha#} (toColorSelection obj) +colorSelectionSetPreviousAlpha :: ColorSelectionClass self => self + -> Int -- ^ @alpha@ - an integer between 0 and 65535. + -> IO () +colorSelectionSetPreviousAlpha self alpha = + {# call color_selection_set_previous_alpha #} + (toColorSelection self) (fromIntegral alpha) -- | Returns the original color value. -- -colorSelectionGetPreviousColor :: ColorSelectionClass obj => obj -> IO Color -colorSelectionGetPreviousColor obj = +colorSelectionGetPreviousColor :: ColorSelectionClass self => self -> IO Color +colorSelectionGetPreviousColor self = alloca $ \colorPtr -> do - {#call unsafe color_selection_get_previous_color#} (toColorSelection obj) + {# call unsafe color_selection_get_previous_color #} + (toColorSelection self) (castPtr colorPtr) peek colorPtr --- | Sets the \'previous\' color. --- --- * This function should be called with some hesitations, as it might seem --- confusing to have that color change. --- --- * Calling 'colorSelectionSetCurrentColor' will also set this color the first +-- | Sets the \'previous\' color to be @color@. This function should be called +-- with some hesitations, as it might seem confusing to have that color change. +-- Calling 'colorSelectionSetCurrentColor' will also set this color the first -- time it is called. -- -colorSelectionSetPreviousColor :: ColorSelectionClass obj => obj - -> Color -> IO () -colorSelectionSetPreviousColor obj color = - alloca $ \colorPtr -> do - poke colorPtr color - {#call color_selection_set_previous_color#} (toColorSelection obj) +colorSelectionSetPreviousColor :: ColorSelectionClass self => self + -> Color -> IO () +colorSelectionSetPreviousColor self color = + with color $ \colorPtr -> + {# call color_selection_set_previous_color #} + (toColorSelection self) (castPtr colorPtr) -- | Gets the current state of the widget. Returns True if the user is currently -- dragging a color around, and False if the selection has stopped. -- -colorSelectionIsAdjusting :: ColorSelectionClass obj => obj -> IO Bool -colorSelectionIsAdjusting obj = liftM toBool $ - {#call unsafe color_selection_is_adjusting#} (toColorSelection obj) +colorSelectionIsAdjusting :: ColorSelectionClass self => self -> IO Bool +colorSelectionIsAdjusting self = + liftM toBool $ + {# call unsafe color_selection_is_adjusting #} + (toColorSelection self) -------------------- -- Properties @@ -220,7 +244,7 @@ -- -- Default value: @False@ -- -colorSelectionHasOpacityControl :: Attr ColorSelection Bool +colorSelectionHasOpacityControl :: ColorSelectionClass self => Attr self Bool colorSelectionHasOpacityControl = Attr colorSelectionGetHasOpacityControl colorSelectionSetHasOpacityControl @@ -229,7 +253,7 @@ -- -- Default value: @False@ -- -colorSelectionHasPalette :: Attr ColorSelection Bool +colorSelectionHasPalette :: ColorSelectionClass self => Attr self Bool colorSelectionHasPalette = Attr colorSelectionGetHasPalette colorSelectionSetHasPalette @@ -240,7 +264,7 @@ -- -- Default value: 65535 -- -colorSelectionCurrentAlpha :: Attr ColorSelection Int +colorSelectionCurrentAlpha :: ColorSelectionClass self => Attr self Int colorSelectionCurrentAlpha = Attr colorSelectionGetCurrentAlpha colorSelectionSetCurrentAlpha @@ -248,7 +272,7 @@ -- | \'previousAlpha\' property. See 'colorSelectionGetPreviousAlpha' and -- 'colorSelectionSetPreviousAlpha' -- -colorSelectionPreviousAlpha :: Attr ColorSelection Int +colorSelectionPreviousAlpha :: ColorSelectionClass self => Attr self Int colorSelectionPreviousAlpha = Attr colorSelectionGetPreviousAlpha colorSelectionSetPreviousAlpha Index: FileChooserWidget.chs.pp =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/Graphics/UI/Gtk/Selectors/FileChooserWidget.chs.pp,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- FileChooserWidget.chs.pp 25 Feb 2005 22:53:43 -0000 1.4 +++ FileChooserWidget.chs.pp 3 Apr 2005 12:56:07 -0000 1.5 @@ -24,16 +24,12 @@ -- Stability : provisional -- Portability : portable (depends on GHC) -- --- The file chooser dialog and widget is a replacement --- for the old 'FileSel'ection dialog. It provides a better user --- interface and an improved API. --- --- * This is the widget variant of the 'FileChooser' +-- File chooser widget that can be embedded in other widgets -- --- * Added in GTK+ 2.4 +-- * Module available since Gtk+ version 2.4 -- module Graphics.UI.Gtk.Selectors.FileChooserWidget ( --- * Description +-- * Detail -- -- | 'FileChooserWidget' is a widget suitable for selecting files. It is the -- main building block of a 'FileChooserDialog'. Most applications will only @@ -42,8 +38,6 @@ -- -- Note that 'FileChooserWidget' does not have any methods of its own. -- Instead, you should use the functions that work on a 'FileChooser'. --- --- * Module available since Gtk version 2.4 -- * Class Hierarchy -- | @@ -57,7 +51,6 @@ -- | +----FileChooserWidget -- @ - #if GTK_CHECK_VERSION(2,4,0) -- * Types FileChooserWidget, @@ -71,8 +64,6 @@ #endif ) where -#if GTK_CHECK_VERSION(2,4,0) - import Monad (liftM) import System.Glib.FFI @@ -82,6 +73,7 @@ {# context lib="gtk" prefix="gtk" #} +#if GTK_CHECK_VERSION(2,4,0) -------------------- -- Interfaces @@ -90,17 +82,34 @@ -------------------- -- Constructors -fileChooserWidgetNew :: FileChooserAction -> IO FileChooserWidget +-- | Creates a new 'FileChooserWidget'. This is a file chooser widget that can +-- be embedded in custom windows, and it is the same widget that is used by +-- 'FileChooserDialog'. +-- +fileChooserWidgetNew :: + FileChooserAction -- ^ @action@ - Open or save mode for the widget + -> IO FileChooserWidget fileChooserWidgetNew action = - makeNewObject mkFileChooserWidget $ liftM castPtr $ + makeNewObject mkFileChooserWidget $ + liftM (castPtr :: Ptr Widget -> Ptr FileChooserWidget) $ {# call unsafe gtk_file_chooser_widget_new #} - (fromIntegral $ fromEnum action) + ((fromIntegral . fromEnum) action) -fileChooserWidgetNewWithBackend :: FileChooserAction -> String -> IO FileChooserWidget +-- | Creates a new 'FileChooserWidget' with a specified backend. This is +-- especially useful if you use 'fileChooserSetLocalOnly' to allow non-local +-- files. This is a file chooser widget that can be embedded in custom windows +-- and it is the same widget that is used by 'FileChooserDialog'. +-- +fileChooserWidgetNewWithBackend :: + FileChooserAction -- ^ @action@ - Open or save mode for the widget + -> String -- ^ @backend@ - The name of the specific filesystem + -- backend to use. + -> IO FileChooserWidget fileChooserWidgetNewWithBackend action backend = - makeNewObject mkFileChooserWidget $ liftM castPtr $ - withCString backend $ \strPtr -> + makeNewObject mkFileChooserWidget $ + liftM (castPtr :: Ptr Widget -> Ptr FileChooserWidget) $ + withCString backend $ \backendPtr -> {# call unsafe gtk_file_chooser_widget_new_with_backend #} - (fromIntegral $ fromEnum action) strPtr - + ((fromIntegral . fromEnum) action) + backendPtr #endif |
From: Duncan C. <dun...@us...> - 2005-04-03 12:56:20
|
Update of /cvsroot/gtk2hs/gtk2hs In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18765 Modified Files: ChangeLog Log Message: Merge from generated modules. Changed code formatting and documentation. Index: ChangeLog =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/ChangeLog,v retrieving revision 1.418 retrieving revision 1.419 diff -u -d -r1.418 -r1.419 --- ChangeLog 2 Apr 2005 19:57:13 -0000 1.418 +++ ChangeLog 3 Apr 2005 12:56:06 -0000 1.419 @@ -1,3 +1,15 @@ +2005-04-3 Duncan Coutts <du...@co...> + + * gtk/Graphics/UI/Gtk/Selectors/ColorSelection.chs, + gtk/Graphics/UI/Gtk/Selectors/ColorSelectionDialog.chs, + gtk/Graphics/UI/Gtk/Selectors/FileChooser.chs.pp, + gtk/Graphics/UI/Gtk/Selectors/FileChooserDialog.chs.pp, + gtk/Graphics/UI/Gtk/Selectors/FileChooserWidget.chs.pp, + gtk/Graphics/UI/Gtk/Selectors/FileSelection.chs.pp, + gtk/Graphics/UI/Gtk/Selectors/FontSelection.chs, + gtk/Graphics/UI/Gtk/Selectors/FontSelectionDialog.chs: merge from + generated modules. Changed code formatting and documentation. + 2005-04-2 Duncan Coutts <du...@co...> * gtk/Graphics/UI/Gtk/MenuComboToolbar/CheckMenuItem.chs.pp, |
From: Duncan C. <dun...@us...> - 2005-04-02 19:57:24
|
Update of /cvsroot/gtk2hs/gtk2hs/gtk/Graphics/UI/Gtk/Scrolling In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7601/gtk/Graphics/UI/Gtk/Scrolling Modified Files: ScrolledWindow.chs Log Message: Trivial changes merged from the generated modules. Index: ScrolledWindow.chs =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/Graphics/UI/Gtk/Scrolling/ScrolledWindow.chs,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- ScrolledWindow.chs 24 Mar 2005 15:16:18 -0000 1.6 +++ ScrolledWindow.chs 2 Apr 2005 19:57:13 -0000 1.7 @@ -133,11 +133,8 @@ makeNewObject mkScrolledWindow $ liftM (castPtr :: Ptr Widget -> Ptr ScrolledWindow) $ {# call unsafe scrolled_window_new #} - (fromMAdj hadjustment) - (fromMAdj vadjustment) - where - fromMAdj :: Maybe Adjustment -> Adjustment - fromMAdj = fromMaybe $ mkAdjustment nullForeignPtr + (fromMaybe (Adjustment nullForeignPtr) hadjustment) + (fromMaybe (Adjustment nullForeignPtr) vadjustment) -------------------- -- Methods @@ -145,8 +142,7 @@ -- | Returns the horizontal scrollbar's adjustment, used to connect the -- horizontal scrollbar to the child widget's horizontal scroll functionality. -- -scrolledWindowGetHAdjustment :: ScrolledWindowClass self => self - -> IO Adjustment +scrolledWindowGetHAdjustment :: ScrolledWindowClass self => self -> IO Adjustment scrolledWindowGetHAdjustment self = makeNewObject mkAdjustment $ {# call unsafe scrolled_window_get_hadjustment #} @@ -155,8 +151,7 @@ -- | Returns the vertical scrollbar's adjustment, used to connect the vertical -- scrollbar to the child widget's vertical scroll functionality. -- -scrolledWindowGetVAdjustment :: ScrolledWindowClass self => self - -> IO Adjustment +scrolledWindowGetVAdjustment :: ScrolledWindowClass self => self -> IO Adjustment scrolledWindowGetVAdjustment self = makeNewObject mkAdjustment $ {# call unsafe scrolled_window_get_vadjustment #} @@ -232,8 +227,7 @@ -- | Gets the placement of the scrollbars for the scrolled window. See -- 'scrolledWindowSetPlacement'. -- -scrolledWindowGetPlacement :: ScrolledWindowClass self => self - -> IO CornerType +scrolledWindowGetPlacement :: ScrolledWindowClass self => self -> IO CornerType scrolledWindowGetPlacement self = liftM (toEnum . fromIntegral) $ {# call unsafe scrolled_window_get_placement #} @@ -241,9 +235,7 @@ -- | Changes the type of shadow drawn around the contents of @scrolledWindow@. -- -scrolledWindowSetShadowType :: ScrolledWindowClass self => self - -> ShadowType - -> IO () +scrolledWindowSetShadowType :: ScrolledWindowClass self => self -> ShadowType -> IO () scrolledWindowSetShadowType self type_ = {# call scrolled_window_set_shadow_type #} (toScrolledWindow self) @@ -252,8 +244,7 @@ -- | Gets the shadow type of the scrolled window. See -- 'scrolledWindowSetShadowType'. -- -scrolledWindowGetShadowType :: ScrolledWindowClass self => self - -> IO ShadowType +scrolledWindowGetShadowType :: ScrolledWindowClass self => self -> IO ShadowType scrolledWindowGetShadowType self = liftM (toEnum . fromIntegral) $ {# call unsafe scrolled_window_get_shadow_type #} @@ -261,9 +252,7 @@ -- | Sets the 'Adjustment' for the horizontal scrollbar. -- -scrolledWindowSetHAdjustment :: ScrolledWindowClass self => self - -> Adjustment - -> IO () +scrolledWindowSetHAdjustment :: ScrolledWindowClass self => self -> Adjustment -> IO () scrolledWindowSetHAdjustment self hadjustment = {# call scrolled_window_set_hadjustment #} (toScrolledWindow self) @@ -271,9 +260,7 @@ -- | Sets the 'Adjustment' for the vertical scrollbar. -- -scrolledWindowSetVAdjustment :: ScrolledWindowClass self => self - -> Adjustment - -> IO () +scrolledWindowSetVAdjustment :: ScrolledWindowClass self => self -> Adjustment -> IO () scrolledWindowSetVAdjustment self vadjustment = {# call scrolled_window_set_vadjustment #} (toScrolledWindow self) |
From: Duncan C. <dun...@us...> - 2005-04-02 19:57:24
|
Update of /cvsroot/gtk2hs/gtk2hs In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7601 Modified Files: ChangeLog Log Message: Trivial changes merged from the generated modules. Index: ChangeLog =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/ChangeLog,v retrieving revision 1.417 retrieving revision 1.418 diff -u -d -r1.417 -r1.418 --- ChangeLog 2 Apr 2005 19:51:43 -0000 1.417 +++ ChangeLog 2 Apr 2005 19:57:13 -0000 1.418 @@ -65,6 +65,9 @@ gtk/Graphics/UI/Gtk/Layout/Notebook.chs.pp: trivial changes merged from the generated modules. + * gtk/Graphics/UI/Gtk/Scrolling/ScrolledWindow.chs: trivial changes + merged from the generated modules. + 2005-04-1 Duncan Coutts <du...@co...> * tools/apiGen/ModuleScan.hs, tools/apiGen/ApiGen.hs, |
From: Duncan C. <dun...@us...> - 2005-04-02 19:51:55
|
Update of /cvsroot/gtk2hs/gtk2hs/gtk/Graphics/UI/Gtk/Layout In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3801/gtk/Graphics/UI/Gtk/Layout Modified Files: Alignment.chs.pp Expander.chs.pp Notebook.chs.pp Log Message: Trivial changes merged from the generated modules. Index: Expander.chs.pp =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/Graphics/UI/Gtk/Layout/Expander.chs.pp,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- Expander.chs.pp 24 Mar 2005 17:30:59 -0000 1.6 +++ Expander.chs.pp 2 Apr 2005 19:51:44 -0000 1.7 @@ -102,7 +102,7 @@ -------------------- -- Constructors --- | Creates a new expander using @label@ as the text of the label. +-- | Creates a new expander using the given string as the text of the label. -- expanderNew :: String -> IO Expander expanderNew label = @@ -157,8 +157,7 @@ -- | Sets the spacing field of @expander@, which is the number of pixels to -- place between expander and the child. -- -expanderSetSpacing :: Expander -> Int - -> IO () +expanderSetSpacing :: Expander -> Int -> IO () expanderSetSpacing self spacing = {# call gtk_expander_set_spacing #} self Index: Alignment.chs.pp =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/Graphics/UI/Gtk/Layout/Alignment.chs.pp,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- Alignment.chs.pp 24 Mar 2005 17:30:59 -0000 1.4 +++ Alignment.chs.pp 2 Apr 2005 19:51:44 -0000 1.5 @@ -164,20 +164,20 @@ -- paddingRight)@ - the padding at the top, -- bottom, left and right of the widget. alignmentGetPadding self = - alloca $ \topPtr -> - alloca $ \bottomPtr -> - alloca $ \leftPtr -> - alloca $ \rightPtr -> do + alloca $ \paddingTopPtr -> + alloca $ \paddingBottomPtr -> + alloca $ \paddingLeftPtr -> + alloca $ \paddingRightPtr -> do {# call gtk_alignment_get_padding #} (toAlignment self) - topPtr - bottomPtr - leftPtr - rightPtr - top <- peek topPtr - bottom <- peek bottomPtr - left <- peek leftPtr - right <- peek rightPtr - return (fromIntegral top, fromIntegral bottom - ,fromIntegral left, fromIntegral right) + paddingTopPtr + paddingBottomPtr + paddingLeftPtr + paddingRightPtr + paddingTop <- peek paddingTopPtr + paddingBottom <- peek paddingBottomPtr + paddingLeft <- peek paddingLeftPtr + paddingRight <- peek paddingRightPtr + return (fromIntegral paddingTop, fromIntegral paddingBottom + ,fromIntegral paddingLeft, fromIntegral paddingRight) #endif Index: Notebook.chs.pp =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/Graphics/UI/Gtk/Layout/Notebook.chs.pp,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- Notebook.chs.pp 24 Mar 2005 17:31:00 -0000 1.5 +++ Notebook.chs.pp 2 Apr 2005 19:51:44 -0000 1.6 @@ -805,7 +805,7 @@ (toWidget child) (fromBool $ pack/=PackNatural) (fromBool $ pack==PackGrow) - ((fromIntegral.fromEnum) packType) + ((fromIntegral . fromEnum) packType) #ifndef DISABLE_DEPRECATED -- | Sets whether the tabs must have all the same size or not. |
From: Duncan C. <dun...@us...> - 2005-04-02 19:51:52
|
Update of /cvsroot/gtk2hs/gtk2hs In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3801 Modified Files: ChangeLog Log Message: Trivial changes merged from the generated modules. Index: ChangeLog =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/ChangeLog,v retrieving revision 1.416 retrieving revision 1.417 diff -u -d -r1.416 -r1.417 --- ChangeLog 2 Apr 2005 19:38:28 -0000 1.416 +++ ChangeLog 2 Apr 2005 19:51:43 -0000 1.417 @@ -58,7 +58,12 @@ gtk/Graphics/UI/Gtk/Display/Label.chs, gtk/Graphics/UI/Gtk/Display/ProgressBar.chs, gtk/Graphics/UI/Gtk/Display/Statusbar.chs: various minor changes - merged from the generated module. + merged from the generated modules. + + * gtk/Graphics/UI/Gtk/Layout/Alignment.chs.pp, + gtk/Graphics/UI/Gtk/Layout/Expander.chs.pp, + gtk/Graphics/UI/Gtk/Layout/Notebook.chs.pp: trivial changes merged + from the generated modules. 2005-04-1 Duncan Coutts <du...@co...> |
From: Duncan C. <dun...@us...> - 2005-04-02 19:38:38
|
Update of /cvsroot/gtk2hs/gtk2hs In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28534 Modified Files: ChangeLog Log Message: Various minor changes merged from the generated module. Index: ChangeLog =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/ChangeLog,v retrieving revision 1.415 retrieving revision 1.416 diff -u -d -r1.415 -r1.416 --- ChangeLog 2 Apr 2005 19:22:02 -0000 1.415 +++ ChangeLog 2 Apr 2005 19:38:28 -0000 1.416 @@ -53,6 +53,13 @@ gtk/Graphics/UI/Gtk/Entry/SpinButton.chs, gtk/Graphics/UI/Gtk/Entry/VScale.chs: various minor changes. + * gtk/Graphics/UI/Gtk/Display/AccelLabel.chs, + gtk/Graphics/UI/Gtk/Display/Image.chs.pp, + gtk/Graphics/UI/Gtk/Display/Label.chs, + gtk/Graphics/UI/Gtk/Display/ProgressBar.chs, + gtk/Graphics/UI/Gtk/Display/Statusbar.chs: various minor changes + merged from the generated module. + 2005-04-1 Duncan Coutts <du...@co...> * tools/apiGen/ModuleScan.hs, tools/apiGen/ApiGen.hs, |
From: Duncan C. <dun...@us...> - 2005-04-02 19:38:38
|
Update of /cvsroot/gtk2hs/gtk2hs/gtk/Graphics/UI/Gtk/Display In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28534/gtk/Graphics/UI/Gtk/Display Modified Files: AccelLabel.chs Image.chs.pp Label.chs ProgressBar.chs Statusbar.chs Log Message: Various minor changes merged from the generated module. Index: Image.chs.pp =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/Graphics/UI/Gtk/Display/Image.chs.pp,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- Image.chs.pp 15 Mar 2005 19:59:09 -0000 1.5 +++ Image.chs.pp 2 Apr 2005 19:38:29 -0000 1.6 @@ -141,7 +141,8 @@ -- imageNewFromFile :: FilePath -> IO Image imageNewFromFile filename = - makeNewObject mkImage $ liftM castPtr $ + makeNewObject mkImage $ + liftM (castPtr :: Ptr Widget -> Ptr Image) $ withUTFString filename $ \filenamePtr -> #if defined (WIN32) && GTK_CHECK_VERSION(2,6,0) {# call unsafe gtk_image_new_from_file_utf8 #} @@ -158,7 +159,8 @@ -- imageNewFromPixbuf :: Pixbuf -> IO Image imageNewFromPixbuf pixbuf = - makeNewObject mkImage $ liftM castPtr $ + makeNewObject mkImage $ + liftM (castPtr :: Ptr Widget -> Ptr Image) $ {# call unsafe image_new_from_pixbuf #} pixbuf @@ -170,7 +172,8 @@ -> IconSize -- ^ @size@ - a stock icon size -> IO Image imageNewFromStock stockId size = - makeNewObject mkImage $ liftM castPtr $ + makeNewObject mkImage $ + liftM (castPtr :: Ptr Widget -> Ptr Image) $ withUTFString stockId $ \stockIdPtr -> {# call unsafe image_new_from_stock #} stockIdPtr Index: ProgressBar.chs =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/Graphics/UI/Gtk/Display/ProgressBar.chs,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- ProgressBar.chs 15 Mar 2005 19:59:10 -0000 1.6 +++ ProgressBar.chs 2 Apr 2005 19:38:29 -0000 1.7 @@ -107,7 +107,8 @@ -- progressBarNew :: IO ProgressBar progressBarNew = - makeNewObject mkProgressBar $ liftM castPtr $ + makeNewObject mkProgressBar $ + liftM (castPtr :: Ptr Widget -> Ptr ProgressBar) $ {# call unsafe progress_bar_new #} -------------------- @@ -186,9 +187,7 @@ -- | Causes the progress bar to switch to a different orientation -- (left-to-right, right-to-left, top-to-bottom, or bottom-to-top). -- -progressBarSetOrientation :: ProgressBarClass self => self - -> ProgressBarOrientation - -> IO () +progressBarSetOrientation :: ProgressBarClass self => self -> ProgressBarOrientation -> IO () progressBarSetOrientation self orientation = {# call progress_bar_set_orientation #} (toProgressBar self) @@ -196,8 +195,7 @@ -- | Retrieves the current progress bar orientation. -- -progressBarGetOrientation :: ProgressBarClass self => self - -> IO ProgressBarOrientation +progressBarGetOrientation :: ProgressBarClass self => self -> IO ProgressBarOrientation progressBarGetOrientation self = liftM (toEnum . fromIntegral) $ {# call unsafe progress_bar_get_orientation #} @@ -210,7 +208,7 @@ -- -- Default value: 'ProgressLeftToRight' -- -progressBarOrientation :: Attr ProgressBar ProgressBarOrientation +progressBarOrientation :: ProgressBarClass self => Attr self ProgressBarOrientation progressBarOrientation = Attr progressBarGetOrientation progressBarSetOrientation @@ -221,7 +219,7 @@ -- -- Default value: 0 -- -progressBarFraction :: Attr ProgressBar Double +progressBarFraction :: ProgressBarClass self => Attr self Double progressBarFraction = Attr progressBarGetFraction progressBarSetFraction @@ -232,7 +230,7 @@ -- -- Default value: 0.1 -- -progressBarPulseStep :: Attr ProgressBar Double +progressBarPulseStep :: ProgressBarClass self => Attr self Double progressBarPulseStep = Attr progressBarGetPulseStep progressBarSetPulseStep Index: Statusbar.chs =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/Graphics/UI/Gtk/Display/Statusbar.chs,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- Statusbar.chs 15 Mar 2005 19:59:10 -0000 1.4 +++ Statusbar.chs 2 Apr 2005 19:38:29 -0000 1.5 @@ -83,6 +83,9 @@ statusbarSetHasResizeGrip, statusbarGetHasResizeGrip, +-- * Properties + statusbarHasResizeGrip, + -- * Signals onTextPopped, afterTextPopped, @@ -94,6 +97,7 @@ import System.Glib.FFI import System.Glib.UTFString +import System.Glib.Attributes (Attr(..)) import Graphics.UI.Gtk.Abstract.Object (makeNewObject) {#import Graphics.UI.Gtk.Types#} {#import Graphics.UI.Gtk.Signals#} @@ -107,7 +111,8 @@ -- statusbarNew :: IO Statusbar statusbarNew = - makeNewObject mkStatusbar $ liftM castPtr $ + makeNewObject mkStatusbar $ + liftM (castPtr :: Ptr Widget -> Ptr Statusbar) $ {# call unsafe statusbar_new #} -------------------- @@ -189,6 +194,18 @@ (toStatusbar self) -------------------- +-- Properties + +-- | Whether the statusbar has a grip for resizing the toplevel window. +-- +-- Default value: @True@ +-- +statusbarHasResizeGrip :: StatusbarClass self => Attr self Bool +statusbarHasResizeGrip = Attr + statusbarGetHasResizeGrip + statusbarSetHasResizeGrip + +-------------------- -- Signals -- | Called if a message is removed. @@ -196,8 +213,8 @@ onTextPopped, afterTextPopped :: StatusbarClass self => self -> (ContextId -> String -> IO ()) -> IO (ConnectId self) -onTextPopped = connect_WORD_STRING__NONE "text-popped" False -afterTextPopped = connect_WORD_STRING__NONE "text-popped" True +onTextPopped self user = connect_WORD_STRING__NONE "text-popped" False self (user . fromIntegral) +afterTextPopped self user = connect_WORD_STRING__NONE "text-popped" True self (user . fromIntegral) -- | Called if a message is pushed on top of the -- stack. @@ -205,5 +222,5 @@ onTextPushed, afterTextPushed :: StatusbarClass self => self -> (ContextId -> String -> IO ()) -> IO (ConnectId self) -onTextPushed = connect_WORD_STRING__NONE "text-pushed" False -afterTextPushed = connect_WORD_STRING__NONE "text-pushed" True +onTextPushed self user = connect_WORD_STRING__NONE "text-pushed" False self (user . fromIntegral) +afterTextPushed self user = connect_WORD_STRING__NONE "text-pushed" True self (user . fromIntegral) Index: AccelLabel.chs =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/Graphics/UI/Gtk/Display/AccelLabel.chs,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- AccelLabel.chs 15 Mar 2005 19:59:09 -0000 1.4 +++ AccelLabel.chs 2 Apr 2005 19:38:29 -0000 1.5 @@ -92,9 +92,12 @@ -- | Creates a new 'AccelLabel'. -- -accelLabelNew :: String -> IO AccelLabel +accelLabelNew :: + String -- ^ @string@ - the label string. + -> IO AccelLabel accelLabelNew string = - makeNewObject mkAccelLabel $ liftM castPtr $ + makeNewObject mkAccelLabel $ + liftM (castPtr :: Ptr Widget -> Ptr AccelLabel) $ withUTFString string $ \stringPtr -> {# call unsafe accel_label_new #} stringPtr Index: Label.chs =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/Graphics/UI/Gtk/Display/Label.chs,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- Label.chs 15 Mar 2005 19:59:09 -0000 1.6 +++ Label.chs 2 Apr 2005 19:38:29 -0000 1.7 @@ -180,14 +180,15 @@ -- labelNew :: Maybe String -> IO Label labelNew str = - makeNewObject mkLabel $ liftM castPtr $ + makeNewObject mkLabel $ + liftM (castPtr :: Ptr Widget -> Ptr Label) $ maybeWith withUTFString str $ \strPtr -> {# call label_new #} strPtr --- | Creates a new 'Label', containing the given text. +-- | Creates a new 'Label', containing the text in @str@. -- --- If characters in @text@ are preceded by an underscore, they are +-- If characters in @str@ are preceded by an underscore, they are -- underlined. If you need a literal underscore character in a label, use -- \'__\' (two underscores). The first underlined character represents a -- keyboard accelerator called a mnemonic. The mnemonic key can be used to @@ -200,11 +201,12 @@ -- automatically become the mnemonic widget and be activated by the mnemonic. -- labelNewWithMnemonic :: - String -- ^ @text@ - The text of the label, with an underscore in front + String -- ^ @str@ - The text of the label, with an underscore in front -- of the mnemonic character -> IO Label labelNewWithMnemonic str = - makeNewObject mkLabel $ liftM castPtr $ + makeNewObject mkLabel $ + liftM (castPtr :: Ptr Widget -> Ptr Label) $ withUTFString str $ \strPtr -> {# call label_new_with_mnemonic #} strPtr @@ -343,7 +345,7 @@ -- receive the events, and pack the label inside it, since labels are a -- \'NoWindow\' widget. -- -labelGetLayoutOffsets :: LabelClass self => self -> IO (Int,Int) +labelGetLayoutOffsets :: LabelClass self => self -> IO (Int, Int) labelGetLayoutOffsets self = alloca $ \xPtr -> alloca $ \yPtr -> do @@ -353,7 +355,7 @@ yPtr x <- peek xPtr y <- peek yPtr - return (fromIntegral x,fromIntegral y) + return (fromIntegral x, fromIntegral y) -- | KeyVal is a synonym for a hot key number. -- @@ -536,7 +538,7 @@ -- -- Default value: @False@ -- -labelUseMarkup :: Attr Label Bool +labelUseMarkup :: LabelClass self => Attr self Bool labelUseMarkup = Attr labelGetUseMarkup labelSetUseMarkup @@ -546,7 +548,7 @@ -- -- Default value: @False@ -- -labelUseUnderline :: Attr Label Bool +labelUseUnderline :: LabelClass self => Attr self Bool labelUseUnderline = Attr labelGetUseUnderline labelSetUseUnderline @@ -557,7 +559,7 @@ -- -- Default value: 'JustifyLeft' -- -labelJustify :: Attr Label Justification +labelJustify :: LabelClass self => Attr self Justification labelJustify = Attr labelGetJustify labelSetJustify @@ -566,14 +568,14 @@ -- -- Default value: @False@ -- -labelSelectable :: Attr Label Bool +labelSelectable :: LabelClass self => Attr self Bool labelSelectable = Attr labelGetSelectable labelSetSelectable -- | \'lineWrap\' property. See 'labelGetLineWrap' and 'labelSetLineWrap' -- -labelLineWrap :: Attr Label Bool +labelLineWrap :: LabelClass self => Attr self Bool labelLineWrap = Attr labelGetLineWrap labelSetLineWrap |