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.