#include "eripcclient.h"
Go to the source code of this file.
Enumerations | |
enum | eCcVwr { ccVwrJumpToPage = 0, ccVwrBookmarkPage, ccVwrInvokeFindDialog, ccVwrZoomIn, ccVwrZoomOut, ccVwrStore, ccVwrToolbar, ccVwrToolbarSync, ccVwrPagebarSync, ccVwrUndefined } |
Functions | |
int | vwrParseCommand (char *szCommand, erIpcCmd_t *pCmd) |
int | vwrJumpToPage (erClientChannel_t channel, int uaID, int page) |
int | vwrBookmarkPage (erClientChannel_t channel, int uaID) |
int | vwrInvokeFindDialog (erClientChannel_t channel, int uaID) |
int | vwrZoomIn (erClientChannel_t channel, int uaID) |
int | vwrZoomOut (erClientChannel_t channel, int uaID) |
int | vwrStore (erClientChannel_t channel, int uaID, int category, char *itemID) |
<File description>="">
Definition in file eripcviewer.h.
enum eCcVwr |
ccVwrJumpToPage | |
ccVwrBookmarkPage | |
ccVwrInvokeFindDialog | |
ccVwrZoomIn | |
ccVwrZoomOut | |
ccVwrStore | |
ccVwrToolbar | |
ccVwrToolbarSync | |
ccVwrPagebarSync | |
ccVwrUndefined |
Definition at line 41 of file eripcviewer.h.
00041 { 00042 ccVwrJumpToPage = 0, 00043 ccVwrBookmarkPage, 00044 ccVwrInvokeFindDialog, 00045 ccVwrZoomIn, 00046 ccVwrZoomOut, 00047 ccVwrStore, 00048 ccVwrToolbar, // previously ccVwrSignal, 00049 ccVwrToolbarSync, 00050 ccVwrPagebarSync, 00051 ccVwrUndefined 00052 } eCcVwr;
int vwrBookmarkPage | ( | erClientChannel_t | channel, | |
int | uaID | |||
) |
Bookmark the currently displayed page in the viewer 'uaID'
channel | Opaque datastructure that contains info on communication channel | |
uaID | application identifier |
Definition at line 67 of file eripcviewer.c.
00068 { 00069 erIpcCmd_t cmd; 00070 00071 strcpy(cmd.name, "vwrBookmarkPage"); 00072 cmd.cc = (int) ccVwrBookmarkPage; 00073 cmd.nArg = 1; 00074 sprintf(cmd.arg[0], "%d", uaID); 00075 00076 return erIpcSndCommand(channel, &cmd); 00077 }
int vwrInvokeFindDialog | ( | erClientChannel_t | channel, | |
int | uaID | |||
) |
Invoke the find dialog on viewer 'uaID'
channel | Opaque datastructure that contains info on communication channel | |
uaID | application identifier |
Definition at line 79 of file eripcviewer.c.
00080 { 00081 erIpcCmd_t cmd; 00082 00083 strcpy(cmd.name, "vwrInvokeFindDialog"); 00084 cmd.cc = (int) ccVwrInvokeFindDialog; 00085 cmd.nArg = 1; 00086 sprintf(cmd.arg[0], "%d", uaID); 00087 00088 return erIpcSndCommand(channel, &cmd); 00089 }
int vwrJumpToPage | ( | erClientChannel_t | channel, | |
int | uaID, | |||
int | page | |||
) |
Sends a signal to a viewer
channel | Opaque datastructure that contains info on communication channel | |
uaID | application identifier | |
signal | signal |
channel | Opaque datastructure that contains info on communication channel | |
uaID | application identifier | |
page | page number |
strcpy(cmd.name, "vwrSignal"); cmd.cc = (int) ccVwrSignal; cmd.nArg = 2; sprintf(cmd.arg[0], "%d", uaID); sprintf(cmd.arg[1], "%d", signal);
return erIpcSndCommand(channel, &cmd); } Outdated
Definition at line 54 of file eripcviewer.c.
00055 { 00056 erIpcCmd_t cmd; 00057 00058 strcpy(cmd.name, "vwrJumpToPage"); 00059 cmd.cc = (int) ccVwrJumpToPage; 00060 cmd.nArg = 2; 00061 sprintf(cmd.arg[0], "%d", uaID); 00062 sprintf(cmd.arg[1], "%d", page); 00063 00064 return erIpcSndCommand(channel, &cmd); 00065 }
int vwrParseCommand | ( | char * | szCommand, | |
erIpcCmd_t * | pCmd | |||
) |
Outdated: replaced by vwrToolbar ** else if (strcmp(szToken, "vwrSignal") == 0 || cmdcode == ccVwrSignal) { strcpy(pCmd->name, szToken); pCmd->cc = (int) ccVwrSignal; nReqArgs = 2; pCmd->nArg = 2; } Outdated
Definition at line 118 of file eripcviewer.c.
00119 { 00120 int i; 00121 char *pChar; 00122 int cmdcode; 00123 char szToken[TB_MAXCHARONLINE]; 00124 int nReqArgs = 0; 00125 00126 pCmd->cc = (int) ccVwrUndefined; 00127 for (i = 0; i < TB_N_ARG; i++) 00128 { 00129 strcpy(pCmd->arg[i], ""); 00130 } 00131 00132 // Parse Command 00133 pChar = szCommand; 00134 i = 0; 00135 while (*pChar != '\0') 00136 { 00137 szToken[i] = '\0'; 00138 if (*pChar == ',') 00139 { 00140 pChar++; 00141 break; 00142 } 00143 szToken[i] = *pChar++; 00144 i++; 00145 szToken[i] = '\0'; 00146 } 00147 00148 // We have found the command Token. Figure out what the command is. 00149 // TODO: stop doing this hardcoded, rely on a smart datastructure instead. 00150 00151 if (isdigit(szToken[0])) 00152 { 00153 cmdcode = atoi(szToken); 00154 } 00155 else 00156 { 00157 cmdcode = -1; 00158 } 00159 if (strcmp(szToken, "vwrJumpToPage") == 0 || cmdcode == ccVwrJumpToPage) 00160 { 00161 strcpy(pCmd->name, szToken); 00162 pCmd->cc = (int) ccVwrJumpToPage; 00163 nReqArgs = 2; 00164 pCmd->nArg = 2; 00165 } 00166 else if (strcmp(szToken, "vwrBookmarkPage") == 0 || cmdcode == ccVwrBookmarkPage) 00167 { 00168 strcpy(pCmd->name, szToken); 00169 pCmd->cc = (int) ccVwrBookmarkPage; 00170 nReqArgs = 1; 00171 pCmd->nArg = 1; 00172 } 00173 else if (strcmp(szToken, "vwrInvokeFindDialog") == 0 || cmdcode == ccVwrInvokeFindDialog) 00174 { 00175 strcpy(pCmd->name, szToken); 00176 pCmd->cc = (int) ccVwrInvokeFindDialog; 00177 nReqArgs = 1; 00178 pCmd->nArg = 1; 00179 } 00180 else if (strcmp(szToken, "vwrZoomIn") == 0 || cmdcode == ccVwrZoomIn) 00181 { 00182 strcpy(pCmd->name, szToken); 00183 pCmd->cc = (int) ccVwrZoomIn; 00184 nReqArgs = 1; 00185 pCmd->nArg = 1; 00186 } 00187 else if (strcmp(szToken, "vwrZoomOut") == 0 || cmdcode == ccVwrZoomOut) 00188 { 00189 strcpy(pCmd->name, szToken); 00190 pCmd->cc = (int) ccVwrZoomOut; 00191 nReqArgs = 1; 00192 pCmd->nArg = 1; 00193 } 00194 else if (strcmp(szToken, "vwrStore") == 0 || cmdcode == ccVwrStore) 00195 { 00196 strcpy(pCmd->name, szToken); 00197 pCmd->cc = (int) ccVwrStore; 00198 nReqArgs = 3; 00199 pCmd->nArg = 3; 00200 } 00210 else if (strcmp(szToken, "vwrToolbar") == 0 || cmdcode == ccVwrToolbar) 00211 { 00212 strcpy(pCmd->name, szToken); 00213 pCmd->cc = (int) ccVwrToolbar; 00214 nReqArgs = 2; 00215 pCmd->nArg = 2; 00216 } 00217 else if (strcmp(szToken, "vwrToolbarSync") == 0 || cmdcode == ccVwrToolbarSync) 00218 { 00219 strcpy(pCmd->name, szToken); 00220 pCmd->cc = (int) ccVwrToolbarSync; 00221 nReqArgs = 0; 00222 pCmd->nArg = 0; 00223 } 00224 else if (strcmp(szToken, "vwrPagebarSync") == 0 || cmdcode == ccVwrPagebarSync) 00225 { 00226 strcpy(pCmd->name, szToken); 00227 pCmd->cc = (int) ccVwrPagebarSync; 00228 nReqArgs = 0; 00229 pCmd->nArg = 0; 00230 } 00231 else 00232 { 00233 strcpy(pCmd->name, "Undefined"); 00234 pCmd->cc = (int) ccVwrUndefined; 00235 fprintf(stderr, "%s: Command %s \n", __FUNCTION__, szToken); 00236 fprintf(stderr, "Error parsing (%s). Command undefined\n", szCommand); 00237 pCmd->nArg = -1; 00238 return -1; 00239 } 00240 00241 if (nReqArgs > 0) 00242 { 00243 erIpcGetArgs(pChar, pCmd, nReqArgs); 00244 } 00245 return 0; 00246 }
int vwrStore | ( | erClientChannel_t | channel, | |
int | uaID, | |||
int | category, | |||
char * | itemID | |||
) |
Store the currently displayed page of viewer 'uaID'
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 |
Definition at line 248 of file eripcviewer.c.
00249 { 00250 erIpcCmd_t cmd; 00251 00252 strcpy(cmd.name, "vwrStore"); 00253 cmd.cc = (int) ccVwrStore; 00254 cmd.nArg = 3; 00255 sprintf(cmd.arg[0], "%d", uaID); 00256 sprintf(cmd.arg[1], "%d", category); 00257 00258 if ((itemID) && (strlen(itemID) < TB_ARGLENGTH)) 00259 { 00260 strncpy(cmd.arg[2], itemID, TB_ARGLENGTH); 00261 } 00262 else 00263 { 00264 sprintf(cmd.arg[2],"%s", ""); 00265 fprintf(stderr, "Command %s \n", cmd.name); 00266 fprintf(stderr, "invalid itemID (%s)\n", itemID); 00267 } 00268 00269 return erIpcSndCommand(channel, &cmd); 00270 }
int vwrZoomIn | ( | erClientChannel_t | channel, | |
int | uaID | |||
) |
Zoom in on the currently displayed page of viewer 'uaID'
channel | Opaque datastructure that contains info on communication channel | |
uaID | application identifier |
Definition at line 91 of file eripcviewer.c.
00092 { 00093 erIpcCmd_t cmd; 00094 00095 strcpy(cmd.name, "vwrZoomIn"); 00096 cmd.cc = (int) ccVwrZoomIn; 00097 cmd.nArg = 1; 00098 sprintf(cmd.arg[0], "%d", uaID); 00099 00100 return erIpcSndCommand(channel, &cmd); 00101 }
int vwrZoomOut | ( | erClientChannel_t | channel, | |
int | uaID | |||
) |
Zoom out on the currently displayed page of viewer 'uaID'
channel | Opaque datastructure that contains info on communication channel | |
uaID | application identifier |
Definition at line 103 of file eripcviewer.c.
00104 { 00105 erIpcCmd_t cmd; 00106 00107 strcpy(cmd.name, "vwrZoomOut"); 00108 cmd.cc = (int) ccVwrZoomOut; 00109 cmd.nArg = 1; 00110 sprintf(cmd.arg[0], "%d", uaID); 00111 00112 return erIpcSndCommand(channel, &cmd); 00113 }