source: trunk/Lucide/SOURCE/plugins/ludoc/lupixbuf.cpp @ 27

Last change on this file since 27 was 27, checked in by Eugene Romanenko, 15 years ago

poppler updated to version 0.5.2, also needed changes to be compatible with new poppler

File size: 3.5 KB
Line 
1
2/*
3 *  This file was generated by the SOM Compiler.
4 *  Generated using:
5 *     SOM incremental update: 2.24
6 */
7
8
9/*
10 *  This file was generated by the SOM Compiler and Emitter Framework.
11 *  Generated using template emitter:
12 *      SOM Emitter emitxtm: 2.23.1.9
13 */
14
15#ifndef SOM_Module_lupixbuf_Source
16#define SOM_Module_lupixbuf_Source
17#endif
18#define LuPixbuf_Class_Source
19
20#include "lupixbuf.xih"
21
22
23
24/*
25 * SOM_Scope void SOMLINK LuPixbufInit(LuPixbuf *somSelf,  Environment *ev,
26 *                                     somInitCtrl* ctrl, long w, long h)
27 */
28
29/*
30 * The prototype for LuPixbufInit was replaced by the following prototype:
31 */
32SOM_Scope void SOMLINK LuPixbufInit(LuPixbuf *somSelf,  Environment *ev, 
33                                    somInitCtrl* ctrl, long w, 
34                                    long h, short bpp)
35{
36    LuPixbufData *somThis;
37    somInitCtrl globalCtrl;
38    somBooleanVector myMask;
39    LuPixbuf_BeginInitializer_LuPixbufInit;
40    LuPixbuf_Init_SOMObject_somDefaultInit(somSelf, ctrl);
41
42    // local LuPixbuf initialization code
43    somThis->width = w;
44    somThis->height = h;
45    somThis->bpp = bpp;
46    somThis->rowsize = ( somThis->width * somThis->bpp );
47    if ( bpp != 4 ) {
48            somThis->rowsize = (somThis->rowsize + 3) &~3;
49        }
50    somThis->dlen = somThis->rowsize * somThis->height;
51    somThis->data = new char[ somThis->dlen ];
52    memset( somThis->data, 0xff, somThis->dlen );
53}
54
55
56SOM_Scope long  SOMLINK getWidth(LuPixbuf *somSelf,  Environment *ev)
57{
58    LuPixbufData *somThis = LuPixbufGetData(somSelf);
59    return somThis->width;
60}
61
62SOM_Scope long  SOMLINK getHeight(LuPixbuf *somSelf,  Environment *ev)
63{
64    LuPixbufData *somThis = LuPixbufGetData(somSelf);
65    return somThis->height;
66}
67
68SOM_Scope short  SOMLINK getBpp(LuPixbuf *somSelf,  Environment *ev)
69{
70    LuPixbufData *somThis = LuPixbufGetData(somSelf);
71    return somThis->bpp;
72}
73
74SOM_Scope long  SOMLINK getRowSize(LuPixbuf *somSelf,  Environment *ev)
75{
76    LuPixbufData *somThis = LuPixbufGetData(somSelf);
77    return somThis->rowsize;
78}
79
80SOM_Scope long  SOMLINK getDataLen(LuPixbuf *somSelf,  Environment *ev)
81{
82    LuPixbufData *somThis = LuPixbufGetData(somSelf);
83    return somThis->dlen;
84}
85
86SOM_Scope void*  SOMLINK getDataPtr(LuPixbuf *somSelf,  Environment *ev)
87{
88    LuPixbufData *somThis = LuPixbufGetData(somSelf);
89    return somThis->data;
90}
91
92SOM_Scope void  SOMLINK putAt(LuPixbuf *somSelf,  Environment *ev,
93                              LuPixbuf* p, long x, long y)
94{
95    LuPixbufData *somThis = LuPixbufGetData(somSelf);
96    int xlen = __min( somThis->width - x, p->getWidth( ev ) ) * somThis->bpp;
97    int ylen = __min( somThis->height - y, p->getHeight( ev ) );
98    int rowstribe = p->getRowSize( ev );
99    char *fromdt = (char *)p->getDataPtr( ev );
100    char *todt = (char *)somThis->data + ( somThis->rowsize * y );
101    for ( int i = 0; i < ylen; i++ )
102    {
103        char *from = fromdt + ( i * rowstribe );
104        char *to = todt + ( i * somThis->rowsize ) + ( x * somThis->bpp );
105        memcpy( to, from, xlen );
106    }
107}
108
109SOM_Scope void SOMLINK somDestruct(LuPixbuf *somSelf, octet doFree,
110                                   som3DestructCtrl* ctrl)
111{
112    LuPixbufData *somThis;
113    somDestructCtrl globalCtrl;
114    somBooleanVector myMask;
115    LuPixbuf_BeginDestructor;
116
117    // local LuPixbuf deinitialization code
118    delete somThis->data;
119    // local LuPixbuf deinitialization code end
120
121    LuPixbuf_EndDestructor;
122}
123
124
Note: See TracBrowser for help on using the repository browser.