1 /*************************************************************************** 2 * canvas_cf.h is part of Math Graphic Library 3 * Copyright (C) 2007-2016 Alexey Balakin <mathgl.abalakin@gmail.ru> * 4 * * 5 * This program is free software; you can redistribute it and/or modify * 6 * it under the terms of the GNU Lesser General Public License as * 7 * published by the Free Software Foundation; either version 3 of the * 8 * License, or (at your option) any later version. * 9 * * 10 * This program is distributed in the hope that it will be useful, * 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of * 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 13 * GNU General Public License for more details. * 14 * * 15 * You should have received a copy of the GNU Lesser General Public * 16 * License along with this program; if not, write to the * 17 * Free Software Foundation, Inc., * 18 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * 19 ***************************************************************************/ 20 #ifndef MGL_CANVAS_CF_H 21 #define MGL_CANVAS_CF_H 22 #include "mgl2/abstract.h" 23 //----------------------------------------------------------------------------- 24 #ifdef __cplusplus 25 extern "C" { 26 #endif 27 28 /// Create HMGL object with specified sizes 29 HMGL MGL_EXPORT mgl_create_graph(int width, int height); 30 uintptr_t MGL_EXPORT mgl_create_graph_(int *width, int *height); 31 /// Delete HMGL object 32 void MGL_EXPORT mgl_delete_graph(HMGL gr); 33 void MGL_EXPORT mgl_delete_graph_(uintptr_t *gr); 34 /// Return pointer to built-in (default) HMGL object 35 HMGL MGL_EXPORT mgl_default_graph(); 36 uintptr_t MGL_EXPORT mgl_default_graph_(); 37 /// Set size of frame in pixels. Normally this function is called internally. 38 void MGL_EXPORT mgl_set_size(HMGL gr, int width, int height); 39 void MGL_EXPORT mgl_set_size_(uintptr_t *gr, int *width, int *height); 40 /// Set size of frame in pixels, but don't erase primitives 41 void MGL_EXPORT mgl_scale_size(HMGL gr, int width, int height); 42 void MGL_EXPORT mgl_scale_size_(uintptr_t *gr, int *width, int *height); 43 /// Scaling for all further set size calls. 44 void MGL_EXPORT mgl_set_size_scl(double scl); 45 void MGL_EXPORT mgl_set_size_scl_(double *scl); 46 /// Set default parameters for plotting 47 void MGL_EXPORT mgl_set_def_param(HMGL gr); 48 void MGL_EXPORT mgl_set_def_param_(uintptr_t *gr); 49 /// Combine plots from 2 canvases. Result will be saved into gr 50 void MGL_EXPORT mgl_combine_gr(HMGL gr, HMGL gr2); 51 void MGL_EXPORT mgl_combine_gr_(uintptr_t *gr, uintptr_t *gr2); 52 /// Force preparing the image. It can be useful for OpenGL mode mostly. 53 void MGL_EXPORT mgl_finish(HMGL gr); 54 void MGL_EXPORT mgl_finish_(uintptr_t *gr); 55 /// Force preparing the image and save result into background one. 56 void MGL_EXPORT mgl_rasterize(HMGL gr); 57 void MGL_EXPORT mgl_rasterize_(uintptr_t *gr); 58 /// Set boundary box for export graphics into 2D file formats. 59 /** If x2<0 (y2<0) then full width (height) will be used. 60 * If x1<0 or y1<0 or x1>=x2|Width or y1>=y2|Height then cropping will be disabled. */ 61 void MGL_EXPORT mgl_set_bbox(HMGL gr, int x1, int y1, int x2, int y2); 62 void MGL_EXPORT mgl_set_bbox_(uintptr_t *gr, int *x1, int *y1, int *x2, int *y2); 63 64 /// Set the size of semi-transparent area around lines, marks, glyphs, ... Default is 1. 65 void MGL_EXPORT mgl_pen_delta(HMGL gr, double d); 66 void MGL_EXPORT mgl_pen_delta_(uintptr_t *gr, double *d); 67 68 /// Set tick length 69 void MGL_EXPORT mgl_set_tick_len(HMGL gr, double len, double stt); 70 void MGL_EXPORT mgl_set_tick_len_(uintptr_t *gr, mreal *len, mreal *stt); 71 /// Set axis and ticks style 72 void MGL_EXPORT mgl_set_axis_stl(HMGL gr, const char *stl, const char *tck, const char *sub); 73 void MGL_EXPORT mgl_set_axis_stl_(uintptr_t *gr, const char *stl, const char *tck, const char *sub, int,int,int); 74 75 /// Auto adjust ticks 76 void MGL_EXPORT mgl_adjust_ticks(HMGL gr, const char *dir); 77 void MGL_EXPORT mgl_adjust_ticks_(uintptr_t *gr, const char *dir, int); 78 /// Auto adjust ticks and set ticks format ("+E0123456789-fF") 79 void MGL_EXPORT mgl_adjust_ticks_ext(HMGL gr, const char *dir, const char *stl); 80 void MGL_EXPORT mgl_adjust_ticks_ext_(uintptr_t *gr, const char *dir, const char *stl, int, int); 81 /// Set the ticks parameters 82 void MGL_EXPORT mgl_set_ticks(HMGL gr, char dir, double d, int ns, double org); 83 void MGL_EXPORT mgl_set_ticks_(uintptr_t *gr, char *dir, mreal *d, int *ns, mreal *org, int); 84 /// Set the ticks parameters and specify ticks factor string 85 void MGL_EXPORT mgl_set_ticks_fact(HMGL gr, char dir, double d, int ns, double org, const char *fact); 86 void MGL_EXPORT mgl_set_ticks_factw(HMGL gr, char dir, double d, int ns, double org, const wchar_t *fact); 87 void MGL_EXPORT mgl_set_ticks_fact_(uintptr_t *gr, char *dir, double *d, int *ns, double *org, const char *fact,int,int); 88 89 /// Set manual ticks text (\n separated). Use "" to disable this feature. 90 void MGL_EXPORT mgl_set_ticks_str(HMGL gr, char dir, const char *lbl, int add); 91 void MGL_EXPORT mgl_set_ticks_str_(uintptr_t *gr, const char *dir, const char *lbl, int *add,int,int); 92 void MGL_EXPORT mgl_set_ticks_wcs(HMGL gr, char dir, const wchar_t *lbl, int add); 93 /// Set manual ticks position and text (\n separated). Use "" to disable this feature. 94 void MGL_EXPORT mgl_set_ticks_val(HMGL gr, char dir, HCDT val, const char *lbl, int add); 95 void MGL_EXPORT mgl_set_ticks_val_(uintptr_t *gr, const char *dir, uintptr_t *val, const char *lbl, int *add,int,int); 96 void MGL_EXPORT mgl_set_ticks_valw(HMGL gr, char dir, HCDT val, const wchar_t *lbl, int add); 97 /// Add manual tick at given position. Use "" to disable this feature. 98 void MGL_EXPORT mgl_add_tick(HMGL gr, char dir, double val, const char *lbl); 99 void MGL_EXPORT mgl_add_tick_(uintptr_t *gr, const char *dir, mreal *val, const char *lbl,int,int); 100 void MGL_EXPORT mgl_add_tickw(HMGL gr, char dir, double val, const wchar_t *lbl); 101 /// Tune ticks (tune|1 for common multiplier, tune|2 for common component) 102 void MGL_EXPORT mgl_tune_ticks(HMGL gr, int tune, double fact_pos); 103 void MGL_EXPORT mgl_tune_ticks_(uintptr_t *gr, int *tune, mreal *fact_pos); 104 /// Set templates for ticks 105 void MGL_EXPORT mgl_set_tick_templ(HMGL gr, char dir, const char *templ); 106 void MGL_EXPORT mgl_set_tick_templ_(uintptr_t *gr, const char *dir, const char *templ,int,int); 107 void MGL_EXPORT mgl_set_tick_templw(HMGL gr, char dir, const wchar_t *templ); 108 /// Set time templates for ticks 109 void MGL_EXPORT mgl_set_ticks_time(HMGL gr, char dir, double d, const char *t); 110 void MGL_EXPORT mgl_set_ticks_time_(uintptr_t *gr, const char *dir, mreal *d, const char *t,int,int); 111 /// Set additional shift of tick labels 112 void MGL_EXPORT mgl_set_tick_shift(HMGL gr, double sx, double sy, double sz, double sc); 113 void MGL_EXPORT mgl_set_tick_shift_(uintptr_t *gr, mreal *sx, mreal *sy, mreal *sz, mreal *sc); 114 115 /// Draws bounding box outside the plotting volume 116 void MGL_EXPORT mgl_box(HMGL gr); 117 void MGL_EXPORT mgl_box_(uintptr_t *gr); 118 /// Draws bounding box outside the plotting volume with color c 119 /** Style ‘@’ produce filled back faces. */ 120 void MGL_EXPORT mgl_box_str(HMGL gr, const char *col, int ticks); 121 void MGL_EXPORT mgl_box_str_(uintptr_t *gr, const char *col, int *ticks, int); 122 /// Draw axises with ticks in direction(s) dir. 123 /** Parameter \a dir may contain: 124 * ‘xyzt’for drawing axis in corresponding direction; 125 * ‘XYZT’ for drawing axis in corresponding direction but with inverted positions of labels; 126 * ‘~’, ‘_’ for disabling tick labels; 127 * ‘U’ for disabling rotation of tick labels; 128 * ‘^’ for inverting default axis origin; 129 * ‘!’ for disabling ticks tuning; 130 * ‘AKDTVISO’ for drawing arrow at the end of axis; 131 * ‘a’ for forced adjusting of axis ticks; 132 * ‘f’ for printing ticks labels in fixed format; 133 * ‘E’ for using ‘E’ instead of ‘e’ in ticks labels; 134 * ‘F’ for printing ticks labels in LaTeX format; 135 * ‘+’ for printing ‘+’ for positive ticks; 136 * ‘-’ for printing usual ‘-’ in ticks labels; 137 * ‘0123456789’ for precision at printing ticks labels. 138 * Option "value" set the manual rotation angle for the ticks.*/ 139 void MGL_EXPORT mgl_axis(HMGL gr, const char *dir, const char *stl, const char *opt); 140 void MGL_EXPORT mgl_axis_(uintptr_t *gr, const char *dir, const char *stl, const char *opt,int,int,int); 141 /// Draw grid lines perpendicular to direction(s) dir. 142 void MGL_EXPORT mgl_axis_grid(HMGL gr, const char *dir,const char *pen, const char *opt); 143 void MGL_EXPORT mgl_axis_grid_(uintptr_t *gr, const char *dir,const char *pen, const char *opt,int,int,int); 144 /// Print the label text for axis dir. 145 /** Option "value" set additional shifting of the label. */ 146 void MGL_EXPORT mgl_label(HMGL gr, char dir, const char *text, double pos, const char *opt); 147 void MGL_EXPORT mgl_label_(uintptr_t *gr, const char *dir, const char *text, mreal *pos, const char *opt,int,int,int); 148 /// Print the label text for axis dir. 149 /** Option "value" set additional shifting of the label. */ 150 void MGL_EXPORT mgl_labelw(HMGL gr, char dir, const wchar_t *text, double pos, const char *opt); 151 152 /// Draw colorbar at edge of axis 153 /** Parameter \a sch may contain: 154 * ‘<>^_’ for positioning at left, at right, at top or at bottom correspondingly; 155 * ‘I’ for positioning near bounding (by default, at edges of subplot); 156 * ‘A’ for using absolute coordinates; 157 * ‘~’ for disabling tick labels. 158 * ‘!’ for disabling ticks tuning; 159 * ‘f’ for printing ticks labels in fixed format; 160 * ‘E’ for using ‘E’ instead of ‘e’ in ticks labels; 161 * ‘F’ for printing ticks labels in LaTeX format; 162 * ‘+’ for printing ‘+’ for positive ticks; 163 * ‘-’ for printing usual ‘-’ in ticks labels; 164 * ‘0123456789’ for precision at printing ticks labels.*/ 165 void MGL_EXPORT mgl_colorbar(HMGL gr, const char *sch); 166 void MGL_EXPORT mgl_colorbar_(uintptr_t *gr, const char *sch,int); 167 /// Draw colorbar at manual position 168 /** Parameter \a sch may contain: 169 * ‘<>^_’ for positioning at left, at right, at top or at bottom correspondingly; 170 * ‘I’ for positioning near bounding (by default, at edges of subplot); 171 * ‘A’ for using absolute coordinates; 172 * ‘~’ for disabling tick labels. 173 * ‘!’ for disabling ticks tuning; 174 * ‘f’ for printing ticks labels in fixed format; 175 * ‘E’ for using ‘E’ instead of ‘e’ in ticks labels; 176 * ‘F’ for printing ticks labels in LaTeX format; 177 * ‘+’ for printing ‘+’ for positive ticks; 178 * ‘-’ for printing usual ‘-’ in ticks labels; 179 * ‘0123456789’ for precision at printing ticks labels.*/ 180 void MGL_EXPORT mgl_colorbar_ext(HMGL gr, const char *sch, double x, double y, double w, double h); 181 void MGL_EXPORT mgl_colorbar_ext_(uintptr_t *gr, const char *sch, mreal *x, mreal *y, mreal *w, mreal *h,int); 182 /// Draw colorbar with manual colors at edge of axis 183 /** Parameter \a sch may contain: 184 * ‘<>^_’ for positioning at left, at right, at top or at bottom correspondingly; 185 * ‘I’ for positioning near bounding (by default, at edges of subplot); 186 * ‘A’ for using absolute coordinates; 187 * ‘~’ for disabling tick labels. 188 * ‘!’ for disabling ticks tuning; 189 * ‘f’ for printing ticks labels in fixed format; 190 * ‘E’ for using ‘E’ instead of ‘e’ in ticks labels; 191 * ‘F’ for printing ticks labels in LaTeX format; 192 * ‘+’ for printing ‘+’ for positive ticks; 193 * ‘-’ for printing usual ‘-’ in ticks labels; 194 * ‘0123456789’ for precision at printing ticks labels.*/ 195 void MGL_EXPORT mgl_colorbar_val(HMGL gr, HCDT dat, const char *sch); 196 void MGL_EXPORT mgl_colorbar_val_(uintptr_t *gr, uintptr_t *dat, const char *sch,int); 197 /// Draw colorbar with manual colors at manual position 198 /** Parameter \a sch may contain: 199 * ‘<>^_’ for positioning at left, at right, at top or at bottom correspondingly; 200 * ‘I’ for positioning near bounding (by default, at edges of subplot); 201 * ‘A’ for using absolute coordinates; 202 * ‘~’ for disabling tick labels. 203 * ‘!’ for disabling ticks tuning; 204 * ‘f’ for printing ticks labels in fixed format; 205 * ‘E’ for using ‘E’ instead of ‘e’ in ticks labels; 206 * ‘F’ for printing ticks labels in LaTeX format; 207 * ‘+’ for printing ‘+’ for positive ticks; 208 * ‘-’ for printing usual ‘-’ in ticks labels; 209 * ‘0123456789’ for precision at printing ticks labels.*/ 210 void MGL_EXPORT mgl_colorbar_val_ext(HMGL gr, HCDT dat, const char *sch,double x, double y, double w, double h); 211 void MGL_EXPORT mgl_colorbar_val_ext_(uintptr_t *gr, uintptr_t *dat, const char *sch, mreal *x, mreal *y, mreal *w, mreal *h,int); 212 213 /// Add string to legend 214 void MGL_EXPORT mgl_add_legend(HMGL gr, const char *text,const char *style); 215 void MGL_EXPORT mgl_add_legend_(uintptr_t *gr, const char *text,const char *style,int,int); 216 void MGL_EXPORT mgl_add_legendw(HMGL gr, const wchar_t *text,const char *style); 217 /// Clear saved legend string 218 void MGL_EXPORT mgl_clear_legend(HMGL gr); 219 void MGL_EXPORT mgl_clear_legend_(uintptr_t *gr); 220 /// Draw legend of accumulated strings at position {x,y} 221 /** Parameter fnt may contain: 222 * font style for legend text; 223 * colors for background (first one), border (second one) and text (last one); 224 * ‘A’ for positioning in absolute coordinates; 225 * ‘^’ for positioning outside of specified point; 226 * ‘-’ for arranging entries horizontally; 227 * ‘#’ for drawing box around legend. 228 * Option value set the space between line samples and text (default is 0.1).*/ 229 void MGL_EXPORT mgl_legend_pos(HMGL gr, double x, double y, const char *font, const char *opt); 230 void MGL_EXPORT mgl_legend_pos_(uintptr_t *gr, mreal *x, mreal *y, const char *font, const char *opt,int,int); 231 /// Draw legend of accumulated strings 232 /** Parameter fnt may contain: 233 * font style for legend text; 234 * colors for background (first one), border (second one) and text (last one); 235 * ‘A’ for positioning in absolute coordinates; 236 * ‘^’ for positioning outside of specified point; 237 * ‘-’ for arranging entries horizontally; 238 * ‘#’ for drawing box around legend. 239 * Option value set the space between line samples and text (default is 0.1). 240 * Parameter \a where sets position: 0 at bottom-left, 1 at bottom-right, 2 at top-left, 3 at top-right (default).*/ 241 void MGL_EXPORT mgl_legend(HMGL gr, int where, const char *font, const char *opt); 242 void MGL_EXPORT mgl_legend_(uintptr_t *gr, int *where, const char *font, const char *opt,int,int); 243 /// Set number of marks in legend sample 244 void MGL_EXPORT mgl_set_legend_marks(HMGL gr, int num); 245 void MGL_EXPORT mgl_set_legend_marks_(uintptr_t *gr, int *num); 246 247 /// Show current image 248 void MGL_EXPORT mgl_show_image(HMGL gr, const char *viewer, int keep); 249 void MGL_EXPORT mgl_show_image_(uintptr_t *gr, const char *viewer, int *keep, int); 250 /// Write the frame in file (depending extension, write current frame if fname is empty) 251 void MGL_EXPORT mgl_write_frame(HMGL gr, const char *fname,const char *descr); 252 void MGL_EXPORT mgl_write_frame_(uintptr_t *gr, const char *fname,const char *descr,int,int); 253 /// Write the frame in file using BMP format 254 void MGL_EXPORT mgl_write_tga(HMGL gr, const char *fname,const char *descr); 255 void MGL_EXPORT mgl_write_tga_(uintptr_t *gr, const char *fname,const char *descr,int,int); 256 /// Write the frame in file using BMP format 257 void MGL_EXPORT mgl_write_bmp(HMGL gr, const char *fname,const char *descr); 258 void MGL_EXPORT mgl_write_bmp_(uintptr_t *gr, const char *fname,const char *descr,int,int); 259 /// Write the frame in file using JPEG format 260 void MGL_EXPORT mgl_write_jpg(HMGL gr, const char *fname,const char *descr); 261 void MGL_EXPORT mgl_write_jpg_(uintptr_t *gr, const char *fname,const char *descr,int,int); 262 /// Write the frame in file using PNG format with transparency 263 void MGL_EXPORT mgl_write_png(HMGL gr, const char *fname,const char *descr); 264 void MGL_EXPORT mgl_write_png_(uintptr_t *gr, const char *fname,const char *descr,int,int); 265 /// Write the frame in file using PNG format without transparency 266 void MGL_EXPORT mgl_write_png_solid(HMGL gr, const char *fname,const char *descr); 267 void MGL_EXPORT mgl_write_png_solid_(uintptr_t *gr, const char *fname,const char *descr,int,int); 268 /// Write the frame in file using PostScript format as bitmap 269 void MGL_EXPORT mgl_write_bps(HMGL gr, const char *fname,const char *descr); 270 void MGL_EXPORT mgl_write_bps_(uintptr_t *gr, const char *fname,const char *descr,int,int); 271 /// Write the frame in file using PostScript format 272 void MGL_EXPORT mgl_write_eps(HMGL gr, const char *fname,const char *descr); 273 void MGL_EXPORT mgl_write_eps_(uintptr_t *gr, const char *fname,const char *descr,int,int); 274 /// Write the frame in file using SVG format 275 void MGL_EXPORT mgl_write_svg(HMGL gr, const char *fname,const char *descr); 276 void MGL_EXPORT mgl_write_svg_(uintptr_t *gr, const char *fname,const char *descr,int,int); 277 /// Write the frame in file using LaTeX format 278 void MGL_EXPORT mgl_write_tex(HMGL gr, const char *fname,const char *descr); 279 void MGL_EXPORT mgl_write_tex_(uintptr_t *gr, const char *fname,const char *descr,int,int); 280 /// Write the frame in file using OBJ format 281 void MGL_EXPORT mgl_write_obj(HMGL gr, const char *fname,const char *descr, int use_png); 282 void MGL_EXPORT mgl_write_obj_(uintptr_t *gr, const char *fname,const char *descr, int *use_png,int,int); 283 /// Write the frame in file using OBJ format (old version) 284 void MGL_EXPORT mgl_write_obj_old(HMGL gr, const char *fname,const char *descr, int use_png); 285 void MGL_EXPORT mgl_write_obj_old_(uintptr_t *gr, const char *fname,const char *descr, int *use_png,int,int); 286 /// Write the frame in file using STL format (faces only) 287 void MGL_EXPORT mgl_write_stl(HMGL gr, const char *fname,const char *descr); 288 void MGL_EXPORT mgl_write_stl_(uintptr_t *gr, const char *fname,const char *descr,int,int); 289 /// Write the frame in file using OFF format 290 void MGL_EXPORT mgl_write_off(HMGL gr, const char *fname,const char *descr, int colored); 291 void MGL_EXPORT mgl_write_off_(uintptr_t *gr, const char *fname,const char *descr,int *colored,int,int); 292 /// Write the frame in file using XYZ format 293 void MGL_EXPORT mgl_write_xyz(HMGL gr, const char *fname,const char *descr); 294 void MGL_EXPORT mgl_write_xyz_(uintptr_t *gr, const char *fname,const char *descr,int,int); 295 296 /*void MGL_EXPORT mgl_write_x3d(HMGL gr, const char *fname,const char *descr); 297 void MGL_EXPORT mgl_write_x3d_(uintptr_t *gr, const char *fname,const char *descr,int,int); 298 void MGL_EXPORT mgl_write_wgl(HMGL gr, const char *fname,const char *descr); 299 void MGL_EXPORT mgl_write_wgl_(uintptr_t *gr, const char *fname,const char *descr,int,int);*/ 300 301 /// Write the frame in file using PRC format 302 void MGL_EXPORT mgl_write_prc(HMGL gr, const char *fname,const char *descr, int make_pdf); 303 void MGL_EXPORT mgl_write_prc_(uintptr_t *gr, const char *fname,const char *descr, int *make_pdf,int,int); 304 /// Write the frame in file using GIF format (only for current frame!) 305 void MGL_EXPORT mgl_write_gif(HMGL gr, const char *fname,const char *descr); 306 void MGL_EXPORT mgl_write_gif_(uintptr_t *gr, const char *fname,const char *descr,int,int); 307 308 /// Start write frames to cinema using GIF format 309 void MGL_EXPORT mgl_start_gif(HMGL gr, const char *fname,int ms); 310 void MGL_EXPORT mgl_start_gif_(uintptr_t *gr, const char *fname,int *ms,int); 311 /// Stop writing cinema using GIF format 312 void MGL_EXPORT mgl_close_gif(HMGL gr); 313 void MGL_EXPORT mgl_close_gif_(uintptr_t *gr); 314 315 /// Export points and primitives in file using MGLD format 316 void MGL_EXPORT mgl_export_mgld(HMGL gr, const char *fname,const char *descr); 317 void MGL_EXPORT mgl_export_mgld_(uintptr_t *gr, const char *fname,const char *descr,int,int); 318 /// Import points and primitives from file using MGLD format 319 void MGL_EXPORT mgl_import_mgld(HMGL gr, const char *fname, int add); 320 void MGL_EXPORT mgl_import_mgld_(uintptr_t *gr, const char *fname, int *add, int); 321 /// Export in JSON format suitable for later drawing by JavaScript 322 void MGL_EXPORT mgl_write_json(HMGL gr, const char *fname,const char *descr); 323 void MGL_EXPORT mgl_write_json_(uintptr_t *gr, const char *fname,const char *descr,int,int); 324 void MGL_EXPORT mgl_write_json_z(HMGL gr, const char *fname,const char *descr); 325 void MGL_EXPORT mgl_write_json_z_(uintptr_t *gr, const char *fname,const char *descr,int,int); 326 MGL_EXPORT const char *mgl_get_json(HMGL gr); 327 328 /// Get RGB values of current bitmap 329 /** Position of element {i,j} is [3*i + 3*Width*j]. */ 330 MGL_EXPORT const unsigned char *mgl_get_rgb(HMGL gr); 331 MGL_EXPORT const unsigned char *mgl_get_rgb_(uintptr_t *gr); 332 /// Get RGBA values of current bitmap 333 /** Position of element {i,j} is [4*i + 4*Width*j]. */ 334 MGL_EXPORT const unsigned char *mgl_get_rgba(HMGL gr); 335 MGL_EXPORT const unsigned char *mgl_get_rgba_(uintptr_t *gr); 336 /// Get RGBA values of background image 337 /** Position of element {i,j} is [4*i + 4*Width*j]. */ 338 MGL_EXPORT_PURE const unsigned char *mgl_get_background(HMGL gr); 339 MGL_EXPORT_PURE const unsigned char *mgl_get_background_(uintptr_t *gr); 340 /// Set object/subplot id 341 void MGL_EXPORT mgl_set_obj_id(HMGL gr, int id); 342 void MGL_EXPORT mgl_set_obj_id_(uintptr_t *gr, int *id); 343 /// Get object id 344 int MGL_EXPORT_PURE mgl_get_obj_id(HMGL gr, int x, int y); 345 int MGL_EXPORT_PURE mgl_get_obj_id_(uintptr_t *gr, int *x, int *y); 346 /// Get subplot id 347 int MGL_EXPORT_PURE mgl_get_spl_id(HMGL gr, int x, int y); 348 int MGL_EXPORT_PURE mgl_get_spl_id_(uintptr_t *gr, int *x, int *y); 349 /// Get width of the image 350 int MGL_EXPORT mgl_get_width(HMGL gr); 351 int MGL_EXPORT mgl_get_width_(uintptr_t *gr); 352 /// Get height of the image 353 int MGL_EXPORT mgl_get_height(HMGL gr); 354 int MGL_EXPORT mgl_get_height_(uintptr_t *gr); 355 /// Calculate 3D coordinate {x,y,z} for screen point {xs,ys} 356 void MGL_EXPORT mgl_calc_xyz(HMGL gr, int xs, int ys, mreal *x, mreal *y, mreal *z); 357 void MGL_EXPORT mgl_calc_xyz_(uintptr_t *gr, int *xs, int *ys, mreal *x, mreal *y, mreal *z); 358 /// Calculate screen point {xs,ys} for 3D coordinate {x,y,z} 359 void MGL_EXPORT mgl_calc_scr(HMGL gr, double x, double y, double z, int *xs, int *ys); 360 void MGL_EXPORT mgl_calc_scr_(uintptr_t *gr, mreal *x, mreal *y, mreal *z, int *xs, int *ys); 361 /// Check if {xs,ys} is close to active point with accuracy d, and return its position or -1 362 long MGL_EXPORT_PURE mgl_is_active(HMGL gr, int xs, int ys, int d); 363 long MGL_EXPORT_PURE mgl_is_active_(uintptr_t *gr, int *xs, int *ys, int *d); 364 365 /// Create new frame. 366 int MGL_EXPORT mgl_new_frame(HMGL gr); 367 int MGL_EXPORT mgl_new_frame_(uintptr_t *gr); 368 /// Finish frame drawing 369 void MGL_EXPORT mgl_end_frame(HMGL gr); 370 void MGL_EXPORT mgl_end_frame_(uintptr_t *gr); 371 /// Get the number of created frames 372 int MGL_EXPORT_PURE mgl_get_num_frame(HMGL gr); 373 int MGL_EXPORT_PURE mgl_get_num_frame_(uintptr_t *gr); 374 /// Reset frames counter (start it from zero) 375 void MGL_EXPORT mgl_reset_frames(HMGL gr); 376 void MGL_EXPORT mgl_reset_frames_(uintptr_t *gr); 377 /// Get drawing data for i-th frame (work if MGL_VECT_FRAME is set on) 378 void MGL_EXPORT mgl_get_frame(HMGL gr, int i); 379 void MGL_EXPORT mgl_get_frame_(uintptr_t *gr, int *i); 380 /// Set drawing data for i-th frame (work if MGL_VECT_FRAME is set on) 381 void MGL_EXPORT mgl_set_frame(HMGL gr, int i); 382 void MGL_EXPORT mgl_set_frame_(uintptr_t *gr, int *i); 383 /// Append drawing data from i-th frame (work if MGL_VECT_FRAME is set on) 384 void MGL_EXPORT mgl_show_frame(HMGL gr, int i); 385 void MGL_EXPORT mgl_show_frame_(uintptr_t *gr, int *i); 386 /// Delete primitives for i-th frame (work if MGL_VECT_FRAME is set on) 387 void MGL_EXPORT mgl_del_frame(HMGL gr, int i); 388 void MGL_EXPORT mgl_del_frame_(uintptr_t *gr, int *i); 389 /// Clear list of primitives for current drawing 390 void MGL_EXPORT mgl_clear_frame(HMGL gr); 391 void MGL_EXPORT mgl_clear_frame_(uintptr_t *gr); 392 393 /// Set the transparency type (0 - usual, 1 - glass, 2 - lamp) 394 void MGL_EXPORT mgl_set_transp_type(HMGL gr, int kind); 395 void MGL_EXPORT mgl_set_transp_type_(uintptr_t *gr, int *kind); 396 /// Set the transparency on/off. 397 void MGL_EXPORT mgl_set_alpha(HMGL gr, int enable); 398 void MGL_EXPORT mgl_set_alpha_(uintptr_t *gr, int *enable); 399 /// Set the gray-scale mode on/off. 400 void MGL_EXPORT mgl_set_gray(HMGL gr, int enable); 401 void MGL_EXPORT mgl_set_gray_(uintptr_t *gr, int *enable); 402 /// Set the fog distance or switch it off (if d=0). 403 void MGL_EXPORT mgl_set_fog(HMGL gr, double d, double dz); 404 void MGL_EXPORT mgl_set_fog_(uintptr_t *gr, mreal *dist, mreal *dz); 405 /// Set the using of light on/off. 406 void MGL_EXPORT mgl_set_light(HMGL gr, int enable); 407 void MGL_EXPORT mgl_set_light_(uintptr_t *gr, int *enable); 408 /// Switch on/off the specified light source. 409 void MGL_EXPORT mgl_set_light_n(HMGL gr, int n, int enable); 410 void MGL_EXPORT mgl_set_light_n_(uintptr_t *gr, int *n, int *enable); 411 /// Set to attach light settings to inplot. 412 void MGL_EXPORT mgl_set_attach_light(HMGL gr, int enable); 413 void MGL_EXPORT mgl_set_attach_light_(uintptr_t *gr, int *enable); 414 415 /// Add white light source at infinity. 416 void MGL_EXPORT mgl_add_light(HMGL gr, int n, double x, double y, double z); 417 void MGL_EXPORT mgl_add_light_(uintptr_t *gr, int *n, mreal *x, mreal *y, mreal *z); 418 /// Add light source at infinity (more settings). 419 void MGL_EXPORT mgl_add_light_ext(HMGL gr, int n, double x, double y, double z, char c, double br, double ap); 420 void MGL_EXPORT mgl_add_light_ext_(uintptr_t *gr, int *n, mreal *x, mreal *y, mreal *z, char *c, mreal *br, mreal *ap, int); 421 /// Add local light source. 422 void MGL_EXPORT mgl_add_light_loc(HMGL gr, int n, double x, double y, double z, double dx, double dy, double dz, char c, double br, double ap); 423 void MGL_EXPORT mgl_add_light_loc_(uintptr_t *gr, int *n, mreal *x, mreal *y, mreal *z, mreal *dx, mreal *dy, mreal *dz, char *c, mreal *br, mreal *ap, int); 424 425 /// Pop transformation matrix from stack 426 void MGL_EXPORT mgl_mat_pop(HMGL gr); 427 void MGL_EXPORT mgl_mat_pop_(uintptr_t *gr); 428 /// Push transformation matrix into stack 429 void MGL_EXPORT mgl_mat_push(HMGL gr); 430 void MGL_EXPORT mgl_mat_push_(uintptr_t *gr); 431 432 /// Clear up the frame 433 void MGL_EXPORT mgl_clf(HMGL gr); 434 void MGL_EXPORT mgl_clf_(uintptr_t *gr); 435 /// Clear up the frame but keep fog settings 436 void MGL_EXPORT mgl_clf_nfog(HMGL gr); 437 void MGL_EXPORT mgl_clf_nfog_(uintptr_t *gr); 438 /// Clear up the frame and fill background by specified color 439 void MGL_EXPORT mgl_clf_rgb(HMGL gr, double r, double g, double b); 440 void MGL_EXPORT mgl_clf_rgb_(uintptr_t *gr, mreal *r, mreal *g, mreal *b); 441 /// Clear up the frame and fill background by specified color 442 void MGL_EXPORT mgl_clf_chr(HMGL gr, char col); 443 void MGL_EXPORT mgl_clf_chr_(uintptr_t *gr, const char *col, int); 444 /// Clear up the frame and fill background by specified color with manual transparency 445 void MGL_EXPORT mgl_clf_str(HMGL gr, const char *col); 446 void MGL_EXPORT mgl_clf_str_(uintptr_t *gr, const char *col, int); 447 /// Load background image 448 void MGL_EXPORT mgl_load_background(HMGL gr, const char *fname, double alpha); 449 void MGL_EXPORT mgl_load_background_(uintptr_t *gr, const char *fname, mreal *alpha, int); 450 /// Load background image 451 /** Parameter 'how' can be: 452 * 'a' for filling current subplot only; 453 * 's' for scaling (resizing) image to whole area; 454 * 'c' for centering image; 455 * 'm' for tessellate image as mosaic. */ 456 void MGL_EXPORT mgl_load_background_ext(HMGL gr, const char *fname, const char *how, double alpha); 457 void MGL_EXPORT mgl_load_background_ext_(uintptr_t *gr, const char *fname, const char *how, mreal *alpha, int,int); 458 /// Fill background by specified color. Colors r,g,b should be in range [0,1]. 459 void MGL_EXPORT mgl_fill_background(HMGL gr, double r, double g, double b); 460 void MGL_EXPORT mgl_fill_background_(uintptr_t *gr, double *r, double *g, double *b); 461 462 /// Put further plotting in m-th cell of nx*ny grid of the image. 463 /** String \a style may contain: 464 * '<' for reserving space at left 465 * '>' for reserving space at right 466 * '^' for reserving space at top 467 * '_' for reserving space at bottom 468 * '#' for using whole region. */ 469 void MGL_EXPORT mgl_subplot(HMGL gr, int nx,int ny,int m,const char *style); 470 void MGL_EXPORT mgl_subplot_(uintptr_t *gr, int *nx,int *ny,int *m, const char *s,int); 471 /// Put further plotting in m-th cell of nx*ny grid of the image and shift it by distance {dx,dy}. 472 /** String \a style may contain: 473 * '<' for reserving space at left 474 * '>' for reserving space at right 475 * '^' for reserving space at top 476 * '_' for reserving space at bottom 477 * '#' for using whole region. */ 478 void MGL_EXPORT mgl_subplot_d(HMGL gr, int nx,int ny,int m,const char *style, double dx, double dy); 479 void MGL_EXPORT mgl_subplot_d_(uintptr_t *gr, int *nx,int *ny,int *m,const char *style, mreal *dx, mreal *dy,int l); 480 /// Put further plotting in rectangle of dx*dy cells starting from m-th cell of nx*ny grid of the image. 481 /** String \a style may contain: 482 * '<' for reserving space at left 483 * '>' for reserving space at right 484 * '^' for reserving space at top 485 * '_' for reserving space at bottom 486 * '#' for using whole region. */ 487 void MGL_EXPORT mgl_multiplot(HMGL gr, int nx,int ny,int m,int dx,int dy,const char *style); 488 void MGL_EXPORT mgl_multiplot_(uintptr_t *gr, int *nx,int *ny,int *m,int *dx,int *dy, const char *s,int); 489 /// Put further plotting in rectangle of dx*dy cells starting from m-th cell of nx*ny grid of the image and shift it by distance {sx,sy}.. 490 /** String \a style may contain: 491 * '<' for reserving space at left 492 * '>' for reserving space at right 493 * '^' for reserving space at top 494 * '_' for reserving space at bottom 495 * '#' for using whole region. */ 496 void MGL_EXPORT mgl_multiplot_d(HMGL gr, int nx,int ny,int m,int dx,int dy,const char *style,double sx,double sy); 497 void MGL_EXPORT mgl_multiplot_d_(uintptr_t *gr, int *nx,int *ny,int *m,int *dx,int *dy, const char *s, mreal *sx, mreal *sy,int); 498 /// Put further plotting in a region [x1,x2]*[y1,y2] of the image (x1,x2,y1,y2 in range [0, 1]). 499 void MGL_EXPORT mgl_inplot(HMGL gr, double x1,double x2,double y1,double y2); 500 void MGL_EXPORT mgl_inplot_(uintptr_t *gr, mreal *x1, mreal *x2, mreal *y1, mreal *y2); 501 /// Put further plotting in a region [x1,x2]*[y1,y2] of the subplot (x1,x2,y1,y2 in range [0, 1]). 502 void MGL_EXPORT mgl_relplot(HMGL gr, double x1,double x2,double y1,double y2); 503 void MGL_EXPORT mgl_relplot_(uintptr_t *gr, mreal *x1, mreal *x2, mreal *y1, mreal *y2); 504 /// Put further plotting in column cell of previous subplot/inplot. 505 void MGL_EXPORT mgl_columnplot(HMGL gr, int num, int ind, double d); 506 void MGL_EXPORT mgl_columnplot_(uintptr_t *gr, int *num, int *i, mreal *d); 507 /// Put further plotting in matrix cell of previous subplot/inplot. 508 void MGL_EXPORT mgl_gridplot(HMGL gr, int nx, int ny, int m, double d); 509 void MGL_EXPORT mgl_gridplot_(uintptr_t *gr, int *nx, int *ny, int *m, mreal *d); 510 /// Put further plotting in cell of stick rotated on angles tet, phi. 511 void MGL_EXPORT mgl_stickplot(HMGL gr, int num, int ind, double tet, double phi); 512 void MGL_EXPORT mgl_stickplot_(uintptr_t *gr, int *num, int *i, mreal *tet, mreal *phi); 513 /// Put further plotting in cell of stick sheared on sx, sy. 514 void MGL_EXPORT mgl_shearplot(HMGL gr, int num, int ind, double sx, double sy, double xd, double yd); 515 void MGL_EXPORT mgl_shearplot_(uintptr_t *gr, int *num, int *i, mreal *sy, mreal *sx, mreal *xd, mreal *yd); 516 /// Add title for current subplot/inplot. 517 /** Style '#' draw box around the title. */ 518 void MGL_EXPORT mgl_title(HMGL gr, const char *title, const char *stl, double size); 519 void MGL_EXPORT mgl_title_(uintptr_t *gr, const char *title, const char *stl, mreal *size, int,int); 520 void MGL_EXPORT mgl_titlew(HMGL gr, const wchar_t *title, const char *stl, double size); 521 /// Set factor of plot size 522 void MGL_EXPORT mgl_set_plotfactor(HMGL gr, double val); 523 void MGL_EXPORT mgl_set_plotfactor_(uintptr_t *gr, mreal *val); 524 525 /// Set aspect ratio for further plotting. 526 void MGL_EXPORT mgl_aspect(HMGL gr, double Ax,double Ay,double Az); 527 void MGL_EXPORT mgl_aspect_(uintptr_t *gr, mreal *Ax, mreal *Ay, mreal *Az); 528 /// Set aspect ratio for further plotting. 529 void MGL_EXPORT mgl_shear(HMGL gr, double Sx,double Sz); 530 void MGL_EXPORT mgl_shear_(uintptr_t *gr, mreal *Sx, mreal *Sy); 531 /// Rotate a further plotting. 532 void MGL_EXPORT mgl_rotate(HMGL gr, double TetX,double TetZ,double TetY); 533 void MGL_EXPORT mgl_rotate_(uintptr_t *gr, mreal *TetX, mreal *TetZ, mreal *TetY); 534 /// Rotate a further plotting around vector {x,y,z}. 535 void MGL_EXPORT mgl_rotate_vector(HMGL gr, double Tet,double x,double y,double z); 536 void MGL_EXPORT mgl_rotate_vector_(uintptr_t *gr, mreal *Tet, mreal *x, mreal *y, mreal *z); 537 /// Set perspective (in range [0,1)) for plot. Set to zero for switching off. 538 void MGL_EXPORT mgl_perspective(HMGL gr, double val); 539 void MGL_EXPORT mgl_perspective_(uintptr_t *gr, mreal *val); 540 /// Ask to set perspective (in range [0,1)) for plot. Set to zero for switching off. 541 void MGL_EXPORT mgl_ask_perspective(HMGL gr, double val); 542 void MGL_EXPORT mgl_ask_perspective_(uintptr_t *gr, mreal *val); 543 /// Set angle of view independently from Rotate(). 544 void MGL_EXPORT mgl_view(HMGL gr, double TetX,double TetZ,double TetY); 545 void MGL_EXPORT mgl_view_(uintptr_t *gr, mreal *TetX, mreal *TetZ, mreal *TetY); 546 /// Zoom in/out a part of picture (use mgl_zoom(0, 0, 1, 1) for restore default) 547 void MGL_EXPORT mgl_zoom(HMGL gr, double x1, double y1, double x2, double y2); 548 void MGL_EXPORT mgl_zoom_(uintptr_t *gr, mreal *x1, mreal *y1, mreal *x2, mreal *y2); 549 550 //----------------------------------------------------------------------------- 551 552 /// Create HMPR object for parsing MGL scripts 553 HMPR MGL_EXPORT mgl_create_parser(); 554 uintptr_t MGL_EXPORT mgl_create_parser_(); 555 /// Change counter of HMPR uses (for advanced users only). Non-zero counter prevent automatic object removing. 556 long MGL_EXPORT mgl_use_parser(HMPR p, int inc); 557 long MGL_EXPORT mgl_use_parser_(uintptr_t* , int *inc); 558 /// Delete HMPR object 559 void MGL_EXPORT mgl_delete_parser(HMPR p); 560 void MGL_EXPORT mgl_delete_parser_(uintptr_t* p); 561 /// Set value for parameter $N 562 void MGL_EXPORT mgl_parser_add_param(HMPR p, int id, const char *str); 563 void MGL_EXPORT mgl_parser_add_param_(uintptr_t* p, int *id, const char *str, int); 564 void MGL_EXPORT mgl_parser_add_paramw(HMPR p, int id, const wchar_t *str); 565 566 /// Find variable with given name or add a new one 567 /// NOTE !!! You must not delete obtained data arrays !!! 568 MGL_EXPORT mglDataA *mgl_parser_add_var(HMPR p, const char *name); 569 uintptr_t MGL_EXPORT mgl_parser_add_var_(uintptr_t* p, const char *name, int); 570 MGL_EXPORT mglDataA *mgl_parser_add_varw(HMPR p, const wchar_t *name); 571 /// Find variable with given name or return NULL if no one 572 /// NOTE !!! You must not delete obtained data arrays !!! 573 MGL_EXPORT_PURE mglDataA *mgl_parser_find_var(HMPR p, const char *name); 574 uintptr_t MGL_EXPORT mgl_parser_find_var_(uintptr_t* p, const char *name, int); 575 MGL_EXPORT_PURE mglDataA *mgl_parser_find_varw(HMPR p, const wchar_t *name); 576 /// Get variable with given id 577 /// NOTE !!! You must not delete obtained data arrays !!! 578 MGL_EXPORT_PURE mglDataA *mgl_parser_get_var(HMPR p, unsigned long id); 579 uintptr_t MGL_EXPORT_PURE mgl_parser_get_var_(uintptr_t* p, unsigned long *id); 580 /// Get number of variables 581 long MGL_EXPORT_PURE mgl_parser_num_var(HMPR p); 582 long MGL_EXPORT_PURE mgl_parser_num_var_(uintptr_t* p); 583 584 /// Get constant with given id 585 /// NOTE !!! You must not delete obtained data arrays !!! 586 MGL_EXPORT_PURE mglNum *mgl_parser_get_const(HMPR p, unsigned long id); 587 uintptr_t MGL_EXPORT_PURE mgl_parser_get_const_(uintptr_t* p, unsigned long *id); 588 /// Get number of constants 589 long MGL_EXPORT_PURE mgl_parser_num_const(HMPR p); 590 long MGL_EXPORT_PURE mgl_parser_num_const_(uintptr_t* p); 591 592 /// Delete variable with name 593 void MGL_EXPORT mgl_parser_del_var(HMPR p, const char *name); 594 void MGL_EXPORT mgl_parser_del_var_(uintptr_t* p, const char *name, int); 595 void MGL_EXPORT mgl_parser_del_varw(HMPR p, const wchar_t *name); 596 /// Delete all data variables 597 void MGL_EXPORT mgl_parser_del_all(HMPR p); 598 void MGL_EXPORT mgl_parser_del_all_(uintptr_t *p); 599 600 /// Load new commands from external dynamic Library (must have "const mglCommand *mgl_cmd_extra" variable) 601 void MGL_EXPORT mgl_parser_load(HMPR pr, const char *dll_name); 602 void MGL_EXPORT mgl_parser_load_(uintptr_t *pr, const char *dll_name,int); 603 604 /// Apply one step for equation d vars[i]/dt = eqs[i] using Runge-Kutta method 605 void MGL_EXPORT mgl_rk_step(HMPR pr, const char *eqs, const char *vars, mreal dt); 606 void MGL_EXPORT mgl_rk_step_w(HMPR pr, const wchar_t *eqs, const wchar_t *vars, mreal dt); 607 void MGL_EXPORT mgl_rk_step_(uintptr_t *p, const char *eqs, const char *vars, double *dt, int,int); 608 609 // Open all data arrays from HDF file and assign it as variables of parser p 610 void MGL_EXPORT mgl_parser_openhdf(HMPR p, const char *fname); 611 void MGL_EXPORT mgl_parser_openhdf_(uintptr_t *p, const char *fname,int l); 612 613 /// Parse and draw single line of the MGL script 614 int MGL_EXPORT mgl_parse_line(HMGL gr, HMPR p, const char *str, int pos); 615 int MGL_EXPORT mgl_parse_line_(uintptr_t* gr, uintptr_t* p, const char *str, int *pos, int); 616 int MGL_EXPORT mgl_parse_linew(HMGL gr, HMPR p, const wchar_t *str, int pos); 617 /// Execute and draw script from the file 618 void MGL_EXPORT mgl_parse_file(HMGL gr, HMPR p, FILE *fp, int print); 619 /// Execute MGL script text with '\n' separated lines 620 void MGL_EXPORT mgl_parse_text(HMGL gr, HMPR p, const char *str); 621 void MGL_EXPORT mgl_parse_text_(uintptr_t* gr, uintptr_t* p, const char *str, int); 622 void MGL_EXPORT mgl_parse_textw(HMGL gr, HMPR p, const wchar_t *str); 623 624 /// Restore once flag 625 void MGL_EXPORT mgl_parser_restore_once(HMPR p); 626 void MGL_EXPORT mgl_parser_restore_once_(uintptr_t* p); 627 /// Allow changing size of the picture 628 void MGL_EXPORT mgl_parser_allow_setsize(HMPR p, int a); 629 void MGL_EXPORT mgl_parser_allow_setsize_(uintptr_t* p, int *a); 630 /// Allow reading/saving files 631 void MGL_EXPORT mgl_parser_allow_file_io(HMPR p, int a); 632 void MGL_EXPORT mgl_parser_allow_file_io_(uintptr_t* p, int *a); 633 /// Allow loading commands from external libraries 634 void MGL_EXPORT mgl_parser_allow_dll_call(HMPR p, int a); 635 void MGL_EXPORT mgl_parser_allow_dll_call_(uintptr_t* p, int *a); 636 /// Set flag to stop script parsing 637 void MGL_EXPORT mgl_parser_stop(HMPR p); 638 void MGL_EXPORT mgl_parser_stop_(uintptr_t* p); 639 /// Set variant of argument(s) separated by '?' to be used 640 void MGL_EXPORT mgl_parser_variant(HMPR p, int var); 641 void MGL_EXPORT mgl_parser_variant_(uintptr_t* p, int *var); 642 /// Set starting object ID 643 void MGL_EXPORT mgl_parser_start_id(HMPR p, int id); 644 void MGL_EXPORT mgl_parser_start_id_(uintptr_t* p, int *id); 645 646 647 /// Return type of command: 0 - not found, 1 - data plot, 2 - other plot, 648 /// 3 - setup, 4 - data handle, 5 - data create, 6 - subplot, 7 - program 649 /// 8 - 1d plot, 9 - 2d plot, 10 - 3d plot, 11 - dd plot, 12 - vector plot 650 /// 13 - axis, 14 - primitives, 15 - axis setup, 16 - text/legend, 17 - data transform 651 int MGL_EXPORT_PURE mgl_parser_cmd_type(HMPR pr, const char *name); 652 int MGL_EXPORT_PURE mgl_parser_cmd_type_(uintptr_t* p, const char *name, int); 653 /// Return description of MGL command 654 MGL_EXPORT_PURE const char *mgl_parser_cmd_desc(HMPR pr, const char *name); 655 /// Return string of command format (command name and its argument[s]) 656 MGL_EXPORT_PURE const char *mgl_parser_cmd_frmt(HMPR pr, const char *name); 657 /// Get name of command with number n 658 MGL_EXPORT_PURE const char *mgl_parser_cmd_name(HMPR pr, long id); 659 /// Get number of defined commands 660 long MGL_EXPORT_PURE mgl_parser_cmd_num(HMPR pr); 661 662 /// Return result of formula evaluation 663 HMDT MGL_EXPORT mgl_parser_calc(HMPR pr, const char *formula); 664 uintptr_t MGL_EXPORT mgl_parser_calc_(uintptr_t *pr, const char *formula,int); 665 HMDT MGL_EXPORT mgl_parser_calcw(HMPR pr, const wchar_t *formula); 666 /// Return result of formula evaluation as complex data 667 HADT MGL_EXPORT mgl_parser_calc_complex(HMPR pr, const char *formula); 668 uintptr_t MGL_EXPORT mgl_parser_calc_complex_(uintptr_t *pr, const char *formula,int); 669 HADT MGL_EXPORT mgl_parser_calc_complexw(HMPR pr, const wchar_t *formula); 670 671 #ifdef __cplusplus 672 } 673 #endif 674 //----------------------------------------------------------------------------- 675 #endif 676