ipdf-svn/src/RenderThread.cpp File Reference

#include "RenderThread.h"
#include <sys/time.h>
#include <time.h>
#include <errno.h>
#include "controller.h"
#include "PDFViewerLog.h"
#include <unistd.h>
#include <gdk/gdkx.h>

Go to the source code of this file.

Functions

void OnTerminated (int sig)
static void installThreadTermHandler ()
static void postEvent (ThreadParam *param, CPageInfo *page)


Function Documentation

static void installThreadTermHandler (  )  [static]

Definition at line 68 of file RenderThread.cpp.

00069 {
00070     // catch the SIGTERM signal
00071     struct sigaction on_term;
00072     memset(&on_term, 0x00, sizeof(on_term));
00073     on_term.sa_handler = OnTerminated;
00074     sigaction(SIGTERM, &on_term, NULL);
00075 }

Here is the call graph for this function:

void OnTerminated ( int  sig  ) 

Definition at line 42 of file main.cc.

00043 {
00044     PV_DUMP("On receive signal %d pid %d\n", sig, getpid());
00045     {
00046         AppID = 0;
00047         pApp->quit();
00048         delete pApp;
00049         pApp = NULL;
00050     }        
00051     exit(0);
00052 }

Here is the call graph for this function:

static void postEvent ( ThreadParam param,
CPageInfo page 
) [static]

Definition at line 195 of file RenderThread.cpp.

00196 {
00197     XKeyEvent xev;
00198     xev.type = KeyPress;
00199     xev.display = param->ctrl->gtkMgr.display;
00200     xev.root = RootWindow(param->ctrl->gtkMgr.display, param->ctrl->gtkMgr.screenNum);
00201     xev.window = GDK_WINDOW_XWINDOW(param->ctrl->gtkMgr.window->window);
00202     xev.subwindow = None;
00203     xev.time = 0;
00204     xev.x = page->pageNumber;
00205     xev.y = 1;
00206     xev.x_root = -1;
00207     xev.y_root = -1;
00208     xev.same_screen = 1;
00209     xev.state = page->pageNumber;
00210     xev.keycode = page->pageNumber; //XKeysymToKeycode(param->ctrl->xMgr.display, 0x0000);
00211     XSendEvent(param->ctrl->gtkMgr.display, 
00212         GDK_WINDOW_XWINDOW(param->ctrl->gtkMgr.window->window), 1, KeyPressMask, (XEvent *)&xev);
00213     XFlush(xev.display);
00214 }


Generated on Wed Feb 4 18:26:07 2009 by  doxygen 1.5.6