view release on metacpan or search on metacpan
lib/IUP/Internal/Canvas.xs.inc view on Meta::CPAN
# void cdCanvasGetSize(cdCanvas* canvas, int *width, int *height, double *width_mm, double *height_mm);
# canvas:GetSize() -> (width, height, mm_width, mm_height: number) [in Lua]
void
cdGetSize(canvas)
SV* canvas;
INIT:
int width;
int height;
double width_mm;
double height_mm;
PPCODE:
cdCanvasGetSize(ref2cnv(canvas),&width,&height,&width_mm,&height_mm);
XPUSHs(sv_2mortal(newSViv(width)));
XPUSHs(sv_2mortal(newSViv(height)));
XPUSHs(sv_2mortal(newSVnv(width_mm)));
XPUSHs(sv_2mortal(newSVnv(height_mm)));
#### Original C function from <.../cd/include/cd.h>
# int cdCanvasUpdateYAxis(cdCanvas* canvas, int* y);
# double cdfCanvasUpdateYAxis(cdCanvas* canvas, double* y);
double
lib/IUP/Internal/Canvas.xs.inc view on Meta::CPAN
# canvas:MM2Pixel(mm_dx, mm_dy: number) -> (dx, dy: number) [in Lua]
void
cdMM2Pixel(canvas,mm_dx,mm_dy)
SV* canvas;
double mm_dx;
double mm_dy;
INIT:
int rv;
int dx;
int dy;
PPCODE:
cdCanvasMM2Pixel(ref2cnv(canvas),mm_dx,mm_dy,&dx,&dy);
XPUSHs(sv_2mortal(newSViv(dx)));
XPUSHs(sv_2mortal(newSViv(dy)));
#### Original C function from <.../cd/include/cd.h>
# void cdCanvasPixel2MM(cdCanvas* canvas, int dx, int dy, double *mm_dx, double *mm_dy);
# canvas:Pixel2MM(dx, dy: number) -> (mm_dx, mm_dy: number) [in Lua]
void
cdPixel2MM(canvas,dx,dy)
SV* canvas;
int dx;
int dy;
INIT:
double mm_dx;
double mm_dy;
PPCODE:
cdCanvasPixel2MM(ref2cnv(canvas),dx,dy,&mm_dx,&mm_dy);
XPUSHs(sv_2mortal(newSVnv(mm_dx)));
XPUSHs(sv_2mortal(newSVnv(mm_dy)));
#### Original C function from <.../cd/include/cd.h>
# void cdfCanvasMM2Pixel(cdCanvas* canvas, double mm_dx, double mm_dy, double *dx, double *dy);
# canvas:fMM2Pixel(mm_dx, mm_dy: number) -> (dx, dy: number) [in Lua]
void
cdfMM2Pixel(canvas,mm_dx,mm_dy)
SV* canvas;
double mm_dx;
double mm_dy;
INIT:
double dx;
double dy;
PPCODE:
cdfCanvasMM2Pixel(ref2cnv(canvas),mm_dx,mm_dy,&dx,&dy);
XPUSHs(sv_2mortal(newSVnv(dx)));
XPUSHs(sv_2mortal(newSVnv(dy)));
#### Original C function from <.../cd/include/cd.h>
# void cdfCanvasPixel2MM(cdCanvas* canvas, double dx, double dy, double *mm_dx, double *mm_dy);
# canvas:fPixel2MM(dx, dy: number) -> (mm_dx, mm_dy: number) [in Lua]
void
cdfPixel2MM(canvas,dx,dy,mm_dx,mm_dy)
SV* canvas;
double dx;
double dy;
INIT:
double mm_dx;
double mm_dy;
PPCODE:
cdfCanvasPixel2MM(ref2cnv(canvas),dx,dy,&mm_dx,&mm_dy);
XPUSHs(sv_2mortal(newSVnv(mm_dx)));
XPUSHs(sv_2mortal(newSVnv(mm_dy)));
#### Original C function from <.../cd/include/cd.h>
# void cdCanvasOrigin(cdCanvas* canvas, int x, int y);
void
cdOrigin(canvas,x,y)
SV* canvas;
int x;
lib/IUP/Internal/Canvas.xs.inc view on Meta::CPAN
#### Original C function from <.../cd/include/cd.h>
# void cdCanvasGetOrigin(cdCanvas* canvas, int *x, int *y);
# canvas:GetOrigin() -> (x, y: number) [in Lua]
void
cdGetOrigin(canvas)
SV* canvas;
INIT:
int x;
int y;
PPCODE:
cdCanvasGetOrigin(ref2cnv(canvas),&x,&y);
XPUSHs(sv_2mortal(newSViv(x)));
XPUSHs(sv_2mortal(newSViv(y)));
#### Original C function from <.../cd/include/cd.h>
# void cdfCanvasGetOrigin(cdCanvas* canvas, double *x, double *y);
# canvas:fGetOrigin() -> (x, y: number) [in Lua]
void
cdfGetOrigin(canvas)
SV* canvas;
INIT:
double x;
double y;
PPCODE:
cdfCanvasGetOrigin(ref2cnv(canvas),&x,&y);
XPUSHs(sv_2mortal(newSVnv(x)));
XPUSHs(sv_2mortal(newSVnv(y)));
#### Original C function from <.../cd/include/cd.h>
# void cdCanvasTransform(cdCanvas* canvas, const double* matrix);
# canvas:Transform(matrix: table) [in Lua]
void
cdTransform(canvas,matrix)
SV* canvas;
lib/IUP/Internal/Canvas.xs.inc view on Meta::CPAN
# void cdCanvasTransformPoint(cdCanvas* canvas, int x, int y, int *tx, int *ty);
# canvas:TransformPoint(x, y: number) -> (tx, ty: number) [in Lua]
void
cdTransformPoint(canvas,x,y)
SV* canvas;
int x;
int y;
INIT:
int tx;
int ty;
PPCODE:
cdCanvasTransformPoint(ref2cnv(canvas),x,y,&tx,&ty);
XPUSHs(sv_2mortal(newSViv(tx)));
XPUSHs(sv_2mortal(newSViv(ty)));
#### Original C function from <.../cd/include/cd.h>
# void cdfCanvasTransformPoint(cdCanvas* canvas, double x, double y, double *tx, double *ty);
# canvas:fTransformPoint(x, y: number) -> (tx, ty: number) [in Lua]
void
cdfTransformPoint(canvas,x,y)
SV* canvas;
double x;
double y;
INIT:
double tx;
double ty;
PPCODE:
cdfCanvasTransformPoint(ref2cnv(canvas),x,y,&tx,&ty);
XPUSHs(sv_2mortal(newSVnv(tx)));
XPUSHs(sv_2mortal(newSVnv(ty)));
#### Original C function from <.../cd/include/cd.h>
# int cdCanvasClip(cdCanvas* canvas, int mode);
int
cdClip(canvas,mode)
SV* canvas;
int mode;
lib/IUP/Internal/Canvas.xs.inc view on Meta::CPAN
# canvas:GetClipArea() -> (xmin, xmax, ymin, ymax, status: number) [in Lua]
void
cdGetClipArea(canvas)
SV* canvas;
INIT:
int xmin;
int xmax;
int ymin;
int ymax;
int status;
PPCODE:
status = cdCanvasGetClipArea(ref2cnv(canvas),&xmin,&xmax,&ymin,&ymax);
XPUSHs(sv_2mortal(newSViv(xmin)));
XPUSHs(sv_2mortal(newSViv(xmax)));
XPUSHs(sv_2mortal(newSViv(ymin)));
XPUSHs(sv_2mortal(newSViv(ymax)));
XPUSHs(sv_2mortal(newSViv(status)));
#### Original C function from <.../cd/include/cd.h>
# void cdfCanvasClipArea(cdCanvas* canvas, double xmin, double xmax, double ymin, double ymax);
void
lib/IUP/Internal/Canvas.xs.inc view on Meta::CPAN
# canvas:GetClipArea() -> (xmin, xmax, ymin, ymax, status: number) [in Lua]
void
cdfGetClipArea(canvas)
SV* canvas;
INIT:
int status;
double xmin;
double xmax;
double ymin;
double ymax;
PPCODE:
status = cdfCanvasGetClipArea(ref2cnv(canvas),&xmin,&xmax,&ymin,&ymax);
XPUSHs(sv_2mortal(newSVnv(xmin)));
XPUSHs(sv_2mortal(newSVnv(xmax)));
XPUSHs(sv_2mortal(newSVnv(ymin)));
XPUSHs(sv_2mortal(newSVnv(ymax)));
XPUSHs(sv_2mortal(newSVnv(status)));
#### Original C function from <.../cd/include/cd.h>
# int cdCanvasIsPointInRegion(cdCanvas* canvas, int x, int y);
int
lib/IUP/Internal/Canvas.xs.inc view on Meta::CPAN
# canvas:GetRegionBox() -> (xmin, xmax, ymin, ymax, status: number) [in Lua]
void
cdGetRegionBox(canvas)
SV* canvas;
INIT:
int status = 4; /* inspired by Lua */
int xmin;
int xmax;
int ymin;
int ymax;
PPCODE:
cdCanvasGetRegionBox(ref2cnv(canvas),&xmin,&xmax,&ymin,&ymax);
XPUSHs(sv_2mortal(newSViv(xmin)));
XPUSHs(sv_2mortal(newSViv(xmax)));
XPUSHs(sv_2mortal(newSViv(ymin)));
XPUSHs(sv_2mortal(newSViv(ymax)));
XPUSHs(sv_2mortal(newSViv(status)));
#### Original C function from <.../cd/include/cd.h>
# int cdCanvasRegionCombineMode(cdCanvas* canvas, int mode);
int
lib/IUP/Internal/Canvas.xs.inc view on Meta::CPAN
#### Original C function from <.../cd/include/cd.h>
# void cdCanvasGetFont(cdCanvas* canvas, char *type_face, int *style, int *size);
# canvas:GetFont() -> (typeface: string, style, size: number) [in Lua]
void
cdGetFont(canvas,type_face,style,size)
SV* canvas;
INIT:
char type_face[1024]; /* XXX-CHECKLATER (HARDCODED BUFFER SIZE) 1024 taken from cd_private.h */
int style;
int size;
PPCODE:
cdCanvasGetFont(ref2cnv(canvas),type_face,&style,&size);
XPUSHs(sv_2mortal(newSVpv(type_face,0)));
XPUSHs(sv_2mortal(newSViv(style)));
XPUSHs(sv_2mortal(newSViv(size)));
#### Original C function from <.../cd/include/cd.h>
# char* cdCanvasNativeFont(cdCanvas* canvas, const char* font);
char*
cdNativeFont(canvas,font)
SV* canvas;
lib/IUP/Internal/Canvas.xs.inc view on Meta::CPAN
#### Original C function from <.../cd/include/cd.h>
# void cdCanvasGetVectorFontSize(cdCanvas* canvas, double *size_x, double *size_y);
# canvas:GetVectorFontSize() -> (size_x, size_y: number) [in Lua]
void
cdGetVectorFontSize(canvas)
SV* canvas;
INIT:
double size_x;
double size_y;
PPCODE:
cdCanvasGetVectorFontSize(ref2cnv(canvas),&size_x,&size_y);
XPUSHs(sv_2mortal(newSVnv(size_x)));
XPUSHs(sv_2mortal(newSVnv(size_y)));
#### Original C function from <.../cd/include/cd.h>
# void cdCanvasGetVectorTextSize(cdCanvas* canvas, const char* s, int *x, int *y);
# canvas:GetVectorTextSize(text: string) -> (width, height: number) [in Lua]
void
cdGetVectorTextSize(canvas,s)
SV* canvas;
const char* s;
INIT:
int x;
int y;
PPCODE:
cdCanvasGetVectorTextSize(ref2cnv(canvas),s,&x,&y);
XPUSHs(sv_2mortal(newSViv(x)));
XPUSHs(sv_2mortal(newSViv(y)));
#### Original C function from <.../cd/include/cd.h>
# void cdCanvasGetVectorTextBounds(cdCanvas* canvas, const char* s, int x, int y, int *rect);
# canvas:GetVectorTextBounds(text: string, x, y: number) -> (rect: table) [in Lua]
void
cdGetVectorTextBounds(canvas,s,x,y)
SV* canvas;
const char* s;
int x;
int y;
INIT:
int rect[8];
PPCODE:
cdCanvasGetVectorTextBounds(ref2cnv(canvas),s,x,y,rect);
/* XXX-CHECKLATER maybe return an arrayref */
XPUSHs(sv_2mortal(newSViv(rect[0]))); /* x0 */
XPUSHs(sv_2mortal(newSViv(rect[1]))); /* y0 */
XPUSHs(sv_2mortal(newSViv(rect[2]))); /* x1 */
XPUSHs(sv_2mortal(newSViv(rect[3]))); /* y1 */
XPUSHs(sv_2mortal(newSViv(rect[4]))); /* x2 */
XPUSHs(sv_2mortal(newSViv(rect[5]))); /* y2 */
XPUSHs(sv_2mortal(newSViv(rect[6]))); /* x3 */
XPUSHs(sv_2mortal(newSViv(rect[7]))); /* y3 */
lib/IUP/Internal/Canvas.xs.inc view on Meta::CPAN
cdGetVectorTextBox(canvas,x,y,s)
SV* canvas;
int x;
int y;
const char* s;
INIT:
int xmin;
int xmax;
int ymin;
int ymax;
PPCODE:
cdCanvasGetVectorTextBox(ref2cnv(canvas),x,y,s,&xmin,&xmax,&ymin,&ymax);
XPUSHs(sv_2mortal(newSViv(xmin)));
XPUSHs(sv_2mortal(newSViv(xmax)));
XPUSHs(sv_2mortal(newSViv(ymin)));
XPUSHs(sv_2mortal(newSViv(ymax)));
#### Original C function from <.../cd/include/cd.h>
# void cdCanvasGetFontDim(cdCanvas* canvas, int *max_width, int *height, int *ascent, int *descent);
# canvas:GetFontDim() -> (max_width, height, ascent, descent: number) [in Lua]
void
cdGetFontDim(canvas)
SV* canvas;
INIT:
int max_width;
int height;
int ascent;
int descent;
PPCODE:
cdCanvasGetFontDim(ref2cnv(canvas),&max_width,&height,&ascent,&descent);
XPUSHs(sv_2mortal(newSViv(max_width)));
XPUSHs(sv_2mortal(newSViv(height)));
XPUSHs(sv_2mortal(newSViv(ascent)));
XPUSHs(sv_2mortal(newSViv(descent)));
#### Original C function from <.../cd/include/cd.h>
# void cdCanvasGetTextSize(cdCanvas* canvas, const char* s, int *width, int *height);
# canvas:GetTextSize(text: string) -> (width, heigth: number) [in Lua]
void
cdGetTextSize(canvas,s)
SV* canvas;
const char* s;
INIT:
int width;
int height;
PPCODE:
cdCanvasGetTextSize(ref2cnv(canvas),s,&width,&height);
XPUSHs(sv_2mortal(newSViv(width)));
XPUSHs(sv_2mortal(newSViv(height)));
#### Original C function from <.../cd/include/cd.h>
# void cdCanvasGetTextBox(cdCanvas* canvas, int x, int y, const char* s, int *xmin, int *xmax, int *ymin, int *ymax);
# canvas:GetTextBox(x, y: number, text: string) -> (xmin, xmax, ymin, ymax: number) [in Lua]
void
cdGetTextBox(canvas,x,y,s)
SV* canvas;
int x;
int y;
const char* s;
INIT:
int xmin;
int xmax;
int ymin;
int ymax;
PPCODE:
cdCanvasGetTextBox(ref2cnv(canvas),x,y,s,&xmin,&xmax,&ymin,&ymax);
XPUSHs(sv_2mortal(newSViv(xmin)));
XPUSHs(sv_2mortal(newSViv(xmax)));
XPUSHs(sv_2mortal(newSViv(ymin)));
XPUSHs(sv_2mortal(newSViv(ymax)));
#### Original C function from <.../cd/include/cd.h>
# void cdCanvasGetTextBounds(cdCanvas* canvas, int x, int y, const char* s, int *rect);
# canvas:GetTextBounds(x, y: number, text: string) -> (rect: table) [in Lua]
void
cdGetTextBounds(canvas,x,y,s)
SV* canvas;
int x;
int y;
const char* s;
INIT:
int rect[8];
PPCODE:
cdCanvasGetTextBounds(ref2cnv(canvas),x,y,s,rect);
/* XXX-CHECKLATER maybe return an arrayref */
XPUSHs(sv_2mortal(newSViv(rect[0]))); /* x0 */
XPUSHs(sv_2mortal(newSViv(rect[1]))); /* y0 */
XPUSHs(sv_2mortal(newSViv(rect[2]))); /* x1 */
XPUSHs(sv_2mortal(newSViv(rect[3]))); /* y1 */
XPUSHs(sv_2mortal(newSViv(rect[4]))); /* x2 */
XPUSHs(sv_2mortal(newSViv(rect[5]))); /* y2 */
XPUSHs(sv_2mortal(newSViv(rect[6]))); /* x3 */
XPUSHs(sv_2mortal(newSViv(rect[7]))); /* y3 */
lib/IUP/Internal/Canvas.xs.inc view on Meta::CPAN
# void wdCanvasGetWindow(cdCanvas* canvas, double *xmin, double *xmax, double *ymin, double *ymax);
# canvas:wGetWindow() -> (xmin, xmax, ymin, ymax: number) [in Lua]
void
wdGetWindow(canvas)
SV* canvas;
INIT:
double xmin;
double xmax;
double ymin;
double ymax;
PPCODE:
wdCanvasGetWindow(ref2cnv(canvas),&xmin,&xmax,&ymin,&ymax);
XPUSHs(sv_2mortal(newSVnv(xmin)));
XPUSHs(sv_2mortal(newSVnv(xmax)));
XPUSHs(sv_2mortal(newSVnv(ymin)));
XPUSHs(sv_2mortal(newSVnv(ymax)));
#### Original C function from <.../cd/include/wd.h>
# void wdCanvasViewport(cdCanvas* canvas, int xmin, int xmax, int ymin, int ymax);
void
lib/IUP/Internal/Canvas.xs.inc view on Meta::CPAN
# void wdCanvasGetViewport(cdCanvas* canvas, int *xmin, int *xmax, int *ymin, int *ymax);
# canvas:wGetViewport() -> (xmin, xmax, ymin, ymax: number) [in Lua]
void
wdGetViewport(canvas)
SV* canvas;
INIT:
int xmin;
int xmax;
int ymin;
int ymax;
PPCODE:
wdCanvasGetViewport(ref2cnv(canvas),&xmin,&xmax,&ymin,&ymax);
XPUSHs(sv_2mortal(newSViv(xmin)));
XPUSHs(sv_2mortal(newSViv(xmax)));
XPUSHs(sv_2mortal(newSViv(ymin)));
XPUSHs(sv_2mortal(newSViv(ymax)));
#### Original C function from <.../cd/include/wd.h>
# void wdCanvasWorld2Canvas(cdCanvas* canvas, double xw, double yw, int *xv, int *yv);
# canvas:wWorld2Canvas(xw, yw: number) -> (xv, yv: number) [in Lua]
void
wdWorld2Canvas(canvas,xw,yw)
SV* canvas;
double xw;
double yw;
INIT:
int xv;
int yv;
PPCODE:
wdCanvasWorld2Canvas(ref2cnv(canvas),xw,yw,&xv,&yv);
XPUSHs(sv_2mortal(newSViv(xv)));
XPUSHs(sv_2mortal(newSViv(yv)));
#### Original C function from <.../cd/include/wd.h>
# void wdCanvasWorld2CanvasSize(cdCanvas* canvas, double hw, double vw, int *hv, int *vv);
# Lua ???
void
wdWorld2CanvasSize(canvas,hw,vw)
SV* canvas;
double hw;
double vw;
INIT:
int hv;
int vv;
PPCODE:
wdCanvasWorld2CanvasSize(ref2cnv(canvas),hw,vw,&hv,&vv);
XPUSHs(sv_2mortal(newSViv(hv)));
XPUSHs(sv_2mortal(newSViv(vv)));
#### Original C function from <.../cd/include/wd.h>
# void wdCanvasCanvas2World(cdCanvas* canvas, int xv, int yv, double *xw, double *yw);
# canvas:wCanvas2World(xv, yv: number) -> (xw, yw: number) [in Lua]
void
wdCanvas2World(canvas,xv,yv)
SV* canvas;
int xv;
int yv;
INIT:
double xw;
double yw;
PPCODE:
wdCanvasCanvas2World(ref2cnv(canvas),xv,yv,&xw,&yw);
XPUSHs(sv_2mortal(newSVnv(xw)));
XPUSHs(sv_2mortal(newSVnv(yw)));
#### Original C function from <.../cd/include/wd.h>
# void wdCanvasSetTransform(cdCanvas* canvas, double sx, double sy, double tx, double ty);
void
wdSetTransform(canvas,sx,sy,tx,ty)
SV* canvas;
double sx;
lib/IUP/Internal/Canvas.xs.inc view on Meta::CPAN
# canvas:wGetTransform() -> (sx, sy, tx, ty: number) [in Lua]
void
wdGetTransform(canvas)
SV* canvas;
INIT:
double sx;
double sy;
double tx;
double ty;
PPCODE:
wdCanvasGetTransform(ref2cnv(canvas),&sx,&sy,&tx,&ty);
XPUSHs(sv_2mortal(newSVnv(sx)));
XPUSHs(sv_2mortal(newSVnv(sy)));
XPUSHs(sv_2mortal(newSVnv(tx)));
XPUSHs(sv_2mortal(newSVnv(ty)));
#### Original C function from <.../cd/include/wd.h>
# void wdCanvasTranslate(cdCanvas* canvas, double dtx, double dty);
void
wdTranslate(canvas,dtx,dty)
lib/IUP/Internal/Canvas.xs.inc view on Meta::CPAN
# canvas:wGetClipArea() -> (xmin, xmax, ymin, ymax, status: number) (WC) [in Lua]
void
wdGetClipArea(canvas)
SV* canvas;
INIT:
int status;
double xmin;
double xmax;
double ymin;
double ymax;
PPCODE:
status = wdCanvasGetClipArea(ref2cnv(canvas),&xmin,&xmax,&ymin,&ymax);
XPUSHs(sv_2mortal(newSVnv(xmin)));
XPUSHs(sv_2mortal(newSVnv(xmax)));
XPUSHs(sv_2mortal(newSVnv(ymin)));
XPUSHs(sv_2mortal(newSVnv(ymax)));
XPUSHs(sv_2mortal(newSViv(status)));
#### Original C function from <.../cd/include/wd.h>
# int wdCanvasIsPointInRegion(cdCanvas* canvas, double x, double y);
int
lib/IUP/Internal/Canvas.xs.inc view on Meta::CPAN
#### Original C function from <.../cd/include/wd.h>
# void wdCanvasGetFont(cdCanvas* canvas, char *type_face, int *style, double *size);
# canvas:wGetFont() -> (typeface: string, style, size: number) (WC) [in Lua]
void
wdGetFont(canvas,type_face,style,size)
SV* canvas;
INIT:
char type_face[1024]; /* XXX-CHECKLATER (HARDCODED BUFFER SIZE) 1024 taken from cd_private.h */
int style;
double size;
PPCODE:
wdCanvasGetFont(ref2cnv(canvas),type_face,&style,&size);
XPUSHs(sv_2mortal(newSVpv(type_face,0)));
XPUSHs(sv_2mortal(newSViv(style)));
XPUSHs(sv_2mortal(newSVnv(size)));
#### Original C function from <.../cd/include/wd.h>
# double wdCanvasMarkSize(cdCanvas* canvas, double size);
double
wdMarkSize(canvas,size)
SV* canvas;
lib/IUP/Internal/Canvas.xs.inc view on Meta::CPAN
# void wdCanvasGetFontDim(cdCanvas* canvas, double *max_width, double *height, double *ascent, double *descent);
# canvas:wGetFontDim() -> (max_width, height, ascent, descent: number) (WC) [in Lua]
void
wdGetFontDim(canvas)
SV* canvas;
INIT:
double max_width;
double height;
double ascent;
double descent;
PPCODE:
wdCanvasGetFontDim(ref2cnv(canvas),&max_width,&height,&ascent,&descent);
XPUSHs(sv_2mortal(newSVnv(max_width)));
XPUSHs(sv_2mortal(newSVnv(height)));
XPUSHs(sv_2mortal(newSVnv(ascent)));
XPUSHs(sv_2mortal(newSVnv(descent)));
#### Original C function from <.../cd/include/wd.h>
# void wdCanvasGetTextSize(cdCanvas* canvas, const char* s, double *width, double *height);
# canvas:wGetTextSize(text: string) -> (width, heigth: number) (WC) [in Lua]
void
wdGetTextSize(canvas,s)
SV* canvas;
const char* s;
INIT:
double width;
double height;
PPCODE:
wdCanvasGetTextSize(ref2cnv(canvas),s,&width,&height);
XPUSHs(sv_2mortal(newSVnv(width)));
XPUSHs(sv_2mortal(newSVnv(height)));
#### Original C function from <.../cd/include/wd.h>
# void wdCanvasGetTextBox(cdCanvas* canvas, double x, double y, const char* s, double *xmin, double *xmax, double *ymin, double *ymax);
# canvas:wGetTextBox(x, y: number, text: string) -> (xmin, xmax, ymin, ymax: number) (WC) [in Lua]
void
wdGetTextBox(canvas,x,y,s)
SV* canvas;
double x;
double y;
const char* s;
INIT:
double xmin;
double xmax;
double ymin;
double ymax;
PPCODE:
wdCanvasGetTextBox(ref2cnv(canvas),x,y,s,&xmin,&xmax,&ymin,&ymax);
XPUSHs(sv_2mortal(newSVnv(xmin)));
XPUSHs(sv_2mortal(newSVnv(xmax)));
XPUSHs(sv_2mortal(newSVnv(ymin)));
XPUSHs(sv_2mortal(newSVnv(ymax)));
#### Original C function from <.../cd/include/wd.h>
# void wdCanvasGetTextBounds(cdCanvas* canvas, double x, double y, const char* s, double *rect);
# canvas:wGetTextBounds(x, y: number, text: string) -> (rect: table) (WC) [in Lua]
void
wdGetTextBounds(canvas,x,y,s)
SV* canvas;
double x;
double y;
const char* s;
INIT:
double rect[8];
PPCODE:
wdCanvasGetTextBounds(ref2cnv(canvas),x,y,s,rect);
/* XXX-CHECKLATER maybe return an arrayref */
XPUSHs(sv_2mortal(newSVnv(rect[0]))); /* x0 */
XPUSHs(sv_2mortal(newSVnv(rect[1]))); /* y0 */
XPUSHs(sv_2mortal(newSVnv(rect[2]))); /* x1 */
XPUSHs(sv_2mortal(newSVnv(rect[3]))); /* y1 */
XPUSHs(sv_2mortal(newSVnv(rect[4]))); /* x2 */
XPUSHs(sv_2mortal(newSVnv(rect[5]))); /* y2 */
XPUSHs(sv_2mortal(newSVnv(rect[6]))); /* x3 */
XPUSHs(sv_2mortal(newSVnv(rect[7]))); /* y3 */
lib/IUP/Internal/Canvas.xs.inc view on Meta::CPAN
#### Original C function from <.../cd/include/wd.h>
# void wdCanvasGetVectorTextSize(cdCanvas* canvas, const char* s, double *x, double *y);
# canvas:wGetVectorTextSize(text: string) -> (width, height: number) [in Lua]
void
wdGetVectorTextSize(canvas,s)
SV* canvas;
const char* s;
INIT:
double x;
double y;
PPCODE:
wdCanvasGetVectorTextSize(ref2cnv(canvas),s,&x,&y);
XPUSHs(sv_2mortal(newSVnv(x)));
XPUSHs(sv_2mortal(newSVnv(y)));
#### Original C function from <.../cd/include/wd.h>
# double wdCanvasVectorCharSize(cdCanvas* canvas, double size);
double
wdVectorCharSize(canvas,size)
SV* canvas;
double size;
lib/IUP/Internal/Canvas.xs.inc view on Meta::CPAN
# void wdCanvasGetVectorTextBounds(cdCanvas* canvas, const char* s, double x, double y, double *rect);
# canvas:wGetVectorTextBounds(text: string, x, y: number) -> (rect: table) [in Lua]
void
wdGetVectorTextBounds(canvas,s,x,y)
SV* canvas;
const char* s;
double x;
double y;
INIT:
double rect[8];
PPCODE:
wdCanvasGetVectorTextBounds(ref2cnv(canvas),s,x,y,rect);
/* XXX-CHECKLATER maybe return an arrayref */
XPUSHs(sv_2mortal(newSVnv(rect[0]))); /* x0 */
XPUSHs(sv_2mortal(newSVnv(rect[1]))); /* y0 */
XPUSHs(sv_2mortal(newSVnv(rect[2]))); /* x1 */
XPUSHs(sv_2mortal(newSVnv(rect[3]))); /* y1 */
XPUSHs(sv_2mortal(newSVnv(rect[4]))); /* x2 */
XPUSHs(sv_2mortal(newSVnv(rect[5]))); /* y2 */
XPUSHs(sv_2mortal(newSVnv(rect[6]))); /* x3 */
XPUSHs(sv_2mortal(newSVnv(rect[7]))); /* y3 */
lib/IUP/Internal/Canvas_Bitmap.xs.inc view on Meta::CPAN
void
__Bitmap__Pixel(self,x,y,...)
IUP::Canvas::Bitmap self;
int x;
int y;
PREINIT:
unsigned char *data_buffer=NULL, *r=NULL, *g=NULL, *b=NULL, *a=NULL, *m=NULL;
int color_space, plane_size=0, plane_count=0, color_count=0;
int width = self->w;
int height = self->h;
PPCODE:
/* warn("XXX-DEBUG: bitmap.pixel x=%d y=%d items=%d w=%d h=%d\n",x,y,items,width,height); */
/* warn("XXX-DEBUG: rgb=%d rgba=%d\n", (self->type==CD_RGB), (self->type==CD_RGBA)); */
if (x<0 || x>=width || y<0 || y>=height ) {
warn("Error: x or y out of range");
}
else if (self->type==CD_RGBA) {
plane_count = 4;
r = cdBitmapGetData(self, CD_IRED);
g = cdBitmapGetData(self, CD_IGREEN);
b = cdBitmapGetData(self, CD_IBLUE);
lib/IUP/Internal/LibraryIup.xs view on Meta::CPAN
CODE:
{
MY_CXT_CLONE;
MY_CXT.idle_action = newSVsv(&PL_sv_undef);
}
################################################################################
void
_SetIdle(func)
SV* func;
PPCODE:
{
dMY_CXT;
XPUSHs(sv_2mortal(newSVsv(MY_CXT.idle_action))); /* return the old value */
SvSetSV(MY_CXT.idle_action, func);
if (SvOK(func)) {
IupSetFunction("IDLE_ACTION", (Icallback)cb_idle_action);
}
else {
IupSetFunction("IDLE_ACTION", (Icallback)NULL);
}
lib/IUP/Internal/LibraryIup.xs view on Meta::CPAN
CODE:
IupCopyClassAttributes(src_ih,dst_ih);
#### Original C function from <iup.h>
# int IupGetAllClasses(char** names, int max_n);
void
_IupGetAllClasses(...)
INIT:
int i, rv, count, max_n;
char** list = NULL;
PPCODE:
max_n = myST2INT(1);
count = IupGetAllClasses(NULL,0);
if (max_n > 0) count = max_n;
list = malloc( count * sizeof(void*) );
rv = IupGetAllClasses(list,count);
if(GIMME_V == G_ARRAY) {
for(i=0; i<count; i++) XPUSHs(sv_2mortal(newSVpv(list[i],0)));
}
else {
XPUSHs(sv_2mortal(newSViv(rv)));
lib/IUP/Internal/LibraryIup.xs view on Meta::CPAN
#### Original C function from <iup.h>
# void IupTextConvertLinColToPos(Ihandle* ih, int lin, int col, int *pos);
void
_IupTextConvertLinColToPos(ih,lin,col,pos)
Ihandle* ih;
int lin;
int col;
INIT:
int pos;
PPCODE:
IupTextConvertLinColToPos(ih,lin,col,&pos);
XPUSHs(sv_2mortal(newSViv(pos)));
#### Original C function from <iup.h>
# void IupTextConvertPosToLinCol(Ihandle* ih, int pos, int *lin, int *col);
void
_IupTextConvertPosToLinCol(ih,pos)
Ihandle* ih;
int pos;
INIT:
int lin;
int col;
PPCODE:
IupTextConvertPosToLinCol(ih,pos,&lin,&col);
XPUSHs(sv_2mortal(newSViv(lin)));
XPUSHs(sv_2mortal(newSViv(col)));
#### Original C function from <iup.h>
# int IupConvertXYToPos(Ihandle* ih, int x, int y);
int
_IupConvertXYToPos(ih,x,y)
Ihandle* ih;
lib/IUP/Internal/LibraryIup.xs view on Meta::CPAN
RETVAL
#### Original C function from <iup.h>
# void* IupTreeGetUserId(Ihandle* ih, int id);
void
_IupTreeGetUserId(ih,id)
Ihandle* ih;
int id;
INIT:
void* ptr;
PPCODE:
ptr = IupTreeGetUserId(ih,id);
if (ptr==NULL) XPUSHs(sv_2mortal(newSVpv(NULL,0))); /* undef xxxcheckthis */
else XPUSHs(sv_2mortal(newSViv(PTR2IV(ptr))));
#### Original C function from <iup.h>
# int IupTreeGetId(Ihandle* ih, void *userid);
int
_IupTreeGetId(ih,userid)
Ihandle* ih;
SV* userid;
lib/IUP/Internal/LibraryIup.xs view on Meta::CPAN
# int IupGetFile(char *arq);
void
_IupGetFile(arq)
char* arq;
INIT:
int rv;
char tmp[MAXPATHLEN];
/* somehow handle the situation when arq is longer then MAXPATHLEN-1 */
tmp[MAXPATHLEN-1] = 0;
if (arq) strncpy(tmp,arq,MAXPATHLEN-1);
PPCODE:
rv = IupGetFile(tmp);
/*warn("rv=%d a=%s", rv, tmp);*/
/* gonna return array: (retval, filename) */
XPUSHs(sv_2mortal(newSViv(rv)));
if (rv == -1)
XPUSHs(sv_2mortal(newSVpv(NULL,0))); /* undef */
else
XPUSHs(sv_2mortal(newSVpvn_utf8(tmp, strlen(tmp), 1))); /* XPUSHs(sv_2mortal(newSVpv(tmp,0))); */
#### Original C function from <iup.h>
lib/IUP/Internal/LibraryIup.xs view on Meta::CPAN
#### Original C function from <iup.h>
# int IupGetText(const char* title, char* text);
void
_IupGetText(title,text)
char* title;
char* text;
INIT:
int rv;
char newtext[10001]; /* xxx hardcoded length */
PPCODE:
strncpy(newtext, text, 10000);
newtext[10000] = 0;
rv = IupGetText(title,newtext,10000);
/* gonna return text or undef */
XPUSHs(sv_2mortal(newSVpvn_utf8(newtext, strlen(newtext), 1))); /* XPUSHs(sv_2mortal(newSVpv(newtext,0))); */
#### Original C function from <iup.h>
# int IupGetColor(int x, int y, unsigned char* r, unsigned char* g, unsigned char* b);
void
_IupGetColor(x,y,r,g,b)
int x;
int y;
unsigned char r;
unsigned char g;
unsigned char b;
INIT:
int rv;
unsigned char newr = r; /* xxx check this assignment newr=r or newr=*r ? */
unsigned char newg = g;
unsigned char newb = b;
PPCODE:
rv = IupGetColor(x,y,&newr,&newg,&newb);
if (rv == 1) {
/* gonna return array: (newr, newg, newb) */
XPUSHs(sv_2mortal(newSViv(newr)));
XPUSHs(sv_2mortal(newSViv(newg)));
XPUSHs(sv_2mortal(newSViv(newb)));
}
else {
/* gonna return array: (undef, undef, undef) */
/* xxxcheckthis is 3x udef necessary? */
lib/IUP/Internal/LibraryIup.xs view on Meta::CPAN
size = 1024-1;
}
memcpy(param_data[i], s, size+1);
break;
}
param_type[i] = t;
f += line_size;
}
PPCODE:
gp.has_func = 0;
if (SvOK(action)) {
gp.has_func = 1;
gp.obj_initialized = 0;
gp.func_ref = action;
gp.obj_ref = action_data;
}
rv = IupGetParamv(title, cb_param_action, gp_user_data, format, param_count, param_extra, param_data);
lib/IUP/Internal/LibraryIup.xs view on Meta::CPAN
char *title;
SV* list;
SV* SV_op;
SV* SV_max_lin;
SV* SV_max_col;
INIT:
int i, rv, op, max_col, max_lin;
int items = -1;
const char** i_list = NULL;
STRLEN l;
PPCODE:
/* convert undef to 0 */
op = (SvIOK(SV_op)) ? SvIVX(SV_op) : 0;
/* convert undef to -1 */
max_col = (SvIOK(SV_max_col)) ? SvIVX(SV_max_col) : -1;
max_lin = (SvIOK(SV_max_lin)) ? SvIVX(SV_max_lin) : -1;
if ((!SvROK(list)) || (SvTYPE(SvRV(list)) != SVt_PVAV) || ((items = av_len((AV *)SvRV(list))) < 0)) {
warn("Warning: invalid 'list' argument of ListDialog()");
XSRETURN_UNDEF;
}
lib/IUP/Internal/LibraryIup.xs view on Meta::CPAN
SV* marks;
SV* SV_max_lin;
SV* SV_max_col;
INIT:
int i, rv, max_col, max_lin;
int items1 = -1, items2 = -1, items = -1;
const char** i_list = NULL;
int* i_marks = NULL;
STRLEN l;
AV* retmarks;
PPCODE:
/* convert undef to -1 */
max_col = (SvIOK(SV_max_col)) ? SvIVX(SV_max_col) : -1;
max_lin = (SvIOK(SV_max_lin)) ? SvIVX(SV_max_lin) : -1;
if ((!SvROK(list)) || (SvTYPE(SvRV(list)) != SVt_PVAV) || ((items1 = av_len((AV *)SvRV(list))) < 0)) {
warn("Warning: invalid 'list' argument of ListDialog()");
XSRETURN_UNDEF;
}
if (SvOK(marks) && ((!SvROK(marks)) || (SvTYPE(SvRV(marks)) != SVt_PVAV) || ((items2 = av_len((AV *)SvRV(marks))) < 0))) {
lib/IUP/Internal/LibraryIup.xs view on Meta::CPAN
#### Original C function from <iup.h>
#int IUP::GetClassCallbacks(const char* classname, char** names, int max_n);
void
_IupGetClassCallbacks(...)
INIT:
int i, rv, count, max_n;
int items = -1;
char* classname;
char** list = NULL;
PPCODE:
classname = myST2STR(0);
max_n = myST2INT(1);
count = IupGetClassCallbacks(classname,NULL,0);
if (max_n > 0) count = max_n;
list = malloc( count * sizeof(void*) );
rv = IupGetClassCallbacks(classname,list,count);
if(GIMME_V == G_ARRAY) {
for(i=0; i<count; i++) XPUSHs(sv_2mortal(newSVpv(list[i],0)));
}
else {
lib/IUP/Internal/LibraryIup.xs view on Meta::CPAN
if (list != NULL) free(list);
#### Original C function from <iup.h>
# int IupGetAllNames(char** names, int max_n);
void
_IupGetAllNames(...)
INIT:
int i, rv, count, max_n;
int items = -1;
char** list = NULL;
PPCODE:
max_n = myST2INT(0);
count = IupGetAllNames(NULL,0);
if (max_n > 0) count = max_n;
list = malloc( count * sizeof(void*) );
rv = IupGetAllNames(list,count);
if(GIMME_V == G_ARRAY) {
for(i=0; i<count; i++) XPUSHs(sv_2mortal(newSVpv(list[i],0)));
}
else {
XPUSHs(sv_2mortal(newSViv(rv)));
}
if (list != NULL) free(list);
#### Original C function from <iup.h>
# int IupGetAllDialogs(char** names, int max_n);
void
_IupGetAllDialogs(...)
INIT:
int i, rv, count, max_n;
char** list = NULL;
PPCODE:
max_n = myST2INT(0);
count = IupGetAllDialogs(NULL,0);
if (max_n > 0) count = max_n;
list = malloc( count * sizeof(void*) );
rv = IupGetAllDialogs(list,count);
if(GIMME_V == G_ARRAY) {
for(i=0; i<count; i++) XPUSHs(sv_2mortal(newSVpv(list[i],0)));
}
else {
XPUSHs(sv_2mortal(newSViv(rv)));
lib/IUP/Internal/LibraryIup.xs view on Meta::CPAN
if (list != NULL) free(list);
#### Original C function from <iup.h>
# int IupGetClassAttributes(const char* classname, char** names, int max_n);
void
_IupGetClassAttributes(classname,...)
const char* classname;
INIT:
int i, rv, count, max_n;
char** list = NULL;
PPCODE:
max_n = myST2INT(1);
count = IupGetClassAttributes(classname,NULL,0);
if (max_n > 0) count = max_n;
list = malloc( count * sizeof(void*) );
rv = IupGetClassAttributes(classname,list,count);
if(GIMME_V == G_ARRAY) {
for(i=0; i<count; i++) XPUSHs(sv_2mortal(newSVpv(list[i],0)));
}
else {
XPUSHs(sv_2mortal(newSViv(rv)));
lib/IUP/Internal/LibraryIup.xs view on Meta::CPAN
if (list != NULL) free(list);
#### Original C function from <iup.h>
# int IupGetAllAttributes(Ihandle* ih, char** names, int max_n);
void
_IupGetAllAttributes(ih,...)
Ihandle* ih;
INIT:
int i, rv, count, max_n;
char** list = NULL;
PPCODE:
max_n = myST2INT(1);
count = IupGetAllAttributes(ih,NULL,0);
if (max_n > 0) count = max_n;
list = malloc( count * sizeof(void*) );
rv = IupGetAllAttributes(ih,list,count);
#warn("[DEBUG.XS] rv=%d count=%d\n", rv, count); /* xxx why are these values different? */
if(GIMME_V == G_ARRAY) {
for(i=0; i<rv; i++) XPUSHs(sv_2mortal(newSVpv(list[i],0)));
}
else {
lib/IUP/Internal/MglPlot.xs.inc view on Meta::CPAN
free(ypointers);
free(zpointers);
}
#endif
#### Original C function from <iup_mglplot.h> # void IupMglPlotTransform(Ihandle* ih, double x, double y, double z, int *ix, int *iy);
void
_IupMglPlotTransform(Ihandle* ih, double x, double y, double z)
INIT:
int ix, iy;
PPCODE:
#ifdef HAVELIB_IUP_MGLPLOT
IupMglPlotTransform(ih,x,y,z,&ix,&iy);
XPUSHs(sv_2mortal(newSViv(ix)));
XPUSHs(sv_2mortal(newSViv(iy)));
#endif
#### Original C function from <iup_mglplot.h> # void IupMglPlotTransformTo(Ihandle* ih, int ix, int iy, double *x, double *y, double *z);
void
_IupMglPlotTransformTo(Ihandle* ih, int ix, int iy)
INIT:
double x, y, z;
PPCODE:
#ifdef HAVELIB_IUP_MGLPLOT
IupMglPlotTransformTo(ih,ix,iy,&x,&y,&z);
XPUSHs(sv_2mortal(newSVnv(x)));
XPUSHs(sv_2mortal(newSVnv(y)));
XPUSHs(sv_2mortal(newSVnv(z)));
#endif
#### Original C function from <iup_mglplot.h> # void IupMglPlotPaintTo(Ihandle *ih, const char* format, int w, int h, double dpi, void *data);
void
_IupMglPlotPaintTo(Ihandle* ih, char* format, int w, int h, double dpi, char *data)
lib/IUP/Internal/PPlot.xs.inc view on Meta::CPAN
#### Original C function from <iup_pplot.h>
# void IupPPlotTransform(Ihandle* ih, float x, float y, int *ix, int *iy);
void
_IupPPlotTransform(ih,x,y);
Ihandle* ih;
float x;
float y
INIT:
int ix;
int iy;
PPCODE:
#ifdef HAVELIB_IUP_PPLOT
IupPPlotTransform(ih,x,y,&ix,&iy);
XPUSHs(sv_2mortal(newSViv(ix)));
XPUSHs(sv_2mortal(newSViv(iy)));
#endif
#### Original C function from <iup_pplot.h>
# void IupPPlotPaintTo(Ihandle *ih, void *cnv);
void
_IupPPlotPaintTo(ih,cnv)
lib/IUP/Internal/Plot.xs.inc view on Meta::CPAN
#### Original C function from <iup_plot.h>
# void IupPlotTransform(Ihandle* ih, double x, double y, double *cnv_x, double *cnv_y); [in C]
void
_IupPlotTransform(ih,x,y);
Ihandle* ih;
double x;
double y
INIT:
double cnv_x;
double cnv_y;
PPCODE:
#ifdef HAVELIB_IUP_PLOT
IupPlotTransform(ih,x,y,&cnv_x,&cnv_y);
XPUSHs(sv_2mortal(newSVnv(cnv_x)));
XPUSHs(sv_2mortal(newSVnv(cnv_y)));
#endif
#### Original C function from <iup_plot.h>
# void IupPlotTransformTo(Ihandle* ih, double cnv_x, double cnv_y, double *x, double *y); [in C]
void
_IupPlotTransformTo(ih,cnv_x,cnv_y);
Ihandle* ih;
double cnv_x;
double cnv_y;
INIT:
double x;
double y;
PPCODE:
#ifdef HAVELIB_IUP_PLOT
IupPlotTransformTo(ih,cnv_x,cnv_y,&x,&y);
XPUSHs(sv_2mortal(newSVnv(cnv_x)));
XPUSHs(sv_2mortal(newSVnv(cnv_y)));
#endif
#### Original C function from <iup_plot.h>
# void IupPlotPaintTo(Ihandle *ih, void *cnv);
void
_IupPlotPaintTo(ih,cnv)