2 Copyright © 1995-2013, The AROS Development Team. All rights reserved.
5 Desc: Onscreen bitmap class for linux fb device
11 #include <aros/debug.h>
12 #include <aros/symbolsets.h>
13 #include <hidd/graphics.h>
14 #include <hidd/unixio.h>
16 #include <proto/oop.h>
17 #include <proto/utility.h>
23 #include "linuxfb_intern.h"
26 /*********** BitMap::New() *************************************/
28 OOP_Object
*LinuxBM__Root__New(OOP_Class
*cl
, OOP_Object
*o
, struct pRoot_New
*msg
)
30 o
= (OOP_Object
*)OOP_DoSuperMethod(cl
, o
, (OOP_Msg
) msg
);
31 D(bug("[LinuxBM] Created base bitmap %p\n", o
));
35 struct BitmapData
*data
= OOP_INST_DATA(cl
, o
);
38 data
->fbdev
= GetTagData(aHidd_LinuxFBBitmap_FBDevInfo
, -1, msg
->attrList
);
40 OOP_GetAttr(o
, aHidd_BitMap_PixFmt
, (IPTR
*)&pf
);
41 OOP_GetAttr(pf
, aHidd_PixFmt_BitsPerPixel
, &data
->bpp
);
47 BOOL
LinuxBM__Hidd_BitMap__SetColors(OOP_Class
*cl
, OOP_Object
*o
, struct pHidd_BitMap_SetColors
*msg
)
49 struct BitmapData
*data
= OOP_INST_DATA(cl
, o
);
51 if ((msg
->firstColor
+ msg
->numColors
) > (1 << (data
->bpp
)))
56 if (!OOP_DoSuperMethod(cl
, o
, (OOP_Msg
)msg
))
61 if (data
->fbdev
!= -1)
63 struct LinuxFB_staticdata
*fsd
= LSD(cl
);
66 for ( xc_i
= msg
->firstColor
, col_i
= 0;
67 col_i
< msg
->numColors
;
73 &msg
->colors
[col_i
].red
,
74 &msg
->colors
[col_i
].green
,
75 &msg
->colors
[col_i
].blue
,
76 &msg
->colors
[col_i
].alpha
79 Hidd_UnixIO_IOControlFile(fsd
->unixio
, data
->fbdev
, FBIOPUTCMAP
, &col
, NULL
);