├── .gitignore ├── CREDITS ├── EXPERIMENTAL ├── README.md ├── cd5 ├── cd.lib ├── cdcairo.lib ├── cdcontextplus.lib ├── cddirect2d.lib ├── cdgl.lib ├── cdim.lib ├── cdpdf.lib ├── freetype6.lib ├── ftgl.lib ├── ftgl_debug.lib ├── include │ ├── cd.h │ ├── cd_canvas.hpp │ ├── cd_old.h │ ├── cd_plus.h │ ├── cd_private.h │ ├── cdcairo.h │ ├── cdcgm.h │ ├── cdclipbd.h │ ├── cddbuf.h │ ├── cddebug.h │ ├── cddgn.h │ ├── cddirect2d.h │ ├── cddxf.h │ ├── cdemf.h │ ├── cdgdiplus.h │ ├── cdgl.h │ ├── cdim.h │ ├── cdimage.h │ ├── cdirgb.h │ ├── cdiup.h │ ├── cdlua.h │ ├── cdlua3_private.h │ ├── cdlua5_private.h │ ├── cdluagl.h │ ├── cdluaim.h │ ├── cdluaiup.h │ ├── cdluapdf.h │ ├── cdmf.h │ ├── cdmf_private.h │ ├── cdnative.h │ ├── cdpdf.h │ ├── cdpicture.h │ ├── cdpptx.h │ ├── cdprint.h │ ├── cdps.h │ ├── cdsvg.h │ ├── cdwmf.h │ ├── wd.h │ └── wd_old.h ├── pdflib.lib └── zlib1.lib ├── config.m4 ├── config.w32 ├── examples └── tutorial │ ├── example2_1.php │ ├── example2_2.php │ ├── example2_3.php │ ├── example2_4.php │ ├── example2_5.php │ ├── example3_1.php │ ├── example3_10.php │ ├── example3_11.php │ ├── example3_2.php │ ├── example3_3.php │ ├── example3_4.php │ ├── example3_5.php │ ├── example3_6.php │ ├── example3_7.php │ ├── example3_8.php │ └── example3_9.php ├── im3 ├── im.lib ├── im_avi.lib ├── im_capture.lib ├── im_fftw.lib ├── im_fftw3.lib ├── im_jp2.lib ├── im_lzo.lib ├── im_process.lib ├── im_process_omp.lib ├── im_wmv.lib ├── include │ ├── im.h │ ├── im_attrib.h │ ├── im_attrib_flat.h │ ├── im_binfile.h │ ├── im_capture.h │ ├── im_color.h │ ├── im_colorhsi.h │ ├── im_complex.h │ ├── im_convert.h │ ├── im_counter.h │ ├── im_dib.h │ ├── im_file.h │ ├── im_format.h │ ├── im_format_all.h │ ├── im_format_avi.h │ ├── im_format_ecw.h │ ├── im_format_jp2.h │ ├── im_format_raw.h │ ├── im_format_wmv.h │ ├── im_image.h │ ├── im_kernel.h │ ├── im_lib.h │ ├── im_math.h │ ├── im_math_op.h │ ├── im_old.h │ ├── im_palette.h │ ├── im_plus.h │ ├── im_process.h │ ├── im_process_ana.h │ ├── im_process_glo.h │ ├── im_process_loc.h │ ├── im_process_pnt.h │ ├── im_raw.h │ ├── im_util.h │ └── imlua.h └── zlib1.lib ├── iup.c ├── iup.php ├── iup3 ├── etc │ ├── iup.manifest │ ├── iup.rc │ ├── iup64.manifest │ ├── iupemscripten_shell.html │ ├── iupstub.c │ ├── pen.cur │ └── tecgraf.ico ├── freetype6.lib ├── ftgl.lib ├── include │ ├── iup.h │ ├── iup_class_cbs.hpp │ ├── iup_config.h │ ├── iup_export.h │ ├── iup_mglplot.h │ ├── iup_plot.h │ ├── iup_plus.h │ ├── iup_scintilla.h │ ├── iup_varg.h │ ├── iupcbs.h │ ├── iupcontrols.h │ ├── iupdef.h │ ├── iupdraw.h │ ├── iupdraw_cd.h │ ├── iupfiledlg.h │ ├── iupgl.h │ ├── iupglcontrols.h │ ├── iupim.h │ ├── iupkey.h │ ├── iuplua.h │ ├── iuplua_mglplot.h │ ├── iuplua_plot.h │ ├── iuplua_scintilla.h │ ├── iupluacontrols.h │ ├── iupluafiledlg.h │ ├── iupluagl.h │ ├── iupluaglcontrols.h │ ├── iupluaim.h │ ├── iupluaole.h │ ├── iupluascripterdlg.h │ ├── iupluatuio.h │ ├── iupluaweb.h │ ├── iupole.h │ ├── iuptuio.h │ └── iupweb.h ├── iup.lib ├── iup_mglplot.lib ├── iup_plot.lib ├── iup_scintilla.lib ├── iupcd.lib ├── iupcontrols.lib ├── iupfiledlg.lib ├── iupgl.lib ├── iupglcontrols.lib ├── iupim.lib ├── iupimglib.lib ├── iupole.lib ├── iuptuio.lib ├── iupweb.lib └── zlib1.lib ├── iup_events.c ├── iup_ext.c ├── iup_main.c ├── iup_more.c ├── php_iup.h └── tests └── 001.phpt /.gitignore: -------------------------------------------------------------------------------- 1 | .deps 2 | *.lo 3 | *.la 4 | .libs 5 | acinclude.m4 6 | aclocal.m4 7 | autom4te.cache 8 | build 9 | config.guess 10 | config.h 11 | config.h.in 12 | config.log 13 | config.nice 14 | config.status 15 | config.sub 16 | configure 17 | configure.ac 18 | install-sh 19 | libtool 20 | ltmain.sh 21 | Makefile 22 | Makefile.fragments 23 | Makefile.global 24 | Makefile.objects 25 | missing 26 | mkinstalldirs 27 | modules 28 | run-tests.php 29 | tests/*/*.diff 30 | tests/*/*.out 31 | tests/*/*.php 32 | tests/*/*.exp 33 | tests/*/*.log 34 | tests/*/*.sh 35 | /iup3/ftgl_debug.lib 36 | /iup3/iup_mglplot_debug.lib 37 | /iup3/iup_scintilla_debug.lib 38 | -------------------------------------------------------------------------------- /CREDITS: -------------------------------------------------------------------------------- 1 | iup -------------------------------------------------------------------------------- /EXPERIMENTAL: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chinenkai/php-iup/3e1a020992ee46d414d0627e6bd3de2724bf1724/EXPERIMENTAL -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # php-iup 2 | PHP-IUP is a language binding for IUP ( http://webserver2.tecgraf.puc-rio.br/iup/ ), it allows you to write windows desktop application with the PHP language. 3 | 4 | 这个项目,让php开发者可以开发传统桌面软件,iup提供了很足的基本控件,满足大部分简单需求。 5 | 6 | 这是一个练手项目,C语言是去年一边写这个项目一边学的,所以代码谈不上好看,有一些乱七八糟。 7 | 8 | 目前存在的PHP GUI框架不少,但基本都停止更新了,包括PHP官方的UI框架——很不幸,这个项目从1.0发布后,也会进入半停止更新状态。只会更新iup版本和修复bug,不做代码重构之类的事情。 9 | -------------------------------------------------------------------------------- /cd5/cd.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chinenkai/php-iup/3e1a020992ee46d414d0627e6bd3de2724bf1724/cd5/cd.lib -------------------------------------------------------------------------------- /cd5/cdcairo.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chinenkai/php-iup/3e1a020992ee46d414d0627e6bd3de2724bf1724/cd5/cdcairo.lib -------------------------------------------------------------------------------- /cd5/cdcontextplus.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chinenkai/php-iup/3e1a020992ee46d414d0627e6bd3de2724bf1724/cd5/cdcontextplus.lib -------------------------------------------------------------------------------- /cd5/cddirect2d.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chinenkai/php-iup/3e1a020992ee46d414d0627e6bd3de2724bf1724/cd5/cddirect2d.lib -------------------------------------------------------------------------------- /cd5/cdgl.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chinenkai/php-iup/3e1a020992ee46d414d0627e6bd3de2724bf1724/cd5/cdgl.lib -------------------------------------------------------------------------------- /cd5/cdim.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chinenkai/php-iup/3e1a020992ee46d414d0627e6bd3de2724bf1724/cd5/cdim.lib -------------------------------------------------------------------------------- /cd5/cdpdf.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chinenkai/php-iup/3e1a020992ee46d414d0627e6bd3de2724bf1724/cd5/cdpdf.lib -------------------------------------------------------------------------------- /cd5/freetype6.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chinenkai/php-iup/3e1a020992ee46d414d0627e6bd3de2724bf1724/cd5/freetype6.lib -------------------------------------------------------------------------------- /cd5/ftgl.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chinenkai/php-iup/3e1a020992ee46d414d0627e6bd3de2724bf1724/cd5/ftgl.lib -------------------------------------------------------------------------------- /cd5/ftgl_debug.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chinenkai/php-iup/3e1a020992ee46d414d0627e6bd3de2724bf1724/cd5/ftgl_debug.lib -------------------------------------------------------------------------------- /cd5/include/cd_old.h: -------------------------------------------------------------------------------- 1 | /** \file 2 | * \brief Old User API 3 | * 4 | * See Copyright Notice in cd.h 5 | */ 6 | 7 | #ifndef __CD_OLD_H 8 | #define __CD_OLD_H 9 | 10 | #ifdef __cplusplus 11 | extern "C" { 12 | #endif 13 | 14 | 15 | /* canvas control */ 16 | int cdActivate(cdCanvas* canvas); 17 | cdCanvas* cdActiveCanvas(void); 18 | int cdSimulate(int mode); 19 | void cdFlush(void); 20 | void cdClear(void); 21 | cdState* cdSaveState(void); 22 | void cdRestoreState(cdState* state); 23 | void cdSetAttribute(const char* name, char* data); 24 | void cdSetfAttribute(const char* name, const char* format, ...); 25 | char* cdGetAttribute(const char* name); 26 | cdContext* cdGetContext(cdCanvas* canvas); 27 | 28 | /* interpretation */ 29 | int cdRegisterCallback(cdContext *context, int cb, cdCallback func); 30 | int cdPlay(cdContext *context, int xmin, int xmax, int ymin, int ymax, void *data); 31 | 32 | /* coordinate transformation */ 33 | void cdGetCanvasSize(int *width, int *height, double *width_mm, double *height_mm); 34 | int cdUpdateYAxis(int *y); 35 | void cdMM2Pixel(double mm_dx, double mm_dy, int *dx, int *dy); 36 | void cdPixel2MM(int dx, int dy, double *mm_dx, double *mm_dy); 37 | void cdOrigin(int x, int y); 38 | 39 | /* clipping */ 40 | int cdClip(int mode); 41 | int * cdGetClipPoly(int *n); 42 | void cdClipArea(int xmin, int xmax, int ymin, int ymax); 43 | int cdGetClipArea(int *xmin, int *xmax, int *ymin, int *ymax); 44 | 45 | /* clipping region */ 46 | int cdPointInRegion(int x, int y); 47 | void cdOffsetRegion(int x, int y); 48 | void cdRegionBox(int *xmin, int *xmax, int *ymin, int *ymax); 49 | int cdRegionCombineMode(int mode); 50 | 51 | /* primitives */ 52 | void cdPixel(int x, int y, long color); 53 | void cdMark(int x, int y); 54 | void cdLine(int x1, int y1, int x2, int y2); 55 | void cdBegin(int mode); 56 | void cdVertex(int x, int y); 57 | void cdEnd(void); 58 | void cdRect(int xmin, int xmax, int ymin, int ymax); 59 | void cdBox(int xmin, int xmax, int ymin, int ymax); 60 | void cdArc(int xc, int yc, int w, int h, double angle1, double angle2); 61 | void cdSector(int xc, int yc, int w, int h, double angle1, double angle2); 62 | void cdChord(int xc, int yc, int w, int h, double angle1, double angle2); 63 | void cdText(int x, int y, const char* s); 64 | 65 | /* attributes */ 66 | long cdBackground(long color); 67 | long cdForeground(long color); 68 | int cdBackOpacity(int opacity); 69 | int cdWriteMode(int mode); 70 | int cdLineStyle(int style); 71 | void cdLineStyleDashes(const int* dashes, int count); 72 | int cdLineWidth(int width); 73 | int cdLineJoin(int join); 74 | int cdLineCap(int cap); 75 | int cdInteriorStyle(int style); 76 | int cdHatch(int style); 77 | void cdStipple(int w, int h, const unsigned char* stipple); 78 | unsigned char* cdGetStipple(int *n, int *m); 79 | void cdPattern(int w, int h, const long *pattern); 80 | long* cdGetPattern(int* n, int* m); 81 | int cdFillMode(int mode); 82 | void cdFont(int type_face, int style, int size); 83 | void cdGetFont(int *type_face, int *style, int *size); 84 | char* cdNativeFont(const char* font); 85 | int cdTextAlignment(int alignment); 86 | double cdTextOrientation(double angle); 87 | int cdMarkType(int type); 88 | int cdMarkSize(int size); 89 | 90 | /* vector text */ 91 | void cdVectorText(int x, int y, const char* s); 92 | void cdMultiLineVectorText(int x, int y, const char* s); 93 | 94 | /* vector text attributes */ 95 | char *cdVectorFont(const char *filename); 96 | void cdVectorTextDirection(int x1, int y1, int x2, int y2); 97 | double* cdVectorTextTransform(const double* matrix); 98 | void cdVectorTextSize(int size_x, int size_y, const char* s); 99 | int cdVectorCharSize(int size); 100 | 101 | /* vector text properties */ 102 | void cdGetVectorTextSize(const char* s, int *x, int *y); 103 | void cdGetVectorTextBounds(const char* s, int x, int y, int *rect); 104 | 105 | /* properties */ 106 | void cdFontDim(int *max_width, int *height, int *ascent, int *descent); 107 | void cdTextSize(const char* s, int *width, int *height); 108 | void cdTextBox(int x, int y, const char* s, int *xmin, int *xmax, int *ymin, int *ymax); 109 | void cdTextBounds(int x, int y, const char* s, int *rect); 110 | int cdGetColorPlanes(void); 111 | 112 | /* color */ 113 | void cdPalette(int n, const long* palette, int mode); 114 | 115 | /* client images */ 116 | void cdGetImageRGB(unsigned char* r, unsigned char* g, unsigned char* b, int x, int y, int w, int h); 117 | void cdPutImageRectRGB(int iw, int ih, const unsigned char* r, const unsigned char* g, const unsigned char* b, int x, int y, int w, int h, int xmin, int xmax, int ymin, int ymax); 118 | void cdPutImageRectRGBA(int iw, int ih, const unsigned char* r, const unsigned char* g, const unsigned char* b, const unsigned char* a, int x, int y, int w, int h, int xmin, int xmax, int ymin, int ymax); 119 | void cdPutImageRectMap(int iw, int ih, const unsigned char* index, const long* colors, int x, int y, int w, int h, int xmin, int xmax, int ymin, int ymax); 120 | 121 | /* defined for backward compatibility */ 122 | #define cdPutImageRGB(iw, ih, r, g, b, x, y, w, h) cdPutImageRectRGB((iw), (ih), (r), (g), (b), (x), (y), (w), (h), 0, 0, 0, 0) 123 | #define cdPutImageRGBA(iw, ih, r, g, b, a, x, y, w, h) cdPutImageRectRGBA((iw), (ih), (r), (g), (b), (a), (x), (y), (w), (h), 0, 0, 0, 0) 124 | #define cdPutImageMap(iw, ih, index, colors, x, y, w, h) cdPutImageRectMap((iw), (ih), (index), (colors), (x), (y), (w), (h), 0, 0, 0, 0) 125 | #define cdPutImage(image, x, y) cdPutImageRect((image), (x), (y), 0, 0, 0, 0) 126 | 127 | /* server images */ 128 | cdImage* cdCreateImage(int w, int h); 129 | void cdGetImage(cdImage* image, int x, int y); 130 | void cdPutImageRect(cdImage* image, int x, int y, int xmin, int xmax, int ymin, int ymax); 131 | void cdScrollArea(int xmin, int xmax, int ymin, int ymax, int dx, int dy); 132 | 133 | /* bitmap */ 134 | void cdPutBitmap(cdBitmap* bitmap, int x, int y, int w, int h); 135 | void cdGetBitmap(cdBitmap* bitmap, int x, int y); 136 | 137 | enum { /* OLD type face -> new names */ 138 | CD_SYSTEM, /* "System" */ 139 | CD_COURIER, /* "Courier" */ 140 | CD_TIMES_ROMAN, /* "Times" */ 141 | CD_HELVETICA, /* "Helvetica" */ 142 | CD_NATIVE 143 | }; 144 | 145 | /* OLD definitions, defined for backward compatibility */ 146 | #define CD_CLIPON CD_CLIPAREA 147 | #define CD_CENTER_BASE CD_BASE_CENTER 148 | #define CD_LEFT_BASE CD_BASE_LEFT 149 | #define CD_RIGHT_BASE CD_BASE_RIGHT 150 | #define CD_ITALIC_BOLD CD_BOLD_ITALIC 151 | #define cdScrollImage cdScrollArea 152 | #define cdCanvas2Raster(x, y) {(void)x; cdUpdateYAxis(y);} 153 | 154 | #ifdef __cplusplus 155 | } 156 | #endif 157 | 158 | #endif 159 | -------------------------------------------------------------------------------- /cd5/include/cdcairo.h: -------------------------------------------------------------------------------- 1 | /** \file 2 | * \brief Cairo extra drivers. 3 | * Rendering PDF, PS, SVG and IMAGERGB. 4 | * 5 | * See Copyright Notice in cd.h 6 | */ 7 | 8 | #ifndef __CD_CAIRO_H 9 | #define __CD_CAIRO_H 10 | 11 | #ifdef __cplusplus 12 | extern "C" { 13 | #endif 14 | 15 | /* Some of these context can be used directly or by cdInitContextPlus, 16 | as CD_NATIVEWINDOW, CD_IMAGE, CD_EMF, CD_PRINTER and CD_DBUFFER. 17 | The others only directly. 18 | */ 19 | 20 | cdContext* cdContextCairoNativeWindow(void); 21 | cdContext* cdContextCairoImage(void); 22 | cdContext* cdContextCairoDBuffer(void); 23 | cdContext* cdContextCairoPrinter(void); 24 | cdContext* cdContextCairoPS(void); 25 | cdContext* cdContextCairoPDF(void); 26 | cdContext* cdContextCairoSVG(void); 27 | cdContext* cdContextCairoImageRGB(void); 28 | cdContext* cdContextCairoEMF(void); 29 | 30 | #define CD_CAIRO_NATIVEWINDOW cdContextCairoNativeWindow() 31 | #define CD_CAIRO_IMAGE cdContextCairoImage() 32 | #define CD_CAIRO_DBUFFER cdContextCairoDBuffer() 33 | #define CD_CAIRO_PRINTER cdContextCairoPrinter() 34 | #define CD_CAIRO_PS cdContextCairoPS() 35 | #define CD_CAIRO_PDF cdContextCairoPDF() 36 | #define CD_CAIRO_SVG cdContextCairoSVG() 37 | #define CD_CAIRO_IMAGERGB cdContextCairoImageRGB() 38 | #define CD_CAIRO_EMF cdContextCairoEMF() 39 | 40 | 41 | #ifdef __cplusplus 42 | } 43 | #endif 44 | 45 | #endif /* ifndef __CD_CAIRO_ */ 46 | -------------------------------------------------------------------------------- /cd5/include/cdcgm.h: -------------------------------------------------------------------------------- 1 | /** \file 2 | * \brief CGM driver 3 | * 4 | * See Copyright Notice in cd.h 5 | */ 6 | 7 | #ifndef __CD_CGM_H 8 | #define __CD_CGM_H 9 | 10 | #ifdef __cplusplus 11 | extern "C" { 12 | #endif 13 | 14 | cdContext* cdContextCGM(void); 15 | #define CD_CGM cdContextCGM() 16 | 17 | #define CD_CGMCOUNTERCB 1 18 | #define CD_CGMSCLMDECB 2 19 | #define CD_CGMVDCEXTCB 3 20 | #define CD_CGMBEGPICTCB 4 21 | #define CD_CGMBEGPICTBCB 5 22 | #define CD_CGMBEGMTFCB 6 23 | 24 | /* OLD definitions, defined for backward compatibility */ 25 | #define CDPLAY_ABORT CD_ABORT 26 | #define CDPLAY_GO CD_CONTINUE 27 | 28 | #ifdef __cplusplus 29 | } 30 | #endif 31 | 32 | #endif /* ifndef __CD_CGM_ */ 33 | 34 | 35 | -------------------------------------------------------------------------------- /cd5/include/cdclipbd.h: -------------------------------------------------------------------------------- 1 | /** \file 2 | * \brief Clipboard driver 3 | * 4 | * See Copyright Notice in cd.h 5 | */ 6 | 7 | #ifndef __CD_CLIPBOARD_H 8 | #define __CD_CLIPBOARD_H 9 | 10 | #ifdef __cplusplus 11 | extern "C" { 12 | #endif 13 | 14 | cdContext* cdContextClipboard(void); 15 | 16 | #define CD_CLIPBOARD cdContextClipboard() 17 | 18 | #ifdef __cplusplus 19 | } 20 | #endif 21 | 22 | #endif 23 | -------------------------------------------------------------------------------- /cd5/include/cddbuf.h: -------------------------------------------------------------------------------- 1 | /** \file 2 | * \brief Double Buffer driver 3 | * 4 | * See Copyright Notice in cd.h 5 | */ 6 | 7 | #ifndef __CD_DBUF_H 8 | #define __CD_DBUF_H 9 | 10 | #ifdef __cplusplus 11 | extern "C" { 12 | #endif 13 | 14 | cdContext* cdContextDBuffer(void); 15 | 16 | #define CD_DBUFFER cdContextDBuffer() 17 | 18 | #ifdef __cplusplus 19 | } 20 | #endif 21 | 22 | #endif /* ifndef __CD_DBUF_ */ 23 | 24 | -------------------------------------------------------------------------------- /cd5/include/cddebug.h: -------------------------------------------------------------------------------- 1 | /** \file 2 | * \brief CD Debug driver 3 | * 4 | * See Copyright Notice in cd.h 5 | */ 6 | 7 | #ifndef __CD_DEBUG_H 8 | #define __CD_DEBUG_H 9 | 10 | #ifdef __cplusplus 11 | extern "C" { 12 | #endif 13 | 14 | cdContext* cdContextDebug(void); 15 | 16 | #define CD_DEBUG cdContextDebug() 17 | 18 | #ifdef __cplusplus 19 | } 20 | #endif 21 | 22 | #endif /* ifndef __CD_DEBUG_H */ 23 | 24 | 25 | -------------------------------------------------------------------------------- /cd5/include/cddgn.h: -------------------------------------------------------------------------------- 1 | /** \file 2 | * \brief DGN driver 3 | * 4 | * See Copyright Notice in cd.h 5 | */ 6 | 7 | #ifndef __CD_DGN_H 8 | #define __CD_DGN_H 9 | 10 | #ifdef __cplusplus 11 | extern "C" { 12 | #endif 13 | 14 | cdContext* cdContextDGN(void); 15 | 16 | #define CD_DGN cdContextDGN() 17 | 18 | #ifdef __cplusplus 19 | } 20 | #endif 21 | 22 | #endif /* ifndef __CD_DGN_ */ 23 | 24 | -------------------------------------------------------------------------------- /cd5/include/cddirect2d.h: -------------------------------------------------------------------------------- 1 | /** \file 2 | * \brief Direct2D extra drivers. 3 | * 4 | * See Copyright Notice in cd.h 5 | */ 6 | 7 | #ifndef __CD_DIRECT2D_H 8 | #define __CD_DIRECT2D_H 9 | 10 | #ifdef __cplusplus 11 | extern "C" { 12 | #endif 13 | 14 | 15 | cdContext* cdContextDirect2DNativeWindow(void); /* already double buffered */ 16 | cdContext* cdContextDirect2DImage(void); /* to draw on an image */ 17 | cdContext* cdContextDirect2DImageRGB(void); /* to draw on an RGBA image */ 18 | cdContext* cdContextDirect2DDBuffer(void); /* Not necessary, used to test image drawing */ 19 | cdContext* cdContextDirect2DPrinter(void); /* NOT working */ 20 | 21 | #define CD_DIRECT2D_NATIVEWINDOW cdContextDirect2DNativeWindow() 22 | #define CD_DIRECT2D_IMAGE cdContextDirect2DImage() 23 | #define CD_DIRECT2D_IMAGERGB cdContextDirect2DImageRGB() 24 | #define CD_DIRECT2D_DBUFFER cdContextDirect2DDBuffer() 25 | #define CD_DIRECT2D_PRINTER cdContextDirect2DPrinter() 26 | 27 | void cdInitDirect2D(void); 28 | void cdFinishDirect2D(void); 29 | 30 | 31 | #ifdef __cplusplus 32 | } 33 | #endif 34 | 35 | #endif /* ifndef __CD_DIRECT2D_H */ 36 | -------------------------------------------------------------------------------- /cd5/include/cddxf.h: -------------------------------------------------------------------------------- 1 | /** \file 2 | * \brief DXF driver 3 | * 4 | * See Copyright Notice in cd.h 5 | */ 6 | 7 | #ifndef __CD_DXF_H 8 | #define __CD_DXF_H 9 | 10 | #ifdef __cplusplus 11 | extern "C" { 12 | #endif 13 | 14 | cdContext* cdContextDXF(void); 15 | 16 | #define CD_DXF cdContextDXF() 17 | 18 | #ifdef __cplusplus 19 | } 20 | #endif 21 | 22 | #endif /* ifndef __CD_DXF_ */ 23 | -------------------------------------------------------------------------------- /cd5/include/cdemf.h: -------------------------------------------------------------------------------- 1 | /** \file 2 | * \brief EMF driver 3 | * 4 | * See Copyright Notice in cd.h 5 | */ 6 | 7 | #ifndef __CD_EMF_H 8 | #define __CD_EMF_H 9 | 10 | #ifdef __cplusplus 11 | extern "C" { 12 | #endif 13 | 14 | cdContext* cdContextEMF(void); 15 | 16 | #define CD_EMF cdContextEMF() 17 | 18 | #ifdef __cplusplus 19 | } 20 | #endif 21 | 22 | #endif 23 | -------------------------------------------------------------------------------- /cd5/include/cdgdiplus.h: -------------------------------------------------------------------------------- 1 | /** \file 2 | * \brief GDI+ Control 3 | * 4 | * See Copyright Notice in cd.h 5 | */ 6 | 7 | #ifndef __CD_GDIPLUS_H 8 | #define __CD_GDIPLUS_H 9 | 10 | #ifdef __cplusplus 11 | extern "C" { 12 | #endif 13 | 14 | #ifdef WIN32 15 | void cdInitGdiPlus(void); /* old function, replaced by cdInitContextPlus */ 16 | #else 17 | #define cdInitGdiPlus() (0) 18 | #endif 19 | 20 | /* Windows GDI+ Adicional Polygons */ 21 | #define CD_SPLINE (CD_POLYCUSTOM+0) 22 | #define CD_FILLSPLINE (CD_POLYCUSTOM+1) 23 | #define CD_FILLGRADIENT (CD_POLYCUSTOM+2) 24 | 25 | #ifdef __cplusplus 26 | } 27 | #endif 28 | 29 | #endif /* ifndef _CD_GDIPLUS_ */ 30 | -------------------------------------------------------------------------------- /cd5/include/cdgl.h: -------------------------------------------------------------------------------- 1 | /** \file 2 | * \brief OpenGL driver 3 | * 4 | * See Copyright Notice in cd.h 5 | */ 6 | 7 | #ifndef __CD_GL_H 8 | #define __CD_GL_H 9 | 10 | #ifdef __cplusplus 11 | extern "C" { 12 | #endif 13 | 14 | cdContext* cdContextGL(void); 15 | 16 | #define CD_GL cdContextGL() 17 | 18 | #ifdef __cplusplus 19 | } 20 | #endif 21 | 22 | #endif /* ifndef __CD_GL_ */ 23 | 24 | -------------------------------------------------------------------------------- /cd5/include/cdim.h: -------------------------------------------------------------------------------- 1 | /** \file 2 | * \brief imImage driver 3 | * 4 | * See Copyright Notice in cd.h 5 | */ 6 | 7 | #ifndef __CD_IM_H 8 | #define __CD_IM_H 9 | 10 | #ifdef __cplusplus 11 | extern "C" { 12 | #endif 13 | 14 | cdContext* cdContextImImage(void); 15 | 16 | #define CD_IMIMAGE cdContextImImage() 17 | 18 | 19 | #ifdef __IM_IMAGE_H 20 | void cdCanvasPatternImImage(cdCanvas* canvas, const imImage* image); 21 | void cdCanvasStippleImImage(cdCanvas* canvas, const imImage* image); 22 | void cdCanvasPutImImage(cdCanvas* canvas, const imImage* image, int x, int y, int w, int h); 23 | void cdCanvasGetImImage(cdCanvas* canvas, imImage* image, int x, int y); 24 | void cdfCanvasPutImImage(cdCanvas* canvas, const imImage* image, double x, double y, double w, double h); 25 | void wdCanvasPutImImage(cdCanvas* canvas, const imImage* image, double x, double y, double w, double h); 26 | void wdCanvasGetImImage(cdCanvas* canvas, imImage* image, double x, double y); 27 | #endif 28 | 29 | #ifdef __cplusplus 30 | } 31 | #endif 32 | 33 | #endif /* ifndef __CD_IM_ */ 34 | -------------------------------------------------------------------------------- /cd5/include/cdimage.h: -------------------------------------------------------------------------------- 1 | /** \file 2 | * \brief Server Image driver 3 | * 4 | * See Copyright Notice in cd.h 5 | */ 6 | 7 | #ifndef __CD_IMAGE_H 8 | #define __CD_IMAGE_H 9 | 10 | #ifdef __cplusplus 11 | extern "C" { 12 | #endif 13 | 14 | cdContext* cdContextImage(void); 15 | 16 | #define CD_IMAGE cdContextImage() 17 | 18 | #ifdef __cplusplus 19 | } 20 | #endif 21 | 22 | #endif /* ifndef __CD_IMAGE_ */ 23 | 24 | -------------------------------------------------------------------------------- /cd5/include/cdirgb.h: -------------------------------------------------------------------------------- 1 | /** \file 2 | * \brief IMAGERGB driver 3 | * 4 | * See Copyright Notice in cd.h 5 | */ 6 | 7 | #ifndef __CD_IRGB_H 8 | #define __CD_IRGB_H 9 | 10 | #ifdef __cplusplus 11 | extern "C" { 12 | #endif 13 | 14 | cdContext* cdContextImageRGB(void); 15 | cdContext* cdContextDBufferRGB(void); 16 | 17 | #define CD_IMAGERGB cdContextImageRGB() 18 | #define CD_DBUFFERRGB cdContextDBufferRGB() 19 | 20 | /* DEPRECATED functions, use REDIMAGE, GREENIMAGE, 21 | BLUEIMAGE, and ALPHAIMAGE attributes. */ 22 | unsigned char* cdRedImage(cdCanvas* cnv); 23 | unsigned char* cdGreenImage(cdCanvas* cnv); 24 | unsigned char* cdBlueImage(cdCanvas* cnv); 25 | unsigned char* cdAlphaImage(cdCanvas* cnv); 26 | 27 | 28 | #ifdef __cplusplus 29 | } 30 | #endif 31 | 32 | #endif /* ifndef __CD_IRGB_ */ 33 | -------------------------------------------------------------------------------- /cd5/include/cdiup.h: -------------------------------------------------------------------------------- 1 | /** \file 2 | * \brief IUP driver 3 | * 4 | * See Copyright Notice in cd.h 5 | */ 6 | 7 | #ifndef __CD_IUP_H 8 | #define __CD_IUP_H 9 | 10 | #ifdef __cplusplus 11 | extern "C" { 12 | #endif 13 | 14 | /* NOTICE: implemented in IUP at the IUPCD library. 15 | Only this file is at the CD includes. */ 16 | 17 | cdContext* cdContextIup(void); 18 | cdContext* cdContextIupDBuffer(void); 19 | cdContext* cdContextIupDBufferRGB(void); 20 | 21 | #define CD_IUP cdContextIup() 22 | #define CD_IUPDBUFFER cdContextIupDBuffer() 23 | #define CD_IUPDBUFFERRGB cdContextIupDBufferRGB() 24 | 25 | #ifdef __cplusplus 26 | } 27 | #endif 28 | 29 | #endif 30 | -------------------------------------------------------------------------------- /cd5/include/cdlua.h: -------------------------------------------------------------------------------- 1 | /** \file 2 | * \brief Lua Binding Control 3 | * 4 | * See Copyright Notice in cd.h 5 | */ 6 | 7 | #ifndef __CD_LUA_H 8 | #define __CD_LUA_H 9 | 10 | #ifdef __cplusplus 11 | extern "C" { 12 | #endif 13 | 14 | #ifdef LUA_NOOBJECT /* Lua 3 */ 15 | void cdlua_open(void); 16 | void cdlua_close(void); 17 | 18 | /* utilities */ 19 | cdCanvas* cdlua_getcanvas(void); /* pos=1, deprecated use cdlua_checkcanvas */ 20 | cdCanvas* cdlua_checkcanvas(int pos); 21 | void cdlua_pushcanvas(cdCanvas* canvas); 22 | #endif 23 | 24 | #ifdef LUA_TNONE /* Lua 5 */ 25 | int cdlua_open(lua_State *L); 26 | int cdlua_close(lua_State *L); 27 | 28 | /* utilities */ 29 | cdCanvas* cdlua_getcanvas(lua_State * L); /* pos=1, deprecated use cdlua_checkcanvas */ 30 | cdCanvas* cdlua_checkcanvas(lua_State * L, int pos); 31 | void cdlua_pushcanvas(lua_State * L, cdCanvas* canvas); 32 | 33 | #endif 34 | 35 | #ifdef __cplusplus 36 | } 37 | #endif 38 | 39 | #endif 40 | 41 | -------------------------------------------------------------------------------- /cd5/include/cdlua3_private.h: -------------------------------------------------------------------------------- 1 | /** \file 2 | * \brief Private Lua 3 Binding Functions 3 | * 4 | * See Copyright Notice in cd.h 5 | */ 6 | 7 | #ifndef __CDLUA3_PRIVATE_H 8 | #define __CDLUA3_PRIVATE_H 9 | 10 | #ifdef __cplusplus 11 | extern "C" { 12 | #endif 13 | 14 | #define COLOR_TAG "CDLUA_COLOR_TAG" 15 | #define CANVAS_TAG "CDLUA_CANVAS_TAG" 16 | #define STATE_TAG "CDLUA_STATE_TAG" 17 | #define BITMAP_TAG "CDLUA_BITMAP_TAG" 18 | #define IMAGE_TAG "CDLUA_IMAGE_TAG" 19 | #define IMAGERGB_TAG "CDLUA_IMAGERGB_TAG" 20 | #define IMAGERGBA_TAG "CDLUA_IMAGERGBA_TAG" 21 | #define STIPPLE_TAG "CDLUA_STIPPLE_TAG" 22 | #define PATTERN_TAG "CDLUA_PATTERN_TAG" 23 | #define PALETTE_TAG "CDLUA_PALETTE_TAG" 24 | #define IMAGEMAP_TAG "CDLUA_IMAGEMAP_TAG" 25 | #define CHANNEL_TAG "CDLUA_CHANNEL_TAG" 26 | 27 | /* context management */ 28 | 29 | typedef struct _cdCallbackLUA { 30 | int lock; 31 | char *name; 32 | cdCallback func; 33 | } cdCallbackLUA; 34 | 35 | typedef struct _cdContextLUA { 36 | int id; 37 | char *name; 38 | cdContext* (*ctx)(void); 39 | void* (*checkdata)(int param); 40 | cdCallbackLUA* cb_list; 41 | int cb_n; 42 | } cdContextLUA; 43 | 44 | void cdlua_addcontext(cdContextLUA* luactx); 45 | void cdlua_register(char* name, lua_CFunction func); 46 | void cdlua_pushnumber(double num, char* name); 47 | 48 | /* tag management */ 49 | 50 | typedef struct _canvas_t { 51 | cdCanvas *cd_canvas; 52 | } canvas_t; 53 | 54 | typedef struct _state_t { 55 | cdState *state; 56 | } state_t; 57 | 58 | typedef struct _stipple_t { 59 | unsigned char *value; 60 | int width; 61 | int height; 62 | long int size; 63 | } stipple_t; 64 | 65 | typedef struct _pattern_t { 66 | long int *color; 67 | int width; 68 | int height; 69 | long int size; 70 | } pattern_t; 71 | 72 | typedef struct _palette_t { 73 | long int *color; 74 | long int size; 75 | } palette_t; 76 | 77 | typedef struct _image_t { 78 | void *cd_image; 79 | } image_t; 80 | 81 | typedef struct _imagergb_t { 82 | unsigned char *red; 83 | unsigned char *green; 84 | unsigned char *blue; 85 | int width; 86 | int height; 87 | long int size; 88 | } imagergb_t; 89 | 90 | typedef struct _imagergba_t { 91 | unsigned char *red; 92 | unsigned char *green; 93 | unsigned char *blue; 94 | unsigned char *alpha; 95 | int width; 96 | int height; 97 | long int size; 98 | } imagergba_t; 99 | 100 | typedef struct _imagemap_t { 101 | unsigned char *index; 102 | int width; 103 | int height; 104 | long int size; 105 | } imagemap_t; 106 | 107 | typedef struct _channel_t { 108 | unsigned char *value; 109 | long int size; 110 | } channel_t; 111 | 112 | typedef struct _bitmap_t { 113 | cdBitmap *image; 114 | } bitmap_t; 115 | 116 | #ifdef __cplusplus 117 | } 118 | #endif 119 | 120 | #endif 121 | -------------------------------------------------------------------------------- /cd5/include/cdlua5_private.h: -------------------------------------------------------------------------------- 1 | /** \file 2 | * \brief Private Lua 5 Binding Functions 3 | * 4 | * See Copyright Notice in cd.h 5 | */ 6 | 7 | #ifndef __CDLUA5_PRIVATE_H 8 | #define __CDLUA5_PRIVATE_H 9 | 10 | #ifdef __cplusplus 11 | extern "C" { 12 | #endif 13 | 14 | 15 | /* context management */ 16 | 17 | typedef struct _cdluaCallback { 18 | int lock; 19 | const char* name; 20 | cdCallback func; 21 | } cdluaCallback; 22 | 23 | typedef struct _cdluaContext { 24 | int id; 25 | const char* name; 26 | cdContext* (*ctx)(void); 27 | void* (*checkdata)(lua_State* L,int param); 28 | cdluaCallback* cb_list; 29 | int cb_n; 30 | } cdluaContext; 31 | 32 | typedef struct _cdluaLuaState { 33 | cdCanvas* void_canvas; /* the VOID canvas to avoid a NULL active canvas */ 34 | cdluaContext* drivers[50]; /* store the registered drivers, map integer values to cdContext */ 35 | int numdrivers; 36 | } cdluaLuaState; 37 | 38 | /* metatables */ 39 | 40 | typedef struct _cdluaStipple { 41 | unsigned char* stipple; 42 | int width; 43 | int height; 44 | long int size; 45 | } cdluaStipple; 46 | 47 | typedef struct _cdluaPattern { 48 | long* pattern; 49 | int width; 50 | int height; 51 | long int size; 52 | } cdluaPattern; 53 | 54 | /* this is the same declaration used in the IM toolkit for imPalette in Lua */ 55 | typedef struct _cdluaPalette { 56 | long* color; 57 | int count; 58 | } cdluaPalette; 59 | 60 | typedef struct _cdluaImageRGB { 61 | unsigned char* red; 62 | unsigned char* green; 63 | unsigned char* blue; 64 | int width; 65 | int height; 66 | long int size; 67 | int free; 68 | } cdluaImageRGB; 69 | 70 | typedef struct _cdluaImageRGBA { 71 | unsigned char* red; 72 | unsigned char* green; 73 | unsigned char* blue; 74 | unsigned char* alpha; 75 | int width; 76 | int height; 77 | long int size; 78 | int free; 79 | } cdluaImageRGBA; 80 | 81 | typedef struct _cdluaImageMap { 82 | unsigned char* index; 83 | int width; 84 | int height; 85 | long int size; 86 | } cdluaImageMap; 87 | 88 | typedef struct _cdluaImageChannel { 89 | unsigned char* channel; 90 | long int size; 91 | } cdluaImageChannel; 92 | 93 | 94 | cdluaLuaState* cdlua_getstate(lua_State* L); 95 | cdluaContext* cdlua_getcontext(lua_State* L, int param); 96 | 97 | lua_State* cdlua_getplaystate(void); 98 | void cdlua_setplaystate(lua_State* L); 99 | 100 | void cdlua_register_lib(lua_State *L, const luaL_Reg* funcs); 101 | void cdlua_register_funcs(lua_State *L, const luaL_Reg* funcs); 102 | 103 | void cdlua_kill_active(lua_State* L, cdCanvas* canvas); 104 | void cdlua_open_active(lua_State* L, cdluaLuaState* cdL); 105 | void cdlua_close_active(cdluaLuaState* cdL); 106 | 107 | void cdlua_open_canvas(lua_State* L); 108 | 109 | void cdlua_addcontext(lua_State* L, cdluaLuaState* cdL, cdluaContext* luactx); 110 | void cdlua_initdrivers(lua_State* L, cdluaLuaState* cdL); 111 | 112 | cdluaPalette* cdlua_checkpalette(lua_State* L, int param); 113 | cdluaStipple* cdlua_checkstipple(lua_State* L, int param); 114 | cdluaPattern* cdlua_checkpattern(lua_State* L, int param); 115 | cdluaImageRGB* cdlua_checkimagergb(lua_State* L, int param); 116 | cdluaImageRGBA* cdlua_checkimagergba(lua_State* L, int param); 117 | cdluaImageMap* cdlua_checkimagemap(lua_State* L, int param); 118 | cdluaImageChannel* cdlua_checkchannel(lua_State* L, int param); 119 | 120 | long cdlua_checkcolor(lua_State* L, int param); 121 | cdImage* cdlua_checkimage(lua_State* L, int param); 122 | cdState* cdlua_checkstate(lua_State* L, int param); 123 | cdBitmap* cdlua_checkbitmap(lua_State* L, int param); 124 | 125 | void cdlua_pushcolor(lua_State* L, long color); 126 | void cdlua_pushpalette(lua_State* L, long* palette, int size); 127 | void cdlua_pushstipple(lua_State* L, unsigned char* stipple, int width, int height); 128 | void cdlua_pushpattern(lua_State* L, long int* pattern, int width, int height); 129 | void cdlua_pushimagergb(lua_State* L, unsigned char* red, unsigned char* green, unsigned char* blue, int width, int height); 130 | void cdlua_pushimagergba(lua_State* L, unsigned char* red, unsigned char* green, unsigned char* blue, unsigned char* alpha, int width, int height); 131 | void cdlua_pushimagemap(lua_State* L, unsigned char* index, int width, int height); 132 | void cdlua_pushchannel(lua_State* L, unsigned char* channel, int size); 133 | 134 | void cdlua_pushimage(lua_State* L, cdImage* image); 135 | void cdlua_pushstate(lua_State* L, cdState* state); 136 | void cdlua_pushbitmap(lua_State* L, cdBitmap* bitmap); 137 | 138 | void cdlua_pushimagergb_ex(lua_State* L, unsigned char* red, unsigned char* green, unsigned char* blue, int width, int height); 139 | void cdlua_pushimagergba_ex(lua_State* L, unsigned char* red, unsigned char* green, unsigned char* blue, unsigned char* alpha, int width, int height); 140 | 141 | #ifdef __cplusplus 142 | } 143 | #endif 144 | 145 | #endif 146 | -------------------------------------------------------------------------------- /cd5/include/cdluagl.h: -------------------------------------------------------------------------------- 1 | /** \file 2 | * \brief OpenGL Canvas Lua Binding 3 | * 4 | * See Copyright Notice in cd.h 5 | */ 6 | 7 | #ifndef __CD_LUAGL_H 8 | #define __CD_LUAGL_H 9 | 10 | #ifdef __cplusplus 11 | extern "C" { 12 | #endif 13 | 14 | #ifdef LUA_NOOBJECT /* Lua 3 */ 15 | void cdluagl_open(void); 16 | #endif 17 | 18 | #ifdef LUA_TNONE /* Lua 5 */ 19 | int cdluagl_open(lua_State *L); 20 | #endif 21 | 22 | #ifdef __cplusplus 23 | } 24 | #endif 25 | 26 | #endif 27 | 28 | -------------------------------------------------------------------------------- /cd5/include/cdluaim.h: -------------------------------------------------------------------------------- 1 | /** \file 2 | * \brief CD+IM Lua Binding 3 | * 4 | * See Copyright Notice in cd.h 5 | */ 6 | 7 | #ifndef __CD_LUAIM_H 8 | #define __CD_LUAIM_H 9 | 10 | #ifdef __cplusplus 11 | extern "C" { 12 | #endif 13 | 14 | #ifdef LUA_TNONE /* Lua 5 */ 15 | int cdluaim_open(lua_State *L); 16 | #endif 17 | 18 | #ifdef __cplusplus 19 | } 20 | #endif 21 | 22 | #endif 23 | -------------------------------------------------------------------------------- /cd5/include/cdluaiup.h: -------------------------------------------------------------------------------- 1 | /** \file 2 | * \brief IUP Canvas Lua Binding 3 | * 4 | * See Copyright Notice in cd.h 5 | */ 6 | 7 | #ifndef __CD_LUAIUP_H 8 | #define __CD_LUAIUP_H 9 | 10 | #ifdef __cplusplus 11 | extern "C" { 12 | #endif 13 | 14 | #ifdef LUA_NOOBJECT /* Lua 3 */ 15 | void cdluaiup_open(void); 16 | #endif 17 | 18 | #ifdef LUA_TNONE /* Lua 5 */ 19 | int cdluaiup_open(lua_State *L); 20 | #endif 21 | 22 | #ifdef __cplusplus 23 | } 24 | #endif 25 | 26 | #endif 27 | 28 | -------------------------------------------------------------------------------- /cd5/include/cdluapdf.h: -------------------------------------------------------------------------------- 1 | /** \file 2 | * \brief PDF Canvas Lua Binding 3 | * 4 | * See Copyright Notice in cd.h 5 | */ 6 | 7 | #ifndef __CD_LUAPDF_H 8 | #define __CD_LUAPDF_H 9 | 10 | #ifdef __cplusplus 11 | extern "C" { 12 | #endif 13 | 14 | #ifdef LUA_NOOBJECT /* Lua 3 */ 15 | void cdluapdf_open(void); 16 | #endif 17 | 18 | #ifdef LUA_TNONE /* Lua 5 */ 19 | int cdluapdf_open(lua_State *L); 20 | #endif 21 | 22 | #ifdef __cplusplus 23 | } 24 | #endif 25 | 26 | #endif 27 | 28 | -------------------------------------------------------------------------------- /cd5/include/cdmf.h: -------------------------------------------------------------------------------- 1 | /** \file 2 | * \brief CD Metafile driver 3 | * 4 | * See Copyright Notice in cd.h 5 | */ 6 | 7 | #ifndef __CD_MF_H 8 | #define __CD_MF_H 9 | 10 | #ifdef __cplusplus 11 | extern "C" { 12 | #endif 13 | 14 | cdContext* cdContextMetafile(void); 15 | 16 | #define CD_METAFILE cdContextMetafile() 17 | 18 | #ifdef __cplusplus 19 | } 20 | #endif 21 | 22 | #endif /* ifndef __CD_MF_ */ 23 | 24 | 25 | -------------------------------------------------------------------------------- /cd5/include/cdmf_private.h: -------------------------------------------------------------------------------- 1 | /** \file 2 | * \brief CD Metafile driver private declarations 3 | * 4 | * See Copyright Notice in cd.h 5 | */ 6 | 7 | #ifndef __CDMF_PRIVATE_H 8 | #define __CDMF_PRIVATE_H 9 | 10 | #ifdef __cplusplus 11 | extern "C" { 12 | #endif 13 | 14 | /* public part of the internal cdCtxCanvas */ 15 | typedef struct cdCanvasMF 16 | { 17 | cdCanvas* canvas; 18 | char* filename; 19 | void* data; 20 | } cdCanvasMF; 21 | 22 | void cdcreatecanvasMF(cdCanvas *canvas, void *data); 23 | void cdinittableMF(cdCanvas* canvas); 24 | void cdkillcanvasMF(cdCanvasMF *mfcanvas); 25 | 26 | #ifdef __cplusplus 27 | } 28 | #endif 29 | 30 | #endif 31 | 32 | 33 | -------------------------------------------------------------------------------- /cd5/include/cdnative.h: -------------------------------------------------------------------------------- 1 | /** \file 2 | * \brief NativeWindow driver 3 | * 4 | * See Copyright Notice in cd.h 5 | */ 6 | 7 | #ifndef __CD_NATIVE_H 8 | #define __CD_NATIVE_H 9 | 10 | #ifdef __cplusplus 11 | extern "C" { 12 | #endif 13 | 14 | cdContext* cdContextNativeWindow(void); 15 | 16 | #define CD_NATIVEWINDOW cdContextNativeWindow() 17 | 18 | void cdGetScreenSize(int *width, int *height, double *width_mm, double *height_mm); 19 | int cdGetScreenColorPlanes(void); 20 | 21 | #ifdef __cplusplus 22 | } 23 | #endif 24 | 25 | #endif /* ifndef __CD_NATIVE_ */ 26 | 27 | -------------------------------------------------------------------------------- /cd5/include/cdpdf.h: -------------------------------------------------------------------------------- 1 | /** \file 2 | * \brief PDF driver 3 | * 4 | * See Copyright Notice in cd.h 5 | */ 6 | 7 | #ifndef __CD_PDF_H 8 | #define __CD_PDF_H 9 | 10 | #ifdef __cplusplus 11 | extern "C" { 12 | #endif 13 | 14 | cdContext* cdContextPDF(void); 15 | 16 | #define CD_PDF cdContextPDF() 17 | 18 | #ifdef __cplusplus 19 | } 20 | #endif 21 | 22 | #endif /* ifndef _CD_PDF_ */ 23 | 24 | -------------------------------------------------------------------------------- /cd5/include/cdpicture.h: -------------------------------------------------------------------------------- 1 | /** \file 2 | * \brief CD Picture driver 3 | * 4 | * See Copyright Notice in cd.h 5 | */ 6 | 7 | #ifndef __CD_PICTURE_H 8 | #define __CD_PICTURE_H 9 | 10 | #ifdef __cplusplus 11 | extern "C" { 12 | #endif 13 | 14 | cdContext* cdContextPicture(void); 15 | 16 | #define CD_PICTURE cdContextPicture() 17 | 18 | #ifdef __cplusplus 19 | } 20 | #endif 21 | 22 | #endif 23 | -------------------------------------------------------------------------------- /cd5/include/cdpptx.h: -------------------------------------------------------------------------------- 1 | /** \file 2 | * \brief PPTX driver 3 | * 4 | * See Copyright Notice in cd.h 5 | */ 6 | 7 | #ifndef __CD_PPTX_H 8 | #define __CD_PPTX_H 9 | 10 | #ifdef __cplusplus 11 | extern "C" { 12 | #endif 13 | 14 | cdContext* cdContextPPTX(void); 15 | #define CD_PPTX cdContextPPTX() 16 | 17 | #ifdef __cplusplus 18 | } 19 | #endif 20 | 21 | #endif /* ifndef __CD_PPTX_ */ 22 | -------------------------------------------------------------------------------- /cd5/include/cdprint.h: -------------------------------------------------------------------------------- 1 | /** \file 2 | * \brief Printer driver 3 | * 4 | * See Copyright Notice in cd.h 5 | */ 6 | 7 | #ifndef __CD_PRINTER_H 8 | #define __CD_PRINTER_H 9 | 10 | #ifdef __cplusplus 11 | extern "C" { 12 | #endif 13 | 14 | cdContext* cdContextPrinter(void); 15 | 16 | #define CD_PRINTER cdContextPrinter() 17 | 18 | #ifdef __cplusplus 19 | } 20 | #endif 21 | 22 | #endif /* ifndef __CD_PRINTER_ */ 23 | 24 | -------------------------------------------------------------------------------- /cd5/include/cdps.h: -------------------------------------------------------------------------------- 1 | /** \file 2 | * \brief PS driver 3 | * 4 | * See Copyright Notice in cd.h 5 | */ 6 | 7 | #ifndef __CD_PS_H 8 | #define __CD_PS_H 9 | 10 | #ifdef __cplusplus 11 | extern "C" { 12 | #endif 13 | 14 | cdContext* cdContextPS(void); 15 | 16 | #define CD_PS cdContextPS() 17 | 18 | #ifdef __cplusplus 19 | } 20 | #endif 21 | 22 | #endif /* ifndef __CD_PS_ */ 23 | 24 | -------------------------------------------------------------------------------- /cd5/include/cdsvg.h: -------------------------------------------------------------------------------- 1 | /** \file 2 | * \brief SVG driver 3 | * 4 | * See Copyright Notice in cd.h 5 | */ 6 | 7 | #ifndef __CD_SVG_H 8 | #define __CD_SVG_H 9 | 10 | #ifdef __cplusplus 11 | extern "C" { 12 | #endif 13 | 14 | cdContext* cdContextSVG(void); 15 | 16 | #define CD_SVG cdContextSVG() 17 | 18 | #ifdef __cplusplus 19 | } 20 | #endif 21 | 22 | #endif /* ifndef __CD_SVG_ */ 23 | -------------------------------------------------------------------------------- /cd5/include/cdwmf.h: -------------------------------------------------------------------------------- 1 | /** \file 2 | * \brief WMF driver 3 | * 4 | * See Copyright Notice in cd.h 5 | */ 6 | 7 | #ifndef __CD_WMF_H 8 | #define __CD_WMF_H 9 | 10 | #ifdef __cplusplus 11 | extern "C" { 12 | #endif 13 | 14 | cdContext* cdContextWMF(void); 15 | 16 | #define CD_WMF cdContextWMF() 17 | 18 | #ifdef __cplusplus 19 | } 20 | #endif 21 | 22 | #endif 23 | -------------------------------------------------------------------------------- /cd5/include/wd.h: -------------------------------------------------------------------------------- 1 | /** \file 2 | * \brief World Coordinate Functions 3 | * 4 | * See Copyright Notice in cd.h 5 | */ 6 | 7 | #ifndef __WD_H 8 | #define __WD_H 9 | 10 | #ifdef __cplusplus 11 | extern "C" { 12 | #endif 13 | 14 | int wdCanvasPlay(cdCanvas* canvas, cdContext *context, double xmin, double xmax, double ymin, double ymax, void *data); 15 | 16 | /* coordinate transformation */ 17 | void wdCanvasWindow(cdCanvas* canvas, double xmin, double xmax, double ymin, double ymax); 18 | void wdCanvasGetWindow(cdCanvas* canvas, double *xmin, double *xmax, double *ymin, double *ymax); 19 | void wdCanvasViewport(cdCanvas* canvas, int xmin, int xmax, int ymin, int ymax); 20 | void wdCanvasGetViewport(cdCanvas* canvas, int *xmin, int *xmax, int *ymin, int *ymax); 21 | void wdCanvasWorld2Canvas(cdCanvas* canvas, double xw, double yw, int *xv, int *yv); 22 | void wdCanvasWorld2CanvasSize(cdCanvas* canvas, double hw, double vw, int *hv, int *vv); 23 | void wdCanvasCanvas2World(cdCanvas* canvas, int xv, int yv, double *xw, double *yw); 24 | void wdCanvasSetTransform(cdCanvas* canvas, double sx, double sy, double tx, double ty); 25 | void wdCanvasGetTransform(cdCanvas* canvas, double *sx, double *sy, double *tx, double *ty); 26 | void wdCanvasTranslate(cdCanvas* canvas, double dtx, double dty); 27 | void wdCanvasScale(cdCanvas* canvas, double dsx, double dsy); 28 | 29 | void wdCanvasClipArea(cdCanvas* canvas, double xmin, double xmax, double ymin, double ymax); 30 | int wdCanvasGetClipArea(cdCanvas* canvas, double *xmin, double *xmax, double *ymin, double *ymax); 31 | int wdCanvasIsPointInRegion(cdCanvas* canvas, double x, double y); 32 | void wdCanvasOffsetRegion(cdCanvas* canvas, double x, double y); 33 | void wdCanvasGetRegionBox(cdCanvas* canvas, double *xmin, double *xmax, double *ymin, double *ymax); 34 | 35 | void wdCanvasHardcopy(cdCanvas* canvas, cdContext* ctx, void *data, void(*draw_func)(cdCanvas *canvas_copy)); 36 | 37 | /* primitives */ 38 | void wdCanvasPixel(cdCanvas* canvas, double x, double y, long color); 39 | void wdCanvasMark(cdCanvas* canvas, double x, double y); 40 | void wdCanvasLine(cdCanvas* canvas, double x1, double y1, double x2, double y2); 41 | void wdCanvasVertex(cdCanvas* canvas, double x, double y); 42 | void wdCanvasRect(cdCanvas* canvas, double xmin, double xmax, double ymin, double ymax); 43 | void wdCanvasBox(cdCanvas* canvas, double xmin, double xmax, double ymin, double ymax); 44 | void wdCanvasArc(cdCanvas* canvas, double xc, double yc, double w, double h, double angle1, double angle2); 45 | void wdCanvasSector(cdCanvas* canvas, double xc, double yc, double w, double h, double angle1, double angle2); 46 | void wdCanvasChord(cdCanvas* canvas, double xc, double yc, double w, double h, double angle1, double angle2); 47 | void wdCanvasText(cdCanvas* canvas, double x, double y, const char* s); 48 | 49 | void wdCanvasGetImageRGB(cdCanvas* canvas, unsigned char* r, unsigned char* g, unsigned char* b, double x, double y, int iw, int ih); 50 | void wdCanvasPutImageRectRGB(cdCanvas* canvas, int iw, int ih, const unsigned char* r, const unsigned char* g, const unsigned char* b, double x, double y, double w, double h, int xmin, int xmax, int ymin, int ymax); 51 | void wdCanvasPutImageRectRGBA(cdCanvas* canvas, int iw, int ih, const unsigned char* r, const unsigned char* g, const unsigned char* b, const unsigned char* a, double x, double y, double w, double h, int xmin, int xmax, int ymin, int ymax); 52 | void wdCanvasPutImageRectMap(cdCanvas* canvas, int iw, int ih, const unsigned char* index, const long* colors, double x, double y, double w, double h, int xmin, int xmax, int ymin, int ymax); 53 | 54 | void wdCanvasPutImageRect(cdCanvas* canvas, cdImage* image, double x, double y, int xmin, int xmax, int ymin, int ymax); 55 | 56 | void wdCanvasPutBitmap(cdCanvas* canvas, cdBitmap* bitmap, double x, double y, double w, double h); 57 | 58 | /* attributes */ 59 | double wdCanvasLineWidth(cdCanvas* canvas, double width); 60 | int wdCanvasFont(cdCanvas* canvas, const char* type_face, int style, double size); 61 | void wdCanvasGetFont(cdCanvas* canvas, char *type_face, int *style, double *size); 62 | double wdCanvasMarkSize(cdCanvas* canvas, double size); 63 | void wdCanvasGetFontDim(cdCanvas* canvas, double *max_width, double *height, double *ascent, double *descent); 64 | void wdCanvasGetTextSize(cdCanvas* canvas, const char* s, double *width, double *height); 65 | void wdCanvasGetTextBox(cdCanvas* canvas, double x, double y, const char* s, double *xmin, double *xmax, double *ymin, double *ymax); 66 | void wdCanvasGetTextBounds(cdCanvas* canvas, double x, double y, const char* s, double *rect); 67 | void wdCanvasStipple(cdCanvas* canvas, int w, int h, const unsigned char*fgbg, double w_mm, double h_mm); 68 | void wdCanvasPattern(cdCanvas* canvas, int w, int h, const long *color, double w_mm, double h_mm); 69 | 70 | /* vector text */ 71 | void wdCanvasVectorTextDirection(cdCanvas* canvas, double x1, double y1, double x2, double y2); 72 | void wdCanvasVectorTextSize(cdCanvas* canvas, double size_x, double size_y, const char* s); 73 | void wdCanvasGetVectorTextSize(cdCanvas* canvas, const char* s, double *x, double *y); 74 | double wdCanvasVectorCharSize(cdCanvas* canvas, double size); 75 | void wdCanvasVectorText(cdCanvas* canvas, double x, double y, const char* s); 76 | void wdCanvasMultiLineVectorText(cdCanvas* canvas, double x, double y, const char* s); 77 | void wdCanvasGetVectorTextBounds(cdCanvas* canvas, const char* s, double x, double y, double *rect); 78 | void wdCanvasGetVectorTextBox(cdCanvas* canvas, double x, double y, const char *s, double *xmin, double *xmax, double *ymin, double *ymax); 79 | 80 | #ifdef __cplusplus 81 | } 82 | #endif 83 | 84 | #ifndef CD_NO_OLD_INTERFACE 85 | #include "wd_old.h" 86 | #endif 87 | 88 | #endif 89 | -------------------------------------------------------------------------------- /cd5/include/wd_old.h: -------------------------------------------------------------------------------- 1 | /** \file 2 | * \brief Old WC API 3 | * 4 | * See Copyright Notice in cd.h 5 | */ 6 | 7 | #ifndef WD_OLD_H 8 | #define WD_OLD_H 9 | 10 | #ifdef __cplusplus 11 | extern "C" { 12 | #endif 13 | 14 | /* coordinate transformation */ 15 | void wdWindow(double xmin, double xmax, double ymin, double ymax); 16 | void wdGetWindow(double *xmin, double *xmax, double *ymin, double *ymax); 17 | void wdViewport(int xmin, int xmax, int ymin, int ymax); 18 | void wdGetViewport(int *xmin, int *xmax, int *ymin, int *ymax); 19 | void wdWorld2Canvas(double xw, double yw, int *xv, int *yv); 20 | void wdWorld2CanvasSize(double hw, double vw, int *hv, int *vv); 21 | void wdCanvas2World(int xv, int yv, double *xw, double *yw); 22 | 23 | void wdClipArea(double xmin, double xmax, double ymin, double ymax); 24 | int wdGetClipArea(double *xmin, double *xmax, double *ymin, double *ymax); 25 | double* wdGetClipPoly(int *n); 26 | int wdPointInRegion(double x, double y); 27 | void wdOffsetRegion(double x, double y); 28 | void wdRegionBox(double *xmin, double *xmax, double *ymin, double *ymax); 29 | 30 | void wdHardcopy(cdContext* ctx, void *data, cdCanvas *cnv, void(*draw_func)(void)); 31 | 32 | /* primitives */ 33 | void wdPixel(double x, double y, long color); 34 | void wdMark(double x, double y); 35 | void wdLine(double x1, double y1, double x2, double y2); 36 | void wdVertex(double x, double y); 37 | void wdRect(double xmin, double xmax, double ymin, double ymax); 38 | void wdBox(double xmin, double xmax, double ymin, double ymax); 39 | void wdArc(double xc, double yc, double w, double h, double angle1, double angle2); 40 | void wdSector(double xc, double yc, double w, double h, double angle1, double angle2); 41 | void wdChord(double xc, double yc, double w, double h, double angle1, double angle2); 42 | void wdText(double x, double y, const char* s); 43 | 44 | void wdPutImageRect(cdImage* image, double x, double y, int xmin, int xmax, int ymin, int ymax); 45 | void wdPutImageRectRGB(int iw, int ih, const unsigned char* r, const unsigned char* g, const unsigned char* b, double x, double y, double w, double h, int xmin, int xmax, int ymin, int ymax); 46 | void wdPutImageRectRGBA(int iw, int ih, const unsigned char* r, const unsigned char* g, const unsigned char* b, const unsigned char* a, double x, double y, double w, double h, int xmin, int xmax, int ymin, int ymax); 47 | void wdPutImageRectMap(int iw, int ih, const unsigned char* index, const long* colors, double x, double y, double w, double h, int xmin, int xmax, int ymin, int ymax); 48 | void wdPutBitmap(cdBitmap* bitmap, double x, double y, double w, double h); 49 | 50 | /* attributes */ 51 | double wdLineWidth(double width); 52 | void wdFont(int type_face, int style, double size); 53 | void wdGetFont(int *type_face, int *style, double *size); 54 | double wdMarkSize(double size); 55 | void wdFontDim(double *max_width, double *height, double *ascent, double *descent); 56 | void wdTextSize(const char* s, double *width, double *height); 57 | void wdTextBox(double x, double y, const char* s, double *xmin, double *xmax, double *ymin, double *ymax); 58 | void wdTextBounds(double x, double y, const char* s, double *rect); 59 | void wdStipple(int w, int h, const unsigned char* stipple, double w_mm, double h_mm); 60 | void wdPattern(int w, int h, const long* pattern, double w_mm, double h_mm); 61 | 62 | /* vector text */ 63 | void wdVectorTextDirection(double x1, double y1, double x2, double y2); 64 | void wdVectorTextSize(double size_x, double size_y, const char* s); 65 | void wdGetVectorTextSize(const char* s, double *x, double *y); 66 | double wdVectorCharSize(double size); 67 | void wdVectorText(double x, double y, const char* s); 68 | void wdMultiLineVectorText(double x, double y, const char* s); 69 | void wdGetVectorTextBounds(const char* s, double x, double y, double *rect); 70 | 71 | /* OLD definitions, defined for backward compatibility */ 72 | #define wdVectorFont cdVectorFont 73 | #define wdVectorTextTransform cdVectorTextTransform 74 | #define wdActivate cdActivate 75 | #define wdClip(mode) cdClip(mode) 76 | #define wdBegin(mode) cdBegin(mode) 77 | #define wdEnd() cdEnd(); 78 | #define wdMM2Pixel(mm_dx, mm_dy, dx, dy) cdMM2Pixel(mm_dx, mm_dy, dx, dy) 79 | #define wdPixel2MM(dx, dy, mm_dx, mm_dy) cdPixel2MM(dx, dy, mm_dx, mm_dy) 80 | 81 | #ifdef __cplusplus 82 | } 83 | #endif 84 | 85 | #endif 86 | -------------------------------------------------------------------------------- /cd5/pdflib.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chinenkai/php-iup/3e1a020992ee46d414d0627e6bd3de2724bf1724/cd5/pdflib.lib -------------------------------------------------------------------------------- /cd5/zlib1.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chinenkai/php-iup/3e1a020992ee46d414d0627e6bd3de2724bf1724/cd5/zlib1.lib -------------------------------------------------------------------------------- /config.m4: -------------------------------------------------------------------------------- 1 | dnl $Id$ 2 | dnl config.m4 for extension iup 3 | 4 | dnl Comments in this file start with the string 'dnl'. 5 | dnl Remove where necessary. This file will not work 6 | dnl without editing. 7 | 8 | dnl If your extension references something external, use with: 9 | 10 | dnl PHP_ARG_WITH(iup, for iup support, 11 | dnl Make sure that the comment is aligned: 12 | dnl [ --with-iup Include iup support]) 13 | 14 | dnl Otherwise use enable: 15 | 16 | PHP_ARG_ENABLE(iup, whether to enable iup support, 17 | dnl Make sure that the comment is aligned: 18 | [ --enable-iup Enable iup support]) 19 | 20 | if test "$PHP_IUP" != "no"; then 21 | dnl Write more examples of tests here... 22 | 23 | dnl # get library FOO build options from pkg-config output 24 | dnl AC_PATH_PROG(PKG_CONFIG, pkg-config, no) 25 | dnl AC_MSG_CHECKING(for libfoo) 26 | dnl if test -x "$PKG_CONFIG" && $PKG_CONFIG --exists foo; then 27 | dnl if $PKG_CONFIG foo --atleast-version 1.2.3; then 28 | dnl LIBFOO_CFLAGS=`$PKG_CONFIG foo --cflags` 29 | dnl LIBFOO_LIBDIR=`$PKG_CONFIG foo --libs` 30 | dnl LIBFOO_VERSON=`$PKG_CONFIG foo --modversion` 31 | dnl AC_MSG_RESULT(from pkgconfig: version $LIBFOO_VERSON) 32 | dnl else 33 | dnl AC_MSG_ERROR(system libfoo is too old: version 1.2.3 required) 34 | dnl fi 35 | dnl else 36 | dnl AC_MSG_ERROR(pkg-config not found) 37 | dnl fi 38 | dnl PHP_EVAL_LIBLINE($LIBFOO_LIBDIR, IUP_SHARED_LIBADD) 39 | dnl PHP_EVAL_INCLINE($LIBFOO_CFLAGS) 40 | 41 | dnl # --with-iup -> check with-path 42 | dnl SEARCH_PATH="/usr/local /usr" # you might want to change this 43 | dnl SEARCH_FOR="/include/iup.h" # you most likely want to change this 44 | dnl if test -r $PHP_IUP/$SEARCH_FOR; then # path given as parameter 45 | dnl IUP_DIR=$PHP_IUP 46 | dnl else # search default path list 47 | dnl AC_MSG_CHECKING([for iup files in default path]) 48 | dnl for i in $SEARCH_PATH ; do 49 | dnl if test -r $i/$SEARCH_FOR; then 50 | dnl IUP_DIR=$i 51 | dnl AC_MSG_RESULT(found in $i) 52 | dnl fi 53 | dnl done 54 | dnl fi 55 | dnl 56 | dnl if test -z "$IUP_DIR"; then 57 | dnl AC_MSG_RESULT([not found]) 58 | dnl AC_MSG_ERROR([Please reinstall the iup distribution]) 59 | dnl fi 60 | 61 | dnl # --with-iup -> add include path 62 | dnl PHP_ADD_INCLUDE($IUP_DIR/include) 63 | 64 | dnl # --with-iup -> check for lib and symbol presence 65 | dnl LIBNAME=iup # you may want to change this 66 | dnl LIBSYMBOL=iup # you most likely want to change this 67 | 68 | dnl PHP_CHECK_LIBRARY($LIBNAME,$LIBSYMBOL, 69 | dnl [ 70 | dnl PHP_ADD_LIBRARY_WITH_PATH($LIBNAME, $IUP_DIR/$PHP_LIBDIR, IUP_SHARED_LIBADD) 71 | dnl AC_DEFINE(HAVE_IUPLIB,1,[ ]) 72 | dnl ],[ 73 | dnl AC_MSG_ERROR([wrong iup lib version or lib not found]) 74 | dnl ],[ 75 | dnl -L$IUP_DIR/$PHP_LIBDIR -lm 76 | dnl ]) 77 | dnl 78 | dnl PHP_SUBST(IUP_SHARED_LIBADD) 79 | 80 | PHP_NEW_EXTENSION(iup, iup.c, $ext_shared,, -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1) 81 | fi 82 | -------------------------------------------------------------------------------- /config.w32: -------------------------------------------------------------------------------- 1 | // $Id$ 2 | // vim:ft=javascript 3 | 4 | ARG_ENABLE("iup", "enable iup support", "no"); 5 | 6 | if (PHP_IUP != "no") { 7 | 8 | if( 9 | CHECK_HEADER_ADD_INCLUDE("im.h", "CFLAGS_PHP_IUP", PHP_IUP + ";" + configure_module_dirname+ "/im3/include") 10 | && CHECK_LIB("im.lib", "iup", PHP_IUP + ";" + configure_module_dirname + "/im3") 11 | && CHECK_LIB("im_avi.lib", "iup", PHP_IUP + ";" + configure_module_dirname + "/im3") 12 | && CHECK_LIB("im_capture.lib", "iup", PHP_IUP + ";" + configure_module_dirname + "/im3") 13 | && CHECK_LIB("im_fftw.lib", "iup", PHP_IUP + ";" + configure_module_dirname + "/im3") 14 | && CHECK_LIB("im_jp2.lib", "iup", PHP_IUP + ";" + configure_module_dirname + "/im3") 15 | && CHECK_LIB("im_lzo.lib", "iup", PHP_IUP + ";" + configure_module_dirname + "/im3") 16 | && CHECK_LIB("im_process.lib", "iup", PHP_IUP + ";" + configure_module_dirname + "/im3") 17 | && CHECK_LIB("im_process_omp.lib", "iup", PHP_IUP + ";" + configure_module_dirname + "/im3") 18 | && CHECK_LIB("im_wmv.lib", "iup", PHP_IUP + ";" + configure_module_dirname + "/im3") 19 | 20 | &&CHECK_HEADER_ADD_INCLUDE("cd.h", "CFLAGS_PHP_IUP", PHP_IUP + ";" + configure_module_dirname+ "/cd5/include") 21 | && CHECK_LIB("cd.lib", "iup", PHP_IUP + ";" + configure_module_dirname + "/cd5") 22 | && CHECK_LIB("cdcairo.lib", "iup", PHP_IUP + ";" + configure_module_dirname + "/cd5") 23 | && CHECK_LIB("cdcontextplus.lib", "iup", PHP_IUP + ";" + configure_module_dirname + "/cd5") 24 | && CHECK_LIB("cdgl.lib", "iup", PHP_IUP + ";" + configure_module_dirname + "/cd5") 25 | && CHECK_LIB("cdim.lib", "iup", PHP_IUP + ";" + configure_module_dirname + "/cd5") 26 | && CHECK_LIB("cdpdf.lib", "iup", PHP_IUP + ";" + configure_module_dirname + "/cd5") 27 | && CHECK_LIB("freetype6.lib", "iup", PHP_IUP + ";" + configure_module_dirname + "/cd5") 28 | && CHECK_LIB("ftgl.lib", "iup", PHP_IUP + ";" + configure_module_dirname + "/cd5") 29 | && CHECK_LIB("pdflib.lib", "iup", PHP_IUP + ";" + configure_module_dirname + "/cd5") 30 | 31 | && CHECK_HEADER_ADD_INCLUDE("iup.h", "CFLAGS_PHP_IUP", PHP_IUP + ";" + configure_module_dirname+ "/iup3/include") 32 | && CHECK_LIB("iup.lib", "iup", PHP_IUP + ";" + configure_module_dirname + "/iup3") 33 | && CHECK_LIB("freetype6.lib", "iup", PHP_IUP + ";" + configure_module_dirname + "/iup3") 34 | && CHECK_LIB("ftgl.lib", "iup", PHP_IUP + ";" + configure_module_dirname + "/iup3") 35 | && CHECK_LIB("iup.lib", "iup", PHP_IUP + ";" + configure_module_dirname + "/iup3") 36 | && CHECK_LIB("iupcd.lib", "iup", PHP_IUP + ";" + configure_module_dirname + "/iup3") 37 | && CHECK_LIB("iupcontrols.lib", "iup", PHP_IUP + ";" + configure_module_dirname + "/iup3") 38 | && CHECK_LIB("iupfiledlg.lib", "iup", PHP_IUP + ";" + configure_module_dirname + "/iup3") 39 | && CHECK_LIB("iupgl.lib", "iup", PHP_IUP + ";" + configure_module_dirname + "/iup3") 40 | && CHECK_LIB("iupglcontrols.lib", "iup", PHP_IUP + ";" + configure_module_dirname + "/iup3") 41 | && CHECK_LIB("iupim.lib", "iup", PHP_IUP + ";" + configure_module_dirname + "/iup3") 42 | && CHECK_LIB("iupimglib.lib", "iup", PHP_IUP + ";" + configure_module_dirname + "/iup3") 43 | && CHECK_LIB("iupole.lib", "iup", PHP_IUP + ";" + configure_module_dirname + "/iup3") 44 | && CHECK_LIB("iuptuio.lib", "iup", PHP_IUP + ";" + configure_module_dirname + "/iup3") 45 | && CHECK_LIB("iupweb.lib", "iup", PHP_IUP + ";" + configure_module_dirname + "/iup3") 46 | && CHECK_LIB("iup_mglplot.lib", "iup", PHP_IUP + ";" + configure_module_dirname + "/iup3") 47 | && CHECK_LIB("iup_plot.lib", "iup", PHP_IUP + ";" + configure_module_dirname + "/iup3") 48 | && CHECK_LIB("iup_scintilla.lib", "iup", PHP_IUP + ";" + configure_module_dirname + "/iup3") 49 | && CHECK_LIB("zlib1.lib", "iup", PHP_IUP + ";" + configure_module_dirname + "/iup3") 50 | // IM 51 | 52 | ){ 53 | EXTENSION("iup", "iup.c", true, "/DZEND_ENABLE_STATIC_TSRMLS_CACHE=1"); 54 | 55 | ADD_FLAG('LIBS', " urlmon.lib ole32.lib oleaut32.lib uuid.lib gdi32.lib winspool.lib comdlg32.lib comctl32.lib imm32.lib winmm.lib opengl32.lib glu32.lib gdiplus.lib"); 56 | 57 | ADD_SOURCES("ext/iup", "iup_main.c iup_events.c iup_more.c iup_ext.c", "iup"); 58 | 59 | }else{ 60 | WARNING("iup.lib not found"); 61 | } 62 | 63 | } 64 | 65 | -------------------------------------------------------------------------------- /examples/tutorial/example2_1.php: -------------------------------------------------------------------------------- 1 | 27 | class imComplex 28 | { 29 | public: 30 | T real; ///< Real part. 31 | T imag; ///< Imaginary part. 32 | 33 | /// Default Constructor (0,0). 34 | imComplex():real(0), imag(0) {} 35 | 36 | /// Constructor from (real, imag) 37 | imComplex(const T& r, const T& i):real(r),imag(i) {} 38 | 39 | /// Constructor from (real) 40 | imComplex(const T& r):real(r),imag(0) {} 41 | }; 42 | 43 | /** \addtogroup cpx 44 | * Complex numbers operators. 45 | * @{ 46 | */ 47 | 48 | template 49 | inline int operator <= (const imComplex& C1, const imComplex& C2) 50 | { 51 | return ((C1.real <= C2.real) && (C1.imag <= C2.imag)); 52 | } 53 | 54 | template 55 | inline int operator <= (const imComplex& C, const float& R) 56 | { 57 | return ((C.real <= (T)R) && (C.imag <= 0)); 58 | } 59 | 60 | template 61 | inline int operator <= (const imComplex& C, const double& R) 62 | { 63 | return ((C.real <= (T)R) && (C.imag <= 0)); 64 | } 65 | 66 | template 67 | inline int operator < (const imComplex& C1, const imComplex& C2) 68 | { 69 | return ((C1.real < C2.real) && (C1.imag < C2.imag)); 70 | } 71 | 72 | template 73 | inline int operator < (const imComplex& C, const T& R) 74 | { 75 | return ((C.real < R) && (C.imag < 0)); 76 | } 77 | 78 | template 79 | inline int operator > (const imComplex& C1, const imComplex& C2) 80 | { 81 | return ((C1.real > C2.real) && (C1.imag > C2.imag)); 82 | } 83 | 84 | template 85 | inline int operator > (const imComplex& C, const T& R) 86 | { 87 | return ((C.real > R) && (C.imag > 0)); 88 | } 89 | 90 | template 91 | inline imComplex operator + (const imComplex& C1, const imComplex& C2) 92 | { 93 | return imComplex(C1.real + C2.real, C1.imag + C2.imag); 94 | } 95 | 96 | template 97 | inline imComplex operator + (const imComplex& C, const T& R) 98 | { 99 | return imComplex(C.real + R, C.imag); 100 | } 101 | 102 | template 103 | inline imComplex operator += (const imComplex& C1, const imComplex& C2) 104 | { 105 | return imComplex(C1.real + C2.real, C1.imag + C2.imag); 106 | } 107 | 108 | template 109 | inline imComplex operator - (const imComplex& C1, const imComplex& C2) 110 | { 111 | return imComplex(C1.real - C2.real, C1.imag - C2.imag); 112 | } 113 | 114 | template 115 | inline imComplex operator - (const imComplex& C, const T& R) 116 | { 117 | return imComplex(C.real - R, C.imag); 118 | } 119 | 120 | template 121 | inline imComplex operator * (const imComplex& C1, const imComplex& C2) 122 | { 123 | return imComplex(C1.real * C2.real - C1.imag * C2.imag, 124 | C1.imag * C2.real + C1.real * C2.imag); 125 | } 126 | 127 | template 128 | inline imComplex operator / (const imComplex& C1, const imComplex& C2) 129 | { 130 | T den = C2.real * C2.real - C2.imag * C2.imag; 131 | return imComplex((C1.real * C2.real + C1.imag * C2.imag) / den, 132 | (C1.imag * C2.real - C1.real * C2.imag) / den); 133 | } 134 | 135 | template 136 | inline imComplex operator / (const imComplex& C, const float& R) 137 | { 138 | return imComplex(C.real / (T)R, C.imag / (T)R); 139 | } 140 | 141 | template 142 | inline imComplex operator / (const imComplex& C, const double& R) 143 | { 144 | return imComplex(C.real / (T)R, C.imag / (T)R); 145 | } 146 | 147 | template 148 | inline imComplex operator /= (const imComplex& C, const float& R) 149 | { 150 | return imComplex(C.real / (T)R, C.imag / (T)R); 151 | } 152 | 153 | template 154 | inline imComplex operator /= (const imComplex& C, const double& R) 155 | { 156 | return imComplex(C.real / (T)R, C.imag / (T)R); 157 | } 158 | 159 | template 160 | inline imComplex operator * (const imComplex& C, const float& R) 161 | { 162 | return imComplex(C.real * (T)R, C.imag * (T)R); 163 | } 164 | 165 | template 166 | inline imComplex operator * (const imComplex& C, const double& R) 167 | { 168 | return imComplex(C.real * (T)R, C.imag * (T)R); 169 | } 170 | 171 | template 172 | inline int operator == (const imComplex& C1, const imComplex& C2) 173 | { 174 | return ((C1.real == C2.real) && (C1.imag == C2.imag)); 175 | } 176 | 177 | template 178 | inline T cpxreal(const imComplex& C) 179 | { 180 | return C.real; 181 | } 182 | 183 | template 184 | inline T cpximag(const imComplex& C) 185 | { 186 | return C.imag; 187 | } 188 | 189 | template 190 | inline T cpxmag(const imComplex& C) 191 | { 192 | return sqrt(C.real*C.real + C.imag*C.imag); 193 | } 194 | 195 | template 196 | inline T cpxphase(const imComplex& C) 197 | { 198 | return atan2(C.real, C.imag); 199 | } 200 | 201 | template 202 | inline imComplex cpxconj(const imComplex& C) 203 | { 204 | return imComplex(C.real, -C.imag); 205 | } 206 | 207 | template 208 | inline imComplex cpxpolar(const T& mag, const T& phase) 209 | { 210 | return imComplex(mag * cos(phase), mag * sin(phase)); 211 | } 212 | 213 | template 214 | inline imComplex log(const imComplex& C) 215 | { 216 | return imComplex(log(cpxmag(C)), atan2(C.real, C.imag)); 217 | } 218 | 219 | template 220 | inline imComplex exp(const imComplex& C) 221 | { 222 | T mag = exp(C.real); 223 | return imComplex(mag * cos(C.imag), mag * sin(C.imag)); 224 | } 225 | 226 | template 227 | inline imComplex pow(const imComplex& C1, const imComplex& C2) 228 | { 229 | return exp(C1 * log(C2)); 230 | } 231 | 232 | template 233 | inline imComplex pow(const imComplex& C1, const T& R) 234 | { 235 | imComplex C2(R); 236 | return pow(C1, C2); 237 | } 238 | 239 | template 240 | inline imComplex sqrt(const imComplex& C) 241 | { 242 | T mag = sqrt(sqrt(C.real*C.real + C.imag*C.imag)); 243 | T phase = atan2(C.real, C.imag) / 2; 244 | return imComplex(mag * cos(phase), mag * sin(phase)); 245 | } 246 | 247 | /** @} */ 248 | 249 | /** complex numbers usign 2 floats 250 | * \ingroup cpx */ 251 | typedef imComplex imcfloat; 252 | 253 | /** complex numbers usign 2 doubles 254 | * \ingroup cpx */ 255 | typedef imComplex imcdouble; 256 | 257 | 258 | #endif 259 | -------------------------------------------------------------------------------- /im3/include/im_convert.h: -------------------------------------------------------------------------------- 1 | /** \file 2 | * \brief Image Conversion 3 | * 4 | * See Copyright Notice in im_lib.h 5 | */ 6 | 7 | #ifndef __IM_CONVERT_H 8 | #define __IM_CONVERT_H 9 | 10 | #include "im_image.h" 11 | 12 | #if defined(__cplusplus) 13 | extern "C" { 14 | #endif 15 | 16 | 17 | /** \defgroup convert Image Conversion 18 | * \par 19 | * Converts one type of image into another. Can convert between color modes 20 | * and between data types. 21 | * \par 22 | * See \ref im_convert.h 23 | * \ingroup imgclass */ 24 | 25 | 26 | /** Complex to real conversions 27 | * \ingroup convert */ 28 | enum imComplex2Real 29 | { 30 | IM_CPX_REAL, 31 | IM_CPX_IMAG, 32 | IM_CPX_MAG, 33 | IM_CPX_PHASE 34 | }; 35 | 36 | /** Predefined Gamma factors. Gamma can be any real number. 37 | * When gamma<0 use logarithmic, when gamma>0 use exponential. 38 | * gamma(x,g) = ((e^(g*x))-1)/(exp(g)-1) 39 | * gamma(x,g) = (log((g*x)+1))/(log(g+1)) 40 | * \ingroup convert */ 41 | enum imGammaFactor 42 | { 43 | IM_GAMMA_LINEAR = 0, 44 | IM_GAMMA_LOGLITE = -10, 45 | IM_GAMMA_LOGHEAVY = -1000, 46 | IM_GAMMA_EXPLITE = 2, 47 | IM_GAMMA_EXPHEAVY = 7 48 | }; 49 | 50 | /** Predefined Cast Modes \n 51 | * See also \ref color Color Manipulation, Color Component Intervals section. 52 | * \ingroup convert */ 53 | enum imCastMode 54 | { 55 | IM_CAST_MINMAX, /**< scan for min and max values. */ 56 | IM_CAST_FIXED, /**< use predefined min-max values. */ 57 | IM_CAST_DIRECT, /**< direct type cast the value. */ 58 | IM_CAST_USER /**< user attributes called "UserMin" and "UserMax", both double values. */ 59 | }; 60 | 61 | /** Changes the image data type, using a complex2real conversion, 62 | * a gamma factor, and an absolute mode (modulus). \n 63 | * When demoting the data type the function will scan source for min/max values or use fixed values (cast_mode) 64 | * to scale the result according to the target range. \n 65 | * Except complex to real that will use only the complex2real conversion. \n 66 | * Images must be of the same size and color mode. If data type is the same nothing is done. \n 67 | * Returns IM_ERR_NONE, IM_ERR_MEM, IM_ERR_DATA or IM_ERR_COUNTER, see also \ref imErrorCodes. \n 68 | * See also \ref imDataType, \ref datatypeutl, \ref imComplex2Real, \ref imGammaFactor and \ref imCastMode. 69 | * 70 | * \verbatim im.ConvertDataType(src_image: imImage, dst_image: imImage, cpx2real: number, gamma: number, absolute: boolean, cast_mode: number) -> error: number [in Lua 5] \endverbatim 71 | * \verbatim im.ConvertDataTypeNew(image: imImage, data_type: number, cpx2real: number, gamma: number, absolute: boolean, cast_mode: number) -> error: number, new_image: imImage [in Lua 5] \endverbatim 72 | * \ingroup convert */ 73 | int imConvertDataType(const imImage* src_image, imImage* dst_image, int cpx2real, double gamma, int absolute, int cast_mode); 74 | 75 | /** Converts one color space to another. \n 76 | * Images must be of the same size and data type. If color mode is the same nothing is done. \n 77 | * CMYK can be converted to RGB only, and it is a very simple conversion. \n 78 | * All colors can be converted to Binary, the non zero gray values are converted to 1. \n 79 | * RGB to Map uses the median cut implementation from the free IJG JPEG software, copyright Thomas G. Lane. \n 80 | * Alpha channel is considered and Transparency* attributes are converted to alpha channel. \n 81 | * All other color space conversions assume sRGB and CIE definitions, see \ref color. \n 82 | * Returns IM_ERR_NONE, IM_ERR_DATA or IM_ERR_COUNTER, see also \ref imErrorCodes. \n 83 | * See also \ref imColorSpace, \ref imColorModeConfig and \ref colormodeutl. 84 | * 85 | * \verbatim im.ConvertColorSpace(src_image: imImage, dst_image: imImage) -> error: number [in Lua 5] \endverbatim 86 | * \verbatim im.ConvertColorSpaceNew(image: imImage, color_space: number, has_alpha: boolean) -> error: number, new_image: imImage [in Lua 5] \endverbatim 87 | * \ingroup convert */ 88 | int imConvertColorSpace(const imImage* src_image, imImage* dst_image); 89 | 90 | /** Converts the image to its bitmap equivalent, 91 | * uses \ref imConvertColorSpace and \ref imConvertDataType. \n 92 | * Returns IM_ERR_NONE, IM_ERR_MEM, IM_ERR_DATA or IM_ERR_COUNTER, see also \ref imErrorCodes. 93 | * See also \ref imImageIsBitmap, \ref imComplex2Real, \ref imGammaFactor and \ref imCastMode. \n 94 | * The function im.ConvertToBitmapNew uses the default conversion result from \ref imColorModeToBitmap if color_space is nil. 95 | * 96 | * \verbatim im.ConvertToBitmap(src_image: imImage, dst_image: imImage, cpx2real: number, gamma: number, absolute: boolean, cast_mode: number) -> error: number [in Lua 5] \endverbatim 97 | * \verbatim im.ConvertToBitmapNew(image: imImage, color_space: number, has_alpha: boolean, cpx2real: number, gamma: number, absolute: boolean, cast_mode: number) -> error: number, new_image: imImage [in Lua 5] \endverbatim 98 | * \ingroup convert */ 99 | int imConvertToBitmap(const imImage* src_image, imImage* dst_image, int cpx2real, double gamma, int absolute, int cast_mode); 100 | 101 | /** Returns an OpenGL compatible data buffer. Also returns the correspondent pixel format. \n 102 | * The memory allocated is stored in the attribute "GLDATA" with BYTE type. And it will exists while the image exists. \n 103 | * It can be cleared by setting the attribute to NULL. \n 104 | * MAP images are converted to RGB, and BINARY images are converted to GRAY. 105 | * Alpha channel is considered and Transparency* attributes are converted to alpha channel. 106 | * So calculate depth from glformat, not from image depth. 107 | * 108 | * \verbatim image:GetOpenGLData() -> gldata: userdata, glformat: number [in Lua 5] \endverbatim 109 | * \ingroup convert */ 110 | void* imImageGetOpenGLData(const imImage* image, int *glformat); 111 | 112 | /** Creates an image from an OpenGL data. 113 | * 114 | * \verbatim im.ImageCreateFromOpenGLData(width, height, glformat: number, gldata: userdata) -> image: imImage [in Lua 5] \endverbatim 115 | * \ingroup convert */ 116 | imImage* imImageCreateFromOpenGLData(int width, int height, int glformat, const void* gldata); 117 | 118 | 119 | /** \defgroup cnvutil Raw Data Conversion Utilities 120 | * \par 121 | * Utilities for raw data buffers. 122 | * \par 123 | * See \ref im_convert.h 124 | * \ingroup imagerep */ 125 | 126 | 127 | /** Changes the packing of the data buffer. Both must have the same width, height and data_type. \n 128 | * It can be used to copy data even if depth=1. \n 129 | * Unsed in OpenGL data conversions. 130 | * \ingroup cnvutil */ 131 | void imConvertPacking(const void* src_data, void* dst_data, int width, int height, int src_depth, int dst_depth, int data_type, int src_is_packed); 132 | 133 | /** Changes in-place a MAP data into a RGB data. The data must have room for the RGB image. \n 134 | * depth can be 3 or 4. count=width*height. \n 135 | * Unsed in OpenGL data conversions. 136 | * \ingroup cnvutil */ 137 | void imConvertMapToRGB(unsigned char* data, int count, int depth, int packed, long* palette, int palette_count); 138 | 139 | 140 | 141 | /* Converts a RGB bitmap into a map bitmap using the median cut algorithm. 142 | * Used only "im_convertcolor.cpp" implemented in "im_rgb2map.cpp". 143 | * Internal function kept here because of the compatibility module. 144 | * Will not be at the documentation. */ 145 | int imConvertRGB2Map(int width, int height, 146 | unsigned char *red, unsigned char *green, unsigned char *blue, 147 | unsigned char *map, long *palette, int *palette_count); 148 | int imConvertRGB2MapCounter(int width, int height, 149 | unsigned char *red, unsigned char *green, unsigned char *blue, 150 | unsigned char *map, long *palette, int *palette_count, 151 | int counter); 152 | 153 | 154 | #if defined(__cplusplus) 155 | } 156 | #endif 157 | 158 | #endif 159 | -------------------------------------------------------------------------------- /im3/include/im_counter.h: -------------------------------------------------------------------------------- 1 | /** \file 2 | * \brief Processing Counter 3 | * 4 | * See Copyright Notice in im_lib.h 5 | */ 6 | 7 | #ifndef __IM_COUNTER_H 8 | #define __IM_COUNTER_H 9 | 10 | #if defined(__cplusplus) 11 | extern "C" { 12 | #endif 13 | 14 | 15 | /** \defgroup counter Counter 16 | * \par 17 | * Used to notify the application that a step in the loading, saving or processing operation has been performed. 18 | * \par 19 | * See \ref im_counter.h 20 | * \ingroup util */ 21 | 22 | /** Counter callback, informs the progress of the operation to the client. \n 23 | * Counter id identifies different counters. \n 24 | * Progress in a count reports a value from 0 to 1000 always, proportional to total value and increment. 25 | * If -1 indicates that Begin was called, 1001 indicates that End was called. \n 26 | * If returns 0 the client should abort the operation. \n 27 | * Noticed that if the counter is aborted, the callback will still be called one last time at 1001. 28 | * Text is NULL most of the time, but contains a title in Begin (progress==-1) 29 | * and a message in the start of a count (progress==0). 30 | * \ingroup counter */ 31 | typedef int (*imCounterCallback)(int counter, void* cb_user_data, const char* text, int progress); 32 | 33 | /** Changes the counter callback. Returns old callback. \n 34 | * User data is changed only if not NULL. 35 | * \ingroup counter */ 36 | imCounterCallback imCounterSetCallback(void* cb_user_data, imCounterCallback counter_func); 37 | 38 | /** Returns true if the counter callback is set. 39 | * When the callback is NULL the counter is inactive and all functions do nothing. 40 | * \ingroup counter */ 41 | int imCounterHasCallback(void); 42 | 43 | /** Begins a new count. \n 44 | * Calls the callback with "-1" and text=title. \n 45 | * This is to be used by the operations. Returns a new counter Id. \n 46 | * Several counters can coexist at the same time, as part of a sequence with sub-counter 47 | * or simultaneous counter in multi-thread applications. 48 | * \ingroup counter */ 49 | int imCounterBegin(const char* title); 50 | 51 | /** Ends a count. \n 52 | * Calls the callback with "1001", text=null, and releases the counter. \n 53 | * \ingroup counter */ 54 | void imCounterEnd(int counter); 55 | 56 | /** Increments a count. Must set the total first. \n 57 | * Calls the callback, text=message if it is the first increment for the count. \n 58 | * Returns 0 if the callback aborted, 1 if returns normally. 59 | * \ingroup counter */ 60 | int imCounterInc(int counter); 61 | 62 | /** Set a specific count. Must set the total first. \n 63 | * Calls the callback, text=message if it is the first increment for the count. \n 64 | * Returns 0 if the callback aborted, 1 if returns normally. 65 | * \ingroup counter */ 66 | int imCounterIncTo(int counter, int count); 67 | 68 | /** Sets the total increments of a count. \n 69 | * Must be set at least one time. \n 70 | * Notice that if total is set more than one time counter should simply restart. 71 | * \ingroup counter */ 72 | void imCounterTotal(int counter, int total, const char* message); 73 | 74 | /** Sets an additional user data in the counter. 75 | * Used to save the lock in multi-threaded configurations. 76 | * \ingroup counter */ 77 | void* imCounterGetUserData(int counter); 78 | 79 | /** Returns the additional user data in the counter. 80 | * \ingroup counter */ 81 | void imCounterSetUserData(int counter, void* userdata); 82 | 83 | 84 | #if defined(__cplusplus) 85 | } 86 | #endif 87 | 88 | #endif 89 | -------------------------------------------------------------------------------- /im3/include/im_file.h: -------------------------------------------------------------------------------- 1 | /** \file 2 | * \brief File Access 3 | * 4 | * See Copyright Notice in im_lib.h 5 | */ 6 | 7 | #ifndef __IM_FILE_H 8 | #define __IM_FILE_H 9 | 10 | #include "im.h" 11 | 12 | #if defined(__cplusplus) 13 | extern "C" { 14 | #endif 15 | 16 | 17 | /** \defgroup filesdk File Format SDK 18 | * \par 19 | * All the file formats are based on theses structures. Use them to create new file formats. \n 20 | * The LineBuffer functions will help transfer image from format buffer to application buffer and vice-versa. 21 | * \par 22 | * See \ref im_file.h 23 | * \ingroup file */ 24 | 25 | 26 | /** \brief Image File Structure (SDK Use Only) 27 | * 28 | * \par 29 | * Base container to hold format independent state variables. 30 | * \ingroup filesdk */ 31 | struct _imFile 32 | { 33 | int is_new; 34 | void* attributes_table; /**< in fact is a imAttribTable, but we hide this here */ 35 | 36 | void* line_buffer; /**< used for line conversion, contains all components if packed, or only one if not */ 37 | int line_buffer_size; 38 | int line_buffer_extra; /**< extra bytes to be allocated */ 39 | int line_buffer_alloc; /**< total allocated so far */ 40 | int counter; 41 | 42 | int convert_bpp; /**< number of bpp to unpack/pack to/from 1 byte. 43 | When reading converts n packed bits to 1 byte (unpack). If n>1 will also expand to 0-255. 44 | When writing converts 1 byte to 1 bit (pack). 45 | If negative will only expand to 0-255 (no unpack or pack). */ 46 | int switch_type; /**< flag to switch the original data type: char-byte, short-ushort, uint-int, double-float */ 47 | 48 | long palette[256]; 49 | int palette_count; 50 | 51 | int user_color_mode, 52 | user_data_type, 53 | file_color_mode, /* these two must be filled by te driver always. */ 54 | file_data_type; 55 | 56 | /* these must be filled by the driver when reading, 57 | and given by the user when writing. */ 58 | 59 | char compression[10]; 60 | int image_count, 61 | image_index, 62 | width, 63 | height; 64 | }; 65 | 66 | 67 | /* Internal Use only */ 68 | 69 | /* Initializes the imFile structure. 70 | * Used by the special format RAW. */ 71 | void imFileClear(imFile* ifile); 72 | 73 | /* Initializes the line buffer. 74 | * Used by "im_file.cpp" only. */ 75 | void imFileLineBufferInit(imFile* ifile); 76 | 77 | /* Check if the conversion is valid. 78 | * Used by "im_file.cpp" only. */ 79 | int imFileCheckConversion(imFile* ifile); 80 | 81 | 82 | /* File Format SDK */ 83 | 84 | /** Number of lines to be accessed. 85 | * \ingroup filesdk */ 86 | int imFileLineBufferCount(imFile* ifile); 87 | 88 | /** Increments the line and plane counters. 89 | * \ingroup filesdk */ 90 | void imFileLineBufferInc(imFile* ifile, int *line, int *plane); 91 | 92 | /** Converts from FILE color mode to USER color mode. 93 | * \ingroup filesdk */ 94 | void imFileLineBufferRead(imFile* ifile, void* data, int line, int plane); 95 | 96 | /** Converts from USER color mode to FILE color mode. 97 | * \ingroup filesdk */ 98 | void imFileLineBufferWrite(imFile* ifile, const void* data, int line, int plane); 99 | 100 | /** Utility to calculate the line size in byte with a specified alignment. \n 101 | * "align" can be 1, 2 or 4. 102 | * \ingroup filesdk */ 103 | int imFileLineSizeAligned(int width, int bpp, int align); 104 | 105 | /** Set the attributes FileFormat, FileCompression and FileImageCount. \n 106 | * Used in imFileOpen and imFileOpenAs, and after the attribute list cleared with RemoveAll. 107 | * \ingroup filesdk */ 108 | void imFileSetBaseAttributes(imFile* ifile); 109 | 110 | 111 | #if defined(__cplusplus) 112 | } 113 | #endif 114 | 115 | #endif 116 | -------------------------------------------------------------------------------- /im3/include/im_format.h: -------------------------------------------------------------------------------- 1 | /** \file 2 | * \brief File Format Access 3 | * 4 | * See Copyright Notice in im_lib.h 5 | */ 6 | 7 | #include "im_file.h" 8 | #include "im_attrib.h" 9 | 10 | #ifndef __IM_FORMAT_H 11 | #define __IM_FORMAT_H 12 | 13 | 14 | class imFormat; 15 | 16 | /** \brief Image File Format Virtual Base Class (SDK Use Only) 17 | * 18 | * \par 19 | * Virtual Base class for file formats. All file formats inherit from this class. 20 | * \ingroup filesdk */ 21 | class imFileFormatBase: public _imFile 22 | { 23 | public: 24 | const imFormat* iformat; 25 | 26 | imFileFormatBase(const imFormat* _iformat): iformat(_iformat) {} 27 | virtual ~imFileFormatBase() {} 28 | 29 | imAttribTable* AttribTable() {return (imAttribTable*)this->attributes_table;} 30 | 31 | /* Pure Virtual Methods. Every driver must implement all the following methods. */ 32 | 33 | virtual int Open(const char* file_name) = 0; // Must initialize compression and image_count 34 | virtual int New(const char* file_name) = 0; 35 | virtual void Close() = 0; 36 | virtual void* Handle(int index) = 0; 37 | virtual int ReadImageInfo(int index) = 0; // Should update compression 38 | virtual int ReadImageData(void* data) = 0; 39 | virtual int WriteImageInfo() = 0; // Should update compression 40 | virtual int WriteImageData(void* data) = 0; // Must update image_count 41 | }; 42 | 43 | /** \brief Image File Format Descriptor Class (SDK Use Only) 44 | * 45 | * \par 46 | * All file formats must define these informations. They are stored by \ref imFormatRegister. 47 | * \ingroup filesdk */ 48 | class imFormat 49 | { 50 | public: 51 | const char* format; 52 | const char* desc; 53 | const char* ext; 54 | const char** comp; 55 | const char* extra; 56 | int comp_count, 57 | can_sequence; 58 | 59 | virtual imFileFormatBase* Create() const = 0; 60 | virtual int CanWrite(const char* compression, int color_mode, int data_type) const = 0; 61 | 62 | imFormat(const char* _format, const char* _desc, const char* _ext, 63 | const char** _comp, int _comp_count, int _can_sequence) 64 | :format(_format), desc(_desc), ext(_ext), comp(_comp), extra(""), 65 | comp_count(_comp_count), can_sequence(_can_sequence) 66 | {} 67 | virtual ~imFormat() {} 68 | }; 69 | 70 | extern "C" 71 | { 72 | 73 | /* Internal Use only */ 74 | 75 | /* Opens a file with the respective format driver 76 | * Uses the file extension to speed up the search for the format driver. 77 | * Used by "im_file.cpp" only. */ 78 | imFileFormatBase* imFileFormatBaseOpen(const char* file_name, int *error); 79 | 80 | /* Opens a file with the given format 81 | * Used by "im_file.cpp" only. */ 82 | imFileFormatBase* imFileFormatBaseOpenAs(const char* file_name, const char* format, int *error); 83 | 84 | /* Creates a file using the given format driver. 85 | * Used by "im_file.cpp" only. */ 86 | imFileFormatBase* imFileFormatBaseNew(const char* file_name, const char* format, int *error); 87 | 88 | 89 | /* File Format SDK */ 90 | 91 | /** Register a format driver. 92 | * \ingroup filesdk */ 93 | void imFormatRegister(imFormat* iformat); 94 | 95 | 96 | } 97 | 98 | #endif 99 | -------------------------------------------------------------------------------- /im3/include/im_format_all.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chinenkai/php-iup/3e1a020992ee46d414d0627e6bd3de2724bf1724/im3/include/im_format_all.h -------------------------------------------------------------------------------- /im3/include/im_format_avi.h: -------------------------------------------------------------------------------- 1 | /** \file 2 | * \brief Register the AVI Format 3 | * 4 | * See Copyright Notice in im_lib.h 5 | */ 6 | 7 | #ifndef __IM_FORMAT_AVI_H 8 | #define __IM_FORMAT_AVI_H 9 | 10 | #if defined(__cplusplus) 11 | extern "C" { 12 | #endif 13 | 14 | /** \defgroup avi AVI - Windows Audio-Video Interleaved RIFF 15 | * \section Description 16 | * 17 | * \par 18 | * Windows Copyright Microsoft Corporation. 19 | * \par 20 | * Access to the AVI format uses Windows AVIFile library. Available in Windows Only. \n 21 | * When writing a new file you must use an ".avi" extension, or the Windows API will fail. \n 22 | * You must link the application with "im_avi.lib" 23 | * and you must call the function \ref imFormatRegisterAVI once 24 | * to register the format into the IM core library. 25 | * In Lua call require"imlua_avi". \n 26 | * Depends also on the VFW library (vfw32.lib). 27 | * When using the "im_avi.dll" this extra library is not necessary. \n 28 | * If using Cygwin or MingW must link with "-lvfw32". 29 | * Old versions of Cygwin and MingW use the "-lvfw_ms32" and "-lvfw_avi32". 30 | * \par 31 | * See \ref im_format_avi.h 32 | * 33 | * \section Features 34 | * 35 | \verbatim 36 | Data Types: Byte 37 | Color Spaces: RGB, MAP and Binary (Gray saved as MAP) 38 | Compressions (installed in Windows XP by default): 39 | NONE - no compression [default] 40 | RLE - Microsoft RLE (8bpp only) 41 | CINEPACK - Cinepak Codec by Radius 42 | MSVC - Microsoft Video 1 (old) (8bpp and 16bpp only) 43 | M261 - Microsoft H.261 Video Codec 44 | M263 - Microsoft H.263 Video Codec 45 | I420 - Intel 4:2:0 Video Codec (same as M263) 46 | IV32 - Intel Indeo Video Codec 3.2 (old) 47 | IV41 - Intel Indeo Video Codec 4.5 (old) 48 | IV50 - Intel Indeo Video 5.1 49 | IYUV - Intel IYUV Codec 50 | MPG4 - Microsoft MPEG-4 Video Codec V1 (not MPEG-4 compliant) (old) 51 | MP42 - Microsoft MPEG-4 Video Codec V2 (not MPEG-4 compliant) 52 | CUSTOM - (show compression dialog) 53 | DIVX - DivX 5.0.4 Codec (DivX must be installed) 54 | (others, must be the 4 charaters of the fourfcc code) 55 | Can have more than one image. 56 | Can have an alpha channel (only for RGB) 57 | Internally the components are always packed. 58 | Lines arranged from top down to bottom or bottom up to top. But are saved always as bottom up. 59 | Handle(0) returns NULL. imBinFile is not supported. 60 | Handle(1) returns PAVIFILE. 61 | Handle(2) returns PAVISTREAM. 62 | 63 | Attributes: 64 | FPS IM_FLOAT (1) (should set when writing, default 15) 65 | AVIQuality IM_INT (1) [1-10000, default -1] (write only) [unsed if compression=CUSTOM] 66 | KeyFrameRate IM_INT (1) (write only) [key frame frequency, if 0 not using key frames, default 15, unsed if compression=CUSTOM] 67 | DataRate IM_INT (1) (write only) [kilobits/second, default 2400, unsed if compression=CUSTOM] 68 | 69 | Comments: 70 | Reads only the first video stream. Other streams are ignored. 71 | All the images have the same size, you must call imFileReadImageInfo/imFileWriteImageInfo 72 | at least once. 73 | For codecs comparsion and download go to: 74 | http://graphics.lcs.mit.edu/~tbuehler/video/codecs/ 75 | http://www.fourcc.org 76 | \endverbatim 77 | * \ingroup format */ 78 | 79 | /** Register the AVI Format. \n 80 | * In Lua, when using require"imlua_avi" this function will be automatically called. 81 | * \ingroup avi */ 82 | void imFormatRegisterAVI(void); 83 | 84 | #if defined(__cplusplus) 85 | } 86 | #endif 87 | 88 | #endif 89 | -------------------------------------------------------------------------------- /im3/include/im_format_ecw.h: -------------------------------------------------------------------------------- 1 | /** \file 2 | * \brief Register the ECW Format 3 | * 4 | * See Copyright Notice in im_lib.h 5 | */ 6 | 7 | #ifndef __IM_FORMAT_ECW_H 8 | #define __IM_FORMAT_ECW_H 9 | 10 | #if defined(__cplusplus) 11 | extern "C" { 12 | #endif 13 | 14 | /** \defgroup ecw ECW - ECW JPEG 2000 15 | * \section Description 16 | * 17 | * \par 18 | * ECW JPEG 2000 Copyright 1998 Earth Resource Mapping Ltd. 19 | * Two formats are supported with this module. The ECW (Enhanced Compression Wavelet) format and the ISO JPEG 2000 format. 20 | * \par 21 | * Access to the ECW format uses the ECW JPEG 2000 SDK version 3.3. 22 | * Available in Windows, Linux and Solaris Only. But source code is also available. \n 23 | * You must link the application with "im_ecw.lib" 24 | * and you must call the function \ref imFormatRegisterECW once 25 | * to register the format into the IM core library. \n 26 | * Depends also on the ECW JPEG 2000 SDK libraries (NCSEcw.lib). 27 | * \par 28 | * When using other JPEG 2000 libraries the first registered library will be used to guess the file format. 29 | * Use the extension *.ecw to shortcut to this implementation of the JPEG 2000 format. 30 | * \par 31 | * See \ref im_format_ecw.h 32 | * \par 33 | * \par 34 | * http://www.ermapper.com/ecw/ \n 35 | * The three types of licenses available for the ECW JPEG 2000 SDK are as follows: 36 | \verbatim 37 | - ECW JPEG 2000 SDK Free Use License Agreement - This license governs the free use of 38 | the ECW JPEG 2000 SDK with Unlimited Decompression and Limited Compression (Less 39 | than 500MB). 40 | - ECW JPEG 2000 SDK Public Use License Agreement - This license governs the use of the 41 | ECW SDK with Unlimited Decompression and Unlimited Compression for applications 42 | licensed under a GNU General Public style license. 43 | - ECW JPEG 2000 SDK Commercial Use License Agreement - This license governs the use 44 | of the ECW JPEG 2000 SDK with Unlimited Decompression and Unlimited Compression 45 | for commercial applications. 46 | \endverbatim 47 | * 48 | * \section Features 49 | * 50 | \verbatim 51 | Data Types: Byte, Short, UShort, Float 52 | Color Spaces: BINARY, GRAY, RGB, YCBCR 53 | Compressions: 54 | ECW - Enhanced Compression Wavelet 55 | JPEG-2000 - ISO JPEG 2000 56 | Only one image. 57 | Can have an alpha channel 58 | Internally the components are always packed. 59 | Lines arranged from top down to bottom. 60 | Handle() returns NCSFileView* when reading, NCSEcwCompressClient* when writing. 61 | 62 | Attributes: 63 | CompressionRatio IM_FLOAT (1) [example: Ratio=7 just like 7:1] 64 | OriginX, OriginY IM_FLOAT (1) 65 | Rotation IM_FLOAT (1) 66 | CellIncrementX, CellIncrementY IM_FLOAT (1) 67 | CellUnits (string) 68 | Datum (string) 69 | Projection (string) 70 | ViewWidth, ViewHeight IM_INT (1) [view zoom] 71 | ViewXmin, ViewYmin, ViewXmax, ViewYmax IM_INT (1) [view limits] 72 | MultiBandCount IM_USHORT (1) [Number of bands in a multiband gray image.] 73 | MultiBandSelect IM_USHORT (1) [Band number to read one band of a multiband gray image. Must be set before reading image info.] 74 | 75 | Comments: 76 | Only read support is implemented. 77 | To read a region of the image you must set the View* attributes before reading the image data. 78 | After reading a partial image the width and height returned in ReadImageInfo is the view size. 79 | The view limits define the region to be read. 80 | The view size is the actual size of the image, so the result can be zoomed. 81 | \endverbatim 82 | * \ingroup format */ 83 | 84 | /** Register the ECW Format 85 | * \ingroup ecw */ 86 | void imFormatRegisterECW(void); 87 | 88 | 89 | #if defined(__cplusplus) 90 | } 91 | #endif 92 | 93 | #endif 94 | -------------------------------------------------------------------------------- /im3/include/im_format_jp2.h: -------------------------------------------------------------------------------- 1 | /** \file 2 | * \brief Register the JP2 Format 3 | * 4 | * See Copyright Notice in im_lib.h 5 | */ 6 | 7 | #ifndef __IM_FORMAT_JP2_H 8 | #define __IM_FORMAT_JP2_H 9 | 10 | #if defined(__cplusplus) 11 | extern "C" { 12 | #endif 13 | 14 | 15 | /** \defgroup jp2 JP2 - JPEG-2000 JP2 File Format 16 | * \section Description 17 | * 18 | * \par 19 | * ISO/IEC 15444 (2000, 2003)\n 20 | * http://www.jpeg.org/ 21 | * \par 22 | * You must link the application with "im_jp2.lib" 23 | * and you must call the function \ref imFormatRegisterJP2 once 24 | * to register the format into the IM core library. 25 | * In Lua call require"imlua_jp2". \n 26 | * \par 27 | * Access to the JPEG2000 file format uses libJasper version 2.0.14 \n 28 | * https://www.ece.uvic.ca/~frodo/jasper/ \n 29 | * Copyright (c) 2001-2016 Michael David Adams. \n 30 | * 31 | * \par 32 | * See \ref im_format_jp2.h 33 | * 34 | * \section Features 35 | * 36 | \verbatim 37 | Data Types: Byte and UShort 38 | Color Spaces: Binary, Gray, RGB, YCbCr, Lab and XYZ 39 | Compressions: 40 | JPEG-2000 - ISO JPEG 2000 [default] 41 | Only one image. 42 | Can have an alpha channel. 43 | Internally the components are always unpacked. 44 | Internally the lines are arranged from top down to bottom. 45 | Handle(1) returns jas_image_t* 46 | Handle(2) returns jas_stream_t* 47 | 48 | Attributes: 49 | CompressionRatio IM_FLOAT (1) [write only, example: Ratio=7 just like 7:1] 50 | 51 | Comments: 52 | We read code stream syntax and JP2, but we write always as JP2. 53 | Used definitions EXCLUDE_JPG_SUPPORT,EXCLUDE_MIF_SUPPORT, 54 | EXCLUDE_PNM_SUPPORT,EXCLUDE_RAS_SUPPORT, 55 | EXCLUDE_BMP_SUPPORT,EXCLUDE_PGX_SUPPORT 56 | Changed jas_config.h to match our needs. 57 | New file jas_binfile.c 58 | Changed base/jas_stream.c to export jas_stream_create and jas_stream_initbuf. 59 | The counter is for memory transfer only. 60 | These changes can be ignored when using an external libJasper distribution, 61 | but in this case the imBinFile global features will not work. 62 | \endverbatim 63 | * \ingroup format */ 64 | 65 | /** Register the JP2 Format. \n 66 | * In Lua, when using require"imlua_jp2" this function will be automatically called. 67 | * \ingroup jp2 */ 68 | void imFormatRegisterJP2(void); 69 | 70 | 71 | #if defined(__cplusplus) 72 | } 73 | #endif 74 | 75 | #endif 76 | -------------------------------------------------------------------------------- /im3/include/im_format_raw.h: -------------------------------------------------------------------------------- 1 | /** \file 2 | * \brief Initialize the RAW Format Driver 3 | * Header for internal use only. 4 | * 5 | * See Copyright Notice in im_lib.h 6 | */ 7 | 8 | #ifndef __IM_FORMAT_RAW_H 9 | #define __IM_FORMAT_RAW_H 10 | 11 | #if defined(__cplusplus) 12 | extern "C" { 13 | #endif 14 | 15 | /** \defgroup raw RAW - RAW File 16 | * 17 | * \par 18 | * The file must be open/created with the functions \ref imFileOpenRaw and \ref imFileNewRaw. 19 | * 20 | * \section Description 21 | * 22 | * \par 23 | * Internal Implementation. 24 | * \par 25 | * Supports RAW binary images. This is an unstructured and uncompressed binary data. 26 | * It is NOT a Camera RAW file generated in many professional digital cameras. \n 27 | * You must know image parameters a priori and must set the IM_INT attributes "Width", "Height", "ColorMode", "DataType" 28 | * before the imFileReadImageInfo/imFileWriteImageInfo functions. 29 | * \par 30 | * The data must be in binary form, but can start in an arbitrary offset from the begining of the file, use attribute "StartOffset". 31 | * The default is at 0 offset. 32 | * \par 33 | * Integer sign and double precision can be converted using attribute "SwitchType". \n 34 | * The conversions will be BYTE<->CHAR, USHORT<->SHORT, INT<->UINT, FLOAT<->DOUBLE. 35 | * \par 36 | * Byte Order can be Little Endian (Intel=1) or Big Endian (Motorola=0), use the attribute "ByteOrder", the default is the current CPU. 37 | * \par 38 | * The lines can be aligned to a BYTE (1), WORD (2) or DWORD (4) boundaries, ue attribute "Padding" with the respective value. 39 | * \par 40 | * If the compression is ASCII the data is stored in textual format, instead of binary. 41 | * In this case SwitchType and ByteOrder are ignored, and Padding should be 0. 42 | * \par 43 | * When reading, if data type is BYTE, color space is RGB and data is packed, then the attribute "RGB16" is consulted. 44 | * It can has values "555" or "565" indicating a packed 16 bits RGB pixel is stored with the given bit distribution for R, G and B. 45 | * \par 46 | * See \ref im_raw.h 47 | * 48 | * \section Features 49 | * 50 | \verbatim 51 | Data Types: 52 | Color Spaces: all, except MAP. 53 | Compressions: 54 | NONE - no compression [default] 55 | ASCII (textual data) 56 | Can have more than one image, depends on "StartOffset" attribute. 57 | Can have an alpha channel. 58 | Components can be packed or not. 59 | Lines arranged from top down to bottom or bottom up to top. 60 | 61 | Attributes: 62 | Width, Height, ColorMode, DataType IM_INT (1) 63 | ImageCount[1], StartOffset[0], SwitchType[FALSE], ByteOrder[IM_LITTLEENDIAN], Padding[0] IM_INT (1) 64 | 65 | Comments: 66 | In fact ASCII is an expansion, not a compression, because the file will be larger than binary data. 67 | \endverbatim 68 | * \ingroup format */ 69 | imFormat* imFormatInitRAW(void); 70 | 71 | void imFormatFinishRAW(void); 72 | 73 | #if defined(__cplusplus) 74 | } 75 | #endif 76 | 77 | #endif 78 | -------------------------------------------------------------------------------- /im3/include/im_format_wmv.h: -------------------------------------------------------------------------------- 1 | /** \file 2 | * \brief Register the WMF Format 3 | * 4 | * See Copyright Notice in im_lib.h 5 | */ 6 | 7 | #ifndef __IM_FORMAT_WMV_H 8 | #define __IM_FORMAT_WMV_H 9 | 10 | #if defined(__cplusplus) 11 | extern "C" { 12 | #endif 13 | 14 | /** \defgroup wmv WMV - Windows Media Video Format 15 | * \section Description 16 | * 17 | * \par 18 | * Advanced Systems Format (ASF) \n 19 | * Windows Copyright Microsoft Corporation. 20 | * \par 21 | * Access to the WMV format uses Windows Media SDK. Available in Windows Only. \n 22 | * You must link the application with "im_wmv.lib" 23 | * and you must call the function \ref imFormatRegisterWMV once 24 | * to register the format into the IM core library. 25 | * In Lua call require"imlua_wmv". \n 26 | * Depends also on the WMF SDK (wmvcore.lib). 27 | * When using the "im_wmv.dll" this extra library is not necessary. 28 | * \par 29 | * The application users should have the WMV codec 9 installed: 30 | * http://www.microsoft.com/windows/windowsmedia/format/codecdownload.aspx 31 | * \par 32 | * You must agree with the WMF SDK EULA to use the SDK. \n 33 | * http://wmlicense.smdisp.net/v9sdk/ 34 | * \par 35 | * For more information: \n 36 | * http://www.microsoft.com/windows/windowsmedia/9series/sdk.aspx \n 37 | * http://msdn.microsoft.com/library/en-us/wmform/htm/introducingwindowsmediaformat.asp 38 | * \par 39 | * See \ref im_format_wmv.h 40 | * 41 | * \section Features 42 | * 43 | \verbatim 44 | Data Types: Byte 45 | Color Spaces: RGB and MAP (Gray and Binary saved as MAP) 46 | Compressions (installed in Windows XP by default): 47 | NONE - no compression 48 | MPEG-4v3 - Windows Media MPEG-4 Video V3 49 | MPEG-4v1 - ISO MPEG-4 Video V1 50 | WMV7 - Windows Media Video V7 51 | WMV7Screen - Windows Media Screen V7 52 | WMV8 - Windows Media Video V8 53 | WMV9Screen - Windows Media Video 9 Screen 54 | WMV9 - Windows Media Video 9 [default] 55 | Unknown - Others 56 | Can have more than one image. 57 | Can have an alpha channel (only for RGB) ? 58 | Internally the components are always packed. 59 | Lines arranged from top down to bottom or bottom up to top. 60 | Handle(0) return NULL. imBinFile is not supported. 61 | Handle(1) returns IWMSyncReader* when reading, IWMWriter* when writing. 62 | 63 | Attributes: 64 | FPS IM_FLOAT (1) (should set when writing, default 15) 65 | WMFQuality IM_INT (1) [0-100, default 50] (write only) 66 | MaxKeyFrameTime IM_INT (1) (write only) [maximum key frame interval in miliseconds, default 5 seconds] 67 | DataRate IM_INT (1) (write only) [kilobits/second, default 2400] 68 | VBR IM_INT (1) [0, 1] (write only) [0 - Constant Bit Rate (default), 1 - Variable Bit Rate (Quality-Based)] 69 | (and several others from the file-level attributes) For ex: 70 | Title, Author, Copyright, Description (string) 71 | Duration IM_INT [100-nanosecond units] 72 | Seekable, HasAudio, HasVideo, Is_Protected, Is_Trusted, IsVBR IM_INT (1) [0, 1] 73 | NumberOfFrames IM_INT (1) 74 | 75 | Comments: 76 | IMPORTANT - The "image_count" and the "FPS" attribute may not be available from the file, 77 | we try to estimate from the duration and from the average time between frames, or using the default value. 78 | We do not handle DRM protected files (Digital Rights Management). 79 | Reads only the first video stream. Other streams are ignored. 80 | All the images have the same size, you must call imFileReadImageInfo/imFileWriteImageInfo 81 | at least once. 82 | For optimal random reading, the file should be indexed previously. 83 | If not indexed by frame, random positioning may not be precise. 84 | Sequencial reading will always be precise. 85 | When writing we use a custom profile and time indexing only. 86 | We do not support multipass encoding. 87 | Since the driver uses COM, CoInitialize(NULL) and CoUninitialize() are called every Open/Close. 88 | \endverbatim 89 | * \ingroup format */ 90 | 91 | /** Register the WMF Format. \n 92 | * In Lua, when using require"imlua_wmv" this function will be automatically called. 93 | * \ingroup wmv */ 94 | void imFormatRegisterWMV(void); 95 | 96 | 97 | #if defined(__cplusplus) 98 | } 99 | #endif 100 | 101 | #endif 102 | -------------------------------------------------------------------------------- /im3/include/im_kernel.h: -------------------------------------------------------------------------------- 1 | /** \file 2 | * \brief Kernel Generators 3 | * Creates several known kernels 4 | * 5 | * See Copyright Notice in im_lib.h 6 | */ 7 | 8 | #ifndef __IM_KERNEL_H 9 | #define __IM_KERNEL_H 10 | 11 | #if defined(__cplusplus) 12 | extern "C" { 13 | #endif 14 | 15 | 16 | /** \defgroup kernel Kernel Generators 17 | * \par 18 | * Creates several known kernels 19 | * \par 20 | * See \ref im_kernel.h 21 | * \ingroup convolve */ 22 | 23 | 24 | /** Creates a kernel with the following values: 25 | * 26 | \verbatim 27 | 1 2 1 28 | 0 0 0 29 | -1 -2 -1 30 | \endverbatim 31 | * 32 | * \verbatim im.KernelSobel() -> kernel: imImage [in Lua 5] \endverbatim 33 | * \ingroup kernel */ 34 | imImage* imKernelSobel(void); 35 | 36 | /** Creates a kernel with the following values: 37 | * 38 | \verbatim 39 | 1 1 1 40 | 0 0 0 41 | -1 -1 -1 42 | \endverbatim 43 | * 44 | * \verbatim im.KernelPrewitt() -> kernel: imImage [in Lua 5] \endverbatim 45 | * \ingroup kernel */ 46 | imImage* imKernelPrewitt(void); 47 | 48 | /** Creates a kernel with the following values: 49 | * 50 | \verbatim 51 | 5 5 5 52 | -3 0 -3 53 | -3 -3 -3 54 | \endverbatim 55 | * 56 | * \verbatim im.KernelKirsh() -> kernel: imImage [in Lua 5] \endverbatim 57 | * \ingroup kernel */ 58 | imImage* imKernelKirsh(void); 59 | 60 | /** Creates a kernel with the following values: 61 | * 62 | \verbatim 63 | 0 -1 0 64 | -1 4 -1 65 | 0 -1 0 66 | \endverbatim 67 | * 68 | * \verbatim im.KernelLaplacian4() -> kernel: imImage [in Lua 5] \endverbatim 69 | * \ingroup kernel */ 70 | imImage* imKernelLaplacian4(void); 71 | 72 | /** Creates a kernel with the following values: 73 | * 74 | \verbatim 75 | -1 -1 -1 76 | -1 8 -1 77 | -1 -1 -1 78 | \endverbatim 79 | * 80 | * \verbatim im.KernelLaplacian8() -> kernel: imImage [in Lua 5] \endverbatim 81 | * \ingroup kernel */ 82 | imImage* imKernelLaplacian8(void); 83 | 84 | /** Creates a kernel with the following values: 85 | * 86 | \verbatim 87 | 0 -1 -1 -1 0 88 | -1 0 1 0 -1 89 | -1 1 8 1 -1 90 | -1 0 1 0 -1 91 | 0 -1 -1 -1 0 92 | \endverbatim 93 | * 94 | * \verbatim im.KernelLaplacian5x5() -> kernel: imImage [in Lua 5] \endverbatim 95 | * \ingroup kernel */ 96 | imImage* imKernelLaplacian5x5(void); 97 | 98 | /** Creates a kernel with the following values: 99 | * 100 | \verbatim 101 | -1 -1 -1 -1 -1 -1 -1 102 | -1 -1 -1 -1 -1 -1 -1 103 | -1 -1 -1 -1 -1 -1 -1 104 | -1 -1 -1 48 -1 -1 -1 105 | -1 -1 -1 -1 -1 -1 -1 106 | -1 -1 -1 -1 -1 -1 -1 107 | -1 -1 -1 -1 -1 -1 -1 108 | \endverbatim 109 | * 110 | * \verbatim im.KernelLaplacian7x7() -> kernel: imImage [in Lua 5] \endverbatim 111 | * \ingroup kernel */ 112 | imImage* imKernelLaplacian7x7(void); 113 | 114 | /** Creates a kernel with the following values: 115 | * 116 | \verbatim 117 | 0 -1 0 118 | 0 1 0 119 | 0 0 0 120 | \endverbatim 121 | * 122 | * \verbatim im.KernelGradian3x3() -> kernel: imImage [in Lua 5] \endverbatim 123 | * \ingroup kernel */ 124 | imImage* imKernelGradian3x3(void); 125 | 126 | /** Creates a kernel with the following values: 127 | * 128 | \verbatim 129 | 0 -1 -1 0 1 1 0 130 | -1 -2 -2 0 2 2 1 131 | -1 -2 -3 0 3 2 1 132 | -1 -2 -3 0 3 2 1 133 | -1 -2 -3 0 3 2 1 134 | -1 -2 -2 0 2 2 1 135 | 0 -1 -1 0 1 1 0 136 | \endverbatim 137 | * 138 | * \verbatim im.KernelGradian7x7() -> kernel: imImage [in Lua 5] \endverbatim 139 | * \ingroup kernel */ 140 | imImage* imKernelGradian7x7(void); 141 | 142 | /** Creates a kernel with the following values: 143 | * 144 | \verbatim 145 | -1 0 0 146 | 0 0 0 147 | 0 0 1 148 | \endverbatim 149 | * 150 | * \verbatim im.KernelSculpt() -> kernel: imImage [in Lua 5] \endverbatim 151 | * \ingroup kernel */ 152 | imImage* imKernelSculpt(void); 153 | 154 | /** Creates a kernel with the following values: 155 | * 156 | \verbatim 157 | 1 1 1 158 | 1 1 1 159 | 1 1 1 160 | \endverbatim 161 | * 162 | * \verbatim im.KernelMean3x3() -> kernel: imImage [in Lua 5] \endverbatim 163 | * \ingroup kernel */ 164 | imImage* imKernelMean3x3(void); 165 | 166 | /** Creates a kernel with the following values: 167 | * 168 | \verbatim 169 | 1 1 1 1 1 170 | 1 1 1 1 1 171 | 1 1 1 1 1 172 | 1 1 1 1 1 173 | 1 1 1 1 1 174 | \endverbatim 175 | * 176 | * \verbatim im.KernelMean5x5() -> kernel: imImage [in Lua 5] \endverbatim 177 | * \ingroup kernel */ 178 | imImage* imKernelMean5x5(void); 179 | 180 | /** Creates a kernel with the following values: 181 | * 182 | \verbatim 183 | 0 1 1 1 0 184 | 1 1 1 1 1 185 | 1 1 1 1 1 186 | 1 1 1 1 1 187 | 0 1 1 1 0 188 | \endverbatim 189 | * 190 | * \verbatim im.KernelMean5x5() -> kernel: imImage [in Lua 5] \endverbatim 191 | * \ingroup kernel */ 192 | imImage* imKernelCircularMean5x5(void); 193 | 194 | /** Creates a kernel with the following values: 195 | * 196 | \verbatim 197 | 1 1 1 1 1 1 1 198 | 1 1 1 1 1 1 1 199 | 1 1 1 1 1 1 1 200 | 1 1 1 1 1 1 1 201 | 1 1 1 1 1 1 1 202 | 1 1 1 1 1 1 1 203 | 1 1 1 1 1 1 1 204 | \endverbatim 205 | * 206 | * \verbatim im.KernelMean7x7() -> kernel: imImage [in Lua 5] \endverbatim 207 | * \ingroup kernel */ 208 | imImage* imKernelMean7x7(void); 209 | 210 | /** Creates a kernel with the following values: 211 | * 212 | \verbatim 213 | 0 0 1 1 1 0 0 214 | 0 1 1 1 1 1 0 215 | 1 1 1 1 1 1 1 216 | 1 1 1 1 1 1 1 217 | 1 1 1 1 1 1 1 218 | 0 1 1 1 1 1 0 219 | 0 0 1 1 1 0 0 220 | \endverbatim 221 | * 222 | * \verbatim im.KernelCircularMean7x7() -> kernel: imImage [in Lua 5] \endverbatim 223 | * \ingroup kernel */ 224 | imImage* imKernelCircularMean7x7(void); 225 | 226 | /** Creates a kernel with the following values: 227 | * 228 | \verbatim 229 | 1 2 1 230 | 2 4 2 231 | 1 2 1 232 | \endverbatim 233 | * 234 | * \verbatim im.KernelGaussian3x3() -> kernel: imImage [in Lua 5] \endverbatim 235 | * \ingroup kernel */ 236 | imImage* imKernelGaussian3x3(void); 237 | 238 | /** Creates a kernel with the following values: 239 | * 240 | \verbatim 241 | 1 4 6 4 1 242 | 4 16 24 16 4 243 | 6 24 36 24 6 244 | 4 16 24 16 4 245 | 1 4 6 4 1 246 | \endverbatim 247 | * 248 | * \verbatim im.KernelGaussian5x5() -> kernel: imImage [in Lua 5] \endverbatim 249 | * \ingroup kernel */ 250 | imImage* imKernelGaussian5x5(void); 251 | 252 | /** Creates a kernel with the following values: 253 | * 254 | \verbatim 255 | 1 2 3 2 1 256 | 2 4 6 4 2 257 | 3 6 9 6 3 258 | 2 4 6 4 2 259 | 1 2 3 2 1 260 | \endverbatim 261 | * 262 | * \verbatim im.KernelBarlett5x5() -> kernel: imImage [in Lua 5] \endverbatim 263 | * \ingroup kernel */ 264 | imImage* imKernelBarlett5x5(void); 265 | 266 | /** Creates a kernel with the following values: 267 | * 268 | \verbatim 269 | 0 -1 -1 -1 0 270 | -1 -1 3 -1 -1 271 | -1 3 4 3 -1 272 | -1 -1 3 -1 -1 273 | 0 -1 -1 -1 0 274 | \endverbatim 275 | * 276 | * \verbatim im.KernelTopHat5x5() -> kernel: imImage [in Lua 5] \endverbatim 277 | * \ingroup kernel */ 278 | imImage* imKernelTopHat5x5(void); 279 | 280 | /** Creates a kernel with the following values: 281 | * 282 | \verbatim 283 | 0 0 -1 -1 -1 0 0 284 | 0 -1 -1 -1 -1 -1 0 285 | -1 -1 3 3 3 -1 -1 286 | -1 -1 3 4 3 -1 -1 287 | -1 -1 3 3 3 -1 -1 288 | 0 -1 -1 -1 -1 -1 0 289 | 0 0 -1 -1 -1 0 0 290 | \endverbatim 291 | * 292 | * \verbatim im.KernelTopHat7x7() -> kernel: imImage [in Lua 5] \endverbatim 293 | * \ingroup kernel */ 294 | imImage* imKernelTopHat7x7(void); 295 | 296 | /** Creates a kernel with the following values: 297 | * 298 | \verbatim 299 | 0 -1 -2 -1 0 300 | -1 -4 0 -4 -1 301 | -2 0 40 0 -2 302 | -1 -4 0 -4 -1 303 | 0 -1 -2 -1 0 304 | \endverbatim 305 | * 306 | * \verbatim im.KernelEnhance() -> kernel: imImage [in Lua 5] \endverbatim 307 | * \ingroup kernel */ 308 | imImage* imKernelEnhance(void); 309 | 310 | #if defined(__cplusplus) 311 | } 312 | #endif 313 | 314 | #endif 315 | 316 | -------------------------------------------------------------------------------- /im3/include/im_lib.h: -------------------------------------------------------------------------------- 1 | /** \file 2 | * \brief Library Management and Main Documentation 3 | * 4 | * See Copyright Notice in this file. 5 | */ 6 | 7 | #ifndef __IM_LIB_H 8 | #define __IM_LIB_H 9 | 10 | #if defined(__cplusplus) 11 | extern "C" { 12 | #endif 13 | 14 | 15 | /** \defgroup lib Library Management 16 | * \ingroup util 17 | * \par 18 | * Usefull definitions for about dialogs and 19 | * for comparing the compiled version with the linked version of the library. 20 | * \par 21 | * \verbatim im._AUTHOR [in Lua 5] \endverbatim 22 | * \verbatim im._COPYRIGHT [in Lua 5] \endverbatim 23 | * \verbatim im._VERSION [in Lua 5] \endverbatim 24 | * \verbatim im._VERSION_DATE [in Lua 5] \endverbatim 25 | * \verbatim im._VERSION_NUMBER [in Lua 5] \endverbatim 26 | * \verbatim im._DESCRIPTION [in Lua 5] \endverbatim 27 | * \verbatim im._NAME [in Lua 5] \endverbatim 28 | * \par 29 | * See \ref im_lib.h 30 | * @{ 31 | */ 32 | #define IM_NAME "IM - An Imaging Toolkit" 33 | #define IM_DESCRIPTION "Toolkit for Image Representation, Storage, Capture and Processing" 34 | #define IM_COPYRIGHT "Copyright (C) 1994-2020 Tecgraf/PUC-Rio" 35 | #define IM_AUTHOR "Antonio Scuri" 36 | #define IM_VERSION "3.15" /* bug fixes are reported only by imVersion functions */ 37 | #define IM_VERSION_NUMBER 315000 38 | #define IM_VERSION_DATE "2020/07/30" /* does not include bug fix releases */ 39 | /** @} */ 40 | 41 | 42 | /** Returns the library current version. Returns the definition IM_VERSION plus the bug fix number. 43 | * 44 | * \verbatim im.Version() -> version: string [in Lua 5] \endverbatim 45 | * \ingroup lib */ 46 | const char* imVersion(void); 47 | 48 | /** Returns the library current version release date. Returns the definition IM_VERSION_DATE. 49 | * 50 | * \verbatim im.VersionDate() -> date: string [in Lua 5] \endverbatim 51 | * \ingroup lib */ 52 | const char* imVersionDate(void); 53 | 54 | /** Returns the library current version number. Returns the definition IM_VERSION_NUMBER plus the bug fix number. \n 55 | * Can be compared in run time with IM_VERSION_NUMBER to compare compiled and linked versions of the library. 56 | * 57 | * \verbatim im.VersionNumber() -> version: number [in Lua 5] \endverbatim 58 | * \ingroup lib */ 59 | int imVersionNumber(void); 60 | 61 | 62 | #if defined(__cplusplus) 63 | } 64 | #endif 65 | 66 | 67 | /*! \mainpage IM 68 | *
69 | *

Image Representation, Storage, Capture and Processing

70 | * Tecgraf: Computer Graphics Technology Group, PUC-Rio, Brazil \n 71 | * http://www.tecgraf.puc-rio.br/im \n 72 | * mailto:im@tecgraf.puc-rio.br 73 | *
74 | * 75 | * \section over Overview 76 | * \par 77 | * IM is a toolkit for Digital Imaging. 78 | * \par 79 | * It provides support for image capture, several image file formats and many image processing operations. 80 | * \par 81 | * Image representation includes scientific data types (like IEEE floating point data) 82 | * and attributes (or metadata like GeoTIFF and Exif tags). 83 | * Animation, video and volumes are supported as image sequences, 84 | * but there is no digital audio support. 85 | * \par 86 | * The main goal of the library is to provide a simple API and abstraction 87 | * of images for scientific applications. 88 | * \par 89 | * The toolkit API is written in C. 90 | * The core library source code is implemented in C++ and it is very portable, 91 | * it can be compiled in Windows and UNIX with no modifications. 92 | * New image processing operations can be implemented in C or in C++. 93 | * \par 94 | * IM is free software, can be used for public and commercial applications. 95 | * \par 96 | * This work was developed at Tecgraf/PUC-Rio 97 | * by means of the partnership with PETROBRAS/CENPES. 98 | * 99 | * \section author Author 100 | * \par 101 | * Antonio Scuri scuri@tecgraf.puc-rio.br 102 | * 103 | * \section copyright Copyright Notice 104 | \verbatim 105 | 106 | **************************************************************************** 107 | Copyright (C) 1994-2020 Tecgraf/PUC-Rio. 108 | 109 | Permission is hereby granted, free of charge, to any person obtaining 110 | a copy of this software and associated documentation files (the 111 | "Software"), to deal in the Software without restriction, including 112 | without limitation the rights to use, copy, modify, merge, publish, 113 | distribute, sublicense, and/or sell copies of the Software, and to 114 | permit persons to whom the Software is furnished to do so, subject to 115 | the following conditions: 116 | 117 | The above copyright notice and this permission notice shall be 118 | included in all copies or substantial portions of the Software. 119 | 120 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 121 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 122 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 123 | IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 124 | CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 125 | TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 126 | SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 127 | **************************************************************************** 128 | \endverbatim 129 | */ 130 | 131 | 132 | /** \defgroup imagerep Image Representation 133 | * \par 134 | * See \ref im.h 135 | */ 136 | 137 | 138 | /** \defgroup file Image Storage 139 | * \par 140 | * See \ref im.h 141 | */ 142 | 143 | 144 | /** \defgroup format File Formats 145 | * \par 146 | * See \ref im.h 147 | * 148 | * Internal Predefined File Formats: 149 | * \li "BMP" - Windows Device Independent Bitmap 150 | * \li "GIF" - Graphics Interchange Format 151 | * \li "ICO" - Windows Icon 152 | * \li "JPEG" - JPEG File Interchange Format 153 | * \li "LED" - IUP image in LED 154 | * \li "PCX" - ZSoft Picture 155 | * \li "PFM" - Portable FloatMap Image Format 156 | * \li "PNG" - Portable Network Graphic Format 157 | * \li "PNM" - Netpbm Portable Image Map 158 | * \li "RAS" - Sun Raster File 159 | * \li "RAW" - RAW File 160 | * \li "SGI" - Silicon Graphics Image File Format 161 | * \li "TGA" - Truevision Targa 162 | * \li "TIFF" - Tagged Image File Format 163 | * 164 | * Other Supported File Formats: 165 | * \li "JP2" - JPEG-2000 JP2 File Format 166 | * \li "AVI" - Windows Audio-Video Interleaved RIFF 167 | * \li "WMV" - Windows Media Video Format 168 | * 169 | * Some Known Compressions: 170 | * \li "NONE" - No Compression. 171 | * \li "RLE" - Run Lenght Encoding. 172 | * \li "LZW" - Lempel, Ziff and Welsh. 173 | * \li "JPEG" - Join Photographics Experts Group. 174 | * \li "DEFLATE" - LZ77 variation (ZIP) 175 | * 176 | * \ingroup file */ 177 | 178 | 179 | /* Library Names Convention 180 | * 181 | * Global Functions and Types - "im[Object][Action]" using first capitals (imFileOpen) 182 | * Local Functions and Types - "i[Object][Action]" using first capitals (iTIFFGetCompIndex) 183 | * Local Static Variables - same as local functions and types (iFormatCount) 184 | * Local Static Tables - same as local functions and types with "Table" suffix (iTIFFCompTable) 185 | * Variables and Members - no prefix, all lower case (width) 186 | * Defines and Enumerations - all capitals (IM_ERR_NONE) 187 | * 188 | */ 189 | 190 | 191 | #endif 192 | -------------------------------------------------------------------------------- /im3/include/im_math_op.h: -------------------------------------------------------------------------------- 1 | /** \file 2 | * \brief Math Operations 3 | * 4 | * See Copyright Notice in im_lib.h 5 | */ 6 | 7 | #ifndef __IM_MATH_OP_H 8 | #define __IM_MATH_OP_H 9 | 10 | #include "im_complex.h" 11 | 12 | 13 | /// Crop value to Byte limit 14 | template 15 | inline T crop_byte(const T& v) 16 | { 17 | return v < 0? 0: v > 255? 255: v; 18 | } 19 | 20 | //////////////////////////////////////////////////////////////////////////////////// 21 | 22 | /// Generic Addition with 2 template types 23 | template 24 | inline T1 add_op(const T1& v1, const T2& v2) 25 | { 26 | return v1 + v2; 27 | } 28 | 29 | //////////////////////////////////////////////////////////////////////////////////// 30 | 31 | /// Generic Subtraction with 2 template types 32 | template 33 | inline T1 sub_op(const T1& v1, const T2& v2) 34 | { 35 | return v1 - v2; 36 | } 37 | 38 | //////////////////////////////////////////////////////////////////////////////////// 39 | 40 | /// Generic Multiplication with 2 template types 41 | template 42 | inline T1 mul_op(const T1& v1, const T2& v2) 43 | { 44 | return v1 * v2; 45 | } 46 | 47 | //////////////////////////////////////////////////////////////////////////////////// 48 | 49 | /// Generic Division with 2 template types 50 | template 51 | inline T1 div_op(const T1& v1, const T2& v2) 52 | { 53 | return v1 / v2; 54 | } 55 | 56 | //////////////////////////////////////////////////////////////////////////////////// 57 | 58 | /// Generic Invert 59 | template 60 | inline T inv_op(const T& v) 61 | { 62 | return T(1)/v; 63 | } 64 | 65 | //////////////////////////////////////////////////////////////////////////////////// 66 | 67 | /// Generic Difference with 2 template types 68 | template 69 | inline T1 diff_op(const T1& v1, const T2& v2) 70 | { 71 | T1 sub = v1 - v2; 72 | if (sub < T1(0)) 73 | return T1(-1)*sub; 74 | return sub; 75 | } 76 | 77 | //////////////////////////////////////////////////////////////////////////////////// 78 | 79 | /// Generic Minimum with 2 template types 80 | template 81 | inline T1 min_op(const T1& v1, const T2& v2) 82 | { 83 | if (v1 < v2) 84 | return v1; 85 | return v2; 86 | } 87 | 88 | //////////////////////////////////////////////////////////////////////////////////// 89 | 90 | /// Generic Maximum with 2 template types 91 | template 92 | inline T1 max_op(const T1& v1, const T2& v2) 93 | { 94 | if (v1 < v2) 95 | return v2; 96 | return v1; 97 | } 98 | 99 | //////////////////////////////////////////////////////////////////////////////////// 100 | 101 | inline int ipow(int base, int exp) 102 | { 103 | int result = 1; 104 | while (exp) 105 | { 106 | if (exp & 1) 107 | result *= base; 108 | exp >>= 1; 109 | base *= base; 110 | } 111 | return result; 112 | } 113 | 114 | inline imbyte pow_op(const imbyte& v1, const imbyte& v2) 115 | { 116 | return (imbyte)ipow((int)v1, (int)v2); 117 | } 118 | 119 | inline imushort pow_op(const imushort& v1, const imushort& v2) 120 | { 121 | return (imushort)ipow((int)v1, (int)v2); 122 | } 123 | 124 | inline short pow_op(const short& v1, const short& v2) 125 | { 126 | return (short)ipow((int)v1, (int)v2); 127 | } 128 | 129 | inline int pow_op(const int& v1, const int& v2) 130 | { 131 | return ipow(v1, v2); 132 | } 133 | 134 | /// Generic Power with 2 template types 135 | template 136 | inline T1 pow_op(const T1& v1, const T2& v2) 137 | { 138 | return (T1)pow(v1, v2); 139 | } 140 | 141 | //////////////////////////////////////////////////////////////////////////////////// 142 | 143 | /// Generic Absolute 144 | template 145 | inline T abs_op(const T& v) 146 | { 147 | if (v < T(0)) 148 | return T(-1)*v; 149 | return v; 150 | } 151 | 152 | //////////////////////////////////////////////////////////////////////////////////// 153 | 154 | /// Generic Less 155 | template 156 | inline T less_op(const T& v) 157 | { 158 | return T(-1)*v; 159 | } 160 | 161 | //////////////////////////////////////////////////////////////////////////////////// 162 | 163 | /// Generic Square 164 | template 165 | inline T sqr_op(const T& v) 166 | { 167 | return v*v; 168 | } 169 | 170 | //////////////////////////////////////////////////////////////////////////////////// 171 | 172 | inline unsigned int isqrt(unsigned int number) 173 | { 174 | #define ISQRT_NEXT(n, i) (((n) + (i)/(n)) >> 1) 175 | unsigned int n = 1; 176 | unsigned int n1 = ISQRT_NEXT(n, number); 177 | 178 | while (imAbs((int)(n1 - n)) > 1) { 179 | n = n1; 180 | n1 = ISQRT_NEXT(n, number); 181 | } 182 | while (n1*n1 > number) 183 | n1--; 184 | #undef ISQRT_NEXT 185 | return n1; 186 | } 187 | 188 | inline int sqrt(const int& v) 189 | { 190 | if (v < 0) 191 | return 0; 192 | return (int)isqrt(v); 193 | } 194 | 195 | /// Generic Square Root 196 | template 197 | inline T sqrt_op(const T& v) 198 | { 199 | return (T)sqrt(v); 200 | } 201 | 202 | //////////////////////////////////////////////////////////////////////////////////// 203 | 204 | inline int exp(const int& v) 205 | { 206 | return (int)exp((double)v); 207 | } 208 | 209 | /// Generic Exponential 210 | template 211 | inline T exp_op(const T& v) 212 | { 213 | return (T)exp(v); 214 | } 215 | 216 | //////////////////////////////////////////////////////////////////////////////////// 217 | 218 | inline int log(const int& v) 219 | { 220 | return (int)log((double)v); 221 | } 222 | 223 | /// Generic Logarithm 224 | template 225 | inline T log_op(const T& v) 226 | { 227 | return (T)log(v); 228 | } 229 | 230 | //////////////////////////////////////////////////////////////////////////////////// 231 | 232 | // Dummy sin 233 | inline imcfloat sin(const imcfloat& v) 234 | { 235 | return (v); 236 | } 237 | inline imcdouble sin(const imcdouble& v) 238 | { 239 | return (v); 240 | } 241 | 242 | inline int sin(const int& v) 243 | { 244 | return (int)sin((double)v); 245 | } 246 | 247 | /// Generic Sine 248 | template 249 | inline T sin_op(const T& v) 250 | { 251 | return (T)sin(v); 252 | } 253 | 254 | //////////////////////////////////////////////////////////////////////////////////// 255 | 256 | // Dummy cos 257 | inline imcfloat cos(const imcfloat& v) 258 | { 259 | return (v); 260 | } 261 | inline imcdouble cos(const imcdouble& v) 262 | { 263 | return (v); 264 | } 265 | 266 | inline int cos(const int& v) 267 | { 268 | return (int)cos((double)v); 269 | } 270 | 271 | /// Generic Cosine 272 | template 273 | inline T cos_op(const T& v) 274 | { 275 | return (T)cos(v); 276 | } 277 | 278 | //////////////////////////////////////////////////////////////////////////////////// 279 | 280 | /// Sets a bit in an array 281 | inline void imDataBitSet(imbyte* data, int index, int bit) 282 | { 283 | if (bit) 284 | data[index / 8] |= (0x01 << (7 - (index % 8))); 285 | else 286 | data[index / 8] &= ~(0x01 << (7 - (index % 8))); 287 | } 288 | 289 | /// Gets a bit from an array 290 | inline int imDataBitGet(imbyte* data, int index) 291 | { 292 | return (data[index / 8] >> (7 - (index % 8))) & 0x01; 293 | } 294 | 295 | #endif 296 | -------------------------------------------------------------------------------- /im3/include/im_old.h: -------------------------------------------------------------------------------- 1 | /** \file 2 | * \brief Old API 3 | * 4 | * See Copyright Notice in im_lib.h 5 | */ 6 | 7 | #ifndef __IM_OLD_H 8 | #define __IM_OLD_H 9 | 10 | #if defined(__cplusplus) 11 | extern "C" { 12 | #endif 13 | 14 | enum {IM_BMP, IM_PCX, IM_GIF, IM_TIF, IM_RAS, IM_SGI, IM_JPG, IM_LED, IM_TGA}; 15 | enum {IM_NONE = 0x0000, IM_DEFAULT = 0x0100, IM_COMPRESSED = 0x0200}; 16 | 17 | #define IM_ERR_READ IM_ERR_ACCESS 18 | #define IM_ERR_WRITE IM_ERR_ACCESS 19 | #define IM_ERR_TYPE IM_ERR_DATA 20 | #define IM_ERR_COMP IM_ERR_COMPRESS 21 | 22 | long imEncodeColor(unsigned char red, unsigned char green, unsigned char blue); 23 | void imDecodeColor(unsigned char* red, unsigned char* green, unsigned char* blue, long palette); 24 | int imFileFormat(char *filename, int* format); 25 | int imImageInfo(char *filename, int *width, int *height, int *type, int *palette_count); 26 | int imLoadRGB(char *filename, unsigned char *red, unsigned char *green, unsigned char *blue); 27 | int imSaveRGB(int width, int height, int format, unsigned char *red, unsigned char *green, unsigned char *blue, char *filename); 28 | int imLoadMap(char *filename, unsigned char *map, long *palette); 29 | int imSaveMap(int width, int height, int format, unsigned char *map, int palette_count, long *palette, char *filename); 30 | void imRGB2Map(int width, int height, unsigned char *red, unsigned char *green, unsigned char *blue, unsigned char *map, int palette_count, long *palette); 31 | void imMap2RGB(int width, int height, unsigned char *map, int palette_count, long *colors, unsigned char *red, unsigned char *green, unsigned char *blue); 32 | void imRGB2Gray(int width, int height, unsigned char *red, unsigned char *green, unsigned char *blue, unsigned char *map, long *grays); 33 | void imMap2Gray(int width, int height, unsigned char *map, int palette_count, long *colors, unsigned char *grey_map, long *grays); 34 | void imResize(int src_width, int src_height, unsigned char *src_map, int dst_width, int dst_height, unsigned char *dst_map); 35 | void imStretch(int src_width, int src_height, unsigned char *src_map, int dst_width, int dst_height, unsigned char *dst_map); 36 | typedef int (*imCallback)(char *filename); 37 | int imRegisterCallback(imCallback cb, int cb_id, int format); 38 | 39 | #define IM_INTERRUPTED -1 40 | #define IM_ALL -1 41 | #define IM_COUNTER_CB 0 42 | typedef int (*imFileCounterCallback)(char *filename, int percent, int io); 43 | 44 | #define IM_RESOLUTION_CB 1 45 | typedef int (*imResolutionCallback)(char *filename, double* xres, double* yres, int* res_unit); 46 | 47 | enum {IM_RES_NONE, IM_RES_DPI, IM_RES_DPC}; 48 | 49 | #define IM_GIF_TRANSPARENT_COLOR_CB 0 50 | typedef int (*imGifTranspIndex)(char *filename, unsigned char *transp_index); 51 | 52 | #define IM_TIF_IMAGE_DESCRIPTION_CB 0 53 | typedef int (*imTiffImageDesc)(char *filename, char* img_desc); 54 | 55 | #if defined(__cplusplus) 56 | } 57 | #endif 58 | 59 | #endif 60 | -------------------------------------------------------------------------------- /im3/include/im_palette.h: -------------------------------------------------------------------------------- 1 | /** \file 2 | * \brief Palette Generators 3 | * 4 | * See Copyright Notice in im_lib.h 5 | */ 6 | 7 | #ifndef __IM_PALETTE_H 8 | #define __IM_PALETTE_H 9 | 10 | #if defined(__cplusplus) 11 | extern "C" { 12 | #endif 13 | 14 | 15 | /** \defgroup palette Palette Generators 16 | * \par 17 | * Creates several standard palettes. The palette is just an array of encoded color values. 18 | * See also \ref colorutl. 19 | * \par 20 | * In Lua, to create a palette you can call im.PaletteCreate. 21 | * \verbatim im.PaletteCreate([count: number]) -> pal: imPalette [in Lua 5] \endverbatim 22 | * Default count is 256. 23 | * IMLua and CDLua palettes are 100% compatible. The IM palette metatable name is "imPalette". \n 24 | * When converted to a string will return "imPalete(%p)" where %p is replaced by the userdata address. 25 | * If the palette is already destroyed by im.PaletteDestroy, then it will return also the suffix "-destroyed". 26 | * \par 27 | * In Lua, to destroy a palette you can call im.PaletteDestroy. 28 | * If this function is not called, the palette is destroyed by the garbage collector. 29 | * \verbatim im.PaletteDestroy(pal: imPalette) [in Lua 5] \endverbatim 30 | * \par 31 | * In Lua, array access is enabled so you can do:. 32 | * \verbatim color = pal[index] \endverbatim 33 | * \verbatim pal[index] = color \endverbatim 34 | * \verbatim count = #pal \endverbatim 35 | * \par 36 | * See \ref im_palette.h 37 | * \ingroup util */ 38 | 39 | 40 | /** Allocates memory for the palette data. 41 | * This ensures allocation and release in the same module by the correct functions. 42 | * \ingroup palette */ 43 | long* imPaletteNew(int count); 44 | 45 | /** Releases memory for the palette data. 46 | * This ensures allocation and release in the same module by the correct functions. 47 | * \ingroup palette */ 48 | void imPaletteRelease(long* palette); 49 | 50 | /** Duplicate a palette data using imPaletteNew. 51 | * \ingroup palette */ 52 | long* imPaletteDuplicate(const long* palette, int count); 53 | 54 | 55 | /** Searches for the nearest color on the table and returns the color index if successful. 56 | * It looks in all palette entries and finds the minimum euclidian square distance. 57 | * If the color matches the given color it returns immediately. 58 | * See also \ref colorutl. 59 | * 60 | * \verbatim im.PaletteFindNearest(pal: imPalette, color: lightuserdata) -> index: number [in Lua 5] \endverbatim 61 | * \ingroup palette */ 62 | int imPaletteFindNearest(const long *palette, int palette_count, long color); 63 | 64 | /** Searches for the color on the table and returns the color index if successful. 65 | * If the tolerance is 0 search for the exact match in the palette else search for the 66 | * first color that fits in the tolerance range. 67 | * See also \ref colorutl. 68 | * 69 | * \verbatim im.PaletteFindColor(pal: imPalette, color: lightuserdata, tol: number) -> index: number [in Lua 5] \endverbatim 70 | * \ingroup palette */ 71 | int imPaletteFindColor(const long *palette, int palette_count, long color, unsigned char tol); 72 | 73 | /** Creates a palette of gray scale values. 74 | * The colors are arranged from black to white. 75 | * 76 | * \verbatim im.PaletteGray() -> pal: imPalette [in Lua 5] \endverbatim 77 | * \ingroup palette */ 78 | long* imPaletteGray(void); 79 | 80 | /** Creates a palette of a gradient of red colors. 81 | * The colors are arranged from black to pure red. 82 | * 83 | * \verbatim im.PaletteRed() -> pal: imPalette [in Lua 5] \endverbatim 84 | * \ingroup palette */ 85 | long* imPaletteRed(void); 86 | 87 | /** Creates a palette of a gradient of green colors. 88 | * The colors are arranged from black to pure green. 89 | * 90 | * \verbatim im.PaletteGreen() -> pal: imPalette [in Lua 5] \endverbatim 91 | * \ingroup palette */ 92 | long* imPaletteGreen(void); 93 | 94 | /** Creates a palette of a gradient of blue colors. 95 | * The colors are arranged from black to pure blue. 96 | * 97 | * \verbatim im.PaletteBlue() -> pal: imPalette [in Lua 5] \endverbatim 98 | * \ingroup palette */ 99 | long* imPaletteBlue(void); 100 | 101 | /** Creates a palette of a gradient of yellow colors. 102 | * The colors are arranged from black to pure yellow. 103 | * 104 | * \verbatim im.PaletteYellow() -> pal: imPalette [in Lua 5] \endverbatim 105 | * \ingroup palette */ 106 | long* imPaletteYellow(void); 107 | 108 | /** Creates a palette of a gradient of magenta colors. 109 | * The colors are arranged from black to pure magenta. 110 | * 111 | * \verbatim im.PaletteMagenta() -> pal: imPalette [in Lua 5] \endverbatim 112 | * \ingroup palette */ 113 | long* imPaletteMagenta(void); 114 | 115 | /** Creates a palette of a gradient of cyan colors. 116 | * The colors are arranged from black to pure cyan. 117 | * 118 | * \verbatim im.PaletteCyan() -> pal: imPalette [in Lua 5] \endverbatim 119 | * \ingroup palette */ 120 | long* imPaletteCyan(void); 121 | 122 | /** Creates a palette of rainbow colors. 123 | * The colors are arranged in the light wave length spectrum order (starting from purple). 124 | * 125 | * \verbatim im.PaletteRainbow() -> pal: imPalette [in Lua 5] \endverbatim 126 | * \ingroup palette */ 127 | long* imPaletteRainbow(void); 128 | 129 | /** Creates a palette of hues with maximum saturation. 130 | * 131 | * \verbatim im.PaletteHues() -> pal: imPalette [in Lua 5] \endverbatim 132 | * \ingroup palette */ 133 | long* imPaletteHues(void); 134 | 135 | /** Creates a palette of a gradient of blue colors. 136 | * The colors are arranged from pure blue to white. 137 | * 138 | * \verbatim im.PaletteBlueIce() -> pal: imPalette [in Lua 5] \endverbatim 139 | * \ingroup palette */ 140 | long* imPaletteBlueIce(void); 141 | 142 | /** Creates a palette of a gradient from black to white passing trough red and orange. 143 | * 144 | * \verbatim im.PaletteHotIron() -> pal: imPalette [in Lua 5] \endverbatim 145 | * \ingroup palette */ 146 | long* imPaletteHotIron(void); 147 | 148 | /** Creates a palette of a gradient from black to white passing trough red and yellow. 149 | * 150 | * \verbatim im.PaletteBlackBody() -> pal: imPalette [in Lua 5] \endverbatim 151 | * \ingroup palette */ 152 | long* imPaletteBlackBody(void); 153 | 154 | /** Creates a palette with high contrast colors. 155 | * 156 | * \verbatim im.PaletteHighContrast() -> pal: imPalette [in Lua 5] \endverbatim 157 | * \ingroup palette */ 158 | long* imPaletteHighContrast(void); 159 | 160 | /** Creates a palette of a sequence of colors from black to white 161 | * with 32 linear intensity values combined with 8 hue variations. 162 | * 163 | * \verbatim im.PaletteLinear() -> pal: imPalette [in Lua 5] \endverbatim 164 | * \ingroup palette */ 165 | long* imPaletteLinear(void); 166 | 167 | /** Creates a palette of an uniform sub-division of colors from black to white. 168 | * This is a 2^(2.6) bits per pixel palette. 169 | * 170 | * \verbatim im.PaletteUniform() -> pal: imPalette [in Lua 5] \endverbatim 171 | * \ingroup palette */ 172 | long* imPaletteUniform(void); 173 | 174 | /** Returns the index of the correspondent RGB color of an uniform palette. 175 | * 176 | * \verbatim im.PaletteUniformIndex(color: lightuserdata) -> index: number [in Lua 5] \endverbatim 177 | * \ingroup palette */ 178 | int imPaletteUniformIndex(long color); 179 | 180 | /** Returns the index of the correspondent RGB color of an uniform palette. 181 | * Uses an 8x8 ordered dither to lookup the index in a halftone matrix. 182 | * The spatial position used by the halftone method. 183 | * 184 | * \verbatim im.PaletteUniformIndexHalftoned(color: lightuserdata, x: number, y: number) -> index: number [in Lua 5] \endverbatim 185 | * \ingroup palette */ 186 | int imPaletteUniformIndexHalftoned(long color, int x, int y); 187 | 188 | 189 | #if defined(__cplusplus) 190 | } 191 | #endif 192 | 193 | #endif 194 | 195 | -------------------------------------------------------------------------------- /im3/include/im_process.h: -------------------------------------------------------------------------------- 1 | /** \file 2 | * \brief Image Processing 3 | * 4 | * See Copyright Notice in im_lib.h 5 | */ 6 | 7 | #ifndef __IM_PROCESS_H 8 | #define __IM_PROCESS_H 9 | 10 | #include "im_process_pnt.h" 11 | #include "im_process_loc.h" 12 | #include "im_process_glo.h" 13 | #include "im_process_ana.h" 14 | 15 | #if defined(__cplusplus) 16 | extern "C" { 17 | #endif 18 | 19 | 20 | /** \defgroup process Image Processing 21 | * \par 22 | * Several image processing functions based on the \ref imImage structure. 23 | * \par 24 | * You must link the application with "im_process.lib/.a/.so". 25 | * In Lua call require"imlua_process". \n 26 | * Some complex operations use the \ref counter.\n 27 | * There is no check on the input/output image properties, 28 | * check each function documentation before using it. 29 | * \par 30 | * To enable OpenMP support use the "im_process_omp.lib/.a/.so" libraries. 31 | * In Lua call require"imlua_process_omp". \n 32 | * Notice that multi-threading can be slower than single thread because of 33 | * the overhead introduced by the threads configuration. \n 34 | * When using the "im_process_omp" library you can reduce that overhead 35 | * by using the \ref imProcessOpenMPSetMinCount and \ref imProcessOpenMPSetNumThreads functions. 36 | * But notice that this is not the same thing as using the library without support for OpenMP. \n 37 | * \par 38 | * The parallelization in im_process involves only loops, usually for all the pixels in the image. 39 | * To accomplish that we had to first isolate the \ref counter code, so the counting could also be done 40 | * in parallel. Then we made sure that all loops contain only local variables 41 | * to avoid unnecessary shared variables that could lead to incorrect results. 42 | * In a few places we use the "atomic" directive to be able to compute histograms and other counts. 43 | * But min/max computation must be done in single thread 44 | * because of limitations in OpenMP support in C (in Fortran it would be easy to implement). 45 | * \par 46 | * For more information on OpenMP: \n 47 | * http://www.openmp.org 48 | */ 49 | 50 | 51 | #if defined(__cplusplus) 52 | } 53 | #endif 54 | 55 | #endif 56 | -------------------------------------------------------------------------------- /im3/include/im_raw.h: -------------------------------------------------------------------------------- 1 | /** \file 2 | * \brief RAW File Format 3 | * 4 | * See Copyright Notice in im_lib.h 5 | */ 6 | 7 | #ifndef __IM_RAW_H 8 | #define __IM_RAW_H 9 | 10 | #if defined(__cplusplus) 11 | extern "C" { 12 | #endif 13 | 14 | 15 | /** Opens a RAW image file. 16 | * See also \ref imErrorCodes. 17 | * 18 | * \verbatim im.FileOpenRaw(file_name: string) -> ifile: imFile, error: number [in Lua 5] \endverbatim 19 | * \ingroup raw */ 20 | imFile* imFileOpenRaw(const char* file_name, int *error); 21 | 22 | /** Creates a RAW image file. 23 | * See also \ref imErrorCodes. 24 | * 25 | * \verbatim im.FileNewRaw(file_name: string) -> ifile: imFile, error: number [in Lua 5] \endverbatim 26 | * \ingroup raw */ 27 | imFile* imFileNewRaw(const char* file_name, int *error); 28 | 29 | 30 | #if defined(__cplusplus) 31 | } 32 | #endif 33 | 34 | #endif 35 | -------------------------------------------------------------------------------- /im3/include/imlua.h: -------------------------------------------------------------------------------- 1 | /** \file 2 | * \brief IM Lua 5 Binding 3 | * 4 | * See Copyright Notice in im_lib.h 5 | */ 6 | 7 | #ifndef __IMLUA_H 8 | #define __IMLUA_H 9 | 10 | #ifdef __cplusplus 11 | extern "C" { 12 | #endif 13 | 14 | /** \defgroup imlua ImLua 5 Binding Reference 15 | * \par 16 | * Binding for the Lua 5 scripting language. \n 17 | * Lua 5.1 Copyright (C) 1994-2005 Lua.org, PUC-Rio \n 18 | * R. Ierusalimschy, L. H. de Figueiredo & W. Celes \n 19 | * http://www.lua.org 20 | * \par 21 | * See \ref imlua.h 22 | * \ingroup util */ 23 | 24 | #ifdef LUA_NOOBJECT /* Lua 3 */ 25 | void imlua_open(void); 26 | #endif 27 | 28 | #ifdef LUA_TNONE /* Lua 5 */ 29 | 30 | /** Initializes the Lua binding of the main IM library. \n 31 | * Returns 1 (leaves the im table on the top of the stack). 32 | * You must link the application with the "imlua51" library. 33 | * \ingroup imlua */ 34 | int imlua_open(lua_State *L); 35 | 36 | /** Calls \ref imFormatRemoveAll to release internal memory. 37 | * Also available in Lua as "im.Close()". 38 | * \ingroup imlua */ 39 | int imlua_close(lua_State *L); 40 | 41 | #ifdef __IM_IMAGE_H /* must include im_image.h before this */ 42 | /** Pushes an image as a metatable on the stack. 43 | * \ingroup imlua */ 44 | void imlua_pushimage(lua_State *L, imImage* image); 45 | 46 | /** Gets an image as a metatable from the stack, checks for correct type. 47 | * \ingroup imlua */ 48 | imImage* imlua_checkimage(lua_State *L, int param); 49 | #endif 50 | 51 | /** Initializes the Lua binding of the capture library. \n 52 | * Returns 1 (leaves the im table on the top of the stack). 53 | * You must link the application with the "imlua_capture51" library. 54 | * \ingroup imlua */ 55 | int imlua_open_capture(lua_State *L); 56 | 57 | /** Initializes the Lua binding of the process library. \n 58 | * Returns 1 (leaves the im table on the top of the stack). 59 | * You must link the application with the "imlua_process51" library. 60 | * \ingroup imlua */ 61 | int imlua_open_process(lua_State *L); 62 | 63 | /** Initializes the Lua binding of the fourier transform library. \n 64 | * Returns 1 (leaves the im table on the top of the stack). 65 | * You must link the application with the "imlua_fftw51" library. 66 | * \ingroup imlua */ 67 | int imlua_open_fftw(lua_State *L); 68 | 69 | 70 | #endif 71 | 72 | #ifdef __cplusplus 73 | } 74 | #endif 75 | 76 | #endif 77 | -------------------------------------------------------------------------------- /im3/zlib1.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chinenkai/php-iup/3e1a020992ee46d414d0627e6bd3de2724bf1724/im3/zlib1.lib -------------------------------------------------------------------------------- /iup.php: -------------------------------------------------------------------------------- 1 | "; 3 | 4 | if(!extension_loaded('iup')) { 5 | dl('php_iup.' . PHP_SHLIB_SUFFIX); 6 | } 7 | $module = 'iup'; 8 | $functions = get_extension_funcs($module); 9 | echo "Functions available in the test extension:$br\n"; 10 | foreach($functions as $func) { 11 | echo $func."$br\n"; 12 | } 13 | echo "$br\n"; 14 | $function = 'confirm_' . $module . '_compiled'; 15 | if (extension_loaded($module)) { 16 | $str = $function($module); 17 | } else { 18 | $str = "Module $module is not compiled into PHP"; 19 | } 20 | echo "$str\n"; 21 | ?> 22 | -------------------------------------------------------------------------------- /iup3/etc/iup.manifest: -------------------------------------------------------------------------------- 1 | 2 | 3 | 9 | Iup Application 10 | 11 | 12 | 20 | 21 | 22 | 23 | 24 | true 25 | 26 | 27 | 28 | 29 | 30 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | -------------------------------------------------------------------------------- /iup3/etc/iup.rc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chinenkai/php-iup/3e1a020992ee46d414d0627e6bd3de2724bf1724/iup3/etc/iup.rc -------------------------------------------------------------------------------- /iup3/etc/iup64.manifest: -------------------------------------------------------------------------------- 1 | 2 | 3 | 9 | Iup Application 10 | 11 | 12 | 20 | 21 | 22 | 23 | 24 | true 25 | 26 | 27 | 28 | 29 | 30 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | -------------------------------------------------------------------------------- /iup3/etc/iupemscripten_shell.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | IupEmscripten 7 | 46 | 47 | 48 |
emscripten
49 |
Downloading...
50 |
51 | 52 |
53 |
54 | 55 |
56 | 131 | {{{ SCRIPT }}} 132 | 133 | 134 | -------------------------------------------------------------------------------- /iup3/etc/iupstub.c: -------------------------------------------------------------------------------- 1 | /** 2 | * When using IUP as a DLL you must link with the "iupstub.lib" static library. 3 | * But if you are using a compiler that is different 4 | * from the one that built the "iupstub.lib" static library 5 | * it can occour linking problems, usually argc and argv not being found. 6 | * If that happen do not use the "iupstub.lib" static library 7 | * and use this file instead. 8 | * 9 | * See Copyright Notice in "iup.h" 10 | */ 11 | 12 | #include 13 | 14 | #include /* declaration of __argc and __argv */ 15 | 16 | extern int main(int, char **); 17 | 18 | /* WinMain is NOT called for Console applications */ 19 | int WINAPI WinMain (HINSTANCE hinst, HINSTANCE hprev, LPSTR cmdline, int ncmdshow) 20 | { 21 | (void)hinst; /* NOT used */ 22 | (void)hprev; 23 | (void)cmdline; 24 | (void)ncmdshow; 25 | 26 | /* this seems to work for all the compilers we tested, except Watcom compilers */ 27 | /* These are declared in , except for Cygwin. */ 28 | #ifdef __GNUC__ 29 | extern int __argc; 30 | extern char** __argv; 31 | #endif 32 | 33 | return main(__argc, __argv); 34 | } 35 | -------------------------------------------------------------------------------- /iup3/etc/pen.cur: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chinenkai/php-iup/3e1a020992ee46d414d0627e6bd3de2724bf1724/iup3/etc/pen.cur -------------------------------------------------------------------------------- /iup3/etc/tecgraf.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chinenkai/php-iup/3e1a020992ee46d414d0627e6bd3de2724bf1724/iup3/etc/tecgraf.ico -------------------------------------------------------------------------------- /iup3/freetype6.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chinenkai/php-iup/3e1a020992ee46d414d0627e6bd3de2724bf1724/iup3/freetype6.lib -------------------------------------------------------------------------------- /iup3/ftgl.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chinenkai/php-iup/3e1a020992ee46d414d0627e6bd3de2724bf1724/iup3/ftgl.lib -------------------------------------------------------------------------------- /iup3/include/iup_config.h: -------------------------------------------------------------------------------- 1 | /** \file 2 | * \brief Configuration file Utilities 3 | * 4 | * See Copyright Notice in "iup.h" 5 | */ 6 | 7 | #ifndef IUP_CONFIG_H 8 | #define IUP_CONFIG_H 9 | 10 | #if defined(__cplusplus) 11 | extern "C" { 12 | #endif 13 | 14 | 15 | IUP_API Ihandle* IupConfig(void); 16 | 17 | IUP_API int IupConfigLoad(Ihandle* ih); 18 | IUP_API int IupConfigSave(Ihandle* ih); 19 | 20 | /****************************************************************/ 21 | 22 | IUP_API void IupConfigSetVariableStr(Ihandle* ih, const char* group, const char* key, const char* value); 23 | IUP_API void IupConfigSetVariableStrId(Ihandle* ih, const char* group, const char* key, int id, const char* value); 24 | IUP_API void IupConfigSetVariableInt(Ihandle* ih, const char* group, const char* key, int value); 25 | IUP_API void IupConfigSetVariableIntId(Ihandle* ih, const char* group, const char* key, int id, int value); 26 | IUP_API void IupConfigSetVariableDouble(Ihandle* ih, const char* group, const char* key, double value); 27 | IUP_API void IupConfigSetVariableDoubleId(Ihandle* ih, const char* group, const char* key, int id, double value); 28 | 29 | IUP_API const char* IupConfigGetVariableStr(Ihandle* ih, const char* group, const char* key); 30 | IUP_API const char* IupConfigGetVariableStrId(Ihandle* ih, const char* group, const char* key, int id); 31 | IUP_API int IupConfigGetVariableInt(Ihandle* ih, const char* group, const char* key); 32 | IUP_API int IupConfigGetVariableIntId(Ihandle* ih, const char* group, const char* key, int id); 33 | IUP_API double IupConfigGetVariableDouble(Ihandle* ih, const char* group, const char* key); 34 | IUP_API double IupConfigGetVariableDoubleId(Ihandle* ih, const char* group, const char* key, int id); 35 | 36 | IUP_API const char* IupConfigGetVariableStrDef(Ihandle* ih, const char* group, const char* key, const char* def); 37 | IUP_API const char* IupConfigGetVariableStrIdDef(Ihandle* ih, const char* group, const char* key, int id, const char* def); 38 | IUP_API int IupConfigGetVariableIntDef(Ihandle* ih, const char* group, const char* key, int def); 39 | IUP_API int IupConfigGetVariableIntIdDef(Ihandle* ih, const char* group, const char* key, int id, int def); 40 | IUP_API double IupConfigGetVariableDoubleDef(Ihandle* ih, const char* group, const char* key, double def); 41 | IUP_API double IupConfigGetVariableDoubleIdDef(Ihandle* ih, const char* group, const char* key, int id, double def); 42 | 43 | IUP_API void IupConfigCopy(Ihandle* ih1, Ihandle* ih2, const char* exclude_prefix); 44 | 45 | /****************************************************************/ 46 | 47 | IUP_API void IupConfigSetListVariable(Ihandle* ih, const char *group, const char* key, const char* value, int add); 48 | 49 | IUP_API void IupConfigRecentInit(Ihandle* ih, Ihandle* menu, Icallback recent_cb, int max_recent); 50 | IUP_API void IupConfigRecentUpdate(Ihandle* ih, const char* filename); 51 | 52 | IUP_API void IupConfigDialogShow(Ihandle* ih, Ihandle* dialog, const char* name); 53 | IUP_API void IupConfigDialogClosed(Ihandle* ih, Ihandle* dialog, const char* name); 54 | 55 | 56 | #if defined(__cplusplus) 57 | } 58 | #endif 59 | 60 | #endif 61 | -------------------------------------------------------------------------------- /iup3/include/iup_export.h: -------------------------------------------------------------------------------- 1 | #ifndef __IUP_EXPORT_H 2 | #define __IUP_EXPORT_H 3 | 4 | #ifndef DOXYGEN_SHOULD_IGNORE_THIS 5 | /** @cond DOXYGEN_SHOULD_IGNORE_THIS */ 6 | 7 | /* Mark the official functions */ 8 | #ifndef IUP_API 9 | #ifdef IUP_BUILD_LIBRARY 10 | #ifdef __EMSCRIPTEN__ 11 | #include 12 | #define IUP_API EMSCRIPTEN_KEEPALIVE 13 | #elif WIN32 14 | #define IUP_API __declspec(dllexport) 15 | #elif defined(__GNUC__) && __GNUC__ >= 4 16 | #define IUP_API __attribute__ ((visibility("default"))) 17 | #else 18 | #define IUP_API 19 | #endif 20 | #else 21 | #define IUP_API 22 | #endif /* IUP_BUILD_LIBRARY */ 23 | #endif /* IUP_API */ 24 | 25 | /* Mark the internal SDK functions (some not official but need to be exported) */ 26 | #ifndef IUP_SDK_API 27 | #ifdef IUP_BUILD_LIBRARY 28 | #ifdef __EMSCRIPTEN__ 29 | #include 30 | #define IUP_SDK_API EMSCRIPTEN_KEEPALIVE 31 | #elif WIN32 32 | #define IUP_SDK_API __declspec(dllexport) 33 | #elif defined(__GNUC__) && __GNUC__ >= 4 34 | #define IUP_SDK_API __attribute__ ((visibility("default"))) 35 | #else 36 | #define IUP_SDK_API 37 | #endif 38 | #else 39 | #define IUP_SDK_API 40 | #endif /* IUP_BUILD_LIBRARY */ 41 | #endif /* IUP_SDK_API */ 42 | 43 | /* Mark the driver functions that need to be exported */ 44 | #ifndef IUP_DRV_API 45 | #ifdef IUP_BUILD_LIBRARY 46 | #ifdef __EMSCRIPTEN__ 47 | #include 48 | #define IUP_DRV_API EMSCRIPTEN_KEEPALIVE 49 | #elif WIN32 50 | #define IUP_DRV_API __declspec(dllexport) 51 | #elif defined(__GNUC__) && __GNUC__ >= 4 52 | #define IUP_DRV_API __attribute__ ((visibility("default"))) 53 | #else 54 | #define IUP_DRV_API 55 | #endif 56 | #else 57 | #define IUP_DRV_API 58 | #endif /* IUP_BUILD_LIBRARY */ 59 | #endif /* IUP_DRV_API */ 60 | 61 | /* Mark the IupImageLib function, it does not have a header of its own */ 62 | #ifndef IUPIMGLIB_API 63 | #ifdef IUPIMGLIB_BUILD_LIBRARY 64 | #ifdef __EMSCRIPTEN__ 65 | #include 66 | #define IUPIMGLIB_API EMSCRIPTEN_KEEPALIVE 67 | #elif WIN32 68 | #define IUPIMGLIB_API __declspec(dllexport) 69 | #elif defined(__GNUC__) && __GNUC__ >= 4 70 | #define IUPIMGLIB_API __attribute__ ((visibility("default"))) 71 | #else 72 | #define IUPIMGLIB_API 73 | #endif 74 | #else 75 | #define IUPIMGLIB_API 76 | #endif /* IUPIMGLIB_BUILD_LIBRARY */ 77 | #endif /* IUPIMGLIB_API */ 78 | 79 | /** @endcond DOXYGEN_SHOULD_IGNORE_THIS */ 80 | #endif /* DOXYGEN_SHOULD_IGNORE_THIS */ 81 | 82 | 83 | #endif /* __IUP_EXPORT_H */ 84 | -------------------------------------------------------------------------------- /iup3/include/iup_mglplot.h: -------------------------------------------------------------------------------- 1 | /** \file 2 | * \brief Plot component for Iup. 3 | * 4 | * See Copyright Notice in "iup.h" 5 | */ 6 | 7 | #ifndef __IUP_MGLPLOT_H 8 | #define __IUP_MGLPLOT_H 9 | 10 | #ifdef __cplusplus 11 | extern "C" { 12 | #endif 13 | 14 | /* Initialize IupMglPlot widget class */ 15 | void IupMglPlotOpen(void); 16 | 17 | /* Create an IupMglPlot widget instance */ 18 | Ihandle* IupMglPlot(void); 19 | 20 | /***********************************************/ 21 | /* Additional API */ 22 | 23 | /* Linear Data Only */ 24 | void IupMglPlotBegin(Ihandle *ih, int dim); 25 | void IupMglPlotAdd1D(Ihandle *ih, const char* name, double y); 26 | void IupMglPlotAdd2D(Ihandle *ih, double x, double y); 27 | void IupMglPlotAdd3D(Ihandle *ih, double x, double y, double z); 28 | int IupMglPlotEnd(Ihandle *ih); 29 | 30 | /* Linear (dim=1,2,3), Planar (dim=1), Volumetric (dim=1) */ 31 | int IupMglPlotNewDataSet(Ihandle *ih, int dim); 32 | 33 | /* Linear Data Only */ 34 | void IupMglPlotInsert1D(Ihandle* ih, int ds_index, int sample_index, const char** names, const double* y, int count); 35 | void IupMglPlotInsert2D(Ihandle* ih, int ds_index, int sample_index, const double* x, const double* y, int count); 36 | void IupMglPlotInsert3D(Ihandle* ih, int ds_index, int sample_index, const double* x, const double* y, const double* z, int count); 37 | 38 | /* Linear Data Only */ 39 | void IupMglPlotSet1D(Ihandle* ih, int ds_index, const char** names, const double* y, int count); 40 | void IupMglPlotSet2D(Ihandle* ih, int ds_index, const double* x, const double* y, int count); 41 | void IupMglPlotSet3D(Ihandle* ih, int ds_index, const double* x, const double* y, const double* z, int count); 42 | void IupMglPlotSetFormula(Ihandle* ih, int ds_index, const char* formulaX, const char* formulaY, const char* formulaZ, int count); 43 | 44 | /* Linear (dim=1), Planar (dim=1), Volumetric (dim=1) */ 45 | void IupMglPlotSetData(Ihandle* ih, int ds_index, const double* data, int count_x, int count_y, int count_z); 46 | void IupMglPlotLoadData(Ihandle* ih, int ds_index, const char* filename, int count_x, int count_y, int count_z); 47 | void IupMglPlotSetFromFormula(Ihandle* ih, int ds_index, const char* formula, int count_x, int count_y, int count_z); 48 | 49 | /* Only inside callbacks */ 50 | void IupMglPlotTransform(Ihandle* ih, double x, double y, double z, int *ix, int *iy); 51 | void IupMglPlotTransformTo(Ihandle* ih, int ix, int iy, double *x, double *y, double *z); 52 | 53 | /* Only inside callbacks */ 54 | void IupMglPlotDrawMark(Ihandle* ih, double x, double y, double z); 55 | void IupMglPlotDrawLine(Ihandle* ih, double x1, double y1, double z1, double x2, double y2, double z2); 56 | void IupMglPlotDrawText(Ihandle* ih, const char* text, double x, double y, double z); 57 | 58 | void IupMglPlotPaintTo(Ihandle *ih, const char* format, int w, int h, double dpi, void *data); 59 | 60 | /***********************************************/ 61 | 62 | /* Utility label for showing TeX labels */ 63 | Ihandle* IupMglLabel(const char* title); 64 | 65 | 66 | #ifdef __cplusplus 67 | } 68 | #endif 69 | 70 | #endif 71 | -------------------------------------------------------------------------------- /iup3/include/iup_plot.h: -------------------------------------------------------------------------------- 1 | /** \file 2 | * \brief Plot component for Iup. 3 | * 4 | * See Copyright Notice in "iup.h" 5 | */ 6 | 7 | #ifndef __IUP_PLOT_H 8 | #define __IUP_PLOT_H 9 | 10 | #ifdef __cplusplus 11 | extern "C" { 12 | #endif 13 | 14 | /* Initialize IupPlot widget class */ 15 | void IupPlotOpen(void); 16 | 17 | /* Create an IupPlot widget instance */ 18 | Ihandle* IupPlot(void); 19 | 20 | /***********************************************/ 21 | /* Additional API */ 22 | 23 | void IupPlotBegin(Ihandle *ih, int strXdata); 24 | void IupPlotAdd(Ihandle *ih, double x, double y); 25 | void IupPlotAddStr(Ihandle *ih, const char* x, double y); 26 | void IupPlotAddSegment(Ihandle *ih, double x, double y); 27 | int IupPlotEnd(Ihandle *ih); 28 | 29 | int IupPlotLoadData(Ihandle* ih, const char* filename, int strXdata); 30 | 31 | /* available only when linking with "iupluaplot" */ 32 | int IupPlotSetFormula(Ihandle* ih, int sample_count, const char* formula, const char* init); 33 | 34 | void IupPlotInsert(Ihandle *ih, int ds_index, int sample_index, double x, double y); 35 | void IupPlotInsertStr(Ihandle *ih, int ds_index, int sample_index, const char* x, double y); 36 | void IupPlotInsertSegment(Ihandle *ih, int ds_index, int sample_index, double x, double y); 37 | 38 | void IupPlotInsertStrSamples(Ihandle* ih, int ds_index, int sample_index, const char** x, double* y, int count); 39 | void IupPlotInsertSamples(Ihandle* ih, int ds_index, int sample_index, double *x, double *y, int count); 40 | 41 | void IupPlotAddSamples(Ihandle* ih, int ds_index, double *x, double *y, int count); 42 | void IupPlotAddStrSamples(Ihandle* ih, int ds_index, const char** x, double* y, int count); 43 | 44 | void IupPlotGetSample(Ihandle* ih, int ds_index, int sample_index, double *x, double *y); 45 | void IupPlotGetSampleStr(Ihandle* ih, int ds_index, int sample_index, const char* *x, double *y); 46 | int IupPlotGetSampleSelection(Ihandle* ih, int ds_index, int sample_index); 47 | double IupPlotGetSampleExtra(Ihandle* ih, int ds_index, int sample_index); 48 | void IupPlotSetSample(Ihandle* ih, int ds_index, int sample_index, double x, double y); 49 | void IupPlotSetSampleStr(Ihandle* ih, int ds_index, int sample_index, const char* x, double y); 50 | void IupPlotSetSampleSelection(Ihandle* ih, int ds_index, int sample_index, int selected); 51 | void IupPlotSetSampleExtra(Ihandle* ih, int ds_index, int sample_index, double extra); 52 | 53 | void IupPlotTransform(Ihandle* ih, double x, double y, double *cnv_x, double *cnv_y); 54 | void IupPlotTransformTo(Ihandle* ih, double cnv_x, double cnv_y, double *x, double *y); 55 | 56 | int IupPlotFindSample(Ihandle* ih, double cnv_x, double cnv_y, int *ds_index, int *sample_index); 57 | int IupPlotFindSegment(Ihandle* ih, double cnv_x, double cnv_y, int *ds_index, int *sample_index1, int *sample_index2); 58 | 59 | struct _cdCanvas; 60 | 61 | void IupPlotPaintTo(Ihandle *ih, struct _cdCanvas* cnv); 62 | 63 | /***********************************************/ 64 | 65 | 66 | #ifdef __cplusplus 67 | } 68 | #endif 69 | 70 | #endif 71 | -------------------------------------------------------------------------------- /iup3/include/iup_scintilla.h: -------------------------------------------------------------------------------- 1 | /** \file 2 | * \brief Scintilla control. 3 | * 4 | * See Copyright Notice in "iup.h" 5 | */ 6 | 7 | #ifndef __IUP_SCINTILLA_H 8 | #define __IUP_SCINTILLA_H 9 | 10 | #ifdef __cplusplus 11 | extern "C" { 12 | #endif 13 | 14 | 15 | void IupScintillaOpen(void); 16 | 17 | Ihandle *IupScintilla(void); 18 | Ihandle *IupScintillaDlg(void); 19 | 20 | #ifdef SCINTILLA_H 21 | sptr_t IupScintillaSendMessage(Ihandle* ih, unsigned int iMessage, uptr_t wParam, sptr_t lParam); 22 | #endif 23 | 24 | 25 | #ifdef __cplusplus 26 | } 27 | #endif 28 | 29 | #endif 30 | -------------------------------------------------------------------------------- /iup3/include/iup_varg.h: -------------------------------------------------------------------------------- 1 | /** \file 2 | * \brief IUP API with explicit variable argument parameters. 3 | * 4 | * See Copyright Notice in "iup.h" 5 | */ 6 | 7 | #ifndef __IUP_VARG_H 8 | #define __IUP_VARG_H 9 | 10 | #include 11 | #include "iup.h" 12 | 13 | #ifdef __cplusplus 14 | extern "C" { 15 | #endif 16 | 17 | IUP_API void IupLogV(const char* type, const char* format, va_list arglist); 18 | 19 | IUP_API Ihandle* IupSetAttV(const char* handle_name, Ihandle* ih, const char* name, va_list arglist); 20 | 21 | IUP_API void IupSetStrfV(Ihandle* ih, const char* name, const char* format, va_list arglist); 22 | IUP_API void IupSetStrfIdV(Ihandle* ih, const char* name, int id, const char* format, va_list arglist); 23 | IUP_API void IupSetStrfId2V(Ihandle* ih, const char* name, int lin, int col, const char* format, va_list arglist); 24 | 25 | IUP_API Ihandle* IupSetCallbacksV(Ihandle* ih, const char *name, Icallback func, va_list arglist); 26 | 27 | IUP_API Ihandle* IupCreateV(const char *classname, void* first, va_list arglist); 28 | IUP_API Ihandle* IupVboxV(Ihandle* child, va_list arglist); 29 | IUP_API Ihandle* IupZboxV(Ihandle* child, va_list arglist); 30 | IUP_API Ihandle* IupHboxV(Ihandle* child,va_list arglist); 31 | IUP_API Ihandle* IupNormalizerV(Ihandle* ih_first, va_list arglist); 32 | IUP_API Ihandle* IupCboxV(Ihandle* child, va_list arglist); 33 | IUP_API Ihandle* IupGridBoxV(Ihandle* child, va_list arglist); 34 | IUP_API Ihandle* IupMultiBoxV(Ihandle* child, va_list arglist); 35 | IUP_API Ihandle* IupMenuV(Ihandle* child,va_list arglist); 36 | IUP_API Ihandle* IupTabsV(Ihandle* child, va_list arglist); 37 | IUP_API Ihandle* IupFlatTabsV(Ihandle* child, va_list arglist); 38 | 39 | IUP_API void IupMessageV(const char *title, const char *format, va_list arglist); 40 | IUP_API Ihandle* IupParamBoxV(Ihandle* param, va_list arglist); 41 | IUP_API int IupGetParamV(const char* title, Iparamcb action, void* user_data, const char* format, va_list arglist); 42 | 43 | /* must include iupglcontrols before this file to enable this declaration */ 44 | #ifdef __IUPGLCONTROLS_H 45 | #ifndef IUP_GLCONTROLS_API 46 | #define IUP_GLCONTROLS_API 47 | #endif 48 | IUP_GLCONTROLS_API Ihandle* IupGLCanvasBoxV(Ihandle* child, va_list arglist); 49 | #endif 50 | 51 | 52 | #endif 53 | -------------------------------------------------------------------------------- /iup3/include/iupcbs.h: -------------------------------------------------------------------------------- 1 | /** \file 2 | * \brief Contains all function pointer typedefs. 3 | * 4 | * See Copyright Notice in "iup.h" 5 | */ 6 | 7 | #ifndef __IUPCBS_H 8 | #define __IUPCBS_H 9 | 10 | struct _cdCanvas; 11 | 12 | typedef int (*IFidle)(void); /* idle */ 13 | typedef void (*IFentry)(void); /* entry */ 14 | 15 | typedef void (*IFi)(int); /* globalentermodal_cb, globalleavemodal_cb, */ 16 | typedef void (*IFs)(char*); /* openurl_cb */ 17 | typedef void (*IFii)(int, int); /* globalkeypress_cb */ 18 | typedef void (*IFiis)(int, int, char*); /* globalmotion_cb, openfiles_cb */ 19 | typedef void (*IFiiiis)(int, int, int, int, char*); /* globalbutton_cb */ 20 | typedef void (*IFfiis)(float,int,int,char*); /* globalwheel_cb */ 21 | typedef void (*IFvs)(void*, char*); /* handleadd_cb, handleremove_cb, imagecreate_cb, imagedestroy_cb */ 22 | 23 | typedef int (*IFn)(Ihandle*); /* default definition, same as Icallback */ 24 | typedef int (*IFni)(Ihandle*, int); /* k_any, show_cb, toggle_action, spin_cb, branchopen_cb, branchclose_cb, executeleaf_cb, showrename_cb, rightclick_cb, extended_cb, height_cb, width_cb */ 25 | typedef int (*IFnii)(Ihandle*, int, int); /* resize_cb, caret_cb, matrix_mousemove_cb, enteritem_cb, leaveitem_cb, scrolltop_cb, dropcheck_cb, selection_cb, select_cb, switch_cb, scrolling_cb, vspan_cb, hspan_cb */ 26 | typedef int (*IFniii)(Ihandle*, int, int, int); /* trayclick_cb, edition_cb */ 27 | typedef int (*IFniiii)(Ihandle*, int, int, int, int); /* dragdrop_cb */ 28 | typedef int (*IFniiiiiiC)(Ihandle*, int, int, int, int, int, int, struct _cdCanvas*); /* draw_cb */ 29 | typedef int (*IFniiiiii)(Ihandle*, int, int, int, int, int, int); /* OLD draw_cb */ 30 | typedef int (*IFnsidv)(Ihandle*, char*, int, double, void*); /* postmessage_cb */ 31 | 32 | typedef int (*IFnff)(Ihandle*, float, float); /* canvas_action */ 33 | typedef int (*IFniff)(Ihandle*,int,float,float); /* scroll_cb */ 34 | typedef int (*IFnfiis)(Ihandle*,float,int,int,char*); /* wheel_cb */ 35 | 36 | typedef int (*IFnsVi)(Ihandle*, char*, void*, int); /* dragdata_cb */ 37 | typedef int (*IFnsViii)(Ihandle*, char*, void*, int, int, int); /* dropdata_cb */ 38 | typedef int (*IFnsiii)(Ihandle*, char*, int, int, int); /* dropfiles_cb */ 39 | typedef int (*IFnssi)(Ihandle*, char*, char*, int); /* dragfilecreatename_cb */ 40 | 41 | typedef int (*IFnnii)(Ihandle*, Ihandle*, int, int); /* drop_cb */ 42 | typedef int (*IFnn)(Ihandle*, Ihandle*); /* savemarkers_cb, restoremarkers_cb */ 43 | typedef int (*IFnnn)(Ihandle*, Ihandle*, Ihandle*); /* tabchange_cb */ 44 | typedef int (*IFnss)(Ihandle*, char *, char *); /* file_cb */ 45 | typedef int (*IFns)(Ihandle*, char *); /* multiselect_cb */ 46 | typedef int (*IFnsi)(Ihandle*, char *, int); /* copydata_cb */ 47 | typedef int (*IFnis)(Ihandle*, int, char *); /* text_action, multiline_action, edit_cb, rename_cb */ 48 | typedef int (*IFnsii)(Ihandle*, char*, int, int); /* list_action */ 49 | typedef int (*IFniis)(Ihandle*, int, int, char*); /* motion_cb, click_cb, value_edit_cb */ 50 | typedef int (*IFniiis)(Ihandle*, int, int, int, char*); /* touch_cb, dblclick_cb */ 51 | typedef int (*IFniiiis)(Ihandle*, int, int, int, int, char*); /* button_cb, matrix_action, mousemotion_cb */ 52 | typedef int (*IFniiiiiis)(Ihandle*, int, int, int, int, int, int, char*); /* mouseclick_cb */ 53 | 54 | typedef int (*IFnIi)(Ihandle*, int*, int); /* multiselection_cb, multiunselection_cb */ 55 | typedef int (*IFnd)(Ihandle*, double); /* mousemove_cb, button_press_cb, button_release_cb */ 56 | typedef int (*IFniiIII)(Ihandle*, int, int, int*, int*, int*); /* fgcolor_cb, bgcolor_cb */ 57 | typedef int (*IFniinsii)(Ihandle*, int, int, Ihandle*, char*, int, int); /* dropselect_cb */ 58 | typedef int (*IFnccc)(Ihandle*, unsigned char, unsigned char, unsigned char); /* drag_cb, change_cb */ 59 | typedef int (*IFniIIII)(Ihandle*, int, int*, int*, int*, int*); /* multitouch_cb */ 60 | 61 | typedef int (*IFnC)(Ihandle*, struct _cdCanvas*); /* postdraw_cb, predraw_cb */ 62 | typedef int (*IFniidd)(Ihandle*, int, int, double, double); /* delete_cb */ 63 | typedef int (*IFniiddi)(Ihandle*, int, int, double, double, int); /* select_cb */ 64 | typedef int (*IFniiddiddi)(Ihandle*, int, int, double, double, int, double, double, int); /* clicksegment_cb */ 65 | typedef int (*IFniidds)(Ihandle*, int, int, double, double, char*); /* plotbutton_cb */ 66 | typedef int (*IFndds)(Ihandle*, double, double, char*); /* plotmotion_cb */ 67 | typedef int (*IFnssds)(Ihandle*, char*, char*, double, char*); /* plottickformat_cb */ 68 | typedef int (*IFnni)(Ihandle*, Ihandle*, int); 69 | 70 | typedef char* (*sIFnii)(Ihandle*, int, int); /* value_cb, font_cb */ 71 | typedef char* (*sIFni)(Ihandle*, int); /* cell_cb */ 72 | typedef char* (*sIFniis)(Ihandle*, int, int, char*); /* translatevalue_cb */ 73 | 74 | typedef double (*dIFnii)(Ihandle*, int, int); /* numericgetvalue_cb */ 75 | typedef int (*IFniid)(Ihandle*, int, int, double); /* numericsetvalue_cb */ 76 | 77 | typedef void (*IFniiv)(Ihandle*, int, int, void*); /* android_onactivityresult_cb */ 78 | 79 | #endif 80 | -------------------------------------------------------------------------------- /iup3/include/iupcontrols.h: -------------------------------------------------------------------------------- 1 | /** \file 2 | * \brief initializes dial, gauge, colorbrowser, colorbar controls. 3 | * 4 | * See Copyright Notice in "iup.h" 5 | */ 6 | 7 | #ifndef __IUPCONTROLS_H 8 | #define __IUPCONTROLS_H 9 | 10 | #ifdef __cplusplus 11 | extern "C" { 12 | #endif 13 | 14 | 15 | int IupControlsOpen(void); 16 | 17 | Ihandle* IupCells(void); 18 | Ihandle* IupMatrix(const char *action); 19 | Ihandle* IupMatrixList(void); 20 | Ihandle* IupMatrixEx(void); 21 | 22 | /* available only when linking with "iupluamatrix" */ 23 | void IupMatrixSetFormula(Ihandle* ih, int col, const char* formula, const char* init); 24 | void IupMatrixSetDynamic(Ihandle* ih, const char* init); 25 | 26 | 27 | #ifdef __cplusplus 28 | } 29 | #endif 30 | 31 | #endif 32 | -------------------------------------------------------------------------------- /iup3/include/iupdraw.h: -------------------------------------------------------------------------------- 1 | /** \file 2 | * \brief Canvas Draw API 3 | * 4 | * See Copyright Notice in "iup.h" 5 | */ 6 | 7 | #ifndef __IUPDRAW_H 8 | #define __IUPDRAW_H 9 | 10 | #ifdef __cplusplus 11 | extern "C" { 12 | #endif 13 | 14 | /* all functions can be used only in IUP canvas and inside the ACTION callback */ 15 | 16 | IUP_API void IupDrawBegin(Ihandle* ih); 17 | IUP_API void IupDrawEnd(Ihandle* ih); 18 | 19 | /* all functions can be called only between calls to Begin and End */ 20 | 21 | IUP_API void IupDrawSetClipRect(Ihandle* ih, int x1, int y1, int x2, int y2); 22 | IUP_API void IupDrawGetClipRect(Ihandle* ih, int *x1, int *y1, int *x2, int *y2); 23 | IUP_API void IupDrawResetClip(Ihandle* ih); 24 | 25 | /* color controlled by the attribute DRAWCOLOR */ 26 | /* line style or fill controlled by the attribute DRAWSTYLE */ 27 | 28 | IUP_API void IupDrawParentBackground(Ihandle* ih); 29 | IUP_API void IupDrawLine(Ihandle* ih, int x1, int y1, int x2, int y2); 30 | IUP_API void IupDrawRectangle(Ihandle* ih, int x1, int y1, int x2, int y2); 31 | IUP_API void IupDrawArc(Ihandle* ih, int x1, int y1, int x2, int y2, double a1, double a2); 32 | IUP_API void IupDrawPolygon(Ihandle* ih, int* points, int count); 33 | IUP_API void IupDrawText(Ihandle* ih, const char* text, int len, int x, int y, int w, int h); 34 | IUP_API void IupDrawImage(Ihandle* ih, const char* name, int x, int y, int w, int h); 35 | IUP_API void IupDrawSelectRect(Ihandle* ih, int x1, int y1, int x2, int y2); 36 | IUP_API void IupDrawFocusRect(Ihandle* ih, int x1, int y1, int x2, int y2); 37 | 38 | IUP_API void IupDrawGetSize(Ihandle* ih, int *w, int *h); 39 | IUP_API void IupDrawGetTextSize(Ihandle* ih, const char* text, int len, int *w, int *h); 40 | IUP_API void IupDrawGetImageInfo(const char* name, int *w, int *h, int *bpp); 41 | 42 | 43 | #ifdef __cplusplus 44 | } 45 | #endif 46 | 47 | #endif 48 | -------------------------------------------------------------------------------- /iup3/include/iupdraw_cd.h: -------------------------------------------------------------------------------- 1 | /** \file 2 | * \brief IupDraw CD driver 3 | * 4 | * See Copyright Notice in iup.h 5 | */ 6 | 7 | #ifndef __CD_IUPDRAW_H 8 | #define __CD_IUPDRAW_H 9 | 10 | #ifdef __cplusplus 11 | extern "C" { 12 | #endif 13 | 14 | cdContext* cdContextIupDraw(void); 15 | #define CD_IUPDRAW cdContextIupDraw() 16 | 17 | #ifdef __cplusplus 18 | } 19 | #endif 20 | 21 | #endif /* ifndef __CD_IUPDRAW_ */ 22 | -------------------------------------------------------------------------------- /iup3/include/iupfiledlg.h: -------------------------------------------------------------------------------- 1 | /** \file 2 | * \brief New FileDlg (Windows Only). 3 | * 4 | * See Copyright Notice in "iup.h" 5 | */ 6 | 7 | #ifndef __IUPFILEDLG_H 8 | #define __IUPFILEDLG_H 9 | 10 | #ifdef __cplusplus 11 | extern "C" { 12 | #endif 13 | 14 | /* the only exported function, 15 | once called it will replace regular IupFileDlg */ 16 | 17 | int IupNewFileDlgOpen(void); 18 | 19 | 20 | #ifdef __cplusplus 21 | } 22 | #endif 23 | 24 | #endif 25 | -------------------------------------------------------------------------------- /iup3/include/iupgl.h: -------------------------------------------------------------------------------- 1 | /** \file 2 | * \brief OpenGL canvas for Iup. 3 | * 4 | * See Copyright Notice in "iup.h" 5 | */ 6 | 7 | #ifndef __IUPGL_H 8 | #define __IUPGL_H 9 | 10 | #ifdef __cplusplus 11 | extern "C" { 12 | #endif 13 | 14 | /* Attributes 15 | ** To set the appropriate visual (pixel format) the following 16 | ** attributes may be specified. Their values should be set 17 | ** before the canvas is mapped to the scrren. 18 | ** After mapping, changing their values has no effect. 19 | */ 20 | #ifndef IUP_BUFFER /* IUP_SINGLE (defaut) or IUP_DOUBLE */ 21 | #define IUP_BUFFER "BUFFER" 22 | #endif 23 | #ifndef IUP_STEREO /* IUP_NO (defaut) or IUP_YES */ 24 | #define IUP_STEREO "STEREO" 25 | #endif 26 | #ifndef IUP_BUFFER_SIZE /* Number of bits if index mode */ 27 | #define IUP_BUFFER_SIZE "BUFFER_SIZE" 28 | #endif 29 | #ifndef IUP_RED_SIZE /* Number of red bits */ 30 | #define IUP_RED_SIZE "RED_SIZE" 31 | #endif 32 | #ifndef IUP_GREEN_SIZE /* Number of green bits */ 33 | #define IUP_GREEN_SIZE "GREEN_SIZE" 34 | #endif 35 | #ifndef IUP_BLUE_SIZE /* Number of blue bits */ 36 | #define IUP_BLUE_SIZE "BLUE_SIZE" 37 | #endif 38 | #ifndef IUP_ALPHA_SIZE /* Number of alpha bits */ 39 | #define IUP_ALPHA_SIZE "ALPHA_SIZE" 40 | #endif 41 | #ifndef IUP_DEPTH_SIZE /* Number of bits in depth buffer */ 42 | #define IUP_DEPTH_SIZE "DEPTH_SIZE" 43 | #endif 44 | #ifndef IUP_STENCIL_SIZE /* Number of bits in stencil buffer */ 45 | #define IUP_STENCIL_SIZE "STENCIL_SIZE" 46 | #endif 47 | #ifndef IUP_ACCUM_RED_SIZE /* Number of red bits in accum. buffer */ 48 | #define IUP_ACCUM_RED_SIZE "ACCUM_RED_SIZE" 49 | #endif 50 | #ifndef IUP_ACCUM_GREEN_SIZE /* Number of green bits in accum. buffer */ 51 | #define IUP_ACCUM_GREEN_SIZE "ACCUM_GREEN_SIZE" 52 | #endif 53 | #ifndef IUP_ACCUM_BLUE_SIZE /* Number of blue bits in accum. buffer */ 54 | #define IUP_ACCUM_BLUE_SIZE "ACCUM_BLUE_SIZE" 55 | #endif 56 | #ifndef IUP_ACCUM_ALPHA_SIZE /* Number of alpha bits in accum. buffer */ 57 | #define IUP_ACCUM_ALPHA_SIZE "ACCUM_ALPHA_SIZE" 58 | #endif 59 | 60 | 61 | /* Attribute values */ 62 | #ifndef IUP_DOUBLE 63 | #define IUP_DOUBLE "DOUBLE" 64 | #endif 65 | #ifndef IUP_SINGLE 66 | #define IUP_SINGLE "SINGLE" 67 | #endif 68 | #ifndef IUP_INDEX 69 | #define IUP_INDEX "INDEX" 70 | #endif 71 | #ifndef IUP_RGBA 72 | #define IUP_RGBA "RGBA" 73 | #endif 74 | #ifndef IUP_YES 75 | #define IUP_YES "YES" 76 | #endif 77 | #ifndef IUP_NO 78 | #define IUP_NO "NO" 79 | #endif 80 | 81 | void IupGLCanvasOpen(void); 82 | 83 | Ihandle *IupGLCanvas(const char *action); 84 | Ihandle* IupGLBackgroundBox(Ihandle* child); 85 | 86 | void IupGLMakeCurrent(Ihandle* ih); 87 | int IupGLIsCurrent(Ihandle* ih); 88 | void IupGLSwapBuffers(Ihandle* ih); 89 | void IupGLPalette(Ihandle* ih, int index, float r, float g, float b); 90 | void IupGLUseFont(Ihandle* ih, int first, int count, int list_base); 91 | void IupGLWait(int gl); 92 | 93 | #ifdef __cplusplus 94 | } 95 | #endif 96 | 97 | #endif 98 | -------------------------------------------------------------------------------- /iup3/include/iupglcontrols.h: -------------------------------------------------------------------------------- 1 | /** \file 2 | * \brief GL Controls. 3 | * 4 | * See Copyright Notice in "iup.h" 5 | */ 6 | 7 | #ifndef __IUPGLCONTROLS_H 8 | #define __IUPGLCONTROLS_H 9 | 10 | #ifdef __cplusplus 11 | extern "C" { 12 | #endif 13 | 14 | 15 | int IupGLControlsOpen(void); 16 | 17 | Ihandle* IupGLCanvasBoxv(Ihandle** children); 18 | Ihandle* IupGLCanvasBox(Ihandle* child, ...); 19 | 20 | Ihandle* IupGLSubCanvas(void); 21 | 22 | Ihandle* IupGLLabel(const char* title); 23 | Ihandle* IupGLSeparator(void); 24 | Ihandle* IupGLButton(const char* title); 25 | Ihandle* IupGLToggle(const char* title); 26 | Ihandle* IupGLLink(const char *url, const char * title); 27 | Ihandle* IupGLProgressBar(void); 28 | Ihandle* IupGLVal(void); 29 | Ihandle* IupGLFrame(Ihandle* child); 30 | Ihandle* IupGLExpander(Ihandle* child); 31 | Ihandle* IupGLScrollBox(Ihandle* child); 32 | Ihandle* IupGLSizeBox(Ihandle* child); 33 | Ihandle* IupGLText(void); 34 | 35 | 36 | /* Utilities */ 37 | void IupGLDrawImage(Ihandle* ih, const char* name, int x, int y, int active); 38 | void IupGLDrawText(Ihandle* ih, const char* str, int len, int x, int y); 39 | void IupGLDrawGetTextSize(Ihandle* ih, const char* str, int *w, int *h); 40 | void IupGLDrawGetImageInfo(const char* name, int *w, int *h, int *bpp); 41 | 42 | 43 | #ifdef __cplusplus 44 | } 45 | #endif 46 | 47 | #endif 48 | -------------------------------------------------------------------------------- /iup3/include/iupim.h: -------------------------------------------------------------------------------- 1 | /** \file 2 | * \brief Utilities using IM 3 | * 4 | * See Copyright Notice in "iup.h" 5 | */ 6 | 7 | #ifndef __IUPIM_H 8 | #define __IUPIM_H 9 | 10 | #if defined(__cplusplus) 11 | extern "C" { 12 | #endif 13 | 14 | 15 | void IupImOpen(void); /* optional */ 16 | 17 | Ihandle* IupLoadImage(const char* filename); 18 | int IupSaveImage(Ihandle* ih, const char* filename, const char* format); 19 | 20 | Ihandle* IupLoadAnimation(const char* filename); 21 | Ihandle* IupLoadAnimationFrames(const char** filename_list, int file_count); 22 | 23 | #ifdef __IM_IMAGE_H 24 | imImage* IupGetNativeHandleImage(void* handle); 25 | void* IupGetImageNativeHandle(const imImage* image); 26 | 27 | Ihandle* IupImageFromImImage(const imImage* image); 28 | imImage* IupImageToImImage(Ihandle* iup_image); 29 | #endif 30 | 31 | 32 | #if defined(__cplusplus) 33 | } 34 | #endif 35 | 36 | #endif 37 | -------------------------------------------------------------------------------- /iup3/include/iuplua.h: -------------------------------------------------------------------------------- 1 | /** \file 2 | * \brief IUP Binding for Lua. 3 | * 4 | * See Copyright Notice in "iup.h" 5 | */ 6 | 7 | #ifndef __IUPLUA_H 8 | #define __IUPLUA_H 9 | 10 | #ifdef __cplusplus 11 | extern "C" { 12 | #endif 13 | 14 | 15 | #ifndef DOXYGEN_SHOULD_IGNORE_THIS 16 | /** @cond DOXYGEN_SHOULD_IGNORE_THIS */ 17 | #ifndef IUPLUA_API 18 | #ifdef IUPLUA_BUILD_LIBRARY 19 | #ifdef __EMSCRIPTEN__ 20 | #include 21 | #define IUPLUA_API EMSCRIPTEN_KEEPALIVE 22 | #elif WIN32 23 | #define IUPLUA_API __declspec(dllexport) 24 | #elif defined(__GNUC__) && __GNUC__ >= 4 25 | #define IUPLUA_API __attribute__ ((visibility("default"))) 26 | #else 27 | #define IUPLUA_API 28 | #endif 29 | #else 30 | #define IUPLUA_API 31 | #endif /* IUPLUA_BUILD_LIBRARY */ 32 | #endif /* IUPLUA_API */ 33 | /** @endcond DOXYGEN_SHOULD_IGNORE_THIS */ 34 | #endif /* DOXYGEN_SHOULD_IGNORE_THIS */ 35 | 36 | 37 | IUPLUA_API int iuplua_open(lua_State *L); 38 | IUPLUA_API int iupkey_open(lua_State *L); /* does nothing, kept for backward compatibility */ 39 | IUPLUA_API int iuplua_close(lua_State * L); 40 | 41 | /* utilities */ 42 | IUPLUA_API int iuplua_isihandle(lua_State *L, int pos); 43 | IUPLUA_API Ihandle* iuplua_checkihandle(lua_State *L, int pos); 44 | IUPLUA_API void iuplua_pushihandle(lua_State *L, Ihandle *n); 45 | IUPLUA_API int iuplua_dofile(lua_State *L, const char *filename); 46 | IUPLUA_API int iuplua_dostring(lua_State *L, const char *string, const char *chunk_name); 47 | IUPLUA_API int iuplua_dobuffer(lua_State *L, const char *buffer, int len, const char *chunk_name); 48 | IUPLUA_API void iuplua_show_error_message(const char *pname, const char* msg); 49 | 50 | #ifdef __cplusplus 51 | } 52 | #endif 53 | 54 | #endif 55 | -------------------------------------------------------------------------------- /iup3/include/iuplua_mglplot.h: -------------------------------------------------------------------------------- 1 | /** \file 2 | * \brief IupMglPlot Binding for Lua. 3 | * 4 | * See Copyright Notice in "iup.h" 5 | */ 6 | 7 | #ifndef __IUPLUA_MGLPLOT_H 8 | #define __IUPLUA_MGLPLOT_H 9 | 10 | #ifdef __cplusplus 11 | extern "C" { 12 | #endif 13 | 14 | int iup_mglplotlua_open (lua_State * L); 15 | 16 | #ifdef __cplusplus 17 | } 18 | #endif 19 | 20 | #endif 21 | -------------------------------------------------------------------------------- /iup3/include/iuplua_plot.h: -------------------------------------------------------------------------------- 1 | /** \file 2 | * \brief iup_plot Binding for Lua. 3 | * 4 | * See Copyright Notice in "iup.h" 5 | */ 6 | 7 | #ifndef __IUPLUA_PLOT_H 8 | #define __IUPLUA_PLOT_H 9 | 10 | #ifdef __cplusplus 11 | extern "C" { 12 | #endif 13 | 14 | int iup_plotlua_open (lua_State * L); 15 | 16 | #ifdef __cplusplus 17 | } 18 | #endif 19 | 20 | #endif 21 | -------------------------------------------------------------------------------- /iup3/include/iuplua_scintilla.h: -------------------------------------------------------------------------------- 1 | /** \file 2 | * \brief IupScintilla Binding for Lua. 3 | * 4 | * See Copyright Notice in "iup.h" 5 | */ 6 | 7 | #ifndef __IUPLUA_SCINTILLA_H 8 | #define __IUPLUA_SCINTILLA_H 9 | 10 | #ifdef __cplusplus 11 | extern "C" { 12 | #endif 13 | 14 | int iup_scintillalua_open (lua_State * L); 15 | 16 | #ifdef __cplusplus 17 | } 18 | #endif 19 | 20 | #endif 21 | -------------------------------------------------------------------------------- /iup3/include/iupluacontrols.h: -------------------------------------------------------------------------------- 1 | /** \file 2 | * \brief iupcontrols Binding for Lua. 3 | * 4 | * See Copyright Notice in "iup.h" 5 | */ 6 | 7 | #ifndef __IUPLUACONTROLS_H 8 | #define __IUPLUACONTROLS_H 9 | 10 | #ifdef __cplusplus 11 | extern "C" { 12 | #endif 13 | 14 | int iupcontrolslua_open (lua_State * L); 15 | 16 | #ifdef __cplusplus 17 | } 18 | #endif 19 | 20 | #endif 21 | -------------------------------------------------------------------------------- /iup3/include/iupluafiledlg.h: -------------------------------------------------------------------------------- 1 | /** \file 2 | * \brief Binding of new iupfiledlg to Lua. 3 | * 4 | * See Copyright Notice in "iup.h" 5 | */ 6 | 7 | #ifndef __IUPLUAFILEDLG_H 8 | #define __IUPLUAFILEDLG_H 9 | 10 | #ifdef __cplusplus 11 | extern "C" { 12 | #endif 13 | 14 | int iupfiledlglua_open (lua_State * L); 15 | 16 | #ifdef __cplusplus 17 | } 18 | #endif 19 | 20 | #endif 21 | -------------------------------------------------------------------------------- /iup3/include/iupluagl.h: -------------------------------------------------------------------------------- 1 | /** \file 2 | * \brief Binding of iupglcanvas to Lua. 3 | * 4 | * See Copyright Notice in "iup.h" 5 | */ 6 | 7 | #ifndef __IUPLUAGL_H 8 | #define __IUPLUAGL_H 9 | 10 | #ifdef __cplusplus 11 | extern "C" { 12 | #endif 13 | 14 | int iupgllua_open (lua_State * L); 15 | 16 | #ifdef __cplusplus 17 | } 18 | #endif 19 | 20 | #endif 21 | -------------------------------------------------------------------------------- /iup3/include/iupluaglcontrols.h: -------------------------------------------------------------------------------- 1 | /** \file 2 | * \brief iupglcontrols Binding for Lua. 3 | * 4 | * See Copyright Notice in "iup.h" 5 | */ 6 | 7 | #ifndef __IUPLUAGLCONTROLS_H 8 | #define __IUPLUAGLCONTROLS_H 9 | 10 | #ifdef __cplusplus 11 | extern "C" { 12 | #endif 13 | 14 | int iupglcontrolslua_open (lua_State * L); 15 | 16 | #ifdef __cplusplus 17 | } 18 | #endif 19 | 20 | #endif 21 | -------------------------------------------------------------------------------- /iup3/include/iupluaim.h: -------------------------------------------------------------------------------- 1 | /** \file 2 | * \brief Bindig of iupim functions to Lua. 3 | * 4 | * See Copyright Notice in "iup.h" 5 | */ 6 | 7 | #ifndef __IUPLUAIM_H 8 | #define __IUPLUAIM_H 9 | 10 | #ifdef __cplusplus 11 | extern "C" { 12 | #endif 13 | 14 | int iupimlua_open(lua_State * L); 15 | 16 | #ifdef __cplusplus 17 | } 18 | #endif 19 | 20 | #endif 21 | -------------------------------------------------------------------------------- /iup3/include/iupluaole.h: -------------------------------------------------------------------------------- 1 | /** \file 2 | * \brief Binding of iupolecontrol to Lua. 3 | * 4 | * See Copyright Notice in "iup.h" 5 | */ 6 | 7 | #ifndef __IUPLUAOLE_H 8 | #define __IUPLUAOLE_H 9 | 10 | #ifdef __cplusplus 11 | extern "C" { 12 | #endif 13 | 14 | int iupolelua_open (lua_State * L); 15 | 16 | #ifdef __cplusplus 17 | } 18 | #endif 19 | 20 | #endif 21 | -------------------------------------------------------------------------------- /iup3/include/iupluascripterdlg.h: -------------------------------------------------------------------------------- 1 | /** \file 2 | * \brief IupLuaScripterDlg dialog and Lua binding 3 | * 4 | * See Copyright Notice in "iup.h" 5 | */ 6 | 7 | #ifndef __IUPLUASCRIPTERDLG_H 8 | #define __IUPLUASCRIPTERDLG_H 9 | 10 | #ifdef __cplusplus 11 | extern "C" { 12 | #endif 13 | 14 | void IupLuaScripterDlgOpen(lua_State * L); 15 | 16 | Ihandle* IupLuaScripterDlg(void); 17 | 18 | /* Lua binding */ 19 | int iupluascripterdlglua_open(lua_State * L); 20 | 21 | #ifdef __cplusplus 22 | } 23 | #endif 24 | 25 | #endif 26 | -------------------------------------------------------------------------------- /iup3/include/iupluatuio.h: -------------------------------------------------------------------------------- 1 | /** \file 2 | * \brief Binding of iuptuio to Lua. 3 | * 4 | * See Copyright Notice in "iup.h" 5 | */ 6 | 7 | #ifndef __IUPLUATUIO_H 8 | #define __IUPLUATUIO_H 9 | 10 | #ifdef __cplusplus 11 | extern "C" { 12 | #endif 13 | 14 | int iuptuiolua_open (lua_State * L); 15 | 16 | #ifdef __cplusplus 17 | } 18 | #endif 19 | 20 | #endif 21 | -------------------------------------------------------------------------------- /iup3/include/iupluaweb.h: -------------------------------------------------------------------------------- 1 | /** \file 2 | * \brief Binding of iupwebbrowser to Lua. 3 | * 4 | * See Copyright Notice in "iup.h" 5 | */ 6 | 7 | #ifndef __IUPLUAWEB_H 8 | #define __IUPLUAWEB_H 9 | 10 | #ifdef __cplusplus 11 | extern "C" { 12 | #endif 13 | 14 | #ifndef DOXYGEN_SHOULD_IGNORE_THIS 15 | /** @cond DOXYGEN_SHOULD_IGNORE_THIS */ 16 | #ifndef IUPLUAWEB_API 17 | #ifdef IUPLUAWEB_BUILD_LIBRARY 18 | #ifdef __EMSCRIPTEN__ 19 | #include 20 | #define IUPLUAWEB_API EMSCRIPTEN_KEEPALIVE 21 | #elif WIN32 22 | #define IUPLUAWEB_API __declspec(dllexport) 23 | #elif defined(__GNUC__) && __GNUC__ >= 4 24 | #define IUPLUAWEB_API __attribute__ ((visibility("default"))) 25 | #else 26 | #define IUPLUAWEB_API 27 | #endif 28 | #else 29 | #define IUPLUAWEB_API 30 | #endif /* IUPLUAWEB_BUILD_LIBRARY */ 31 | #endif /* IUPLUAWEB_API */ 32 | /** @endcond DOXYGEN_SHOULD_IGNORE_THIS */ 33 | #endif /* DOXYGEN_SHOULD_IGNORE_THIS */ 34 | 35 | 36 | IUPLUAWEB_API int iupweblua_open (lua_State * L); 37 | 38 | #ifdef __cplusplus 39 | } 40 | #endif 41 | 42 | #endif 43 | -------------------------------------------------------------------------------- /iup3/include/iupole.h: -------------------------------------------------------------------------------- 1 | /** \file 2 | * \brief Ole control. 3 | * 4 | * See Copyright Notice in "iup.h" 5 | */ 6 | 7 | #ifndef __IUPOLE_H 8 | #define __IUPOLE_H 9 | 10 | #ifdef __cplusplus 11 | extern "C" { 12 | #endif 13 | 14 | #ifndef DOXYGEN_SHOULD_IGNORE_THIS 15 | /** @cond DOXYGEN_SHOULD_IGNORE_THIS */ 16 | #ifndef IUPOLE_API 17 | #ifdef IUPOLE_BUILD_LIBRARY 18 | #ifdef __EMSCRIPTEN__ 19 | #include 20 | #define IUPOLE_API EMSCRIPTEN_KEEPALIVE 21 | #elif WIN32 22 | #define IUPOLE_API __declspec(dllexport) 23 | #elif defined(__GNUC__) && __GNUC__ >= 4 24 | #define IUPOLE_API __attribute__ ((visibility("default"))) 25 | #else 26 | #define IUPOLE_API 27 | #endif 28 | #else 29 | #define IUPOLE_API 30 | #endif /* IUP_BUILD_LIBRARY */ 31 | #endif /* IUPOLE_API */ 32 | /** @endcond DOXYGEN_SHOULD_IGNORE_THIS */ 33 | #endif /* DOXYGEN_SHOULD_IGNORE_THIS */ 34 | 35 | 36 | IUPOLE_API Ihandle *IupOleControl(const char* progid); 37 | 38 | IUPOLE_API int IupOleControlOpen(void); 39 | 40 | 41 | #ifdef __cplusplus 42 | } 43 | #endif 44 | 45 | #endif 46 | -------------------------------------------------------------------------------- /iup3/include/iuptuio.h: -------------------------------------------------------------------------------- 1 | /** \file 2 | * \brief IupTuioClient control 3 | * 4 | * See Copyright Notice in "iup.h" 5 | */ 6 | 7 | #ifndef __IUPTUIO_H 8 | #define __IUPTUIO_H 9 | 10 | #if defined(__cplusplus) 11 | extern "C" { 12 | #endif 13 | 14 | int IupTuioOpen(void); 15 | Ihandle* IupTuioClient(int port); 16 | 17 | #if defined(__cplusplus) 18 | } 19 | #endif 20 | 21 | #endif 22 | -------------------------------------------------------------------------------- /iup3/include/iupweb.h: -------------------------------------------------------------------------------- 1 | /** \file 2 | * \brief Web control. 3 | * 4 | * See Copyright Notice in "iup.h" 5 | */ 6 | 7 | #ifndef __IUPWEB_H 8 | #define __IUPWEB_H 9 | 10 | #ifdef __cplusplus 11 | extern "C" { 12 | #endif 13 | 14 | #ifndef DOXYGEN_SHOULD_IGNORE_THIS 15 | /** @cond DOXYGEN_SHOULD_IGNORE_THIS */ 16 | #ifndef IUPWEB_API 17 | #ifdef IUPWEB_BUILD_LIBRARY 18 | #ifdef __EMSCRIPTEN__ 19 | #include 20 | #define IUPWEB_API EMSCRIPTEN_KEEPALIVE 21 | #elif WIN32 22 | #define IUPWEB_API __declspec(dllexport) 23 | #elif defined(__GNUC__) && __GNUC__ >= 4 24 | #define IUPWEB_API __attribute__ ((visibility("default"))) 25 | #else 26 | #define IUPWEB_API 27 | #endif 28 | #else 29 | #define IUPWEB_API 30 | #endif /* IUP_BUILD_LIBRARY */ 31 | #endif /* IUPWEB_API */ 32 | /** @endcond DOXYGEN_SHOULD_IGNORE_THIS */ 33 | #endif /* DOXYGEN_SHOULD_IGNORE_THIS */ 34 | 35 | 36 | IUPWEB_API int IupWebBrowserOpen(void); 37 | 38 | IUPWEB_API Ihandle *IupWebBrowser(void); 39 | 40 | 41 | #ifdef __cplusplus 42 | } 43 | #endif 44 | 45 | #endif 46 | -------------------------------------------------------------------------------- /iup3/iup.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chinenkai/php-iup/3e1a020992ee46d414d0627e6bd3de2724bf1724/iup3/iup.lib -------------------------------------------------------------------------------- /iup3/iup_mglplot.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chinenkai/php-iup/3e1a020992ee46d414d0627e6bd3de2724bf1724/iup3/iup_mglplot.lib -------------------------------------------------------------------------------- /iup3/iup_plot.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chinenkai/php-iup/3e1a020992ee46d414d0627e6bd3de2724bf1724/iup3/iup_plot.lib -------------------------------------------------------------------------------- /iup3/iup_scintilla.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chinenkai/php-iup/3e1a020992ee46d414d0627e6bd3de2724bf1724/iup3/iup_scintilla.lib -------------------------------------------------------------------------------- /iup3/iupcd.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chinenkai/php-iup/3e1a020992ee46d414d0627e6bd3de2724bf1724/iup3/iupcd.lib -------------------------------------------------------------------------------- /iup3/iupcontrols.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chinenkai/php-iup/3e1a020992ee46d414d0627e6bd3de2724bf1724/iup3/iupcontrols.lib -------------------------------------------------------------------------------- /iup3/iupfiledlg.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chinenkai/php-iup/3e1a020992ee46d414d0627e6bd3de2724bf1724/iup3/iupfiledlg.lib -------------------------------------------------------------------------------- /iup3/iupgl.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chinenkai/php-iup/3e1a020992ee46d414d0627e6bd3de2724bf1724/iup3/iupgl.lib -------------------------------------------------------------------------------- /iup3/iupglcontrols.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chinenkai/php-iup/3e1a020992ee46d414d0627e6bd3de2724bf1724/iup3/iupglcontrols.lib -------------------------------------------------------------------------------- /iup3/iupim.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chinenkai/php-iup/3e1a020992ee46d414d0627e6bd3de2724bf1724/iup3/iupim.lib -------------------------------------------------------------------------------- /iup3/iupimglib.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chinenkai/php-iup/3e1a020992ee46d414d0627e6bd3de2724bf1724/iup3/iupimglib.lib -------------------------------------------------------------------------------- /iup3/iupole.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chinenkai/php-iup/3e1a020992ee46d414d0627e6bd3de2724bf1724/iup3/iupole.lib -------------------------------------------------------------------------------- /iup3/iuptuio.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chinenkai/php-iup/3e1a020992ee46d414d0627e6bd3de2724bf1724/iup3/iuptuio.lib -------------------------------------------------------------------------------- /iup3/iupweb.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chinenkai/php-iup/3e1a020992ee46d414d0627e6bd3de2724bf1724/iup3/iupweb.lib -------------------------------------------------------------------------------- /iup3/zlib1.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chinenkai/php-iup/3e1a020992ee46d414d0627e6bd3de2724bf1724/iup3/zlib1.lib -------------------------------------------------------------------------------- /iup_ext.c: -------------------------------------------------------------------------------- 1 | /* 2 | +----------------------------------------------------------------------+ 3 | | PHP Version 7 | 4 | +----------------------------------------------------------------------+ 5 | | Copyright (c) 1997-2018 The PHP Group | 6 | +----------------------------------------------------------------------+ 7 | | This source file is subject to version 3.01 of the PHP license, | 8 | | that is bundled with this package in the file LICENSE, and is | 9 | | available through the world-wide-web at the following url: | 10 | | http://www.php.net/license/3_01.txt | 11 | | If you did not receive a copy of the PHP license and are unable to | 12 | | obtain it through the world-wide-web, please send a note to | 13 | | license@php.net so we can mail you a copy immediately. | 14 | +----------------------------------------------------------------------+ 15 | | Author: | 16 | +----------------------------------------------------------------------+ 17 | */ 18 | 19 | /* $Id$ */ 20 | 21 | #ifdef HAVE_CONFIG_H 22 | #include "config.h" 23 | #endif 24 | 25 | #include "php.h" 26 | #include "php_ini.h" 27 | #include "ext/standard/info.h" 28 | #include "php_iup.h" 29 | 30 | extern int le_iup_ihandle; 31 | extern int le_iup_event; 32 | 33 | extern HashTable *iup_events; 34 | 35 | -------------------------------------------------------------------------------- /tests/001.phpt: -------------------------------------------------------------------------------- 1 | --TEST-- 2 | Check for iup presence 3 | --SKIPIF-- 4 | 5 | --FILE-- 6 | 20 | --EXPECT-- 21 | iup extension is available 22 | --------------------------------------------------------------------------------