pageBar/tst/pagebarTest.c File Reference

#include <gtk/gtk.h>
#include <stdlib.h>
#include <liberipc/eripc.h>
#include <liberipc/eripcpagebar.h>
#include <liberipc/eripcviewer.h>

Go to the source code of this file.

Defines

#define UAID   ER_APABI_VIEWER_CHANNEL

Functions

void serviceCallback (gpointer data, gint source_fd, GdkInputCondition condition)
void installIpcServer ()
int main (int argc, char *argv[])

Variables

erClientChannel_t channel


Define Documentation

#define UAID   ER_APABI_VIEWER_CHANNEL

Definition at line 31 of file pagebarTest.c.


Function Documentation

void installIpcServer (  ) 

Definition at line 52 of file pagebarTest.c.

00053 {
00054     int     nRet = 0;
00055     int     fd = -1;
00056     erServerChannel_t channel;
00057 
00058     nRet = erIpcOpenServerChannel(ER_APABI_VIEWER_CHANNEL, &channel);
00059     fd = erIpcGetServerFd(channel);
00060     // gtk specific mechanism to monitor input file descriptor.
00061     gdk_input_add(fd, GDK_INPUT_READ, serviceCallback, (gpointer) channel);
00062 }

Here is the call graph for this function:

int main ( int  argc,
char *  argv[] 
)

Definition at line 64 of file pagebarTest.c.

00064                                  {
00065     /* init threads */
00066     g_thread_init(NULL);
00067     gdk_threads_init();
00068 
00069     erIpcStartClient(ER_PAGEBAR_CHANNEL, &channel);
00070     installIpcServer();
00071     
00072     pbReset(channel, UAID);
00073     pbSetPageCount(channel, UAID, 50);
00074     pbSetCurrentPageOffset(channel, UAID, 60);
00075     pbSetDrawAreaVOrigin(channel, UAID, 1020);
00076     pbRedraw(channel, UAID);
00077     
00078     
00079     gdk_threads_enter();
00080     gtk_main();
00081     gdk_threads_leave();
00082     return 0;
00083 }

Here is the call graph for this function:

void serviceCallback ( gpointer  data,
gint  source_fd,
GdkInputCondition  condition 
)

Definition at line 33 of file pagebarTest.c.

00034 {
00035     char    szBuffer[1024];
00036     int     nBuf = 1024;
00037     erIpcCmd_t command;
00038 
00039     erIpcGetMessage((erServerChannel_t) data, szBuffer, &nBuf);
00040     printf("Received %s\n", szBuffer);
00041     if (vwrParseCommand(szBuffer, &command) >= 0) {
00042       switch (command.cc) {
00043         case ccVwrJumpToPage:
00044           printf("PAGE CHANGE TO PAGE %d\n", atoi(command.arg[1]));
00045           break;
00046         default:
00047           break;
00048       }
00049     }
00050 }

Here is the call graph for this function:


Variable Documentation

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

Definition at line 29 of file pagebarTest.c.


Generated on Sun Dec 14 17:15:20 2008 by  doxygen 1.5.6