Changeset 323


Ignore:
Timestamp:
Mar 27, 2010, 12:15:53 PM (11 years ago)
Author:
dmik
Message:

branches/kmk: Implemented LuPopplerInputText? class.

Location:
branches/kmk/Lucide/plugins
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • branches/kmk/Lucide/plugins/ludoc/luifield.idl

    r319 r323  
    2929     * To be overriden. By default, returns NULL.
    3030     *
    31      * Note: the returned rectangle must be allocated using SOMMAlloc().
     31     * Note: the returned pointer must be valid until the object destriction.
    3232     */
    3333    LuRectangle *getRectangle();
  • branches/kmk/Lucide/plugins/lupoppler/Makefile.kmk

    r320 r323  
    1616lupoppler_NAME           = lupplr
    1717lupoppler_INCS           = \
    18         lupoppler                                                                 \
    1918        ../ludoc $(PATH_lupoppler)/../ludoc                                       \
    2019        ../../../poppler/mypoppler                                                \
  • branches/kmk/Lucide/plugins/lupoppler/lupifield.cpp

    r321 r323  
    5656
    5757
    58 SOM_Scope void SOMLINK LuPopplerInputField_init(LuPopplerInputField *somSelf,
    59                                                  Environment *ev,
    60                                                 somInitCtrl* ctrl,
    61                                                 FormWidget* aFormWidget)
     58SOM_Scope void SOMLINK init_widget(LuPopplerInputField *somSelf,
     59                                    Environment *ev, somInitCtrl* ctrl,
     60                                   FormWidget* aFormWidget)
    6261{
    6362    LuPopplerInputFieldData *somThis; /* set in BeginInitializer */
    6463    somInitCtrl globalCtrl;
    6564    somBooleanVector myMask;
    66     LuPopplerInputField_BeginInitializer_LuPopplerInputField_init;
     65    LuPopplerInputField_BeginInitializer_init_widget;
    6766
    6867    LuPopplerInputField_Init_LuInputField_somDefaultInit(somSelf, ctrl);
    6968
    7069    /* local LuPopplerInputField initialization code */
    71 printf("%s:%d\n", __PRETTY_FUNCTION__, __LINE__);
    7270
    73     somThis->data = aFormWidget;
     71    somThis->widget = aFormWidget;
     72    somThis->rect.x1 = 0.;
     73    somThis->rect.x2 = 0.;
     74    somThis->rect.y1 = 0.;
     75    somThis->rect.y2 = 0.;
    7476}
    7577
     
    8486
    8587    /* local LuPopplerInputField deinitialization code */
    86 printf("%s:%d\n", __PRETTY_FUNCTION__, __LINE__);
    8788
    8889    LuPopplerInputField_EndDestructor;
     
    9697
    9798    LuInputField_Type type = LuInputField_Undefined;
    98     switch( somThis->data->getType() ) {
     99    switch( somThis->widget->getType() ) {
    99100        case formButton:    type = LuInputField_Button; break;
    100101        case formText:      type = LuInputField_Text; break;
     
    112113    LuPopplerInputFieldData *somThis = LuPopplerInputFieldGetData(somSelf);
    113114
    114     LuRectangle *rect = (LuRectangle *)SOMMalloc( sizeof( LuRectangle ) );
    115 
    116     somThis->data->getRect(&rect->x1, &rect->y1, &rect->x2, &rect->y2);
    117 
    118     return rect;
     115    somThis->widget->getRect(&somThis->rect.x1, &somThis->rect.y1,
     116                             &somThis->rect.x2, &somThis->rect.y2);
     117    return &somThis->rect;
    119118}
    120119
     
    124123    LuPopplerInputFieldData *somThis = LuPopplerInputFieldGetData(somSelf);
    125124
    126     return somThis->data->getID();
     125    return somThis->widget->getID();
    127126}
    128127
     
    132131    LuPopplerInputFieldData *somThis = LuPopplerInputFieldGetData(somSelf);
    133132
    134     return somThis->data->isModified();
     133    return somThis->widget->isModified();
    135134}
    136135
     
    140139    LuPopplerInputFieldData *somThis = LuPopplerInputFieldGetData(somSelf);
    141140
    142     return somThis->data->isReadOnly();
     141    return somThis->widget->isReadOnly();
    143142}
    144143
  • branches/kmk/Lucide/plugins/lupoppler/lupifield.idl

    r321 r323  
    1313interface LuPopplerInputField : LuInputField
    1414{
    15     void LuPopplerInputField_init( inout somInitCtrl ctrl,
    16                                    in FormWidget aFormWidget );
     15    void init_widget( inout somInitCtrl ctrl, in FormWidget aFormWidget );
    1716
    1817#ifdef __SOMIDL__
     
    2019    implementation
    2120    {
    22         releaseorder: LuPopplerInputField_init;
     21        releaseorder: init_widget;
    2322
    24         LuPopplerInputField_init: init;
     23        init_widget: init;
    2524        somDestruct: override;
    2625
     
    3130        isReadOnly: override;
    3231
    33         FormWidget data;
     32        FormWidget widget;
     33        LuRectangle rect;
    3434
    3535        passthru C_h_before =  ""
  • branches/kmk/Lucide/plugins/lupoppler/lupitext.cpp

    r320 r323  
     1
     2/*
     3 *  This file was generated by the SOM Compiler.
     4 *  Generated using:
     5 *     SOM incremental update: 2.24
     6 */
     7
     8
    19/* ***** BEGIN LICENSE BLOCK *****
    210 * Version: CDDL 1.0/LGPL 2.1
     
    4856
    4957
     58SOM_Scope void SOMLINK init_widgetText(LuPopplerInputText *somSelf,
     59                                        Environment *ev, somInitCtrl* ctrl,
     60                                       FormWidgetText* aFormWidgetText)
     61{
     62    LuPopplerInputTextData *somThis; /* set in BeginInitializer */
     63    somInitCtrl globalCtrl;
     64    somBooleanVector myMask;
     65    LuPopplerInputText_BeginInitializer_init_widgetText;
     66
     67    LuPopplerInputText_Init_LuInputText_somDefaultInit(somSelf, ctrl);
     68    LuPopplerInputText_Init_LuPopplerInputField_init_widget(somSelf, ev, ctrl,
     69                                                            aFormWidgetText);
     70
     71    /* local LuPopplerInputField initialization code */
     72
     73    somThis->widget = aFormWidgetText;
     74    somThis->contents = NULL;
     75}
     76
     77
     78SOM_Scope void SOMLINK somDestruct(LuPopplerInputText *somSelf,
     79                                   octet doFree, som3DestructCtrl* ctrl)
     80{
     81    LuPopplerInputTextData *somThis; /* set in BeginDestructor */
     82    somDestructCtrl globalCtrl;
     83    somBooleanVector myMask;
     84    LuPopplerInputText_BeginDestructor;
     85
     86    /* local LuPopplerInputField deinitialization code */
     87
     88    LuPopplerInputText_EndDestructor;
     89}
     90
     91
    5092SOM_Scope string  SOMLINK getContents(LuPopplerInputText *somSelf,
    5193                                       Environment *ev)
    5294{
    5395    LuPopplerInputTextData *somThis = LuPopplerInputTextGetData(somSelf);
    54     LuPopplerInputTextMethodDebug("LuPopplerInputText","getContents");
    5596
    56     return (LuPopplerInputText_parent_LuInputText_getContents(somSelf,
    57                                                               ev));
     97    GooString *contents = somThis->widget->getContent();
     98    return contents->getCString();
    5899}
    59100
     
    62103{
    63104    LuPopplerInputTextData *somThis = LuPopplerInputTextGetData(somSelf);
    64     LuPopplerInputTextMethodDebug("LuPopplerInputText","setContents");
    65105
    66     LuPopplerInputText_parent_LuInputText_setContents(somSelf,
    67                                                       ev, aContents);
     106    GooString *contents = new GooString(aContents);
     107    somThis->widget->setContent(contents);
     108    delete contents;
    68109}
    69110
     
    72113{
    73114    LuPopplerInputTextData *somThis = LuPopplerInputTextGetData(somSelf);
    74     LuPopplerInputTextMethodDebug("LuPopplerInputText","isMultiLine");
    75115
    76     return (LuPopplerInputText_parent_LuInputText_isMultiLine(somSelf,
    77                                                               ev));
     116    return somThis->widget->isMultiline();
    78117}
    79118
     
    82121{
    83122    LuPopplerInputTextData *somThis = LuPopplerInputTextGetData(somSelf);
    84     LuPopplerInputTextMethodDebug("LuPopplerInputText","isPassword");
    85123
    86     return (LuPopplerInputText_parent_LuInputText_isPassword(somSelf,
    87                                                              ev));
     124    return somThis->widget->isPassword();
    88125}
    89126
     
    92129{
    93130    LuPopplerInputTextData *somThis = LuPopplerInputTextGetData(somSelf);
    94     LuPopplerInputTextMethodDebug("LuPopplerInputText","isFileName");
    95131
    96     return (LuPopplerInputText_parent_LuInputText_isFileName(somSelf,
    97                                                              ev));
     132    return somThis->widget->isFileSelect();
    98133}
    99134
     
    102137{
    103138    LuPopplerInputTextData *somThis = LuPopplerInputTextGetData(somSelf);
    104     LuPopplerInputTextMethodDebug("LuPopplerInputText","isSpellCheckable");
    105139
    106     return (LuPopplerInputText_parent_LuInputText_isSpellCheckable(somSelf,
    107                                                                    ev));
     140    return !somThis->widget->noSpellCheck();
    108141}
    109142
     
    112145{
    113146    LuPopplerInputTextData *somThis = LuPopplerInputTextGetData(somSelf);
    114     LuPopplerInputTextMethodDebug("LuPopplerInputText","isScrollable");
    115147
    116     return (LuPopplerInputText_parent_LuInputText_isScrollable(somSelf,
    117                                                                ev));
     148    return !somThis->widget->noScroll();
    118149}
    119150
     
    122153{
    123154    LuPopplerInputTextData *somThis = LuPopplerInputTextGetData(somSelf);
    124     LuPopplerInputTextMethodDebug("LuPopplerInputText","isComb");
    125155
    126     return (LuPopplerInputText_parent_LuInputText_isComb(somSelf,
    127                                                          ev));
     156    return somThis->widget->isComb();
    128157}
    129158
     
    132161{
    133162    LuPopplerInputTextData *somThis = LuPopplerInputTextGetData(somSelf);
    134     LuPopplerInputTextMethodDebug("LuPopplerInputText","isRichText");
    135163
    136     return (LuPopplerInputText_parent_LuInputText_isRichText(somSelf,
    137                                                              ev));
     164    return somThis->widget->isRichText();
    138165}
    139166
     
    142169{
    143170    LuPopplerInputTextData *somThis = LuPopplerInputTextGetData(somSelf);
    144     LuPopplerInputTextMethodDebug("LuPopplerInputText","getMaximumLength");
    145171
    146     return (LuPopplerInputText_parent_LuInputText_getMaximumLength(somSelf,
    147                                                                    ev));
     172    return somThis->widget->getMaxLen();
    148173}
    149174
  • branches/kmk/Lucide/plugins/lupoppler/lupitext.idl

    r320 r323  
    33
    44#include <luitext.idl>
     5#include <lupifield.idl>
     6
     7interface FormWidgetText; // declared in poppler/Form.h
    58
    69/**
     
    912 * This interface exposes the FormWidgetText poppler class.
    1013 */
    11 interface LuPopplerInputText : LuInputText
     14interface LuPopplerInputText : LuInputText, LuPopplerInputField
    1215{
     16    void init_widgetText( inout somInitCtrl ctrl,
     17               in FormWidgetText aFormWidgetText );
    1318
    1419#ifdef __SOMIDL__
     
    1621    implementation
    1722    {
     23        releaseorder: init_widgetText;
     24
     25        init_widgetText: init;
     26        somDestruct: override;
     27
    1828        getContents: override;
    1929        setContents: override;
     
    2737        getMaximumLength: override;
    2838
    29         string mContents;
    30         boolean mIsMultiLine;
    31         boolean mIsPassword;
    32         boolean mIsFileSelect;
    33         boolean mIsSpellCheckable;
    34         boolean mIsScrollable;
    35         boolean mIsComb;
    36         boolean mIsRichText;
    37         long mMaximumLength;
     39        FormWidgetText widget;
     40        string contents;
     41
     42        passthru C_h_before =  ""
     43            ""
     44            "#include <Form.h>"
     45            "";
     46
     47        passthru C_xh_before =  ""
     48            ""
     49            "#include <Form.h>"
     50            "";
    3851    };
    3952
Note: See TracChangeset for help on using the changeset viewer.