packages feed

fltkhs 0.5.3.7 → 0.5.3.8

raw patch · 4 files changed

+26/−6 lines, 4 filesPVP: major bump suggested

API removals or changes: PVP suggests a major version bump

API changes (from Hackage documentation)

- Graphics.UI.FLTK.LowLevel.FL: getFontSizes :: (Font) -> IO (Int, Int)
+ Graphics.UI.FLTK.LowLevel.FL: getFontSizes :: Font -> IO [Int]

Files

c-src/Fl_C.cpp view
@@ -461,8 +461,11 @@   FL_EXPORT_C(const char*,Fl_get_font_name_with_attributes)(Fl_Font font,int* attributes){     return Fl::get_font_name(font,attributes);   }-  FL_EXPORT_C(int,Fl_get_font_sizes)(Fl_Font font,int* sizep){-    return Fl::get_font_sizes(font,sizep);+  FL_EXPORT_C(int,Fl_get_font_sizes)(Fl_Font font, int** sizes){+    int* size;+    int length = Fl::get_font_sizes((Fl_Font)font,size);+    *sizes = size;+    return length;   }   FL_EXPORT_C(void,Fl_set_font_by_string)(Fl_Font font,const char* text){     Fl::set_font(font,text);
c-src/Fl_C.h view
@@ -215,7 +215,7 @@   FL_EXPORT_C_HEADER(const char*       ,Fl_get_font,(Fl_Font font));   FL_EXPORT_C_HEADER(const char*       ,Fl_get_font_name,(Fl_Font font));   FL_EXPORT_C_HEADER(const char*       ,Fl_get_font_name_with_attributes,(Fl_Font font,int* attributes));-  FL_EXPORT_C_HEADER(int               ,Fl_get_font_sizes,(Fl_Font font,int* sizep));+  FL_EXPORT_C_HEADER(int               ,Fl_get_font_sizes,(Fl_Font font,int** sizep));   FL_EXPORT_C_HEADER(void              ,Fl_set_font_by_string,(Fl_Font font,const char* fontString));   FL_EXPORT_C_HEADER(void              ,Fl_set_font_by_font,(Fl_Font to,Fl_Font from));   FL_EXPORT_C_HEADER(Fl_Font           ,Fl_set_fonts,());
fltkhs.cabal view
@@ -1,5 +1,5 @@ name : fltkhs-version : 0.5.3.7+version : 0.5.3.8 synopsis : FLTK bindings description: Low level bindings for the FLTK GUI toolkit. For installation and quick start instruction please scroll all the way down to the README. license : MIT
src/Graphics/UI/FLTK/LowLevel/FL.chs view
@@ -769,8 +769,25 @@           return $ cToFontAttribute attributeCode getFontName :: Font -> IO (T.Text, Maybe FontAttribute) getFontName f = getFontNameWithAttributes' f-{# fun Fl_get_font_sizes as getFontSizes-       { cFromFont `Font', alloca- `Int' peekIntConv* } -> `Int' #}+{# fun Fl_get_font_sizes as getFontSizes'+       { cFromFont `Font', id `Ptr (Ptr CInt)' } -> `CInt' #}+getFontSizes :: Font -> IO [Int]+getFontSizes font = do+   arrPtr <- (newArray [] :: IO (Ptr (Ptr CInt)))+   arrLength <- getFontSizes' font arrPtr+   zeroth <- peekElemOff arrPtr 0+   if (arrLength == 0) then return []+   else do+     (sizes :: [CInt]) <-+         mapM+           (+            \offset -> do+               size <- peek (advancePtr zeroth offset)+               return size+           )+           [0 .. ((fromIntegral arrLength) - 1)]+     return (map fromIntegral sizes)+ {# fun Fl_set_font_by_string as setFontToString        { cFromFont `Font', unsafeToCString `T.Text' } -> `()' supressWarningAboutRes #} {# fun Fl_set_font_by_font as setFontToFont