liberipc/src/eripceba.c File Reference

#include <stdio.h>
#include <stddef.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <unistd.h>
#include "eripc.h"
#include "eripcclient.h"
#include "eripceba.h"
#include "eripcparser.h"

Go to the source code of this file.

Functions

int ebaJumpToPage (erClientChannel_t channel, int uaID, int page)
int ebaBookmarkPage (erClientChannel_t channel, int uaID)
int ebaInvokeFindDialog (erClientChannel_t channel, int uaID)
int ebaZoomIn (erClientChannel_t channel, int uaID)
int ebaZoomOut (erClientChannel_t channel, int uaID)
int ebaParseCommand (char *szCommand, erIpcCmd_t *pCmd)
int ebaStore (erClientChannel_t channel, int uaID, int category, char *itemID)


Function Documentation

int ebaBookmarkPage ( erClientChannel_t  channel,
int  uaID 
)

Bookmark the currently displayed page in the viewer 'uaID'

Parameters:
channel Opaque datastructure that contains info on communication channel
uaID application identifier
Returns:
A value of 0 signals success

Definition at line 53 of file eripceba.c.

00054 {
00055     erIpcCmd_t cmd;
00056 
00057     strcpy(cmd.name, "ebaBookmarkPage");
00058     cmd.cc = (int) ccEbaBookmarkPage;
00059     cmd.nArg = 1;
00060     sprintf(cmd.arg[0], "%d", uaID);
00061 
00062     return erIpcSndCommand(channel, &cmd);
00063 }

Here is the call graph for this function:

int ebaInvokeFindDialog ( erClientChannel_t  channel,
int  uaID 
)

Invoke the find dialog on viewer 'uaID'

Parameters:
channel Opaque datastructure that contains info on communication channel
uaID application identifier
Returns:
A value of 0 signals success

Definition at line 65 of file eripceba.c.

00066 {
00067     erIpcCmd_t cmd;
00068 
00069     strcpy(cmd.name, "ebaInvokeFindDialog");
00070     cmd.cc = (int) ccEbaInvokeFindDialog;
00071     cmd.nArg = 1;
00072     sprintf(cmd.arg[0], "%d", uaID);
00073 
00074     return erIpcSndCommand(channel, &cmd);
00075 }

Here is the call graph for this function:

int ebaJumpToPage ( erClientChannel_t  channel,
int  uaID,
int  page 
)

Copyright (C) 2005-2008 iRex Technologies B.V. All rights reserved.

Definition at line 40 of file eripceba.c.

00041 {
00042     erIpcCmd_t cmd;
00043 
00044     strcpy(cmd.name, "ebaJumpToPage");
00045     cmd.cc = (int) ccEbaJumpToPage;
00046     cmd.nArg = 2;
00047     sprintf(cmd.arg[0], "%d", uaID);
00048     sprintf(cmd.arg[1], "%d", page);
00049 
00050     return erIpcSndCommand(channel, &cmd);
00051 }

Here is the call graph for this function:

int ebaParseCommand ( char *  szCommand,
erIpcCmd_t pCmd 
)

Definition at line 104 of file eripceba.c.

00105 {
00106     int     i;
00107     char   *pChar;
00108     int     cmdcode;
00109     char    szToken[TB_MAXCHARONLINE];
00110     int     nReqArgs = 0;
00111 
00112     pCmd->cc = (int) ccEbaUndefined;
00113     for (i = 0; i < TB_N_ARG; i++)
00114     {
00115         strcpy(pCmd->arg[i], "");
00116     }
00117 
00118     // Parse Command
00119     pChar = szCommand;
00120     i = 0;
00121     while (*pChar != '\0')
00122     {
00123         szToken[i] = '\0';
00124         if (*pChar == ',')
00125         {
00126             pChar++;
00127             break;
00128         }
00129         szToken[i] = *pChar++;
00130         i++;
00131         szToken[i] = '\0';
00132     }
00133 
00134     // We have found the command Token. Figure out what the command is.
00135     // TODO: stop doing this hardcoded, rely on a smart datastructure instead.
00136 
00137     if (isdigit(szToken[0]))
00138     {
00139         cmdcode = atoi(szToken);
00140     }
00141     else
00142     {
00143         cmdcode = -1;
00144     }
00145     if (strcmp(szToken, "ebaJumpToPage") == 0  ||  cmdcode == ccEbaJumpToPage)
00146     {
00147         strcpy(pCmd->name, szToken);
00148         pCmd->cc = (int) ccEbaJumpToPage;
00149         nReqArgs = 2;
00150         pCmd->nArg = 2;
00151     }
00152     else if (strcmp(szToken, "ebaBookmarkPage") == 0  ||  cmdcode == ccEbaBookmarkPage)
00153     {
00154         strcpy(pCmd->name, szToken);
00155         pCmd->cc = (int) ccEbaBookmarkPage;
00156         nReqArgs = 1;
00157         pCmd->nArg = 1;
00158     }
00159     else if (strcmp(szToken, "ebaInvokeFindDialog") == 0  ||  cmdcode == ccEbaInvokeFindDialog)
00160     {
00161         strcpy(pCmd->name, szToken);
00162         pCmd->cc = (int) ccEbaInvokeFindDialog;
00163         nReqArgs = 1;
00164         pCmd->nArg = 1;
00165     }
00166     else if (strcmp(szToken, "ebaZoomIn") == 0  ||  cmdcode == ccEbaZoomIn)
00167     {
00168         strcpy(pCmd->name, szToken);
00169         pCmd->cc = (int) ccEbaZoomIn;
00170         nReqArgs = 1;
00171         pCmd->nArg = 1;
00172     }
00173     else if (strcmp(szToken, "ebaZoomOut") == 0  ||  cmdcode == ccEbaZoomOut)
00174     {
00175         strcpy(pCmd->name, szToken);
00176         pCmd->cc = (int) ccEbaZoomOut;
00177         nReqArgs = 1;
00178         pCmd->nArg = 1;
00179     }
00180     else if (strcmp(szToken, "ebaStore") == 0  ||  cmdcode == ccEbaStore)
00181     {
00182         strcpy(pCmd->name, szToken);
00183         pCmd->cc = (int) ccEbaStore;
00184         nReqArgs = 3;
00185         pCmd->nArg = 3;
00186     }
00187     else if (strcmp(szToken, "ebaToolbar") == 0  ||  cmdcode == ccEbaToolbar)
00188     {
00189         strcpy(pCmd->name, szToken);
00190         pCmd->cc = (int) ccEbaToolbar;
00191         nReqArgs = 2;
00192         pCmd->nArg = 2;
00193     }
00194     else
00195     {
00196         strcpy(pCmd->name, "Undefined");
00197         pCmd->cc = (int) ccEbaUndefined;
00198         fprintf(stderr, "%s: Command %s \n", __FUNCTION__, szToken);
00199         fprintf(stderr, "Error parsing (%s). Command undefined\n", szCommand);
00200         pCmd->nArg = -1;
00201         return -1;
00202     }
00203 
00204     if (nReqArgs > 0)
00205     {
00206         erIpcGetArgs(pChar, pCmd, nReqArgs);
00207     }
00208     return 0;
00209 }

Here is the call graph for this function:

int ebaStore ( erClientChannel_t  channel,
int  uaID,
int  category,
char *  itemID 
)

Store the currently displayed page of viewer 'uaID'

Parameters:
channel Opaque datastructure that contains info on communication channel
uaID application identifier
category identifier
itemID - null terminated string - unique item ID of the currently displayed content
Returns:
A value of 0 signals success

Definition at line 211 of file eripceba.c.

00212 {
00213     erIpcCmd_t cmd;
00214 
00215     strcpy(cmd.name, "ebaStore");
00216     cmd.cc = (int) ccEbaStore;
00217     cmd.nArg = 3;
00218     sprintf(cmd.arg[0], "%d", uaID);
00219     sprintf(cmd.arg[1], "%d", category);
00220         
00221         if ((itemID) && (strlen(itemID) < TB_ARGLENGTH))
00222         {
00223                 strncpy(cmd.arg[2], itemID, TB_ARGLENGTH);
00224         }
00225         else
00226         {
00227             sprintf(cmd.arg[2],"%s", "");
00228             fprintf(stderr, "Command %s \n", cmd.name);
00229                 fprintf(stderr, "invalid itemID (%s)\n", itemID);
00230         }
00231 
00232     return erIpcSndCommand(channel, &cmd);      
00233 }

Here is the call graph for this function:

int ebaZoomIn ( erClientChannel_t  channel,
int  uaID 
)

Zoom in on the currently displayed page of viewer 'uaID'

Parameters:
channel Opaque datastructure that contains info on communication channel
uaID application identifier
Returns:
A value of 0 signals success

Definition at line 77 of file eripceba.c.

00078 {
00079     erIpcCmd_t cmd;
00080 
00081     strcpy(cmd.name, "ebaZoomIn");
00082     cmd.cc = (int) ccEbaZoomIn;
00083     cmd.nArg = 1;
00084     sprintf(cmd.arg[0], "%d", uaID);
00085 
00086     return erIpcSndCommand(channel, &cmd);
00087 }

Here is the call graph for this function:

int ebaZoomOut ( erClientChannel_t  channel,
int  uaID 
)

Zoom out on the currently displayed page of viewer 'uaID'

Parameters:
channel Opaque datastructure that contains info on communication channel
uaID application identifier
Returns:
A value of 0 signals success

Definition at line 89 of file eripceba.c.

00090 {
00091     erIpcCmd_t cmd;
00092 
00093     strcpy(cmd.name, "ebaZoomOut");
00094     cmd.cc = (int) ccEbaZoomOut;
00095     cmd.nArg = 1;
00096     sprintf(cmd.arg[0], "%d", uaID);
00097 
00098     return erIpcSndCommand(channel, &cmd);
00099 }

Here is the call graph for this function:


Generated on Sun Dec 14 17:11:43 2008 by  doxygen 1.5.6