Skip to content

Commit

Permalink
poppler version up to 0.14 (to match gtk2hs.) remove PopplerOrientati…
Browse files Browse the repository at this point in the history
…on to be

compatible with poppler C lib version > 0.39. Resolved the issue #17.
  • Loading branch information
wavewave committed Apr 5, 2016
1 parent 357910b commit 146610b
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 15 deletions.
2 changes: 0 additions & 2 deletions Graphics/UI/Gtk/Poppler/Enums.chs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
module Graphics.UI.Gtk.Poppler.Enums (
-- * Enums
Error(..),
Orientation(..),
SelectionStyle(..),
PageTransitionType(..),
PageTransitionAlignment(..),
Expand Down Expand Up @@ -60,7 +59,6 @@ import System.Glib.UTFString
{# context lib="poppler" prefix="poppler" #}

{# enum PopplerError as Error {underscoreToCase} with prefix = "Poppler" deriving (Eq, Ord, Bounded, Show, Typeable) #}
{# enum PopplerOrientation as Orientation {underscoreToCase} with prefix = "Poppler" deriving (Eq, Ord, Bounded, Show, Typeable) #}
{# enum PopplerSelectionStyle as SelectionStyle {underscoreToCase} with prefix = "Poppler" deriving (Eq, Ord, Bounded, Show, Typeable) #}
{# enum PopplerPageTransitionType as PageTransitionType {underscoreToCase} with prefix = "Poppler" deriving (Eq, Ord, Bounded, Show, Typeable) #}
{# enum PopplerPageTransitionAlignment as PageTransitionAlignment {underscoreToCase} with prefix = "Poppler" deriving (Eq, Ord, Bounded, Show, Typeable) #}
Expand Down
17 changes: 9 additions & 8 deletions Graphics/UI/Gtk/Poppler/Structs.hsc
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ module Graphics.UI.Gtk.Poppler.Structs (
peekPopplerColor,
) where

import Control.Monad (liftM)
import Control.Monad (liftM)
import Data.IORef
import Control.Exception

Expand All @@ -51,7 +51,7 @@ import System.Glib.GObject (makeNewGObject)
-- * Specifies x, y, width and height
--
data PopplerRectangle = PopplerRectangle Double Double Double Double
deriving Show
deriving Show

instance Storable PopplerRectangle where
sizeOf _ = #{const sizeof(PopplerRectangle)}
Expand All @@ -68,10 +68,10 @@ instance Storable PopplerRectangle where

peekPopplerRectangle :: Ptr PopplerRectangle -> IO PopplerRectangle
peekPopplerRectangle ptr = do
(x1_ ::#gtk2hs_type gdouble) <- #{peek PopplerRectangle, x1} ptr
(y1_ ::#gtk2hs_type gdouble) <- #{peek PopplerRectangle, y1} ptr
(x2_ ::#gtk2hs_type gdouble) <- #{peek PopplerRectangle, x2} ptr
(y2_ ::#gtk2hs_type gdouble) <- #{peek PopplerRectangle, y2} ptr
(x1_ ::#gtk2hs_type gdouble) <- #{peek PopplerRectangle, x1} ptr
(y1_ ::#gtk2hs_type gdouble) <- #{peek PopplerRectangle, y1} ptr
(x2_ ::#gtk2hs_type gdouble) <- #{peek PopplerRectangle, x2} ptr
(y2_ ::#gtk2hs_type gdouble) <- #{peek PopplerRectangle, y2} ptr
return (PopplerRectangle (realToFrac x1_) (realToFrac y1_)
(realToFrac x2_) (realToFrac y2_))

Expand All @@ -89,7 +89,8 @@ instance Storable PopplerColor where

peekPopplerColor :: Ptr PopplerColor -> IO PopplerColor
peekPopplerColor ptr = do
red <- #{peek PopplerColor, red} ptr
red <- #{peek PopplerColor, red} ptr
green <- #{peek PopplerColor, green} ptr
blue <- #{peek PopplerColor, blue} ptr
return $ PopplerColor red green blue
return $ PopplerColor red green blue

10 changes: 5 additions & 5 deletions poppler.cabal
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Name: poppler
Version: 0.13.1
Version: 0.14
License: GPL-2
License-file: COPYING
Copyright: (c) 2001-2012, 2014 The Gtk2Hs Team
Expand Down Expand Up @@ -45,12 +45,12 @@ flag gtk3
Library
build-depends: base >= 4 && < 5, array, containers,
mtl, bytestring,
glib >= 0.13 && < 0.14,
cairo >= 0.13 && < 0.14
glib >= 0.13 && < 0.15,
cairo >= 0.13 && < 0.15
if flag(gtk3)
build-depends: gtk3 >= 0.13 && < 0.14
build-depends: gtk3 >= 0.13 && < 0.15
else
build-depends: gtk >= 0.13 && < 0.14
build-depends: gtk >= 0.13 && < 0.15
build-tools: gtk2hsC2hs, gtk2hsHookGenerator, gtk2hsTypeGen

exposed-modules:
Expand Down
1 change: 1 addition & 0 deletions template-hsc-gtk2hs.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#ifndef _TEMPLATE_HSC_GTK2HS_H_
#define _TEMPLATE_HSC_GTK2HS_H_

#include <stdio.h>
#include <glib.h>

#define hsc_gtk2hs_type(t) \
Expand Down

0 comments on commit 146610b

Please sign in to comment.