pdfSetMouseDoubleClickWinCbk
Set a callback function for mouse button double-click events with window coordinates.
void pdfSetMouseDoubleClickWinCbk(PDFViewerHandle viewer,
void (*cbk)(void *data, int button, int shift,
int winX, int winY),
void *data)
This function sets a callback which will be called when the user
double-clicks a mouse button.
The function will be called with six arguments:
data
: the value of thedata
argument that was passed topdfSetMouseDoubleClickCbk
button
: the mouse button number - one ofpdfLeftButton
,pdfMiddleButton
, orpdfRightButton
shift
: the shift/control/alt bit mask, which contains zero or more bit flags frompdfShiftKey
,pdfCtrlKey
, andpdfAltKey
page
: the page number where the mouse button was clickedx, y
: the position where the mouse button was clicked, in PDF coordinates
pdfConvertWindowToPDFCoords2
.
This callback is similar to pdfSetMouseDoubleClickCbk
, except that
(a) it is called with window coordinates instead of PDF coordinates,
and (b) it will be called even if the mouse is clicked outside of a
PDF page.
C:
void mouseDoubleClickWinCbk(void *data, int button, int shift,
int winX, int winY) {
Context *myContext = (Context *)data;
int pg;
double x, y;
pdfConvertWindowToPDFCoords2(viewer, winX, winY, &pg, &x, &y);
/* ... use pg, x, y ... */
}
....
pdfSetMouseDoubleClickWinCbk(viewer, &mouseDoubleClickCbk, &myContext);