PalmFiction
RulesRules  FAQFAQ  SearchSearch 
RSS-feedRSS-feed  RegisterRegister  Log inLog in
Forum index » English » Dictionary word lookup

Post new topicReply to topic View previous topicPrint ViewView next topic 
Author Message
jakewalk



Joined: 26 Jan 2006
Posts: 3
PostPosted: 04.10.06 10:40 Reply with quoteBack to top

Hi,

will it some day be possible to lookup a word in a dictionary from within palmfiction without exiting the program?

Many dictionaries have a resident function which work like that, but when I read in fullscreen mode I have to return to normal mode, make a pen stroke and launch the resident module.

Something similar to this would be nice:

http://www.prussfamily.us/PPI.html

jakewalk

 89.53.112.* View user's profileSend private messageVisit poster's website
alexhemp



Joined: 29 Oct 2004
Posts: 820
PostPosted: 04.10.06 14:09 Reply with quoteBack to top

What functionality present in PalmFiction about year or more.

See in "Tune Profile" on "Selection" Tab.


_________________
Palm Tungsten|T5
 213.59.94.* View user's profileSend private messageICQ Number
Yuval
Guest
Guest



PostPosted: 04.10.06 16:26 Reply with quoteBack to top

alexhemp - you are right, but so is jakewalk:

the PPI (Plucker's PlugIn) support custom launch codes (0x8000+ aka CustomBase...) that are common and compatible with some dictionary software (I use SlovoEd with great success - shows a little disposable window when loads).

With PalmFiction, the call to the external app is a normal launch code - SlovoEd (my configured app, shows as "Dictionary Engine") loads in full-blown mode, which is also slower.

Actually, I never cared much about it - PalmFiction was intelligent enough to have the "Return to PF when tap at home", which is a great and satisfying feature for me.

The only thing you should configure in SlovoEd (or other dictionaries maybe) for such methods to work smoothly, is to immediately show a translation for the clipboard on startup.

Having all the dictionary files on the RAM instead of the card, helps with the loading time too, of course :)

 83.130.142.*
alexhemp



Joined: 29 Oct 2004
Posts: 820
PostPosted: 04.10.06 18:54 Reply with quoteBack to top

Yuval

PPI must be supported in dictionary application.
SlovoEd has such support?


_________________
Palm Tungsten|T5
 213.59.94.* View user's profileSend private messageICQ Number
Yuval
Guest
Guest



PostPosted: 04.10.06 23:42 Reply with quoteBack to top

Not exactly - PPI simply supports the "CustomBase+" launch command codes, and it's appearantly how SlovoEd works in the background for its own resident option (took me a while to figure this out, but it simply worked).

For this option to work properly as I said, I think that both the PPI and the dictionary application should be configured to use the clipboard.

PalmFiction works great for me thanks to all of its surrounding features, even though it doesn't support this special launch code, so I never bothered to make a special request.

However, I understand that any feature requests are denied anyway now? I really hope it's not because of me and my problematic Hebrew support request that messed the last version a little...;)
Nevertheless, PalmFiction does a GREAT job now and it supports Hebrew quite flawlessly as far as I checked, thanks to the author's kind efforts.

 83.130.142.*
alexhemp



Joined: 29 Oct 2004
Posts: 820
PostPosted: 05.10.06 13:56 Reply with quoteBack to top

Slovoed Resident API not published.

Author asked for them but no response...


_________________
Palm Tungsten|T5
 213.59.94.* View user's profileSend private messageICQ Number
Yuval
Guest
Guest



PostPosted: 05.10.06 18:31 Reply with quoteBack to top

Maybe because they don't want to call it officialy an "API" - it's something internal of theirs for the resident feature. The reason it worked for me with PPI in the first try is probably sheer coincedence/luck of hitting the right custom launch code.

But then again, maybe it's not pure luck - I'm pretty certain that Dr. Alex Pruss knew what he was doing when he offered the custom launch method in PPI...;)

 83.130.142.*
alexhemp



Joined: 29 Oct 2004
Posts: 820
PostPosted: 06.10.06 20:39 Reply with quoteBack to top

PPI internals contains different API to popular dictionary engines.

Core function of PPI:
Code:


// .h file
typedef struct {
    Char       name[ dmDBNameLength ];
    AppType    type;
    UInt32     launchCmd;
    Boolean    toClipboard;
} LookupList;

typedef enum {
    TYPE_APP = 0,
    TYPE_DA,
    TYPE_CUSTOM
} AppType;



/* Started with sysAppLaunchCmdCustomBase, pass word to Dictionary */
/* System Globals and Static Variables are not available */
static Err LookupWord( MemPtr cmdPBP )
{
    LocalID      dbID = 0;
    Err          err = dmErrCantFind;
    UInt32       outputValue;
    Preferences  prefs;
    LookupList   lookupList[] =  {
                                   {"None", 0, 0, false },
                                   {"Custom", TYPE_CUSTOM, 0, false },
                                   {"RoadLingua", TYPE_APP,
                                     sysAppLaunchCmdCustomBase, false },
                                   {"KDIC DA", TYPE_DA, 0, true },
                                   {"BDicty", TYPE_APP,
                                     sysAppLaunchCmdCustomBase + 212, true },
                                   {"BDicty", TYPE_APP,
                                     sysAppLaunchCmdCustomBase + 212, false },
                                   {"SlovoEd", TYPE_APP,
                                     sysAppLaunchCmdCustomBase + 0, false },
                                 };



    ReadPrefs ( &prefs );
    if ( prefs.lookupAction == ( LookupWordActionType ) 0 )
        return errNone;

    if ( prefs.lookupAction != SELECT_WORD_CUSTOM ) {
        dbID = DmFindDatabase( 0, lookupList[ prefs.lookupAction ].name );
        if ( dbID == 0 )
            return err;
    }

    switch ( lookupList[ prefs.lookupAction ].type ) {
        case TYPE_APP:
            err = SysAppLaunch( 0, dbID, 0,
                                lookupList[ prefs.lookupAction ].launchCmd,
                                cmdPBP, &outputValue );
            break;

        case TYPE_DA:
            err = LaunchDa( dbID, ( Char* ) cmdPBP,
                            lookupList[ prefs.lookupAction ].toClipboard );
            break;

        case TYPE_CUSTOM:
            if ( 0 < StrLen( prefs.name ) ) {
                Char* text = ( Char* ) cmdPBP;

                dbID = DmFindDatabase( 0, prefs.name );
                if ( dbID == 0 )
                    return err;
                if ( prefs.isDA )
                    return LaunchDa( dbID, text, prefs.toClipboard );
                if ( prefs.toClipboard )
                    ClipboardAddItem( clipboardText, text, StrLen( text ) );
                err = SysAppLaunch( 0, dbID, 0, sysAppLaunchCmdCustomBase
                                    + prefs.launchCmd, cmdPBP, &outputValue );
            }
            break;

    }
    return err;
}

/* System Globals and Static Variables are not available */
/* Save UI info */
static Err LaunchDa( LocalID dbID, Char* word, Boolean toClipboard )
{
    DmOpenRef  db;
    MemHandle  handle;
    void       ( *da_entry )();
    Err        err = dmErrCantFind;
    FormPtr    saved_form;
    UInt16     saved_form_id;
    WinHandle  saved_active_win;
    WinHandle  saved_draw_win;
    FontID     saved_font;

    db = DmOpenDatabase( 0, dbID, dmModeReadOnly );
    if ( db != NULL ) {
        handle = DmGet1Resource( DA_RSRC_TYPE, DA_RSRC_ID );
        if ( handle != NULL ) {
            da_entry = MemHandleLock( handle );
            if ( da_entry != NULL ) {
                if ( toClipboard )
                    ClipboardAddItem( clipboardText, word, StrLen( word ) );
                saved_form = FrmGetActiveForm();
                saved_form_id = FrmGetActiveFormID();
                saved_active_win = WinGetActiveWindow();
                saved_draw_win = WinGetDrawWindow();
                saved_font = FntSetFont(stdFont);
                ( *da_entry )();
                MemHandleUnlock( handle );
                if (saved_form_id != 0)
                    FrmSetActiveForm(saved_form);
                WinSetActiveWindow(saved_active_win);
                WinSetDrawWindow(saved_draw_win);
                FntSetFont(saved_font);
                err = errNone;
            }
            DmReleaseResource( handle );
        }
        DmCloseDatabase( db );
    }
    return err;
}



_________________
Palm Tungsten|T5
 213.59.94.* View user's profileSend private messageICQ Number
PalmFiction



Joined: 25 Oct 2004
Posts: 454
PostPosted: 10.10.06 7:46 Reply with quoteBack to top

In version 0.14r you can customize eight application or DA for word lookup.
Parameter "To clipboard" - copy selected text to clipboard before start app or DA.
Parameter "CustomBase+" and digital value field - a) if checked - start app with launch code "sysAppLaunchCmdCustomBase+value", hiden for DA and work only if app contain resident module. b) if unchecked - switch using SysUIAppSwitch to this app and return to PF with press "Home" button. If PF in fullscreen mode, status bar restore and hide after return in PF.
PF support three predefined resident dictionary.
1. RoadLingua
2. BDicty
3. Slovoed (Multilex) - need configure in dictionary for using with PF.
In "Resident option" - check activation method "Command Bar Menu" and check "Use Clipboard to get text". In "Common option" - check "Paste on start". This is allow PF launch resident Slovoed (Multilex). My Multilex work in this mode and not work with sysAppLaunchCmdCustomBase. Maybe new version work, but I don't have this version.

 217.13.215.* View user's profileSend private message
bobo
Guest
Guest



PostPosted: 27.11.06 13:57 Reply with quoteBack to top

hi,

can I used this feature with MSDict also? it has a resident module.

bobo

 89.53.115.*
Display posts from previous      
Post new topicReply to topic
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

Rambler's Top100 SourceForge Logo