|
From: shelarcy <she...@gm...> - 2009-01-06 18:33:28
|
DarcsURL: C:/home/shelarcy/wxhaskell
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="=_"
--=_
Content-Type: text/plain
Content-Transfer-Encoding: quoted-printable
Tue Jan 6 22:29:11 =93=8C=8B=9E (=95W=8F=80=8E=9E) 2009 shelarcy <shelarc=
y...@gm...>
* Bump version number to 0.11.1
Tue Jan 6 23:13:58 =93=8C=8B=9E (=95W=8F=80=8E=9E) 2009 shelarcy <shelarc=
y...@gm...>
* Add Word8 and Word32 support.
Wed Jan 7 00:18:18 =93=8C=8B=9E (=95W=8F=80=8E=9E) 2009 shelarcy <shelarc=
y...@gm...>
* Change Color's primitive type from CChar to Word8.
Wed Jan 7 02:11:39 =93=8C=8B=9E (=95W=8F=80=8E=9E) 2009 shelarcy <shelarc=
y...@gm...>
* Add Word support.
Wed Jan 7 03:23:10 =93=8C=8B=9E (=95W=8F=80=8E=9E) 2009 shelarcy <shelarc=
y...@gm...>
* Add experimental alpha channel support to Color type.
--=_
Content-Type: text/x-darcs-patch; name="bump-version-number-to-0_11_1.dpatch"
Content-Transfer-Encoding: quoted-printable
Content-Description: A darcs patch for your repository!
New patches:
[Bump version number to 0.11.1
shelarcy <she...@gm...>**20090106132911
Ignore-this: d945970996e6812d312a0592c2ff2b6e
] {
hunk ./configure 15
#--------------------------------------------------------------------
# Versioning
#--------------------------------------------------------------------
-version=3D"0.11.0"
+version=3D"0.11.1"
release=3D"0"
=
#--------------------------------------------------------------------
hunk ./wx/wx.cabal 2
Name: wx
-Version: 0.11.0
+Version: 0.11.1
License: LGPL
License-file: license.txt
Homepage: http://haskell.org/haskellwiki/WxHaskell
hunk ./wxc/wxc-2.8.dsp 57
LINK32=3Dlink.exe=0D
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.=
lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odb=
ccp32.lib /nologo /dll /machine:I386=0D
=0D
-# ADD LINK32 wxzlib.lib wxregexu.lib wxpng.lib wxjpeg.lib wxtiff.lib wxexp=
at.lib wxbase28u.lib wxbase28u_net.lib wxbase28u_odbc.lib wxbase28u_xml.lib=
wxmsw28u_core.lib wxmsw28u_adv.lib wxmsw28u_dbgrid.lib wxmsw28u_gl.lib wxm=
sw28u_html.lib wxmsw28u_media.lib wxmsw28u_stc.lib wxmsw28u_svg.lib wxmsw28=
u_xrc.lib kernel32.lib user32.lib gdi32.lib gdiplus.lib winspool.lib comdlg=
32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib =
odbccp32.lib comctl32.lib rpcrt4.lib wsock32.lib opengl32.lib winmm.lib /no=
logo /dll /machine:I386 /nodefaultlib:"LIBCMT" /out:"..\dist\wxc\wxc-msw2.8=
.9-0.11.0.dll" /libpath:"..\..\wxWidgets-2.8.9\lib\vc_lib"=0D
+# ADD LINK32 wxzlib.lib wxregexu.lib wxpng.lib wxjpeg.lib wxtiff.lib wxexp=
at.lib wxbase28u.lib wxbase28u_net.lib wxbase28u_odbc.lib wxbase28u_xml.lib=
wxmsw28u_core.lib wxmsw28u_adv.lib wxmsw28u_dbgrid.lib wxmsw28u_gl.lib wxm=
sw28u_html.lib wxmsw28u_media.lib wxmsw28u_stc.lib wxmsw28u_svg.lib wxmsw28=
u_xrc.lib kernel32.lib user32.lib gdi32.lib gdiplus.lib winspool.lib comdlg=
32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib =
odbccp32.lib comctl32.lib rpcrt4.lib wsock32.lib opengl32.lib winmm.lib /no=
logo /dll /machine:I386 /nodefaultlib:"LIBCMT" /out:"..\dist\wxc\wxc-msw2.8=
.9-0.11.1.dll" /libpath:"..\..\wxWidgets-2.8.9\lib\vc_lib"=0D
# Begin Special Build Tool=0D
SOURCE=3D"$(InputPath)"=0D
hunk ./wxc/wxc-2.8.dsp 60
-PostBuild_Cmds=3Decho Generating mingw32 import library ... ..\bin\reimp .=
.\dist\wxc\wxc-msw2.8.9-0.11.0.lib move libwxc-msw2.8.9-0.11.0.a ..\dist\wx=
c move wxc-msw2.8.9-0.11.0.def ..\dist\wxc echo Done.=0D
+PostBuild_Cmds=3Decho Generating mingw32 import library ... ..\bin\reimp .=
.\dist\wxc\wxc-msw2.8.9-0.11.1.lib move libwxc-msw2.8.9-0.11.1.a ..\dist\wx=
c move wxc-msw2.8.9-0.11.1.def ..\dist\wxc echo Done.=0D
# End Special Build Tool=0D
=0D
!ELSEIF "$(CFG)" =3D=3D "wxc - Win32 Debug"=0D
hunk ./wxc/wxc-2.8.dsp 88
LINK32=3Dlink.exe=0D
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.=
lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odb=
ccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept=0D
=0D
-# ADD LINK32 wxzlibd.lib wxregexud.lib wxpngd.lib wxjpegd.lib wxtiffd.lib =
wxexpatd.lib wxbase28ud.lib wxbase28ud_net.lib wxbase28ud_odbc.lib wxbase28=
ud_xml.lib wxmsw28ud_core.lib wxmsw28ud_adv.lib wxmsw28ud_dbgrid.lib wxmsw2=
8ud_gl.lib wxmsw28ud_html.lib wxmsw28ud_media.lib wxmsw28ud_stc.lib wxmsw28=
ud_svg.lib wxmsw28ud_xrc.lib kernel32.lib user32.lib gdi32.lib gdiplus.lib =
winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib u=
uid.lib odbc32.lib odbccp32.lib comctl32.lib rpcrt4.lib wsock32.lib opengl3=
2.lib winmm.lib /nologo /dll /debug /machine:I386 /nodefaultlib:"LIBCMTD" /=
out:"..\dist\wxc\wxcd-msw2.8.9-0.11.0.dll" /pdbtype:sept /libpath:"..\..\wx=
Widgets-2.8.9\lib\vc_lib"=0D
+# ADD LINK32 wxzlibd.lib wxregexud.lib wxpngd.lib wxjpegd.lib wxtiffd.lib =
wxexpatd.lib wxbase28ud.lib wxbase28ud_net.lib wxbase28ud_odbc.lib wxbase28=
ud_xml.lib wxmsw28ud_core.lib wxmsw28ud_adv.lib wxmsw28ud_dbgrid.lib wxmsw2=
8ud_gl.lib wxmsw28ud_html.lib wxmsw28ud_media.lib wxmsw28ud_stc.lib wxmsw28=
ud_svg.lib wxmsw28ud_xrc.lib kernel32.lib user32.lib gdi32.lib gdiplus.lib =
winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib u=
uid.lib odbc32.lib odbccp32.lib comctl32.lib rpcrt4.lib wsock32.lib opengl3=
2.lib winmm.lib /nologo /dll /debug /machine:I386 /nodefaultlib:"LIBCMTD" /=
out:"..\dist\wxc\wxcd-msw2.8.9-0.11.1.dll" /pdbtype:sept /libpath:"..\..\wx=
Widgets-2.8.9\lib\vc_lib"=0D
# Begin Special Build Tool=0D
SOURCE=3D"$(InputPath)"=0D
hunk ./wxc/wxc-2.8.dsp 91
-PostBuild_Cmds=3Decho Generating mingw32 import library ... ..\bin\reimp .=
.\dist\wxc\wxcd-msw2.8.9-0.11.0.lib move libwxcd-msw2.8.9-0.11.0.a ..\dist\=
wxc move wxcd-msw2.8.9-0.11.0.def ..\dist\wxc echo Done.=0D
+PostBuild_Cmds=3Decho Generating mingw32 import library ... ..\bin\reimp .=
.\dist\wxc\wxcd-msw2.8.9-0.11.1.lib move libwxcd-msw2.8.9-0.11.1.a ..\dist\=
wxc move wxcd-msw2.8.9-0.11.1.def ..\dist\wxc echo Done.=0D
# End Special Build Tool=0D
=0D
!ENDIF =0D
hunk ./wxcore.cabal 2
Name: wxcore
-Version: 0.11.0
+Version: 0.11.1
License: LGPL
License-file: license.txt
Homepage: http://haskell.org/haskellwiki/WxHaskell
hunk ./wxdirect/wxdirect.cabal 2
Name: wxdirect
-Version: 0.11.0
+Version: 0.11.1
License: BSD3
Homepage: http://haskell.org/haskellwiki/WxHaskell
Author: Daan Leijen
}
[Add Word8 and Word32 support.
shelarcy <she...@gm...>**20090106141358
Ignore-this: 704189efa0ea7576c4752df6d9a39faf
] {
hunk ./wxc/include/wxc_types.h 78
/* 64 bit integer */=0D
#define TInt64 int64_t=0D
=0D
+/* 8 bit unsigned integer */=0D
+#define TUInt8 uint8_t=0D
+=0D
+/* 32 bit unsigned integer */=0D
+#define TUInt32 uint32_t=0D
+=0D
/* boolean as int */=0D
#define TBoolInt int=0D
=0D
hunk ./wxdirect/src/CompileClasses.hs 562
Bool -> "Bool"
Int _ -> "Int"
Int64 -> "Int64"
+ Word8 -> "Word8"
+ Word32 -> "Word32"
Void -> "()"
Char -> "Char"
Double -> "Double"
hunk ./wxdirect/src/CompileClasses.hs 653
Bool -> "CBool"
Int _ -> "CInt"
Int64 -> "Int64"
+ Word8 -> "Word8"
+ Word32 -> "Word32"
Void -> "()"
Char -> "CWchar"
Double -> "Double"
hunk ./wxdirect/src/ParseC.hs 138
<|> do reserved "size_t"; return (Int SizeT)
<|> do reserved "time_t"; return (Int TimeT)
<|> do reserved "TInt64"; return Int64
+ <|> do reserved "TUInt8"; return Word8
+ <|> do reserved "TUInt32"; return Word32
<|> do reserved "TBool"; return Bool
<|> do reserved "TBoolInt"; return Bool
<|> do reserved "TChar"; return Char
hunk ./wxdirect/src/Types.hs 83
=
data Type =3D Int CBaseType
| Int64
+ | Word8
+ | Word32
| Void
| Char
| Double
}
[Change Color's primitive type from CChar to Word8.
shelarcy <she...@gm...>**20090106151818
Ignore-this: a63da969a83ee42f141db3797b824fc8
] {
hunk ./wxc/include/wxc_glue.h 1226
=0D
/* wxColour */=0D
TClassDefExtend(wxColour,wxObject)=0D
+TUInt8 wxColour_Alpha( TSelf(wxColour) _obj );=0D
void wxColour_Assign( TSelf(wxColour) _obj, void* other );=0D
hunk ./wxc/include/wxc_glue.h 1228
-TChar wxColour_Blue( TSelf(wxColour) _obj );=0D
+TUInt8 wxColour_Blue( TSelf(wxColour) _obj );=0D
void wxColour_Copy( TSelf(wxColour) _obj, void* _other );=0D
hunk ./wxc/include/wxc_glue.h 1230
-void* wxColour_CreateByName( TStringVoid _name );=0D
+TClass(wxColour) wxColour_CreateByName( TClass(wxString) _name );=0D
TClass(wxColour) wxColour_CreateEmpty( );=0D
TClass(wxColour) wxColour_CreateFromStock( int id );=0D
hunk ./wxc/include/wxc_glue.h 1233
-void* wxColour_CreateRGB( TChar _red, TChar _green, TChar _blue );=0D
+TClass(wxColour) wxColour_CreateRGB( TUInt8 _red, TUInt8 _green, TUInt8 _b=
lue, TUInt8 _alpha );=0D
void wxColour_Delete( TSelf(wxColour) _obj );=0D
//WXCOLORREF wxColour_GetPixel( TSelf(wxColour) _obj );=0D
hunk ./wxc/include/wxc_glue.h 1236
-TChar wxColour_Green( TSelf(wxColour) _obj );=0D
-TBool wxColour_Ok( TSelf(wxColour) _obj );=0D
-TChar wxColour_Red( TSelf(wxColour) _obj );=0D
-void wxColour_Set( TSelf(wxColour) _obj, TChar _red, TChar _green, T=
Char _blue );=0D
-void wxColour_SetByName( TSelf(wxColour) _obj, TStringVoid _name );=
=0D
-TBoolInt wxColour_ValidName( TStringVoid _name );=0D
+TUInt8 wxColour_Green( TSelf(wxColour) _obj );=0D
+TBool wxColour_IsOk( TSelf(wxColour) _obj );=0D
+TUInt8 wxColour_Red( TSelf(wxColour) _obj );=0D
+void wxColour_Set( TSelf(wxColour) _obj, TUInt8 _red, TUInt8 _green,=
TUInt8 _blue, TUInt8 _alpha );=0D
+void wxColour_SetByName( TSelf(wxColour) _obj, TClass(wxString) _nam=
e );=0D
+TBool wxColour_ValidName( TStringVoid _name );=0D
=0D
/* wxColourData */=0D
TClassDefExtend(wxColourData,wxObject)=0D
hunk ./wxc/include/wxc_types.h 16
#undef TClassDef=0D
#undef TClassDefExtend=0D
#undef TChar=0D
+#undef TUInt8=0D
#undef TInt64=0D
#undef TBool=0D
#undef TBoolInt=0D
hunk ./wxc/include/wxc_types.h 116
#define TSizeOut(w,h) int* w, int* h=0D
#define TRect(x,y,w,h) int x, int y, int w, int h=0D
#define TRectOut(x,y,w,h) int* x, int* y, int* w, int* h=0D
-#define TColorRGB(r,g,b) char r, char g, char b=0D
+#define TColorRGB(r,g,b) TUInt8 r, TUInt8 g, TUInt8 b=0D
=0D
/* arrays */=0D
#define TArrayLen int=0D
hunk ./wxc/src/eljcolour.cpp 6
extern "C"=0D
{=0D
=0D
-EWXWEXPORT(void*, wxColour_CreateEmpty) ()=0D
+EWXWEXPORT(wxColour*,wxColour_CreateEmpty)()=0D
{=0D
hunk ./wxc/src/eljcolour.cpp 8
- return (void*) new wxColour();=0D
+ return new wxColour();=0D
}=0D
=0D
hunk ./wxc/src/eljcolour.cpp 11
-EWXWEXPORT(void*, wxColour_CreateRGB) (char _red, char _green, char _blue)=
=0D
+EWXWEXPORT(wxColour*,wxColour_CreateRGB)(wxUint8 _red,wxUint8 _green,wxUin=
t8 _blue,wxUint8 _alpha)=0D
{=0D
hunk ./wxc/src/eljcolour.cpp 13
- return (void*) new wxColour(_red, _green, _blue);=0D
+ return new wxColour(_red, _green, _blue,_alpha);=0D
}=0D
=0D
hunk ./wxc/src/eljcolour.cpp 16
-EWXWEXPORT(void*, wxColour_CreateByName) (void* _name)=0D
+EWXWEXPORT(wxColour*,wxColour_CreateByName)(wxString* _name)=0D
{=0D
hunk ./wxc/src/eljcolour.cpp 18
- return (void*) new wxColour((wxChar*)_name);=0D
+ return new wxColour(*_name);=0D
}=0D
=0D
hunk ./wxc/src/eljcolour.cpp 21
-EWXWEXPORT(void*, wxColour_CreateFromStock) (int _id)=0D
+EWXWEXPORT(void*,wxColour_CreateFromStock)(int _id)=0D
{=0D
switch (_id)=0D
{=0D
hunk ./wxc/src/eljcolour.cpp 44
return NULL;=0D
}=0D
=0D
-EWXWEXPORT(void, wxColour_Delete)(void* _obj)=0D
+EWXWEXPORT(void,wxColour_Delete)(wxColour* _obj)=0D
{=0D
hunk ./wxc/src/eljcolour.cpp 46
- delete (wxColour*)_obj;=0D
+ delete _obj;=0D
}=0D
=0D
hunk ./wxc/src/eljcolour.cpp 49
-EWXWEXPORT(void, wxColour_Set)(void* _obj, char _red, char _green, char _b=
lue)=0D
+EWXWEXPORT(void,wxColour_Set)(wxColour* _obj,wxUint8 _red,wxUint8 _green,w=
xUint8 _blue,wxUint8 _alpha)=0D
{=0D
hunk ./wxc/src/eljcolour.cpp 51
- ((wxColour*)_obj)->Set(_red, _green, _blue);=0D
+ _obj->Set(_red, _green, _blue);=0D
}=0D
=0D
hunk ./wxc/src/eljcolour.cpp 54
-EWXWEXPORT(void, wxColour_Assign)(void* _obj, void* other)=0D
+EWXWEXPORT(void,wxColour_Assign)(wxColour* _obj,wxColour* other)=0D
{=0D
hunk ./wxc/src/eljcolour.cpp 56
- *((wxColour*)_obj) =3D *((wxColour*)other);=0D
+ *_obj =3D *other;=0D
}=0D
=0D
hunk ./wxc/src/eljcolour.cpp 59
-EWXWEXPORT(int, wxColour_Ok)(void* _obj)=0D
+EWXWEXPORT(bool,wxColour_IsOk)(wxColour* _obj)=0D
{=0D
hunk ./wxc/src/eljcolour.cpp 61
- return (int)((wxColour*)_obj)->Ok();=0D
+ return _obj->IsOk();=0D
}=0D
=0D
hunk ./wxc/src/eljcolour.cpp 64
-EWXWEXPORT(char, wxColour_Red)(void* _obj)=0D
+EWXWEXPORT(wxUint8,wxColour_Red)(wxColour* _obj)=0D
{=0D
hunk ./wxc/src/eljcolour.cpp 66
- return ((wxColour*)_obj)->Red();=0D
+ return _obj->Red();=0D
}=0D
=0D
hunk ./wxc/src/eljcolour.cpp 69
-EWXWEXPORT(char, wxColour_Green)(void* _obj)=0D
+EWXWEXPORT(wxUint8,wxColour_Green)(wxColour* _obj)=0D
{=0D
hunk ./wxc/src/eljcolour.cpp 71
- return ((wxColour*)_obj)->Green();=0D
+ return _obj->Green();=0D
}=0D
=0D
hunk ./wxc/src/eljcolour.cpp 74
-EWXWEXPORT(char, wxColour_Blue)(void* _obj)=0D
+EWXWEXPORT(wxUint8,wxColour_Blue)(wxColour* _obj)=0D
{=0D
hunk ./wxc/src/eljcolour.cpp 76
- return ((wxColour*)_obj)->Blue();=0D
+ return _obj->Blue();=0D
+}=0D
+=0D
+EWXWEXPORT(wxUint8,wxColour_Alpha)(wxColour* _obj)=0D
+{=0D
+ return _obj->Alpha();=0D
}=0D
=0D
// FIXME: the return type on this is platform dependent=0D
hunk ./wxc/src/eljcolour.cpp 92
// GTK - int=0D
// X11 - long=0D
// Mac - (WXCOLORREF&)=0D
-// EWXWEXPORT(WXCOLORREF, wxColour_GetPixel)(void* _obj)=0D
+// EWXWEXPORT(WXCOLORREF,wxColour_GetPixel)(wxColour* _obj)=0D
// {=0D
hunk ./wxc/src/eljcolour.cpp 94
-// return ((wxColour*)_obj)->GetPixel();=0D
+// return _obj->GetPixel();=0D
// }=0D
=0D
hunk ./wxc/src/eljcolour.cpp 97
-EWXWEXPORT(void, wxColour_Copy)(void* _obj, void* _other)=0D
+EWXWEXPORT(void,wxColour_Copy)(wxColour* _obj,wxColour* _other)=0D
{=0D
hunk ./wxc/src/eljcolour.cpp 99
- (*((wxColour*)_obj)) =3D (*((wxColour*)_other));=0D
+ *_obj =3D *_other;=0D
}=0D
=0D
hunk ./wxc/src/eljcolour.cpp 102
-EWXWEXPORT(void, wxColour_SetByName)(void* _obj, void* _name)=0D
+EWXWEXPORT(void,wxColour_SetByName)(wxColour* _obj,wxString* _name)=0D
{=0D
hunk ./wxc/src/eljcolour.cpp 104
- (*((wxColour*)_obj)) =3D (wxChar*)_name;=0D
+ *_obj =3D *_name;=0D
}=0D
=0D
hunk ./wxc/src/eljcolour.cpp 107
-EWXWEXPORT(int, wxColour_ValidName)(wxChar* _name)=0D
+EWXWEXPORT(bool,wxColour_ValidName)(wxString* _name)=0D
{=0D
#if (wxVERSION_NUMBER < 2600)=0D
hunk ./wxc/src/eljcolour.cpp 110
- return (wxTheColourDatabase->FindColour (wxString(_name))) !=3D NULL;=0D
+ return (wxTheColourDatabase->FindColour (*_name)) !=3D NULL;=0D
#else=0D
hunk ./wxc/src/eljcolour.cpp 112
- return wxTheColourDatabase->Find(wxString(_name)).Ok();=0D
+ return wxTheColourDatabase->Find(*_name).IsOk();=0D
#endif=0D
}=0D
=0D
hunk ./wxc/src/image.cpp 10
{
=
/* bitmap/image helpers */
-EWXWEXPORT(wxBitmap*, wxBitmap_CreateFromImage)( wxImage* image, int depth=
)
+EWXWEXPORT(wxBitmap*,wxBitmap_CreateFromImage)(wxImage* image,int depth)
{
return new wxBitmap(*image,depth);
}
hunk ./wxc/src/image.cpp 16
=
=
-EWXWEXPORT(wxImage*, wxImage_CreateFromDataEx)(int width, int height, void=
* data, int isStaticData)
+EWXWEXPORT(wxImage*,wxImage_CreateFromDataEx)(int width,int height,wxUint8=
* data,bool isStaticData)
{
hunk ./wxc/src/image.cpp 18
- return new wxImage(width, height, (unsigned char*)data, isStaticData !=
=3D 0);
+ return new wxImage(width, height, data, isStaticData);
}
=
=
hunk ./wxc/src/image.cpp 22
-EWXWEXPORT(void, wxImage_Delete)( wxImage* image )
+EWXWEXPORT(void,wxImage_Delete)(wxImage* image)
{
delete image;
}
hunk ./wxc/src/image.cpp 29
=
=
/* colours */
-EWXWEXPORT(void*, wxColour_CreateFromInt) (int rgb)
+EWXWEXPORT(void*,wxColour_CreateFromInt)(int rgb)
{
return (void*) new wxColour((rgb >> 16) & 0xFF, (rgb >> 8) & 0xFF, rgb &=
0xFF);
}
hunk ./wxc/src/image.cpp 34
=
-EWXWEXPORT(int, wxColour_GetInt) (wxColour* colour)
+EWXWEXPORT(int,wxColour_GetInt)(wxColour* colour)
{
int r =3D colour->Red();
int g =3D colour->Green();
hunk ./wxc/src/image.cpp 43
}
=
/* basic pixel manipulation */
-EWXWEXPORT(void, wxcSetPixelRGB)( unsigned char* buffer, int width, int x,=
int y, int rgb )
+EWXWEXPORT(void,wxcSetPixelRGB)(wxUint8* buffer,int width,int x,int y,int =
rgb)
{
int indexR =3D 3*(width*y + x);
buffer[indexR] =3D rgb >> 16;
hunk ./wxc/src/image.cpp 51
buffer[indexR+2] =3D rgb;
}
=
-EWXWEXPORT(int, wxcGetPixelRGB)( unsigned char* buffer, int width, int x, =
int y )
+EWXWEXPORT(int,wxcGetPixelRGB)(wxUint8* buffer,int width,int x,int y)
{
int indexR =3D 3*(width*y + x);
int r,g,b;
hunk ./wxc/src/image.cpp 61
return ((r << 16) | (g << 8) | b);
}
=
-EWXWEXPORT(void, wxcSetPixelRowRGB)( unsigned char* buffer, int width, int=
x, int y, int rgb0, int rgb1, int count )
+EWXWEXPORT(void,wxcSetPixelRowRGB)(wxUint8* buffer,int width,int x,int y,i=
nt rgb0,int rgb1,int count)
{
int r0 =3D ((rgb0 >> 16) && 0xFF);
int g0 =3D ((rgb0 >> 8) && 0xFF);
hunk ./wxc/src/image.cpp 102
}
}
=
-EWXWEXPORT(void, wxcInitPixelsRGB)( unsigned char* buffer, int width, int =
height, int rgb )
+EWXWEXPORT(void,wxcInitPixelsRGB)(wxUint8* buffer,int width,int height,int=
rgb)
{
int count =3D width*height*3;
hunk ./wxc/src/image.cpp 105
- unsigned char r =3D ((rgb >> 16) && 0xFF);
- unsigned char g =3D ((rgb >> 8) && 0xFF);
- unsigned char b =3D rgb && 0xFF;
+ wxUint8 r =3D ((rgb >> 16) && 0xFF);
+ wxUint8 g =3D ((rgb >> 8) && 0xFF);
+ wxUint8 b =3D rgb && 0xFF;
int i;
=
if (r=3D=3Dg && g=3D=3Db) {
hunk ./wxcore/src/Graphics/UI/WXCore/Image.hs 218
Direct image manipulation
--------------------------------------------------------------------------=
---------------}
-- | An abstract pixel buffer (=3D array of RGB values)
-data PixelBuffer =3D PixelBuffer Bool Size (Ptr CChar)
+data PixelBuffer =3D PixelBuffer Bool Size (Ptr Word8)
=
-- | Create a pixel buffer. (To be deleted with 'pixelBufferDelete').
pixelBufferCreate :: Size -> IO PixelBuffer
hunk ./wxcore/src/Graphics/UI/WXCore/Image.hs 240
pixelBufferGetPixels :: PixelBuffer -> IO [Color]
pixelBufferGetPixels (PixelBuffer owned (Size w h) buffer)
=3D do let count =3D w*h
- rgbs <- peekCStringLen (buffer,3*count) -- peekArra=
y seems buggy in ghc 6.2.1
+ rgbs <- peekArray (3*count) buffer
return (convert rgbs)
where
hunk ./wxcore/src/Graphics/UI/WXCore/Image.hs 243
- convert :: [Char] -> [Color]
- convert (r:g:b:xs) =3D colorRGB (intFromCChar r) (intFromCChar g) (in=
tFromCChar b): convert xs
+ convert :: [Word8] -> [Color]
+ convert (r:g:b:xs) =3D colorRGB (intFromWord8 r) (intFromWord8 g) (in=
tFromWord8 b): convert xs
convert [] =3D []
=
hunk ./wxcore/src/Graphics/UI/WXCore/Image.hs 247
-intFromCChar :: Char -> Int =
-intFromCChar c =3D fromEnum c
+intFromWord8 :: Word8 -> Int =
+intFromWord8 c =3D fromIntegral c
=
hunk ./wxcore/src/Graphics/UI/WXCore/Image.hs 250
-intToCChar :: Int -> CChar
-intToCChar i =3D fromIntegral i
+intToWord8 :: Int -> Word8
+intToWord8 i =3D fromIntegral i
=
-- | Set all the pixels of a pixel buffer.
pixelBufferSetPixels :: PixelBuffer -> [Color] -> IO ()
hunk ./wxcore/src/Graphics/UI/WXCore/Image.hs 259
=3D do let count =3D w*h
pokeArray buffer (convert (take count colors))
where
- convert :: [Color] -> [CChar]
- convert (c:cs) =3D intToCChar (colorRed c) : intToCChar (colorGreen c)=
: intToCChar (colorBlue c) : convert cs
+ convert :: [Color] -> [Word8]
+ convert (c:cs) =3D intToWord8 (colorRed c) : intToWord8 (colorGreen c)=
: intToWord8 (colorBlue c) : convert cs
convert [] =3D []
=
-- | Initialize the pixel buffer with a grey color. The second argument
hunk ./wxcore/src/Graphics/UI/WXCore/Image.hs 274
pixelBufferSetPixel (PixelBuffer owned size buffer) point color
=3D {-
do let idx =3D 3*(y*w + x)
- r =3D intToCChar (colorRed color)
- g =3D intToCChar (colorGreen color)
- b =3D intToCChar (colorBlue color)
+ r =3D intToWord8 (colorRed color)
+ g =3D intToWord8 (colorGreen color)
+ b =3D intToWord8 (colorBlue color)
pokeByteOff buffer idx r
pokeByteOff buffer (idx+1) g
pokeByteOff buffer (idx+2) b
hunk ./wxcore/src/Graphics/UI/WXCore/Image.hs 292
r <- peekByteOff buffer idx
g <- peekByteOff buffer (idx+1)
b <- peekByteOff buffer (idx+2)
- return (colorRGB (intFromCChar r) (intFromCChar g) (intFromCChar b)=
)
+ return (colorRGB (intFromWord8 r) (intFromWord8 g) (intFromWord8 b)=
)
-}
do rgb <- wxcGetPixelRGB buffer (sizeW size) point
return (colorFromInt rgb)
hunk ./wxcore/src/Graphics/UI/WXCore/WxcTypes.hs 67
=
, colourFromColor, colorFromColour
, colourCreate, colourSafeDelete -- , colourCreateRGB, colourR=
ed, colourGreen, colourBlue
- , toCCharColorRed, toCCharColorGreen, toCCharColorBlue
+ , toWord8ColorRed, toWord8ColorGreen, toWord8ColorBlue
=
=
-- ** Managed object types
hunk ./wxcore/src/Graphics/UI/WXCore/WxcTypes.hs 1218
=
=
-- marshalling 1
-toCCharColorRed, toCCharColorGreen, toCCharColorBlue :: Color -> CChar
-toCCharColorRed c =3D toCCharInt (colorRed c)
-toCCharColorGreen c =3D toCCharInt (colorGreen c)
-toCCharColorBlue c =3D toCCharInt (colorBlue c)
-
-toCCharInt :: Int -> CChar
-toCCharInt i =3D fromIntegral i
+toWord8ColorRed, toWord8ColorGreen, toWord8ColorBlue :: Color -> Word8
+toWord8ColorRed c =3D fromIntegral (colorRed c)
+toWord8ColorGreen c =3D fromIntegral (colorGreen c)
+toWord8ColorBlue c =3D fromIntegral (colorBlue c)
=
-- marshalling 2
{-
hunk ./wxcore/src/Graphics/UI/WXCore/WxcTypes.hs 1238
withManagedColourResult :: IO (Ptr (TColour a)) -> IO Color
withManagedColourResult io
=3D do pcolour <- io
- color <- do ok <- colourOk pcolour
+ color <- do ok <- colourIsOk pcolour
if (ok=3D=3D0)
then return colorNull
else do rgb <- colourGetInt pcolour
hunk ./wxcore/src/Graphics/UI/WXCore/WxcTypes.hs 1272
colorFromColour :: Colour a -> IO Color
colorFromColour c
=3D withObjectRef "colorFromColour" c $ \pcolour ->
- do ok <- colourOk pcolour
+ do ok <- colourIsOk pcolour
if (ok=3D=3D0)
then return colorNull
else do rgb <- colourGetInt pcolour
hunk ./wxcore/src/Graphics/UI/WXCore/WxcTypes.hs 1284
foreign import ccall "wxColour_GetInt" colourGetInt :: Ptr (=
TColour a) -> IO CInt
foreign import ccall "wxColour_SafeDelete" colourSafeDelete :: Ptr (TCol=
our a) -> IO ()
foreign import ccall "wxColour_IsStatic" colourIsStatic :: Ptr (TColour =
a) -> Bool
-foreign import ccall "wxColour_Ok" colourOk :: Ptr (TColour a) -> IO =
CInt
+foreign import ccall "wxColour_IsOk" colourIsOk :: Ptr (TColour a) ->=
IO CInt
foreign import ccall "Null_Colour" colourNull :: IO (Ptr (TColour a))
foreign import ccall wxManagedPtr_CreateFromColour :: Ptr (TColour a) -> I=
O (ManagedPtr (TColour a))
hunk ./wxdirect/src/CompileClasses.hs 468
++ pparens ("toCDoubleRectW " ++ name) ++ " " ++ pparen=
s( "toCDoubleRectH " ++ name)
Rect _ -> pparens ("toCIntRectX " ++ name) ++ " " ++ pparens( "toC=
IntRectY " ++ name)
++ pparens ("toCIntRectW " ++ name) ++ " " ++ pparens( "=
toCIntRectH " ++ name)
- ColorRGB _ -> pparens ("toCCharColorRed " ++ name) ++ " " =
- ++ pparens ("toCCharColorGreen " ++ name) ++ " "
- ++ pparens ("toCCharColorBlue " ++ name) =
+ ColorRGB _ -> pparens ("toWord8ColorRed " ++ name) ++ " " =
+ ++ pparens ("toWord8ColorGreen " ++ name) ++ " "
+ ++ pparens ("toWord8ColorBlue " ++ name) =
=
ArrayString _ -> haskellArrayLenName name ++ " " ++ haskellArray=
Name name
ArrayObject tp _ -> haskellArrayLenName name ++ " " ++ haskellArray=
Name name
hunk ./wxdirect/src/CompileClasses.hs 671
Vector _ -> "CInt -> CInt"
Size CDouble -> "CDouble -> CDouble"
Size _ -> "CInt -> CInt"
- ColorRGB _ -> "CChar -> CChar -> CChar"
+ ColorRGB _ -> "Word8 -> Word8 -> Word8"
Rect CDouble -> "CDouble -> CDouble -> CDouble -> CDouble"
Rect _ -> "CInt -> CInt -> CInt -> CInt"
Fun f -> "Ptr " ++ pparens f
}
[Add Word support.
shelarcy <she...@gm...>**20090106171139
Ignore-this: 81376472899f15f9724f724b656c251d
] {
hunk ./wxc/include/wxc_types.h 79
/* 64 bit integer */=0D
#define TInt64 int64_t=0D
=0D
+/* unsigned integer */=0D
+#define TUInt uint32_t=0D
+=0D
/* 8 bit unsigned integer */=0D
#define TUInt8 uint8_t=0D
=0D
hunk ./wxcore/src/Graphics/UI/WXCore/WxcTypes.hs 101
, withByteStringResult, withLazyByteStringResult
-- *** CInt
, CInt, toCInt, fromCInt, withIntResult
+ -- *** Word
+ , Word
-- *** 8 bit Word
, Word8
-- *** 64 bit Integer
hunk ./wxdirect/src/CompileClasses.hs 562
Bool -> "Bool"
Int _ -> "Int"
Int64 -> "Int64"
+ Word -> "Word"
Word8 -> "Word8"
Word32 -> "Word32"
Void -> "()"
hunk ./wxdirect/src/CompileClasses.hs 654
Bool -> "CBool"
Int _ -> "CInt"
Int64 -> "Int64"
+ Word -> "Word"
Word8 -> "Word8"
Word32 -> "Word32"
Void -> "()"
hunk ./wxdirect/src/ParseC.hs 138
<|> do reserved "size_t"; return (Int SizeT)
<|> do reserved "time_t"; return (Int TimeT)
<|> do reserved "TInt64"; return Int64
+ <|> do reserved "TUInt"; return Word
<|> do reserved "TUInt8"; return Word8
<|> do reserved "TUInt32"; return Word32
<|> do reserved "TBool"; return Bool
hunk ./wxdirect/src/Types.hs 83
=
data Type =3D Int CBaseType
| Int64
+ | Word
| Word8
| Word32
| Void
}
[Add experimental alpha channel support to Color type.
shelarcy <she...@gm...>**20090106182310
Ignore-this: 6c35ed5d80bed81134a6110cd9cfb60a
] {
hunk ./wxc/include/wxc.h 380
TClass(wxColour) wxColour_CreateFromInt(int rgb);=0D
/** Return colors as an rgb int. */=0D
int wxColour_GetInt( TSelf(wxColour) colour);=0D
+/** Create from rgba unsigned int. */=0D
+TClass(wxColour) wxColour_CreateFromUnsignedInt(TUInt rgba);=0D
+/** Return colors as an rgba unsigned int. */=0D
+TUInt wxColour_GetUnsignedInt( TSelf(wxColour) colour);=0D
=0D
/** Create from system colour. */=0D
TClass(wxColour) wxcSystemSettingsGetColour( int systemColour );=0D
hunk ./wxc/include/wxc.h 390
=0D
=0D
/* basic pixel manipulation */=0D
-void wxcSetPixelRGB( void* buffer, int width, TPoint(x,y), int rgb );=0D
-int wxcGetPixelRGB( void* buffer, int width, TPoint(x,y) );=0D
-void wxcSetPixelRowRGB( void* buffer, int width, TPoint(x,y), int rgbStart=
, int rgbEnd, int count );=0D
-void wxcInitPixelsRGB( void* buffer, TSize(width,height), int rgb );=0D
+void wxcSetPixelRGB( TUInt8* buffer, int width, TPoint(x,y), int rgb );=
=0D
+int wxcGetPixelRGB( TUInt8* buffer, int width, TPoint(x,y) );=0D
+void wxcSetPixelRowRGB( TUInt8* buffer, int width, TPoint(x,y), int rgbSta=
rt, int rgbEnd, int count );=0D
+void wxcInitPixelsRGB( TUInt8* buffer, TSize(width,height), int rgba );=0D
+void wxcSetPixelRGBA( TUInt8* buffer, int width, TPoint(x,y), TUInt rgba =
);=0D
+int wxcGetPixelRGBA( TUInt8* buffer, int width, TPoint(x,y) );=0D
+void wxcSetPixelRowRGBA( TUInt8* buffer, int width, TPoint(x,y), int rgbaS=
tart, int rgbEnd, TUInt count );=0D
+void wxcInitPixelsRGBA( TUInt8* buffer, TSize(width,height), TUInt rgba );=
=0D
=0D
/* malloc/free */=0D
void* wxcMalloc(int size );=0D
hunk ./wxc/src/image.cpp 124
}
}
=
+EWXWEXPORT(void*,wxColour_CreateFromUnsignedInt)(unsigned int rgba)
+{
+ return (void*) new wxColour((rgba >> 24) & 0xFF, (rgba >> 16) & 0xFF, (r=
gba >> 8) & 0xFF, rgba & 0xFF);
+}
+
+EWXWEXPORT(unsigned int,wxColour_GetUnsignedInt)(wxColour* colour)
+{
+ int r =3D colour->Red();
+ int g =3D colour->Green();
+ int b =3D colour->Blue();
+ int a =3D colour->Alpha();
+ return ((r << 24) | (g << 16) | (b << 8) | a);
+}
+
+/* basic pixel manipulation */
+EWXWEXPORT(void,wxcSetPixelRGBA)(wxUint8* buffer,int width,int x,int y,int=
rgba)
+{
+ unsigned int indexR =3D 4*(width*y + x);
+ buffer[indexR] =3D rgba >> 24;
+ buffer[indexR+1] =3D rgba >> 16;
+ buffer[indexR+2] =3D rgba >> 8;
+ buffer[indexR+3] =3D rgba;
+}
+
+EWXWEXPORT(int,wxcGetPixelRGBA)(wxUint8* buffer,int width,int x,int y)
+{
+ unsigned int indexR =3D 4*(width*y + x);
+ int r,g,b,a;
+ r =3D buffer[indexR];
+ g =3D buffer[indexR+1];
+ b =3D buffer[indexR+2];
+ a =3D buffer[indexR+3];
+ return ((r << 24) | (g << 16) | (b << 8) | a);
+}
+
+EWXWEXPORT(void,wxcSetPixelRowRGBA)(wxUint8* buffer,int width,int x,int y,=
unsigned int rgba0,unsigned int rgba1,unsigned int count)
+{
+ int r0 =3D ((rgba0 >> 24) && 0xFF);
+ int g0 =3D ((rgba0 >> 16) && 0xFF);
+ int b0 =3D ((rgba0 >> 8) && 0xFF);
+ int a0 =3D (rgba0 && 0xFF);
+ unsigned int start =3D 4*(width*y+x);
+ unsigned int i;
+
+ if (rgba0 =3D=3D rgba1) {
+ /* same color */
+ for( i=3D0; i < count*4; i +=3D4) {
+ buffer[start+i] =3D r0;
+ buffer[start+i+1] =3D g0;
+ buffer[start+i+2] =3D b0;
+ buffer[start+i+3] =3D a0;
+ }
+ }
+ else {
+ /* do linear interpolation of the color */
+ int r1 =3D ((rgba1 >> 24) && 0xFF);
+ int g1 =3D ((rgba1 >> 16) && 0xFF);
+ int b1 =3D ((rgba1 >> 8) && 0xFF);
+ int a1 =3D (rgba1 && 0xFF);
+
+ int rd =3D ((r1 - r0) << 24) / (count-1);
+ int gd =3D ((g1 - g0) << 24) / (count-1);
+ int bd =3D ((b1 - b0) << 24) / (count-1);
+ int ad =3D ((a1 - a0) << 24) / (count-1);
+
+ int r =3D r0 << 24;
+ int g =3D g0 << 24;
+ int b =3D b0 << 24;
+ int a =3D b0 << 24;
+
+ for( i =3D 0; i < count*4; i +=3D 4 ) {
+ buffer[start+i] =3D (r >> 24);
+ buffer[start+i+1] =3D (g >> 24);
+ buffer[start+i+2] =3D (b >> 24);
+ buffer[start+i+3] =3D (a >> 24);
+ r +=3D rd;
+ g +=3D gd;
+ b +=3D bd;
+ a +=3D ad;
+ }
+ }
+}
+
+EWXWEXPORT(void,wxcInitPixelsRGBA)(wxUint8* buffer,int width,int height,in=
t rgba)
+{
+ unsigned int count =3D width*height*4;
+ wxUint8 r =3D ((rgba >> 24) && 0xFF);
+ wxUint8 g =3D ((rgba >> 16) && 0xFF);
+ wxUint8 b =3D ((rgba >> 8) && 0xFF);
+ wxUint8 a =3D rgba && 0xFF;
+ unsigned int i;
+
+ if (r=3D=3Dg && g=3D=3Db && b=3D=3Da) {
+ for( i=3D0; i < count; i++ ) {
+ buffer[i] =3D r;
+ }
+ }
+ else {
+ for( i=3D0; i < count; i +=3D 4) {
+ buffer[i] =3D r;
+ buffer[i+1] =3D g;
+ buffer[i+2] =3D b;
+ buffer[i+3] =3D a;
+ }
+ }
+}
+
}
hunk ./wxcore/src/Graphics/UI/WXCore/WxcTypes.hs 50
, rect, rectBetween, rectFromSize, rectZero, rectNull, rectSiz=
e, rectIsEmpty
=
-- ** Color
- , Color(..), rgb, colorRGB, colorRed, colorGreen, colorBlue, i=
ntFromColor, colorFromInt, colorOk
+ , Color(..), rgb, colorRGB, rgba, colorRGBA, colorRed, colorGr=
een, colorBlue, colorAlpha
+ , intFromColor, colorFromInt, wordFromColor, colorFromWord, co=
lorOk
=
-- * Marshalling
-- ** Basic types
hunk ./wxcore/src/Graphics/UI/WXCore/WxcTypes.hs 67
, withArrayIntResult, withArrayStringResult, withArrayWStringR=
esult, withArrayObjectResult
=
, colourFromColor, colorFromColour
- , colourCreate, colourSafeDelete -- , colourCreateRGB, colourR=
ed, colourGreen, colourBlue
- , toWord8ColorRed, toWord8ColorGreen, toWord8ColorBlue
+ , colourCreate, colourSafeDelete -- , colourCreateRGB, colourR=
ed, colourGreen, colourBlue colourAlpha
+ , toWord8ColorRed, toWord8ColorGreen, toWord8ColorBlue, toWord=
8ColorAlpha
=
=
-- ** Managed object types
hunk ./wxcore/src/Graphics/UI/WXCore/WxcTypes.hs 1166
-- We can't derive 'MArray' class's unboxed array instance this way. Thi=
s is a bad point
-- of current 'MArray' class definition.
--
-newtype Color =3D Color Int =
+newtype Color =3D Color Word =
deriving (Eq, Typeable) -- , IArray UArray) =
=
instance Show Color where
hunk ./wxcore/src/Graphics/UI/WXCore/WxcTypes.hs 1171
showsPrec d c
- =3D showParen (d > 0) (showString "rgb(" . shows (colorRed c) .
- showChar ',' . shows (colorGreen c) .
- showChar ',' . shows (colorBlue c) .
+ =3D showParen (d > 0) (showString "rgba(" . shows (colorRed c) .
+ showChar ',' . shows (colorGreen c) .
+ showChar ',' . shows (colorBlue c) .
+ showChar ',' . shows (colorAlpha c) .
showChar ')' )
=
-- | Create a color from a red\/green\/blue triple.
hunk ./wxcore/src/Graphics/UI/WXCore/WxcTypes.hs 1179
colorRGB :: Int -> Int -> Int -> Color
-colorRGB r g b =3D Color (shiftL r 16 .|. shiftL g 8 .|. b)
+colorRGB r g b =3D Color (shiftL (fromIntegral r) 24 .|. shiftL (fromInteg=
ral g) 16 .|. shiftL (fromIntegral b) 8 .|. 255)
=
-- | Create a color from a red\/green\/blue triple.
rgb :: Int -> Int -> Int -> Color
hunk ./wxcore/src/Graphics/UI/WXCore/WxcTypes.hs 1185
rgb r g b =3D colorRGB r g b
=
+-- | Create a color from a red\/green\/blue\/alpha quadruple.
+colorRGBA :: Int -> Int -> Int -> Int -> Color
+colorRGBA r g b a =3D Color (shiftL (fromIntegral r) 24 .|. shiftL (fromIn=
tegral g) 16 .|. shiftL (fromIntegral b) 8 .|. (fromIntegral a))
+
+-- | Create a color from a red\/green\/blue\/alpha quadruple.
+rgba :: Int -> Int -> Int -> Int -> Color
+rgba r g b a =3D colorRGBA r g b a
+
=
-- | Return an 'Int' where the three least significant bytes contain
-- the red, green, and blue component of a color.
hunk ./wxcore/src/Graphics/UI/WXCore/WxcTypes.hs 1197
intFromColor :: Color -> Int
-intFromColor (Color rgb)
- =3D rgb
+intFromColor rgb
+ =3D let r =3D colorRed rgb
+ g =3D colorGreen rgb
+ b =3D colorBlue rgb
+ in (shiftL (fromIntegral r) 16 .|. shiftL (fromIntegral g) 8 .|. b)
=
-- | Set the color according to an rgb integer. (see 'rgbIntFromColor').
colorFromInt :: Int -> Color
hunk ./wxcore/src/Graphics/UI/WXCore/WxcTypes.hs 1206
colorFromInt rgb
+ =3D let r =3D (shiftR rgb 16) .&. 0xFF
+ g =3D (shiftR rgb 8) .&. 0xFF
+ b =3D rgb .&. 0xFF
+ in colorRGB r g b
+
+-- | Return an 'Int' where the three least significant bytes contain
+-- the red, green, and blue component of a color.
+wordFromColor :: Color -> Word
+wordFromColor (Color rgb)
+ =3D rgb
+
+-- | Set the color according to an rgba unsigned integer. (see 'rgbaIntFro=
mColor').
+colorFromWord :: Word -> Color
+colorFromWord rgb
=3D Color rgb
=
-- | Returns a red color component
hunk ./wxcore/src/Graphics/UI/WXCore/WxcTypes.hs 1224
colorRed :: Color -> Int
-colorRed (Color rgb) =3D (shiftR rgb 16) .&. 0xFF
+colorRed (Color rgba) =3D fromIntegral ((shiftR rgba 24) .&. 0xFF)
=
-- | Returns a green color component
colorGreen :: Color -> Int
hunk ./wxcore/src/Graphics/UI/WXCore/WxcTypes.hs 1228
-colorGreen (Color rgb) =3D (shiftR rgb 8) .&. 0xFF
+colorGreen (Color rgba) =3D fromIntegral ((shiftR rgba 16) .&. 0xFF)
=
-- | Returns a blue color component
colorBlue :: Color -> Int
hunk ./wxcore/src/Graphics/UI/WXCore/WxcTypes.hs 1232
-colorBlue (Color rgb) =3D rgb .&. 0xFF
+colorBlue (Color rgba) =3D fromIntegral ((shiftR rgba 8) .&. 0xFF)
+
+-- | Returns a alpha channel component
+colorAlpha :: Color -> Int
+colorAlpha (Color rgba) =3D fromIntegral (rgba .&. 0xFF)
=
=
-- | This is an illegal color, corresponding to @nullColour@.
hunk ./wxcore/src/Graphics/UI/WXCore/WxcTypes.hs 1251
=
=
-- marshalling 1
-toWord8ColorRed, toWord8ColorGreen, toWord8ColorBlue :: Color -> Word8
+toWord8ColorRed, toWord8ColorGreen, toWord8ColorBlue, toWord8ColorAlpha ::=
Color -> Word8
toWord8ColorRed c =3D fromIntegral (colorRed c)
toWord8ColorGreen c =3D fromIntegral (colorGreen c)
toWord8ColorBlue c =3D fromIntegral (colorBlue c)
hunk ./wxcore/src/Graphics/UI/WXCore/WxcTypes.hs 1255
+toWord8ColorAlpha c =3D fromIntegral (colorAlpha c)
=
-- marshalling 2
{-
hunk ./wxcore/src/Graphics/UI/WXCore/WxcTypes.hs 1275
color <- do ok <- colourIsOk pcolour
if (ok=3D=3D0)
then return colorNull
- else do rgb <- colourGetInt pcolour
- return (colorFromInt (fromCInt rgb))
+ else do rgba <- colourGetUnsignedInt pcolour
+ return (colorFromWord rgba)
colourSafeDelete pcolour
return color
=
hunk ./wxcore/src/Graphics/UI/WXCore/WxcTypes.hs 1287
=
withColourPtr :: Color -> (Ptr (TColour a) -> IO b) -> IO b
withColourPtr c f
- =3D do pcolour <- colourCreateFromInt (toCInt (intFromColor c))
+ =3D do pcolour <- colourCreateFromUnsignedInt (wordFromColor c)
x <- f pcolour
colourSafeDelete pcolour
return x
hunk ./wxcore/src/Graphics/UI/WXCore/WxcTypes.hs 1295
colourFromColor :: Color -> IO (Colour ())
colourFromColor c
=3D if (colorOk c)
- then do p <- colourCreateFromInt (toCInt (intFromColor c))
+ then do p <- colourCreateFromUnsignedInt (wordFromColor c)
if (colourIsStatic p)
then return (objectFromPtr p)
else do mp <- wxManagedPtr_CreateFromColour p
hunk ./wxcore/src/Graphics/UI/WXCore/WxcTypes.hs 1309
do ok <- colourIsOk pcolour
if (ok=3D=3D0)
then return colorNull
- else do rgb <- colourGetInt pcolour
- return (colorFromInt (fromCInt rgb))
+ else do rgba <- colourGetUnsignedInt pcolour
+ return (colorFromWord rgba)
=
=
foreign import ccall "wxColour_CreateEmpty" colourCreate :: IO (Ptr (TC=
olour a))
hunk ./wxcore/src/Graphics/UI/WXCore/WxcTypes.hs 1316
foreign import ccall "wxColour_CreateFromInt" colourCreateFromInt :: CInt =
-> IO (Ptr (TColour a))
foreign import ccall "wxColour_GetInt" colourGetInt :: Ptr (=
TColour a) -> IO CInt
+foreign import ccall "wxColour_CreateFromUnsignedInt" colourCreateFromUnsi=
gnedInt :: Word -> IO (Ptr (TColour a))
+foreign import ccall "wxColour_GetUnsignedInt" colourGetUnsignedInt =
:: Ptr (TColour a) -> IO Word
foreign import ccall "wxColour_SafeDelete" colourSafeDelete :: Ptr (TCol=
our a) -> IO ()
foreign import ccall "wxColour_IsStatic" colourIsStatic :: Ptr (TColour =
a) -> Bool
foreign import ccall "wxColour_IsOk" colourIsOk :: Ptr (TColour a) ->=
IO CInt
}
Context:
[Remove unused wxWidgets 2.4 and 2.6's Visual Studio project files.
shelarcy <she...@gm...>**20090105012854
Ignore-this: 20cc431e49694e048d1d676170200ed6
] =
[TAG 0.11.0
shelarcy <she...@gm...>**20090102223052] =
Patch bundle hash:
c30e3f25c567fc8842b88ecfa6095530d6be49c9
--=_--
.
|