source: branches/kmk/Lucide/plugins/lupoppler/lupifield.cpp @ 324

Last change on this file since 324 was 324, checked in by dmik, 12 years ago

branches/kmk: DocumentViewer?: Change the cursor type to I-beam when over the input field.

  • Property svn:executable set to *
File size: 5.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/* ***** BEGIN LICENSE BLOCK *****
10 * Version: CDDL 1.0/LGPL 2.1
11 *
12 * The contents of this file are subject to the COMMON DEVELOPMENT AND
13 * DISTRIBUTION LICENSE (CDDL) Version 1.0 (the "License"); you may not use
14 * this file except in compliance with the License. You may obtain a copy of
15 * the License at http://www.sun.com/cddl/
16 *
17 * Software distributed under the License is distributed on an "AS IS" basis,
18 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
19 * for the specific language governing rights and limitations under the
20 * License.
21 *
22 * The Initial Developer of the Original Code is
23 * Dmitry A. Kuminov, netlabs.org.
24 * Portions created by the Initial Developer are Copyright (C) 2006
25 * the Initial Developer. All Rights Reserved.
26 *
27 * Contributor(s):
28 *
29 * Alternatively, the contents of this file may be used under the terms of
30 * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
31 * in which case the provisions of the LGPL are applicable instead of those
32 * above. If you wish to allow use of your version of this file only under the
33 * terms of the LGPL, and not to allow others to use your version of this file
34 * under the terms of the CDDL, indicate your decision by deleting the
35 * provisions above and replace them with the notice and other provisions
36 * required by the LGPL. If you do not delete the provisions above, a recipient
37 * may use your version of this file under the terms of any one of the CDDL
38 * or the LGPL.
39 *
40 * ***** END LICENSE BLOCK ***** */
41
42
43
44/*
45 *  This file was generated by the SOM Compiler and Emitter Framework.
46 *  Generated using template emitter:
47 *      SOM Emitter emitxtm: 2.23.1.9
48 */
49
50#ifndef SOM_Module_lupifield_Source
51#define SOM_Module_lupifield_Source
52#endif
53#define LuPopplerInputField_Class_Source
54
55#include "lupifield.xih"
56
57#include <Page.h>
58
59
60SOM_Scope void SOMLINK init_widget(LuPopplerInputField *somSelf,
61                                    Environment *ev, somInitCtrl* ctrl,
62                                   LuPopplerDocument* aDoc, long aPagenum,
63                                   Page* aPage, FormWidget* aFormWidget)
64{
65    LuPopplerInputFieldData *somThis; /* set in BeginInitializer */
66    somInitCtrl globalCtrl;
67    somBooleanVector myMask;
68    LuPopplerInputField_BeginInitializer_init_widget;
69
70    LuPopplerInputField_Init_LuInputField_somDefaultInit(somSelf, ctrl);
71
72    /* local LuPopplerInputField initialization code */
73
74    somThis->doc = aDoc;
75    somThis->pagenum = aPagenum;
76    somThis->page = aPage;
77    somThis->widget = aFormWidget;
78    somThis->rect.x1 = 0.;
79    somThis->rect.x2 = 0.;
80    somThis->rect.y1 = 0.;
81    somThis->rect.y2 = 0.;
82}
83
84
85SOM_Scope void SOMLINK somDestruct(LuPopplerInputField *somSelf,
86                                   octet doFree, som3DestructCtrl* ctrl)
87{
88    LuPopplerInputFieldData *somThis; /* set in BeginDestructor */
89    somDestructCtrl globalCtrl;
90    somBooleanVector myMask;
91    LuPopplerInputField_BeginDestructor;
92
93    /* local LuPopplerInputField deinitialization code */
94
95    LuPopplerInputField_EndDestructor;
96}
97
98
99SOM_Scope LuInputField_Type  SOMLINK getType(LuPopplerInputField *somSelf,
100                                              Environment *ev)
101{
102    LuPopplerInputFieldData *somThis = LuPopplerInputFieldGetData(somSelf);
103
104    LuInputField_Type type = LuInputField_Undefined;
105    switch( somThis->widget->getType() ) {
106        case formButton:    type = LuInputField_Button; break;
107        case formText:      type = LuInputField_Text; break;
108        case formChoice:    type = LuInputField_Choice; break;
109        case formSignature: type = LuInputField_Signature; break;
110        default: break;
111    }
112
113    return type;
114}
115
116SOM_Scope LuRectangle*  SOMLINK getRectangle(LuPopplerInputField *somSelf,
117                                              Environment *ev)
118{
119    LuPopplerInputFieldData *somThis = LuPopplerInputFieldGetData(somSelf);
120
121    somThis->widget->getRect( &somThis->rect.x1, &somThis->rect.y1,
122                              &somThis->rect.x2, &somThis->rect.y2 );
123
124    // see LuPopplerDocument::getLinkMapping()
125
126    double height = 0;
127    somThis->doc->getPageSize( ev, somThis->pagenum, NULL, &height );
128
129    somThis->rect.x1 -= somThis->page->getCropBox()->x1;
130    somThis->rect.x2 -= somThis->page->getCropBox()->x1;
131    somThis->rect.y1 -= somThis->page->getCropBox()->y1;
132    somThis->rect.y2 -= somThis->page->getCropBox()->y1;
133
134    double y1 = somThis->rect.y1;
135    double y2 = somThis->rect.y2;
136    somThis->rect.y1 = height - y2;
137    somThis->rect.y2 = height - y1;
138
139    return &somThis->rect;
140}
141
142SOM_Scope unsigned long  SOMLINK getID(LuPopplerInputField *somSelf,
143                                        Environment *ev)
144{
145    LuPopplerInputFieldData *somThis = LuPopplerInputFieldGetData(somSelf);
146
147    return somThis->widget->getID();
148}
149
150SOM_Scope boolean  SOMLINK isModified(LuPopplerInputField *somSelf,
151                                       Environment *ev)
152{
153    LuPopplerInputFieldData *somThis = LuPopplerInputFieldGetData(somSelf);
154
155    return somThis->widget->isModified();
156}
157
158SOM_Scope boolean  SOMLINK isReadOnly(LuPopplerInputField *somSelf,
159                                       Environment *ev)
160{
161    LuPopplerInputFieldData *somThis = LuPopplerInputFieldGetData(somSelf);
162
163    return somThis->widget->isReadOnly();
164}
165
Note: See TracBrowser for help on using the repository browser.