[327] | 1 | |
---|
| 2 | /* |
---|
| 3 | * This file was generated by the SOM Compiler. |
---|
| 4 | * Generated using: |
---|
| 5 | * SOM incremental update: 2.24 |
---|
| 6 | */ |
---|
| 7 | |
---|
| 8 | |
---|
[320] | 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 |
---|
[492] | 23 | * Dmitriy Kuminov, netlabs.org. |
---|
[320] | 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_lupibutton_Source |
---|
| 51 | #define SOM_Module_lupibutton_Source |
---|
| 52 | #endif |
---|
| 53 | #define LuPopplerInputButton_Class_Source |
---|
| 54 | |
---|
| 55 | #include "lupibutton.xih" |
---|
| 56 | |
---|
| 57 | |
---|
[327] | 58 | SOM_Scope void SOMLINK init_widgetButton(LuPopplerInputButton *somSelf, |
---|
| 59 | Environment *ev, somInitCtrl* ctrl, |
---|
| 60 | LuPopplerDocument* aDoc, |
---|
| 61 | long aPagenum, Page* aPage, |
---|
| 62 | FormWidgetButton* aFormWidgetButton) |
---|
| 63 | { |
---|
| 64 | LuPopplerInputButtonData *somThis; /* set in BeginInitializer */ |
---|
| 65 | somInitCtrl globalCtrl; |
---|
| 66 | somBooleanVector myMask; |
---|
| 67 | LuPopplerInputButton_BeginInitializer_init_widgetButton; |
---|
| 68 | |
---|
| 69 | LuPopplerInputButton_Init_LuPopplerInputField_init_widget(somSelf, ev, ctrl, |
---|
| 70 | aDoc, aPagenum, aPage, |
---|
| 71 | aFormWidgetButton); |
---|
| 72 | LuPopplerInputButton_Init_LuInputButton_somDefaultInit(somSelf, ctrl); |
---|
| 73 | |
---|
| 74 | /* local LuPopplerInputField initialization code */ |
---|
| 75 | |
---|
| 76 | somThis->widget = aFormWidgetButton; |
---|
| 77 | } |
---|
| 78 | |
---|
| 79 | |
---|
| 80 | SOM_Scope void SOMLINK somDestruct(LuPopplerInputButton *somSelf, |
---|
| 81 | octet doFree, som3DestructCtrl* ctrl) |
---|
| 82 | { |
---|
| 83 | LuPopplerInputButtonData *somThis; /* set in BeginDestructor */ |
---|
| 84 | somDestructCtrl globalCtrl; |
---|
| 85 | somBooleanVector myMask; |
---|
| 86 | LuPopplerInputButton_BeginDestructor; |
---|
| 87 | |
---|
| 88 | /* local LuPopplerInputField deinitialization code */ |
---|
| 89 | |
---|
| 90 | LuPopplerInputButton_EndDestructor; |
---|
| 91 | } |
---|
| 92 | |
---|
| 93 | |
---|
[320] | 94 | SOM_Scope LuInputButton_ButtonType SOMLINK getButtonType(LuPopplerInputButton *somSelf, |
---|
| 95 | Environment *ev) |
---|
| 96 | { |
---|
| 97 | LuPopplerInputButtonData *somThis = LuPopplerInputButtonGetData(somSelf); |
---|
| 98 | |
---|
[327] | 99 | LuInputButton_ButtonType type = LuInputButton_Undefined; |
---|
| 100 | |
---|
| 101 | switch ( somThis->widget->getButtonType() ) { |
---|
| 102 | case formButtonCheck: type = LuInputButton_Check; break; |
---|
| 103 | case formButtonPush: type = LuInputButton_Push; break; |
---|
| 104 | case formButtonRadio: type = LuInputButton_Radio; break; |
---|
| 105 | default: |
---|
| 106 | break; |
---|
| 107 | } |
---|
| 108 | |
---|
| 109 | return type; |
---|
[320] | 110 | } |
---|
| 111 | |
---|
| 112 | SOM_Scope boolean SOMLINK getState(LuPopplerInputButton *somSelf, |
---|
| 113 | Environment *ev) |
---|
| 114 | { |
---|
| 115 | LuPopplerInputButtonData *somThis = LuPopplerInputButtonGetData(somSelf); |
---|
| 116 | |
---|
[327] | 117 | return somThis->widget->getState(); |
---|
[320] | 118 | } |
---|
| 119 | |
---|
| 120 | SOM_Scope void SOMLINK setState(LuPopplerInputButton *somSelf, |
---|
| 121 | Environment *ev, boolean aState) |
---|
| 122 | { |
---|
| 123 | LuPopplerInputButtonData *somThis = LuPopplerInputButtonGetData(somSelf); |
---|
| 124 | |
---|
[327] | 125 | somThis->widget->setState( aState ); |
---|
[320] | 126 | } |
---|
| 127 | |
---|
| 128 | SOM_Scope string SOMLINK getText(LuPopplerInputButton *somSelf, |
---|
| 129 | Environment *ev) |
---|
| 130 | { |
---|
| 131 | LuPopplerInputButtonData *somThis = LuPopplerInputButtonGetData(somSelf); |
---|
| 132 | |
---|
[327] | 133 | return somThis->widget->getOnStr(); |
---|
[320] | 134 | } |
---|
| 135 | |
---|
| 136 | SOM_Scope LuInputButton_SiblingSequence* SOMLINK getSiblings(LuPopplerInputButton *somSelf, |
---|
| 137 | Environment *ev) |
---|
| 138 | { |
---|
| 139 | LuPopplerInputButtonData *somThis = LuPopplerInputButtonGetData(somSelf); |
---|
| 140 | |
---|
[520] | 141 | // int count = somThis->widget->getNumSiblingsID(); |
---|
| 142 | int count = 0; |
---|
[327] | 143 | |
---|
| 144 | LuInputButton_SiblingSequence* siblings = (LuInputButton_SiblingSequence *) |
---|
| 145 | SOMMalloc( sizeof( LuInputButton_SiblingSequence ) ); |
---|
| 146 | siblings->_maximum = count; |
---|
| 147 | siblings->_length = count; |
---|
| 148 | siblings->_buffer = (unsigned long *)SOMMalloc( sizeof( unsigned long * ) * count ); |
---|
| 149 | |
---|
[520] | 150 | // unsigned *ids = somThis->widget->getSiblingsID(); |
---|
| 151 | unsigned *ids = 0; |
---|
[327] | 152 | for ( int i = 0; i < count; ++i ) |
---|
| 153 | siblings->_buffer[ i ] = ids[ i ]; |
---|
| 154 | |
---|
| 155 | return siblings; |
---|
[320] | 156 | } |
---|
| 157 | |
---|