Thread: iLiad mrxvt ported to iLiad
View Single Post
Old 11-12-2006, 05:31 PM   #4
scotty1024
Banned
scotty1024 is no ebook tyro.scotty1024 is no ebook tyro.scotty1024 is no ebook tyro.scotty1024 is no ebook tyro.scotty1024 is no ebook tyro.scotty1024 is no ebook tyro.scotty1024 is no ebook tyro.scotty1024 is no ebook tyro.scotty1024 is no ebook tyro.scotty1024 is no ebook tyro.
 
Posts: 1,300
Karma: 1479
Join Date: Jul 2006
Location: Peoples Republic of Washington
Device: Reader / iPhone / Librie / Kindle
The bits and pieces

You need the following includes:

Code:
#include <liberdm/erdm.h>
#include <liberipc/eripcviewer.h>
#include <liberipc/eripctoolbar.h>
#include <liberipc/eripcbusyd.h>
The following globals

Code:
erClientChannel_t erbusyChannel;
erClientChannel_t ertoolbarChannel;
This bit of code turns off the LED.

Code:
    // Turn off busy LED if we were invoked via [SHELL]
    erIpcStartClient(ER_BUSYD_CHANNEL, &erbusyChannel);
    busySetBusy(erbusyChannel, ccBusyState_Off);
This bit of code enables and then pops up the keyboard.

Code:
    erIpcStartClient(ER_TOOLBAR_CHANNEL, &ertoolbarChannel);
    tbSelectIconSet(ertoolbarChannel, ER_PDF_VIEWER_UA_ID);
    tbClearIconSet(ertoolbarChannel, ER_PDF_VIEWER_UA_ID);

    // Turn off trashcan
    tbAppendPlatformIcon(  ertoolbarChannel, ER_PDF_VIEWER_UA_ID, iconID_trashcan, -1);
    tbSetStatePlatformIcon(ertoolbarChannel, ER_PDF_VIEWER_UA_ID, iconID_trashcan, iconState_grey );

    // Enable then pop up keyboard
    tbAppendPlatformIcon(  ertoolbarChannel, ER_PDF_VIEWER_UA_ID, iconID_keyboard, -1);
    tbSetStatePlatformIcon(ertoolbarChannel, ER_PDF_VIEWER_UA_ID, iconID_keyboard, iconState_selected);
This bit of code labels the main window so Matchbox treats it as a Dialog and lets it set its own size (and brings it to front).

Code:
Atom window_type = XInternAtom(r->Xdisplay,
                               "_NET_WM_WINDOW_TYPE_DIALOG",
                               False);
XChangeProperty(r->Xdisplay,
                r->TermWin.parent,
                XInternAtom(r->Xdisplay, "_NET_WM_WINDOW_TYPE", False),
                XA_ATOM,
                32,
                PropModeReplace,
                (unsigned char*)&window_type, 1);
This bit of code flashes the screen black to do as ghost-less a refresh as possible

Code:
    // Full Refresh, chase off all the ghosts
    dmDisplay(dmCmdPriorUrgent, dmQFull);
This bit of code refreshes the screen without the black flash. It works much better for UI work such as that in mrxvt.

Code:
        dmDisplay(dmCmdPriorUrgent, dmQTyping);
To make the keyboard go away when you are done with it (or exiting mrxvt).

Code:
    extern erClientChannel_t ertoolbarChannel;

    // close keyboard
    tbSetStatePlatformIcon(ertoolbarChannel, ER_PDF_VIEWER_UA_ID, iconID_keyboard, iconState_normal);
And to link you need the following libraries.

Code:
-lerdm -leripc

Last edited by scotty1024; 11-12-2006 at 08:56 PM. Reason: Added library linkages and Matchbox WM code
scotty1024 is offline   Reply With Quote