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...@wo...> - 2007-08-30 12:43:47
|
Thu Aug 30 05:44:27 PDT 2007 Duncan Coutts <du...@ha...> * Update Graphics.SOE.Gtk to new api and fix many bugs hunk ./soegtk/Graphics/SOE/Gtk.hs.pp 2 --- SOE implementation based on Gtk and cairo or Gdk. +-- SOE implementation based on Gtk and cairo (or Gdk). +-- Some code borrowed from SOE implementation based on OpenGL and GLFW by +-- Paul Liu, http://www.haskell.org/soe/ hunk ./soegtk/Graphics/SOE/Gtk.hs.pp 10 --- Copyright (C) 2005 Duncan Coutts +-- Copyright (C) 2005-2007 Duncan Coutts +-- Copyright (C) 2007 Paul Liu hunk ./soegtk/Graphics/SOE/Gtk.hs.pp 82 - getWindowTick, hunk ./soegtk/Graphics/SOE/Gtk.hs.pp 87 -#define USE_CAIRO +define USE_CAIRO hunk ./soegtk/Graphics/SOE/Gtk.hs.pp 90 +import Data.List (foldl') hunk ./soegtk/Graphics/SOE/Gtk.hs.pp 109 +------------------- +-- Window Functions +------------------- + hunk ./soegtk/Graphics/SOE/Gtk.hs.pp 140 - eventsChan :: Chan Event, - timerVar :: MVar [MVar ()] + eventsChan :: Chan Event hunk ./soegtk/Graphics/SOE/Gtk.hs.pp 145 - openWindowEx title Nothing (Just size) drawBufferedGraphic Nothing + openWindowEx title Nothing (Just size) drawBufferedGraphic hunk ./soegtk/Graphics/SOE/Gtk.hs.pp 147 -openWindowEx :: - Title - -> Maybe Point - -> Maybe Size - -> RedrawMode - -> Maybe Word32 - -> IO Window -openWindowEx title position size (RedrawMode useDoubleBuffer) timer = +openWindowEx :: Title -> Maybe Point -> Maybe Size -> RedrawMode -> IO Window +openWindowEx title position size (RedrawMode useDoubleBuffer) = hunk ./soegtk/Graphics/SOE/Gtk.hs.pp 167 - [_$_] + hunk ./soegtk/Graphics/SOE/Gtk.hs.pp 170 - timerVar <- newMVar [] hunk ./soegtk/Graphics/SOE/Gtk.hs.pp 198 - Cairo.setLineWidth 1 + Cairo.setLineWidth 1.5 hunk ./soegtk/Graphics/SOE/Gtk.hs.pp 246 - [_$_] - case timer of - Nothing -> return () - Just delay -> do - let tick = do - ps <- takeMVar timerVar - mapM_ (\p -> putMVar p ()) ps - putMVar timerVar [] - return True - Gtk.timeoutAddFull tick Gtk.priorityDefaultIdle (fromIntegral delay) - return () hunk ./soegtk/Graphics/SOE/Gtk.hs.pp 251 - eventsChan = eventsChan, - timerVar = timerVar + eventsChan = eventsChan hunk ./soegtk/Graphics/SOE/Gtk.hs.pp 276 +-------------------- +-- Drawing Functions +-------------------- + hunk ./soegtk/Graphics/SOE/Gtk.hs.pp 298 -type Angle = Double +type Angle = Float hunk ./soegtk/Graphics/SOE/Gtk.hs.pp 382 -polygon (p@(x,y):ps) = Graphic $ \pc -> do +polygon ((x,y):ps) = Graphic $ \pc -> do hunk ./soegtk/Graphics/SOE/Gtk.hs.pp 390 -polyline (p@(x,y):ps) = Graphic $ \pc -> do +polyline ((x,y):ps) = Graphic $ \pc -> do hunk ./soegtk/Graphics/SOE/Gtk.hs.pp 401 - Cairo.curveTo (fromIntegral x1) (fromIntegral y2) + Cairo.curveTo (fromIntegral x1) (fromIntegral y1) hunk ./soegtk/Graphics/SOE/Gtk.hs.pp 410 -arc pt1 pt2 start extent = Graphic $ \pc -> case normaliseBounds pt1 pt2 of +arc pt1 pt2 start_ extent_ = Graphic $ \pc -> case normaliseBounds pt1 pt2 of hunk ./soegtk/Graphics/SOE/Gtk.hs.pp 420 + where start = realToFrac start_ + extent = realToFrac extent_ + +------------------- +-- Region Functions +------------------- hunk ./soegtk/Graphics/SOE/Gtk.hs.pp 435 +instance Show Region where show (Region _ x y w h) = show (x,y,w,h) + hunk ./soegtk/Graphics/SOE/Gtk.hs.pp 441 --- Cairo.liftIO $ print ("createRectangle",x,y,width,height) hunk ./soegtk/Graphics/SOE/Gtk.hs.pp 448 - let (x,y,width,height) = normaliseBounds' pt1 pt2 + let (x0,y0,width,height) = normaliseBounds' pt1 pt2 hunk ./soegtk/Graphics/SOE/Gtk.hs.pp 452 - Cairo.translate (fromIntegral x + fromIntegral width / 2) - (fromIntegral y + fromIntegral height / 2) + Cairo.translate (fromIntegral (x) + fromIntegral width / 2) + (fromIntegral (y) + fromIntegral height / 2) hunk ./soegtk/Graphics/SOE/Gtk.hs.pp 458 - in Region drawing x y width height + in Region drawing x0 y0 width height hunk ./soegtk/Graphics/SOE/Gtk.hs.pp 462 -createPolygon (p@(x,y):ps) = - let minMax (x,y) (minx,maxx,miny,maxy) = +createPolygon (p@(x0,y0):ps) = + let minMax (minx,maxx,miny,maxy) (x,y) = hunk ./soegtk/Graphics/SOE/Gtk.hs.pp 470 - (minx,maxx,miny,maxy) = foldr minMax (x,x,y,y) ps [_$_] + (minx,maxx,miny,maxy) = foldl' minMax (x0,x0,y0,y0) (p:ps) hunk ./soegtk/Graphics/SOE/Gtk.hs.pp 472 - Cairo.moveTo (fromIntegral x) (fromIntegral y) + Cairo.save + Cairo.translate (fromIntegral (x-minx)) (fromIntegral (y-miny)) + Cairo.moveTo (fromIntegral x0) (fromIntegral y0) hunk ./soegtk/Graphics/SOE/Gtk.hs.pp 478 + Cairo.restore hunk ./soegtk/Graphics/SOE/Gtk.hs.pp 503 --- Cairo.liftIO $ print ("combineRegion",x,y,width,height) hunk ./soegtk/Graphics/SOE/Gtk.hs.pp 512 --- Cairo.liftIO $ print ("mask surface",x,y) hunk ./soegtk/Graphics/SOE/Gtk.hs.pp 678 +--------------------------- +-- Event Handling Functions +--------------------------- + hunk ./soegtk/Graphics/SOE/Gtk.hs.pp 717 - if noEvents then return Nothing + if noEvents then -- Sync with the main GUI loop or we can end up spinning on + -- maybeGetWindowEvent and prevent the screen redrawing. + -- We also introduce a very short delay here of 5ms. This + -- prevents the program from using 100% cpu and redrawing + -- constantly. This actually makes animation much smoother + -- since the process gets treated as interactive rather than + -- as a CPU hog so the scheduler gives us the benefit on + -- latency. Even with a 5ms delay here we can animate at up + -- to 200fps. + do syncVar <- newEmptyMVar + Gtk.timeoutAddFull (putMVar syncVar () >> return False) + Gtk.priorityDefaultIdle 10 + takeMVar syncVar + return Nothing hunk ./soegtk/Graphics/SOE/Gtk.hs.pp 747 + Closed -> return '\x0' hunk ./soegtk/Graphics/SOE/Gtk.hs.pp 751 -getKey win = getKeyEx win True >> getKeyEx win False +getKey win = do + ch <- getKeyEx win True + if ch == '\x0' then return ch + else getKeyEx win False hunk ./soegtk/Graphics/SOE/Gtk.hs.pp 770 -getWindowTick :: Window -> IO () -getWindowTick win = do - ps <- takeMVar (timerVar win) - p <- newEmptyMVar - putMVar (timerVar win) (p:ps) - takeMVar p --block until the timer fills this MVar - |
From: Duncan C. <dun...@wo...> - 2007-08-29 02:02:21
|
Tue Aug 28 19:01:53 PDT 2007 Duncan Coutts <du...@ha...> * Fill in the GObjectClass methods for the ListStore and TreeStore We still seem to be getting some iter stamp errors :-( hunk ./gtk/Graphics/UI/Gtk/ModelView/CustomStore.chs 79 -instance GObjectClass (CustomTreeModel private row) hunk ./gtk/Graphics/UI/Gtk/ModelView/CustomStore.chs 80 +instance GObjectClass (CustomTreeModel private row) where + toGObject (CustomTreeModel tm) = mkGObject (castForeignPtr tm) + unsafeCastGObject = CustomTreeModel . castForeignPtr . unGObject hunk ./gtk/Graphics/UI/Gtk/ModelView/ListStore.hs.pp 59 -import Graphics.UI.Gtk.Types (GObjectClass, TreeModelClass) +import Graphics.UI.Gtk.Types (GObjectClass(..), TreeModelClass) hunk ./gtk/Graphics/UI/Gtk/ModelView/ListStore.hs.pp 66 -instance GObjectClass (ListStore a) -instance TreeModelClass (ListStore a) hunk ./gtk/Graphics/UI/Gtk/ModelView/ListStore.hs.pp 67 +instance TreeModelClass (ListStore a) +instance GObjectClass (ListStore a) where + toGObject (ListStore tm) = toGObject tm + unsafeCastGObject = ListStore . unsafeCastGObject hunk ./gtk/Graphics/UI/Gtk/ModelView/TreeStore.hs 57 -import Graphics.UI.Gtk.Types (GObjectClass, TreeModelClass) +import Graphics.UI.Gtk.Types (GObjectClass(..), TreeModelClass) hunk ./gtk/Graphics/UI/Gtk/ModelView/TreeStore.hs 69 -instance GObjectClass (TreeStore a) -instance TreeModelClass (TreeStore a) hunk ./gtk/Graphics/UI/Gtk/ModelView/TreeStore.hs 70 +instance TreeModelClass (TreeStore a) +instance GObjectClass (TreeStore a) where + toGObject (TreeStore tm) = toGObject tm + unsafeCastGObject = TreeStore . unsafeCastGObject |
From: Duncan C. <dun...@wo...> - 2007-08-26 23:29:44
|
Mon Aug 20 08:17:05 PDT 2007 Alex Tarkovsky <ale...@gm...> * Update Glade tutorial to focus on Glade 3 addfile ./docs/tutorial/glade/entry.png addfile ./docs/tutorial/glade/hbox.png binary ./docs/tutorial/glade/horizontal.png rmfile ./docs/tutorial/glade/horizontal.png addfile ./docs/tutorial/glade/label.png binary ./docs/tutorial/glade/labeltext.png rmfile ./docs/tutorial/glade/labeltext.png addfile ./docs/tutorial/glade/screen1_small.png addfile ./docs/tutorial/glade/screen2_small.png addfile ./docs/tutorial/glade/screen3_small.png addfile ./docs/tutorial/glade/screen4.png binary ./docs/tutorial/glade/screen6.png rmfile ./docs/tutorial/glade/screen6.png binary ./docs/tutorial/glade/widget.png rmfile ./docs/tutorial/glade/widget.png binary ./docs/tutorial/glade/button.png binary ./docs/tutorial/glade/entry.png binary ./docs/tutorial/glade/hbox.png hunk ./docs/tutorial/glade/index.t2t 2 -Hans van Thiel hunk ./docs/tutorial/glade/index.t2t 10 -This tutorial will attempt to provide a step by step guide for developers -wanting to write Gtk+ apps using Glade. We assume you are using Linux, but -because the Gtk+ toolkit, the Glade Interface Designer and Gtk2Hs are available -on other platforms too, this might also help you get started there. +This tutorial will attempt to provide a step by step guide for Haskell +developers wanting to write Gtk+ apps using Glade. We assume you are using +Linux, but because the Gtk+ toolkit, the Glade Interface Designer and Gtk2Hs +bindings are available on other platforms too, this might also help you get +started there. hunk ./docs/tutorial/glade/index.t2t 23 -- [Glade http://glade.gnome.org/] version 2 or 3 +- [Glade http://glade.gnome.org/] version 3 (or version 2, but beware of minor + differences) hunk ./docs/tutorial/glade/index.t2t 29 -You will be creating a modified "Hello World!" application like this: +You will be creating a "Hello World"-style application like this: hunk ./docs/tutorial/glade/index.t2t 41 -Start up glade. You should see the following three windows: +Start up Glade. It will open with a new untitled project. You should see the +following (click on screenshots to see full size): hunk ./docs/tutorial/glade/index.t2t 44 -[screen1.png] +[[screen1_small.png] screen1.png] hunk ./docs/tutorial/glade/index.t2t 46 -The first window controls your project. The palette allows you to add widgets -to your application, while the properties window will allow a selected widget's +The palette on the left allows you to add widgets to your application, while +the properties pane on the lower right will allow a selected widget's hunk ./docs/tutorial/glade/index.t2t 50 -Open a new project. The first thing we're going to need is a place to add -widgets, so lets first create a window by clicking on the window icon from the -palette. +The first thing we're going to need is a place to add widgets, so let's create +a window by clicking on the //Window// icon from the palette. hunk ./docs/tutorial/glade/index.t2t 53 -[window.png] Window palette icon. +[window.png] //Window palette icon// hunk ./docs/tutorial/glade/index.t2t 55 -A new window will pop-up ready to be modified. Notice the properties for the -window, particularly that the name of the window is ``"window1"``. Lets modify -the title of this window which is displayed in the title bar to something a -little more descriptive. Simply change ``"window1"`` in the Widget tab -from the Properties window to something like ``"My First Gtk+ App"``. +A new Window widget will appear on the canvas ready to be modified. Notice the +properties (under the //General// tab) for the window, particularly that its +name is ``window1``. Let's assign a descriptive title which will be displayed +in the window's title bar at run time. In the Window Title property field type +``Hello Gtk2Hs``. hunk ./docs/tutorial/glade/index.t2t 61 -OK, so the window is all set up, now to add some buttons and labels.... but -wait! We can't just add widgets just yet... Widgets in Gtk+ apps are -//packed//. Packing widgets may seem to be a burden at first but is actually an -ingenious method to allow many nifty things, the most immediate being automatic -resizing. When a user resizes an app we usually would like the widgets in the -window to be resized to take advantage of a bigger space or to shrink to fit in -a newly sized window. Packing allows this to be done automatically and greatly -frees the developer from writing resizing code. Packing is done by creating -//boxes// or //tables//. These widgets are invisible, meaning they can't be -seen at run time however they have a direct effect on the application. +OK, so the window is all set up, now to add some buttons and labels... but +wait! We can't add widgets just yet. Widgets in Gtk+ apps are //packed//. +Packing widgets may seem to be a burden at first but is actually an ingenious +method to allow many nifty things, the most immediate being automatic resizing. +When a user resizes an app we usually would like the widgets in the window to +be resized to take advantage of a bigger space or shrink. Packing allows this +to be done automatically and greatly frees the developer from writing resizing +code. Packing is done by creating //boxes// or //tables//. These widgets are +invisible, meaning they can't be seen at run time, however they have a direct +effect on the application. hunk ./docs/tutorial/glade/index.t2t 73 -up the window into three rows: the label at the top, the text entry in the -middle and the two buttons at the bottom. So what we'll do is create a -//Vertical Box// with three rows. Click the Vertical Box icon in the palette -and then click anywhere in the window we just created. +up the window into three rows: the label at the top, the text entry field in +the middle and the two buttons at the bottom. So what we'll do is create a +VBox widget with three rows. Click the //Vertical Box// icon in the palette and +then click anywhere in the window we just created. hunk ./docs/tutorial/glade/index.t2t 78 -[vbox.png] Vertical Box palette icon. +[vbox.png] //VBox palette icon// hunk ./docs/tutorial/glade/index.t2t 80 -Specify that you want three rows created and click OK. The window will now be -divided up into three rows, ready for more widgets to be added. +Specify that you want three rows created and click //OK//. The window will now +be divided up into three rows, ready for more widgets to be added. Add a Label +widget to the first (top) row. hunk ./docs/tutorial/glade/index.t2t 84 -[labeltext.png] Label and Text Entry palette icons. +[label.png] //Label palette icon// + +In the second row place an Entry widget (its tooltip refers to it as +//Text Entry//). + +[entry.png] //Entry palette icon// hunk ./docs/tutorial/glade/index.t2t 94 -[screen2.png] +[[screen2_small.png] screen2.png] hunk ./docs/tutorial/glade/index.t2t 97 -within the third row of the vertical box. The new horizontal box will have two -columns, one for each button. So lets do this by clicking the horizontal box -icon from the palette and clicking in the third row of our window. +within it. The new HBox widget will have two columns, one for each button, so +let's do this by clicking the //Horizontal Box// icon from the palette and +clicking in the third row of our window. hunk ./docs/tutorial/glade/index.t2t 101 -[horizontal.png] Horizontal Box palette icon. +[hbox.png] //HBox palette icon// hunk ./docs/tutorial/glade/index.t2t 103 -Specify two columns and click OK. The third row will now be divided -horizontally into two equal section. +Specify two columns and click //OK//. The third row will now be divided +horizontally into two equal sections. hunk ./docs/tutorial/glade/index.t2t 106 -Perhaps this would be a good time to save our project. By default Glade will -save your project under a ``Projects`` directory in your home directory. -Name your project something simple such as ``hellohaskell``. +Perhaps this would be a good time to save your project. By default Glade will +save it as a ``.glade`` file in your home directory. Name your project +``hellogtk2hs``. hunk ./docs/tutorial/glade/index.t2t 111 -will each hold a button. So let's add a button to each section by clicking the -//Button// icon from the palette and clicking in the first section. Perform a -similar action for the second section. +of the VBox will hold a button, so let's add a Button widget by clicking the +//Button// icon in the palette then clicking in the first (left) section. Do +the same for the second section. hunk ./docs/tutorial/glade/index.t2t 115 -[button.png] Button palette icon. +[button.png] //Button palette icon// hunk ./docs/tutorial/glade/index.t2t 117 -OK, so our buttons are there.... but they don't look quite right. This is -because we have to pack them properly. Do this by clicking on the first button -and from the //Properties// window selecting the //Packing// tab. Enable both -the //Expand// and //Fill// property for the button by setting both to //Yes//. -You should see the first button fill up a bit. Do the same thing to the second -button and you should get it looking a bit better: +OK, so our buttons are in place: hunk ./docs/tutorial/glade/index.t2t 119 -[screen3.png] +[[screen3_small.png] screen3.png] hunk ./docs/tutorial/glade/index.t2t 121 -We can make things look even better yet. Change the following: +Now we'll change some packing properties to improve the look, and give our +buttons identities (remember that you can select widgets easily from the +//Inspector// pane): hunk ./docs/tutorial/glade/index.t2t 125 -Remember you can select widgets easily from the //Widget Tree// window. - -- Change the //Homogeneous// property of //hbox1// to //Yes// -- Change the //Border Width// of //hbox1// and //vbox1// to //4// -- Change the //Spacing// of //hbox1// and //vbox1// to //4// -- Change the //Stock Button// property of //button1// to //OK// -- Change the //Stock Button// property of //button2// to //Close// +- Change the //Homogeneous// property in the //General// tab for ``hbox1`` to + //Yes// +- Change the //Spacing// property in the //General// tab for ``hbox1`` and + ``vbox1`` to //4// +- Change the //Border width// property in the //Common// tab for ``hbox1`` and + ``vbox1`` to //4// +- Change the //Edit Type// property in the //General// tab for ``button1`` to + //Stock//, then change the //Stock Button// property to //Apply// +- Change the //Edit Type// property in the //General// tab for ``button2`` to + //Stock//, then change the //Stock Button// property to //Close// hunk ./docs/tutorial/glade/index.t2t 138 -app will look like... so play around with the properties till it looks just the +app will look like, so play around with the properties till it looks just the hunk ./docs/tutorial/glade/index.t2t 142 -property of //label1// to "Enter your name:" - -Without writing one line of code we've actually created a full UI mockup. Next -we will write a little code to get our appliation running. +property in the //General// tab for ``label1`` to ``Enter your name:``, then +save the project. hunk ./docs/tutorial/glade/index.t2t 145 -If you now look in your Project directory (remember we saved it in -~/Projects/hellohaskell) you'll see the files Glade has created. +If you now look in your home directory (or whichever directory you chose to +save the project to earlier) all you'll see is the file with the ``.glade`` +extension. This is an XML file and therefore you can inspect it with an editor +or a browser. If you do this, you'll see every widget you've specified as an +XML element, each with an ``id`` attribute. This unique name, in our case +assigned by default by Glade, is used by Gtk2Hs to access the widgets (as you +can see in //Code Listing A// below). hunk ./docs/tutorial/glade/index.t2t 153 - Side note: back in the dark mists of time it was recommended practice - for C programmers to generate C code from their glade UI designs. Glade - version 2 supports this directly with the //Build// button on the - toolbar however you should ignore that feature as it only applies to C. - Indeed the recommendation these days - even for C programmers - is to - load the UI at runtime as this is much more maintainable and flexible. + Side note: Back in the dark mists of time it was recommended practice for C + programmers to generate C code from their Glade UI designs. Glade version 2 + supports this directly with the //Build// button on the toolbar, however + you should ignore that feature as it only applies to C. Indeed the + recommendation these days[_\e2_][_\80_][_\94_]even for C programmers[_\e2_][_\80_][_\94_]is to load the UI at + runtime, as this is much more maintainable and flexible. hunk ./docs/tutorial/glade/index.t2t 160 -All we need is the file with the //.glade// extension. This is an XML file and -therefore you can inspect it with an editor or a browser. If you do this, -you'll see every widget you've specified as an XML element, each with an //id// -attribute. This unique name, in our case assigned by default by Glade, is used -by Gtk2Hs to access the widgets, as you can see in line 9 of the following -listing. +Without writing one line of code we've actually created a full UI mockup. Now +we will write a little code to get our application running. hunk ./docs/tutorial/glade/index.t2t 163 -First, however, you have to take care of some administration. This includes -importing the modules in lines 1 and 2, initializing the graphics in line 5 and -adding the main graphics function at the end on line 9. This is the basic -template for all Gtk2Hs user modules. To use a //.glade// file you must also -add something like line 6 to the template. If the specified file is found, you -now have a handle to access all your widgets. +First, some administration. This includes importing the necessary Gtk2Hs +modules in lines 3 and 4, initializing the graphics in line 7, exposing the +window in line 11 after all the widgets have been added, and calling the main +graphics function at the end. This is the basic template for all Gtk2Hs user +modules. To utilize our ``.glade`` file you must also add something like line +8. If the specified file is found, you now have a handle to access all your +widgets. hunk ./docs/tutorial/glade/index.t2t 172 -1 import Graphics.UI.Gtk -2 import Graphics.UI.Gtk.Glade -3 -4 main = do -5 initGUI -6 Just xml <- xmlNew "hellohaskell.glade" -7 window <- xmlGetWidget xml castToWindow "window1" -8 onDestroy window mainQuit -9 mainGUI +1 module Main where +2 +3 import Graphics.UI.Gtk +4 import Graphics.UI.Gtk.Glade +5 +6 main = do +7 initGUI +8 Just xml <- xmlNew "hellogtk2hs.glade" +9 window <- xmlGetWidget xml castToWindow "window1" +10 onDestroy window mainQuit +11 widgetShowAll window +12 mainGUI hunk ./docs/tutorial/glade/index.t2t 185 +//Code Listing A// hunk ./docs/tutorial/glade/index.t2t 187 -Line 7 shows you how to get a handle to a specified widget using the general -``xmlGetWidget`` function. Its first argument is the handle to the glade, -its second a cast to the desired type, and its third the name (its //id// -attribute) in the XML file. We'll use this function again and again. Lastly, -line 8 contains the action to be taken when the user closes the window. If you -have the Glasgow Haskell Compiler installed you can use its interactive version -``ghci`` to run (your copy of) this listing. +Line 9 shows you how to get a handle to a specified widget using the general +``xmlGetWidget`` function. The first argument to the function is the handle to +our Glade XML. The second argument is a cast to the desired widget type, and +the third argument is the widget's name (its ``id`` attribute) as specified in +the XML. We'll use this function again and again. Lastly, line 10 contains the +action to be taken when the user closes the window. hunk ./docs/tutorial/glade/index.t2t 194 -Now all this fun is well and good.... but our app is still kind of blah when it -doesn't actually do anything. So let's start up on the coding! +If you have the Glasgow Haskell Compiler installed you can use its interactive +version ``ghci`` to quickly test what we have so far for our ``main`` function. + +Now all this fun is well and good, but our app is still kind of blah when it +doesn't actually do anything. So let's start on the coding! hunk ./docs/tutorial/glade/index.t2t 201 -What we would like to accomplish is for the user to type in his/her name in the -text entry field and when OK is clicked for the label to change to greet the -user with a Hello followed by the entered name. Also the Close button should -quit the application. +What we would like to accomplish is to let the user type his/her name in the +text entry field and[_\e2_][_\80_][_\94_]when they click //Apply//[_\e2_][_\80_][_\94_]change the label to greet the +user with a "Hello" followed by the name they entered. Also, the //Close// +button should cause the application to terminate. hunk ./docs/tutorial/glade/index.t2t 206 -The general idea is that when something of interest happens to a widget (eg a -when button is clicked), a signal is emitted, and the programmer codes what the -response will be. For example: +The general idea is that when something of interest happens to a widget (//eg// +when a button is clicked), a signal is emitted, and the programmer codes what +the response will be. For example: hunk ./docs/tutorial/glade/index.t2t 216 -is only used so that we don't have to enclose the whole 'do' block in brackets) +is only used here so that we don't have to enclose the whole ``do`` block in +brackets.) hunk ./docs/tutorial/glade/index.t2t 219 -So let's start by creating two signal handlers, one for each button. We'll -start off with the Close button, since that is the easiest to implement. Let's -add some trivial code too, just to see our event in action. The ``putStrLn`` -function is used to print to standard out, so let's add some code to signify -that button2 was clicked. +Let's start by creating two signal handlers, one for each button. First up is +the //Close// button since that's the easiest to implement. Let's add some +trivial code too, just to see our event in action. The ``putStrLn`` function +prints to standard out, so let's use it to signify that ``button2`` was +clicked. hunk ./docs/tutorial/glade/index.t2t 225 -Before ``mainGUI``, which always must be last, add the following two lines: +Before ``mainGUI``, which must always be last, and ``widgetShowAll window``, +add the following two lines: hunk ./docs/tutorial/glade/index.t2t 229 -clbutton <- xmlGetWidget xml castToButton "button2" -onClicked clbutton $ do - putStrLn "Close Button Clicked" +closeButton <- xmlGetWidget xml castToButton "button2" +onClicked closeButton $ do + putStrLn "Close Button Clicked" hunk ./docs/tutorial/glade/index.t2t 234 -As you see, you use the ``xmlGetWidget`` function again, but with a different -typecast than before. To actually implement the Close button like its name -says, you might try to use ``mainQuit`` in place of ``putStrLn``. If you do -this in ``ghci`` you'll see that pressing the button will indeed exit to ``ghci``, -but leave the window and its descendants on the screen. When you try to close -the window you'll probably get a message from the operating system that the -application is not responding, or something like that. What you need is: +As you can see, you're using the ``xmlGetWidget`` function again, but with a +different typecast than before. To actually implement the //Close// button like +its name implies, you might try to use ``mainQuit`` in place of ``putStrLn``. +If you do this in ``ghci`` you'll see that pressing the button will indeed exit +to ``ghci``, but leave the window and its descendants on the screen. When you +try to close the window you'll probably get a message from the operating system +that the application is not responding, or something similar. What you need is: hunk ./docs/tutorial/glade/index.t2t 243 -onClicked clbutton $ do - widgetDestroy window +onClicked closeButton $ do + widgetDestroy window hunk ./docs/tutorial/glade/index.t2t 247 -This will do as advertised, and because of line 8 (see the listing) the -program will also exit cleanly. - -And you now have a fully functioning Close button! +This will do as advertised, and because of line 10 in //Code Listing A// above, +the program will also exit cleanly. And you now have a fully functioning +//Close// button! hunk ./docs/tutorial/glade/index.t2t 251 -Let's re-cap what we want our OK button to do. After a user types in their name -in the text entry field we will change the label to display "Hello User", with -User being the contents of the text entry field. This will involve two basic -concepts: retrieving data from a widget and setting a widgets property. +Let's re-cap what we want our //Apply// button to do. After a user types their +name in the text entry field we will change the label to display "Hello +//user//", where //user// represents the text the user entered. This will +involve two basic concepts: retrieving data from a widget and setting a +widget's property. hunk ./docs/tutorial/glade/index.t2t 260 -text entries. +text entry fields. hunk ./docs/tutorial/glade/index.t2t 262 -The first thing we'll need is a way to obtain the text the user had entered. -This is done with the ``get`` function and the ``entryText`` attribute. -Secondly we need a way to set the text in our label. This is done with the -``set`` function and the ``labelText`` attribute. And, of course, we need to -create handles for the new widgets we want to use. Lines 12 - 14 in the listing -won't surprise you, and the functionality of lines 15 - 17 is no rocket science -either. +The first thing we'll need is a way to obtain the text the user entered. This +is done with the ``get`` function and the ``entryText`` attribute. Secondly we +need a way to set the text in our label. This is done with the ``set`` function +and the ``labelText`` attribute. And, of course, we need to create handles for +the new widgets we want to use. Lines 14[_\e2_][_\80_][_\93_]16 in //Code Listing B// below won't +surprise you, and the functionality of lines 17[_\e2_][_\80_][_\93_]19 is no rocket science either. hunk ./docs/tutorial/glade/index.t2t 270 -1 import Graphics.UI.Gtk -2 import Graphics.UI.Gtk.Glade -3 -4 main = do -5 initGUI -6 Just xml <- xmlNew "hellohaskell.glade" -7 window <- xmlGetWidget xml castToWindow "window1" -8 onDestroy window mainQuit -9 clbutton <- xmlGetWidget xml castToButton "button2" -10 onClicked clbutton $ do -11 widgetDestroy window -12 prompt <- xmlGetWidget xml castToLabel "label1" -13 txtfield <- xmlGetWidget xml castToEntry "entry1" -14 okbutton <- xmlGetWidget xml castToButton "button1" -15 onClicked okbutton $ do -16 name <- get txtfield entryText -17 set prompt [ labelText := "Hello " ++ name ] -18 mainGUI +1 module Main where +2 +3 import Graphics.UI.Gtk +4 import Graphics.UI.Gtk.Glade +5 +6 main = do +7 initGUI +8 Just xml <- xmlNew "hellogtk2hs.glade" +9 window <- xmlGetWidget xml castToWindow "window1" +10 onDestroy window mainQuit +11 closeButton <- xmlGetWidget xml castToButton "button2" +12 onClicked closeButton $ do +13 widgetDestroy window +14 label <- xmlGetWidget xml castToLabel "label1" +15 entry <- xmlGetWidget xml castToEntry "entry1" +16 applyButton <- xmlGetWidget xml castToButton "button1" +17 onClicked applyButton $ do +18 name <- get entry entryText +19 set label [ labelText := "Hello " ++ name ] +20 widgetShowAll window +21 mainGUI hunk ./docs/tutorial/glade/index.t2t 292 +//Code Listing B// hunk ./docs/tutorial/glade/index.t2t 294 -We're done! Edit the program and compile with ``ghci`` or ``ghc``. eg: +We're done! Save the program as ``HelloGtk2Hs.hs`` in the same directory as our +Glade XML file, compile it using ``ghc``, then launch the new binary: hunk ./docs/tutorial/glade/index.t2t 298 -$ ghc --make HelloWorld.hs -o helloworld -$ ./helloworld +$ ghc --make HelloGtk2Hs.hs -o hellogtk2hs +$ ./hellogtk2hs hunk ./docs/tutorial/glade/index.t2t 302 -Type your name in the entry field and click OK. Hello User! Not too shabby -huh... +Type your name in the text entry field and click //Apply//. Hello //user//! Not +too shabby huh... hunk ./docs/tutorial/glade/index.t2t 305 -[screen6.png] +[screen4.png] hunk ./docs/tutorial/glade/index.t2t 308 + hunk ./docs/tutorial/glade/index.t2t 310 -the user presses //Enter//, and use this it to implement the same functionality -as the //OK button//. +the user presses //Enter// and use this to implement the same functionality the +//Apply// button provides. hunk ./docs/tutorial/glade/index.t2t 314 -Run one of the listings with ``ghci``, using the ``main`` command, and close -the window, but don't leave the module. Now open the Glade Interface Designer -and open your project. Change the name of the window and use //save// to -implement the change in the //glade// file. Now run ``./helloworld`` again (or -``main`` in ``ghci``) and verify that the name has changed. Experiment to find -out what other changes you can make in your GUI with the same Haskell code. + +Run one of the code listings with ``ghci``, using the ``main`` command, and +close the window, but don't leave the module. Now open your project in Glade. +Change the name of the window and hit //Save// to implement the change in the +``.glade`` file. Now run ``./hellogtk2hs`` again (or ``main`` in ``ghci``) and +verify that the name has changed. Experiment to find out what other changes you +can make in your GUI with the same Haskell code. hunk ./docs/tutorial/glade/index.t2t 335 -[Hans van Thiel http://j-van-thiel.speedlinq.nl/] October 2006. +[Hans van Thiel http://j-van-thiel.speedlinq.nl/], October 2006. Text and +images updated for Glade 3 by Alex Tarkovsky, August 2007. binary ./docs/tutorial/glade/label.png binary ./docs/tutorial/glade/main.png binary ./docs/tutorial/glade/screen1.png binary ./docs/tutorial/glade/screen1_small.png binary ./docs/tutorial/glade/screen2.png binary ./docs/tutorial/glade/screen2_small.png binary ./docs/tutorial/glade/screen3.png binary ./docs/tutorial/glade/screen3_small.png binary ./docs/tutorial/glade/screen4.png binary ./docs/tutorial/glade/vbox.png binary ./docs/tutorial/glade/window.png |
From: Duncan C. <dun...@wo...> - 2007-08-26 23:29:39
|
Fri Aug 17 07:13:56 PDT 2007 hth...@zo... * Gtk+2.0 Tutorial Port Chapter 8, Tables addfile ./docs/tutorial/Tutorial_Port/Example_Code/GtkChap8.hs hunk ./docs/tutorial/Tutorial_Port/Example_Code/GtkChap8.hs 1 +import Graphics.UI.Gtk + +main:: IO () +main = do + initGUI + window <- windowNew + set window [windowTitle := "Labels", containerBorderWidth := 10 ] + mainbox <- vBoxNew False 10 + containerAdd window mainbox [_$_] + hbox <- hBoxNew True 5 + boxPackStart mainbox hbox PackNatural 0 + vbox1 <- vBoxNew False 10 + vbox2 <- vBoxNew False 0 + boxPackStart hbox vbox1 PackNatural 0 [_$_] + boxPackStart hbox vbox2 PackNatural 0 + + (label1,frame1) <- myLabelWithFrameNew + boxPackStart vbox1 frame1 PackNatural 0 + labelSetText label1 "Penny Harter" + + (label2,frame2) <- myLabelWithFrameNew + boxPackStart vbox1 frame2 PackNatural 0 + labelSetText label2 "broken bowl\nthe pieces\nstill rocking" + miscSetAlignment label2 0.0 0.0 + hsep1 <- hSeparatorNew + boxPackStart vbox1 hsep1 PackNatural 10 + + (label3,frame3) <- myLabelWithFrameNew + boxPackStart vbox1 frame3 PackNatural 0 + labelSetText label3 "Gary Snyder" + + (label4,frame4) <- myLabelWithFrameNew + boxPackStart vbox1 frame4 PackNatural 0 + labelSetText label4 "After weeks of watching the roof leak\nI fixed it tonight\nby moving a single board" + labelSetJustify label4 JustifyCenter + + (label5,frame5) <- myLabelWithFrameNew + boxPackStart vbox2 frame5 PackNatural 0 + labelSetText label5 "Kobayashi Issa" + [_$_] + (label7,frame7) <- myLabelWithFrameNew + boxPackEnd vbox2 frame7 PackNatural 0 + labelSetText label7 "only one guy and\nonly one fly trying to\nmake the guest room do" + labelSetJustify label7 JustifyRight + + (label6,frame6) <- myLabelWithFrameNew + boxPackEnd vbox2 frame6 PackNatural 10 + labelSetText label6 "One Guy" + frameSetLabel frame6 "Title:" + labelSetPattern label6 [3,1,3] + + button <- buttonNew + boxPackEnd mainbox button PackNatural 20 + buttonlabel <- labelNewWithMnemonic "Haiku _Clicked" + containerAdd button buttonlabel + + widgetShowAll window + onClicked button (putStrLn "button clicked...") + onDestroy window mainQuit + mainGUI + + +myLabelWithFrameNew :: IO (Label,Frame) +myLabelWithFrameNew = do + label <- labelNew Nothing + frame <- frameNew + containerAdd frame label + frameSetShadowType frame ShadowOut + return (label, frame) + +-- Haikus quoted from X.J. Kennedy, Dana Gioia, Introduction to Poetry, Longman, 1997 addfile ./docs/tutorial/Tutorial_Port/Images/GtkChap8.png binary ./docs/tutorial/Tutorial_Port/Images/GtkChap8.png hunk ./docs/tutorial/Tutorial_Port/chap1.html 59 + </dl><br> + <dt><br> + <a href="chap8.html">Labels</a></dt> addfile ./docs/tutorial/Tutorial_Port/chap8.html hunk ./docs/tutorial/Tutorial_Port/chap8.html 1 +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> + +<html> +<head> + <meta name="generator" content= + "HTML Tidy for Linux/x86 (vers 11 February 2007), see www.w3.org"> + <meta http-equiv="CONTENT-TYPE" content= + "text/html; charset=us-ascii"> + + <title>Labels</title> +</head> + +<body lang="en-US" text="#000000" link="#0000FF" vlink="#840084" +bgcolor="#FFFFFF" dir="ltr"> + <table summary="links to other pages" width="100%" border="0" + cellpadding="0" cellspacing="0"> + <tr> + <th colspan="3"> + <p align="center">Gtk2Hs Tutorial</p> + </th> + </tr> + + <tr valign="bottom"> + <td width="10%"> + <p align="left"><a href="chap7.html"><<< + Previous</a></p> + </td> + + <td width="80%"></td> + + <td width="10%"> + <p align="right"><a href="chap9.html">Next + >>></a></p> + </td> + </tr> + </table> + <hr> + + <h2><a name="SEC-LABELS" id="SEC-LABELS"></a>Labels</h2> + + <p>Labels are used a lot in Gtk2Hs, and are relatively simple. + Labels emit no signals as they do not have an associated X + window. If you need to catch signals, or do clipping, place it + inside an <i>EventBox</i> widget, which allows you to catch + signals for widgets which do not have their own window, or a + button.</p> + + <p>To create a new label, use:</p> + + <table summary="Haskell code" width="100%" border="0" + cellpadding="2" cellspacing="2" bgcolor="#E0E0E0"> + <tr> + <td> + <pre> +labelNew :: Maybe String -> IO Label + +labelNewWithMnemonic :: String -> IO Label +</pre> + </td> + </tr> + </table> + + <p>With the second function, if characters in the string 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. When that key is pressed + the activable widget which contains the label (e.g. a button) + will be activated. The widget which is to be affected can also be + set by <i>labelSetMnemonicWidget</i>.</p> + + <p>To change the label's text after creation, or to get the + label's text, use the functions:</p> + + <table summary="Haskell code" width="100%" border="0" + cellpadding="2" cellspacing="2" bgcolor="#E0E0E0"> + <tr> + <td> + <pre> +labelSetText :: LabelClass self => self -> String -> IO () + +labelGetLabel :: LabelClass self => self -> IO String +</pre> + </td> + </tr> + </table> + + <p>or, of course, the generic <i>set</i> or <i>get</i> functions. + The space needed for the new string will be automatically + adjusted if needed. You can produce multi-line labels by putting + line breaks in the label string. If you have multi-line labels + the lines can be justified relatively to each other using:</p> + + <table summary="Haskell code" width="100%" border="0" + cellpadding="2" cellspacing="0" bgcolor="#E0E0E0"> + <col width="256*"> + + <tr> + <td width="100%"> + <pre> +labelSetJustify :: LabelClass self => self -> Justification -> IO () +</pre> + </td> + </tr> + </table> + + <p>where the type <i>Justification</i> has one of four + constructors:</p> + + <table summary="Haskell code" width="100%" border="0" + cellpadding="2" cellspacing="2" bgcolor="#E0E0E0"> + <tr> + <td> + <pre> +JustifyLeft +JustifyRight +JustifyCenter +JustifyFill +</pre> + </td> + </tr> + </table> + + <p>The label widget is also capable of line wrapping the text + automatically. This can be activated using:</p> + + <table summary="Haskell code" width="100%" border="0" + cellpadding="2" cellspacing="2" bgcolor="#E0E0E0"> + <tr> + <td> + <pre> +labelSetLineWrap :: LabelClass self => self -> Bool -> IO () +</pre> + </td> + </tr> + </table> + + <p>If you want your label underlined, then you can set a pattern + on the label:</p> + + <table summary="Haskell code" width="100%" border="0" + cellpadding="2" cellspacing="2" bgcolor="#E0E0E0"> + <tr> + <td> + <pre> +labelSetPattern :: LabelClass self => self -> [Int] -> IO () +</pre> + </td> + </tr> + </table> + + <p>The list of Ints marks the underlined parts of the label text + alternated by the non-interlined parts. For example, [3,1,3] + means first 3 characters underlined, the next not, the next 3 + underlined.</p> + + <p>You can also make text in a lable selectable, so the user can + copy and paste it, and use some formatting options.</p> + + <p align="left">Below is a short example to illustrate a few of + these functions. It makes use of the <i>Frame</i> widget to + better demonstrate the label styles. A <i>Frame</i> is just an + ornament like a <i>HSeparator</i> and a <i>VSeparator</i> but it + surrounds the widget and is an instance of <i>Container</i>. + Therefore the widget it frames must be added to it with + <i>containerAdd</i>. A frame itself can have a label to convey + information about its contents.</p> + <p><img src="./Images/GtkChap8.png" name="graphics2" align= + "bottom" alt="GtkChap8" id="graphics2"></p> + + <p>Because all the labels are framed, a function + <i>myLabelWithFrameNew</i> is defined, which returns a + tuple.Gtk2Hs is truly Haskell, so you can use all the Haskell + data types and features. The justifications are pretty obvious, + but they only refer to the lines inside the label. So, to to + right justify label2 itself, you need <i>miscSetAlignment</i> as + shown below. The last two widgets in the left horizontal box are + packed with <i>boxPackEnd</i> instead of the usual + <i>boxPackStart</i>. The button label demonstrates the use of a + mnemonic as an accellarator key. Pressing Alt_C on the keyboard + has the same effect as clicking the button.</p> + + <p>Note: when tested on Fedora 6, pressing Enter or the space bar + also had this effect. Also note the effect of the y-character on + the placement of the underline.</p> + + <table summary="Haskell code" width="100%" border="0" + cellpadding="2" cellspacing="2" bgcolor="#E0E0E0"> + <tr> + <td> + <pre> +import Graphics.UI.Gtk + +main:: IO () +main = do + initGUI + window <- windowNew + set window [windowTitle := "Labels", containerBorderWidth := 10 ] + mainbox <- vBoxNew False 10 + containerAdd window mainbox [_$_] + hbox <- hBoxNew True 5 + boxPackStart mainbox hbox PackNatural 0 + vbox1 <- vBoxNew False 10 + vbox2 <- vBoxNew False 0 + boxPackStart hbox vbox1 PackNatural 0 [_$_] + boxPackStart hbox vbox2 PackNatural 0 + + (label1,frame1) <- myLabelWithFrameNew + boxPackStart vbox1 frame1 PackNatural 0 + labelSetText label1 "Penny Harter" + + (label2,frame2) <- myLabelWithFrameNew + boxPackStart vbox1 frame2 PackNatural 0 + labelSetText label2 "broken bowl\nthe pieces\nstill rocking" + miscSetAlignment label2 0.0 0.0 + hsep1 <- hSeparatorNew + boxPackStart vbox1 hsep1 PackNatural 10 + + (label3,frame3) <- myLabelWithFrameNew + boxPackStart vbox1 frame3 PackNatural 0 + labelSetText label3 "Gary Snyder" + + (label4,frame4) <- myLabelWithFrameNew + boxPackStart vbox1 frame4 PackNatural 0 + labelSetText label4 "After weeks of watching the roof leak\nI fixed it tonight\nby moving a single board" + labelSetJustify label4 JustifyCenter + + (label5,frame5) <- myLabelWithFrameNew + boxPackStart vbox2 frame5 PackNatural 0 + labelSetText label5 "Kobayashi Issa" + [_$_] + (label7,frame7) <- myLabelWithFrameNew + boxPackEnd vbox2 frame7 PackNatural 0 + labelSetText label7 "only one guy and\nonly one fly trying to\nmake the guest room do" + labelSetJustify label7 JustifyRight + + (label6,frame6) <- myLabelWithFrameNew + boxPackEnd vbox2 frame6 PackNatural 10 + labelSetText label6 "One Guy" + frameSetLabel frame6 "Title:" + labelSetPattern label6 [3,1,3] + + button <- buttonNew + boxPackEnd mainbox button PackNatural 20 + buttonlabel <- labelNewWithMnemonic "Haiku _Clicked" + containerAdd button buttonlabel + + widgetShowAll window + onClicked button (putStrLn "button clicked...") + onDestroy window mainQuit + mainGUI + + +myLabelWithFrameNew :: IO (Label,Frame) +myLabelWithFrameNew = do + label <- labelNew Nothing + frame <- frameNew + containerAdd frame label + frameSetShadowType frame ShadowOut + return (label, frame) +-- Haikus quoted from X.J. Kennedy, Dana Gioia, Introduction to Poetry, Longman, 1997 +</pre> + </td> + </tr> + </table> + <hr> + + <table summary="links to other pages" width="100%" border="0" + cellpadding="0" cellspacing="0"> + <tr valign="top"> + <td width="33%"> + <p align="left"><a href="chap7.html"><<< + Previous</a></p> + </td> + + <td width="34%"> + <p align="center"><a href="chap1.html">Home</a></p> + </td><!-- + <TD WIDTH=33%> + <P ALIGN=RIGHT><A HREF="chap9.html">Next >>></A></P> + </TD [_$_] + --> + </tr> + + <tr valign="top"> + <td width="33%"> + <p align="left">Adjustments, Scale and Range</p> + </td> + + <td width="34%"> + <p align="center"> </p> + </td> + + <td width="33%"> + <p align="right">to be continued...</p> + </td> + </tr> + </table> + + <p><br> + <br></p> +</body> +</html> |
From: Duncan C. <dun...@wo...> - 2007-08-26 23:29:38
|
Fri Aug 17 05:49:58 PDT 2007 A....@ke... * Add _SPLIT variant for gstreamer to the CLEAN targets. hunk ./Makefile.am 2405 - rm -f $(c2hs_CLEANFILES) - rm -f $(glib_CLEANFILES) - rm -f $(gtk_CLEANFILES) - rm -f $(glade_CLEANFILES) - rm -f $(gconf_CLEANFILES) - rm -f $(sourceview_CLEANFILES) - rm -f $(mozembed_CLEANFILES) - rm -f $(cairo_CLEANFILES) - rm -f $(svgcairo_CLEANFILES) - rm -f $(gtkglext_CLEANFILES) - rm -f $(soegtk_CLEANFILES) - rm -f $(doc_CLEANFILES) + rm -f $(c2hs_CLEANFILES) + rm -rf $(c2hs_CLEANFILES_SPLIT) + rm -f $(glib_CLEANFILES) + rm -rf $(glib_CLEANFILES_SPLIT) + rm -f $(gtk_CLEANFILES) + rm -rf $(gtk_CLEANFILES_SPLIT) + rm -f $(glade_CLEANFILES) + rm -rf $(glade_CLEANFILES_SPLIT) + rm -f $(gconf_CLEANFILES) + rm -rf $(gconf_CLEANFILES_SPLIT) + rm -f $(sourceview_CLEANFILES) + rm -rf $(sourceview_CLEANFILES_SPLIT) + rm -f $(mozembed_CLEANFILES) + rm -rf $(mozembed_CLEANFILES_SPLIT) + rm -f $(cairo_CLEANFILES) + rm -rf $(cairo_CLEANFILES_SPLIT) + rm -f $(svgcairo_CLEANFILES) + rm -rf $(svgcairo_CLEANFILES_SPLIT) + rm -f $(gtkglext_CLEANFILES) + rm -rf $(gtkglext_CLEANFILES_SPLIT) + rm -f $(soegtk_CLEANFILES) + rm -rf $(soegtk_CLEANFILES_SPLIT) + rm -f $(gnomevfs_CLEANFILES) + rm -rf $(gnomevfs_CLEANFILES_SPLIT) + rm -f $(gstreamer_CLEANFILES) + rm -rf $(gstreamer_CLEANFILES_SPLIT) + rm -f $(doc_CLEANFILES) |
From: Duncan C. <dun...@wo...> - 2007-08-26 23:29:36
|
Mon Jul 23 15:34:41 PDT 2007 Peter Gavin <pg...@gm...> * gstreamer: use the new hierarchyGenGst; rename Object marshallers to better denote their semantics; start wrapping base libraries adddir ./gstreamer/Media/Streaming/GStreamer/Base hunk ./Makefile.am 25 - gtk/Graphics/UI/Gtk/ModelView/Gtk2HsStore.h \ - gstreamer/hsgstreamer.h + gtk/Graphics/UI/Gtk/ModelView/Gtk2HsStore.h hunk ./Makefile.am 1875 -libHSgstreamer_a_GENERATEDSOURCES = \ - gstreamer/Media/Streaming/GStreamer/Core/Hierarchy.chs \ +libHSgstreamer_a_GENERATEDSOURCES = \ + gstreamer/Media/Streaming/GStreamer/Core/Hierarchy.chs \ + gstreamer/Media/Streaming/GStreamer/Core/MiniHierarchy.chs \ + gstreamer/Media/Streaming/GStreamer/Core/GObjectHierarchy.chs \ + gstreamer/Media/Streaming/GStreamer/Base/Hierarchy.chs \ + gstreamer/Media/Streaming/GStreamer/Base/GObjectHierarchy.chs \ hunk ./Makefile.am 1914 + gstreamer/Media/Streaming/GStreamer/Base/Types.chs \ + gstreamer/Media/Streaming/GStreamer/Base/BaseSrc.chs \ + gstreamer/Media/Streaming/GStreamer/Base.hs \ + gstreamer/Media/Streaming/GStreamer.hs \ hunk ./Makefile.am 1920 -htmldoc_HSFILES_HIDDEN += $(libHSgstreamer_a_GENERATEDSOURCES:.chs=.hs) +htmldoc_HSFILES_HIDDEN += \ + $(libHSgstreamer_a_GENERATEDSOURCES:.chs=.hs) \ + gstreamer/Media/Streaming/GStreamer/Core/Types.hs \ + gstreamer/Media/Streaming/GStreamer/Base/Types.hs \ + gnomevfs/System/Gnome/VFS/Marshal.hs + +EXTRA_DIST += \ + gstreamer/hsgstreamer.h \ + gstreamer/hierarchy.list \ + gstreamer/mini-hierarchy.list \ + gstreamer/gobject-hierarchy.list hunk ./Makefile.am 1941 -gstreamer/Media/Streaming/GStreamer/Core/Hierarchy.chs : \ - $(srcdir)/tools/hierarchyGen/hierarchy.list \ - $(srcdir)/tools/hierarchyGen/TypeGenerator$(EXEEXT) \ - $(srcdir)/tools/hierarchyGen/Hierarchy.chs.template - $(strip $(srcdir)/tools/hierarchyGen/TypeGenerator$(EXEEXT) \ - $(srcdir)/tools/hierarchyGen/hierarchy.list \ - $(srcdir)/tools/hierarchyGen/Hierarchy.chs.template \ - $@ --tag=gstreamer-core --lib=gstreamer --prefix=gstreamer \ - --modname=Media.Streaming.GStreamer.Core.Hierarchy --parentname=System.Glib.GObject) +gstreamer/Media/Streaming/GStreamer/Core/Hierarchy.chs : \ + $(srcdir)/gstreamer/hierarchy.list \ + $(srcdir)/tools/hierarchyGenGst/TypeGenerator$(EXEEXT) \ + $(srcdir)/gstreamer/Media/Streaming/GStreamer/Hierarchy.chs.template + $(strip $(srcdir)/tools/hierarchyGenGst/TypeGenerator$(EXEEXT) \ + $(srcdir)/gstreamer/hierarchy.list \ + $(srcdir)/gstreamer/Media/Streaming/GStreamer/Hierarchy.chs.template \ + $@ --tag=gstreamer-core --lib=gstreamer --prefix=gstreamer \ + --root=GObject \ + --modname=Media.Streaming.GStreamer.Core.Hierarchy) hunk ./Makefile.am 1952 -gstreamer/Media/Streaming/GStreamer/Base/Hierarchy.chs : \ - $(srcdir)/tools/hierarchyGen/hierarchy.list \ - $(srcdir)/tools/hierarchyGen/TypeGenerator$(EXEEXT) \ - $(srcdir)/tools/hierarchyGen/Hierarchy.chs.template - $(strip $(srcdir)/tools/hierarchyGen/TypeGenerator$(EXEEXT) \ - $(srcdir)/tools/hierarchyGen/hierarchy.list \ - $(srcdir)/tools/hierarchyGen/Hierarchy.chs.template \ - $@ --tag=gstreamer-base --lib=gstreamer --prefix=gstreamer \ - --modname=Media.Streaming.GStreamer.Base.Hierarchy --parentname=Media.Streaming.GStreamer.Base.Hierarchy) +gstreamer/Media/Streaming/GStreamer/Core/MiniHierarchy.chs : \ + $(srcdir)/gstreamer/mini-hierarchy.list \ + $(srcdir)/tools/hierarchyGenGst/TypeGenerator$(EXEEXT) \ + $(srcdir)/gstreamer/Media/Streaming/GStreamer/MiniHierarchy.chs.template + $(strip $(srcdir)/tools/hierarchyGenGst/TypeGenerator$(EXEEXT) \ + $(srcdir)/gstreamer/mini-hierarchy.list \ + $(srcdir)/gstreamer/Media/Streaming/GStreamer/MiniHierarchy.chs.template \ + $@ --tag=gstreamer-core --lib=gstreamer --prefix=gstreamer \ + --root=MiniObject \ + --modname=Media.Streaming.GStreamer.Core.MiniHierarchy) + +gstreamer/Media/Streaming/GStreamer/Core/GObjectHierarchy.chs : \ + $(srcdir)/gstreamer/gobject-hierarchy.list \ + $(srcdir)/tools/hierarchyGenGst/TypeGenerator$(EXEEXT) \ + $(srcdir)/gstreamer/Media/Streaming/GStreamer/GObjectHierarchy.chs.template + $(strip $(srcdir)/tools/hierarchyGenGst/TypeGenerator$(EXEEXT) \ + $(srcdir)/gstreamer/gobject-hierarchy.list \ + $(srcdir)/gstreamer/Media/Streaming/GStreamer/GObjectHierarchy.chs.template \ + $@ --tag=gstreamer-core --lib=gstreamer --prefix=gstreamer \ + --root=GObject \ + --modname=Media.Streaming.GStreamer.Core.GObjectHierarchy) + +gstreamer/Media/Streaming/GStreamer/Base/Hierarchy.chs : \ + $(srcdir)/gstreamer/hierarchy.list \ + $(srcdir)/tools/hierarchyGenGst/TypeGenerator$(EXEEXT) \ + $(srcdir)/gstreamer/Media/Streaming/GStreamer/Hierarchy.chs.template + $(strip $(srcdir)/tools/hierarchyGenGst/TypeGenerator$(EXEEXT) \ + $(srcdir)/gstreamer/hierarchy.list \ + $(srcdir)/gstreamer/Media/Streaming/GStreamer/Hierarchy.chs.template \ + $@ --tag=gstreamer-base --lib=gstreamer --prefix=gstreamer \ + --root=GObject \ + --modname=Media.Streaming.GStreamer.Base.Hierarchy --parentname=Media.Streaming.GStreamer.Core.Types) + +gstreamer/Media/Streaming/GStreamer/Base/GObjectHierarchy.chs : \ + $(srcdir)/gstreamer/gobject-hierarchy.list \ + $(srcdir)/tools/hierarchyGenGst/TypeGenerator$(EXEEXT) \ + $(srcdir)/gstreamer/Media/Streaming/GStreamer/GObjectHierarchy.chs.template + $(strip $(srcdir)/tools/hierarchyGenGst/TypeGenerator$(EXEEXT) \ + $(srcdir)/gstreamer/gobject-hierarchy.list \ + $(srcdir)/gstreamer/Media/Streaming/GStreamer/GObjectHierarchy.chs.template \ + $@ --tag=gstreamer-base --lib=gstreamer --prefix=gstreamer \ + --root=GObject \ + --modname=Media.Streaming.GStreamer.Base.GObjectHierarchy --parentname=Media.Streaming.GStreamer.Core.Types) hunk ./gnomevfs/System/Gnome/VFS/Types.chs 32 --- [_$_] --- Types used by GnomeVFS. hunk ./gstreamer/Media/Streaming/GStreamer.hs 20 - module Media.Streaming.GStreamer.Core + module Media.Streaming.GStreamer.Core, + module Media.Streaming.GStreamer.Base hunk ./gstreamer/Media/Streaming/GStreamer.hs 26 +import Media.Streaming.GStreamer.Base addfile ./gstreamer/Media/Streaming/GStreamer/Base.hs hunk ./gstreamer/Media/Streaming/GStreamer/Base.hs 1 +-- GIMP Toolkit (GTK) Binding for Haskell: binding to gstreamer -*-haskell-*- +-- +-- Author : Peter Gavin +-- Created: 1-Apr-2007 +-- +-- Version $Revision$ from $Date$ +-- +-- Copyright (c) 2007 Peter Gavin +-- +-- This library is free software; you can redistribute it and/or +-- modify it under the terms of the GNU Library General Public +-- License as published by the Free Software Foundation; either +-- version 2 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 +-- Library General Public License for more details. +-- +module Media.Streaming.GStreamer.Base ( + [_$_] + module Media.Streaming.GStreamer.Base.BaseSrc + [_$_] + ) where + +import Media.Streaming.GStreamer.Base.BaseSrc addfile ./gstreamer/Media/Streaming/GStreamer/Base/BaseSrc.chs hunk ./gstreamer/Media/Streaming/GStreamer/Base/BaseSrc.chs 1 +-- GIMP Toolkit (GTK) Binding for Haskell: binding to gstreamer -*-haskell-*- +-- +-- Author : Peter Gavin +-- Created: 1-Apr-2007 +-- +-- Version $Revision$ from $Date$ +-- +-- Copyright (c) 2007 Peter Gavin +-- +-- This library is free software; you can redistribute it and/or +-- modify it under the terms of the GNU Library General Public +-- License as published by the Free Software Foundation; either +-- version 2 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 +-- Library General Public License for more details. +-- +module Media.Streaming.GStreamer.Base.BaseSrc ( + [_$_] + BaseSrc, + BaseSrcClass, + [_$_] + ) where + +{#import Media.Streaming.GStreamer.Base.Types#} addfile ./gstreamer/Media/Streaming/GStreamer/Base/Types.chs hunk ./gstreamer/Media/Streaming/GStreamer/Base/Types.chs 1 +-- GIMP Toolkit (GTK) Binding for Haskell: binding to libgnomevfs -*-haskell-*- +-- +-- Author : Peter Gavin +-- Created: 1-Apr-2007 +-- +-- Copyright (c) 2007 Peter Gavin +-- +-- This library is free software: you can redistribute it and/or +-- modify it under the terms of the GNU Lesser General Public License +-- as published by the Free Software Foundation, either version 3 of +-- the License, or (at your option) any later version. +-- [_$_] +-- This library is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +-- Lesser General Public License for more details. +-- [_$_] +-- You should have received a copy of the GNU Lesser General Public +-- License along with this program. If not, see +-- <http://www.gnu.org/licenses/>. +-- [_$_] +-- GnomeVFS, the C library which this Haskell library depends on, is +-- available under LGPL Version 2. The documentation included with +-- this library is based on the original GnomeVFS documentation, +-- Copyright (c) 2001 Seth Nickell <sni...@st...>. The +-- documentation is covered by the GNU Free Documentation License, +-- version 1.2. +-- [_$_] +-- | Maintainer : gtk...@li... +-- Stability : alpha +-- Portability : portable (depends on GHC) +module Media.Streaming.GStreamer.Base.Types ( + [_$_] + module Media.Streaming.GStreamer.Base.Hierarchy, + [_$_] + ) where + +{#import Media.Streaming.GStreamer.Core.Types#} +{#import Media.Streaming.GStreamer.Base.Hierarchy#} +{#import System.Glib.GObject#} + hunk ./gstreamer/Media/Streaming/GStreamer/Core/Bin.chs 80 - withUTFString name ({# call bin_get_by_name #} (toBin bin)) >>= maybePeek newElement + withUTFString name ({# call bin_get_by_name #} (toBin bin)) >>= maybePeek takeElement hunk ./gstreamer/Media/Streaming/GStreamer/Core/Bin.chs 88 - maybePeek newElement + maybePeek takeElement hunk ./gstreamer/Media/Streaming/GStreamer/Core/Bin.chs 96 - maybePeek newElement + maybePeek takeElement hunk ./gstreamer/Media/Streaming/GStreamer/Core/Bin.chs 103 - maybePeek newIterator + maybePeek takeIterator hunk ./gstreamer/Media/Streaming/GStreamer/Core/Bin.chs 110 - maybePeek newIterator + maybePeek takeIterator hunk ./gstreamer/Media/Streaming/GStreamer/Core/Bin.chs 117 - maybePeek newIterator + maybePeek takeIterator hunk ./gstreamer/Media/Streaming/GStreamer/Core/Bin.chs 124 - maybePeek newIterator + maybePeek takeIterator hunk ./gstreamer/Media/Streaming/GStreamer/Core/Bin.chs 131 - maybePeek newIterator + maybePeek takeIterator hunk ./gstreamer/Media/Streaming/GStreamer/Core/Bin.chs 139 - maybePeek newIterator + maybePeek takeIterator hunk ./gstreamer/Media/Streaming/GStreamer/Core/Bin.chs 147 - maybePeek newPad + maybePeek takePad hunk ./gstreamer/Media/Streaming/GStreamer/Core/Bus.chs 58 - {# call bus_new #} >>= newBus + {# call bus_new #} >>= takeBus hunk ./gstreamer/Media/Streaming/GStreamer/Core/Bus.chs 75 - {# call bus_peek #} bus >>= maybePeek newMessage + {# call bus_peek #} bus >>= maybePeek takeMessage hunk ./gstreamer/Media/Streaming/GStreamer/Core/Bus.chs 80 - {# call bus_pop #} bus >>= maybePeek newMessage + {# call bus_pop #} bus >>= maybePeek takeMessage hunk ./gstreamer/Media/Streaming/GStreamer/Core/Bus.chs 87 - maybePeek newMessage + maybePeek takeMessage hunk ./gstreamer/Media/Streaming/GStreamer/Core/Bus.chs 113 - do bus <- newBus_ busPtr - message <- newMessage_ messagePtr + do bus <- peekBus busPtr + message <- peekMessage messagePtr hunk ./gstreamer/Media/Streaming/GStreamer/Core/Bus.chs 154 - newMessage + takeMessage hunk ./gstreamer/Media/Streaming/GStreamer/Core/Bus.chs 161 - connect_BOXED__NONE "message" newMessage_ False + connect_BOXED__NONE "message" peekMessage False hunk ./gstreamer/Media/Streaming/GStreamer/Core/Bus.chs 163 - connect_BOXED__NONE "message" newMessage_ True + connect_BOXED__NONE "message" peekMessage True hunk ./gstreamer/Media/Streaming/GStreamer/Core/Caps.chs 52 +import Control.Monad (liftM) hunk ./gstreamer/Media/Streaming/GStreamer/Core/Caps.chs 59 - unsafePerformIO $ {# call caps_new_empty #} >>= newCaps + unsafePerformIO $ {# call caps_new_empty #} >>= takeCaps hunk ./gstreamer/Media/Streaming/GStreamer/Core/Caps.chs 63 - unsafePerformIO $ {# call caps_new_any #} >>= newCaps + unsafePerformIO $ {# call caps_new_any #} >>= takeCaps hunk ./gstreamer/Media/Streaming/GStreamer/Core/Caps.chs 76 - maybePeek newStructure_ + maybePeek peekStructure hunk ./gstreamer/Media/Streaming/GStreamer/Core/Caps.chs 127 - newCaps + takeCaps hunk ./gstreamer/Media/Streaming/GStreamer/Core/Caps.chs 135 - newCaps + takeCaps hunk ./gstreamer/Media/Streaming/GStreamer/Core/Caps.chs 143 - newCaps + takeCaps hunk ./gstreamer/Media/Streaming/GStreamer/Core/Caps.chs 149 - {# call caps_normalize #} caps >>= newCaps + {# call caps_normalize #} caps >>= takeCaps hunk ./gstreamer/Media/Streaming/GStreamer/Core/Caps.chs 162 - newCaps + takeCaps hunk ./gstreamer/Media/Streaming/GStreamer/Core/Caps.chs 181 - caps <- newCaps_ ptr + caps <- liftM Caps $ newForeignPtr_ ptr hunk ./gstreamer/Media/Streaming/GStreamer/Core/Caps.chs 183 - caps' <- newCaps ptr + caps' <- takeCaps ptr hunk ./gstreamer/Media/Streaming/GStreamer/Core/Caps.chs 205 - {# call caps_copy #} caps2 >>= newCaps_ >>= + {# call caps_copy #} caps2 >>= takeCaps >>= hunk ./gstreamer/Media/Streaming/GStreamer/Core/Caps.chs 212 - {# call caps_copy #} caps2 >>= newCaps_ >>= + {# call caps_copy #} caps2 >>= takeCaps >>= hunk ./gstreamer/Media/Streaming/GStreamer/Core/Clock.chs 85 - {# call clock_get_master #} (toClock clock) >>= maybePeek newClock + {# call clock_get_master #} (toClock clock) >>= maybePeek takeClock hunk ./gstreamer/Media/Streaming/GStreamer/Core/Clock.chs 117 - newClockID . castPtr + takeClockID . castPtr hunk ./gstreamer/Media/Streaming/GStreamer/Core/Clock.chs 128 - newClockID . castPtr + takeClockID . castPtr hunk ./gstreamer/Media/Streaming/GStreamer/Core/Element.chs 113 - maybePeek newPad + maybePeek takePad hunk ./gstreamer/Media/Streaming/GStreamer/Core/Element.chs 122 - maybePeek newPad + maybePeek takePad hunk ./gstreamer/Media/Streaming/GStreamer/Core/Element.chs 130 - maybePeek newPadTemplate + maybePeek takePadTemplate hunk ./gstreamer/Media/Streaming/GStreamer/Core/Element.chs 139 - maybePeek newPad_ -- no finalizer; use elementReleaseRequestPad + maybePeek peekPad -- no finalizer; use elementReleaseRequestPad hunk ./gstreamer/Media/Streaming/GStreamer/Core/Element.chs 147 - maybePeek newPad + maybePeek takePad hunk ./gstreamer/Media/Streaming/GStreamer/Core/Element.chs 173 - {# call element_iterate_pads #} (toElement element) >>= newIterator + {# call element_iterate_pads #} (toElement element) >>= takeIterator hunk ./gstreamer/Media/Streaming/GStreamer/Core/Element.chs 179 - {# call element_iterate_sink_pads #} (toElement element) >>= newIterator + {# call element_iterate_sink_pads #} (toElement element) >>= takeIterator hunk ./gstreamer/Media/Streaming/GStreamer/Core/Element.chs 185 - {# call element_iterate_sink_pads #} (toElement element) >>= newIterator + {# call element_iterate_sink_pads #} (toElement element) >>= takeIterator hunk ./gstreamer/Media/Streaming/GStreamer/Core/Element.chs 269 - {# call element_get_bus #} (toElement element) >>= newBus + {# call element_get_bus #} (toElement element) >>= takeBus hunk ./gstreamer/Media/Streaming/GStreamer/Core/Element.chs 275 - {# call element_get_factory #} (toElement element) >>= newElementFactory_ + {# call element_get_factory #} (toElement element) >>= peekElementFactory hunk ./gstreamer/Media/Streaming/GStreamer/Core/Element.chs 288 - {# call element_get_index #} (toElement element) >>= maybePeek newIndex + {# call element_get_index #} (toElement element) >>= maybePeek takeIndex hunk ./gstreamer/Media/Streaming/GStreamer/Core/Element.chs 313 - {# call element_get_clock #} (toElement element) >>= maybePeek newClock + {# call element_get_clock #} (toElement element) >>= maybePeek takeClock hunk ./gstreamer/Media/Streaming/GStreamer/Core/Element.chs 325 - {# call element_provide_clock #} (toElement element) >>= maybePeek newClock + {# call element_provide_clock #} (toElement element) >>= maybePeek takeClock hunk ./gstreamer/Media/Streaming/GStreamer/Core/Element.chs 401 - then liftM (Just . unsafeCoerce#) $ withForeignPtr query' $ newQuery . castPtr + then liftM (Just . unsafeCoerce#) $ withForeignPtr query' $ takeQuery . castPtr hunk ./gstreamer/Media/Streaming/GStreamer/Core/ElementFactory.chs 55 - withUTFString name {# call element_factory_find #} >>= newElementFactory + withUTFString name {# call element_factory_find #} >>= takeElementFactory hunk ./gstreamer/Media/Streaming/GStreamer/Core/ElementFactory.chs 122 - maybePeek newElement + maybePeek takeElement hunk ./gstreamer/Media/Streaming/GStreamer/Core/ElementFactory.chs 131 - maybePeek newElement + maybePeek takeElement hunk ./gstreamer/Media/Streaming/GStreamer/Core/Format.chs 86 - {# call format_iterate_definitions #} >>= newIterator + {# call format_iterate_definitions #} >>= takeIterator hunk ./gstreamer/Media/Streaming/GStreamer/Core/GhostPad.chs 50 - maybePeek newPad + maybePeek takePad hunk ./gstreamer/Media/Streaming/GStreamer/Core/GhostPad.chs 58 - maybePeek newPad + maybePeek takePad hunk ./gstreamer/Media/Streaming/GStreamer/Core/GhostPad.chs 67 - maybePeek newPad + maybePeek takePad hunk ./gstreamer/Media/Streaming/GStreamer/Core/GhostPad.chs 75 - maybePeek newPad + maybePeek takePad hunk ./gstreamer/Media/Streaming/GStreamer/Core/GhostPad.chs 86 - {# call ghost_pad_get_target #} gpad >>= newPad + {# call ghost_pad_get_target #} gpad >>= takePad hunk ./gstreamer/Media/Streaming/GStreamer/Core/Index.chs 56 - {# call index_new #} >>= newIndex + {# call index_new #} >>= takeIndex hunk ./gstreamer/Media/Streaming/GStreamer/Core/Index.chs 101 - do index <- newIndex_ cIndex - indexEntry <- newIndexEntry_ cIndexEntry + do index <- peekIndex cIndex + indexEntry <- peekIndexEntry cIndexEntry hunk ./gstreamer/Media/Streaming/GStreamer/Core/Index.chs 137 - newIndexEntry_ + peekIndexEntry hunk ./gstreamer/Media/Streaming/GStreamer/Core/Index.chs 152 - newIndexEntry_ + peekIndexEntry hunk ./gstreamer/Media/Streaming/GStreamer/Core/Index.chs 162 - newIndexEntry_ + peekIndexEntry hunk ./gstreamer/Media/Streaming/GStreamer/Core/Index.chs 179 - maybePeek newIndexEntry_ + maybePeek peekIndexEntry hunk ./gstreamer/Media/Streaming/GStreamer/Core/Index.chs 198 - connect_BOXED__NONE "entry-added" newIndexEntry_ False + connect_BOXED__NONE "entry-added" peekIndexEntry False hunk ./gstreamer/Media/Streaming/GStreamer/Core/Index.chs 200 - connect_BOXED__NONE "entry-added" newIndexEntry_ True + connect_BOXED__NONE "entry-added" peekIndexEntry True hunk ./gstreamer/Media/Streaming/GStreamer/Core/IndexFactory.chs 40 - maybePeek newIndexFactory + maybePeek takeIndexFactory hunk ./gstreamer/Media/Streaming/GStreamer/Core/IndexFactory.chs 46 - newIndex + takeIndex hunk ./gstreamer/Media/Streaming/GStreamer/Core/IndexFactory.chs 52 - newIndex + takeIndex hunk ./gstreamer/Media/Streaming/GStreamer/Core/Iterator.chs 80 - newIterator + takeIterator hunk ./gstreamer/Media/Streaming/GStreamer/Core/Message.chs 74 - newObject_ + peekObject hunk ./gstreamer/Media/Streaming/GStreamer/Core/Message.chs 98 - unsafePerformIO $ {# call message_get_structure #} message >>= newStructure_ + unsafePerformIO $ {# call message_get_structure #} message >>= peekStructure hunk ./gstreamer/Media/Streaming/GStreamer/Core/Message.chs 105 - newMessage + takeMessage hunk ./gstreamer/Media/Streaming/GStreamer/Core/Message.chs 113 - liftM Just $ peek clockPtr >>= newClock_ + liftM Just $ peek clockPtr >>= peekClock hunk ./gstreamer/Media/Streaming/GStreamer/Core/Message.chs 123 - clock <- peek clockPtr >>= maybePeek newClock_ + clock <- peek clockPtr >>= maybePeek peekClock hunk ./gstreamer/Media/Streaming/GStreamer/Core/Message.chs 165 - peek clockPtr >>= maybePeek newClock_ + peek clockPtr >>= maybePeek peekClock hunk ./gstreamer/Media/Streaming/GStreamer/Core/Message.chs 211 - peek tagListPtr >>= newTagList + peek tagListPtr >>= takeTagList hunk ./gstreamer/Media/Streaming/GStreamer/Core/Object.chs 93 - maybePeek newObject + maybePeek takeObject hunk ./gstreamer/Media/Streaming/GStreamer/Core/Pad.chs 100 - newPad + takePad hunk ./gstreamer/Media/Streaming/GStreamer/Core/Pad.chs 114 - newElement + peekElement hunk ./gstreamer/Media/Streaming/GStreamer/Core/Pad.chs 151 - {# call pad_get_caps #} (toPad pad) >>= newCaps + {# call pad_get_caps #} (toPad pad) >>= takeCaps hunk ./gstreamer/Media/Streaming/GStreamer/Core/Pad.chs 158 - maybePeek newCaps + maybePeek takeCaps hunk ./gstreamer/Media/Streaming/GStreamer/Core/Pad.chs 165 - maybePeek newCaps + maybePeek takeCaps hunk ./gstreamer/Media/Streaming/GStreamer/Core/Pad.chs 174 - {# call caps_copy #} >>= newCaps + {# call caps_copy #} >>= takeCaps hunk ./gstreamer/Media/Streaming/GStreamer/Core/Pad.chs 188 - {# call pad_get_peer #} (toPad pad) >>= maybePeek newPad + {# call pad_get_peer #} (toPad pad) >>= maybePeek takePad hunk ./gstreamer/Media/Streaming/GStreamer/Core/Pad.chs 194 - {# call pad_peer_get_caps #} (toPad pad) >>= maybePeek newCaps + {# call pad_peer_get_caps #} (toPad pad) >>= maybePeek takeCaps hunk ./gstreamer/Media/Streaming/GStreamer/Core/Pad.chs 229 - maybePeek newPad + maybePeek takePad hunk ./gstreamer/Media/Streaming/GStreamer/Core/Pad.chs 242 - {# call pad_proxy_getcaps #} (toPad pad) >>= newCaps + {# call pad_proxy_getcaps #} (toPad pad) >>= takeCaps hunk ./gstreamer/Media/Streaming/GStreamer/Core/Pad.chs 251 - withForeignPtr caps' newCaps + withForeignPtr caps' takeCaps hunk ./gstreamer/Media/Streaming/GStreamer/Core/Pad.chs 277 - then liftM (Just . unsafeCoerce#) $ withForeignPtr query' $ newQuery . castPtr + then liftM (Just . unsafeCoerce#) $ withForeignPtr query' $ takeQuery . castPtr hunk ./gstreamer/Media/Streaming/GStreamer/Core/PadTemplate.chs 61 - newPadTemplate + takePadTemplate hunk ./gstreamer/Media/Streaming/GStreamer/Core/PadTemplate.chs 68 - newCaps_ + peekCaps hunk ./gstreamer/Media/Streaming/GStreamer/Core/Parse.chs 37 - maybePeek newElement + maybePeek takeElement hunk ./gstreamer/Media/Streaming/GStreamer/Core/Parse.chs 47 - maybePeek newElement + maybePeek takeElement hunk ./gstreamer/Media/Streaming/GStreamer/Core/Parse.chs 60 - maybePeek newElement + maybePeek takeElement hunk ./gstreamer/Media/Streaming/GStreamer/Core/Pipeline.chs 52 - newElement + takeElement hunk ./gstreamer/Media/Streaming/GStreamer/Core/Pipeline.chs 58 - {# call pipeline_get_bus #} (toPipeline pipeline) >>= newBus + {# call pipeline_get_bus #} (toPipeline pipeline) >>= takeBus hunk ./gstreamer/Media/Streaming/GStreamer/Core/Plugin.chs 148 - newPlugin + takePlugin hunk ./gstreamer/Media/Streaming/GStreamer/Core/Plugin.chs 154 - newPlugin + takePlugin hunk ./gstreamer/Media/Streaming/GStreamer/Core/PluginFeature.chs 41 - newPluginFeature + takePluginFeature hunk ./gstreamer/Media/Streaming/GStreamer/Core/Registry.chs 70 - unsafePerformIO $ {# call registry_get_default #} >>= newRegistry_ + unsafePerformIO $ {# call registry_get_default #} >>= peekRegistry hunk ./gstreamer/Media/Streaming/GStreamer/Core/Registry.chs 78 - fromGList >>= mapM newPluginFeature + fromGList >>= mapM takePluginFeature hunk ./gstreamer/Media/Streaming/GStreamer/Core/Registry.chs 87 - fromGList >>= mapM newPluginFeature + fromGList >>= mapM takePluginFeature hunk ./gstreamer/Media/Streaming/GStreamer/Core/Registry.chs 101 - fromGList >>= mapM newPlugin + fromGList >>= mapM takePlugin hunk ./gstreamer/Media/Streaming/GStreamer/Core/Registry.chs 126 - liftM fromBool $ newPlugin_ pluginPtr >>= pluginFilter + liftM fromBool $ peekPlugin pluginPtr >>= pluginFilter hunk ./gstreamer/Media/Streaming/GStreamer/Core/Registry.chs 142 - fromGList >>= mapM newPlugin + fromGList >>= mapM takePlugin hunk ./gstreamer/Media/Streaming/GStreamer/Core/Registry.chs 154 - liftM fromBool $ newPluginFeature_ pluginFeaturePtr >>= pluginFeatureFilter + liftM fromBool $ peekPluginFeature pluginFeaturePtr >>= pluginFeatureFilter hunk ./gstreamer/Media/Streaming/GStreamer/Core/Registry.chs 170 - fromGList >>= mapM newPluginFeature + fromGList >>= mapM takePluginFeature hunk ./gstreamer/Media/Streaming/GStreamer/Core/Registry.chs 179 - maybePeek newPlugin + maybePeek takePlugin hunk ./gstreamer/Media/Streaming/GStreamer/Core/Registry.chs 191 - maybePeek newPluginFeature + maybePeek takePluginFeature hunk ./gstreamer/Media/Streaming/GStreamer/Core/Registry.chs 199 - maybePeek newPluginFeature + maybePeek takePluginFeature hunk ./gstreamer/Media/Streaming/GStreamer/Core/Registry.chs 235 - newPlugin + takePlugin hunk ./gstreamer/Media/Streaming/GStreamer/Core/Structure.chs 72 - newStructure + takeStructure hunk ./gstreamer/Media/Streaming/GStreamer/Core/Structure.chs 88 - maybePeek newStructure + maybePeek takeStructure hunk ./gstreamer/Media/Streaming/GStreamer/Core/Structure.chs 193 - structure <- newStructure_ ptr + structure <- liftM Structure $ newForeignPtr_ ptr hunk ./gstreamer/Media/Streaming/GStreamer/Core/Structure.chs 195 - structure' <- newStructure ptr + structure' <- takeStructure ptr hunk ./gstreamer/Media/Streaming/GStreamer/Core/SystemClock.chs 34 - {# call system_clock_obtain #} >>= newClock + {# call system_clock_obtain #} >>= takeClock hunk ./gstreamer/Media/Streaming/GStreamer/Core/TagList.chs 184 - unsafePerformIO $ {# call tag_list_new #} >>= newTagList . castPtr + unsafePerformIO $ {# call tag_list_new #} >>= takeTagList . castPtr hunk ./gstreamer/Media/Streaming/GStreamer/Core/TagList.chs 201 - newTagList . castPtr + takeTagList . castPtr hunk ./gstreamer/Media/Streaming/GStreamer/Core/TagList.chs 219 - tagList' <- newTagList tagListPtr + tagList' <- takeTagList tagListPtr hunk ./gstreamer/Media/Streaming/GStreamer/Core/TagList.chs 230 - tagList'' <- newTagList $ castPtr tagListPtr + tagList'' <- takeTagList $ castPtr tagListPtr hunk ./gstreamer/Media/Streaming/GStreamer/Core/Types.chs 21 + module Media.Streaming.GStreamer.Core.MiniHierarchy, + module Media.Streaming.GStreamer.Core.GObjectHierarchy, hunk ./gstreamer/Media/Streaming/GStreamer/Core/Types.chs 33 - withObject, - isObject, - newObject, - newObject_, hunk ./gstreamer/Media/Streaming/GStreamer/Core/Types.chs 43 - withPad, - isPad, - newPad, - newPad_, - [_$_] - withGhostPad, - isGhostPad, - newGhostPad, - newGhostPad_, - - withPluginFeature, - isPluginFeature, - newPluginFeature, - newPluginFeature_, - - withElementFactory, - isElementFactory, - newElementFactory, - newElementFactory_, - [_$_] - withTypeFindFactory, - isTypeFindFactory, - newTypeFindFactory, - newTypeFindFactory_, - [_$_] - withIndexFactory, - isIndexFactory, - newIndexFactory, - newIndexFactory_, hunk ./gstreamer/Media/Streaming/GStreamer/Core/Types.chs 52 - withElement, - isElement, - newElement, - newElement_, - [_$_] - withImplementsInterface, - isImplementsInterface, - newImplementsInterface, - newImplementsInterface_, - [_$_] - withTagSetter, - isTagSetter, - newTagSetter, - newTagSetter_, - [_$_] - withBin, - isBin, - newBin, - newBin_, - [_$_] - withPipeline, - isPipeline, - newPipeline, - newPipeline_, - [_$_] - withPlugin, - isPlugin, - newPlugin, - newPlugin_, hunk ./gstreamer/Media/Streaming/GStreamer/Core/Types.chs 55 - withRegistry, - isRegistry, - newRegistry, - newRegistry_, hunk ./gstreamer/Media/Streaming/GStreamer/Core/Types.chs 59 - withBus, - isBus, - newBus, - newBus_, hunk ./gstreamer/Media/Streaming/GStreamer/Core/Types.chs 66 - withClock, - isClock, - newClock, - newClock_, hunk ./gstreamer/Media/Streaming/GStreamer/Core/Types.chs 68 - newClockID, - newClockID_, - [_$_] - withSystemClock, - isSystemClock, - newSystemClock, - newSystemClock_, + takeClockID, + peekClockID, hunk ./gstreamer/Media/Streaming/GStreamer/Core/Types.chs 72 - withIndex, - isIndex, - newIndex, - newIndex_, hunk ./gstreamer/Media/Streaming/GStreamer/Core/Types.chs 76 - newIndexEntry, - newIndexEntry_, + takeIndexEntry, + peekIndexEntry, hunk ./gstreamer/Media/Streaming/GStreamer/Core/Types.chs 86 - StaticPadTemplate(..), - withPadTemplate, - isPadTemplate, - newPadTemplate, - newPadTemplate_, - [_$_] - withTask, - isTask, - newTask, - newTask_, - [_$_] - withXML, - isXML, - newXML, - newXML_, - [_$_] - withChildProxy, - isChildProxy, - newChildProxy, - newChildProxy_, - [_$_] - withURIHandler, - isURIHandler, - [_$_] - MiniObject(..), - MiniObjectClass, - mkMiniObject, - unMiniObject, - withMiniObject, - isMiniObject, - toMiniObject, - fromMiniObject, - castToMiniObject, - newMiniObject, - newMiniObject_, hunk ./gstreamer/Media/Streaming/GStreamer/Core/Types.chs 88 - Buffer(..), - BufferClass, - mkBuffer, - unBuffer, - withBuffer, - isBuffer, - toBuffer, - fromBuffer, - newBuffer, - newBuffer_, - castToBuffer, - [_$_] - Event(..), - EventClass, - mkEvent, - unEvent, - withEvent, - isEvent, - toEvent, - fromEvent, - newEvent, - newEvent_, - castToEvent, - [_$_] - Message(..), - MessageClass, hunk ./gstreamer/Media/Streaming/GStreamer/Core/Types.chs 89 - mkMessage, - unMessage, - withMessage, - isMessage, - toMessage, - fromMessage, - newMessage, - newMessage_, - castToMessage, hunk ./gstreamer/Media/Streaming/GStreamer/Core/Types.chs 90 - Query(..), hunk ./gstreamer/Media/Streaming/GStreamer/Core/Types.chs 91 - QueryClass, - mkQuery, - unQuery, - withQuery, - isQuery, - toQuery, - fromQuery, - newQuery, - newQuery_, - castToQuery, hunk ./gstreamer/Media/Streaming/GStreamer/Core/Types.chs 100 - newIterator, - newIterator_, + takeIterator, + peekIterator, hunk ./gstreamer/Media/Streaming/GStreamer/Core/Types.chs 107 - newCaps, - newCaps_, + takeCaps, + peekCaps, hunk ./gstreamer/Media/Streaming/GStreamer/Core/Types.chs 114 - newStructure, - newStructure_, + takeStructure, + peekStructure, hunk ./gstreamer/Media/Streaming/GStreamer/Core/Types.chs 122 - newTagList, - newTagList_, + takeTagList, + peekTagList, hunk ./gstreamer/Media/Streaming/GStreamer/Core/Types.chs 151 +{#import Media.Streaming.GStreamer.Core.MiniHierarchy#} +{#import Media.Streaming.GStreamer.Core.GObjectHierarchy#} hunk ./gstreamer/Media/Streaming/GStreamer/Core/Types.chs 187 -withObject :: Object - -> (Ptr Object -> IO a) - -> IO a -withObject = withForeignPtr . unObject - -mkIsObject :: GObjectClass obj - => GType - -> obj - -> Bool -mkIsObject gType obj = - unsafePerformIO $ - withForeignPtr (unGObject $ toGObject obj) $ \objPtr -> - return $ typeInstanceIsA (castPtr objPtr) gType - -mkNewObject, mkNewObject_ :: (ObjectClass obj, ObjectClass obj') - => (ForeignPtr obj' -> obj') - -> Ptr obj - -> IO obj' -mkNewObject_ cons cObject = - liftM (cons . castForeignPtr) $ do - cObjectTakeOwnership $ castPtr cObject - newForeignPtr (castPtr cObject) objectFinalizer -foreign import ccall unsafe "&gst_object_unref" - objectFinalizer :: FunPtr (Ptr () -> IO ()) -foreign import ccall unsafe "_hs_gst_object_take_ownership" - cObjectTakeOwnership :: Ptr () - -> IO () - -mkNewObject cons cObject = - liftM (cons . castForeignPtr) $ - newForeignPtr (castPtr cObject) objectFinalizer - -isObject :: ObjectClass obj - => obj - -> Bool -isObject = mkIsObject {# call fun unsafe gst_object_get_type #} - --- | Use 'newObject' when a function returns an object that must be --- unreffed when you're done with it; i.e., the object is owned by --- the caller. -newObject, newObject_ :: Ptr Object - -> IO Object -newObject = mkNewObject Object - --- | Use 'newObject_' when a function returns an object that is owned --- elsewhere, or objects with floating references. -newObject_ = mkNewObject_ Object - hunk ./gstreamer/Media/Streaming/GStreamer/Core/Types.chs 208 -withPad :: Pad - -> (Ptr Pad -> IO a) - -> IO a -withPad = withForeignPtr . unPad - -isPad :: ObjectClass obj - => obj - -> Bool -isPad = mkIsObject {# call fun unsafe gst_pad_get_type #} - -newPad, newPad_ :: Ptr Pad - -> IO Pad -newPad = mkNewObject Pad -newPad_ = mkNewObject_ Pad - hunk ./gstreamer/Media/Streaming/GStreamer/Core/Types.chs 238 - peekIteratable = newPad . castPtr + peekIteratable = peekPad . castPtr hunk ./gstreamer/Media/Streaming/GStreamer/Core/Types.chs 243 -withGhostPad :: GhostPad - -> (Ptr GhostPad -> IO a) - -> IO a -withGhostPad = withForeignPtr . unGhostPad - -isGhostPad :: ObjectClass obj - => obj - -> Bool -isGhostPad = mkIsObject {# call fun unsafe gst_ghost_pad_get_type #} - -newGhostPad, newGhostPad_ :: Ptr GhostPad - -> IO GhostPad -newGhostPad = mkNewObject GhostPad -newGhostPad_ = mkNewObject_ GhostPad - --------------------------------------------------------------------- - -withPluginFeature :: PluginFeature - -> (Ptr PluginFeature -> IO a) - -> IO a -withPluginFeature = withForeignPtr . unPluginFeature - -isPluginFeature :: ObjectClass obj - => obj - -> Bool -isPluginFeature = mkIsObject {# call fun unsafe gst_plugin_feature_get_type #} - -newPluginFeature, newPluginFeature_ :: Ptr PluginFeature - -> IO PluginFeature -newPluginFeature = mkNewObject PluginFeature -newPluginFeature_ = mkNewObject_ PluginFeature - hunk ./gstreamer/Media/Streaming/GStreamer/Core/Types.chs 247 -withElementFactory :: ElementFactory - -> (Ptr ElementFactory -> IO a) - -> IO a -withElementFactory = withForeignPtr . unElementFactory - -isElementFactory :: ObjectClass obj - => obj - -> Bool -isElementFactory = mkIsObject {# call fun unsafe gst_element_factory_get_type #} - -newElementFactory, newElementFactory_ :: Ptr ElementFactory - -> IO ElementFactory -newElementFactory = mkNewObject ElementFactory -newElementFactory_ = mkNewObject_ ElementFactory - --------------------------------------------------------------------- - -withTypeFindFactory :: TypeFindFactory - -> (Ptr TypeFindFactory -> IO a) - -> IO a -withTypeFindFactory = withForeignPtr . unTypeFindFactory - -isTypeFindFactory :: ObjectClass obj - => obj - -> Bool -isTypeFindFactory = mkIsObject {# call fun unsafe gst_type_find_factory_get_type #} - -newTypeFindFactory, newTypeFindFactory_ :: Ptr TypeFindFactory - -> IO TypeFindFactory -newTypeFindFactory = mkNewObject TypeFindFactory -newTypeFindFactory_ = mkNewObject_ TypeFindFactory - --------------------------------------------------------------------- - -withIndexFactory :: IndexFactory - -> (Ptr IndexFactory -> IO a) - -> IO a -withIndexFactory = withForeignPtr . unIndexFactory - -isIndexFactory :: ObjectClass obj - => obj - -> Bool -isIndexFactory = mkIsObject {# call fun unsafe gst_index_factory_get_type #} - -newIndexFactory, newIndexFactory_ :: Ptr IndexFactory - -> IO IndexFactory -newIndexFactory = mkNewObject IndexFactory -newIndexFactory_ = mkNewObject_ IndexFactory - --------------------------------------------------------------------- - -withElement :: Element - -> (Ptr Element -> IO a) - -> IO a -withElement (Element cElement) = withForeignPtr cElement - -isElement :: ObjectClass obj - => obj - -> Bool -isElement = mkIsObject {# call fun unsafe gst_element_get_type #} - -newElement, newElement_ :: Ptr Element - -> IO Element -newElement = mkNewObject Element -newElement_ = mkNewObject_ Element - hunk ./gstreamer/Media/Streaming/GStreamer/Core/Types.chs 296 - peekIteratable = newElement . castPtr + peekIteratable = peekElement . castPtr hunk ./gstreamer/Media/Streaming/GStreamer/Core/Types.chs 301 -withImplementsInterface :: ImplementsInterface - -> (Ptr ImplementsInterface -> IO a) - -> IO a -withImplementsInterface = withForeignPtr . unImplementsInterface - -isImplementsInterface :: ObjectClass obj - => obj - -> Bool -isImplementsInterface = mkIsObject {# call fun unsafe gst_implements_interface_get_type #} - -newImplementsInterface, newImplementsInterface_ :: Ptr ImplementsInterface - -> IO ImplementsInterface -newImplementsInterface = mkNewObject ImplementsInterface -newImplementsInterface_ = mkNewObject_ ImplementsInterface - --------------------------------------------------------------------- - -withTagSetter :: TagSetter - -> (Ptr TagSetter -> IO a) - -> IO a -withTagSetter = withForeignPtr . unTagSetter - -isTagSetter :: ObjectClass obj - => obj - -> Bool -isTagSetter = mkIsObject {# call fun unsafe gst_tag_setter_get_type #} - -newTagSetter, newTagSetter_ :: Ptr TagSetter - -> IO TagSetter -newTagSetter = mkNewObject TagSetter -newTagSetter_ = mkNewObject_ TagSetter - --------------------------------------------------------------------- - -withBin :: Bin - -> (Ptr Bin -> IO a) - -> IO a -withBin = withForeignPtr . unBin - -isBin :: ObjectClass obj - => obj - -> Bool -isBin = mkIsObject {# call fun unsafe gst_bin_get_type #} - -newBin, newBin_ :: Ptr Bin - -> IO Bin -newBin = mkNewObject Bin -newBin_ = mkNewObject_ Bin - --------------------------------------------------------------------- - -withPipeline :: Pipeline - -> (Ptr Pipeline -> IO a) - -> IO a -withPipeline = withForeignPtr . unPipeline - -isPipeline :: ObjectClass obj - => obj - -> Bool -isPipeline = mkIsObject {# call fun unsafe gst_index_factory_get_type #} - -newPipeline, newPipeline_ :: Ptr Pipeline - -> IO Pipeline -newPipeline = mkNewObject Pipeline -newPipeline_ = mkNewObject_ Pipeline - --------------------------------------------------------------------- - -withPlugin :: Plugin - -> (Ptr Plugin -> IO a) - -> IO a -withPlugin = withForeignPtr . unPlugin - -isPlugin :: ObjectClass obj - => obj - -> Bool -isPlugin = mkIsObject {# call fun unsafe gst_plugin_get_type #} - -newPlugin, newPlugin_ :: Ptr Plugin - -> IO Plugin -newPlugin = mkNewObject Plugin -newPlugin_ = mkNewObject_ Plugin - --------------------------------------------------------------------- - -withRegistry :: Registry - -> (Ptr Registry -> IO a) - -> IO a -withRegistry = withForeignPtr . unRegistry - -isRegistry :: ObjectClass obj - => obj - -> Bool -isRegistry = mkIsObject {# call fun unsafe gst_registry_get_type #} - -newRegistry, newRegistry_ :: Ptr Registry - -> IO Registry -newRegistry = mkNewObject Registry -newRegistry_ = mkNewObject_ Registry - hunk ./gstreamer/Media/Streaming/GStreamer/Core/Types.chs 319 -withBus :: Bus - -> (Ptr Bus -> IO a) - -> IO a -withBus = withForeignPtr . unBus - -isBus :: ObjectClass obj - => obj - -> Bool -isBus = mkIsObject {# call fun unsafe gst_bus_get_type #} - -newBus, newBus_ :: Ptr Bus - -> IO Bus -newBus = mkNewObject Bus -newBus_ = mkNewObject_ Bus - hunk ./gstreamer/Media/Streaming/GStreamer/Core/Types.chs 321 -withClock :: Clock - -> (Ptr Clock -> IO a) - -> IO a -withClock = withForeignPtr . unClock - -isClock :: ObjectClass obj - => obj - -> Bool -isClock = mkIsObject {# call fun unsafe gst_clock_get_type #} - -newClock, newClock_ :: Ptr Clock - -> IO Clock -newClock = mkNewObject Clock -newClock_ = mkNewObject_ Clock - hunk ./gstreamer/Media/Streaming/GStreamer/Core/Types.chs 356 -newClockID, newClockID_ :: Ptr ClockID +takeClockID, peekClockID :: Ptr ClockID hunk ./gstreamer/Media/Streaming/GStreamer/Core/Types.chs 358 -newClockID clockIDPtr = +takeClockID clockIDPtr = hunk ./gstreamer/Media/Streaming/GStreamer/Core/Types.chs 360 -newClockID_ clockIDPtr = +peekClockID clockIDPtr = hunk ./gstreamer/Media/Streaming/GStreamer/Core/Types.chs 362 - newClockID clockIDPtr + takeClockID clockIDPtr hunk ./gstreamer/Media/Streaming/GStreamer/Core/Types.chs 369 -withSystemClock :: SystemClock - -> (Ptr SystemClock -> IO a) - -> IO a -withSystemClock = withForeignPtr . unSystemClock -newSystemClock, newSystemClock_ :: Ptr SystemClock - -> IO SystemClock - -isSystemClock :: ObjectClass obj - => obj - -> Bool -isSystemClock = mkIsObject {# call fun unsafe gst_system_clock_get_type #} - -newSystemClock = mkNewObject SystemClock -newSystemClock_ = mkNewObject_ SystemClock - --------------------------------------------------------------------- - -withIndex :: Index - -> (Ptr Index -> IO a) - -> IO a -withIndex = withForeignPtr . unIndex - -isIndex :: ObjectClass obj - => obj - -> Bool -isIndex = mkIsObject {# call fun unsafe gst_index_get_type #} - -newIndex, newIndex_ :: Ptr Index - -> IO Index -newIndex = mkNewObject Index -newIndex_ = mkNewObject_ Index - hunk ./gstreamer/Media/Streaming/GStreamer/Core/Types.chs 390 -newIndexEntry :: Ptr IndexEntry +takeIndexEntry :: Ptr IndexEntry hunk ./gstreamer/Media/Streaming/GStreamer/Core/Types.chs 392 -newIndexEntry ptr = +takeIndexEntry ptr = hunk ./gstreamer/Media/Streaming/GStreamer/Core/Types.chs 396 -newIndexEntry_ :: Ptr IndexEntry +peekIndexEntry :: Ptr IndexEntry hunk ./gstreamer/Media/Streaming/GStreamer/Core/Types.chs 398 -newIndexEntry_ ptr = +peekIndexEntry ptr = hunk ./gstreamer/Media/Streaming/GStreamer/Core/Types.chs 401 - newIndexEntry + takeIndexEntry hunk ./gstreamer/Media/Streaming/GStreamer/Core/Types.chs 424 -{# pointer *GstStaticPadTemplate as StaticPadTemplate newtype #} - -withPadTemplate :: PadTemplate - -> (Ptr PadTemplate -> IO a) - -> IO a -withPadTemplate = withForeignPtr . unPadTemplate - -isPadTemplate :: ObjectClass obj - => obj - -> Bool -isPadTemplate = mkIsObject {# call fun unsafe gst_pad_template_get_type #} - -newPadTemplate, newPadTemplate_ :: Ptr PadTemplate - -> IO PadTemplate -newPadTemplate = mkNewObject PadTemplate -newPadTemplate_ = mkNewObject_ PadTemplate - --------------------------------------------------------------------- - -withTask :: Task - -> (Ptr Task -> IO a) - -> IO a -withTask = withForeignPtr . unTask - -isTask :: ObjectClass obj - => obj - -> Bool -isTask = mkIsObject {# call fun unsafe gst_task_get_type #} - -newTask, newTask_ :: Ptr Task - -> IO Task -newTask = mkNewObject Task -newTask_ = mkNewObject_ Task - --------------------------------------------------------------------- - -withXML :: XML - -> (Ptr XML -> IO a) - -> IO a -withXML = withForeignPtr . unXML - -isXML :: ObjectClass obj - => obj - -> Bool -isXML = mkIsObject {# call fun unsafe gst_xml_get_type #} - -newXML, newXML_ :: Ptr XML - -> IO XML -newXML = mkNewObject XML -newXML_ = mkNewObject_ XML - --------------------------------------------------------------------- - -withChildProxy :: ChildProxy - -> (Ptr ChildProxy -> IO a) - -> IO a -withChildProxy = withForeignPtr . unChildProxy - -isChildProxy :: ObjectClass obj - => obj - -> Bool -isChildProxy = mkIsObject {# call fun unsafe gst_child_proxy_get_type #} - -newChildProxy, newChildProxy_ :: Ptr ChildProxy - -> IO ChildProxy -newChildProxy = mkNewObject ChildProxy -newChildProxy_ = mkNewObject_ ChildProxy - --------------------------------------------------------------------- - -withURIHandler :: URIHandler - -> (Ptr URIHandler -> IO a) - -> IO a -withURIHandler = withForeignPtr . unURIHandler - -isURIHandler :: ObjectClass obj - => obj - -> Bool -isURIHandler = mkIsObject {# call fun unsafe gst_uri_handler_get_type #} - --------------------------------------------------------------------- - -{# pointer *GstMiniObject as MiniObject foreign newtype #} - -mkMiniObject = MiniObject -unMiniObject (MiniObject o) = o - -withMiniObject :: MiniObject - -> (Ptr MiniObject -> IO a) - -> IO a -withMiniObject = withForeignPtr . unMiniObject - -class MiniObjectClass o - -mkIsMiniObject :: MiniObjectClass obj - => GType - -> obj - -> Bool -mkIsMiniObject gType obj = - unsafePerformIO $ withMiniObject (toMiniObject obj) $ \objPtr -> - return $ typeInstanceIsA (castPtr objPtr) gType - -isMiniObject :: MiniObjectClass obj - => obj - -> Bool -isMiniObject = mkIsMiniObject {# call fun unsafe gst_mini_object_get_type #} - -toMiniObject :: MiniObjectClass o => o -> MiniObject -toMiniObject = unsafeCoerce# -fromMiniObject :: MiniObjectClass o => MiniObject -> o -fromMiniObject = unsafeCoerce# - -instance MiniObjectClass MiniObject - -castToMini :: (MiniObjectClass obj, MiniObjectClass obj') - => GType - -> String - -> obj - -> obj' -castToMini gtype objTypeName obj = - case toMiniObject obj of - mobj@(MiniObject objFPtr) - | typeInstanceIsA ((unsafeForeignPtrToPtr . castForeignPtr) objFPtr) gtype -> - fromMiniObject mobj - | otherwise -> - error $ "Cannot cast object to " ++ objTypeName - -castToMiniObject :: MiniObjectClass obj - => obj - -> MiniObject -castToMiniObject = - castToMini {# call fun unsafe gst_mini_object_get_type #} "MiniObject" - -mkNewMiniObject, mkNewMiniObject_ :: (MiniObjectClass obj, MiniObjectClass obj') - => (ForeignPtr obj' -> obj') - -> Ptr obj - -> IO obj' -mkNewMiniObject_ cons cObject = - liftM (cons . castForeignPtr) $ do - cMiniObjectRef $ castPtr cObject - newForeignPtr (castPtr cObject) miniObjectFinalizer -foreign import ccall unsafe "&gst_object_unref" - miniObjectFinalizer :: FunPtr (Ptr () -> IO ()) -foreign import ccall unsafe "gst_mini_object_ref" - cMiniObjectRef :: Ptr () - -> IO (Ptr ()) - -mkNewMiniObject cons cObject = - liftM (cons . castForeignPtr) $ - newForeignPtr (castPtr cObject) miniObjectFinalizer - -newMiniObject, newMiniObject_ :: Ptr MiniObject - -> IO MiniObject - --- | Use 'newMiniObject' when a function returns an object that must be --- unreffed when you're done with it; i.e., the object is owned by --- the caller. -newMiniObject = mkNewMiniObject MiniObject - --- | Use 'newMiniObject_' when a function returns an object that is owned --- elsewhere. -newMiniObject_ = mkNewMiniObject_ MiniObject - hunk ./gstreamer/Media/Streaming/GStreamer/Core/Types.chs 436 -{#pointer *GstBuffer as Buffer foreign newtype #} - -mkBuffer = Buffer -unBuffer (Buffer o) = o - -withBuffer :: Buffer - -> (Ptr Buffer -> IO a) - -> IO a -withBuffer = withForeignPtr . unBuffer - -isBuffer :: MiniObjectClass obj - => obj - -> Bool -isBuffer = mkIsMiniObject {# call fun unsafe gst_buffer_get_type #} - -class MiniObjectClass o => BufferClass o -toBuffer :: BufferClass o => o -> Buffer -toBuffer = unsafeCoerce# -fromBuffer :: BufferClass o => Buffer -> o -fromBuffer = unsafeCoerce# - -instance BufferClass Buffer -instance MiniObjectClass Buffer - -newBuffer, newBuffer_ :: Ptr Buffer - -> IO Buffer -newBuffer = mkNewMiniObject Buffer -newBuffer_ = mkNewMiniObject_ Buffer - -castToBuffer :: MiniObjectClass obj - => obj - -> Buffer -castToBuffer = - castToMini {# call fun unsafe gst_buffer_get_type #} "Buffer" - --------------------------------------------------------------------- - -{#pointer *GstEvent as Event foreign newtype #} - -mkEvent = Event -unEvent (Event o) = o - -withEvent :: Event - -> (Ptr Event -> IO a) - -> IO a -withEvent = withForeignPtr . unEvent - -isEvent :: MiniObjectClass obj - => obj - -> Bool -isEvent = mkIsMiniObject {# call fun unsafe gst_event_get_type #} - -class MiniObjectClass o => EventClass o -toEvent :: EventClass o => o -> Event -toEvent = unsafeCoerce# -fromEvent :: EventClass o => Event -> o -fromEvent = unsafeCoerce# - -instance EventClass Event -instance MiniObjectClass Event - -newEvent, newEvent_ :: Ptr Event - -> IO Event -newEvent = mkNewMiniObject Event -newEvent_ = mkNewMiniObject_ Event - -castToEvent :: MiniObjectClass obj - => obj - -> Event -castToEvent = - castToMini {# call fun unsafe gst_event_get_type #} "Event" - --------------------------------------------------------------------- - -{# pointer *GstMessage as Message foreign newtype #} hunk ./gstreamer/Media/Streaming/GStreamer/Core/Types.chs 506 -mkMessage = Message -unMessage (Message o) = o - -withMessage :: Message - -> (Ptr Message -> IO a) - -> IO a -withMessage = withForeignPtr . unMessage - -isMessage :: MiniObjectClass obj - => obj - -> Bool -isMessage = mkIsMiniObject {# call fun unsafe gst_message_get_type #} - -class MiniObjectClass o => MessageClass o -toMessage :: MessageClass o => o -> Message -toMessage = unsafeCoerce# -fromMessage :: MessageClass o => Message -> o -fromMessage = unsafeCoerce# - -instance MessageClass Message -instance MiniObjectClass Message - -newMessage, newMessage_ :: Ptr Message - -> IO Message -newMessage = mkNewMiniObject Message -newMessage_ = mkNewMiniObject_ Message - -castToMessage :: MiniObjectClass obj - => obj - -> Message -castToMessage = - castToMini {# call fun unsafe gst_message_get_type #} "Message" - hunk ./gstreamer/Media/Streaming/GStreamer/Core/Types.chs 508 -{#pointer *GstQuery as Query foreign newtype #} hunk ./gstreamer/Media/Streaming/GStreamer/Core/Types.chs 510 -mkQuery = Query -unQuery (Query o) = o - -withQuery :: Query - -> (Ptr Query -> IO a) - -> IO a -withQuery = withForeignPtr . unQuery - -isQuery :: MiniObjectClass obj - => obj - -> Bool -isQuery = mkIsMiniObject {# call fun unsafe gst_query_get_type #} - -class MiniObjectClass o => QueryClass o -toQuery :: QueryClass o => o -> Query -toQuery = unsafeCoerce# -fromQuery :: QueryClass o => Query -> o -fromQuery = unsafeCoerce# - -instance QueryClass Query -instance MiniObjectClass Query - -newQuery, newQuery_ :: Ptr Query - -> IO Query -newQuery = mkNewMiniObject Query -newQuery_ = mkNewMiniObject_ Query - -castToQuery :: MiniObjectClass obj - => obj - -> Query -castToQuery = - castToMini {# call fun unsafe gst_query_get_type #} "Query" - hunk ./gstreamer/Media/Streaming/GStreamer/Core/Types.chs 519 -newPtrIterator, newPtrIterator_ :: Ptr PtrIterator +takePtrIterator, peekPtrIterator :: Ptr PtrIterator hunk ./gstreamer/Media/Streaming/GStreamer/Core/Types.chs 521 -newPtrIterator ptrIteratorPtr = +takePtrIterator ptrIteratorPtr = hunk ./gstreamer/Media/Streaming/GStreamer/Core/Types.chs 523 -newPtrIterator_ ptrIteratorPtr = +peekPtrIterator ptrIteratorPtr = hunk ./gstreamer/Media/Streaming/GStreamer/Core/Types.chs 543 -newIterator, newIterator_ :: Ptr PtrIterator +takeIterator, peekIterator :: Ptr PtrIterator hunk ./gstreamer/Media/Streaming/GStreamer/Core/Types.chs 545 -newIterator cPtrIterator = mkIterator newPtrIterator cPtrIterator -newIterator_ cPtrIterator = mkIterator newPtrIterator_ cPtrIter... [truncated message content] |
From: Duncan C. <dun...@wo...> - 2007-08-26 23:29:35
|
Mon Jul 23 15:30:20 PDT 2007 Peter Gavin <pg...@gm...> * tools: added hierarchyGenGst, a modified version of hierarchyGenGst, needed for GStreamer adddir ./tools/hierarchyGenGst hunk ./Makefile.am 73 + tools/hierarchyGenGst/TypeGenerator \ hunk ./Makefile.am 110 +tools_hierarchyGenGst_PKGNAME = tools_hierarchyGenGst_TypeGenerator + +tools_hierarchyGenGst_TypeGenerator_MAIN = \ + $(tools_hierarchyGenGst_TypeGenerator_SOURCES) +tools_hierarchyGenGst_TypeGenerator_EXTERNALDEPS = base +tools_hierarchyGenGst_TypeGenerator_SOURCESDIRS = tools/hierarchyGenGst +tools_hierarchyGenGst_TypeGenerator_SOURCES = \ + tools/hierarchyGenGst/TypeGen.hs +# Fix automake - the subdir-objects option doesn't work here. +am_tools_hierarchyGenGst_TypeGenerator_OBJECTS = $(addsuffix .$(OBJEXT),\ + $(basename $(tools_hierarchyGenGst_TypeGenerator_SOURCES))) +MOSTLYCLEANFILES+= $(am_tools_hierarchyGenGst_TypeGenerator_OBJECTS) +MOSTLYCLEANFILES+= $(tools_hierarchyGenGst_TypeGenerator_SOURCES:.hs=.hi) + addfile ./tools/hierarchyGenGst/TypeGen.hs hunk ./tools/hierarchyGenGst/TypeGen.hs 1 +-- TypeGenerator.hs +-- Takes a hierarchical list of all objects in GTK+ and produces +-- Haskell class that reflect this hierarchy. +module Main (main) where + +import Data.Char (isAlpha, isAlphaNum, toLower, toUpper, isUpper) +import Data.List (isPrefixOf) +import Control.Monad (when) +import System.Environment (getArgs) +import System.Exit (exitWith, ExitCode(..)) + +-- The current object and its inheritence relationship is defined by all +-- ancestors and their column position. +type ObjectSpec = [(Int,String)] + +-- This is a mapping from a type name to a) the type name in Haskell and +-- b) the GTK blah_get_type function. +type TypeQuery = (String, (String, Maybe String)) +type TypeTable = [TypeQuery] + +-- A Tag is a string restricting the generation of type entries to +-- those lines that have the appropriate "if <tag>" at the end. +type Tag = String + +data ParserState = ParserState { + line :: Int, + col :: Int, + hierObjs :: ObjectSpec, + onlyTags :: [Tag] + } + +freshParserState :: [Tag] -> ParserState +freshParserState = ParserState 1 1 [] + +-- The parser returns a list of ObjectSpec and possibly a special type query +-- function. Each ObjectSpec describes one object with all its parents. + +pFreshLine :: ParserState -> String -> [(ObjectSpec, TypeQuery)] +pFreshLine ps input = pFL ps input + where + pFL ps ('#':rem) = pFL ps (dropWhile ((/=) '\n') rem) + pFL ps ('\n':rem) = pFL (ps {line = line ps+1, col=1}) rem + pFL ps (' ':rem) = pFL (ps {col=col ps+1}) rem + pFL ps ('\t':rem) = pFL (ps {col=col ps+8}) rem + pFL ps all@('G':'t':'k':rem)= pGetObject ps all rem + pFL ps all@('G':'d':'k':rem)= pGetObject ps all rem + pFL ps all@('G':'n':'o':'m':'e':rem)= pGetObject ps all rem + pFL ps [] = [] + pFL ps all = pGetObject ps all all + +pGetObject :: ParserState -> String -> String -> [(ObjectSpec, TypeQuery)] +pGetObject ps@ParserState { onlyTags=tags } txt txt' = [_$_] + (if readTag `elem` tags then (:) (spec, specialQuery) else id) $ + pFreshLine (ps { hierObjs=spec}) (dropWhile ((/=) '\n') rem'') + where + isBlank c = c==' ' || c=='\t' + isAlphaNum_ c = isAlphaNum c || c=='_' + isTagName c = isAlphaNum_ c || c=='-' || c=='.' --to allow tag 'gtk-2.4' + (origCName,rem) = span isAlphaNum txt + (origHsName,_) = span isAlphaNum txt' + (name,specialQuery,rem') = case (dropWhile isBlank rem) of + ('a':'s':r) -> + let (tyName,r') = span isAlphaNum_ (dropWhile isBlank r) in + case (dropWhile isBlank r') of + (',':r) -> + let (tyQuery,r') = span isAlphaNum_ (dropWhile isBlank r) in + (tyName, (tyName, (origCName, Just tyQuery)), r') + r -> (tyName, (tyName, (origCName, Nothing)), r) + r -> (origHsName, (origHsName, (origCName, Nothing)), r) + parents = dropWhile (\(c,_) -> c>=col ps) (hierObjs ps) + spec = (col ps,name):parents + (readTag, rem'') = case (dropWhile isBlank rem') of + ('i':'f':r) -> span isTagName (dropWhile isBlank r) + r -> ("default",r) + + +------------------------------------------------------------------------------- +-- Helper functions +------------------------------------------------------------------------------- + +ss = showString +sc = showChar + +indent :: Int -> ShowS +indent c = ss ("\n"++replicate (2*c) ' ') + +------------------------------------------------------------------------------- +-- start of code generation +------------------------------------------------------------------------------- + + +main = do + args <- getArgs + when (length args<3) usage + + ----------------------------------------------------------------------------- + -- Parse command line parameters + -- + let (hierFile: templateFile: goalFile: rem) = args + let tags = map (drop 6) (filter ("--tag=" `isPrefixOf`) rem) + let lib = case map (drop 6) (filter ("--lib=" `isPrefixOf`) rem) of + [] -> "gtk" + (lib:_) -> lib + let prefix = case map (drop 9) (filter ("--prefix=" `isPrefixOf`) rem) of + [] -> "gtk" + (prefix:_) -> prefix + let modName = case map (drop 10) (filter ("--modname=" `isPrefixOf`) rem) of + [] -> bareFName goalFile + (modName:_) -> modName + where bareFName = reverse . + takeWhile isAlphaNum . + drop 1 . + dropWhile isAlpha . + reverse + let parentName = case map (drop 13) (filter ("--parentname=" `isPrefixOf`) rem) of + [] -> "" + (parentName:_) -> parentName + [_$_] + let rootObject = case map (drop 7) (filter ("--root=" `isPrefixOf`) rem) of + [] -> "GObject" + (rootObject:_) -> rootObject + + ----------------------------------------------------------------------------- + -- Read in the input files + -- + content <- if hierFile == "-" + then getContents -- read stdin + else readFile hierFile + template <- readFile templateFile + + ----------------------------------------------------------------------------- + -- Parse the contents of the hierarchy file + -- + let (objs', specialQueries) = unzip $ + pFreshLine (freshParserState tags) content + objs = map (map snd) objs' + + ----------------------------------------------------------------------------- + -- Write the result file by substituting values into the template file + -- + writeFile goalFile $ + templateSubstitute template (\var -> + case var of + "MODULE_NAME" -> ss modName + "MODULE_EXPORTS" -> generateExports objs + "IMPORT_PARENT" -> if null parentName + then ss "" + else ss "{#import " .ss parentName .ss "#}" + "CONTEXT_LIB" -> ss lib + "CONTEXT_PREFIX" -> ss prefix + "CASTING_FUNCTIONS" -> generateCastFunctions rootObject objs specialQueries + "CLASS_DECLERATIONS" -> generateClassDeclerations prefix objs specialQueries + _ -> ss "" + ) "" + + +usage = do + putStr "\nProgram to generate Gtk's object hierarchy in Haskell. Usage:\n\ + \TypeGenerator <hierFile> <templateFile> <outFile> {--tag=<tag>}\n\ + \ {--lib=<lib>} {--prefix=<prefix>}\n\ + \ {--modname=<modName>} {--parentname=<parentName>}\n\ + \where\n\ + \ <hierFile> a list of all possible objects, the hierarchy is\n\ + \ taken from the indentation\n\ + \ <templateFile> is the name and path of the output template file\n\ + \ <outFile> is the name and path of the output file\n\ + \ <tag> generate entries that have the tag <tag>\n\ + \ specify `default' for types without tags\n\ + \ <lib> set the lib to use in the c2hs {#context #}\n\ + \ declaration (the default is \"gtk\")\n\ + \ <prefix> set the prefix to use in the c2hs {#context #}\n\ + \ declaration (the default is \"gtk\")\n\ + \ <modName> specify module name if it does not match the\n\ + \ file name, eg a hierarchical module name\n\ + \ <parentName> specify the name of the module that defines any\n\ + \ parent classes eg Hierarchy (default is none)\n" + exitWith $ ExitFailure 1 + + + +------------------------------------------------------------------------------- +-- generate dynamic fragments +------------------------------------------------------------------------------- + +generateExports :: [[String]] -> ShowS +generateExports objs = + tail. + foldl (\s1 s2 -> s1.ss ", ".s2) id (map (\(n:_) -> [_$_] + indent 1.ss n.ss "(".ss n.ss "), ".ss n.ss "Class,". + indent 1.ss "to".ss n.ss ", ". + indent 1.ss "from".ss n.ss ", ". + indent 1.ss "with".ss n.ss ", ". + indent 1.ss "mk".ss n.ss ", un".ss n.sc ','. + indent 1.ss "castTo".ss n.ss ",". + indent 1.ss "is".ss n.ss ",". + indent 1.ss "peek".ss n.ss ",". + indent 1.ss "take".ss n) objs) + +generateCastFunctions :: String -> [[String]] -> TypeTable -> ShowS +generateCastFunctions rootObject objs typeTable = foldl (.) id (map (makeUpcast rootObject typeTable) objs) + +generateClassDeclerations :: String -> [[String]] -> TypeTable -> ShowS +generateClassDeclerations prefix objs typeTable = foldl (.) id (map (makeClass prefix typeTable) objs) + +makeUpcast :: String -> TypeTable -> [String] -> ShowS +makeUpcast rootObject table [obj] = id -- no casting for GObject +makeUpcast rootObject table (obj:_:_) = [_$_] + indent 0.ss "castTo".ss obj.ss " :: ".ss rootObject.ss "Class obj => obj -> ".ss obj. + indent 0.ss "castTo".ss obj.ss " = mkCastToObject". + indent 1.get_type_func.ss " \"".ss obj.ss "\"". + indent 0.ss "is".ss obj.ss " :: ".ss obj.ss "Class o => o -> Bool". + indent 0.ss "is".ss obj.ss " = mkIsObject ".get_type_func. + indent 0.ss "peek".ss obj.ss " :: Ptr ".ss obj.ss " -> IO ".ss obj. + indent 0.ss "peek".ss obj.ss " = mkPeekObject ".ss obj. + indent 0.ss "take".ss obj.ss " :: Ptr ".ss obj.ss " -> IO ".ss obj. + indent 0.ss "take".ss obj.ss " = mkTakeObject ".ss obj. + indent 0 + where + get_type_func = + ss "{# call fun unsafe ". + ss (case lookup obj table of [_$_] + (Just (_, Just get_type_func)) -> get_type_func + (Just (cname, _)) -> tail $ c2u True cname++"_get_type"). + ss " #}" + -- case to underscore translation: the boolean arg specifies whether + -- the first uppercase letter X is to be replaced by _x (True) or by x. + -- + -- translation: HButtonBox -> hbutton_box + c2u :: Bool -> String -> String + c2u True (x:xs) | isUpper x = '_':toLower x:c2u False xs + c2u False (x:xs) | isUpper x = toLower x:c2u True xs + c2u _ (x:xs) | otherwise = x:c2u True xs + c2u _ [] = [] + +makeOrd fill [] = id +makeOrd fill (obj:preds) = indent 1.ss "compare ".ss obj.ss "Tag ". + fill obj.ss obj.ss "Tag".fill obj. + ss " = EQ".makeGT obj preds + where + makeGT obj [] = id + makeGT obj (pr:eds) = indent 1.ss "compare ".ss obj.ss "Tag ". + fill obj.ss pr.ss "Tag".fill pr. + ss " = GT".makeGT obj eds + +makeClass :: String -> TypeTable -> [String] -> ShowS +makeClass prefix table (name:[]) = id +makeClass prefix table (name:parents) = + indent 0.ss "-- ".ss (replicate (75-length name) '*').sc ' '.ss name. + indent 0. + indent 0.ss "{#pointer *". + (case lookup name table of + (Just (cname, _)) | stripPrefix cname == name -> ss name + | otherwise -> ss cname.ss " as ".ss name + where stripPrefix s = if uCasePrefix `isPrefixOf` s + then drop (length prefix) s + else s + uCasePrefix = toUpper (head prefix) : tail prefix -- gtk -> Gtk + ). + ss " foreign newtype #}". + indent 0. + indent 0.ss "mk".ss name.ss " = ".ss name. + indent 0.ss "un".ss name.ss " (".ss name.ss " o) = o". + indent 0. + indent 0.ss "class ".ss (head parents).ss "Class o => ".ss name.ss "Class o". + indent 0.ss "to".ss name.ss " :: ".ss name.ss "Class o => o -> ".ss name. + indent 0.ss "to".ss name.ss " = unsafeCoerce#". + indent 0.ss "from".ss name.ss " :: ".ss name.ss "Class o => ".ss name.ss " -> o". + indent 0.ss "from".ss name.ss " = unsafeCoerce#". + indent 0.ss "with".ss name.ss " :: ".ss name.ss "Class o => o -> (Ptr ".ss name.ss " -> IO a) -> IO a". + indent 0.ss "with".ss name.ss " = withForeignPtr . un".ss name.ss " . to".ss name. + indent 0. + makeInstance name (name:parents). + indent 0 + +makeInstance :: String -> [String] -> ShowS +makeInstance name [] = indent 0 +makeInstance name (par:ents) = + indent 0.ss "instance ".ss par.ss "Class ".ss name. + makeInstance name ents + +templateSubstitute :: String -> (String -> ShowS) -> ShowS +templateSubstitute template varSubst = doSubst template [_$_] + where doSubst [] = id + doSubst ('\\':'@':cs) = sc '@' . doSubst cs + doSubst ('@':cs) = let (var,_:cs') = span ('@'/=) cs + in varSubst var . doSubst cs' + doSubst (c:cs) = sc c . doSubst cs |
From: Duncan C. <dun...@wo...> - 2007-08-26 23:29:33
|
Sat Jul 21 18:59:17 PDT 2007 Peter Gavin <pg...@gm...> * gstreamer: Core/Types.chs: added isObject (etc.) functions Also renamed newObject/newMiniObject to mkNewObject/mkNewMiniObject & added real newObject/newMiniObject functions. hunk ./gstreamer/Media/Streaming/GStreamer/Core/Message.chs 74 - newObject_ Object + newObject_ hunk ./gstreamer/Media/Streaming/GStreamer/Core/Object.chs 61 -{# import Media.Streaming.GStreamer.Core.Types #} -{# import Media.Streaming.GStreamer.Core.Signals #} +{#import Media.Streaming.GStreamer.Core.Types#} +{#import Media.Streaming.GStreamer.Core.Signals#} hunk ./gstreamer/Media/Streaming/GStreamer/Core/Object.chs 93 - (maybePeek $ newObject Object) + maybePeek newObject hunk ./gstreamer/Media/Streaming/GStreamer/Core/Types.chs 32 + isObject, hunk ./gstreamer/Media/Streaming/GStreamer/Core/Types.chs 46 + isPad, hunk ./gstreamer/Media/Streaming/GStreamer/Core/Types.chs 51 + isGhostPad, hunk ./gstreamer/Media/Streaming/GStreamer/Core/Types.chs 56 + isPluginFeature, hunk ./gstreamer/Media/Streaming/GStreamer/Core/Types.chs 61 + isElementFactory, hunk ./gstreamer/Media/Streaming/GStreamer/Core/Types.chs 66 + isTypeFindFactory, hunk ./gstreamer/Media/Streaming/GStreamer/Core/Types.chs 71 + isIndexFactory, hunk ./gstreamer/Media/Streaming/GStreamer/Core/Types.chs 84 + isElement, hunk ./gstreamer/Media/Streaming/GStreamer/Core/Types.chs 88 + withImplementsInterface, + isImplementsInterface, + newImplementsInterface, + newImplementsInterface_, + [_$_] + withTagSetter, + isTagSetter, + newTagSetter, + newTagSetter_, + [_$_] hunk ./gstreamer/Media/Streaming/GStreamer/Core/Types.chs 99 + isBin, hunk ./gstreamer/Media/Streaming/GStreamer/Core/Types.chs 104 + isPipeline, hunk ./gstreamer/Media/Streaming/GStreamer/Core/Types.chs 109 + isPlugin, hunk ./gstreamer/Media/Streaming/GStreamer/Core/Types.chs 116 + isRegistry, hunk ./gstreamer/Media/Streaming/GStreamer/Core/Types.chs 124 + isBus, hunk ./gstreamer/Media/Streaming/GStreamer/Core/Types.chs 135 + isClock, hunk ./gstreamer/Media/Streaming/GStreamer/Core/Types.chs 144 + isSystemClock, hunk ./gstreamer/Media/Streaming/GStreamer/Core/Types.chs 150 + isIndex, hunk ./gstreamer/Media/Streaming/GStreamer/Core/Types.chs 169 + isPadTemplate, hunk ./gstreamer/Media/Streaming/GStreamer/Core/Types.chs 174 + isTask, hunk ./gstreamer/Media/Streaming/GStreamer/Core/Types.chs 179 + isXML, hunk ./gstreamer/Media/Streaming/GStreamer/Core/Types.chs 183 + withChildProxy, + isChildProxy, + newChildProxy, + newChildProxy_, + [_$_] + withURIHandler, + isURIHandler, + [_$_] hunk ./gstreamer/Media/Streaming/GStreamer/Core/Types.chs 196 + isMiniObject, hunk ./gstreamer/Media/Streaming/GStreamer/Core/Types.chs 209 + isBuffer, hunk ./gstreamer/Media/Streaming/GStreamer/Core/Types.chs 221 + isEvent, hunk ./gstreamer/Media/Streaming/GStreamer/Core/Types.chs 234 + isMessage, hunk ./gstreamer/Media/Streaming/GStreamer/Core/Types.chs 247 + isQuery, hunk ./gstreamer/Media/Streaming/GStreamer/Core/Types.chs 309 +{#import System.Glib.GType#} hunk ./gstreamer/Media/Streaming/GStreamer/Core/Types.chs 352 -newObject, newObject_ :: (ObjectClass obj, ObjectClass obj') - => (ForeignPtr obj' -> obj') - -> Ptr obj - -> IO obj' --- | Use 'newObject_' when a function returns an object that is owned --- elsewhere, or objects with floating references. -newObject_ cons cObject = +mkIsObject :: GObjectClass obj + => GType + -> obj + -> Bool +mkIsObject gType obj = + unsafePerformIO $ + withForeignPtr (unGObject $ toGObject obj) $ \objPtr -> + return $ typeInstanceIsA (castPtr objPtr) gType + +mkNewObject, mkNewObject_ :: (ObjectClass obj, ObjectClass obj') + => (ForeignPtr obj' -> obj') + -> Ptr obj + -> IO obj' +mkNewObject_ cons cObject = hunk ./gstreamer/Media/Streaming/GStreamer/Core/Types.chs 375 +mkNewObject cons cObject = + liftM (cons . castForeignPtr) $ + newForeignPtr (castPtr cObject) objectFinalizer + +isObject :: ObjectClass obj + => obj + -> Bool +isObject = mkIsObject {# call fun unsafe gst_object_get_type #} + hunk ./gstreamer/Media/Streaming/GStreamer/Core/Types.chs 387 -newObject cons cObject = - liftM (cons . castForeignPtr) $ - newForeignPtr (castPtr cObject) objectFinalizer +newObject, newObject_ :: Ptr Object + -> IO Object +newObject = mkNewObject Object + +-- | Use 'newObject_' when a function returns an object that is owned +-- elsewhere, or objects with floating references. +newObject_ = mkNewObject_ Object hunk ./gstreamer/Media/Streaming/GStreamer/Core/Types.chs 421 +isPad :: ObjectClass obj + => obj + -> Bool +isPad = mkIsObject {# call fun unsafe gst_pad_get_type #} + hunk ./gstreamer/Media/Streaming/GStreamer/Core/Types.chs 428 -newPad = newObject Pad -newPad_ = newObject_ Pad +newPad = mkNewObject Pad +newPad_ = mkNewObject_ Pad hunk ./gstreamer/Media/Streaming/GStreamer/Core/Types.chs 471 +isGhostPad :: ObjectClass obj + => obj + -> Bool +isGhostPad = mkIsObject {# call fun unsafe gst_ghost_pad_get_type #} + hunk ./gstreamer/Media/Streaming/GStreamer/Core/Types.chs 478 -newGhostPad = newObject GhostPad -newGhostPad_ = newObject_ GhostPad +newGhostPad = mkNewObject GhostPad +newGhostPad_ = mkNewObject_ GhostPad hunk ./gstreamer/Media/Streaming/GStreamer/Core/Types.chs 488 +isPluginFeature :: ObjectClass obj + => obj + -> Bool +isPluginFeature = mkIsObject {# call fun unsafe gst_plugin_feature_get_type #} + hunk ./gstreamer/Media/Streaming/GStreamer/Core/Types.chs 495 -newPluginFeature = newObject PluginFeature -newPluginFeature_ = newObject_ PluginFeature +newPluginFeature = mkNewObject PluginFeature +newPluginFeature_ = mkNewObject_ PluginFeature hunk ./gstreamer/Media/Streaming/GStreamer/Core/Types.chs 507 +isElementFactory :: ObjectClass obj + => obj + -> Bool +isElementFactory = mkIsObject {# call fun unsafe gst_element_factory_get_type #} + hunk ./gstreamer/Media/Streaming/GStreamer/Core/Types.chs 514 -newElementFactory = newObject ElementFactory -newElementFactory_ = newObject_ ElementFactory +newElementFactory = mkNewObject ElementFactory +newElementFactory_ = mkNewObject_ ElementFactory hunk ./gstreamer/Media/Streaming/GStreamer/Core/Types.chs 524 +isTypeFindFactory :: ObjectClass obj + => obj + -> Bool +isTypeFindFactory = mkIsObject {# call fun unsafe gst_type_find_factory_get_type #} + hunk ./gstreamer/Media/Streaming/GStreamer/Core/Types.chs 531 -newTypeFindFactory = newObject TypeFindFactory -newTypeFindFactory_ = newObject_ TypeFindFactory +newTypeFindFactory = mkNewObject TypeFindFactory +newTypeFindFactory_ = mkNewObject_ TypeFindFactory hunk ./gstreamer/Media/Streaming/GStreamer/Core/Types.chs 541 +isIndexFactory :: ObjectClass obj + => obj + -> Bool +isIndexFactory = mkIsObject {# call fun unsafe gst_index_factory_get_type #} + hunk ./gstreamer/Media/Streaming/GStreamer/Core/Types.chs 548 -newIndexFactory = newObject IndexFactory -newIndexFactory_ = newObject_ IndexFactory +newIndexFactory = mkNewObject IndexFactory +newIndexFactory_ = mkNewObject_ IndexFactory hunk ./gstreamer/Media/Streaming/GStreamer/Core/Types.chs 557 + +isElement :: ObjectClass obj + => obj + -> Bool +isElement = mkIsObject {# call fun unsafe gst_element_get_type #} + hunk ./gstreamer/Media/Streaming/GStreamer/Core/Types.chs 565 -newElement = newObject Element -newElement_ = newObject_ Element +newElement = mkNewObject Element +newElement_ = mkNewObject_ Element hunk ./gstreamer/Media/Streaming/GStreamer/Core/Types.chs 626 + +isImplementsInterface :: ObjectClass obj + => obj + -> Bool +isImplementsInterface = mkIsObject {# call fun unsafe gst_implements_interface_get_type #} + hunk ./gstreamer/Media/Streaming/GStreamer/Core/Types.chs 634 -newImplementsInterface = newObject ImplementsInterface -newImplementsInterface_ = newObject_ ImplementsInterface +newImplementsInterface = mkNewObject ImplementsInterface +newImplementsInterface_ = mkNewObject_ ImplementsInterface hunk ./gstreamer/Media/Streaming/GStreamer/Core/Types.chs 643 + +isTagSetter :: ObjectClass obj + => obj + -> Bool +isTagSetter = mkIsObject {# call fun unsafe gst_tag_setter_get_type #} + hunk ./gstreamer/Media/Streaming/GStreamer/Core/Types.chs 650 - -> IO TagSetter -newTagSetter = newObject TagSetter -newTagSetter_ = newObject_ TagSetter + -> IO TagSetter +newTagSetter = mkNewObject TagSetter +newTagSetter_ = mkNewObject_ TagSetter hunk ./gstreamer/Media/Streaming/GStreamer/Core/Types.chs 660 + +isBin :: ObjectClass obj + => obj + -> Bool +isBin = mkIsObject {# call fun unsafe gst_bin_get_type #} + hunk ./gstreamer/Media/Streaming/GStreamer/Core/Types.chs 668 -newBin = newObject Bin -newBin_ = newObject_ Bin +newBin = mkNewObject Bin +newBin_ = mkNewObject_ Bin hunk ./gstreamer/Media/Streaming/GStreamer/Core/Types.chs 677 + +isPipeline :: ObjectClass obj + => obj + -> Bool +isPipeline = mkIsObject {# call fun unsafe gst_index_factory_get_type #} + hunk ./gstreamer/Media/Streaming/GStreamer/Core/Types.chs 685 -newPipeline = newObject Pipeline -newPipeline_ = newObject_ Pipeline +newPipeline = mkNewObject Pipeline +newPipeline_ = mkNewObject_ Pipeline hunk ./gstreamer/Media/Streaming/GStreamer/Core/Types.chs 694 + +isPlugin :: ObjectClass obj + => obj + -> Bool +isPlugin = mkIsObject {# call fun unsafe gst_plugin_get_type #} + hunk ./gstreamer/Media/Streaming/GStreamer/Core/Types.chs 702 -newPlugin = newObject Plugin -newPlugin_ = newObject_ Plugin +newPlugin = mkNewObject Plugin +newPlugin_ = mkNewObject_ Plugin hunk ./gstreamer/Media/Streaming/GStreamer/Core/Types.chs 711 + +isRegistry :: ObjectClass obj + => obj + -> Bool +isRegistry = mkIsObject {# call fun unsafe gst_registry_get_type #} + hunk ./gstreamer/Media/Streaming/GStreamer/Core/Types.chs 719 -newRegistry = newObject Registry -newRegistry_ = newObject_ Registry +newRegistry = mkNewObject Registry +newRegistry_ = mkNewObject_ Registry hunk ./gstreamer/Media/Streaming/GStreamer/Core/Types.chs 744 + +isBus :: ObjectClass obj + => obj + -> Bool +isBus = mkIsObject {# call fun unsafe gst_bus_get_type #} + hunk ./gstreamer/Media/Streaming/GStreamer/Core/Types.chs 752 -newBus = newObject Bus -newBus_ = newObject_ Bus +newBus = mkNewObject Bus +newBus_ = mkNewObject_ Bus hunk ./gstreamer/Media/Streaming/GStreamer/Core/Types.chs 762 +isClock :: ObjectClass obj + => obj + -> Bool +isClock = mkIsObject {# call fun unsafe gst_clock_get_type #} + hunk ./gstreamer/Media/Streaming/GStreamer/Core/Types.chs 769 -newClock = newObject Clock -newClock_ = newObject_ Clock +newClock = mkNewObject Clock +newClock_ = mkNewObject_ Clock hunk ./gstreamer/Media/Streaming/GStreamer/Core/Types.chs 826 -newSystemClock = newObject SystemClock -newSystemClock_ = newObject_ SystemClock + +isSystemClock :: ObjectClass obj + => obj + -> Bool +isSystemClock = mkIsObject {# call fun unsafe gst_system_clock_get_type #} + +newSystemClock = mkNewObject SystemClock +newSystemClock_ = mkNewObject_ SystemClock hunk ./gstreamer/Media/Streaming/GStreamer/Core/Types.chs 842 +isIndex :: ObjectClass obj + => obj + -> Bool +isIndex = mkIsObject {# call fun unsafe gst_index_get_type #} + hunk ./gstreamer/Media/Streaming/GStreamer/Core/Types.chs 849 -newIndex = newObject Index -newIndex_ = newObject_ Index +newIndex = mkNewObject Index +newIndex_ = mkNewObject_ Index hunk ./gstreamer/Media/Streaming/GStreamer/Core/Types.chs 914 +isPadTemplate :: ObjectClass obj + => obj + -> Bool +isPadTemplate = mkIsObject {# call fun unsafe gst_pad_template_get_type #} + hunk ./gstreamer/Media/Streaming/GStreamer/Core/Types.chs 921 -newPadTemplate = newObject PadTemplate -newPadTemplate_ = newObject_ PadTemplate +newPadTemplate = mkNewObject PadTemplate +newPadTemplate_ = mkNewObject_ PadTemplate hunk ./gstreamer/Media/Streaming/GStreamer/Core/Types.chs 930 + +isTask :: ObjectClass obj + => obj + -> Bool +isTask = mkIsObject {# call fun unsafe gst_task_get_type #} + hunk ./gstreamer/Media/Streaming/GStreamer/Core/Types.chs 938 -newTask = newObject Task -newTask_ = newObject_ Task +newTask = mkNewObject Task +newTask_ = mkNewObject_ Task hunk ./gstreamer/Media/Streaming/GStreamer/Core/Types.chs 947 + +isXML :: ObjectClass obj + => obj + -> Bool +isXML = mkIsObject {# call fun unsafe gst_xml_get_type #} + hunk ./gstreamer/Media/Streaming/GStreamer/Core/Types.chs 955 -newXML = newObject XML -newXML_ = newObject_ XML +newXML = mkNewObject XML +newXML_ = mkNewObject_ XML hunk ./gstreamer/Media/Streaming/GStreamer/Core/Types.chs 964 + +isChildProxy :: ObjectClass obj + => obj + -> Bool +isChildProxy = mkIsObject {# call fun unsafe gst_child_proxy_get_type #} + hunk ./gstreamer/Media/Streaming/GStreamer/Core/Types.chs 972 -newChildProxy = newObject ChildProxy -newChildProxy_ = newObject_ ChildProxy +newChildProxy = mkNewObject ChildProxy +newChildProxy_ = mkNewObject_ ChildProxy hunk ./gstreamer/Media/Streaming/GStreamer/Core/Types.chs 982 +isURIHandler :: ObjectClass obj + => obj + -> Bool +isURIHandler = mkIsObject {# call fun unsafe gst_uri_handler_get_type #} + hunk ./gstreamer/Media/Streaming/GStreamer/Core/Types.chs 1001 +mkIsMiniObject :: MiniObjectClass obj + => GType + -> obj + -> Bool +mkIsMiniObject gType obj = + unsafePerformIO $ withMiniObject (toMiniObject obj) $ \objPtr -> + return $ typeInstanceIsA (castPtr objPtr) gType + +isMiniObject :: MiniObjectClass obj + => obj + -> Bool +isMiniObject = mkIsMiniObject {# call fun unsafe gst_mini_object_get_type #} + hunk ./gstreamer/Media/Streaming/GStreamer/Core/Types.chs 1040 -newMiniObject, newMiniObject_ :: (MiniObjectClass obj, MiniObjectClass obj') - => (ForeignPtr obj' -> obj') - -> Ptr obj - -> IO obj' --- | Use 'newMiniObject_' when a function returns an object that is owned --- elsewhere. -newMiniObject_ cons cObject = +mkNewMiniObject, mkNewMiniObject_ :: (MiniObjectClass obj, MiniObjectClass obj') + => (ForeignPtr obj' -> obj') + -> Ptr obj + -> IO obj' +mkNewMiniObject_ cons cObject = hunk ./gstreamer/Media/Streaming/GStreamer/Core/Types.chs 1054 +mkNewMiniObject cons cObject = + liftM (cons . castForeignPtr) $ + newForeignPtr (castPtr cObject) miniObjectFinalizer + +newMiniObject, newMiniObject_ :: Ptr MiniObject + -> IO MiniObject + hunk ./gstreamer/Media/Streaming/GStreamer/Core/Types.chs 1064 -newMiniObject cons cObject = - liftM (cons . castForeignPtr) $ - newForeignPtr (castPtr cObject) miniObjectFinalizer +newMiniObject = mkNewMiniObject MiniObject + +-- | Use 'newMiniObject_' when a function returns an object that is owned +-- elsewhere. +newMiniObject_ = mkNewMiniObject_ MiniObject hunk ./gstreamer/Media/Streaming/GStreamer/Core/Types.chs 1092 +isBuffer :: MiniObjectClass obj + => obj + -> Bool +isBuffer = mkIsMiniObject {# call fun unsafe gst_buffer_get_type #} + hunk ./gstreamer/Media/Streaming/GStreamer/Core/Types.chs 1108 -newBuffer = newMiniObject Buffer -newBuffer_ = newMiniObject_ Buffer +newBuffer = mkNewMiniObject Buffer +newBuffer_ = mkNewMiniObject_ Buffer hunk ./gstreamer/Media/Streaming/GStreamer/Core/Types.chs 1129 +isEvent :: MiniObjectClass obj + => obj + -> Bool +isEvent = mkIsMiniObject {# call fun unsafe gst_event_get_type #} + hunk ./gstreamer/Media/Streaming/GStreamer/Core/Types.chs 1145 -newEvent = newMiniObject Event -newEvent_ = newMiniObject_ Event +newEvent = mkNewMiniObject Event +newEvent_ = mkNewMiniObject_ Event hunk ./gstreamer/Media/Streaming/GStreamer/Core/Types.chs 1235 +isMessage :: MiniObjectClass obj + => obj + -> Bool +isMessage = mkIsMiniObject {# call fun unsafe gst_message_get_type #} + hunk ./gstreamer/Media/Streaming/GStreamer/Core/Types.chs 1251 -newMessage = newMiniObject Message -newMessage_ = newMiniObject_ Message +newMessage = mkNewMiniObject Message +newMessage_ = mkNewMiniObject_ Message hunk ./gstreamer/Media/Streaming/GStreamer/Core/Types.chs 1273 +isQuery :: MiniObjectClass obj + => obj + -> Bool +isQuery = mkIsMiniObject {# call fun unsafe gst_query_get_type #} + hunk ./gstreamer/Media/Streaming/GStreamer/Core/Types.chs 1289 -newQuery = newMiniObject Query -newQuery_ = newMiniObject_ Query +newQuery = mkNewMiniObject Query +newQuery_ = mkNewMiniObject_ Query |
From: Duncan C. <dun...@wo...> - 2007-08-26 23:29:31
|
Sat Jul 21 17:46:23 PDT 2007 Peter Gavin <pg...@gm...> * gstreamer: add attributes & properties to GObject subclasses; small code cleanups; add hierarchy for GStreamer.Base hunk ./Makefile.am 1916 - $@ --tag=gstreamer --lib=gstreamer --prefix=gstreamer \ + $@ --tag=gstreamer-core --lib=gstreamer --prefix=gstreamer \ hunk ./Makefile.am 1919 +gstreamer/Media/Streaming/GStreamer/Base/Hierarchy.chs : \ + $(srcdir)/tools/hierarchyGen/hierarchy.list \ + $(srcdir)/tools/hierarchyGen/TypeGenerator$(EXEEXT) \ + $(srcdir)/tools/hierarchyGen/Hierarchy.chs.template + $(strip $(srcdir)/tools/hierarchyGen/TypeGenerator$(EXEEXT) \ + $(srcdir)/tools/hierarchyGen/hierarchy.list \ + $(srcdir)/tools/hierarchyGen/Hierarchy.chs.template \ + $@ --tag=gstreamer-base --lib=gstreamer --prefix=gstreamer \ + --modname=Media.Streaming.GStreamer.Base.Hierarchy --parentname=Media.Streaming.GStreamer.Base.Hierarchy) + addfile ./gstreamer/Media/Streaming/GStreamer.hs hunk ./gstreamer/Media/Streaming/GStreamer.hs 1 +-- GIMP Toolkit (GTK) Binding for Haskell: binding to gstreamer -*-haskell-*- +-- +-- Author : Peter Gavin +-- Created: 1-Apr-2007 +-- +-- Copyright (c) 2007 Peter Gavin +-- +-- This library is free software; you can redistribute it and/or +-- modify it under the terms of the GNU Library General Public +-- License as published by the Free Software Foundation; either +-- version 2 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 +-- Library General Public License for more details. +-- +module Media.Streaming.GStreamer ( + [_$_] + module Media.Streaming.GStreamer.Core + [_$_] + ) where + +import Media.Streaming.GStreamer.Core hunk ./gstreamer/Media/Streaming/GStreamer/Core/Bin.chs 38 - binFindUnconnectedPad + binFindUnconnectedPad, + [_$_] + onBinElementAdded, + afterBinElementAdded, + onBinElementRemoved, + afterBinElementRemoved hunk ./gstreamer/Media/Streaming/GStreamer/Core/Bus.chs 38 - busPoll + busPoll, + [_$_] + onBusMessage, + afterBusMessage + [_$_] hunk ./gstreamer/Media/Streaming/GStreamer/Core/Bus.chs 86 - {# call bus_timed_pop #} bus timeout >>= maybePeek newMessage + {# call bus_timed_pop #} bus (fromIntegral timeout) >>= + maybePeek newMessage hunk ./gstreamer/Media/Streaming/GStreamer/Core/Bus.chs 151 - {# call bus_poll #} bus (fromIntegral $ fromFlags events) timeout >>= + {# call bus_poll #} bus + (fromIntegral $ fromFlags events) + (fromIntegral timeout) >>= hunk ./gstreamer/Media/Streaming/GStreamer/Core/Clock.chs 38 - clockIDUnschedule + clockIDUnschedule, + [_$_] + clockTimeout, + clockWindowSize, + clockWindowThreshold hunk ./gstreamer/Media/Streaming/GStreamer/Core/Clock.chs 53 +import System.Glib.Attributes ( Attr + , newAttr ) +import System.Glib.Properties hunk ./gstreamer/Media/Streaming/GStreamer/Core/Clock.chs 192 +clockTimeout :: ClockClass clockT + => Attr clockT ClockTime +clockTimeout = newAttr + (objectGetPropertyUInt64 "timeout") + (objectSetPropertyUInt64 "timeout") + +clockWindowSize :: ClockClass clockT + => Attr clockT Int +clockWindowSize = + newAttrFromIntProperty "window-size" + +clockWindowThreshold :: ClockClass clockT + => Attr clockT Int +clockWindowThreshold = + newAttrFromIntProperty "window-threshold" hunk ./gstreamer/Media/Streaming/GStreamer/Core/Object.chs 39 - objectUnlock - + objectUnlock, + [_$_] + onObjectParentSet, + afterObjectParentSet, + onObjectParentUnset, + afterObjectParentUnset, + [_$_] + objectName + [_$_] hunk ./gstreamer/Media/Streaming/GStreamer/Core/Object.chs 58 +import System.Glib.Properties ( newAttrFromMaybeStringProperty ) +import System.Glib.Attributes ( Attr ) +import System.Glib.Signals hunk ./gstreamer/Media/Streaming/GStreamer/Core/Object.chs 62 +{# import Media.Streaming.GStreamer.Core.Signals #} hunk ./gstreamer/Media/Streaming/GStreamer/Core/Object.chs 168 +onObjectParentSet, afterObjectParentSet :: ObjectClass objectT + => objectT + -> (GObject -> IO ()) + -> IO (ConnectId objectT) +onObjectParentSet = + connect_OBJECT__NONE "parent-set" False +afterObjectParentSet = + connect_OBJECT__NONE "parent-set" True + +onObjectParentUnset, afterObjectParentUnset :: ObjectClass objectT + => objectT + -> (GObject -> IO ()) + -> IO (ConnectId objectT) +onObjectParentUnset = + connect_OBJECT__NONE "parent-unset" False +afterObjectParentUnset = + connect_OBJECT__NONE "parent-unset" True + +objectName :: ObjectClass objectT + => Attr objectT (Maybe String) +objectName = newAttrFromMaybeStringProperty "name" + hunk ./gstreamer/Media/Streaming/GStreamer/Core/Pad.chs 66 - padGetInternalLinks, hunk ./gstreamer/Media/Streaming/GStreamer/Core/Pad.chs 71 - afterPadUnlinked + afterPadUnlinked, + [_$_] + padCaps, + padDirection, + padTemplate, hunk ./gstreamer/Media/Streaming/GStreamer/Core/Pad.chs 86 +import System.Glib.Properties ( objectGetPropertyGObject ) +import System.Glib.Attributes ( ReadAttr + , readAttr ) hunk ./gstreamer/Media/Streaming/GStreamer/Core/Pad.chs 384 -padGetInternalLinks :: PadClass pad - => pad - -> IO [Pad] -padGetInternalLinks pad = - {# call pad_get_internal_links #} (toPad pad) >>= - fromGList >>= - mapM newPad_ - hunk ./gstreamer/Media/Streaming/GStreamer/Core/Pad.chs 411 +padCaps :: PadClass pad + => ReadAttr pad Caps +padCaps = readAttr + padGetCaps + +padDirection :: PadClass pad + => ReadAttr pad PadDirection +padDirection = readAttr + padGetDirection + +padTemplate :: PadClass pad + => ReadAttr pad PadTemplate +padTemplate = readAttr $ + objectGetPropertyGObject {# call fun gst_pad_template_get_type #} + "template" + +padParentElement :: PadClass pad + => ReadAttr pad Element +padParentElement = readAttr + padGetParentElement + +padQueryTypes :: PadClass pad + => ReadAttr pad [QueryType] +padQueryTypes = readAttr + padGetQueryTypes hunk ./gstreamer/Media/Streaming/GStreamer/Core/PadTemplate.chs 33 - padTemplateGetPresence + padTemplateGetPresence, + [_$_] + onPadTemplatePadCreated, + afterPadTemplatePadCreated hunk ./gstreamer/Media/Streaming/GStreamer/Core/PadTemplate.chs 42 +{#import Media.Streaming.GStreamer.Core.Signals#} hunk ./gstreamer/Media/Streaming/GStreamer/Core/PadTemplate.chs 45 +import System.Glib.Signals hunk ./gstreamer/Media/Streaming/GStreamer/Core/PadTemplate.chs 91 +onPadTemplatePadCreated, afterPadTemplatePadCreated :: PadTemplateClass padTemplateT + => padTemplateT + -> (Pad -> IO ()) + -> IO (ConnectId padTemplateT) +onPadTemplatePadCreated = + connect_OBJECT__NONE "pad-created" False +afterPadTemplatePadCreated = + connect_OBJECT__NONE "pad-created" True + hunk ./gstreamer/Media/Streaming/GStreamer/Core/Pipeline.chs 33 - pipelineGetDelay + pipelineGetDelay, + [_$_] + pipelineAutoFlushBus, + pipelineDelay hunk ./gstreamer/Media/Streaming/GStreamer/Core/Pipeline.chs 43 +import System.Glib.Attributes ( Attr + , newAttr ) hunk ./gstreamer/Media/Streaming/GStreamer/Core/Pipeline.chs 119 +pipelineAutoFlushBus :: PipelineClass pipelineT + => Attr pipelineT Bool +pipelineAutoFlushBus = newAttr + pipelineGetAutoFlushBus + pipelineSetAutoFlushBus + +pipelineDelay :: PipelineClass pipelineT + => Attr pipelineT ClockTime +pipelineDelay = newAttr + pipelineGetDelay + pipelineSetDelay + hunk ./gstreamer/Media/Streaming/GStreamer/Core/Plugin.chs 35 + [_$_] + pluginName, + pluginDescription, + pluginFilename, + pluginLicense, + pluginPackage, + pluginOrigin, + pluginSource, + pluginVersion + [_$_] hunk ./gstreamer/Media/Streaming/GStreamer/Core/Plugin.chs 51 +import System.Glib.Attributes ( ReadAttr + , readAttr ) hunk ./gstreamer/Media/Streaming/GStreamer/Core/Plugin.chs 111 +pluginName :: PluginClass plugin + => ReadAttr plugin String +pluginName = readAttr pluginGetName + +pluginDescription :: PluginClass plugin + => ReadAttr plugin String +pluginDescription = readAttr pluginGetDescription + +pluginFilename :: PluginClass plugin + => ReadAttr plugin FilePath +pluginFilename = readAttr pluginGetFilename + +pluginLicense :: PluginClass plugin + => ReadAttr plugin String +pluginLicense = readAttr pluginGetLicense + +pluginPackage :: PluginClass plugin + => ReadAttr plugin String +pluginPackage = readAttr pluginGetPackage + +pluginOrigin :: PluginClass plugin + => ReadAttr plugin String +pluginOrigin = readAttr pluginGetOrigin + +pluginSource :: PluginClass plugin + => ReadAttr plugin String +pluginSource = readAttr pluginGetSource + +pluginVersion :: PluginClass plugin + => ReadAttr plugin String +pluginVersion = readAttr pluginGetVersion + hunk ./tools/hierarchyGen/hierarchy.list 225 - GstObject as Object, gst_object_get_type if gstreamer - GstPad as Pad, gst_pad_get_type if gstreamer - GstGhostPad as GhostPad, gst_ghost_pad_get_type if gstreamer - GstPluginFeature as PluginFeature, gst_plugin_feature_get_type if gstreamer - GstElementFactory as ElementFactory, gst_element_factory_get_type if gstreamer - GstTypeFindFactory as TypeFindFactory, gst_type_find_factory_get_type if gstreamer - GstIndexFactory as IndexFactory, gst_index_factory_get_type if gstreamer - GstElement as Element, gst_element_get_type if gstreamer - GstBin as Bin, gst_bin_get_type if gstreamer - GstPipeline as Pipeline, gst_pipeline_get_type if gstreamer - GstImplementsInterface as ImplementsInterface, gst_implements_interface_get_type if gstreamer - GstTagSetter as TagSetter, gst_tag_setter_get_type if gstreamer - GstPlugin as Plugin, gst_plugin_get_type if gstreamer - GstRegistry as Registry, gst_registry_get_type if gstreamer - GstBus as Bus, gst_bus_get_type if gstreamer - GstClock as Clock, gst_clock_get_type if gstreamer - GstSystemClock as SystemClock, gst_system_clock_get_type if gstreamer - GstIndex as Index, gst_index_get_type if gstreamer - GstPadTemplate as PadTemplate, gst_pad_template_get_type if gstreamer - GstTask as Task, gst_task_get_type if gstreamer - GstXML as XML, gst_xml_get_type if gstreamer - GstChildProxy as ChildProxy, gst_child_proxy_get_type if gstreamer + GstObject as Object, gst_object_get_type if gstreamer-core + GstPad as Pad, gst_pad_get_type if gstreamer-core + GstGhostPad as GhostPad, gst_ghost_pad_get_type if gstreamer-core + GstPluginFeature as PluginFeature, gst_plugin_feature_get_type if gstreamer-core + GstElementFactory as ElementFactory, gst_element_factory_get_type if gstreamer-core + GstTypeFindFactory as TypeFindFactory, gst_type_find_factory_get_type if gstreamer-core + GstIndexFactory as IndexFactory, gst_index_factory_get_type if gstreamer-core + GstElement as Element, gst_element_get_type if gstreamer-core + GstBin as Bin, gst_bin_get_type if gstreamer-core + GstPipeline as Pipeline, gst_pipeline_get_type if gstreamer-core + GstImplementsInterface as ImplementsInterface, gst_implements_interface_get_type if gstreamer-core + GstTagSetter as TagSetter, gst_tag_setter_get_type if gstreamer-core + GstBaseSrc as BaseSrc, gst_base_src_get_type if gstreamer-base + GstPushSrc as PushSrc, gst_push_src_get_type if gstreamer-base + GstBaseSink as BaseSink, gst_base_sink_get_type if gstreamer-base + GstBaseTransform as BaseTransform, gst_base_transform_get_type if gstreamer-base + GstPlugin as Plugin, gst_plugin_get_type if gstreamer-core + GstRegistry as Registry, gst_registry_get_type if gstreamer-core + GstBus as Bus, gst_bus_get_type if gstreamer-core + GstClock as Clock, gst_clock_get_type if gstreamer-core + GstSystemClock as SystemClock, gst_system_clock_get_type if gstreamer-core + GstIndex as Index, gst_index_get_type if gstreamer-core + GstPadTemplate as PadTemplate, gst_pad_template_get_type if gstreamer-core + GstTask as Task, gst_task_get_type if gstreamer-core + GstXML as XML, gst_xml_get_type if gstreamer-core + GstChildProxy as ChildProxy, gst_child_proxy_get_type if gstreamer-core + GstCollectPads as CollectPads, gst_collect_pads_get_type if gstreamer-base hunk ./tools/hierarchyGen/hierarchy.list 253 - GstURIHandler as URIHandler, gst_uri_handler_get_type if gstreamer + GstURIHandler as URIHandler, gst_uri_handler_get_type if gstreamer-core + GstController as Controller, gst_controller_get_type if gstreamer-base + GstAdapter as Adapter, gst_adapter_get_type if gstreamer-base |
From: Duncan C. <dun...@wo...> - 2007-08-26 23:29:30
|
Sat Jul 21 14:42:52 PDT 2007 Peter Gavin <pg...@gm...> * gstreamer: change ClockTime/ClockTimeDiff to Word64/Int64 instead of c2hs types hunk ./gstreamer/Media/Streaming/GStreamer/Core/Clock.chs 42 +import Data.Ratio ( Ratio + , (%) + , numerator + , denominator ) hunk ./gstreamer/Media/Streaming/GStreamer/Core/Clock.chs 59 - do success <- {# call clock_add_observation #} (toClock clock) slave master rSquaredPtr + do success <- {# call clock_add_observation #} (toClock clock) + (fromIntegral slave) + (fromIntegral master) + rSquaredPtr hunk ./gstreamer/Media/Streaming/GStreamer/Core/Clock.chs 84 -clockSetResolution = - {# call clock_set_resolution #} . toClock +clockSetResolution clock resolution = + liftM fromIntegral $ + {# call clock_set_resolution #} (toClock clock) + (fromIntegral resolution) hunk ./gstreamer/Media/Streaming/GStreamer/Core/Clock.chs 92 -clockGetResolution = - {# call clock_get_resolution #} . toClock +clockGetResolution clock = + liftM fromIntegral $ + {# call clock_get_resolution #} (toClock clock) hunk ./gstreamer/Media/Streaming/GStreamer/Core/Clock.chs 99 -clockGetTime = - {# call clock_get_time #} . toClock +clockGetTime clock = + liftM fromIntegral $ + {# call clock_get_time #} (toClock clock) hunk ./gstreamer/Media/Streaming/GStreamer/Core/Clock.chs 108 - {# call clock_new_single_shot_id #} (toClock clock) time >>= + {# call clock_new_single_shot_id #} (toClock clock) + (fromIntegral time) >>= hunk ./gstreamer/Media/Streaming/GStreamer/Core/Clock.chs 118 - {# call clock_new_periodic_id #} (toClock clock) startTime interval >>= + {# call clock_new_periodic_id #} (toClock clock) + (fromIntegral startTime) + (fromIntegral interval) >>= hunk ./gstreamer/Media/Streaming/GStreamer/Core/Clock.chs 126 -clockGetInternalTime = - {# call clock_get_internal_time #} . toClock +clockGetInternalTime clock = + liftM fromIntegral $ + {# call clock_get_internal_time #} (toClock clock) hunk ./gstreamer/Media/Streaming/GStreamer/Core/Clock.chs 132 - -> IO (ClockTime, ClockTime, ClockTime, ClockTime) + -> IO (ClockTime, ClockTime, Ratio ClockTime) hunk ./gstreamer/Media/Streaming/GStreamer/Core/Clock.chs 143 - liftM4 (\a b c d -> (a, b, c, d)) + liftM4 (\a b c d -> + (fromIntegral a, + fromIntegral b, + (fromIntegral c) % (fromIntegral d))) hunk ./gstreamer/Media/Streaming/GStreamer/Core/Clock.chs 156 - -> ClockTime - -> ClockTime + -> Ratio ClockTime hunk ./gstreamer/Media/Streaming/GStreamer/Core/Clock.chs 158 -clockSetCalibration = - {# call clock_set_calibration #} . toClock +clockSetCalibration clock internal external rate = + {# call clock_set_calibration #} (toClock clock) + (fromIntegral internal) + (fromIntegral external) + (fromIntegral $ numerator rate) + (fromIntegral $ denominator rate) hunk ./gstreamer/Media/Streaming/GStreamer/Core/Clock.chs 168 - withClockID clockID $ {# call clock_id_get_time #} . castPtr + liftM fromIntegral $ withClockID clockID $ + {# call clock_id_get_time #} . castPtr hunk ./gstreamer/Media/Streaming/GStreamer/Core/Clock.chs 178 - return $ (toClockReturn result, jitter) + return $ (toClockReturn result, fromIntegral jitter) hunk ./gstreamer/Media/Streaming/GStreamer/Core/Message.chs 79 - unsafePerformIO $ withMessage message {# get GstMessage->timestamp #} + fromIntegral $ unsafePerformIO $ withMessage message {# get GstMessage->timestamp #} hunk ./gstreamer/Media/Streaming/GStreamer/Core/Pipeline.chs 75 - {# call pipeline_set_new_stream_time #} (toPipeline pipeline) time + {# call pipeline_set_new_stream_time #} (toPipeline pipeline) + (fromIntegral time) hunk ./gstreamer/Media/Streaming/GStreamer/Core/Pipeline.chs 81 -pipelineGetLastStreamTime = - {# call pipeline_get_last_stream_time #} . toPipeline +pipelineGetLastStreamTime pipeline = + liftM fromIntegral $ + {# call pipeline_get_last_stream_time #} (toPipeline pipeline) hunk ./gstreamer/Media/Streaming/GStreamer/Core/Pipeline.chs 104 - {# call pipeline_set_delay #} (toPipeline pipeline) delay + {# call pipeline_set_delay #} (toPipeline pipeline) + (fromIntegral delay) hunk ./gstreamer/Media/Streaming/GStreamer/Core/Pipeline.chs 111 - {# call pipeline_get_delay #} (toPipeline pipeline) + liftM fromIntegral $ + {# call pipeline_get_delay #} (toPipeline pipeline) hunk ./gstreamer/Media/Streaming/GStreamer/Core/Structure.chs 279 - marshalStructureSet {# call g_value_set_uint64 #} + marshalStructureSet $ \gValue clockTime -> + {# call g_value_set_uint64 #} gValue $ fromIntegral clockTime hunk ./gstreamer/Media/Streaming/GStreamer/Core/Types.chs 649 -type ClockTime = {# type GstClockTime #} -type ClockTimeDiff = {# type GstClockTimeDiff #} +type ClockTime = Word64 +type ClockTimeDiff = Int64 |
From: Duncan C. <dun...@wo...> - 2007-08-26 23:29:29
|
Sat Jul 21 11:58:39 PDT 2007 Peter Gavin <pg...@gm...> * gstreamer: move all current modules from Media.Streaming.GStreamer to Media.Streaming.GStreamer.Core I'm anticipating adding other submodules into GStreamer. move ./gstreamer/Media/Streaming/GStreamer.hs ./gstreamer/Media/Streaming/GStreamer/Core.hs adddir ./gstreamer/Media/Streaming/GStreamer/Core move ./gstreamer/Media/Streaming/GStreamer/Bin.chs ./gstreamer/Media/Streaming/GStreamer/Core/Bin.chs move ./gstreamer/Media/Streaming/GStreamer/Bus.chs ./gstreamer/Media/Streaming/GStreamer/Core/Bus.chs move ./gstreamer/Media/Streaming/GStreamer/Caps.chs ./gstreamer/Media/Streaming/GStreamer/Core/Caps.chs move ./gstreamer/Media/Streaming/GStreamer/Clock.chs ./gstreamer/Media/Streaming/GStreamer/Core/Clock.chs move ./gstreamer/Media/Streaming/GStreamer/Element.chs ./gstreamer/Media/Streaming/GStreamer/Core/Element.chs move ./gstreamer/Media/Streaming/GStreamer/ElementFactory.chs ./gstreamer/Media/Streaming/GStreamer/Core/ElementFactory.chs move ./gstreamer/Media/Streaming/GStreamer/Format.chs ./gstreamer/Media/Streaming/GStreamer/Core/Format.chs move ./gstreamer/Media/Streaming/GStreamer/GhostPad.chs ./gstreamer/Media/Streaming/GStreamer/Core/GhostPad.chs move ./gstreamer/Media/Streaming/GStreamer/ImplementsInterface.chs ./gstreamer/Media/Streaming/GStreamer/Core/ImplementsInterface.chs move ./gstreamer/Media/Streaming/GStreamer/Index.chs ./gstreamer/Media/Streaming/GStreamer/Core/Index.chs move ./gstreamer/Media/Streaming/GStreamer/IndexFactory.chs ./gstreamer/Media/Streaming/GStreamer/Core/IndexFactory.chs move ./gstreamer/Media/Streaming/GStreamer/Init.chs ./gstreamer/Media/Streaming/GStreamer/Core/Init.chs move ./gstreamer/Media/Streaming/GStreamer/Iterator.chs ./gstreamer/Media/Streaming/GStreamer/Core/Iterator.chs move ./gstreamer/Media/Streaming/GStreamer/Message.chs ./gstreamer/Media/Streaming/GStreamer/Core/Message.chs move ./gstreamer/Media/Streaming/GStreamer/Object.chs ./gstreamer/Media/Streaming/GStreamer/Core/Object.chs move ./gstreamer/Media/Streaming/GStreamer/Pad.chs ./gstreamer/Media/Streaming/GStreamer/Core/Pad.chs move ./gstreamer/Media/Streaming/GStreamer/PadTemplate.chs ./gstreamer/Media/Streaming/GStreamer/Core/PadTemplate.chs move ./gstreamer/Media/Streaming/GStreamer/Parse.chs ./gstreamer/Media/Streaming/GStreamer/Core/Parse.chs move ./gstreamer/Media/Streaming/GStreamer/Pipeline.chs ./gstreamer/Media/Streaming/GStreamer/Core/Pipeline.chs move ./gstreamer/Media/Streaming/GStreamer/Plugin.chs ./gstreamer/Media/Streaming/GStreamer/Core/Plugin.chs move ./gstreamer/Media/Streaming/GStreamer/PluginFeature.chs ./gstreamer/Media/Streaming/GStreamer/Core/PluginFeature.chs move ./gstreamer/Media/Streaming/GStreamer/Registry.chs ./gstreamer/Media/Streaming/GStreamer/Core/Registry.chs move ./gstreamer/Media/Streaming/GStreamer/Segment.chs ./gstreamer/Media/Streaming/GStreamer/Core/Segment.chs move ./gstreamer/Media/Streaming/GStreamer/Structure.chs ./gstreamer/Media/Streaming/GStreamer/Core/Structure.chs move ./gstreamer/Media/Streaming/GStreamer/SystemClock.chs ./gstreamer/Media/Streaming/GStreamer/Core/SystemClock.chs move ./gstreamer/Media/Streaming/GStreamer/TagList.chs ./gstreamer/Media/Streaming/GStreamer/Core/TagList.chs move ./gstreamer/Media/Streaming/GStreamer/Types.chs ./gstreamer/Media/Streaming/GStreamer/Core/Types.chs hunk ./Makefile.am 1854 - gstreamer/Media/Streaming/GStreamer/Bus_stub.o \ - gstreamer/Media/Streaming/GStreamer/Index_stub.o \ - gstreamer/Media/Streaming/GStreamer/Iterator_stub.o \ - gstreamer/Media/Streaming/GStreamer/Registry_stub.o + gstreamer/Media/Streaming/GStreamer/Core/Bus_stub.o \ + gstreamer/Media/Streaming/GStreamer/Core/Index_stub.o \ + gstreamer/Media/Streaming/GStreamer/Core/Iterator_stub.o \ + gstreamer/Media/Streaming/GStreamer/Core/Registry_stub.o hunk ./Makefile.am 1862 - gstreamer/Media/Streaming/GStreamer/Hierarchy.chs \ - gstreamer/Media/Streaming/GStreamer/Signals.chs + gstreamer/Media/Streaming/GStreamer/Core/Hierarchy.chs \ + gstreamer/Media/Streaming/GStreamer/Core/Signals.chs hunk ./Makefile.am 1867 -libHSgstreamer_a_SOURCES = \ - gstreamer/Media/Streaming/GStreamer/Types.chs \ - gstreamer/Media/Streaming/GStreamer/Init.chs \ - gstreamer/Media/Streaming/GStreamer/Object.chs \ - gstreamer/Media/Streaming/GStreamer/Element.chs \ - gstreamer/Media/Streaming/GStreamer/Pad.chs \ - gstreamer/Media/Streaming/GStreamer/GhostPad.chs \ - gstreamer/Media/Streaming/GStreamer/Bin.chs \ - gstreamer/Media/Streaming/GStreamer/Format.chs \ - gstreamer/Media/Streaming/GStreamer/ElementFactory.chs \ - gstreamer/Media/Streaming/GStreamer/Caps.chs \ - gstreamer/Media/Streaming/GStreamer/Structure.chs \ - gstreamer/Media/Streaming/GStreamer/Message.chs \ - gstreamer/Media/Streaming/GStreamer/Bus.chs \ - gstreamer/Media/Streaming/GStreamer/Clock.chs \ - gstreamer/Media/Streaming/GStreamer/PadTemplate.chs \ - gstreamer/Media/Streaming/GStreamer/ImplementsInterface.chs \ - gstreamer/Media/Streaming/GStreamer/Index.chs \ - gstreamer/Media/Streaming/GStreamer/IndexFactory.chs \ - gstreamer/Media/Streaming/GStreamer/Iterator.chs \ - gstreamer/Media/Streaming/GStreamer/Parse.chs \ - gstreamer/Media/Streaming/GStreamer/Pipeline.chs \ - gstreamer/Media/Streaming/GStreamer/Plugin.chs \ - gstreamer/Media/Streaming/GStreamer/PluginFeature.chs \ - gstreamer/Media/Streaming/GStreamer/Registry.chs \ - gstreamer/Media/Streaming/GStreamer/Segment.chs \ - gstreamer/Media/Streaming/GStreamer/SystemClock.chs \ - gstreamer/Media/Streaming/GStreamer/TagList.chs \ - gstreamer/Media/Streaming/GStreamer.hs \ +libHSgstreamer_a_SOURCES = \ + gstreamer/Media/Streaming/GStreamer/Core/Types.chs \ + gstreamer/Media/Streaming/GStreamer/Core/Init.chs \ + gstreamer/Media/Streaming/GStreamer/Core/Object.chs \ + gstreamer/Media/Streaming/GStreamer/Core/Element.chs \ + gstreamer/Media/Streaming/GStreamer/Core/Pad.chs \ + gstreamer/Media/Streaming/GStreamer/Core/GhostPad.chs \ + gstreamer/Media/Streaming/GStreamer/Core/Bin.chs \ + gstreamer/Media/Streaming/GStreamer/Core/Format.chs \ + gstreamer/Media/Streaming/GStreamer/Core/ElementFactory.chs \ + gstreamer/Media/Streaming/GStreamer/Core/Caps.chs \ + gstreamer/Media/Streaming/GStreamer/Core/Structure.chs \ + gstreamer/Media/Streaming/GStreamer/Core/Message.chs \ + gstreamer/Media/Streaming/GStreamer/Core/Bus.chs \ + gstreamer/Media/Streaming/GStreamer/Core/Clock.chs \ + gstreamer/Media/Streaming/GStreamer/Core/PadTemplate.chs \ + gstreamer/Media/Streaming/GStreamer/Core/ImplementsInterface.chs \ + gstreamer/Media/Streaming/GStreamer/Core/Index.chs \ + gstreamer/Media/Streaming/GStreamer/Core/IndexFactory.chs \ + gstreamer/Media/Streaming/GStreamer/Core/Iterator.chs \ + gstreamer/Media/Streaming/GStreamer/Core/Parse.chs \ + gstreamer/Media/Streaming/GStreamer/Core/Pipeline.chs \ + gstreamer/Media/Streaming/GStreamer/Core/Plugin.chs \ + gstreamer/Media/Streaming/GStreamer/Core/PluginFeature.chs \ + gstreamer/Media/Streaming/GStreamer/Core/Registry.chs \ + gstreamer/Media/Streaming/GStreamer/Core/Segment.chs \ + gstreamer/Media/Streaming/GStreamer/Core/SystemClock.chs \ + gstreamer/Media/Streaming/GStreamer/Core/TagList.chs \ + gstreamer/Media/Streaming/GStreamer/Core.hs \ hunk ./Makefile.am 1900 -gstreamer_Media_Streaming_GStreamer_Types_hs_HCFLAGS = -fglasgow-exts -gstreamer_Media_Streaming_GStreamer_Pad_hs_HCFLAGS = -fglasgow-exts -gstreamer_Media_Streaming_GStreamer_Element_hs_HCFLAGS = -fglasgow-exts -gstreamer_Media_Streaming_GStreamer_Iterator_hs_HCFLAGS = -fglasgow-exts -gstreamer_Media_Streaming_GStreamer_Plugin_hs_HCFLAGS = -fglasgow-exts -gstreamer_Media_Streaming_GStreamer_PluginFeature_hs_HCFLAGS = -fglasgow-exts +gstreamer_Media_Streaming_GStreamer_Core_Types_hs_HCFLAGS = -fglasgow-exts +gstreamer_Media_Streaming_GStreamer_Core_Pad_hs_HCFLAGS = -fglasgow-exts +gstreamer_Media_Streaming_GStreamer_Core_Element_hs_HCFLAGS = -fglasgow-exts +gstreamer_Media_Streaming_GStreamer_Core_Iterator_hs_HCFLAGS = -fglasgow-exts +gstreamer_Media_Streaming_GStreamer_Core_Plugin_hs_HCFLAGS = -fglasgow-exts +gstreamer_Media_Streaming_GStreamer_Core_PluginFeature_hs_HCFLAGS = -fglasgow-exts hunk ./Makefile.am 1909 -gstreamer/Media/Streaming/GStreamer/Hierarchy.chs : \ +gstreamer/Media/Streaming/GStreamer/Core/Hierarchy.chs : \ hunk ./Makefile.am 1917 - --modname=Media.Streaming.GStreamer.Hierarchy --parentname=System.Glib.GObject) + --modname=Media.Streaming.GStreamer.Core.Hierarchy --parentname=System.Glib.GObject) hunk ./Makefile.am 1919 -gstreamer/Media/Streaming/GStreamer/Signals.chs : \ +gstreamer/Media/Streaming/GStreamer/Core/Signals.chs : \ hunk ./Makefile.am 1926 - Media.Streaming.GStreamer.Signals) + Media.Streaming.GStreamer.Core.Signals) hunk ./gstreamer/Media/Streaming/GStreamer/Core.hs 20 -module Media.Streaming.GStreamer ( +module Media.Streaming.GStreamer.Core ( hunk ./gstreamer/Media/Streaming/GStreamer/Core.hs 22 - module Media.Streaming.GStreamer.Bin, - module Media.Streaming.GStreamer.Bus, - module Media.Streaming.GStreamer.Caps, - module Media.Streaming.GStreamer.Clock, - module Media.Streaming.GStreamer.Element, - module Media.Streaming.GStreamer.ElementFactory, - module Media.Streaming.GStreamer.Format, - module Media.Streaming.GStreamer.GhostPad, - module Media.Streaming.GStreamer.ImplementsInterface, - module Media.Streaming.GStreamer.Index, - module Media.Streaming.GStreamer.IndexFactory, - module Media.Streaming.GStreamer.Init, - module Media.Streaming.GStreamer.Iterator, - module Media.Streaming.GStreamer.Message, - module Media.Streaming.GStreamer.Object, - module Media.Streaming.GStreamer.Pad, - module Media.Streaming.GStreamer.PadTemplate, - module Media.Streaming.GStreamer.Parse, - module Media.Streaming.GStreamer.Pipeline, - module Media.Streaming.GStreamer.Plugin, - module Media.Streaming.GStreamer.PluginFeature, - module Media.Streaming.GStreamer.Registry, - module Media.Streaming.GStreamer.Segment, - module Media.Streaming.GStreamer.Structure, - module Media.Streaming.GStreamer.SystemClock, - module Media.Streaming.GStreamer.TagList, + module Media.Streaming.GStreamer.Core.Bin, + module Media.Streaming.GStreamer.Core.Bus, + module Media.Streaming.GStreamer.Core.Caps, + module Media.Streaming.GStreamer.Core.Clock, + module Media.Streaming.GStreamer.Core.Element, + module Media.Streaming.GStreamer.Core.ElementFactory, + module Media.Streaming.GStreamer.Core.Format, + module Media.Streaming.GStreamer.Core.GhostPad, + module Media.Streaming.GStreamer.Core.ImplementsInterface, + module Media.Streaming.GStreamer.Core.Index, + module Media.Streaming.GStreamer.Core.IndexFactory, + module Media.Streaming.GStreamer.Core.Init, + module Media.Streaming.GStreamer.Core.Iterator, + module Media.Streaming.GStreamer.Core.Message, + module Media.Streaming.GStreamer.Core.Object, + module Media.Streaming.GStreamer.Core.Pad, + module Media.Streaming.GStreamer.Core.PadTemplate, + module Media.Streaming.GStreamer.Core.Parse, + module Media.Streaming.GStreamer.Core.Pipeline, + module Media.Streaming.GStreamer.Core.Plugin, + module Media.Streaming.GStreamer.Core.PluginFeature, + module Media.Streaming.GStreamer.Core.Registry, + module Media.Streaming.GStreamer.Core.Segment, + module Media.Streaming.GStreamer.Core.Structure, + module Media.Streaming.GStreamer.Core.SystemClock, + module Media.Streaming.GStreamer.Core.TagList, hunk ./gstreamer/Media/Streaming/GStreamer/Core.hs 51 -import Media.Streaming.GStreamer.Bin -import Media.Streaming.GStreamer.Bus -import Media.Streaming.GStreamer.Caps -import Media.Streaming.GStreamer.Clock -import Media.Streaming.GStreamer.Element -import Media.Streaming.GStreamer.ElementFactory -import Media.Streaming.GStreamer.Format -import Media.Streaming.GStreamer.GhostPad -import Media.Streaming.GStreamer.ImplementsInterface -import Media.Streaming.GStreamer.Index -import Media.Streaming.GStreamer.IndexFactory -import Media.Streaming.GStreamer.Init -import Media.Streaming.GStreamer.Iterator -import Media.Streaming.GStreamer.Message -import Media.Streaming.GStreamer.Object -import Media.Streaming.GStreamer.Pad -import Media.Streaming.GStreamer.PadTemplate -import Media.Streaming.GStreamer.Parse -import Media.Streaming.GStreamer.Pipeline -import Media.Streaming.GStreamer.Plugin -import Media.Streaming.GStreamer.PluginFeature -import Media.Streaming.GStreamer.Registry -import Media.Streaming.GStreamer.Segment -import Media.Streaming.GStreamer.Structure -import Media.Streaming.GStreamer.SystemClock -import Media.Streaming.GStreamer.TagList +import Media.Streaming.GStreamer.Core.Bin +import Media.Streaming.GStreamer.Core.Bus +import Media.Streaming.GStreamer.Core.Caps +import Media.Streaming.GStreamer.Core.Clock +import Media.Streaming.GStreamer.Core.Element +import Media.Streaming.GStreamer.Core.ElementFactory +import Media.Streaming.GStreamer.Core.Format +import Media.Streaming.GStreamer.Core.GhostPad +import Media.Streaming.GStreamer.Core.ImplementsInterface +import Media.Streaming.GStreamer.Core.Index +import Media.Streaming.GStreamer.Core.IndexFactory +import Media.Streaming.GStreamer.Core.Init +import Media.Streaming.GStreamer.Core.Iterator +import Media.Streaming.GStreamer.Core.Message +import Media.Streaming.GStreamer.Core.Object +import Media.Streaming.GStreamer.Core.Pad +import Media.Streaming.GStreamer.Core.PadTemplate +import Media.Streaming.GStreamer.Core.Parse +import Media.Streaming.GStreamer.Core.Pipeline +import Media.Streaming.GStreamer.Core.Plugin +import Media.Streaming.GStreamer.Core.PluginFeature +import Media.Streaming.GStreamer.Core.Registry +import Media.Streaming.GStreamer.Core.Segment +import Media.Streaming.GStreamer.Core.Structure +import Media.Streaming.GStreamer.Core.SystemClock +import Media.Streaming.GStreamer.Core.TagList hunk ./gstreamer/Media/Streaming/GStreamer/Core/Bin.chs 20 -module Media.Streaming.GStreamer.Bin ( +module Media.Streaming.GStreamer.Core.Bin ( hunk ./gstreamer/Media/Streaming/GStreamer/Core/Bin.chs 49 -{#import Media.Streaming.GStreamer.Types#} -{#import Media.Streaming.GStreamer.Signals#} +{#import Media.Streaming.GStreamer.Core.Types#} +{#import Media.Streaming.GStreamer.Core.Signals#} hunk ./gstreamer/Media/Streaming/GStreamer/Core/Bus.chs 20 -module Media.Streaming.GStreamer.Bus ( +module Media.Streaming.GStreamer.Core.Bus ( hunk ./gstreamer/Media/Streaming/GStreamer/Core/Bus.chs 42 -{#import Media.Streaming.GStreamer.Types#} -{#import Media.Streaming.GStreamer.Signals#} +{#import Media.Streaming.GStreamer.Core.Types#} +{#import Media.Streaming.GStreamer.Core.Signals#} hunk ./gstreamer/Media/Streaming/GStreamer/Core/Caps.chs 18 -module Media.Streaming.GStreamer.Caps ( +module Media.Streaming.GStreamer.Core.Caps ( hunk ./gstreamer/Media/Streaming/GStreamer/Core/Caps.chs 54 -{#import Media.Streaming.GStreamer.Types#} +{#import Media.Streaming.GStreamer.Core.Types#} hunk ./gstreamer/Media/Streaming/GStreamer/Core/Clock.chs 18 -module Media.Streaming.GStreamer.Clock ( +module Media.Streaming.GStreamer.Core.Clock ( hunk ./gstreamer/Media/Streaming/GStreamer/Core/Clock.chs 43 -{#import Media.Streaming.GStreamer.Types#} +{#import Media.Streaming.GStreamer.Core.Types#} hunk ./gstreamer/Media/Streaming/GStreamer/Core/Element.chs 20 -module Media.Streaming.GStreamer.Element ( +module Media.Streaming.GStreamer.Core.Element ( hunk ./gstreamer/Media/Streaming/GStreamer/Core/Element.chs 94 -{#import Media.Streaming.GStreamer.Types#} -{#import Media.Streaming.GStreamer.Signals#} +{#import Media.Streaming.GStreamer.Core.Types#} +{#import Media.Streaming.GStreamer.Core.Signals#} hunk ./gstreamer/Media/Streaming/GStreamer/Core/ElementFactory.chs 20 -module Media.Streaming.GStreamer.ElementFactory ( +module Media.Streaming.GStreamer.Core.ElementFactory ( hunk ./gstreamer/Media/Streaming/GStreamer/Core/ElementFactory.chs 48 -{# import Media.Streaming.GStreamer.Types #} +{# import Media.Streaming.GStreamer.Core.Types #} hunk ./gstreamer/Media/Streaming/GStreamer/Core/Format.chs 20 -module Media.Streaming.GStreamer.Format ( +module Media.Streaming.GStreamer.Core.Format ( hunk ./gstreamer/Media/Streaming/GStreamer/Core/Format.chs 33 -{#import Media.Streaming.GStreamer.Types#} +{#import Media.Streaming.GStreamer.Core.Types#} hunk ./gstreamer/Media/Streaming/GStreamer/Core/GhostPad.chs 20 -module Media.Streaming.GStreamer.GhostPad ( +module Media.Streaming.GStreamer.Core.GhostPad ( hunk ./gstreamer/Media/Streaming/GStreamer/Core/GhostPad.chs 39 -{#import Media.Streaming.GStreamer.Types#} +{#import Media.Streaming.GStreamer.Core.Types#} hunk ./gstreamer/Media/Streaming/GStreamer/Core/ImplementsInterface.chs 18 -module Media.Streaming.GStreamer.ImplementsInterface ( +module Media.Streaming.GStreamer.Core.ImplementsInterface ( hunk ./gstreamer/Media/Streaming/GStreamer/Core/ImplementsInterface.chs 28 -{#import Media.Streaming.GStreamer.Types#} +{#import Media.Streaming.GStreamer.Core.Types#} hunk ./gstreamer/Media/Streaming/GStreamer/Core/Index.chs 18 -module Media.Streaming.GStreamer.Index ( +module Media.Streaming.GStreamer.Core.Index ( hunk ./gstreamer/Media/Streaming/GStreamer/Core/Index.chs 44 -{#import Media.Streaming.GStreamer.Types#} -{#import Media.Streaming.GStreamer.Signals#} +{#import Media.Streaming.GStreamer.Core.Types#} +{#import Media.Streaming.GStreamer.Core.Signals#} hunk ./gstreamer/Media/Streaming/GStreamer/Core/IndexFactory.chs 18 -module Media.Streaming.GStreamer.IndexFactory ( +module Media.Streaming.GStreamer.Core.IndexFactory ( hunk ./gstreamer/Media/Streaming/GStreamer/Core/IndexFactory.chs 30 -{#import Media.Streaming.GStreamer.Types#} +{#import Media.Streaming.GStreamer.Core.Types#} hunk ./gstreamer/Media/Streaming/GStreamer/Core/Init.chs 20 -module Media.Streaming.GStreamer.Init ( +module Media.Streaming.GStreamer.Core.Init ( hunk ./gstreamer/Media/Streaming/GStreamer/Core/Iterator.chs 18 -module Media.Streaming.GStreamer.Iterator ( +module Media.Streaming.GStreamer.Core.Iterator ( hunk ./gstreamer/Media/Streaming/GStreamer/Core/Iterator.chs 35 -{#import Media.Streaming.GStreamer.Types#} +{#import Media.Streaming.GStreamer.Core.Types#} hunk ./gstreamer/Media/Streaming/GStreamer/Core/Message.chs 18 -module Media.Streaming.GStreamer.Message ( +module Media.Streaming.GStreamer.Core.Message ( hunk ./gstreamer/Media/Streaming/GStreamer/Core/Message.chs 50 -{#import Media.Streaming.GStreamer.Types#} +{#import Media.Streaming.GStreamer.Core.Types#} hunk ./gstreamer/Media/Streaming/GStreamer/Core/Object.chs 20 -module Media.Streaming.GStreamer.Object ( +module Media.Streaming.GStreamer.Core.Object ( hunk ./gstreamer/Media/Streaming/GStreamer/Core/Object.chs 51 -{# import Media.Streaming.GStreamer.Types #} +{# import Media.Streaming.GStreamer.Core.Types #} hunk ./gstreamer/Media/Streaming/GStreamer/Core/Pad.chs 20 -module Media.Streaming.GStreamer.Pad ( +module Media.Streaming.GStreamer.Core.Pad ( hunk ./gstreamer/Media/Streaming/GStreamer/Core/Pad.chs 78 -{#import Media.Streaming.GStreamer.Types#} -{#import Media.Streaming.GStreamer.Signals#} +{#import Media.Streaming.GStreamer.Core.Types#} +{#import Media.Streaming.GStreamer.Core.Signals#} hunk ./gstreamer/Media/Streaming/GStreamer/Core/PadTemplate.chs 20 -module Media.Streaming.GStreamer.PadTemplate ( +module Media.Streaming.GStreamer.Core.PadTemplate ( hunk ./gstreamer/Media/Streaming/GStreamer/Core/PadTemplate.chs 38 -{#import Media.Streaming.GStreamer.Types#} +{#import Media.Streaming.GStreamer.Core.Types#} hunk ./gstreamer/Media/Streaming/GStreamer/Core/Parse.chs 18 -module Media.Streaming.GStreamer.Parse ( +module Media.Streaming.GStreamer.Core.Parse ( hunk ./gstreamer/Media/Streaming/GStreamer/Core/Parse.chs 24 -{#import Media.Streaming.GStreamer.Types#} +{#import Media.Streaming.GStreamer.Core.Types#} hunk ./gstreamer/Media/Streaming/GStreamer/Core/Pipeline.chs 18 -module Media.Streaming.GStreamer.Pipeline ( +module Media.Streaming.GStreamer.Core.Pipeline ( hunk ./gstreamer/Media/Streaming/GStreamer/Core/Pipeline.chs 37 -{#import Media.Streaming.GStreamer.Types#} +{#import Media.Streaming.GStreamer.Core.Types#} hunk ./gstreamer/Media/Streaming/GStreamer/Core/Plugin.chs 18 -module Media.Streaming.GStreamer.Plugin ( +module Media.Streaming.GStreamer.Core.Plugin ( hunk ./gstreamer/Media/Streaming/GStreamer/Core/Plugin.chs 38 -{#import Media.Streaming.GStreamer.Types#} +{#import Media.Streaming.GStreamer.Core.Types#} hunk ./gstreamer/Media/Streaming/GStreamer/Core/PluginFeature.chs 18 -module Media.Streaming.GStreamer.PluginFeature ( +module Media.Streaming.GStreamer.Core.PluginFeature ( hunk ./gstreamer/Media/Streaming/GStreamer/Core/PluginFeature.chs 29 -{#import Media.Streaming.GStreamer.Types#} +{#import Media.Streaming.GStreamer.Core.Types#} hunk ./gstreamer/Media/Streaming/GStreamer/Core/Registry.chs 18 -module Media.Streaming.GStreamer.Registry ( +module Media.Streaming.GStreamer.Core.Registry ( hunk ./gstreamer/Media/Streaming/GStreamer/Core/Registry.chs 58 -{#import Media.Streaming.GStreamer.Types#} -{#import Media.Streaming.GStreamer.Signals#} +{#import Media.Streaming.GStreamer.Core.Types#} +{#import Media.Streaming.GStreamer.Core.Signals#} hunk ./gstreamer/Media/Streaming/GStreamer/Core/Segment.chs 18 -module Media.Streaming.GStreamer.Segment ( +module Media.Streaming.GStreamer.Core.Segment ( hunk ./gstreamer/Media/Streaming/GStreamer/Core/Segment.chs 37 -{#import Media.Streaming.GStreamer.Types#} +{#import Media.Streaming.GStreamer.Core.Types#} hunk ./gstreamer/Media/Streaming/GStreamer/Core/Structure.chs 18 -module Media.Streaming.GStreamer.Structure ( +module Media.Streaming.GStreamer.Core.Structure ( hunk ./gstreamer/Media/Streaming/GStreamer/Core/Structure.chs 58 -{#import Media.Streaming.GStreamer.Types#} +{#import Media.Streaming.GStreamer.Core.Types#} hunk ./gstreamer/Media/Streaming/GStreamer/Core/SystemClock.chs 18 -module Media.Streaming.GStreamer.SystemClock ( +module Media.Streaming.GStreamer.Core.SystemClock ( hunk ./gstreamer/Media/Streaming/GStreamer/Core/SystemClock.chs 27 -{#import Media.Streaming.GStreamer.Types#} +{#import Media.Streaming.GStreamer.Core.Types#} hunk ./gstreamer/Media/Streaming/GStreamer/Core/TagList.chs 18 -module Media.Streaming.GStreamer.TagList ( +module Media.Streaming.GStreamer.Core.TagList ( hunk ./gstreamer/Media/Streaming/GStreamer/Core/TagList.chs 64 -{#import Media.Streaming.GStreamer.Types#} +{#import Media.Streaming.GStreamer.Core.Types#} hunk ./gstreamer/Media/Streaming/GStreamer/Core/Types.chs 18 -module Media.Streaming.GStreamer.Types ( +module Media.Streaming.GStreamer.Core.Types ( hunk ./gstreamer/Media/Streaming/GStreamer/Core/Types.chs 20 - module Media.Streaming.GStreamer.Hierarchy, + module Media.Streaming.GStreamer.Core.Hierarchy, hunk ./gstreamer/Media/Streaming/GStreamer/Core/Types.chs 269 -{#import Media.Streaming.GStreamer.Hierarchy#} +{#import Media.Streaming.GStreamer.Core.Hierarchy#} |
From: Duncan C. <dun...@wo...> - 2007-08-26 23:29:29
|
Fri Jul 20 13:12:14 PDT 2007 Peter Gavin <pg...@gm...> * gstreamer: remove commented function messageParseAsyncStart in Message.chs hunk ./gstreamer/Media/Streaming/GStreamer/Message.chs 46 - --messageParseAsyncStart + [_$_] hunk ./gstreamer/Media/Streaming/GStreamer/Message.chs 249 -{- -messageParseAsyncStart :: Message - -> Bool -messageParseAsyncStart message = - toBool $ unsafePerformIO $ alloca $ \newBaseTimePtr -> - do poke newBaseTimePtr $ fromBool False - {# call message_parse_async_start #} message newBaseTimePtr - peek newBaseTimePtr --} |
From: Duncan C. <dun...@wo...> - 2007-08-26 23:29:27
|
Fri Jul 20 13:11:51 PDT 2007 Peter Gavin <pg...@gm...> * gstreamer: fix types for event handlers in Element.chs hunk ./gstreamer/Media/Streaming/GStreamer/Element.chs 505 - -> (GObject -> IO ()) + -> (Pad -> IO ()) hunk ./gstreamer/Media/Streaming/GStreamer/Element.chs 514 - -> (GObject -> IO ()) + -> (Pad -> IO ()) |
From: Duncan C. <dun...@wo...> - 2007-08-26 23:29:24
|
Fri Jul 20 13:10:23 PDT 2007 Peter Gavin <pg...@gm...> * gstreamer: fix export list in most modules hunk ./gstreamer/Media/Streaming/GStreamer/Bus.chs 21 + [_$_] hunk ./gstreamer/Media/Streaming/GStreamer/Bus.chs 24 + castToBus, + toBus, + fromBus, hunk ./gstreamer/Media/Streaming/GStreamer/Clock.chs 19 + [_$_] + Clock, + ClockClass, + castToClock, + toClock, + fromClock, + clockAddObservation, + clockSetMaster, + clockGetMaster, + clockSetResolution, + clockGetResolution, + clockGetTime, + clockNewSingleShotID, + clockNewPeriodicID, + clockGetInternalTime, + clockGetCalibration, + clockSetCalibration, + clockIDGetTime, + clockIDWait, + clockIDUnschedule + [_$_] hunk ./gstreamer/Media/Streaming/GStreamer/Element.chs 30 - StateChangeReturn(..) + StateChangeReturn(..), + elementAddPad, + elementGetPad, + elementGetCompatiblePad, + elementGetCompatiblePadTemplate, + elementGetRequestPad, + elementGetStaticPad, + elementNoMorePads, + elementReleaseRequestPad, + elementRemovePad, + elementIteratePads, + elementIterateSinkPads, + elementIterateSrcPads, + elementLink, + elementUnlink, + elementLinkPads, + elementUnlinkPads, + elementLinkPadsFiltered, + elementLinkFiltered, + elementSetBaseTime, + elementGetBaseTime, + elementSetBus, + elementGetBus, + elementGetFactory, + elementSetIndex, + elementIsIndexable, + elementRequiresClock, + elementSetClock, + elementGetClock, + elementProvidesClock, + elementProvideClock, + elementSetState, + elementGetState, + elementSetLockedState, + elementIsLockedState, + elementAbortState, + elementStateGetName, + elementStateChangeReturnGetName, + elementSyncStateWithParent, + elementGetQueryTypes, + elementQuery, + elementQueryConvert, + elementQueryPosition, + elementQueryDuration, + elementSendEvent, [_$_] + elementSeekSimple, + elementSeek, + onElementNoMorePads, + afterElementNoMorePads, + onElementPadAdded, + afterElementPadAdded, + onElementPadRemoved, + afterElementPadRemoved hunk ./gstreamer/Media/Streaming/GStreamer/GhostPad.chs 24 + castToGhostPad, + toGhostPad, + fromGhostPad, hunk ./gstreamer/Media/Streaming/GStreamer/ImplementsInterface.chs 21 + castToImplementsInterface, + toImplementsInterface, + fromImplementsInterface, hunk ./gstreamer/Media/Streaming/GStreamer/Index.chs 19 + [_$_] + Index, + IndexClass, + castToIndex, + toIndex, + fromIndex, + indexNew, + indexCommit, + indexGetGroup, + indexNewGroup, + indexSetGroup, + indexSetCertainty, + indexSetFilter, + indexGetWriterId, + indexAddFormat, + indexAddAssociations, + indexAddId, + indexGetAssocEntry, + indexEntryAssocMap, + onIndexEntryAdded, + afterIndexEntryAdded, + [_$_] hunk ./gstreamer/Media/Streaming/GStreamer/IndexFactory.chs 19 + [_$_] hunk ./gstreamer/Media/Streaming/GStreamer/IndexFactory.chs 21 + IndexFactoryClass, + castToIndexFactory, + toIndexFactory, + fromIndexFactory, hunk ./gstreamer/Media/Streaming/GStreamer/Message.chs 19 + [_$_] hunk ./gstreamer/Media/Streaming/GStreamer/Message.chs 21 + MessageClass, + castToMessage, + toMessage, + fromMessage, + MessageType(..), hunk ./gstreamer/Media/Streaming/GStreamer/PadTemplate.chs 27 - PadFlags(..), hunk ./gstreamer/Media/Streaming/GStreamer/Pipeline.chs 21 + castToPipeline, + toPipeline, + fromPipeline, hunk ./gstreamer/Media/Streaming/GStreamer/Plugin.chs 21 + castToPlugin, + toPlugin, + fromPlugin, hunk ./gstreamer/Media/Streaming/GStreamer/PluginFeature.chs 21 + castToPluginFeature, + toPluginFeature, + fromPluginFeature, hunk ./gstreamer/Media/Streaming/GStreamer/Registry.chs 19 + [_$_] + Registry, + RegistryClass, + castToRegistry, + toRegistry, + fromRegistry, + defaultRegistry, + registryGetFeatureList, + registryGetFeatureListByPlugin, + registryGetPathList, + registryGetPluginList, + registryAddPlugin, + registryRemovePlugin, + registryPluginFilter, + registryFeatureFilter, + registryFindPlugin, + registryFindFeature, + registryLookupFeature, + registryScanPath, + registryXMLReadCache, + registryXMLWriteCache, + registryLookup, + registryRemoveFeature, + registryAddFeature, + defaultRegistryCheckFeatureVersion, + defaultRegistryGetPathList, + defaultRegistryAddPlugin, + defaultRegistryScanPath, + defaultRegistryFindPlugin, + defaultRegistryFindFeature, + defaultRegistryFeatureFilter, + onRegistryFeatureAdded, + afterRegistryFeatureAdded, + onRegistryPluginAdded, + afterRegistryPluginAdded + [_$_] hunk ./gstreamer/Media/Streaming/GStreamer/Segment.chs 19 + [_$_] hunk ./gstreamer/Media/Streaming/GStreamer/Segment.chs 21 + [_$_] hunk ./gstreamer/Media/Streaming/GStreamer/Segment.chs 29 + [_$_] hunk ./gstreamer/Media/Streaming/GStreamer/TagList.chs 19 + [_$_] + StandardTag(..), + standardTagToString, + tagNick, + tagDescription, + tagGetFlag, + tagIsFixed, + tagListEmpty, + tagListIsEmpty, + tagListMerge, + tagListGetTagSize, + tagListCreate, + tagListModify, + tagListInsert, + tagListRemoveTag, + tagListGetChar, + tagListGetCharIndex, + tagListGetUChar, + tagListGetUCharIndex, + tagListGetBool, + tagListGetBoolIndex, + tagListGetInt, + tagListGetIntIndex, + tagListGetUInt, + tagListGetUIntIndex, + tagListGetLong, + tagListGetLongIndex, + tagListGetULong, + tagListGetULongIndex, + tagListGetInt64, + tagListGetInt64Index, + tagListGetUInt64, + tagListGetUInt64Index, + tagListGetFloat, + tagListGetFloatIndex, + tagListGetDouble, + tagListGetDoubleIndex, + tagListGetString, + tagListGetStringIndex, + tagListGetDate, + tagListGetDateIndex + [_$_] |
From: Duncan C. <dun...@wo...> - 2007-08-26 23:29:24
|
Wed Jul 18 23:02:28 PDT 2007 Peter Gavin <pg...@gm...> * gstreamer: initial import adddir ./gstreamer adddir ./gstreamer/Media adddir ./gstreamer/Media/Streaming adddir ./gstreamer/Media/Streaming/GStreamer hunk ./Makefile.am 24 - gnomevfs/marshal.list + gnomevfs/marshal.list \ + gtk/Graphics/UI/Gtk/ModelView/Gtk2HsStore.h \ + gstreamer/hsgstreamer.h hunk ./Makefile.am 67 +if ENABLE_GSTREAMER +pkglib_LIBRARIES += libHSgstreamer.a +endif hunk ./Makefile.am 1831 +# +# gstreamer package +# +################################################################################ + +if ENABLE_GSTREAMER + +gstreamer_PKGNAME = libHSgstreamer_a + +libHSgstreamer_a_NAME = gstreamer +libHSgstreamer_a_CONFIG = gstreamer/gstreamer.$(PKGEXT) +libHSgstreamer_a_EXTERNALDEPS = base haskell98 mtl +libHSgstreamer_a_INTERNALDEPS = glib +libHSgstreamer_a_HEADER = gstreamer/hsgstreamer.h +libHSgstreamer_a_PRECOMP = gstreamer/gstreamer.precomp +libHSgstreamer_a_LIBS = $(GLIB_LIBS) $(GSTREAMER_LIBS) $(GCONF_LIBS) +libHSgstreamer_a_HCFLAGS = -fffi +libHSgstreamer_a_CFLAGS = $(filter-out -I% -D%,$(GLIB_CFLAGS) $(GSTREAMER_CFLAGS)) +libHSgstreamer_a_CPPFLAGS = $(filter -I% -D%,$(GLIB_CFLAGS) $(GSTREAMER_CFLAGS)) + +libHSgstreamer_a_SOURCESDIRS = gstreamer + +libHSgstreamer_a_LIBADD = + +gstreamer/libHSgstreamer_a.deps : glib/libHSglib_a.deps + +libHSgstreamer_a_GENERATEDSOURCES = \ + gstreamer/Media/Streaming/GStreamer/Hierarchy.chs \ + gstreamer/Media/Streaming/GStreamer/Signals.chs + +nodist_libHSgstreamer_a_SOURCES = $(libHSgstreamer_a_GENERATEDSOURCES) + +libHSgstreamer_a_SOURCES = \ + gstreamer/Media/Streaming/GStreamer/Types.chs \ + gstreamer/Media/Streaming/GStreamer/Init.chs \ + gstreamer/Media/Streaming/GStreamer/Object.chs \ + gstreamer/Media/Streaming/GStreamer/Element.chs \ + gstreamer/Media/Streaming/GStreamer/Pad.chs \ + gstreamer/Media/Streaming/GStreamer/GhostPad.chs \ + gstreamer/Media/Streaming/GStreamer/Bin.chs \ + gstreamer/Media/Streaming/GStreamer/Format.chs \ + gstreamer/Media/Streaming/GStreamer/ElementFactory.chs \ + gstreamer/Media/Streaming/GStreamer/Caps.chs \ + gstreamer/Media/Streaming/GStreamer/Structure.chs \ + gstreamer/Media/Streaming/GStreamer/Message.chs \ + gstreamer/Media/Streaming/GStreamer/Bus.chs \ + gstreamer/Media/Streaming/GStreamer/Clock.chs \ + gstreamer/Media/Streaming/GStreamer/PadTemplate.chs \ + gstreamer/Media/Streaming/GStreamer/ImplementsInterface.chs \ + gstreamer/Media/Streaming/GStreamer/Index.chs \ + gstreamer/Media/Streaming/GStreamer/IndexFactory.chs \ + gstreamer/Media/Streaming/GStreamer/Iterator.chs \ + gstreamer/Media/Streaming/GStreamer/Parse.chs \ + gstreamer/Media/Streaming/GStreamer/Pipeline.chs \ + gstreamer/Media/Streaming/GStreamer/Plugin.chs \ + gstreamer/Media/Streaming/GStreamer/PluginFeature.chs \ + gstreamer/Media/Streaming/GStreamer/Registry.chs \ + gstreamer/Media/Streaming/GStreamer/Segment.chs \ + gstreamer/Media/Streaming/GStreamer/SystemClock.chs \ + gstreamer/Media/Streaming/GStreamer/TagList.chs \ + gstreamer/Media/Streaming/GStreamer.hs \ + gstreamer/hsgstreamer.c + +htmldoc_HSFILES_HIDDEN += $(libHSgstreamer_a_GENERATEDSOURCES:.chs=.hs) + +gstreamer_Media_Streaming_GStreamer_Types_hs_HCFLAGS = -fglasgow-exts +gstreamer_Media_Streaming_GStreamer_Pad_hs_HCFLAGS = -fglasgow-exts +gstreamer_Media_Streaming_GStreamer_Element_hs_HCFLAGS = -fglasgow-exts +gstreamer_Media_Streaming_GStreamer_Iterator_hs_HCFLAGS = -fglasgow-exts +gstreamer_Media_Streaming_GStreamer_Plugin_hs_HCFLAGS = -fglasgow-exts +gstreamer_Media_Streaming_GStreamer_PluginFeature_hs_HCFLAGS = -fglasgow-exts + +libHSgstreamer_a_ALLSOURCES = $(libHSgstreamer_a_SOURCES) $(nodist_libHSgstreamer_a_SOURCES) + +gstreamer/Media/Streaming/GStreamer/Hierarchy.chs : \ + $(srcdir)/tools/hierarchyGen/hierarchy.list \ + $(srcdir)/tools/hierarchyGen/TypeGenerator$(EXEEXT) \ + $(srcdir)/tools/hierarchyGen/Hierarchy.chs.template + $(strip $(srcdir)/tools/hierarchyGen/TypeGenerator$(EXEEXT) \ + $(srcdir)/tools/hierarchyGen/hierarchy.list \ + $(srcdir)/tools/hierarchyGen/Hierarchy.chs.template \ + $@ --tag=gstreamer --lib=gstreamer --prefix=gstreamer \ + --modname=Media.Streaming.GStreamer.Hierarchy --parentname=System.Glib.GObject) + +gstreamer/Media/Streaming/GStreamer/Signals.chs : \ + $(srcdir)/tools/callbackGen/Signal.chs.template \ + $(srcdir)/gnomevfs/marshal.list \ + $(srcdir)/tools/callbackGen/HookGenerator$(EXEEXT) + $(strip $(srcdir)/tools/callbackGen/HookGenerator$(EXEEXT) \ + $(srcdir)/gstreamer/marshal.list \ + $(srcdir)/tools/callbackGen/Signal.chs.template $@ \ + Media.Streaming.GStreamer.Signals) + +am_libHSgstreamer_a_OBJECTS = \ + $(addsuffix .$(OBJEXT),$(basename $(basename $(libHSgstreamer_a_ALLSOURCES)))) + +libHSgstreamer_a_HSPPFILES = $(filter %.hs.pp, $(libHSgstreamer_a_ALLSOURCES)) +libHSgstreamer_a_CHSPPFILES = $(filter %.chs.pp,$(libHSgstreamer_a_ALLSOURCES)) +libHSgstreamer_a_CHSFILES = \ + $(filter %.chs,$(libHSgstreamer_a_ALLSOURCES:.chs.pp=.chs)) +libHSgstreamer_a_CHSFILES_HS = $(libHSgstreamer_a_CHSFILES:.chs=.hs) +libHSgstreamer_a_HSCFILES = $(filter %.hsc, $(libHSgstreamer_a_ALLSOURCES)) +libHSgstreamer_a_HSCFILES_HS = $(libHSgstreamer_a_HSCFILES:.hsc=.hs) +libHSgstreamer_a_BUILDSOURCES = \ + $(libHSgstreamer_a_HSPPFILES:.hs.pp=.hs) \ + $(libHSgstreamer_a_CHSPPFILES:.chs.pp=.chs) \ + $(libHSgstreamer_a_CHSFILES_HS) \ + $(libHSgstreamer_a_HSCFILES_HS) \ + $(libHSgstreamer_a_GENERATEDSOURCES) +libHSgstreamer_a_HSFILES = \ + $(filter %.hs,$(libHSgstreamer_a_BUILDSOURCES)) \ + $(filter %.hs,$(libHSgstreamer_a_ALLSOURCES)) + +nobase_hi_DATA += $(libHSgstreamer_a_HSFILES:.hs=.hi) + +gstreamer_MOSTLYCLEANFILES = $(am_libHSgstreamer_a_OBJECTS) +gstreamer_MOSTLYCLEANFILES += $(libHSgstreamer_a_HSFILES:.hs=.hi) +gstreamer_MOSTLYCLEANFILES += $(libHSgstreamer_a_CHSFILES:.chs=.chi) +gstreamer_MOSTLYCLEANFILES += $(libHSgstreamer_a_CHSFILES:.chs=_stub.h) +gstreamer_MOSTLYCLEANFILES += $(libHSgstreamer_a_CHSFILES:.chs=_stub.o) +gstreamer_MOSTLYCLEANFILES += $(libHSgstreamer_a_CHSFILES:.chs=_stub.c) +gstreamer_CLEANFILES = $(libHSgstreamer_a_BUILDSOURCES) +gstreamer_CLEANFILES += $(libHSgstreamer_a_CHSFILES_HS:.hs=.dep) + +$(libHSgstreamer_a_CHSFILES:.chs=.dep) : \ + $(libHSgtk_a_GENERATEDSOURCES) \ + $(libHSgstreamer_a_GENERATEDSOURCES) + +ifeq (,$(findstring clean,$(MAKECMDGOALS))) +-include $(libHSgstreamer_a_CHSFILES:.chs=.dep) gstreamer/libHSgstreamer_a.deps + endif + +if ENABLE_SPLITOBJS +libHSgstreamer_a_AR = $(srcdir)/mk/link-splitobjs.sh +else +libHSgstreamer_a_AR = $(AR) $(ARFLAGS) +endif + +libHSgstreamer_a_DEPENDENCIES = HSgstreamer.o +pkglib_DATA += HSgstreamer.o +HSgstreamer.o : $(libHSgstreamer_a_OBJECTS) + $(LD) -r $(LD_X) -o $@ $(libHSgstreamer_a_OBJECTS) $(libHSgstreamer_a_LIBADD) + +if ENABLE_PROFILING +libHSgstreamer_a_DEPENDENCIES += libHSgstreamer_p.a +pkglib_DATA += libHSgstreamer_p.a +libHSgstreamer_p.a : $(libHSgstreamer_a_HSFILES:.hs=.p_o) \ + $(libHSgstreamer_a_LIBADD:.o=.p_o) + $(AR) $(ARFLAGS) $@ $^ + +ifeq (,$(findstring clean,$(MAKECMDGOALS))) +-include gstreamer/libHSgstreamer_a.p_deps + endif + +nobase_hi_DATA += $(libHSgstreamer_a_HSFILES:.hs=.p_hi) +gstreamer_MOSTLYCLEANFILES += $(libHSgstreamer_a_HSFILES:.hs=.p_hi) +gstreamer_MOSTLYCLEANFILES += $(libHSgstreamer_a_HSFILES:.hs=.p_o) +gstreamer_MOSTLYCLEANFILES += $(libHSgstreamer_a_LIBADD:.o=.p_o) + +endif + +endif + hunk ./Makefile.am 2320 + rm -f $(gstreamer_MOSTLYCLEANFILES) merger 0.0 ( hunk ./Makefile.am 2324 - rm -f $(c2hs_CLEANFILES) - rm -f $(glib_CLEANFILES) - rm -f $(gtk_CLEANFILES) - rm -f $(glade_CLEANFILES) - rm -f $(gconf_CLEANFILES) - rm -f $(sourceview_CLEANFILES) - rm -f $(mozembed_CLEANFILES) - rm -f $(cairo_CLEANFILES) - rm -f $(svgcairo_CLEANFILES) - rm -f $(gtkglext_CLEANFILES) - rm -f $(soegtk_CLEANFILES) - rm -f $(doc_CLEANFILES) + rm -f $(c2hs_CLEANFILES) + rm -rf $(c2hs_CLEANFILES_SPLIT) + rm -f $(glib_CLEANFILES) + rm -rf $(glib_CLEANFILES_SPLIT) + rm -f $(gtk_CLEANFILES) + rm -rf $(gtk_CLEANFILES_SPLIT) + rm -f $(glade_CLEANFILES) + rm -rf $(glade_CLEANFILES_SPLIT) + rm -f $(gconf_CLEANFILES) + rm -rf $(gconf_CLEANFILES_SPLIT) + rm -f $(sourceview_CLEANFILES) + rm -rf $(sourceview_CLEANFILES_SPLIT) + rm -f $(mozembed_CLEANFILES) + rm -rf $(mozembed_CLEANFILES_SPLIT) + rm -f $(cairo_CLEANFILES) + rm -rf $(cairo_CLEANFILES_SPLIT) + rm -f $(svgcairo_CLEANFILES) + rm -rf $(svgcairo_CLEANFILES_SPLIT) + rm -f $(gtkglext_CLEANFILES) + rm -rf $(gtkglext_CLEANFILES_SPLIT) + rm -f $(soegtk_CLEANFILES) + rm -rf $(soegtk_CLEANFILES_SPLIT) + rm -f $(gnomevfs_CLEANFILES) + rm -rf $(gnomevfs_CLEANFILES_SPLIT) + rm -f $(doc_CLEANFILES) merger 0.0 ( merger 0.0 ( hunk ./Makefile.am 2335 + rm -f $(gnomevfs_CLEANFILES) hunk ./Makefile.am 2324 - rm -f $(c2hs_CLEANFILES) - rm -f $(glib_CLEANFILES) - rm -f $(gtk_CLEANFILES) - rm -f $(glade_CLEANFILES) - rm -f $(gconf_CLEANFILES) - rm -f $(sourceview_CLEANFILES) - rm -f $(mozembed_CLEANFILES) - rm -f $(cairo_CLEANFILES) - rm -f $(svgcairo_CLEANFILES) - rm -f $(gtkglext_CLEANFILES) - rm -f $(soegtk_CLEANFILES) - rm -f $(doc_CLEANFILES) + rm -f $(c2hs_CLEANFILES) + rm -rf $(c2hs_CLEANFILES_SPLIT) + rm -f $(glib_CLEANFILES) + rm -rf $(glib_CLEANFILES_SPLIT) + rm -f $(gtk_CLEANFILES) + rm -rf $(gtk_CLEANFILES_SPLIT) + rm -f $(glade_CLEANFILES) + rm -rf $(glade_CLEANFILES_SPLIT) + rm -f $(gconf_CLEANFILES) + rm -rf $(gconf_CLEANFILES_SPLIT) + rm -f $(sourceview_CLEANFILES) + rm -rf $(sourceview_CLEANFILES_SPLIT) + rm -f $(mozembed_CLEANFILES) + rm -rf $(mozembed_CLEANFILES_SPLIT) + rm -f $(cairo_CLEANFILES) + rm -rf $(cairo_CLEANFILES_SPLIT) + rm -f $(svgcairo_CLEANFILES) + rm -rf $(svgcairo_CLEANFILES_SPLIT) + rm -f $(gtkglext_CLEANFILES) + rm -rf $(gtkglext_CLEANFILES_SPLIT) + rm -f $(soegtk_CLEANFILES) + rm -rf $(soegtk_CLEANFILES_SPLIT) + rm -f $(doc_CLEANFILES) ) hunk ./Makefile.am 2336 + rm -f $(gstreamer_CLEANFILES) ) ) hunk ./configure.ac 346 +GTKHS_PKG_CHECK(gstreamer, gstreamer, GSTREAMER, [gstreamer-0.10 >= 0.10], + [build gstreamer package (default=auto)], + [gstreamer library requirement not met. Perhaps you need to install libgstreamer or libgstreamer-devel]) + hunk ./configure.ac 642 +GTKHS_REFORMAT_PACKAGE_CFLAGS(GSTREAMER_CFLAGS, GSTREAMER_CFLAGS_CQ) +GTKHS_REFORMAT_PACKAGE_LIBS(GSTREAMER_LIBS, GSTREAMER_LIBS_CQ, GSTREAMER_LIBDIR_CQ, GSTREAMER_LIBEXTRA_CQ) +AC_SUBST(GSTREAMER_CFLAGS_CQ) +AC_SUBST(GSTREAMER_LIBS_CQ) +AC_SUBST(GSTREAMER_LIBDIR_CQ) +AC_SUBST(GSTREAMER_LIBEXTRA_CQ) + hunk ./configure.ac 880 + + gstreamer/gstreamer.pkg + gstreamer/gstreamer.package.conf + gstreamer/gstreamer.cabal hunk ./configure.ac 905 +echo "* gstreamer : ${ENABLE_GSTREAMER} " addfile ./gstreamer/Media/Streaming/GStreamer.hs hunk ./gstreamer/Media/Streaming/GStreamer.hs 1 +-- GIMP Toolkit (GTK) Binding for Haskell: binding to gstreamer -*-haskell-*- +-- +-- Author : Peter Gavin +-- Created: 1-Apr-2007 +-- +-- Version $Revision$ from $Date$ +-- +-- Copyright (c) 2007 Peter Gavin +-- +-- This library is free software; you can redistribute it and/or +-- modify it under the terms of the GNU Library General Public +-- License as published by the Free Software Foundation; either +-- version 2 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 +-- Library General Public License for more details. +-- +module Media.Streaming.GStreamer ( + [_$_] + module Media.Streaming.GStreamer.Bin, + module Media.Streaming.GStreamer.Bus, + module Media.Streaming.GStreamer.Caps, + module Media.Streaming.GStreamer.Clock, + module Media.Streaming.GStreamer.Element, + module Media.Streaming.GStreamer.ElementFactory, + module Media.Streaming.GStreamer.Format, + module Media.Streaming.GStreamer.GhostPad, + module Media.Streaming.GStreamer.ImplementsInterface, + module Media.Streaming.GStreamer.Index, + module Media.Streaming.GStreamer.IndexFactory, + module Media.Streaming.GStreamer.Init, + module Media.Streaming.GStreamer.Iterator, + module Media.Streaming.GStreamer.Message, + module Media.Streaming.GStreamer.Object, + module Media.Streaming.GStreamer.Pad, + module Media.Streaming.GStreamer.PadTemplate, + module Media.Streaming.GStreamer.Parse, + module Media.Streaming.GStreamer.Pipeline, + module Media.Streaming.GStreamer.Plugin, + module Media.Streaming.GStreamer.PluginFeature, + module Media.Streaming.GStreamer.Registry, + module Media.Streaming.GStreamer.Segment, + module Media.Streaming.GStreamer.Structure, + module Media.Streaming.GStreamer.SystemClock, + module Media.Streaming.GStreamer.TagList, + [_$_] + ) where + +import Media.Streaming.GStreamer.Bin +import Media.Streaming.GStreamer.Bus +import Media.Streaming.GStreamer.Caps +import Media.Streaming.GStreamer.Clock +import Media.Streaming.GStreamer.Element +import Media.Streaming.GStreamer.ElementFactory +import Media.Streaming.GStreamer.Format +import Media.Streaming.GStreamer.GhostPad +import Media.Streaming.GStreamer.ImplementsInterface +import Media.Streaming.GStreamer.Index +import Media.Streaming.GStreamer.IndexFactory +import Media.Streaming.GStreamer.Init +import Media.Streaming.GStreamer.Iterator +import Media.Streaming.GStreamer.Message +import Media.Streaming.GStreamer.Object +import Media.Streaming.GStreamer.Pad +import Media.Streaming.GStreamer.PadTemplate +import Media.Streaming.GStreamer.Parse +import Media.Streaming.GStreamer.Pipeline +import Media.Streaming.GStreamer.Plugin +import Media.Streaming.GStreamer.PluginFeature +import Media.Streaming.GStreamer.Registry +import Media.Streaming.GStreamer.Segment +import Media.Streaming.GStreamer.Structure +import Media.Streaming.GStreamer.SystemClock +import Media.Streaming.GStreamer.TagList addfile ./gstreamer/Media/Streaming/GStreamer/Bin.chs hunk ./gstreamer/Media/Streaming/GStreamer/Bin.chs 1 +-- GIMP Toolkit (GTK) Binding for Haskell: binding to gstreamer -*-haskell-*- +-- +-- Author : Peter Gavin +-- Created: 1-Apr-2007 +-- +-- Version $Revision$ from $Date$ +-- +-- Copyright (c) 2007 Peter Gavin +-- +-- This library is free software; you can redistribute it and/or +-- modify it under the terms of the GNU Library General Public +-- License as published by the Free Software Foundation; either +-- version 2 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 +-- Library General Public License for more details. +-- +module Media.Streaming.GStreamer.Bin ( + [_$_] + Bin, + BinClass, + castToBin, + toBin, + fromBin, + binAdd, + binRemove, + binGetByName, + binGetByNameRecurseUp, + binGetByInterface, + binIterateElements, + binIterateRecurse, + binIterateSinks, + binIterateSorted, + binIterateSources, + binIterateAllByInterface, + binFindUnconnectedPad + [_$_] + ) where + +import Control.Exception ( bracket_ ) +import Control.Monad ( liftM ) +import System.Glib.FFI +{#import System.Glib.GType#} ( GType ) +import System.Glib.UTFString ( withUTFString ) +import System.Glib.GList ( GList + , readGList ) +{#import Media.Streaming.GStreamer.Types#} +{#import Media.Streaming.GStreamer.Signals#} + +{# context lib = "gstreamer" prefix = "gst" #} + +binAdd :: (BinClass bin, + ElementClass element) => + bin + -> element + -> IO Bool +binAdd bin element = + liftM toBool $ {# call bin_add #} (toBin bin) (toElement element) + +binRemove :: (BinClass bin, + ElementClass element) => + bin + -> element + -> IO Bool +binRemove bin element = + liftM toBool $ {# call bin_remove #} (toBin bin) (toElement element) + +binGetByName :: BinClass bin => + bin + -> String + -> IO (Maybe Element) +binGetByName bin name = + withUTFString name ({# call bin_get_by_name #} (toBin bin)) >>= maybePeek newElement + +binGetByNameRecurseUp :: BinClass bin => + bin + -> String + -> IO (Maybe Element) +binGetByNameRecurseUp bin name = + withUTFString name ({# call bin_get_by_name_recurse_up #} $ toBin bin) >>= + maybePeek newElement + +binGetByInterface :: BinClass bin => + bin + -> GType + -> IO (Maybe Element) +binGetByInterface bin iface = + {# call bin_get_by_interface #} (toBin bin) (fromIntegral iface) >>= + maybePeek newElement + +binIterateElements :: BinClass bin => + bin + -> IO (Maybe (Iterator Element)) +binIterateElements bin = + {# call bin_iterate_elements #} (toBin bin) >>= + maybePeek newIterator + +binIterateRecurse :: BinClass bin => + bin + -> IO (Maybe (Iterator Element)) +binIterateRecurse bin = + {# call bin_iterate_recurse #} (toBin bin) >>= + maybePeek newIterator + +binIterateSinks :: BinClass bin => + bin + -> IO (Maybe (Iterator Element)) +binIterateSinks bin = + {# call bin_iterate_sinks #} (toBin bin) >>= + maybePeek newIterator + +binIterateSorted :: BinClass bin => + bin + -> IO (Maybe (Iterator Element)) +binIterateSorted bin = + {# call bin_iterate_sorted #} (toBin bin) >>= + maybePeek newIterator + +binIterateSources :: BinClass bin => + bin + -> IO (Maybe (Iterator Element)) +binIterateSources bin = + {# call bin_iterate_sources #} (toBin bin) >>= + maybePeek newIterator + +binIterateAllByInterface :: BinClass bin => + bin + -> GType + -> IO (Maybe (Iterator Element)) +binIterateAllByInterface bin iface = + {# call bin_iterate_all_by_interface #} (toBin bin) (fromIntegral iface) >>= + maybePeek newIterator + +binFindUnconnectedPad :: BinClass bin => + bin + -> PadDirection + -> IO (Maybe Pad) +binFindUnconnectedPad bin direction = + {# call bin_find_unconnected_pad #} (toBin bin) (fromIntegral $ fromEnum direction) >>= + maybePeek newPad + +onBinElementAdded, afterBinElementAdded :: BinClass bin + => bin + -> (Element -> IO ()) + -> IO (ConnectId bin) +onBinElementAdded = + connect_OBJECT__NONE "element-added" False +afterBinElementAdded = + connect_OBJECT__NONE "element-added" True + +onBinElementRemoved, afterBinElementRemoved :: BinClass bin + => bin + -> (Element -> IO ()) + -> IO (ConnectId bin) +onBinElementRemoved = + connect_OBJECT__NONE "element-removed" False +afterBinElementRemoved = + connect_OBJECT__NONE "element-removed" True addfile ./gstreamer/Media/Streaming/GStreamer/Bus.chs hunk ./gstreamer/Media/Streaming/GStreamer/Bus.chs 1 +-- GIMP Toolkit (GTK) Binding for Haskell: binding to gstreamer -*-haskell-*- +-- +-- Author : Peter Gavin +-- Created: 1-Apr-2007 +-- +-- Version $Revision$ from $Date$ +-- +-- Copyright (c) 2007 Peter Gavin +-- +-- This library is free software; you can redistribute it and/or +-- modify it under the terms of the GNU Library General Public +-- License as published by the Free Software Foundation; either +-- version 2 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 +-- Library General Public License for more details. +-- +module Media.Streaming.GStreamer.Bus ( + Bus, + BusClass, + busNew, + busPost, + busHavePending, + busPeek, + busPop, + busTimedPop, + busSetFlushing, + busCreateWatch, + busAddWatch, + busAddSignalWatch, + busRemoveSignalWatch, + busPoll + ) where + +import Control.Monad (liftM) +{#import Media.Streaming.GStreamer.Types#} +{#import Media.Streaming.GStreamer.Signals#} +{#import System.Glib.MainLoop#} +import System.Glib.Flags +import System.Glib.FFI +{#import System.Glib.GObject#} +{#import System.Glib.MainLoop#} + +{# context lib = "gstreamer" prefix = "gst" #} + +busNew :: IO Bus +busNew = + {# call bus_new #} >>= newBus + +busPost :: Bus + -> Message + -> IO Bool +busPost bus message = + do {# call gst_mini_object_ref #} (toMiniObject message) + liftM toBool $ {# call bus_post #} bus message + +busHavePending :: Bus + -> IO Bool +busHavePending bus = + liftM toBool $ {# call bus_have_pending #} bus + +busPeek :: Bus + -> IO (Maybe Message) +busPeek bus = + {# call bus_peek #} bus >>= maybePeek newMessage + +busPop :: Bus + -> IO (Maybe Message) +busPop bus = + {# call bus_pop #} bus >>= maybePeek newMessage + +busTimedPop :: Bus + -> ClockTime + -> IO (Maybe Message) +busTimedPop bus timeout = + {# call bus_timed_pop #} bus timeout >>= maybePeek newMessage + +busSetFlushing :: Bus + -> Bool + -> IO () +busSetFlushing bus flushing = + {# call bus_set_flushing #} bus $ fromBool flushing + +busCreateWatch :: Bus + -> IO Source +busCreateWatch bus = + liftM Source $ {# call bus_create_watch #} bus >>= + flip newForeignPtr sourceFinalizer +foreign import ccall unsafe "&g_source_unref" + sourceFinalizer :: FunPtr (Ptr Source -> IO ()) + +type CBusFunc = Ptr Bus + -> Ptr Message + -> {# type gpointer #} + -> IO {# type gboolean #} +marshalBusFunc :: BusFunc + -> IO {# type GstBusFunc #} +marshalBusFunc busFunc = + makeBusFunc cBusFunc + where cBusFunc :: CBusFunc + cBusFunc busPtr messagePtr userData = + do bus <- newBus_ busPtr + message <- newMessage_ messagePtr + liftM fromBool $ busFunc bus message +foreign import ccall "wrapper" + makeBusFunc :: CBusFunc + -> IO {# type GstBusFunc #} + +busAddWatch :: Bus + -> Priority + -> BusFunc + -> IO Word +busAddWatch bus priority func = + do busFuncPtr <- marshalBusFunc func + destroyNotify <- mkFunPtrDestroyNotify busFuncPtr + liftM fromIntegral $ + {# call bus_add_watch_full #} + bus + (fromIntegral priority) + busFuncPtr + nullPtr + destroyNotify + +busAddSignalWatch :: Bus + -> Priority + -> IO () +busAddSignalWatch bus priority = + {# call bus_add_signal_watch_full #} bus $ fromIntegral priority + +busRemoveSignalWatch :: Bus + -> IO () +busRemoveSignalWatch = + {# call bus_remove_signal_watch #} + +busPoll :: Bus + -> [MessageType] + -> ClockTimeDiff + -> IO Message +busPoll bus events timeout = + {# call bus_poll #} bus (fromIntegral $ fromFlags events) timeout >>= + newMessage + +onBusMessage, afterBusMessage :: BusClass bus + => bus + -> (Message -> IO ()) + -> IO (ConnectId bus) +onBusMessage = + connect_BOXED__NONE "message" newMessage_ False +afterBusMessage = + connect_BOXED__NONE "message" newMessage_ True addfile ./gstreamer/Media/Streaming/GStreamer/Caps.chs hunk ./gstreamer/Media/Streaming/GStreamer/Caps.chs 1 +-- GIMP Toolkit (GTK) Binding for Haskell: binding to gstreamer -*-haskell-*- +-- +-- Author : Peter Gavin +-- Created: 1-Apr-2007 +-- +-- Copyright (c) 2007 Peter Gavin +-- +-- This library is free software; you can redistribute it and/or +-- modify it under the terms of the GNU Library General Public +-- License as published by the Free Software Foundation; either +-- version 2 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 +-- Library General Public License for more details. +-- +module Media.Streaming.GStreamer.Caps ( + [_$_] + Caps, + capsNone, + capsAny, + capsSize, + capsGetStructure, + capsIsEmpty, + capsIsFixed, + capsIsEqual, + capsIsEqualFixed, + capsIsAlwaysCompatible, [_$_] + capsIsSubset, + capsIntersect, + capsUnion, + capsSubtract, + capsNormalize, + capsFromString, + capsToString, + [_$_] + CapsM, + capsCreate, + capsModify, + capsAppend, + capsMerge, + capsAppendStructure, + capsMergeStructure, + capsRemoveStructure, + capsTruncate + [_$_] + ) where + +{# context lib = "gstreamer" prefix = "gst" #} + +import System.Glib.FFI +import System.Glib.UTFString +{#import Media.Streaming.GStreamer.Types#} + +capsNone :: Caps +capsNone = + unsafePerformIO $ {# call caps_new_empty #} >>= newCaps + +capsAny :: Caps +capsAny = + unsafePerformIO $ {# call caps_new_any #} >>= newCaps + +capsSize :: Caps + -> Word +capsSize caps = + fromIntegral $ unsafePerformIO $ {# call caps_get_size #} caps + +capsGetStructure :: Caps + -> Word + -> Maybe Structure +capsGetStructure caps index = + unsafePerformIO $ + {# call caps_get_structure #} caps (fromIntegral index) >>= + maybePeek newStructure_ + +capsIsEmpty :: Caps + -> Bool +capsIsEmpty caps = + toBool $ unsafePerformIO $ + {# call caps_is_empty #} caps + +capsIsFixed :: Caps + -> Bool +capsIsFixed caps = + toBool $ unsafePerformIO $ + {# call caps_is_fixed #} caps + +capsIsEqual :: Caps + -> Caps + -> Bool +capsIsEqual caps1 caps2 = + toBool $ unsafePerformIO $ + {# call caps_is_equal #} caps1 caps2 + +instance Eq Caps where + (==) = capsIsEqual + +capsIsEqualFixed :: Caps + -> Caps + -> Bool +capsIsEqualFixed caps1 caps2 = + toBool $ unsafePerformIO $ + {# call caps_is_equal_fixed #} caps1 caps2 + +capsIsAlwaysCompatible :: Caps + -> Caps + -> Bool +capsIsAlwaysCompatible caps1 caps2 = + toBool $ unsafePerformIO $ + {# call caps_is_always_compatible #} caps1 caps2 + +capsIsSubset :: Caps + -> Caps + -> Bool +capsIsSubset caps1 caps2 = + toBool $ unsafePerformIO $ + {# call caps_is_subset #} caps1 caps2 + +capsIntersect :: Caps + -> Caps + -> Caps +capsIntersect caps1 caps2 = + unsafePerformIO $ + {# call caps_intersect #} caps1 caps2 >>= + newCaps + +capsUnion :: Caps + -> Caps + -> Caps +capsUnion caps1 caps2 = + unsafePerformIO $ + {# call caps_union #} caps1 caps2 >>= + newCaps + +capsSubtract :: Caps + -> Caps + -> Caps +capsSubtract caps1 caps2 = + unsafePerformIO $ + {# call caps_subtract #} caps1 caps2 >>= + newCaps + +capsNormalize :: Caps + -> Caps +capsNormalize caps = + unsafePerformIO $ + {# call caps_normalize #} caps >>= newCaps + +capsToString :: Caps + -> String +capsToString caps = + unsafePerformIO $ + {# call caps_to_string #} caps >>= readUTFString + +capsFromString :: String + -> Caps +capsFromString string = + unsafePerformIO $ + withUTFString string {# call caps_from_string #} >>= + newCaps + +newtype CapsM a = CapsM (CapsMRep a) +type CapsMRep a = (Caps -> IO a) + +instance Monad CapsM where + (CapsM aM) >>= fbM = + CapsM $ \caps -> + do a <- aM caps + let CapsM bM = fbM a + bM caps + return a = CapsM $ const $ return a + +marshalCapsModify :: IO (Ptr Caps) + -> CapsM a + -> (Caps, a) +marshalCapsModify mkCaps (CapsM action) = + unsafePerformIO $ + do ptr <- mkCaps + caps <- newCaps_ ptr + result <- action caps + caps' <- newCaps ptr + return (caps', result) + +capsCreate :: CapsM a + -> (Caps, a) +capsCreate action = + marshalCapsModify + {# call caps_new_empty #} + action + +capsModify :: Caps + -> CapsM a + -> (Caps, a) +capsModify caps action = + marshalCapsModify + ({# call caps_copy #} caps) + action + +capsAppend :: Caps + -> CapsM () +capsAppend caps2 = + CapsM $ \caps1 -> + {# call caps_copy #} caps2 >>= newCaps_ >>= + {# call caps_append #} caps1 + +capsMerge :: Caps + -> CapsM () +capsMerge caps2 = + CapsM $ \caps1 -> + {# call caps_copy #} caps2 >>= newCaps_ >>= + {# call caps_merge #} caps1 + +capsAppendStructure :: Structure + -> CapsM () +capsAppendStructure structure = + CapsM $ \caps -> + giveStructure structure $ + {# call caps_append_structure #} caps + +capsMergeStructure :: Structure + -> CapsM () +capsMergeStructure structure = + CapsM $ \caps -> + giveStructure structure $ + {# call caps_merge_structure #} caps + +capsRemoveStructure :: Word + -> CapsM () +capsRemoveStructure idx = + CapsM $ \caps -> + {# call caps_remove_structure #} caps $ fromIntegral idx + +capsTruncate :: CapsM () +capsTruncate = + CapsM {# call caps_truncate #} addfile ./gstreamer/Media/Streaming/GStreamer/Clock.chs hunk ./gstreamer/Media/Streaming/GStreamer/Clock.chs 1 +-- GIMP Toolkit (GTK) Binding for Haskell: binding to gstreamer -*-haskell-*- +-- +-- Author : Peter Gavin +-- Created: 1-Apr-2007 +-- +-- Copyright (c) 2007 Peter Gavin +-- +-- This library is free software; you can redistribute it and/or +-- modify it under the terms of the GNU Library General Public +-- License as published by the Free Software Foundation; either +-- version 2 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 +-- Library General Public License for more details. +-- +module Media.Streaming.GStreamer.Clock ( + ) where + +import Control.Monad (liftM, liftM4) +{#import Media.Streaming.GStreamer.Types#} +import System.Glib.FFI + +{# context lib = "gstreamer" prefix = "gst" #} + +clockAddObservation :: ClockClass clock + => clock + -> ClockTime + -> ClockTime + -> IO (Maybe Double) +clockAddObservation clock slave master = + alloca $ \rSquaredPtr -> + do success <- {# call clock_add_observation #} (toClock clock) slave master rSquaredPtr + if toBool success + then liftM (Just . realToFrac) $ peek rSquaredPtr + else return Nothing + +clockSetMaster :: (ClockClass clock, ClockClass master) + => clock + -> master + -> IO Bool +clockSetMaster clock master = + liftM toBool $ {# call clock_set_master #} (toClock clock) (toClock master) + +clockGetMaster :: ClockClass clock + => clock + -> IO (Maybe Clock) +clockGetMaster clock = + {# call clock_get_master #} (toClock clock) >>= maybePeek newClock + +clockSetResolution :: ClockClass clock + => clock + -> ClockTime + -> IO ClockTime +clockSetResolution = + {# call clock_set_resolution #} . toClock + +clockGetResolution :: ClockClass clock + => clock + -> IO ClockTime +clockGetResolution = + {# call clock_get_resolution #} . toClock + +clockGetTime :: ClockClass clock + => clock + -> IO ClockTime +clockGetTime = + {# call clock_get_time #} . toClock + +clockNewSingleShotID :: ClockClass clock + => clock + -> ClockTime + -> IO ClockID +clockNewSingleShotID clock time = + {# call clock_new_single_shot_id #} (toClock clock) time >>= + newClockID . castPtr + +clockNewPeriodicID :: ClockClass clock + => clock + -> ClockTime + -> ClockTime + -> IO ClockID +clockNewPeriodicID clock startTime interval = + {# call clock_new_periodic_id #} (toClock clock) startTime interval >>= + newClockID . castPtr + +clockGetInternalTime :: ClockClass clock + => clock + -> IO ClockTime +clockGetInternalTime = + {# call clock_get_internal_time #} . toClock + +clockGetCalibration :: ClockClass clock + => clock + -> IO (ClockTime, ClockTime, ClockTime, ClockTime) +clockGetCalibration clock = + alloca $ \internalPtr -> + alloca $ \externalPtr -> + alloca $ \rateNumPtr -> + alloca $ \rateDenomPtr -> + do {# call clock_get_calibration #} (toClock clock) + internalPtr + externalPtr + rateNumPtr + rateDenomPtr + liftM4 (\a b c d -> (a, b, c, d)) + (peek internalPtr) + (peek externalPtr) + (peek rateNumPtr) + (peek rateDenomPtr) + +clockSetCalibration :: ClockClass clock + => clock + -> ClockTime + -> ClockTime + -> ClockTime + -> ClockTime + -> IO () +clockSetCalibration = + {# call clock_set_calibration #} . toClock + +clockIDGetTime :: ClockID + -> IO ClockTime +clockIDGetTime clockID = + withClockID clockID $ {# call clock_id_get_time #} . castPtr + +clockIDWait :: ClockID + -> IO (ClockReturn, ClockTimeDiff) +clockIDWait clockID = + alloca $ \jitterPtr -> + do result <- withClockID clockID $ \clockIDPtr -> + {# call clock_id_wait #} (castPtr clockIDPtr) jitterPtr + jitter <- peek jitterPtr + return $ (toClockReturn result, jitter) + +clockIDUnschedule :: ClockID + -> IO () +clockIDUnschedule clockID = + withClockID clockID $ {# call clock_id_unschedule #} . castPtr + addfile ./gstreamer/Media/Streaming/GStreamer/Element.chs hunk ./gstreamer/Media/Streaming/GStreamer/Element.chs 1 +-- GIMP Toolkit (GTK) Binding for Haskell: binding to gstreamer -*-haskell-*- +-- +-- Author : Peter Gavin +-- Created: 1-Apr-2007 +-- +-- Version $Revision$ from $Date$ +-- +-- Copyright (c) 2007 Peter Gavin +-- +-- This library is free software; you can redistribute it and/or +-- modify it under the terms of the GNU Library General Public +-- License as published by the Free Software Foundation; either +-- version 2 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 +-- Library General Public License for more details. +-- +module Media.Streaming.GStreamer.Element ( + [_$_] + Element, + ElementClass, + castToElement, + toElement, + fromElement, + ElementFlags(..), + State(..), + StateChange(..), + StateChangeReturn(..) + [_$_] + ) where + +import Control.Monad ( liftM ) +import Data.Maybe ( fromMaybe ) +import System.Glib.FFI +import System.Glib.Flags +import System.Glib.UTFString ( withUTFString + , peekUTFString ) +{#import System.Glib.Signals#} +{#import System.Glib.GObject#} +{#import Media.Streaming.GStreamer.Types#} +{#import Media.Streaming.GStreamer.Signals#} +import GHC.Base ( unsafeCoerce# ) + +{# context lib = "gstreamer" prefix = "gst" #} + +elementAddPad :: (ElementClass elementT, PadClass padT) => + elementT + -> padT + -> IO Bool +elementAddPad element pad = + liftM toBool $ {# call element_add_pad #} (toElement element) (toPad pad) + +elementGetPad :: ElementClass elementT => + elementT + -> String + -> IO (Maybe Pad) +elementGetPad element name = + (withUTFString name $ {# call element_get_pad #} (toElement element)) >>= + maybePeek newPad + +elementGetCompatiblePad :: (ElementClass elementT, PadClass padT) => + elementT + -> padT + -> Caps + -> IO (Maybe Pad) +elementGetCompatiblePad element pad caps = + {# call element_get_compatible_pad #} (toElement element) (toPad pad) caps >>= + maybePeek newPad + +elementGetCompatiblePadTemplate :: (ElementClass elementT, PadTemplateClass padTemplateT) => + elementT + -> padTemplateT + -> IO (Maybe PadTemplate) +elementGetCompatiblePadTemplate element padTemplate = + {# call element_get_compatible_pad_template #} (toElement element) (toPadTemplate padTemplate) >>= + maybePeek newPadTemplate + + +elementGetRequestPad :: ElementClass elementT => + elementT + -> String + -> IO (Maybe Pad) +elementGetRequestPad element name = + (withUTFString name $ {# call element_get_request_pad #} (toElement element)) >>= + maybePeek newPad_ -- no finalizer; use elementReleaseRequestPad + +elementGetStaticPad :: ElementClass elementT => + elementT + -> String + -> IO (Maybe Pad) +elementGetStaticPad element name = + (withUTFString name $ {# call element_get_static_pad #} (toElement element)) >>= + maybePeek newPad + +elementNoMorePads :: ElementClass elementT => + elementT + -> IO () +elementNoMorePads element = + {# call element_no_more_pads #} (toElement element) + +elementReleaseRequestPad :: (ElementClass elementT, PadClass padT) => + elementT + -> padT + -> IO () +elementReleaseRequestPad element pad = + {# call element_release_request_pad #} (toElement element) (toPad pad) + +elementRemovePad :: (ElementClass elementT, PadClass padT) => + elementT + -> padT + -> IO Bool +elementRemovePad element pad = + liftM toBool $ {# call element_remove_pad #} (toElement element) (toPad pad) + +elementIteratePads :: (ElementClass elementT) => + elementT + -> IO (Iterator Pad) +elementIteratePads element = + {# call element_iterate_pads #} (toElement element) >>= newIterator + +elementIterateSinkPads :: (ElementClass elementT) => + elementT + -> IO (Iterator Pad) +elementIterateSinkPads element = + {# call element_iterate_sink_pads #} (toElement element) >>= newIterator + +elementIterateSrcPads :: (ElementClass elementT) => + elementT + -> IO (Iterator Pad) +elementIterateSrcPads element = + {# call element_iterate_sink_pads #} (toElement element) >>= newIterator + +elementLink :: (ElementClass elementT1, ElementClass elementT2) => + elementT1 + -> elementT2 + -> IO Bool +elementLink element1 element2 = + liftM toBool $ {# call element_link #} (toElement element1) (toElement element2) + +elementUnlink :: (ElementClass elementT1, ElementClass elementT2) => + elementT1 + -> elementT2 + -> IO () +elementUnlink element1 element2 = + {# call element_unlink #} (toElement element1) (toElement element2) + +elementLinkPads :: (ElementClass elementT1, ElementClass elementT2) => + elementT1 + -> String + -> elementT2 + -> String + -> IO Bool +elementLinkPads src srcPadName dest destPadName = + withUTFString destPadName $ \cDestPadName -> + withUTFString srcPadName $ \cSrcPadName -> + liftM toBool $ {# call element_link_pads #} (toElement src) cSrcPadName (toElement dest) cDestPadName + +elementUnlinkPads :: (ElementClass elementT1, ElementClass elementT2) => + elementT1 + -> String + -> elementT2 + -> String + -> IO () +elementUnlinkPads src srcPadName dest destPadName = + withUTFString destPadName $ \cDestPadName -> + withUTFString srcPadName $ \cSrcPadName -> + {# call element_unlink_pads #} (toElement src) cSrcPadName (toElement dest) cDestPadName + +elementLinkPadsFiltered :: (ElementClass elementT1, ElementClass elementT2) => + elementT1 + -> String + -> elementT2 + -> String + -> Caps + -> IO Bool +elementLinkPadsFiltered src srcPadName dest destPadName filter = + withUTFString destPadName $ \cDestPadName -> + withUTFString srcPadName $ \cSrcPadName -> + liftM toBool $ {# call element_link_pads_filtered #} (toElement src) cSrcPadName (toElement dest) cDestPadName filter + +elementLinkFiltered :: (ElementClass elementT1, ElementClass elementT2) => + elementT1 + -> elementT2 + -> Maybe Caps + -> IO Bool +elementLinkFiltered element1 element2 filter = + liftM toBool $ + {# call element_link_filtered #} (toElement element1) (toElement element2) $ + fromMaybe (Caps nullForeignPtr) filter + +elementSetBaseTime :: ElementClass elementT => + elementT + -> ClockTimeDiff + -> IO () +elementSetBaseTime element time = + {# call element_set_base_time #} (toElement element) $ fromIntegral time + +elementGetBaseTime :: ElementClass elementT => + elementT + -> IO ClockTimeDiff +elementGetBaseTime element = + liftM fromIntegral $ {# call element_get_base_time #} (toElement element) + +elementSetBus :: (ElementClass elementT, BusClass busT) => + elementT + -> busT + -> IO () +elementSetBus element bus = + {# call element_set_bus #} (toElement element) (toBus bus) + +elementGetBus :: ElementClass elementT => + elementT + -> IO Bus +elementGetBus element = + {# call element_get_bus #} (toElement element) >>= newBus + +elementGetFactory :: ElementClass elementT => + elementT + -> IO ElementFactory +elementGetFactory element = + {# call element_get_factory #} (toElement element) >>= newElementFactory_ + +elementSetIndex :: (ElementClass elementT, IndexClass indexT) => + elementT + -> indexT + -> IO () +elementSetIndex element index = + {# call element_set_index #} (toElement element) (toIndex index) + +elementGetIndex :: ElementClass elementT => + elementT + -> IO (Maybe Index) +elementGetIndex element = + {# call element_get_index #} (toElement element) >>= maybePeek newIndex + +elementIsIndexable :: ElementClass elementT => + elementT + -> IO Bool +elementIsIndexable element = + liftM toBool $ {# call element_is_indexable #} (toElement element) + +elementRequiresClock :: ElementClass elementT => + elementT + -> IO Bool +elementRequiresClock element = + liftM toBool $ {# call element_requires_clock #} (toElement element) + +elementSetClock :: (ElementClass elementT, ClockClass clockT) => + elementT + -> clockT + -> IO Bool +elementSetClock element clock = + liftM toBool $ {# call element_set_clock #} (toElement element) (toClock clock) + +elementGetClock :: ElementClass elementT => + elementT + -> IO (Maybe Clock) +elementGetClock element = + {# call element_get_clock #} (toElement element) >>= maybePeek newClock + +elementProvidesClock :: ElementClass elementT => + elementT + -> IO Bool +elementProvidesClock element = + liftM toBool $ {# call element_provides_clock #} $ toElement element + +elementProvideClock :: ElementClass elementT => + elementT + -> IO (Maybe Clock) +elementProvideClock element = + {# call element_provide_clock #} (toElement element) >>= maybePeek newClock + +elementSetState :: ElementClass elementT => + elementT + -> State + -> IO StateChangeReturn +elementSetState element state = + liftM (toEnum . fromIntegral) $ {# call element_set_state #} (toElement element) $ + fromIntegral $ fromEnum state + +elementGetState :: ElementClass elementT => + elementT + -> ClockTime + -> IO (StateChangeReturn, State, State) +elementGetState element timeout = + alloca $ \statePtr -> + alloca $ \pendingPtr -> + do result <- {# call element_get_state #} (toElement element) statePtr pendingPtr $ fromIntegral timeout + state <- peek statePtr + pending <- peek pendingPtr + return (toEnum (fromIntegral result), + toEnum (fromIntegral state), + toEnum (fromIntegral pending)) + +elementSetLockedState :: ElementClass elementT => + elementT + -> Bool + -> IO Bool +elementSetLockedState element lockedState = + liftM toBool $ {# call element_set_locked_state #} (toElement element) $ fromBool lockedState + +elementIsLockedState :: ElementClass elementT => + elementT + -> IO Bool +elementIsLockedState element = + liftM toBool $ {# call element_is_locked_state #} $ toElement element + +elementAbortState :: ElementClass elementT => + elementT + -> IO () +elementAbortState element = + {# call element_abort_state #} $ toElement element + +elementStateGetName :: State + -> String +elementStateGetName state = + unsafePerformIO $ ({# call element_state_get_name #} $ fromIntegral $ fromEnum state) >>= peekUTFString + +elementStateChangeReturnGetName :: StateChangeReturn + -> String +elementStateChangeReturnGetName stateRet = + unsafePerformIO $ ({# call element_state_change_return_get_name #} $ fromIntegral $ fromEnum stateRet) >>= peekUTFString + +elementSyncStateWithParent :: ElementClass elementT => + elementT + -> IO Bool +elementSyncStateWithParent element = + liftM toBool $ {# call element_sync_state_with_parent #} $ toElement element + +elementGetQueryTypes :: ElementClass element + => element + -> IO [QueryType] +elementGetQueryTypes element = + liftM (map (toEnum . fromIntegral)) $ + {# call element_get_query_types #} (toElement element) >>= + peekArray0 0 + +elementQuery :: (ElementClass element, QueryClass query) + => element + -> query + -> IO (Maybe query) +elementQuery element query = + do query' <- {# call mini_object_copy #} (toMiniObject query) >>= + newForeignPtr_ . castPtr + success <- {# call element_query #} (toElement element) $ Query query' + if toBool success + then liftM (Just . unsafeCoerce#) $ withForeignPtr query' $ newQuery . castPtr + else return Nothing + +elementQueryConvert :: ElementClass element + => element + -> Format + -> Int64 + -> IO (Maybe (Format, Int64)) +elementQueryConvert element srcFormat srcVal = + alloca $ \destFormatPtr -> + alloca $ \destValPtr -> + do success <- {# call element_query_convert #} (toElement element) + (fromIntegral $ fromEnum srcFormat) + (fromIntegral srcVal) + destFormatPtr + destValPtr + if toBool success + then do destFormat <- peek destFormatPtr + destVal <- peek destValPtr + return $ Just (toEnum $ fromIntegral destFormat, + fromIntegral destVal) + else return Nothing + +elementQueryPosition :: ElementClass element + => element + -> IO (Maybe (Format, Int64)) +elementQueryPosition element = + alloca $ \formatPtr -> + alloca $ \curPtr -> + do success <- {# call element_query_position #} (toElement element) formatPtr curPtr + if toBool success + then do format <- peek formatPtr + cur <- peek curPtr + return $ Just (toEnum $ fromIntegral format, + fromIntegral cur) + else return Nothing + +elementQueryDuration :: ElementClass element + => element + -> IO (Maybe (Format, Int64)) +elementQueryDuration element = + alloca $ \formatPtr -> + alloca $ \durationPtr -> + do success <- {# call element_query_duration #} (toElement element) formatPtr durationPtr + if toBool success + then do format <- peek formatPtr + duration <- peek durationPtr + return $ Just (toEnum $ fromIntegral format, + fromIntegral duration) + else return Nothing + +elementSendEvent :: (ElementClass element, EventClass event) + => element + -> event + -> IO Bool +elementSendEvent element event = + liftM toBool $ + giveMiniObject (toEvent event) $ {# call element_send_event #} (toElement element) + +elementSeekSimple :: ElementClass element + => element + -> Format + -> [SeekFlags] + -> Int64 + -> IO Bool +elementSeekSimple element format seekFlags seekPos = + liftM toBool $ + {# call element_seek_simple #} (toElement element) + (fromIntegral $ fromEnum format) + (fromIntegral $ fromFlags seekFlags) + (fromIntegral seekPos) + +elementSeek :: ElementClass element + => element + -> Double + -> Format + -> [SeekFlags] + -> SeekType + -> Int64 + -> SeekType + -> Int64 + -> IO Bool +elementSeek element rate format flags curType cur stopType stop = + liftM toBool $ + {# call element_seek #} (toElement element) + (realToFrac rate) + (fromIntegral $ fromEnum format) + (fromIntegral $ fromFlags flags) + (fromIntegral $ fromEnum curType) + (fromIntegral cur) + (fromIntegral $ fromEnum stopType) + (fromIntegral stop) + +onElementNoMorePads, afterElementNoMorePads :: (ElementClass element) + => element + -> IO () + -> IO (ConnectId element) +onElementNoMorePads = + connect_NONE__NONE "no-more-pads" False +afterElementNoMorePads = + connect_NONE__NONE "no-more-pads" True + +onElementPadAdded, afterElementPadAdded :: (ElementClass element) + => element + -> (GObject -> IO ()) + -> IO (ConnectId element) +onElementPadAdded = + connect_OBJECT__NONE "pad-added" False +afterElementPadAdded = + connect_OBJECT__NONE "pad-added" True + +onElementPadRemoved, afterElementPadRemoved :: (ElementClass element) + => element + -> (GObject -> IO ()) + -> IO (ConnectId element) +onElementPadRemoved = + connect_OBJECT__NONE "pad-removed" False +afterElementPadRemoved = + connect_OBJECT__NONE "pad-removed" True addfile ./gstreamer/Media/Streaming/GStreamer/ElementFactory.chs hunk ./gstreamer/Media/Streaming/GStreamer/ElementFactory.chs 1 +-- GIMP Toolkit (GTK) Binding for Haskell: binding to gstreamer -*-haskell-*- +-- +-- Author : Peter Gavin... [truncated message content] |
From: Duncan C. <dun...@wo...> - 2007-08-26 23:29:22
|
Fri Jul 20 13:09:32 PDT 2007 Peter Gavin <pg...@gm...> * gstreamer: add stub files to LIBADD in makefile hunk ./Makefile.am 1853 -libHSgstreamer_a_LIBADD = +libHSgstreamer_a_LIBADD = \ + gstreamer/Media/Streaming/GStreamer/Bus_stub.o \ + gstreamer/Media/Streaming/GStreamer/Index_stub.o \ + gstreamer/Media/Streaming/GStreamer/Iterator_stub.o \ + gstreamer/Media/Streaming/GStreamer/Registry_stub.o |
From: Axel S. <A....@ke...> - 2007-08-17 11:28:40
|
Fri Aug 17 04:26:26 PDT 2007 A....@ke... * Add a demo on PangoLayout. adddir ./demo/pango hunk ./Makefile.am 2004 + demo/pango/Layout.hs demo/pango/Makefile \ addfile ./demo/pango/Layout.hs hunk ./demo/pango/Layout.hs 1 +-- Example of using a PangoLayout +import Graphics.UI.Gtk +import Graphics.Rendering.Cairo + +loremIpsum = "Lorem ipsum dolor sit amet, consectetur adipisicing elit,\ + \ sed do eiusmod tempor incididunt ut labore et dolore magna\ + \ aliqua. Ut enim ad minim veniam, quis nostrud exercitation\ + \ ullamco laboris nisi ut aliquip ex ea commodo consequat.\ + \ Duis aute irure dolor in reprehenderit in voluptate\ + \ velit esse cillum dolore eu fugiat nulla pariatur.\ + \ Excepteur sint occaecat cupidatat non proident, sunt in culpa\ + \ qui officia deserunt mollit anim id est laborum." + +main = do + initGUI + -- Create the main window. + win <- windowNew + win `onDestroy` mainQuit + -- Create a drawing area in which we can render text. + area <- drawingAreaNew + containerAdd win area + area `onSizeRequest` return (Requisition 100 100) + [_$_] + -- Create a Cairo Context that contains information about the current font, + -- etc. + ctxt <- cairoCreateContext Nothing + lay <- layoutText ctxt loremIpsum + layoutSetWrap lay WrapWholeWords + [_$_] + -- Wrap the layout to a different width each time the window is resized. + area `onSizeAllocate` \(Rectangle _ _ w _) -> do + layoutSetWidth lay (Just (fromIntegral w)) + + -- Setup the handler to draw the layout. + area `onExpose` updateArea area lay + [_$_] + -- Run the whole thing. + widgetShowAll win + mainGUI + +updateArea :: DrawingArea -> PangoLayout -> Event -> IO Bool +updateArea area lay Expose {} = do + win <- widgetGetDrawWindow area + renderWithDrawable win $ do + moveTo 0 0 + showLayout lay + + return True + [_$_] addfile ./demo/pango/Makefile hunk ./demo/pango/Makefile 1 + +PROG = layout [_$_] +SOURCES = Layout.hs + +$(PROG) : $(SOURCES) + $(HC) --make $< -o $@ $(HCFLAGS) + +clean: + rm -f $(SOURCES:.hs=.hi) $(SOURCES:.hs=.o) $(PROG) + +HC=ghc |
From: Duncan C. <dun...@wo...> - 2007-08-14 18:33:50
|
Tue Aug 14 11:28:14 PDT 2007 Duncan Coutts <du...@ha...> * Fix ref counting bug in sourceBufferCreateMarker (reported by bwwx in #haskell) The docs say that gtk_source_buffer_create_marker returns a new GtkSourceMarker, owned by the buffer. So we need to ref the object, so we should use makeGObject rather than constructNewGObject. hunk ./sourceview/Graphics/UI/Gtk/SourceView/SourceBuffer.chs 228 - constructNewGObject mkSourceMarker $ + makeNewGObject mkSourceMarker $ |
From: Duncan C. <dun...@wo...> - 2007-08-14 08:44:39
|
Sat Aug 11 07:10:48 PDT 2007 hth...@zo... * Gtk+2.0 Tutorial Port (part 1) Start of a port to Gtk2Hs of the Gtk+2.0 tutorial included in the Gtk documentation. Note: Chapter 2 is supposed to be an introductory overview, as in the original, but for Gtk2Hs. I'm hoping someone who knows more will jump in here. The implemented chapters are: 1. Contents and copyright, as required by the original authors 2. To be written by an expert... 3. Getting Started 4. Packing Widgets 5.a. Packing Demonstration Program 5.b. Packing Using Tables 6. The Button Widget 7. Adjustments, Scale and Range The examples have been tested with Gtk2Hs-0.9.12 (the first ones with .11) on Fedora 6. The html files have been taken from the original Gtk+2.0 tutorial, processed in Open Office Writer html mode, and then cleaned up with Screem and tidy. There are still some unreferred name tags left from the original. adddir ./docs/tutorial/Tutorial_Port adddir ./docs/tutorial/Tutorial_Port/Example_Code adddir ./docs/tutorial/Tutorial_Port/Images addfile ./docs/tutorial/Tutorial_Port/Example_Code/GtkChap3a.hs hunk ./docs/tutorial/Tutorial_Port/Example_Code/GtkChap3a.hs 1 +{- GTK 2.0 Tutorial: Chapter 3a, Getting Started + + To run with GHCi: ghci GtkChap3.hs + To compile with GHC: ghc --make GtkChap3.hs -o chap +-} + [_$_] +import Graphics.UI.Gtk + +main :: IO () +main = do [_$_] + initGUI + window <- windowNew + widgetShowAll window + mainGUI + +{- Notes: + 1) Watch the upper and lower case occurrences + 2) Ctl-z to abort GHCi, not Ctl-c [_$_] +-} [_$_] + + + + [_$_] addfile ./docs/tutorial/Tutorial_Port/Example_Code/GtkChap3b.hs hunk ./docs/tutorial/Tutorial_Port/Example_Code/GtkChap3b.hs 1 +import Graphics.UI.Gtk + +hello :: (ButtonClass o) => o -> IO () +hello b = set b [buttonLabel := "Hello World"] + +main :: IO () +main = do [_$_] + initGUI + window <- windowNew + button <- buttonNew + set window [windowDefaultWidth := 200, windowDefaultHeight := 200, + containerChild := button , containerBorderWidth := 10 ] + onClicked button (hello button) + onDestroy window mainQuit + widgetShowAll window + mainGUI [_$_] + +{- Notes: + 1) the default size of the window is set to 200 x 200 pixels + 2) when the button is clicked the hello function is 'executed' +-} addfile ./docs/tutorial/Tutorial_Port/Example_Code/GtkChap4.hs hunk ./docs/tutorial/Tutorial_Port/Example_Code/GtkChap4.hs 1 +-- GTK 2.0 Tutorial: Chapter 4, Moving On + +import Graphics.UI.Gtk + +main :: IO () +main = do + initGUI + window <- windowNew + hbox <- hBoxNew True 10 + button1 <- buttonNewWithLabel "Button 1" + button2 <- buttonNewWithLabel "Button 2" + set window [windowDefaultWidth := 200, windowDefaultHeight := 200, + containerBorderWidth := 10, containerChild := hbox ] + boxPackStart hbox button1 PackGrow 0 + boxPackStart hbox button2 PackGrow 0 + widgetShowAll window + onDestroy window mainQuit + mainGUI addfile ./docs/tutorial/Tutorial_Port/Example_Code/GtkChap5a.hs hunk ./docs/tutorial/Tutorial_Port/Example_Code/GtkChap5a.hs 1 +-- GTK 2.0 Tutorial: Chapter 5a, Packing Widgets + +import Graphics.UI.Gtk + +main :: IO () +main = do + initGUI + window <- windowNew + vbox <- vBoxNew False 0 + set window [containerBorderWidth := 10, [_$_] + windowTitle := "Packing Demonstration", + containerChild := vbox ] + label1 <- labelNew (Just "hBoxNew False 0") + miscSetAlignment label1 0 0 + boxPackStart vbox label1 PackNatural 0 + box1 <- makeBox False 0 PackNatural 0 + boxPackStart vbox box1 PackNatural 0 + box2 <- makeBox False 0 PackRepel 0 + boxPackStart vbox box2 PackNatural 0 [_$_] + box3 <- makeBox False 0 PackGrow 0 + boxPackStart vbox box3 PackNatural 0 + sep1 <- hSeparatorNew + boxPackStart vbox sep1 PackNatural 10 [_$_] + label2 <- labelNew (Just "hBoxNew True 0") + miscSetAlignment label2 0 0 + boxPackStart vbox label2 PackNatural 0 + box4 <- makeBox True 0 PackNatural 0 + boxPackStart vbox box4 PackNatural 0 + box5 <- makeBox True 0 PackRepel 0 + boxPackStart vbox box5 PackNatural 0 [_$_] + box6 <- makeBox False 0 PackGrow 0 + boxPackStart vbox box6 PackNatural 0 + sep <- hSeparatorNew + boxPackStart vbox sep PackNatural 10 [_$_] + quitbox <- hBoxNew False 0 + boxPackStart vbox quitbox PackNatural 0 + quitbutton <- buttonNewWithLabel "Quit" + boxPackStart quitbox quitbutton PackRepel 0 + onClicked quitbutton mainQuit [_$_] + onDestroy window mainQuit [_$_] + widgetShowAll window + mainGUI + + +makeBox :: Bool -> Int -> Packing -> Int -> IO HBox +makeBox homogeneous spacing packing padding = do + box <- hBoxNew homogeneous spacing + button1 <- buttonNewWithLabel "boxPackStart" + boxPackStart box button1 packing padding + button2 <- buttonNewWithLabel "box" + boxPackStart box button2 packing padding + button3 <- buttonNewWithLabel "button" + boxPackStart box button3 packing padding + button4 <- case packing of [_$_] + PackNatural -> buttonNewWithLabel "PackNatural" + PackRepel -> buttonNewWithLabel "PackRepel" + PackGrow -> buttonNewWithLabel "PackGrow" + boxPackStart box button4 packing padding [_$_] + button5 <- buttonNewWithLabel (show padding) + boxPackStart box button5 packing padding [_$_] + return box addfile ./docs/tutorial/Tutorial_Port/Example_Code/GtkChap5b.hs hunk ./docs/tutorial/Tutorial_Port/Example_Code/GtkChap5b.hs 1 +-- GTK 2.0 Tutorial: Chapter 5b, Table + +import Graphics.UI.Gtk + +main :: IO () +main = do + initGUI + window <- windowNew + set window [windowTitle := "Table", containerBorderWidth := 20, + windowDefaultWidth := 150, windowDefaultHeight := 100 ] + table <- tableNew 2 2 True + containerAdd window table + button1 <- buttonNewWithLabel "On" + onClicked button1 (buttonSwitch button1) + tableAttachDefaults table button1 0 1 0 1 + button2 <- buttonNewWithLabel "Off" + onClicked button2 (buttonSwitch button2) + tableAttachDefaults table button2 1 2 0 1 + button3 <- buttonNewWithLabel "Quit" + onClicked button3 mainQuit + tableAttachDefaults table button3 0 2 1 2 + onDestroy window mainQuit [_$_] + widgetShowAll window + mainGUI + +buttonSwitch :: Button -> IO () +buttonSwitch b = do + txt <- buttonGetLabel b + let newtxt = case txt of + "Off" -> "On" + "On" -> "Off" + buttonSetLabel b newtxt [_$_] + + addfile ./docs/tutorial/Tutorial_Port/Example_Code/GtkChap6a.hs hunk ./docs/tutorial/Tutorial_Port/Example_Code/GtkChap6a.hs 1 +import Graphics.UI.Gtk + +main :: IO () +main = do + initGUI + window <- windowNew + set window [windowTitle := "Pix", + containerBorderWidth := 10 ] + button <- buttonNew + onClicked button (putStrLn "button clicked") + box <- labelBox "info.xpm" "cool button" + containerAdd button box + containerAdd window button + widgetShowAll window + onDestroy window mainQuit + mainGUI + +labelBox :: FilePath -> String -> IO HBox +labelBox fn txt = do + box <- hBoxNew False 0 + set box [containerBorderWidth := 2 ] + image <- imageNewFromFile fn + label <- labelNew (Just txt) + boxPackStart box image PackNatural 3 [_$_] + boxPackStart box label PackNatural 3 + return box [_$_] addfile ./docs/tutorial/Tutorial_Port/Example_Code/GtkChap6b.hs hunk ./docs/tutorial/Tutorial_Port/Example_Code/GtkChap6b.hs 1 +-- Chapter 7, Radio Button + +-- packeds not good! + +import Graphics.UI.Gtk + +main :: IO () +main = do + initGUI + window <- windowNew + set window [windowTitle := "Radio Button", containerBorderWidth := 5 , + windowDefaultWidth := 200, windowDefaultHeight := 150 ] + box1 <- vBoxNew False 0 + containerAdd window box1 + box2 <- vBoxNew False 10 + containerSetBorderWidth box2 10 + boxPackStart box1 box2 PackNatural 0 + button1 <- radioButtonNewWithLabel "button 1" + boxPackStart box2 button1 PackNatural 0 + button2 <- radioButtonNewWithLabelFromWidget button1 "button 2" + boxPackStart box2 button2 PackNatural 0 + button3 <- radioButtonNewWithLabelFromWidget button2 "button 3" + boxPackStart box2 button3 PackNatural 0 + toggleButtonSetActive button2 True + onToggled button1 (setRadioState button1) + onToggled button2 (setRadioState button2) + onToggled button3 (setRadioState button3) + sep <- hSeparatorNew + boxPackStart box1 sep PackNatural 0 + box3 <- vBoxNew False 10 + containerSetBorderWidth box3 10 + boxPackStart box1 box3 PackNatural 0 + closeb <- buttonNewWithLabel "close" + boxPackStart box3 closeb PackNatural 0 + onClicked closeb mainQuit + widgetShowAll window + onDestroy window mainQuit + mainGUI + +setRadioState :: RadioButton -> IO () +setRadioState b = do + state <- toggleButtonGetActive b + label <- get b buttonLabel + putStrLn ("State " ++ label ++ " now is " ++ (show state)) + + addfile ./docs/tutorial/Tutorial_Port/Example_Code/GtkChap7.hs hunk ./docs/tutorial/Tutorial_Port/Example_Code/GtkChap7.hs 1 +-- Chapter 9, Range Widgets, Example + +import Graphics.UI.Gtk + +main :: IO () +main = do + initGUI + window <- windowNew + set window [windowTitle := "range controls", + windowDefaultWidth := 250 ] + mainbox <- vBoxNew False 10 + containerAdd window mainbox + containerSetBorderWidth mainbox 10 + + box1 <- hBoxNew False 0 + boxPackStart mainbox box1 PackGrow 0 + adj1 <- adjustmentNew 0.0 0.0 101.0 0.1 1.0 1.0 + vsc <- vScaleNew adj1 + boxPackStart box1 vsc PackGrow 0 + + box2 <- vBoxNew False 0 + boxPackStart box1 box2 PackGrow 0 [_$_] + + hsc1 <- hScaleNew adj1 + boxPackStart box2 hsc1 PackGrow 0 + hsc2 <- hScaleNew adj1 + boxPackStart box2 hsc2 PackGrow 0 + + chb <- checkButtonNewWithLabel "Display Value on Scale Widgets" + boxPackStart mainbox chb PackNatural 10 + toggleButtonSetActive chb True + + box3 <- hBoxNew False 10 + boxPackStart mainbox box3 PackNatural 0 + label1 <- labelNew (Just "Scale Value Position:") + boxPackStart box3 label1 PackNatural 0 + opt1 <- makeOpt1 + boxPackStart box3 opt1 PackNatural 0 + + box4 <- hBoxNew False 10 + boxPackStart mainbox box4 PackNatural 0 + label2 <- labelNew (Just "Scale Update Policy:") + boxPackStart box4 label2 PackNatural 0 + opt2 <- makeOpt2 + boxPackStart box4 opt2 PackNatural 0 + + adj2 <- adjustmentNew 1.0 0.0 5.0 1.0 1.0 0.0 + + box5 <- hBoxNew False 0 + containerSetBorderWidth box5 10 + boxPackStart mainbox box5 PackGrow 0 + label3 <- labelNew (Just "Scale Digits:") + boxPackStart box5 label3 PackNatural 10 + dsc <- hScaleNew adj2 + boxPackStart box5 dsc PackGrow 0 + scaleSetDigits dsc 0 + + adj3 <- adjustmentNew 1.0 1.0 101.0 1.0 1.0 0.0 + + box6 <- hBoxNew False 0 + containerSetBorderWidth box6 10 + boxPackStart mainbox box6 PackGrow 0 + label4 <- labelNew (Just "Scrollbar Page Size:") + boxPackStart box6 label4 PackNatural 10 + psc <- hScaleNew adj3 + boxPackStart box6 psc PackGrow 0 + scaleSetDigits psc 0 + + onToggled chb $ do toggleDisplay chb [hsc1,hsc2] + toggleDisplay chb [vsc] + + onChanged opt1 $ do setScalePos opt1 hsc1 [_$_] + setScalePos opt1 hsc2 + setScalePos opt1 vsc + + onChanged opt2 $ do setUpdatePol opt2 hsc1 [_$_] + setUpdatePol opt2 hsc2 + setUpdatePol opt2 vsc + + onValueChanged adj2 $ do setDigits hsc1 adj2 + setDigits hsc2 adj2 + setDigits vsc adj2 + + onValueChanged adj3 $ do val <- adjustmentGetValue adj3 + adjustmentSetPageSize adj1 val + + widgetShowAll window + onDestroy window mainQuit + mainGUI + +makeOpt1 :: IO ComboBox +makeOpt1 = do + cb <- comboBoxNewText + comboBoxAppendText cb "TOP" [_$_] + comboBoxAppendText cb "BOTTOM" + comboBoxAppendText cb "LEFT" [_$_] + comboBoxAppendText cb "RIGHT" [_$_] + comboBoxSetActive cb 0 + return cb + +setScalePos :: ScaleClass self => ComboBox -> self -> IO () +setScalePos cb sc = do + ntxt <- comboBoxGetActiveText cb + let pos = case ntxt of + (Just "TOP") -> PosTop + (Just "BOTTOM") -> PosBottom + (Just "LEFT") -> PosLeft + (Just "RIGHT") -> PosRight + Nothing -> error "GtkChap9.hs setScalePos: no position set" + scaleSetValuePos sc pos [_$_] + + [_$_] +makeOpt2 :: IO ComboBox +makeOpt2 = do + cb <- comboBoxNewText + comboBoxAppendText cb "Continuous" [_$_] + comboBoxAppendText cb "Discontinuous" + comboBoxAppendText cb "Delayed" [_$_] + comboBoxSetActive cb 0 + return cb + +setUpdatePol :: RangeClass self => ComboBox -> self -> IO () +setUpdatePol cb sc = do + ntxt <- comboBoxGetActiveText cb + let pol = case ntxt of + (Just "Continuous") -> UpdateContinuous + (Just "Discontinuous") -> UpdateDiscontinuous + (Just "Delayed") -> UpdateDelayed + Nothing -> error "GtkChap9.hs setUpdatePol: no policy set" + rangeSetUpdatePolicy sc pol [_$_] + +toggleDisplay :: ScaleClass self => CheckButton -> [self] -> IO () +toggleDisplay b scls = sequence_ (map change scls) where [_$_] + change sc = do st <- toggleButtonGetActive b + scaleSetDrawValue sc st + +setDigits :: ScaleClass self => self -> Adjustment -> IO () +setDigits sc adj = do val <- get adj adjustmentValue + set sc [scaleDigits := (round val) ] + + [_$_] addfile ./docs/tutorial/Tutorial_Port/Example_Code/info.xpm hunk ./docs/tutorial/Tutorial_Port/Example_Code/info.xpm 1 +/* XPM */ +static char *openfile[] = { +/* width height num_colors chars_per_pixel */ +" 20 19 66 2", +/* colors */ +".. c None", +".# c #000000", +".a c #dfdfdf", +".b c #7f7f7f", +".c c #006f6f", +".d c #00efef", +".e c #009f9f", +".f c #004040", +".g c #00bfbf", +".h c #ff0000", +".i c #ffffff", +".j c #7f0000", +".k c #007070", +".l c #00ffff", +".m c #00a0a0", +".n c #004f4f", +".o c #00cfcf", +".p c #8f8f8f", +".q c #6f6f6f", +".r c #a0a0a0", +".s c #7f7f00", +".t c #007f7f", +".u c #5f5f5f", +".v c #707070", +".w c #00f0f0", +".x c #009090", +".y c #ffff00", +".z c #0000ff", +".A c #00afaf", +".B c #00d0d0", +".C c #00dfdf", +".D c #005f5f", +".E c #00b0b0", +".F c #001010", +".G c #00c0c0", +".H c #000f0f", +".I c #00007f", +".J c #005050", +".K c #002f2f", +".L c #dfcfcf", +".M c #dfd0d0", +".N c #006060", +".O c #00e0e0", +".P c #00ff00", +".Q c #002020", +".R c #dfc0c0", +".S c #008080", +".T c #001f1f", +".U c #003f3f", +".V c #007f00", +".W c #00000f", +".X c #000010", +".Y c #00001f", +".Z c #000020", +".0 c #00002f", +".1 c #000030", +".2 c #00003f", +".3 c #000040", +".4 c #00004f", +".5 c #000050", +".6 c #00005f", +".7 c #000060", +".8 c #00006f", +".9 c #000070", +"#. c #7f7f80", +"## c #9f9f9f", +/* pixels */ +"........................................", +"........................................", +"........................................", +".......................#.#.#............", +".....................#.......#...#......", +"...............................#.#......", +".......#.#.#.................#.#.#......", +".....#.y.i.y.#.#.#.#.#.#.#..............", +".....#.i.y.i.y.i.y.i.y.i.#..............", +".....#.y.i.y.i.y.i.y.i.y.#..............", +".....#.i.y.i.y.#.#.#.#.#.#.#.#.#.#.#....", +".....#.y.i.y.#.s.s.s.s.s.s.s.s.s.#......", +".....#.i.y.#.s.s.s.s.s.s.s.s.s.#........", +".....#.y.#.s.s.s.s.s.s.s.s.s.#..........", +".....#.#.s.s.s.s.s.s.s.s.s.#............", +".....#.#.#.#.#.#.#.#.#.#.#..............", +"........................................", +"........................................", +"........................................" +}; addfile ./docs/tutorial/Tutorial_Port/Images/GtkChap3a.png binary ./docs/tutorial/Tutorial_Port/Images/GtkChap3a.png addfile ./docs/tutorial/Tutorial_Port/Images/GtkChap3b.png binary ./docs/tutorial/Tutorial_Port/Images/GtkChap3b.png addfile ./docs/tutorial/Tutorial_Port/Images/GtkChap4.png binary ./docs/tutorial/Tutorial_Port/Images/GtkChap4.png addfile ./docs/tutorial/Tutorial_Port/Images/GtkChap5a1.png binary ./docs/tutorial/Tutorial_Port/Images/GtkChap5a1.png addfile ./docs/tutorial/Tutorial_Port/Images/GtkChap5a2.png binary ./docs/tutorial/Tutorial_Port/Images/GtkChap5a2.png addfile ./docs/tutorial/Tutorial_Port/Images/GtkChap5b.png binary ./docs/tutorial/Tutorial_Port/Images/GtkChap5b.png addfile ./docs/tutorial/Tutorial_Port/Images/GtkChap6a.png binary ./docs/tutorial/Tutorial_Port/Images/GtkChap6a.png addfile ./docs/tutorial/Tutorial_Port/Images/GtkChap6b.png binary ./docs/tutorial/Tutorial_Port/Images/GtkChap6b.png addfile ./docs/tutorial/Tutorial_Port/Images/GtkChap7.png binary ./docs/tutorial/Tutorial_Port/Images/GtkChap7.png addfile ./docs/tutorial/Tutorial_Port/chap1.html hunk ./docs/tutorial/Tutorial_Port/chap1.html 1 +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> + +<html> +<head> + <meta name="generator" content= + "HTML Tidy for Linux/x86 (vers 11 February 2007), see www.w3.org"> + <meta http-equiv="CONTENT-TYPE" content= + "text/html; charset=us-ascii"> + + <title>Gtk2Hs Tutorial</title> +</head> + +<body lang="en-US" text="#000000" link="#0000FF" vlink="#840084" +bgcolor="#FFFFFF" dir="ltr"> + <h2 align="center"><a name="Gtk2Hs-TUT" id= + "Gtk2Hs-TUT"></a><a name="AEN2" id="AEN2"></a>Gtk2Hs + Tutorial (part 1)</h2> + + <h3>Hans van Thiel</h3> + <hr> + <br> + <br> + + <h3>The start of a port and adaptation to Gtk2Hs of the:</h3> + + <h3>GTK+2.0 Tutorial by</h3> + + <h3><a name="AEN6" id="AEN6"></a>Tony Gale</h3> + + <h3><a name="AEN9" id="AEN9"></a>Ian Main</h3> + + <h3><a name="AEN12" id="AEN12"></a>& the GTK team</h3> + <hr> + + <dl> + <dt><b>Table of Contents</b></dt> + + <dt><br> + <br> + Introduction and Overview: not available yet...</dt> + + <dt><br> + <a href="chap3.html">Getting Started</a></dt> + + <dt><br> + <a href="chap4.html">Packing Widgets</a></dt> + + <dt><br> + <a href="chap5a.html">Packing Demonstration Program</a></dt> + + <dt><br> + <a href="chap5b.html">Packing Using Tables</a></dt> + + <dt><br> + <a href="chap6.html">The Button Widget</a></dt> + + <dt><br> + <a href="chap7.html">Adjustments, Scale and Range</a></dt> + </dl><br> + <hr> + <br> + + <h1><a name="CH-COPYRIGHT" id="CH-COPYRIGHT"></a>Tutorial + Copyright and Permissions Notice</h1> + + <p>The GTK Tutorial is Copyright (C) 1997 Ian Main.</p> + + <p>Copyright (C) 1998-2002 Tony Gale.</p> + + <p>Copyright (C) 2007 Hans van Thiel</p> + + <p>Permission is granted to make and distribute verbatim copies + of this manual provided the copyright notice and this permission + notice are preserved on all copies.</p> + + <p>Permission is granted to copy and distribute modified versions + of this document under the conditions for verbatim copying, + provided that this copyright notice is included exactly as in the + original, and that the entire resulting derived work is + distributed under the terms of a permission notice identical to + this one.</p> + + <p>Permission is granted to copy and distribute translations of + this document into another language, under the above conditions + for modified versions.</p> + + <p>If you are intending to incorporate this document into a + published work, please contact the maintainer, and we will make + an effort to ensure that you have the most up to date information + available.</p> + + <p>There is no guarantee that this document lives up to its + intended purpose. This is simply provided as a free resource. As + such, the authors and maintainers of the information provided + within can not make any guarantee that the information is even + accurate.</p> + <hr> + + <table summary="links to other pages" width="100%" border="0" + cellpadding="0" cellspacing="0"> + <tr valign="top"> + <td width="33%"> + <p align="left"><br></p> + </td> + + <td width="34%"> + <p align="center"><br></p> + </td> + + <td width="33%"> + <p align="right"><a href="chap3.html">Next + >>></a></p> + </td> + </tr> + + <tr valign="top"> + <td width="33%"> + <p align="left"><br></p> + </td> + + <td width="34%"> + <p align="center"> </p> + </td> + + <td width="33%"> + <p align="right"><br></p> + </td> + </tr> + </table> +</body> +</html> addfile ./docs/tutorial/Tutorial_Port/chap3.html hunk ./docs/tutorial/Tutorial_Port/chap3.html 1 +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> + +<html> +<head> + <meta name="generator" content= + "HTML Tidy for Linux/x86 (vers 11 February 2007), see www.w3.org"> + <meta http-equiv="CONTENT-TYPE" content= + "text/html; charset=us-ascii"> + + <title>Getting Started</title> +</head> + +<body lang="en-US" text="#000000" link="#0000FF" vlink="#840084" +bgcolor="#FFFFFF" dir="ltr"> + <table summary="links to other pages" width="100%" border="0" + cellpadding="0" cellspacing="0"> + <tr> + <th colspan="3"> + <p align="center">Gtk2Hs Tutorial</p> + </th> + </tr> + + <tr valign="bottom"> + <td width="10%"> + <p align="left"><a href= + "chap1.html"><<<Previous</a></p> + </td> + + <td width="80%"></td> + + <td width="10%"> + <p align="right"><a href="chap4.html">Next + >>></a></p> + </td> + </tr> + </table> + <hr> + + <h3><a name="CH-GETTINGSTARTED" id= + "CH-GETTINGSTARTED"></a>Getting Started</h3> + + <p>The first thing to do, of course, is download Gtk2Hs and + install it. You can always get the latest version from <a href= + "http://haskell.org/gtk2hs/">http://haskell.org/gtk2hs/</a> and + several Linux versions have their own Gtk2Hs packages. For + Windows there is an installer available.</p> + + <p>The next thing is to open the Gtk2Hs API reference + documentation for your version. You will need to use this + extensively to be able to find the names for widgets, methods, + attributes and signals you might want to use. The <i>contents</i> + list all modules and there is also an <i>index</i>. Inside each + module description there is also a class hierarchy. If a method, + attribute or signal you expect is missing, it might belong to one + of the super classes of which your widget type is an + instance.</p> + + <p>To begin our introduction to Gk2Hs, we'll start with the + simplest program possible. This program will create a 200x200 + pixel window and has no way of exiting except to be killed by + using the shell.</p> + + <p><img src="./Images/GtkChap3a.png" align="bottom" alt= + "GtkChap3a"></p> + + <table summary="haskell code" width="100%" border="0" + cellpadding="2" cellspacing="2" bgcolor="#E0E0E0"> + <tr> + <td> + <pre> +import Graphics.UI.Gtk + +main :: IO () +main = do [_$_] + initGUI + window <- windowNew + widgetShowAll window + mainGUI +</pre> + </td> + </tr> + </table> + + <p>You can compile the above program with the Glasgow Haskell + Compiler (GHC) using:</p> + + <p><tt>ghc --make GtkChap3a.hs -o Chap3a</tt></p> + + <p>assuming GtkChap3a.hs is the filename. Alternatively you can + use the interactive GHCi, for earlier and later versions of + Gtk2Hs. (Because of threading problems intermediate versions will + not work interactively. Gtk2Hs does not work with Hugs.)</p> + + <p>The first line imports the Gtk2Hs graphics library.</p> + + <p>All Gtk2Hs programs run in main and the first line:</p> + + <table summary="haskell code" width="100%" border="0" + cellpadding="2" cellspacing="2" bgcolor="#E0E0E0"> + <tr> + <td> + <pre> + initGUI +</pre> + </td> + </tr> + </table> + + <p>is called in all Gk2Hs applications. The next two lines of + code create and display a window.</p> + + <table summary="haskell code" width="100%" border="0" + cellpadding="2" cellspacing="2" bgcolor="#E0E0E0"> + <tr> + <td> + <pre> + window <- windowNew + widgetShowAll window +</pre> + </td> + </tr> + </table> + + <p>Rather than create a window of 0x0 size, a window without + children is set to 200x200 by default so you can still manipulate + it. Widgets that can be visible (not all can) may be shown or + hidden using their own methods, but the second line works on a + widget (here the window) and all its children.</p> + + <p>The last line enters the Gtk2Hs main processing loop.</p> + + <table summary="haskell code" width="100%" border="0" + cellpadding="2" cellspacing="2" bgcolor="#E0E0E0"> + <tr> + <td> + <pre> + mainGUI +</pre> + </td> + </tr> + </table> + + <p>mainGUI is another call you will see in every Gtk2Hs + application. When control reaches this point, Gtk2Hs will sleep + waiting for X events (such as button or key presses), timeouts, + or file IO notifications to occur. In our simple example, + however, events are ignored.</p> + + <h3><a name="SEC-HELLOWORLD" id="SEC-HELLOWORLD"></a>Hello World + in Gtk2Hs</h3> + + <p>Now for a program with a widget (a button). It's the classic + hello world à la Gtk2Hs.</p> + + <p><img src="./Images/GtkChap3b.png" name="graphics2" align= + "bottom" alt="GtkChap3b" id="graphics2"></p> + + <p>If the button is clicked it will display the text <i>Hello + World</i>. This is implemented in the Haskell function + <i>hello</i> with a button <i>b</i> as its argument. The type + declaration actually states the type variable <i>o</i> is an + instance of class <i>ButtonClass</i>. Gtk2Hs extensively uses + Haskell classes to map the object hierarchy of the original Gtk + widgets. Each widget in Gtk2Hs, of course, has a Haskell + type.</p> + + <p>Widgets, and the classes their types belong to, usually have + attributes. These can be set either by named methods or by the + general <i>set</i> function, which uses a list like notation as + shown below. Of special interest here is the + <i>containerChild</i> attribute of the window (actually a super + class of the window) which states the relationship with the + button. Because of this <i>widgetShowAll window</i> will also + make the button visible.</p> + + <p>Widgets are connected to other widgets in a graphical + dependency tree (not to be confused with the class hierarchy). + Gtk2hs also works with the Glade visual interface designer and, + if you use Glade, such connections are visible in the <i>Widget + tree</i> window. There is a separate introductory tutorial on how + to use Glade with Gtk2Hs.</p> + + <table summary="haskell code" width="100%" border="0" + cellpadding="2" cellspacing="2" bgcolor="#E0E0E0"> + <tr> + <td> + <pre> +import Graphics.UI.Gtk + +hello :: (ButtonClass o) => o -> IO () +hello b = set b [buttonLabel := "Hello World"] + +main :: IO () +main = do [_$_] + initGUI + window <- windowNew + button <- buttonNew + set window [windowDefaultWidth := 200, windowDefaultHeight := 200, + containerChild := button , containerBorderWidth := 10 ] + onClicked button (hello button) + onDestroy window mainQuit + widgetShowAll window + mainGUI [_$_] +</pre> + </td> + </tr> + </table> + <hr> + + <p>Gtk2Hs is event driven. The mainGUI function will sleep until + something happens, like a mouse being clicked, a window being + destroyed or something else typical for a widget. Such events + then trigger signals which in turn trigger user defined functions + to be evaluated. In this case the <i>onClicked</i> signal, + emitted by the user clicking the button, is linked to the text + being displayed on the same button. When the user destroys the + window, unlike as with the first program, <i>main</i> now exits + cleanly.</p> + + <p><br> + <br></p> + + <table summary="links to other pages" width="100%" border="0" + cellpadding="0" cellspacing="0"> + <tr valign="top"> + <td width="33%"> + <p align="left"><a href="chap1.html"><<< + Previous</a></p> + </td> + + <td width="34%"> + <p align="center"><a href="chap1.html">Home</a></p> + </td> + + <td width="33%"> + <p align="right"><a href="chap4.html">Next + >>></a></p> + </td> + </tr> + + <tr valign="top"> + <td width="33%"> + <p align="left">Contents</p> + </td> + + <td width="34%"> + <p align="center"> </p> + </td> + + <td width="33%"> + <p align="right">Packing Widgets</p> + </td> + </tr> + </table> + + <p><br> + <br></p> +</body> +</html> addfile ./docs/tutorial/Tutorial_Port/chap4.html hunk ./docs/tutorial/Tutorial_Port/chap4.html 1 +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> + +<html> +<head> + <meta name="generator" content= + "HTML Tidy for Linux/x86 (vers 11 February 2007), see www.w3.org"> + + <title>Packing Widgets</title> +</head> + +<body lang="en-US" text="#000000" link="#0000FF" vlink="#840084" +bgcolor="#FFFFFF" dir="ltr"> + <table summary="links to other pages" width="100%" border="0" + cellpadding="0" cellspacing="0" style= + "page-break-before: always"> + <tr> + <th colspan="3"> + <p align="center">GTK2Hs Tutorial</p> + </th> + </tr> + + <tr valign="bottom"> + <td width="10%"> + <p align="left"><a href= + "chap3.html"><<<Previous</a></p> + </td> + + <td width="80%"></td> + + <td width="10%"> + <p align="right"><a href="chap5a.html">Next + >>></a></p> + </td> + </tr> + </table> + <hr> + + <h1><a name="CH-PACKINGWIDGETS" id= + "CH-PACKINGWIDGETS"></a>Packing Widgets</h1> + + <p>When creating an application, you'll want to put more than one + widget inside a window. Our first <i>helloworld</i> example only + used one widget so we could simply use a <i>set</i> (of the + <i>containerChild</i> attribute) or a <i>containerAdd</i> to + "pack" the widget into the window. But when you want to put more + than one widget into a window, how do you control where that + widget is positioned? This is where packing comes in.</p> + + <h1><a name="SEC-THEORYOFPACKINGBOXES" id= + "SEC-THEORYOFPACKINGBOXES"></a>Theory of Packing Boxes</h1> + + <p>Most packing is done by creating boxes. These are invisible + widget containers that we can pack our widgets into which come in + two forms, a horizontal box, and a vertical box. When packing + widgets into a horizontal box, the objects are inserted + horizontally from left to right or right to left depending on the + call used. In a vertical box, widgets are packed from top to + bottom or vice versa. You may use any combination of boxes inside + or beside other boxes to create the desired effect.</p> + + <p>To create a new horizontal box, we use <i>hBoxNew</i>, and for + vertical boxes, <i>vBoxNew</i>. Both take a Bool and an Int + parameter. The first will give all children equal space + allotments if set True and the second sets the number of pixels + to place by default between the children.</p> + + <p>The <i>boxPackStart</i> and <i>boxPackEnd</i> functions are + used to place objects inside of these containers. The + <i>boxPackStart</i> function will start at the top and work its + way down in a vbox, and pack left to right in an hbox. + <i>boxPackEnd</i> will do the opposite, packing from bottom to + top in a vbox, and right to left in an hbox. Using these + functions allows us to right justify or left justify our widgets + and may be mixed in any way to achieve the desired effect. We + will use <i>boxPackStart</i> in most of our examples. An object + may be another container or a widget. In fact, many widgets are + actually containers themselves, including the button, but we + usually only use a label inside a button.</p> + + <p><img src="Images/GtkChap4.png" name="graphics1" alt="GtkChap4" + align="bottom" width="210" height="229" border="0" id= + "graphics1"></p> + + <table summary="Haskell code" width="100%" border="0" + cellpadding="2" cellspacing="0" bgcolor="#E0E0E0"> + <col width="256*"> + + <tr> + <td width="100%"> + <pre> +import Graphics.UI.Gtk + +main :: IO () +main = do + initGUI + window <- windowNew + hbox <- hBoxNew True 10 + button1 <- buttonNewWithLabel "Button 1" + button2 <- buttonNewWithLabel "Button 2" + set window [windowDefaultWidth := 200, windowDefaultHeight := 200, + containerBorderWidth := 10, containerChild := hbox ] + boxPackStart hbox button1 PackGrow 0 + boxPackStart hbox button2 PackGrow 0 + widgetShowAll window + onDestroy window mainQuit + mainGUI +</pre> + </td> + </tr> + </table> + + <p><br> + <br></p> + + <p>By using these calls, GTK knows where you want to place your + widgets so it can do automatic resizing and other nifty things. + The <i>Packing</i> parameter specifies the way the widgets in the + container behave when the window is resized. <i>PackNatural</i> + means the widgets will retain their size and stay where they are, + <i>PackGrow</i> <span style="font-style: normal">means they will + be resized, and using</span> <i>PackRepel</i> t<span style= + "font-style: normal">he widgets will be padded equally on both + sides. The last parameter is an Int, which specifies any extra + padding to be put between this child and its + neighbours.</span></p> + + <p style="font-style: normal">Note that the packing only applies + to the dimension of the box. If, for example, you specify + <i>PackNatural</i> instead of <i>Packgrow</i> in the above, + resizing horizontally will keep the buttons at their original + size, but resizing vertically will also resize the buttons. This + is because the buttons are placed homogoneously in the horizontal + box (first parameter <i>True</i>) and the box itself will resize + with the window. The next example will make the effects more + clear.</p> + <hr> + + <table summary="links to other pages" width="100%" border="0" + cellpadding="0" cellspacing="0"> + <tr valign="top"> + <td width="33%"> + <p align="left"><a href="chap3.html"><<< + Previous</a></p> + </td> + + <td width="34%"> + <p align="center"><a href="chap1.html">Home</a></p> + </td> + + <td width="33%"> + <p align="right"><a href="chap5a.html">Next + >>></a></p> + </td> + </tr> + + <tr valign="top"> + <td width="33%"> + <p align="left">Getting Started</p> + </td> + + <td width="34%"> + <p align="center"> </p> + </td> + + <td width="33%"> + <p align="right">Packing Demonstration Program</p> + </td> + </tr> + </table> + + <p><br> + <br></p> +</body> +</html> addfile ./docs/tutorial/Tutorial_Port/chap5a.html hunk ./docs/tutorial/Tutorial_Port/chap5a.html 1 +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> + +<html> +<head> + <meta name="generator" content= + "HTML Tidy for Linux/x86 (vers 11 February 2007), see www.w3.org"> + <meta http-equiv="CONTENT-TYPE" content= + "text/html; charset=us-ascii"> + + <title>Packing Demonstration Program</title> +</head> + +<body lang="en-US" text="#000000" link="#0000FF" vlink="#840084" +bgcolor="#FFFFFF" dir="ltr"> + <table summary="links to other pages" width="100%" border="0" + cellpadding="0" cellspacing="0" style= + "page-break-before: always"> + <tr> + <th colspan="3"> + <p align="center">Gtk2HsTutorial</p> + </th> + </tr> + + <tr valign="bottom"> + <td width="10%"> + <p align="left"><a href= + "chap4.html"><<<Previous</a></p> + </td> + + <td width="80%"> + <p align="center">Packing Demonstration</p> + </td> + + <td width="10%"> + <p align="right"><a href="chap5b.html">Next + >>></a></p> + </td> + </tr> + </table> + <hr> + + <h1><a name="SEC-PACKINGDEMONSTRATIONPROGRAM" id= + "SEC-PACKINGDEMONSTRATIONPROGRAM"></a>Packing Demonstration + Program</h1> + + <p>The base of all widgets here is a vertical box, which itself + is a child of the window. The child widgets are not displayed + homogeneously and there is no additional spacing (other than the + standard spacing). There are 6 horizontal boxes in the vertical + box, as defined by the function makeBox, which has the type as + shown. Furthermore, there are 2 labels in the vertical box as + well as 2 horizontal separators. The last widget is the quit + button, whose <i>onClicked</i> signal is attached to the + <i>mainQuit</i> function.</p> + + <p>The separators are created with <i>hSeparatorNew</i> and they + are spaced by <i>boxPackStart</i> with a padding of 10 pixels. + The labels are created by <i>labelNew</i> which takes a <i>Maybe + String</i> and their positioning is set by + <i>miscSetAlignment</i> to be left and top justified.</p> + + <p><br></p> + + <p><img src="Images/GtkChap5a1.png" name="graphics1" alt= + "GtkChap5a" align="bottom" width="505" height="328" border="0" + id="graphics1"></p> + + <p>The function <i>makeBox :: Bool -> Int -> Packing -> + Int -> IO HBox</i> demonstrates how Gtk2Hs widgets fit into + the Haskell type system. <i>Packing</i> is just a type like + <i>Int</i> and <i>Bool</i> and <i>IO HBox is just like IO + String</i> in the usual IO. The function creates 5 buttons, + labels them with the appropriate text and packs them into a + horizontal box. The function is then used in the main program to + create the desired ways of packing.</p><br> + + <table summary="Haskell code" width="100%" border="0" + cellpadding="2" cellspacing="2" bgcolor="#E0E0E0"> + <tr> + <td> + <pre> +import Graphics.UI.Gtk + +main :: IO () +main = do + initGUI + window <- windowNew + vbox <- vBoxNew False 0 + set window [containerBorderWidth := 10, [_$_] + windowTitle := "Packing Demonstration", + containerChild := vbox ] + label1 <- labelNew (Just "hBoxNew False 0") + miscSetAlignment label1 0 0 + boxPackStart vbox label1 PackNatural 0 + box1 <- makeBox False 0 PackNatural 0 + boxPackStart vbox box1 PackNatural 0 + box2 <- makeBox False 0 PackRepel 0 + boxPackStart vbox box2 PackNatural 0 [_$_] + box3 <- makeBox False 0 PackGrow 0 + boxPackStart vbox box3 PackNatural 0 + sep1 <- hSeparatorNew + boxPackStart vbox sep1 PackNatural 10 [_$_] + label2 <- labelNew (Just "hBoxNew True 0") + miscSetAlignment label2 0 0 + boxPackStart vbox label2 PackNatural 0 + box4 <- makeBox True 0 PackNatural 0 + boxPackStart vbox box4 PackNatural 0 + box5 <- makeBox True 0 PackRepel 0 + boxPackStart vbox box5 PackNatural 0 [_$_] + box6 <- makeBox False 0 PackGrow 0 + boxPackStart vbox box6 PackNatural 0 + sep <- hSeparatorNew + boxPackStart vbox sep PackNatural 10 [_$_] + quitbox <- hBoxNew False 0 + boxPackStart vbox quitbox PackNatural 0 + quitbutton <- buttonNewWithLabel "Quit" + boxPackStart quitbox quitbutton PackRepel 0 + onClicked quitbutton mainQuit [_$_] + onDestroy window mainQuit [_$_] + widgetShowAll window + mainGUI + + +makeBox :: Bool -> Int -> Packing -> Int -> IO HBox +makeBox homogeneous spacing packing padding = do + box <- hBoxNew homogeneous spacing + button1 <- buttonNewWithLabel "boxPackStart" + boxPackStart box button1 packing padding + button2 <- buttonNewWithLabel "box" + boxPackStart box button2 packing padding + button3 <- buttonNewWithLabel "button" + boxPackStart box button3 packing padding + button4 <- case packing of [_$_] + PackNatural -> buttonNewWithLabel "PackNatural" + PackRepel -> buttonNewWithLabel "PackRepel" + PackGrow -> buttonNewWithLabel "PackGrow" + boxPackStart box button4 packing padding [_$_] + button5 <- buttonNewWithLabel (show padding) + boxPackStart box button5 packing padding [_$_] + return box +</pre> + </td> + </tr> + </table> + + <p>The image below shows the effects of resizing the window + horizontally. In the first group, with homogeneous <i>False</i> + horizontal resizing leaves the first row of buttons as it is, + spaces the second row evenly, and enlarges the buttons in the + third row. In the second group the buttons are set to be packed + homogeneously, and the first 2 rows will look the same. Resizing + the window vertically just add extra space at the end, because + the vertical box was initialized with <i>False</i>.</p><img src= + "Images/GtkChap5a2.png" name="graphics2" alt="GtkChap5a resized" + align="bottom" id="graphics2"><br> + <hr> + + <table summary="links to other pages" width="100%" border="0" + cellpadding="0" cellspacing="0"> + <tr valign="top"> + <td width="33%"> + <p align="left"><a href="chap4.html"><<< + Previous</a></p> + </td> + + <td width="34%"> + <p align="center"><a href="chap1.html">Home</a></p> + </td> + + <td width="33%"> + <p align="right"><a href="chap5b.html">Next + >>></a></p> + </td> + </tr> + + <tr valign="top"> + <td width="50%"> + <p align="left">Packing Widgets</p> + </td> + + <td width="50%"> + <p align="right">Packing Using Tables</p> + </td> + </tr> + </table> + + <p><br> + <br></p> +</body> +</html> addfile ./docs/tutorial/Tutorial_Port/chap5b.html hunk ./docs/tutorial/Tutorial_Port/chap5b.html 1 +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> + +<html> +<head> + <meta name="generator" content= + "HTML Tidy for Linux/x86 (vers 11 February 2007), see www.w3.org"> + <meta http-equiv="CONTENT-TYPE" content= + "text/html; charset=us-ascii"> + + <title>Packing Using Tables</title> +</head> + +<body lang="en-US" text="#000000" link="#0000FF" vlink="#840084" +bgcolor="#FFFFFF" dir="ltr"> + <table summary="links to other pages" width="100%" border="0" + cellpadding="0" cellspacing="0"> + <tr> + <th colspan="3"> + <p align="center">Gtk2Hs Tutorial</p> + </th> + </tr> + + <tr valign="bottom"> + <td width="10%"> + <p align="left"><a href="chap5a.html"><<< + Previous</a></p> + </td> + + <td width="80%"> + <p align="center">Tables</p> + </td> + + <td width="10%"> + <p align="right"><a href="chap6.html">Next + >>></a></p> + </td> + </tr> + </table> + <hr> + + <h2><a name="SEC-PACKINGUSINGTABLES" id= + "SEC-PACKINGUSINGTABLES"></a>Packing Using Tables</h2> + + <p>Let's take a look at another way of packing - Tables. These + can be extremely useful in certain situations.</p> + + <p>Using tables, we create a grid that we can place widgets in. + The widgets may take up as many spaces as we specify.</p> + + <p>The first thing to look at, of course, is the <i>tableNew</i> + function:</p> + + <table summary="Haskell code" width="100%" border="0" + cellpadding="2" cellspacing="2" bgcolor="#E0E0E0"> + <tr> + <td> + <pre> +tableNew :: Int -> Int -> Bool -> IO Table +</pre> + </td> + </tr> + </table> + + <p>The first argument is the number of rows to make in the table, + while the second, obviously, is the number of columns.</p> + + <p>The boolean argument (homogeneous) has to do with how the + table's boxes are sized. If homogeneous is TRUE, the table boxes + are resized to the size of the largest widget in the table. If + homogeneous is FALSE, the size of a table boxes is dictated by + the tallest widget in its same row, and the widest widget in its + column.</p> + + <p>The rows and columns are laid out from 0 to n, where n was the + number specified in the call to <i>tableNew</i>. So, if you + specify rows = 2 and columns = 2, the layout would look something + like this:</p> + + <table summary="Haskell code" width="100%" border="0" + cellpadding="2" cellspacing="2" bgcolor="#E0E0E0"> + <tr> + <td> + <pre> + 0 1 2 +0+----------+----------+ + | | | +1+----------+----------+ + | | | +2+----------+----------+ +</pre> + </td> + </tr> + </table> + + <p>Note that the coordinate system starts in the upper left hand + corner. To place a widget into a box, use the following + function:</p> + + <table summary="Haskell code" width="100%" border="0" + cellpadding="2" cellspacing="2" bgcolor="#E0E0E0"> + <tr> + <td> + <pre> +tableAttach :: (TableClass self, WidgetClass child) => [_$_] + self -- self - the table + -> child -- child - The widget to add. + -> Int [_$_] +-- leftAttach - the column number to attach the left side of a child widget to. + -> Int [_$_] +-- rightAttach - the column number to attach the right side of a child widget to. + -> Int -- topAttach - the row number to attach the top of a child widget to. + -> Int -- bottomAttach - the row number to attach the bottom of a child widget to. + -> [AttachOptions] [_$_] +-- xoptions - Used to specify the properties of the child widget when the table is resized. + -> [AttachOptions] [_$_] +-- yoptions - The same as xoptions, except this field determines behaviour of vertical resizing. + -> Int [_$_] +-- xpadding - An integer value specifying the padding on the left and right of the widget being added to the table. + -> Int -- ypadding - The amount of padding above and below the child widget. + -> IO () +</pre> + </td> + </tr> + </table> + + <p>The first argument (self) is the table you've created and the + second (child) the widget you wish to place in the table.</p> + + <p>The left and right attach arguments specify where to place the + widget, and how many boxes to use. If you want a button in the + lower right table entry of our 2x2 table, and want it to fill + that entry <i>only</i>, left_attach would be = 1, right_attach = + 2, top_attach = 1, bottom_attach = 2.</p> + + <p>Now, if you wanted a widget to take up the whole top row of + our 2x2 table, you'd use left_attach = 0, right_attach = 2, + top_attach = 0, bottom_attach = 1.</p> + + <p>The xoptions and yoptions are used to specify packing options + and the list may contain more than one to allow multiple + options.</p> + + <p>These options are:</p> + + <dl> + <dt><tt>Fill</tt></dt> + + <dd>If the table box is larger than the widget, and + <tt>Fill</tt> is specified, the widget will expand to use all + the room available.</dd> + + <dt><tt>Shrink</tt></dt> + + <dd>If the table widget was allocated less space then was + requested (usually by the user resizing the window), then the + widgets would normally just be pushed off the bottom of the + window and disappear. If <tt>Shrink</tt> is specified, the + widgets will shrink with the table.</dd> + + <dt><tt>Expand</tt></dt> + + <dd>This will cause the table to expand to use up any remaining + space in the window.</dd> + </dl> + + <p>Padding is just like in boxes, creating a clear area around + the widget specified in pixels.</p> + + <p><i>tableAttach</i> has many options. So, there's a + shortcut:</p> + + <table summary="Haskell code" width="100%" border="0" + cellpadding="2" cellspacing="2" bgcolor="#E0E0E0"> + <tr> + <td> + <pre> +tableAttachDefaults :: (TableClass self, WidgetClass widget) => self [_$_] + -> widget -- widget - The child widget to add. + -> Int [_$_] +-- leftAttach - The column number to attach the left side of the child widget to. + -> Int [_$_] +-- rightAttach - The column number to attach the right side of the child widget to. + -> Int [_$_] +-- topAttach - The row number to attach the top of the child widget to. + -> Int [_$_] +-- bottomAttach - The row number to attach the bottom of the child widget to. + -> IO () +</pre> + </td> + </tr> + </table> + + <p>The values used for the <i>AttachOptions</i> are <tt>[Expand, + Fill]</tt>, and the padding is set to 0. The rest of the + arguments are identical to the previous function.</p> + + <p>We also have tableSetRowSpacing and tableSetColSpacing. These + place spacing at the specified row or column.</p> + + <table summary="Haskell code" width="100%" border="0" + cellpadding="2" cellspacing="2" bgcolor="#E0E0E0"> + <tr> + <td> + <pre> +tableSetRowSpacing :: TableClass self=> self-> Int -> Int -> IO () +</pre> + </td> + </tr> + </table> + + <p>and,</p> + + <table summary="Haskell code" width="100%" border="0" + cellpadding="2" cellspacing="2" bgcolor="#E0E0E0"> + <tr> + <td> + <pre> +tableSetColSpacing :: TableClass self => self -> Int -> Int -> IO () +</pre> + </td> + </tr> + </table> + + <p>The first <i>Int</i> argument is the row/column and the second + the spacing in pixels. Note that for columns, the space goes to + the right of the column, and for rows, the space goes below the + row.</p> + + <p>You can also set a consistent spacing of all rows and/or + columns with:</p> + + <table summary="Haskell code" width="100%" border="0" + cellpadding="2" cellspacing="2" bgcolor="#E0E0E0"> + <tr> + <td> + <pre> +tableSetRowSpacings :: TableClass self=> self-> Int -> IO () +</pre> + </td> + </tr> + </table> + + <p>and,</p> + + <table summary="Haskell code" width="100%" border="0" + cellpadding="2" cellspacing="2" bgcolor="#E0E0E0"> + <tr> + <td> + <pre> +tableSetColSpacings :: TableClass self => self -> Int -> IO () +</pre> + </td> + </tr> + </table> + + <p>Note that with these calls, the last row and last column do + not get any spacing.</p> + + <p><br> + <br></p> + + <h2><a name="SEC-TABLEPACKINGEXAMPLES" id= + "SEC-TABLEPACKINGEXAMPLES"></a>Table Packing Example</h2> + + <p>Here we make a window with three buttons in a 2x2 table. The + first two buttons will be placed in the upper row. A third, quit + button, is placed in the lower row, spanning both columns. Which + means it should look something like this:</p> + + <p><img src="Images/GtkChap5b.png" align="bottom" alt= + "Table Packing"></p> + + <p>Here's the source code:</p> + + <table summary="Haskell code" width="100%" border="0" + cellpadding="2" cellspacing="2" bgcolor="#E0E0E0"> + <tr> + <td> + <pre> +import Graphics.UI.Gtk + +main :: IO () +main = do + initGUI + window <- windowNew + set window [windowTitle := "Table", containerBorderWidth := 20, + windowDefaultWidth := 150, windowDefaultHeight := 100 ] + table <- tableNew 2 2 True + containerAdd window table + button1 <- buttonNewWithLabel "On" + onClicked button1 (buttonSwitch button1) + tableAttachDefaults table button1 0 1 0 1 + button2 <- buttonNewWithLabel "Off" + onClicked button2 (buttonSwitch button2) + tableAttachDefaults table button2 1 2 0 1 + button3 <- buttonNewWithLabel "Quit" + onClicked button3 mainQuit + tableAttachDefaults table button3 0 2 1 2 + onDestroy window mainQuit [_$_] + widgetShowAll window + mainGUI + +buttonSwitch :: Button -> IO () +buttonSwitch b = do + txt <- buttonGetLabel b + let newtxt = case txt of + "Off" -> "On" + "On" -> "Off" + buttonSetLabel b newtxt [_$_] +</pre> + </td> + </tr> + </table> + <hr> + + <p>The <i>buttonSwitch</i> function is attached to both buttons + in the top row. The <i>buttonGetLabel</i> function is an example + of how to get an attribute from a widget using a standard method. + There is also a more general alternative <i>get</i> (analogous to + <i>set</i>) which takes a widget and an attribute. In the above + example this should be:</p> + + <table summary="Haskell code" width="100%" border="0" + cellpadding="2" cellspacing="0" bgcolor="#E0E0E0"> + <col width="256*"> + + <tr> + <td width="100%"> + <p>txt <- get b buttonLabel</p> + </td> + </tr> + </table> + + <p>with the same result.</p> + + <table summary="links to other pages" width="100%" border="0" + cellpadding="0" cellspacing="0"> + <tr valign="top"> + <td width="33%"> + <p align="left"><a href="chap5a.html"><<< + Previous</a></p> + </td> + + <td width="34%"> + <p align="center"><a href="chap1.html">Home</a></p> + </td> + + <td width="33%"> + <p align="right"><a href="chap6.html">Next + >>></a></p> + </td> + </tr> + + <tr valign="top"> + <td width="33%"> + <p align="left">Packing Demonstration</p> + </td> + + <td width="33%"> + <p align="right">Button Widget</p> + </td> + </tr> + </table> + + <p><br> + <br></p> +</body> +</html> addfile ./docs/tutorial/Tutorial_Port/chap6.html hunk ./docs/tutorial/Tutorial_Port/chap6.html 1 +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> + +<html> +<head> + <meta name="generator" content= + "HTML Tidy for Linux/x86 (vers 11 February 2007), see www.w3.org"> + <meta http-equiv="CONTENT-TYPE" content= + "text/html; charset=us-ascii"> + + <title>The Button Widget</title> +</head> + +<body lang="en-US" text="#000000" link="#0000FF" vlink="#840084" +bgcolor... [truncated message content] |
From: Duncan C. <dun...@wo...> - 2007-08-12 15:03:48
|
Sun Aug 5 07:45:21 PDT 2007 Peter Gavin <pg...@gm...> * small makefile changes to clean up documentation files that were not being removed hunk ./Makefile.am 1891 - docs/reference/minus.gif docs/reference/haddock.js \ + docs/reference/plus.gif docs/reference/minus.gif \ + docs/reference/haddock.js \ hunk ./Makefile.am 1895 - $(foreach LETTER, A B C D E F G H I J K L M N O P Q R S T U V W X \ + $(foreach LETTER, A B C D E F G H I J K L M N O P Q R S T U V W X Y \ |
From: Duncan C. <dun...@wo...> - 2007-08-12 15:03:45
|
Sat Jul 21 19:46:18 PDT 2007 Peter Gavin <pg...@gm...> * gnomevfs: updated license to LGPLv3, made all source file headers consistent addfile ./COPYING.GPLv3 hunk ./COPYING.GPLv3 1 + GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/> + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU General Public License is a free, copyleft license for +software and other kinds of works. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. + + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Use with the GNU Affero General Public License. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + <one line to give the program's name and a brief idea of what it does.> + Copyright (C) <year> <name of author> + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. + +Also add information on how to contact you by electronic and paper mail. + + If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: + + <program> Copyright (C) <year> <name of author> + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, your program's commands +might be different; for a GUI interface, you would use an "about box". + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU GPL, see +<http://www.gnu.org/licenses/>. + + The GNU General Public License does not permit incorporating your program +into proprietary programs. If your program is a subroutine library, you +may consider it more useful to permit linking proprietary applications with +the library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. But first, please read +<http://www.gnu.org/philosophy/why-not-lgpl.html>. addfile ./COPYING.LGPLv3 hunk ./COPYING.LGPLv3 1 + GNU LESSER GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/> + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + + This version of the GNU Lesser General Public License incorporates +the terms and conditions of version 3 of the GNU General Public +License, supplemented by the additional permissions listed below. + + 0. Additional Definitions. [_$_] + + As used herein, "this License" refers to version 3 of the GNU Lesser +General Public License, and the "GNU GPL" refers to version 3 of the GNU +General Public License. + + "The Library" refers to a covered work governed by this License, +other than an Application or a Combined Work as defined below. + + An "Application" is any work that makes use of an interface provided +by the Library, but which is not otherwise based on the Library. +Defining a subclass of a class defined by the Library is deemed a mode +of using an interface provided by the Library. + + A "Combined Work" is a work produced by combining or linking an +Application with the Library. The particular version of the Library +with which the Combined Work was made is also called the "Linked +Version". + + The "Minimal Corresponding Source" for a Combined Work means the +Corresponding Source for the Combined Work, excluding any source code +for portions of the Combined Work that, considered in isolation, are +based on the Application, and not on the Linked Version. + + The "Corresponding Application Code" for a Combined Work means the +object code and/or source code for the Application, including any data +and utility programs needed for reproducing the Combined Work from the +Application, but excluding the System Libraries of the Combined Work. + + 1. Exception to Section 3 of the GNU GPL. + + You may convey a covered work under sections 3 and 4 of this License +without being bound by section 3 of the GNU GPL. + + 2. Conveying Modified Versions. + + If you modify a copy of the Library, and, in your modifications, a +facility refers to a function or data to be supplied by an Application +that uses the facility (other than as an argument passed when the +facility is invoked), then you may convey a copy of the modified +version: + + a) under this License, provided that you make a good faith effort to + ensure that, in the event an Application does not supply the + function or data, the facility still operates, and performs + whatever part of its purpose remains meaningful, or + + b) under the GNU GPL, with none of the additional permissions of + this License applicable to that copy. + + 3. Object Code Incorporating Material from Library Header Files. + + The object code form of an Application may incorporate material from +a header file that is part of the Library. You may convey such object +code under terms of your choice, provided that, if the incorporated +material is not limited to numerical parameters, data structure +layouts and accessors, or small macros, inline functions and templates +(ten or fewer lines in length), you do both of the following: + + a) Give prominent notice with each copy of the object code that the + Library is used in it and that the Library and its use are + covered by this License. + + b) Accompany the object code with a copy of the GNU GPL and this license + document. + + 4. Combined Works. + + You may convey a Combined Work under terms of your choice that, +taken together, effectively do not restrict modification of the +portions of the Library contained in the Combined Work and reverse +engineering for debugging such modifications, if you also do each of +the following: + + a) Give prominent notice with each copy of the Combined Work that + the Library is used in it and that the Library and its use are + covered by this License. + + b) Accompany the Combined Work with a copy of the GNU GPL and this license + document. + + c) For a Combined Work that displays copyright notices during + execution, include the copyright notice for the Library among + these notices, as well as a reference directing the user to the + copies of the GNU GPL and this license document. + + d) Do one of the following: + + 0) Convey the Minimal Corresponding Source under the terms of this + License, and the Corresponding Application Code in a form + suitable for, and under terms that permit, the user to + recombine or relink the Application with a modified version of + the Linked Version to produce a modified Combined Work, in the + manner specified by section 6 of the GNU GPL for conveying + Corresponding Source. + + 1) Use a suitable shared library mechanism for linking with the + Library. A suitable mechanism is one that (a) uses at run time + a copy of the Library already present on the user's computer + system, and (b) will operate properly with a modified version + of the Library that is interface-compatible with the Linked + Version. [_$_] + + e) Provide Installation Information, but only if you would otherwise + be required to provide such information under section 6 of the + GNU GPL, and only to the extent that such information is + necessary to install and execute a modified version of the + Combined Work produced by recombining or relinking the + Application with a modified version of the Linked Version. (If + you use option 4d0, the Installation Information must accompany + the Minimal Corresponding Source and Corresponding Application + Code. If you use option 4d1, you must provide the Installation + Information in the manner specified by section 6 of the GNU GPL + for conveying Corresponding Source.) + + 5. Combined Libraries. + + You may place library facilities that are a work based on the +Library side by side in a single library together with other library +facilities that are not Applications and are not covered by this +License, and convey such a combined library under terms of your +choice, if you do both of the following: + + a) Accompany the combined library with a copy of the same work based + on the Library, uncombined with any other library facilities, + conveyed under the terms of this License. + + b) Give prominent notice with the combined library that part of it + is a work based on the Library, and explaining where to find the + accompanying uncombined form of the same work. + + 6. Revised Versions of the GNU Lesser General Public License. + + The Free Software Foundation may publish revised and/or new versions +of the GNU Lesser General Public License from time to time. Such new +versions will be similar in spirit to the present version, but may +differ in detail to address new problems or concerns. + + Each version is given a distinguishing version number. If the +Library as you received it specifies that a certain numbered version +of the GNU Lesser General Public License "or any later version" +applies to it, you have the option of following the terms and +conditions either of that published version or of any later version +published by the Free Software Foundation. If the Library as you +received it does not specify a version number of the GNU Lesser +General Public License, you may choose any version of the GNU Lesser +General Public License ever published by the Free Software Foundation. + + If the Library as you received it specifies that a proxy can decide +whether future versions of the GNU Lesser General Public License shall +apply, that proxy's public statement of acceptance of any version is +permanent authorization for you to choose that version for the +Library. hunk ./gnomevfs/System/Gnome/VFS.hs 1 --- GIMP Toolkit (GTK) Binding for Haskell: binding to libgnomevfs -*-haskell-*- +-- GIMP Toolkit (GTK) Binding for Haskell: binding to libgnomevfs -*-haskell-*- hunk ./gnomevfs/System/Gnome/VFS.hs 8 --- This library is free software; you can redistribute it and/or --- modify it under the terms of the GNU Library General Public --- License as published by the Free Software Foundation; either --- version 2 of the License, or (at your option) any later version. --- +-- This library is free software: you can redistribute it and/or +-- modify it under the terms of the GNU Lesser General Public License +-- as published by the Free Software Foundation, either version 3 of +-- the License, or (at your option) any later version. +-- [_$_] hunk ./gnomevfs/System/Gnome/VFS.hs 16 --- Library General Public License for more details. --- +-- Lesser General Public License for more details. +-- [_$_] +-- You should have received a copy of the GNU Lesser General Public +-- License along with this program. If not, see +-- <http://www.gnu.org/licenses/>. +-- [_$_] +-- GnomeVFS, the C library which this Haskell library depends on, is +-- available under LGPL Version 2. The documentation included with +-- this library is based on the original GnomeVFS documentation, +-- Copyright (c) 2001 Seth Nickell <sni...@st...>. The +-- documentation is covered by the GNU Free Documentation License, +-- version 1.2. +-- [_$_] hunk ./gnomevfs/System/Gnome/VFS/Cancellation.chs 1 --- GIMP Toolkit (GTK) Binding for Haskell: binding to libgnomevfs -*-haskell-*- +-- GIMP Toolkit (GTK) Binding for Haskell: binding to libgnomevfs -*-haskell-*- hunk ./gnomevfs/System/Gnome/VFS/Cancellation.chs 8 --- This library is free software; you can redistribute it and/or --- modify it under the terms of the GNU Library General Public --- License as published by the Free Software Foundation; either --- version 2 of the License, or (at your option) any later version. --- +-- This library is free software: you can redistribute it and/or +-- modify it under the terms of the GNU Lesser General Public License +-- as published by the Free Software Foundation, either version 3 of +-- the License, or (at your option) any later version. +-- [_$_] hunk ./gnomevfs/System/Gnome/VFS/Cancellation.chs 16 --- Library General Public License for more details. --- +-- Lesser General Public License for more details. +-- [_$_] +-- You should have received a copy of the GNU Lesser General Public +-- License along with this program. If not, see +-- <http://www.gnu.org/licenses/>. +-- [_$_] +-- GnomeVFS, the C library which this Haskell library depends on, is +-- available under LGPL Version 2. The documentation included with +-- this library is based on the original GnomeVFS documentation, +-- Copyright (c) 2001 Seth Nickell <sni...@st...>. The +-- documentation is covered by the GNU Free Documentation License, +-- version 1.2. +-- [_$_] hunk ./gnomevfs/System/Gnome/VFS/Directory.chs 1 --- GIMP Toolkit (GTK) Binding for Haskell: binding to libgnomevfs -*-haskell-*- +-- GIMP Toolkit (GTK) Binding for Haskell: binding to libgnomevfs -*-haskell-*- hunk ./gnomevfs/System/Gnome/VFS/Directory.chs 8 --- This library is free software; you can redistribute it and/or --- modify it under the terms of the GNU Library General Public --- License as published by the Free Software Foundation; either --- version 2 of the License, or (at your option) any later version. --- +-- This library is free software: you can redistribute it and/or +-- modify it under the terms of the GNU Lesser General Public License +-- as published by the Free Software Foundation, either version 3 of +-- the License, or (at your option) any later version. +-- [_$_] hunk ./gnomevfs/System/Gnome/VFS/Directory.chs 16 --- Library General Public License for more details. --- +-- Lesser General Public License for more details. +-- [_$_] +-- You should have received a copy of the GNU Lesser General Public +-- License along with this program. If not, see +-- <http://www.gnu.org/licenses/>. +-- [_$_] +-- GnomeVFS, the C library which this Haskell library depends on, is +-- available under LGPL Version 2. The documentation included with +-- this library is based on the original GnomeVFS documentation, +-- Copyright (c) 2001 Seth Nickell <sni...@st...>. The +-- documentation is covered by the GNU Free Documentation License, +-- version 1.2. +-- [_$_] hunk ./gnomevfs/System/Gnome/VFS/Drive.chs 1 --- GIMP Toolkit (GTK) Binding for Haskell: binding to libgnomevfs -*-haskell-*- +-- GIMP Toolkit (GTK) Binding for Haskell: binding to libgnomevfs -*-haskell-*- hunk ./gnomevfs/System/Gnome/VFS/Drive.chs 8 --- This library is free software; you can redistribute it and/or --- modify it under the terms of the GNU Library General Public --- License as published by the Free Software Foundation; either --- version 2 of the License, or (at your option) any later version. --- +-- This library is free software: you can redistribute it and/or +-- modify it under the terms of the GNU Lesser General Public License +-- as published by the Free Software Foundation, either version 3 of +-- the License, or (at your option) any later version. +-- [_$_] hunk ./gnomevfs/System/Gnome/VFS/Drive.chs 16 --- Library General Public License for more details. --- +-- Lesser General Public License for more details. +-- [_$_] +-- You should have received a copy of the GNU Lesser General Public +-- License along with this program. If not, see +-- <http://www.gnu.org/licenses/>. +-- [_$_] +-- GnomeVFS, the C library which this Haskell library depends on, is +-- available under LGPL Version 2. The documentation included with +-- this library is based on the original GnomeVFS documentation, +-- Copyright (c) 2001 Seth Nickell <sni...@st...>. The +-- documentation is covered by the GNU Free Documentation License, +-- version 1.2. +-- [_$_] hunk ./gnomevfs/System/Gnome/VFS/Error.hs 1 --- GIMP Toolkit (GTK) Binding for Haskell: binding to libgnomevfs -*-haskell-*- +-- GIMP Toolkit (GTK) Binding for Haskell: binding to libgnomevfs -*-haskell-*- hunk ./gnomevfs/System/Gnome/VFS/Error.hs 8 --- This library is free software; you can redistribute it and/or --- modify it under the terms of the GNU Library General Public --- License as published by the Free Software Foundation; either --- version 2 of the License, or (at your option) any later version. --- +-- This library is free software: you can redistribute it and/or +-- modify it under the terms of the GNU Lesser General Public License +-- as published by the Free Software Foundation, either version 3 of +-- the License, or (at your option) any later version. +-- [_$_] hunk ./gnomevfs/System/Gnome/VFS/Error.hs 16 --- Library General Public License for more details. --- +-- Lesser General Public License for more details. +-- [_$_] +-- You should have received a copy of the GNU Lesser General Public +-- License along with this program. If not, see +-- <http://www.gnu.org/licenses/>. +-- [_$_] +-- GnomeVFS, the C library which this Haskell library depends on, is +-- available under LGPL Version 2. The documentation included with +-- this library is based on the original GnomeVFS documentation, +-- Copyright (c) 2001 Seth Nickell <sni...@st...>. The +-- documentation is covered by the GNU Free Documentation License, +-- version 1.2. +-- [_$_] hunk ./gnomevfs/System/Gnome/VFS/FileInfo.chs 1 --- GIMP Toolkit (GTK) Binding for Haskell: binding to libgnomevfs -*-haskell-*- +-- GIMP Toolkit (GTK) Binding for Haskell: binding to libgnomevfs -*-haskell-*- hunk ./gnomevfs/System/Gnome/VFS/FileInfo.chs 8 --- This library is free software; you can redistribute it and/or --- modify it under the terms of the GNU Library General Public --- License as published by the Free Software Foundation; either --- version 2 of the License, or (at your option) any later version. --- +-- This library is free software: you can redistribute it and/or +-- modify it under the terms of the GNU Lesser General Public License +-- as published by the Free Software Foundation, either version 3 of +-- the License, or (at your option) any later version. +-- [_$_] hunk ./gnomevfs/System/Gnome/VFS/FileInfo.chs 16 --- Library General Public License for more details. --- +-- Lesser General Public License for more details. +-- [_$_] +-- You should have received a copy of the GNU Lesser General Public +-- License along with this program. If not, see +-- <http://www.gnu.org/licenses/>. +-- [_$_] +-- GnomeVFS, the C library which this Haskell library depends on, is +-- available under LGPL Version 2. The documentation included with +-- this library is based on the original GnomeVFS documentation, +-- Copyright (c) 2001 Seth Nickell <sni...@st...>. The +-- documentation is covered by the GNU Free Documentation License, +-- version 1.2. +-- [_$_] hunk ./gnomevfs/System/Gnome/VFS/Init.chs 1 --- GIMP Toolkit (GTK) Binding for Haskell: binding to libgnomevfs -*-haskell-*- +-- GIMP Toolkit (GTK) Binding for Haskell: binding to libgnomevfs -*-haskell-*- hunk ./gnomevfs/System/Gnome/VFS/Init.chs 8 --- This library is free software; you can redistribute it and/or --- modify it under the terms of the GNU Library General Public --- License as published by the Free Software Foundation; either --- version 2 of the License, or (at your option) any later version. --- +-- This library is free software: you can redistribute it and/or +-- modify it under the terms of the GNU Lesser General Public License +-- as published by the Free Software Foundation, either version 3 of +-- the License, or (at your option) any later version. +-- [_$_] hunk ./gnomevfs/System/Gnome/VFS/Init.chs 16 --- Library General Public License for more details. --- +-- Lesser General Public License for more details. +-- [_$_] +-- You should have received a copy of the GNU Lesser General Public +-- License along with this program. If not, see +-- <http://www.gnu.org/licenses/>. +-- [_$_] +-- GnomeVFS, the C library which this Haskell library depends on, is +-- available under LGPL Version 2. The documentation included with +-- this library is based on the original GnomeVFS documentation, +-- Copyright (c) 2001 Seth Nickell <sni...@st...>. The +-- documentation is covered by the GNU Free Documentation License, +-- version 1.2. +-- [_$_] hunk ./gnomevfs/System/Gnome/VFS/MIME.chs 1 --- GIMP Toolkit (GTK) Binding for Haskell: binding to libgnomevfs -*-haskell-*- +-- GIMP Toolkit (GTK) Binding for Haskell: binding to libgnomevfs -*-haskell-*- hunk ./gnomevfs/System/Gnome/VFS/MIME.chs 8 --- This library is free software; you can redistribute it and/or --- modify it under the terms of the GNU Library General Public --- License as published by the Free Software Foundation; either --- version 2 of the License, or (at your option) any later version. --- +-- This library is free software: you can redistribute it and/or +-- modify it under the terms of the GNU Lesser General Public License +-- as published by the Free Software Foundation, either version 3 of +-- the License, or (at your option) any later version. +-- [_$_] hunk ./gnomevfs/System/Gnome/VFS/MIME.chs 16 --- Library General Public License for more details. --- +-- Lesser General Public License for more details. +-- [_$_] +-- You should have received a copy of the GNU Lesser General Public +-- License along with this program. If not, see +-- <http://www.gnu.org/licenses/>. +-- [_$_] +-- GnomeVFS, the C library which this Haskell library depends on, is +-- available under LGPL Version 2. The documentation included with +-- this library is based on the original GnomeVFS documentation, +-- Copyright (c) 2001 Seth Nickell <sni...@st...>. The +-- documentation is covered by the GNU Free Documentation License, +-- version 1.2. +-- [_$_] hunk ./gnomevfs/System/Gnome/VFS/Marshal.chs 1 --- GIMP Toolkit (GTK) Binding for Haskell: binding to libgnomevfs -*-haskell-*- +-- GIMP Toolkit (GTK) Binding for Haskell: binding to libgnomevfs -*-haskell-*- hunk ./gnomevfs/System/Gnome/VFS/Marshal.chs 8 --- This library is free software; you can redistribute it and/or --- modify it under the terms of the GNU Librar... [truncated message content] |
From: Duncan C. <dun...@wo...> - 2007-08-12 15:03:44
|
Sat Jul 21 14:20:09 PDT 2007 Peter Gavin <pg...@gm...> * glib: add support for 64-bit int object properties hunk ./glib/System/Glib/GValueTypes.chs 34 + valueSetUInt64, + valueGetUInt64, + valueSetInt64, + valueGetInt64, hunk ./glib/System/Glib/GValueTypes.chs 93 +valueSetUInt64 :: GValue -> Word64 -> IO () +valueSetUInt64 gvalue value = + {# call unsafe value_set_uint64 #} gvalue (fromIntegral value) + +valueGetUInt64 :: GValue -> IO Word64 +valueGetUInt64 gvalue = + liftM fromIntegral $ + {# call unsafe value_get_uint64 #} gvalue + +valueSetInt64 :: GValue -> Int64 -> IO () +valueSetInt64 gvalue value = + {# call unsafe value_set_int64 #} gvalue (fromIntegral value) + +valueGetInt64 :: GValue -> IO Int64 +valueGetInt64 gvalue = + liftM fromIntegral $ + {# call unsafe value_get_int64 #} gvalue + hunk ./glib/System/Glib/Properties.chs 33 + objectSetPropertyInt64, + objectGetPropertyInt64, + objectSetPropertyUInt64, + objectGetPropertyUInt64, hunk ./glib/System/Glib/Properties.chs 138 +objectSetPropertyInt64 :: GObjectClass gobj => String -> gobj -> Int64 -> IO () +objectSetPropertyInt64 = objectSetPropertyInternal GType.int valueSetInt64 + +objectGetPropertyInt64 :: GObjectClass gobj => String -> gobj -> IO Int64 +objectGetPropertyInt64 = objectGetPropertyInternal GType.int valueGetInt64 + +objectSetPropertyUInt64 :: GObjectClass gobj => String -> gobj -> Word64 -> IO () +objectSetPropertyUInt64 = objectSetPropertyInternal GType.uint (\gv v -> valueSetUInt64 gv (fromIntegral v)) + +objectGetPropertyUInt64 :: GObjectClass gobj => String -> gobj -> IO Word64 +objectGetPropertyUInt64 = objectGetPropertyInternal GType.uint (\gv -> liftM fromIntegral $ valueGetUInt64 gv) + |
From: Duncan C. <dun...@wo...> - 2007-08-12 15:03:44
|
Wed Jul 18 22:57:02 PDT 2007 Peter Gavin <pg...@gm...> * glib: export contructors for Source datatype in MainLoop.chs hunk ./glib/System/Glib/MainLoop.chs.pp 52 - Source, + Source(..), |
From: Duncan C. <dun...@wo...> - 2007-08-08 17:18:22
|
Wed Aug 8 10:16:54 PDT 2007 Duncan Coutts <du...@ha...> * Import CUInt in the Types.chs modules as GType seems to be CUInt now Reported in Fedora 8 that c2hs reports GType as CUInt whereas it previously was CULong, so we now import both in the Hierarchy.chs.template. hunk ./tools/hierarchyGen/Hierarchy.chs.template 33 -import Foreign.C.Types (CULong) +import Foreign.C.Types (CULong, CUInt) |
From: Duncan C. <dun...@wo...> - 2007-08-08 17:18:21
|
Wed Aug 1 20:10:49 PDT 2007 Duncan Coutts <du...@ha...> * Fix doc typo, "the the" hunk ./gtk/Graphics/UI/Gtk/Gdk/Events.hsc 224 - -- | The coordinates of the click relative the the screen origin. + -- | The coordinates of the click relative to the screen origin. |