View Single Post
Old 11-30-2009, 03:50 AM   #8
Max
Connoisseur
Max has a complete set of Star Wars action figures.Max has a complete set of Star Wars action figures.Max has a complete set of Star Wars action figures.Max has a complete set of Star Wars action figures.
 
Max's Avatar
 
Posts: 79
Karma: 380
Join Date: Mar 2008
Location: Girona, Spain
Device: iLiad, DR1000s
Post

In the ipdf app. the events in the toolbar buttons are send to the ipcCbk function. You set the call back function with:

Code:
       erIpcChannel = channel;           
       int fd = erIpcGetServerFd(channel); 
         
       gdk_input_add (fd, 
                              GDK_INPUT_READ, 
                              (GdkInputFunction) ipcCbk, 
                              (gpointer) this);
when you set a icon the last parameter is a code send to de ipcCbk when you click on the icon. then you can set a icon like:

Code:
tbAppendPlatformIcon(  ertoolbarChannel, ER_PDF_VIEWER_UA_ID, iconID_pan, ccVwrToolbar);
and in the ipcCbk do:

Code:
void IliadToolbar::ipcCbk(gpointer client_data, gint *fd, GdkInputCondition id) 
{ 
         
         IliadToolbar *toolBar = (IliadToolbar *) client_data; 
         char szBuffer[IPC_BUF_MAX]; 
         int nBuf = IPC_BUF_MAX; 
         erIpcCmd_t command; 
         erServerChannel_t channel = toolBar->erIpcChannel; 
         erIpcGetMessage(channel, szBuffer, &nBuf); 
         if (vwrParseCommand(szBuffer, &command) >= 0) 
         { 
                 switch (command.cc) 
                 { 
                         case ccVwrToolbar:
In when ccVwrToolbar is recibed ipdf check the icon name to decide the action to take.

As how you show/hide the keyboar you can see the settings app code in:

http://iliad.hpelbers.org/irexdox/se...735f93a6ced14a

the method show_keyboard.
Max is offline   Reply With Quote