├── .github └── workflows │ └── build.yml ├── .gitignore ├── .scripts ├── build.sh ├── deploy.sh ├── install-freemint.sh ├── install_ssh_id.sh └── setup_env.sh ├── .travis.yml ├── .travis ├── install.sh └── script.sh ├── BINFILES ├── CONFIGVARS ├── ChangeLog ├── ChangeLog.422 ├── ChangeLog.MGL ├── ChangeLog.old ├── DEPENDENCIES ├── Doxyfile.in ├── EXTRAFILES ├── HOWTO_RELEASE ├── MISCFILES ├── Makefile ├── PHONY ├── README.md ├── RULES ├── SRCFILES ├── VERSION ├── _gc_aes.c ├── _gc_vdi.c ├── _gc_vq_gdos.c ├── _gc_vq_vgdos.c ├── _lc_asm.s ├── _pc_asm.s ├── _sx_asm.s ├── a__appl_yield.c ├── a_appl_bvset.c ├── a_appl_control.c ├── a_appl_exit.c ├── a_appl_find.c ├── a_appl_getcicon.c ├── a_appl_getinfo.c ├── a_appl_getinfo_str.c ├── a_appl_init.c ├── a_appl_init_st.c ├── a_appl_options.c ├── a_appl_read.c ├── a_appl_search.c ├── a_appl_tplay.c ├── a_appl_trecord.c ├── a_appl_write.c ├── a_appl_yield.c ├── a_evnt_button.c ├── a_evnt_dclick.c ├── a_evnt_keybd.c ├── a_evnt_mesag.c ├── a_evnt_mouse.c ├── a_evnt_multi.c ├── a_evnt_multi_fast.c ├── a_evnt_timer.c ├── a_form_alert.c ├── a_form_button.c ├── a_form_center.c ├── a_form_center_grect.c ├── a_form_dial.c ├── a_form_dial_grect.c ├── a_form_do.c ├── a_form_error.c ├── a_form_keybd.c ├── a_fsel_boxinput.c ├── a_fsel_exinput.c ├── a_fsel_input.c ├── a_glue.c ├── a_graf_dragbox.c ├── a_graf_growbox.c ├── a_graf_growbox_grect.c ├── a_graf_handle.c ├── a_graf_mbox.c ├── a_graf_mkstate.c ├── a_graf_mouse.c ├── a_graf_multirubber.c ├── a_graf_rubbox.c ├── a_graf_shrinkbox.c ├── a_graf_shrinkbox_grect.c ├── a_graf_slidebox.c ├── a_graf_watchbox.c ├── a_graf_wwatchbox.c ├── a_graf_xhandle.c ├── a_menu_attach.c ├── a_menu_bar.c ├── a_menu_click.c ├── a_menu_icheck.c ├── a_menu_ienable.c ├── a_menu_istart.c ├── a_menu_popup.c ├── a_menu_register.c ├── a_menu_settings.c ├── a_menu_text.c ├── a_menu_tnormal.c ├── a_menu_unregister.c ├── a_objc_add.c ├── a_objc_change.c ├── a_objc_change_grect.c ├── a_objc_delete.c ├── a_objc_draw.c ├── a_objc_draw_grect.c ├── a_objc_edit.c ├── a_objc_find.c ├── a_objc_offset.c ├── a_objc_order.c ├── a_objc_sysvar.c ├── a_objc_xfind.c ├── a_rsrc_free.c ├── a_rsrc_gaddr.c ├── a_rsrc_load.c ├── a_rsrc_obfix.c ├── a_rsrc_rcfix.c ├── a_rsrc_saddr.c ├── a_scrp_clear.c ├── a_scrp_read.c ├── a_scrp_write.c ├── a_shel_envrn.c ├── a_shel_find.c ├── a_shel_get.c ├── a_shel_help.c ├── a_shel_put.c ├── a_shel_rdef.c ├── a_shel_read.c ├── a_shel_wdef.c ├── a_shel_write.c ├── a_wind_calc.c ├── a_wind_calc_grect.c ├── a_wind_close.c ├── a_wind_create.c ├── a_wind_create_grect.c ├── a_wind_delete.c ├── a_wind_draw.c ├── a_wind_find.c ├── a_wind_get.c ├── a_wind_get_grect.c ├── a_wind_get_int.c ├── a_wind_get_ptr.c ├── a_wind_new.c ├── a_wind_open.c ├── a_wind_open_grect.c ├── a_wind_set.c ├── a_wind_set_grect.c ├── a_wind_set_int.c ├── a_wind_set_ptr.c ├── a_wind_set_ptr_int.c ├── a_wind_set_str.c ├── a_wind_sget.c ├── a_wind_update.c ├── a_wind_xcreate.c ├── a_wind_xcreate_grect.c ├── a_wind_xget_grect.c ├── a_wind_xset_grect.c ├── doxydoc.c ├── files.mak ├── gcc.mak ├── gcc281-16.mak ├── gcc281.mak ├── gem.h ├── gem_aesP.h ├── gem_vdiP.h ├── gemlib.spec.in ├── gemx.h ├── globals.c ├── include ├── README ├── gcc281 │ └── compiler.h ├── lattice │ └── compiler.h ├── purec │ └── compiler.h ├── sozobon │ └── compiler.h └── vbcc │ └── compiler.h ├── lat.mak ├── mt_gem.h.in ├── mt_gemx.h ├── n_v_bez.c ├── n_v_bez_off.c ├── n_v_bez_on.c ├── n_v_bez_qual.c ├── n_v_clsbm.c ├── n_v_color2nearest.c ├── n_v_color2value.c ├── n_v_create_ctab.c ├── n_v_create_driver_info.c ├── n_v_create_itab.c ├── n_v_ctab_idx2value.c ├── n_v_ctab_idx2vdi.c ├── n_v_ctab_vdi2idx.c ├── n_v_delete_ctab.c ├── n_v_delete_driver_info.c ├── n_v_delete_itab.c ├── n_v_ftext.c ├── n_v_ftext16.c ├── n_v_ftext16n.c ├── n_v_ftext_offset.c ├── n_v_ftext_offset16.c ├── n_v_ftext_offset16n.c ├── n_v_ftextn.c ├── n_v_get_ctab_id.c ├── n_v_get_outline.c ├── n_v_getbitmap_info.c ├── n_v_getoutline.c ├── n_v_open_bm.c ├── n_v_opnbm.c ├── n_v_opnprn.c ├── n_v_read_default_settings.c ├── n_v_resize_bm.c ├── n_v_setrgb.c ├── n_v_value2color.c ├── n_v_write_default_settings.c ├── n_vq_bit_image.c ├── n_vq_ctab.c ├── n_vq_ctab_entry.c ├── n_vq_ctab_id.c ├── n_vq_devinfo.c ├── n_vq_dflt_ctab.c ├── n_vq_driver_info.c ├── n_vq_ext_devinfo.c ├── n_vq_hilite_color.c ├── n_vq_image_type.c ├── n_vq_margins.c ├── n_vq_max_color.c ├── n_vq_min_color.c ├── n_vq_prn_scaling.c ├── n_vq_px_format.c ├── n_vq_scrninfo.c ├── n_vq_weight_color.c ├── n_vqf_bg_color.c ├── n_vqf_fg_color.c ├── n_vql_bg_color.c ├── n_vql_fg_color.c ├── n_vqm_bg_color.c ├── n_vqm_fg_color.c ├── n_vqr_bg_color.c ├── n_vqr_fg_color.c ├── n_vqt_advance.c ├── n_vqt_advance32.c ├── n_vqt_bg_color.c ├── n_vqt_char_index.c ├── n_vqt_devinfo.c ├── n_vqt_ext_name.c ├── n_vqt_f_extent.c ├── n_vqt_f_extent16.c ├── n_vqt_f_extent16n.c ├── n_vqt_f_extentn.c ├── n_vqt_fg_color.c ├── n_vqt_fontheader.c ├── n_vqt_name_and_id.c ├── n_vqt_pairkern.c ├── n_vqt_real_extent.c ├── n_vqt_real_extent16n.c ├── n_vqt_real_extentn.c ├── n_vqt_trackkern.c ├── n_vqt_xfntinfo.c ├── n_vr_transfer_bits.c ├── n_vs_crop.c ├── n_vs_ctab.c ├── n_vs_ctab_entry.c ├── n_vs_dflt_ctab.c ├── n_vs_document_info.c ├── n_vs_hilite_color.c ├── n_vs_load_disp_list.c ├── n_vs_max_color.c ├── n_vs_min_color.c ├── n_vs_page_info.c ├── n_vs_save_disp_list.c ├── n_vs_weight_color.c ├── n_vsf_bg_color.c ├── n_vsf_fg_color.c ├── n_vsl_bg_color.c ├── n_vsl_fg_color.c ├── n_vsm_bg_color.c ├── n_vsm_fg_color.c ├── n_vsr_bg_color.c ├── n_vsr_fg_color.c ├── n_vst_arbpt.c ├── n_vst_arbpt32.c ├── n_vst_bg_color.c ├── n_vst_charmap.c ├── n_vst_fg_color.c ├── n_vst_kern.c ├── n_vst_map_mode.c ├── n_vst_name.c ├── n_vst_setsize.c ├── n_vst_setsize32.c ├── n_vst_skew.c ├── n_vst_track_offset.c ├── n_vst_width.c ├── pc.mak ├── pdlg_add_printers.c ├── pdlg_add_sub_dlgs.c ├── pdlg_close.c ├── pdlg_create.c ├── pdlg_delete.c ├── pdlg_dflt_sett.c ├── pdlg_do.c ├── pdlg_evnt.c ├── pdlg_free_sett.c ├── pdlg_get_setsize.c ├── pdlg_new_sett.c ├── pdlg_open.c ├── pdlg_rmv_printers.c ├── pdlg_rmv_sub_dlgs.c ├── pdlg_save_dflt_sett.c ├── pdlg_update.c ├── pdlg_use_sett.c ├── pdlg_validate_sett.c ├── rc_array_to_grect.c ├── rc_copy.c ├── rc_equal.c ├── rc_grect_to_array.c ├── rc_intersect.c ├── sox.mak ├── u_v_alpha_text.c ├── u_v_bez.c ├── u_v_bit_image.c ├── u_v_curtext.c ├── u_v_ftext.c ├── u_v_ftext_offset.c ├── u_v_ftext_offset16.c ├── u_v_ftext_offset16n.c ├── u_v_ftextn.c ├── u_v_gtext.c ├── u_v_justified.c ├── u_v_loadcache.c ├── u_v_savecache.c ├── u_vm_filename.c ├── u_vq_devinfo.c ├── u_vq_hilite_color.c ├── u_vqt_extent.c ├── u_vqt_f_extent.c ├── u_vqt_f_extentn.c ├── u_vqt_fontheader.c ├── u_vqt_name_and_id.c ├── u_vqt_real_extent.c ├── u_vqt_real_extentn.c ├── u_vrq_string.c ├── u_vs_document_info.c ├── u_vsm_string.c ├── u_vst_error.c ├── u_vst_name.c ├── v_alpha_text.c ├── v_alpha_text16n.c ├── v_arc.c ├── v_bar.c ├── v_bit_image.c ├── v_cellarray.c ├── v_circle.c ├── v_clear_disp_list.c ├── v_clrwk.c ├── v_clsvwk.c ├── v_clswk.c ├── v_contourfill.c ├── v_copies.c ├── v_curdown.c ├── v_curhome.c ├── v_curleft.c ├── v_curright.c ├── v_curtext.c ├── v_curtext16n.c ├── v_curup.c ├── v_dspcur.c ├── v_eeol.c ├── v_eeos.c ├── v_ellarc.c ├── v_ellipse.c ├── v_ellpie.c ├── v_enter_cur.c ├── v_escape2000.c ├── v_exit_cur.c ├── v_fillarea.c ├── v_flushcache.c ├── v_fontinit.c ├── v_form_adv.c ├── v_get_pixel.c ├── v_gtext.c ├── v_gtext16.c ├── v_gtext16n.c ├── v_gtextn.c ├── v_hardcopy.c ├── v_hide_c.c ├── v_justified.c ├── v_justified16n.c ├── v_loadcache.c ├── v_meta_extents.c ├── v_offset.c ├── v_opnvwk.c ├── v_opnwk.c ├── v_orient.c ├── v_output_window.c ├── v_page_size.c ├── v_pieslice.c ├── v_pline.c ├── v_pmarker.c ├── v_rbox.c ├── v_rfbox.c ├── v_rmcur.c ├── v_rvoff.c ├── v_rvon.c ├── v_savecache.c ├── v_set_app_buff.c ├── v_show_c.c ├── v_sound.c ├── v_trays.c ├── v_updwk.c ├── v_write_meta.c ├── vbcc.mak ├── vdi_array2str.c ├── vdi_dummy.c ├── vdi_str2array.c ├── vdi_userdef.c ├── vdi_userdef.h ├── vdi_wstrlen.c ├── vex_butv.c ├── vex_curv.c ├── vex_motv.c ├── vex_timv.c ├── vex_wheelv.c ├── vm_coords.c ├── vm_filename.c ├── vm_pagesize.c ├── vq_calibrate.c ├── vq_cellarray.c ├── vq_chcells.c ├── vq_color.c ├── vq_curaddress.c ├── vq_extnd.c ├── vq_key_s.c ├── vq_mouse.c ├── vq_page_name.c ├── vq_scan.c ├── vq_tabstatus.c ├── vq_tdimensions.c ├── vq_tray_names.c ├── vqf_attributes.c ├── vqin_mode.c ├── vql_attributes.c ├── vqm_attributes.c ├── vqp_filmname.c ├── vqt_attributes.c ├── vqt_cachesize.c ├── vqt_extent.c ├── vqt_extent16.c ├── vqt_extent16n.c ├── vqt_extentn.c ├── vqt_fontinfo.c ├── vqt_get_table.c ├── vqt_name.c ├── vqt_width.c ├── vr_recfl.c ├── vr_trnfm.c ├── vro_cpyfm.c ├── vrq_choice.c ├── vrq_locator.c ├── vrq_string.c ├── vrq_valuator.c ├── vrt_cpyfm.c ├── vs_calibrate.c ├── vs_clip.c ├── vs_clip_off.c ├── vs_clip_pxy.c ├── vs_color.c ├── vs_curaddress.c ├── vs_mute.c ├── vs_palette.c ├── vsc_expose.c ├── vsc_form.c ├── vsf_color.c ├── vsf_interior.c ├── vsf_perimeter.c ├── vsf_style.c ├── vsf_udpat.c ├── vsf_xperimeter.c ├── vsin_mode.c ├── vsl_color.c ├── vsl_ends.c ├── vsl_type.c ├── vsl_udsty.c ├── vsl_width.c ├── vsm_choice.c ├── vsm_color.c ├── vsm_height.c ├── vsm_locator.c ├── vsm_string.c ├── vsm_type.c ├── vsm_valuator.c ├── vsp_film.c ├── vst_alignment.c ├── vst_color.c ├── vst_effects.c ├── vst_error.c ├── vst_font.c ├── vst_height.c ├── vst_load_fonts.c ├── vst_point.c ├── vst_rotation.c ├── vst_scratch.c ├── vst_unload_fonts.c ├── vswr_mode.c ├── vt_alignment.c ├── vt_axis.c ├── vt_origin.c ├── vt_resolution.c ├── x_appl_flags.c ├── x_appl_font.c ├── x_appl_sleep.c ├── x_appl_term.c ├── x_appl_tplay.c ├── x_appl_trecord.c ├── x_edit_close.c ├── x_edit_create.c ├── x_edit_cursor.c ├── x_edit_delete.c ├── x_edit_evnt.c ├── x_edit_get_buf.c ├── x_edit_get_colour.c ├── x_edit_get_cursor.c ├── x_edit_get_dirty.c ├── x_edit_get_font.c ├── x_edit_get_format.c ├── x_edit_get_pos.c ├── x_edit_get_scrollinfo.c ├── x_edit_get_sel.c ├── x_edit_open.c ├── x_edit_resized.c ├── x_edit_scroll.c ├── x_edit_set_buf.c ├── x_edit_set_colour.c ├── x_edit_set_cursor.c ├── x_edit_set_dirty.c ├── x_edit_set_font.c ├── x_edit_set_format.c ├── x_edit_set_pos.c ├── x_evnt_multi.c ├── x_fnts_add.c ├── x_fnts_close.c ├── x_fnts_create.c ├── x_fnts_delete.c ├── x_fnts_do.c ├── x_fnts_evnt.c ├── x_fnts_get_info.c ├── x_fnts_get_name.c ├── x_fnts_get_no_styles.c ├── x_fnts_get_style.c ├── x_fnts_open.c ├── x_fnts_remove.c ├── x_fnts_update.c ├── x_form_center.c ├── x_form_error.c ├── x_form_filename.c ├── x_form_mouse.c ├── x_form_popup.c ├── x_form_wbutton.c ├── x_form_wkeybd.c ├── x_form_xdial.c ├── x_form_xdial_grect.c ├── x_form_xdo.c ├── x_form_xerr.c ├── x_fsel_input.c ├── x_fslx_close.c ├── x_fslx_do.c ├── x_fslx_evnt.c ├── x_fslx_getnxtfile.c ├── x_fslx_open.c ├── x_fslx_set_flags.c ├── x_graf_blit.c ├── x_graf_rast2rez.c ├── x_graf_rubberbox.c ├── x_help.c ├── x_lbox_ascroll_to.c ├── x_lbox_bscroll_to.c ├── x_lbox_cnt_items.c ├── x_lbox_create.c ├── x_lbox_delete.c ├── x_lbox_do.c ├── x_lbox_free_items.c ├── x_lbox_free_list.c ├── x_lbox_get_afirst.c ├── x_lbox_get_bentries.c ├── x_lbox_get_bfirst.c ├── x_lbox_get_bvis.c ├── x_lbox_get_idx.c ├── x_lbox_get_item.c ├── x_lbox_get_items.c ├── x_lbox_get_slct_idx.c ├── x_lbox_get_slct_item.c ├── x_lbox_get_tree.c ├── x_lbox_get_udata.c ├── x_lbox_get_visible.c ├── x_lbox_set_asldr.c ├── x_lbox_set_bentries.c ├── x_lbox_set_bsldr.c ├── x_lbox_set_items.c ├── x_lbox_update.c ├── x_malloc.c ├── x_mfree.c ├── x_mshrink.c ├── x_objc_edit.c ├── x_objc_wchange.c ├── x_objc_wdraw.c ├── x_objc_wedit.c ├── x_objc_xedit.c ├── x_realloc.c ├── x_scrp_get.c ├── x_settings.c ├── x_shel_get.c ├── x_shel_put.c ├── x_sprintf.c ├── x_sscanf.c ├── x_wdial_change.c ├── x_wdial_draw.c ├── x_wdlg_close.c ├── x_wdlg_create.c ├── x_wdlg_delete.c ├── x_wdlg_evnt.c ├── x_wdlg_get_edit.c ├── x_wdlg_get_handle.c ├── x_wdlg_get_tree.c ├── x_wdlg_get_udata.c ├── x_wdlg_open.c ├── x_wdlg_redraw.c ├── x_wdlg_set_edit.c ├── x_wdlg_set_iconify.c ├── x_wdlg_set_size.c ├── x_wdlg_set_tree.c ├── x_wdlg_set_uniconify.c ├── x_wind_calc.c ├── x_wind_create.c ├── x_wind_tree.c ├── x_xfrm_popup.c └── zip.mak /.gitignore: -------------------------------------------------------------------------------- 1 | .deps 2 | .lib* 3 | mt_gem.h 4 | *.o 5 | *.a 6 | *.tar.gz 7 | *~ 8 | Doxyfile 9 | html/ 10 | -------------------------------------------------------------------------------- /.scripts/build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -eux 2 | # -e: Exit immediately if a command exits with a non-zero status. 3 | # -u: Treat unset variables as an error when substituting. 4 | # -x: Display expanded script commands 5 | 6 | make && make DESTDIR="${INSTALL_DIR}" PREFIX=/usr install 7 | 8 | find "${INSTALL_DIR}" -type f \( -name '*.a' -o -name '*.o' \) -exec ${CROSS_TOOL}-strip -S -X -w -N '.L[0-9]*' {} \; 9 | -------------------------------------------------------------------------------- /.scripts/install-freemint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -eux 2 | # -e: Exit immediately if a command exits with a non-zero status. 3 | # -u: Treat unset variables as an error when substituting. 4 | # -x: Display expanded script commands 5 | 6 | DOWNLOAD_DIR=http://tho-otto.de/snapshots 7 | SYSROOT_DIR=${SYSROOT_DIR:-"/usr/${CROSS_TOOL}/sys-root"} 8 | 9 | sudo mkdir -p "${SYSROOT_DIR}" && cd "${SYSROOT_DIR}" 10 | 11 | toolsuffix=${CROSS_TOOL##*-} 12 | 13 | for package in $* 14 | do 15 | # for gcc and binutils, use stable current, not experimental latest build 16 | case $package in 17 | gcc | binutils) 18 | filename=${package}-${toolsuffix}-current.tar.bz2 19 | ;; 20 | *) 21 | filename=${package}-${toolsuffix}-latest.tar.bz2 22 | ;; 23 | esac 24 | wget -q -O - "$DOWNLOAD_DIR/${package}/${filename}" | sudo tar xjf - 25 | done 26 | -------------------------------------------------------------------------------- /.travis/install.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -eux 2 | # -e: Exit immediately if a command exits with a non-zero status. 3 | # -u: Treat unset variables as an error when substituting. 4 | # -x: Display expanded script commands 5 | 6 | if [ "${TRAVIS_PULL_REQUEST}" = "false" -a "${TRAVIS_REPO_SLUG}" = "freemint/gemlib" ] 7 | then 8 | BINTRAY_REPO="travis" SYSROOT_DIR="/" ./.travis/install_bintray.sh m68k-atari-mint-binutils-gdb m68k-atari-mint-gcc mintbin 9 | ./.travis/install_bintray.sh mintlib 10 | else 11 | sudo add-apt-repository -y ppa:vriviere/ppa 12 | sudo apt-get update 13 | sudo apt-get install binutils-m68k-atari-mint gcc-m68k-atari-mint mintbin-m68k-atari-mint mintlib-m68k-atari-mint 14 | fi 15 | -------------------------------------------------------------------------------- /.travis/script.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -eux 2 | # -e: Exit immediately if a command exits with a non-zero status. 3 | # -u: Treat unset variables as an error when substituting. 4 | # -x: Display expanded script commands 5 | 6 | make && make PREFIX="${INSTALL_DIR}" install 7 | 8 | find "${INSTALL_DIR}" -type f \( -name '*.a' -o -name '*.o' \) -exec m68k-atari-mint-strip -S -X -w -N '.L[0-9]*' {} \; 9 | -------------------------------------------------------------------------------- /BINFILES: -------------------------------------------------------------------------------- 1 | # This file gets included by the Makefile in this directory to determine 2 | # the files that should go only into binary distributions. 3 | 4 | BINFILES = libgem.a libgem16.a 5 | 6 | ifeq ($(WITH_020_LIB),yes) 7 | BINFILES += libgem020.a libgem02016.a 8 | endif 9 | 10 | ifeq ($(WITH_V4E_LIB),yes) 11 | BINFILES += libgemv4e.a libgemv4e16.a 12 | endif 13 | -------------------------------------------------------------------------------- /EXTRAFILES: -------------------------------------------------------------------------------- 1 | # This file gets included by the Makefile in this directory to determine 2 | # the files that should go only into source distributions. 3 | 4 | SRCFILES += CONFIGVARS DEPENDENCIES PHONY RULES 5 | 6 | SRCFILES += \ 7 | BINFILES \ 8 | ChangeLog \ 9 | ChangeLog.old \ 10 | EXTRAFILES \ 11 | MISCFILES \ 12 | Makefile \ 13 | SRCFILES \ 14 | \ 15 | gemlib.spec \ 16 | VERSION \ 17 | mt_gem.h.in \ 18 | \ 19 | doxydoc.c \ 20 | Doxyfile \ 21 | \ 22 | files.mak \ 23 | gcc281-16.mak \ 24 | gcc281.mak \ 25 | gcc.mak \ 26 | pc.mak \ 27 | sox.mak \ 28 | zip.mak \ 29 | \ 30 | _lc_asm.s \ 31 | _pc_asm.s \ 32 | _sx_asm.s 33 | -------------------------------------------------------------------------------- /MISCFILES: -------------------------------------------------------------------------------- 1 | # This file gets included by the Makefile in this directory to determine 2 | # the files that should go both into source and binary distributions. 3 | 4 | MISCFILES = gem.h gemx.h mt_gem.h mt_gemx.h 5 | -------------------------------------------------------------------------------- /PHONY: -------------------------------------------------------------------------------- 1 | # These are the phony targets common to all Makefiles. 2 | 3 | .PHONY: clean clean-recursive dist distclean distclean-recursive \ 4 | bakclean bakclean-recursive bin-dist distdir bindistdir default \ 5 | all all-here all-recursive install install-recursive \ 6 | uninstall uninstall-recursive help 7 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | [![Build Status](https://github.com/freemint/gemlib/actions/workflows/build.yml/badge.svg?branch=master)](https://github.com/freemint/gemlib/actions) 2 | 3 | * Latest snapshot: [Download (mint)](https://tho-otto.de/snapshots/gemlib/gemlib-mint-latest.tar.bz2) 4 | * Latest snapshot: [Download (mintelf)](https://tho-otto.de/snapshots/gemlib/gemlib-mintelf-latest.tar.bz2) 5 | * [Archive](https://tho-otto.de/snapshots/gemlib/) 6 | -------------------------------------------------------------------------------- /VERSION: -------------------------------------------------------------------------------- 1 | 2 | # $Id$ 3 | # 4 | 5 | # Define this to the version of the package. 6 | VERSION=0.44.0 7 | -------------------------------------------------------------------------------- /_gc_aes.c: -------------------------------------------------------------------------------- 1 | #include "gem_aesP.h" 2 | 3 | #ifdef __GNUC__ 4 | void aes(AESPB *pb) 5 | { 6 | register long d1 __asm__("d1") = (long)pb; 7 | 8 | __asm__ __volatile__ ( 9 | "\tmove.w #200,%%d0\n" 10 | "\ttrap #2\n" 11 | : 12 | : "r"(d1) 13 | : "d0", "d2", "a0", "a1", "a2", "memory", "cc" 14 | ); 15 | } 16 | #endif 17 | -------------------------------------------------------------------------------- /_gc_vdi.c: -------------------------------------------------------------------------------- 1 | #include "gem_vdiP.h" 2 | 3 | #ifdef __GNUC__ 4 | void vdi(VDIPB *pb) 5 | { 6 | register long d1 __asm__("d1") = (long)pb; 7 | 8 | __asm__ __volatile__ ( 9 | "\tmoveq #115,%%d0\n" 10 | "\ttrap #2\n" 11 | : 12 | : "r"(d1) 13 | : "d0", "d2", "a0", "a1", "a2", "memory", "cc" 14 | ); 15 | } 16 | #endif 17 | -------------------------------------------------------------------------------- /_gc_vq_gdos.c: -------------------------------------------------------------------------------- 1 | #include "gem_vdiP.h" 2 | 3 | #ifdef __GNUC__ 4 | short vq_gdos(void) 5 | { 6 | register long ret __asm__("d0"); 7 | 8 | __asm__ __volatile__ ( 9 | "\tmoveq #-2,%%d0\n" 10 | "\ttrap #2\n" 11 | "\tcmp.w #-2,%%d0\n" 12 | "\tsne %%d0\n" 13 | "\text.w %%d0\n" 14 | # ifndef __MSHORT__ 15 | "\text.l %%d0\n" 16 | # endif 17 | : "=r"(ret) 18 | : 19 | : "d1", "d2", "a0", "a1", "a2", "memory", "cc" 20 | ); 21 | return ret; 22 | } 23 | #endif 24 | -------------------------------------------------------------------------------- /_gc_vq_vgdos.c: -------------------------------------------------------------------------------- 1 | #include "gem_vdiP.h" 2 | 3 | #ifdef __GNUC__ 4 | long vq_vgdos(void) 5 | { 6 | register long ret __asm__("d0"); 7 | 8 | __asm__ __volatile__ ( 9 | "\tmoveq #-2,%d0\n" 10 | "\ttrap #2\n" 11 | : "=r"(ret) 12 | : 13 | : "d1", "d2", "a0", "a1", "a2", "memory", "cc" 14 | ); 15 | return (short)ret == -2 ? (short)ret : ret; 16 | } 17 | #endif 18 | -------------------------------------------------------------------------------- /_pc_asm.s: -------------------------------------------------------------------------------- 1 | 2 | .TEXT 3 | .EXPORT aes, vdi 4 | .EXPORT vq_gdos, vq_vgdos 5 | 6 | aes: 7 | move.l a0,d1 ; pb in A0 und nicht auf Stack! 8 | move.w #200,d0 9 | movem.l d2/a2,-(sp) ; backup registers 10 | trap #2 11 | movem.l (sp)+,d2/a2 ; restore registers 12 | rts 13 | 14 | vdi: 15 | move.l a0,d1 16 | moveq #115,d0 17 | movem.l d2/a2,-(sp) ; backup registers 18 | trap #2 19 | movem.l (sp)+,d2/a2 ; restore registers 20 | rts 21 | 22 | vq_gdos: 23 | moveq #-2,d0 24 | movem.l d2/a2,-(sp) ; backup registers 25 | trap #2 26 | movem.l (sp)+,d2/a2 ; restore registers 27 | cmp.w #-2,d0 28 | sne d0 29 | ext.w d0 30 | rts 31 | 32 | vq_vgdos: 33 | moveq #-2,d0 34 | movem.l d2/a2,-(sp) ; backup registers 35 | trap #2 36 | movem.l (sp)+,d2/a2 ; restore registers 37 | cmp.w #-2,d0 38 | bne.b gdos_found 39 | moveq #-2,d0 40 | gdos_found: 41 | rts 42 | -------------------------------------------------------------------------------- /a__appl_yield.c: -------------------------------------------------------------------------------- 1 | #include "gem_aesP.h" 2 | 3 | /** forces an AES process switch. 4 | * 5 | * @return none 6 | * 7 | * @since not available in PC-GEM 8 | * 9 | * @sa mt_appl_yield() 10 | * 11 | */ 12 | 13 | #ifdef __GNUC__ 14 | void _appl_yield(void) 15 | { 16 | __asm__ volatile ( 17 | "move.w #201,%%d0\n\t" 18 | "trap #2" 19 | : 20 | : 21 | : "d0","d1","d2","a0","a1","a2","memory","cc" 22 | ); 23 | } 24 | #endif 25 | 26 | 27 | #ifdef __VBCC__ 28 | static void _asm_appl_yield(void) = 29 | "\tmove.l\td2,-(sp)\n" 30 | "\tmove.l\ta2,-(sp)\n" 31 | "\tmove.w\t#201,d0\n" 32 | "\ttrap\t#2\n" 33 | "\tmove.l\t(sp)+,a2\n" 34 | "\tmove.l\t(sp)+,d2"; 35 | 36 | void _appl_yield(void) 37 | { 38 | _asm_appl_yield(); 39 | } 40 | #endif 41 | -------------------------------------------------------------------------------- /a_appl_bvset.c: -------------------------------------------------------------------------------- 1 | #include "gem_aesP.h" 2 | 3 | /** tell PC-GEM which logical drives are connected to the system (for the file selector box). 4 | * 5 | * @param bvdisk Bit vector with all connected disk drives. Bit 15 (the most 6 | * significant bit) denotes drive A: 7 | * @param bvhard Bit vector with all connected hard drives. 8 | * @param global_aes global AES array 9 | * 10 | * @return Unknown 11 | * 12 | * @since only available on PC-GEM (as of version 2.0) 13 | * 14 | */ 15 | 16 | short 17 | mt_appl_bvset(short bvdisk, short bvhard, short *global_aes) 18 | { 19 | AES_PARAMS(16,2,1,0,0); 20 | 21 | aes_intin[0] = bvdisk; 22 | aes_intin[1] = bvhard; 23 | 24 | AES_TRAP(aes_params); 25 | 26 | return aes_intout[0]; 27 | } 28 | -------------------------------------------------------------------------------- /a_appl_exit.c: -------------------------------------------------------------------------------- 1 | #include "gem_aesP.h" 2 | 3 | /** Unregister an application from the AES and free its AES ID. 4 | * 5 | * @return 0 if an error occurred or non-zero otherwise. 6 | * 7 | * @since All AES versions. 8 | * 9 | * @sa mt_appl_init() 10 | * 11 | * The handling of an error (return value 0) is currently undefined. 12 | * 13 | */ 14 | 15 | short 16 | mt_appl_exit(short *global_aes) 17 | { 18 | AES_PARAMS(19,0,1,0,0); 19 | 20 | AES_TRAP(aes_params); 21 | 22 | return aes_intout[0]; 23 | } 24 | -------------------------------------------------------------------------------- /a_appl_init_st.c: -------------------------------------------------------------------------------- 1 | #include "mt_gem.h" 2 | 3 | #define appl_init _no_appl_init /* to disable the appl_init inline function from gem.h */ 4 | #include "gem.h" 5 | 6 | #undef appl_init 7 | short appl_init(void); 8 | 9 | short appl_init(void) 10 | { 11 | gl_apid = mt_appl_init(aes_global); 12 | gl_ap_version = aes_global[0]; 13 | return gl_apid; 14 | } 15 | -------------------------------------------------------------------------------- /a_appl_yield.c: -------------------------------------------------------------------------------- 1 | #include "gem_aesP.h" 2 | 3 | /** forces an AES process switch. 4 | * 5 | * @param global_aes global AES array 6 | * @return unknown 7 | * 8 | * @since PC-GEM (as of version 2.0), MagiC (as of version 2.0) 9 | * 10 | * @sa mt_evnt_timer() 11 | * 12 | * @note Use mt_evnt_timer() with \a interval = 1L on other AES implementations. 13 | * 14 | */ 15 | 16 | short 17 | mt_appl_yield(short *global_aes) 18 | { 19 | AES_PARAMS(17,0,1,0,0); 20 | 21 | AES_TRAP(aes_params); 22 | 23 | return aes_intout[0]; 24 | } 25 | -------------------------------------------------------------------------------- /a_form_center_grect.c: -------------------------------------------------------------------------------- 1 | #include "gem_aesP.h" 2 | 3 | /** see mt_form_center() 4 | * 5 | * @param tree mt_form_center() 6 | * @param r mt_form_center()\n 7 | * [option CHECK_NULLPTR] r may be NULL 8 | * @param global_aes global AES array 9 | * 10 | * @return see mt_form_center() 11 | * 12 | * @since see mt_form_center() 13 | * 14 | */ 15 | 16 | short 17 | mt_form_center_grect( OBJECT *tree, GRECT *r, short *global_aes) 18 | { 19 | AES_PARAMS(54,0,5,1,0); 20 | 21 | aes_addrin[0] = (long)tree; 22 | 23 | AES_TRAP(aes_params); 24 | 25 | #if CHECK_NULLPTR 26 | if (r) 27 | #endif 28 | *r = *(GRECT*)(aes_intout+1); 29 | 30 | return aes_intout[0]; 31 | } 32 | -------------------------------------------------------------------------------- /a_graf_growbox_grect.c: -------------------------------------------------------------------------------- 1 | #include "gem_aesP.h" 2 | 3 | /** see mt_graf_growbox() 4 | * 5 | * @param in starting rectangle (where the outline will grow from). 6 | * @param out ending rectangle (where the outline will grow to). 7 | * @param global_aes global AES array 8 | * 9 | * @return see mt_graf_growbox() 10 | * 11 | * @since see mt_graf_growbox() 12 | * 13 | * 14 | */ 15 | 16 | short 17 | mt_graf_growbox_grect( const GRECT *in, const GRECT *out, short *global_aes) 18 | { 19 | AES_PARAMS(73,8,1,0,0); 20 | 21 | *(GRECT*)(aes_intin ) = *in; 22 | *(GRECT*)(aes_intin+4) = *out; 23 | 24 | AES_TRAP(aes_params); 25 | 26 | return aes_intout[0]; 27 | } 28 | -------------------------------------------------------------------------------- /a_graf_shrinkbox_grect.c: -------------------------------------------------------------------------------- 1 | #include "gem_aesP.h" 2 | 3 | /** see mt_graf_shrinkbox() 4 | * 5 | * @param in rectangle to shrink to 6 | * @param out rectangle to shrink from 7 | * @param global_aes global AES array 8 | * 9 | * @return see mt_graf_shrinkbox() 10 | * 11 | * @since see mt_graf_shrinkbox() 12 | * 13 | * 14 | */ 15 | 16 | short 17 | mt_graf_shrinkbox_grect( const GRECT *in, const GRECT *out, short *global_aes) 18 | { 19 | AES_PARAMS(74,8,1,0,0); 20 | 21 | *(GRECT*)(aes_intin ) = *in; 22 | *(GRECT*)(aes_intin+4) = *out; 23 | 24 | AES_TRAP(aes_params); 25 | 26 | return aes_intout[0]; 27 | } 28 | -------------------------------------------------------------------------------- /a_menu_click.c: -------------------------------------------------------------------------------- 1 | #include "gem_aesP.h" 2 | 3 | /** 4 | * 5 | * @param click specifies if the AES shall manage menu as 6 | * - 0 : Drop down menu 7 | * - 1 : PullDown 8 | * @param setit is one of the following value: 9 | * - 0 = Menu prompting query 10 | * - 1 = Menu prompting set 11 | * @param global_aes global AES array 12 | * 13 | * @return adjusted menu prompting (0 = drop down, 1 = Pulldown) 14 | * 15 | * @since PC/GEM3, mt_appl_getinfo() with parameter #AES_PCGEM gives the 16 | * availability of this function. 17 | * 18 | * @sa 19 | * 20 | */ 21 | 22 | short 23 | mt_menu_click(short click, short setit, short *global_aes) 24 | { 25 | AES_PARAMS(37,2,1,0,0); 26 | 27 | aes_intin[0] = click; 28 | aes_intin[1] = setit; 29 | 30 | AES_TRAP(aes_params); 31 | 32 | return aes_intout[0]; 33 | } 34 | -------------------------------------------------------------------------------- /a_menu_text.c: -------------------------------------------------------------------------------- 1 | #include "gem_aesP.h" 2 | 3 | /** changes the text of a menu item. 4 | * 5 | * @param me_tree specifies the object tree of the menu bar 6 | * @param me_item specifies the object index of the menu item to change 7 | * @param me_text points to a NULL-terminated character string containing the 8 | * new text. 9 | * @param global_aes global AES array 10 | * 11 | * @return 0 if an error occurred or non-zero otherwise. 12 | * 13 | * @since All AES versions. 14 | * 15 | * 16 | */ 17 | 18 | short 19 | mt_menu_text(OBJECT *me_tree, short me_item, const char *me_text, short *global_aes) 20 | { 21 | AES_PARAMS(34,1,1,2,0); 22 | 23 | aes_intin[0] = me_item; 24 | 25 | aes_addrin[0] = (long)me_tree; 26 | aes_addrin[1] = (long)me_text; 27 | 28 | AES_TRAP(aes_params); 29 | 30 | return aes_intout[0]; 31 | } 32 | -------------------------------------------------------------------------------- /a_menu_unregister.c: -------------------------------------------------------------------------------- 1 | #include "gem_aesP.h" 2 | 3 | /** remove accessory name from menu 4 | * 5 | * @param id application ID of the accessory 6 | * @param global_aes global AES array 7 | * 8 | * @return at present unknown 9 | * 10 | * This function allows an Accessorie to remove its name from the menu line. 11 | * 12 | * @since PC/GEM2 and MagiC 2.0 13 | * 14 | * @sa mt_menu_register() 15 | */ 16 | 17 | short 18 | mt_menu_unregister(short id, short *global_aes) 19 | { 20 | AES_PARAMS(36,1,1,0,0); 21 | 22 | aes_intin[0] = id; 23 | 24 | AES_TRAP(aes_params); 25 | 26 | return aes_intout[0]; 27 | } 28 | -------------------------------------------------------------------------------- /a_objc_draw_grect.c: -------------------------------------------------------------------------------- 1 | #include "gem_aesP.h" 2 | 3 | /** see mt_objc_draw() 4 | * 5 | * @param tree see mt_objc_draw() 6 | * @param start see mt_objc_draw() 7 | * @param depth see mt_objc_draw() 8 | * @param r clipping rectangle to enforce during drawing 9 | * @param global_aes global AES array 10 | * 11 | * @return see mt_objc_draw() 12 | * 13 | * @since see mt_objc_draw() 14 | * 15 | * 16 | */ 17 | 18 | short 19 | mt_objc_draw_grect(OBJECT *tree, short start, short depth, const GRECT *r, short *global_aes) 20 | { 21 | AES_PARAMS(42,6,1,1,0); 22 | 23 | aes_intin[0] = start; 24 | aes_intin[1] = depth; 25 | *(GRECT*)(aes_intin+2) = *r; 26 | 27 | aes_addrin[0] = (long)tree; 28 | 29 | AES_TRAP(aes_params); 30 | 31 | return aes_intout[0]; 32 | } 33 | -------------------------------------------------------------------------------- /a_objc_xfind.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/freemint/gemlib/44d3e3a3cadc8fc7f085e0738660377ecfdcda4f/a_objc_xfind.c -------------------------------------------------------------------------------- /a_rsrc_free.c: -------------------------------------------------------------------------------- 1 | #include "gem_aesP.h" 2 | 3 | /** releases memory allocated by mt_rsrc_load() for an 4 | * application's resource. 5 | * 6 | * @param global_aes global AES array 7 | * 8 | * @return 0 if an error occurred or non-zero otherwise. 9 | * 10 | * @since All AES versions. 11 | * 12 | * @sa mt_rsrc_load() 13 | * 14 | * mt_rsrc_free() should be called before an application which 15 | * loaded a resource using mt_rsrc_load() exits. 16 | */ 17 | 18 | short 19 | mt_rsrc_free( short *global_aes) 20 | { 21 | AES_PARAMS(111,0,1,0,0); 22 | 23 | AES_TRAP(aes_params); 24 | 25 | return aes_intout[0]; 26 | } 27 | -------------------------------------------------------------------------------- /a_rsrc_load.c: -------------------------------------------------------------------------------- 1 | #include "gem_aesP.h" 2 | 3 | /** loads and allocates memory for the named 4 | * resource file. 5 | * 6 | * @param Name is a character pointer to a NULL-terminated GEMDOS 7 | * file specification of the resource to load. 8 | * @param global_aes global AES array 9 | * 10 | * @return 1 if successful or zero if an error occurred. 11 | * 12 | * @since All AES versions. 13 | * 14 | * @sa mt_rsrc_free() 15 | * 16 | * In addition to loading the resource, all OBJECT coordinates 17 | * are converted from character based coordinates to pixels based 18 | * coordinates. 19 | * 20 | */ 21 | 22 | short 23 | mt_rsrc_load(const char *Name, short *global_aes) 24 | { 25 | AES_PARAMS(110,0,1,1,0); 26 | 27 | aes_addrin[0] = (long)Name; 28 | 29 | AES_TRAP(aes_params); 30 | 31 | return aes_intout[0]; 32 | } 33 | -------------------------------------------------------------------------------- /a_scrp_clear.c: -------------------------------------------------------------------------------- 1 | #include "gem_aesP.h" 2 | 3 | /** clear the content of the clipboard directory 4 | * 5 | * @param global_aes global AES array 6 | * 7 | * @return 0 if an error occurred or non-zero otherwise. 8 | * 9 | * @since All AES versions. 10 | * 11 | * @sa mt_scrp_read(), mt_scrp_write() 12 | * 13 | * This function deletes all the files in the clipboard directory, 14 | * (not only files named \c 'SCRAP.*'). 15 | * 16 | */ 17 | 18 | short 19 | mt_scrp_clear( short *global_aes) 20 | { 21 | AES_PARAMS(82,0,1,0,0); 22 | 23 | AES_TRAP(aes_params); 24 | 25 | return aes_intout[0]; 26 | } 27 | -------------------------------------------------------------------------------- /a_shel_wdef.c: -------------------------------------------------------------------------------- 1 | #include "gem_aesP.h" 2 | 3 | /** "Shell write default" - default program set 4 | * 5 | * @param lpcmd 6 | * @param lpdir 7 | * @param global_aes global AES array 8 | * 9 | * @since The presence of this function can be determined by mt_appl_getinfo() with mode 10 | * #AES_PCGEM. Under PC-GEM, this function is available since release 2.0 11 | * 12 | * @sa mt_shel_rdef() 13 | * 14 | * The function makes it possible to specify the application which 15 | * is to be the default program (normally the Desktop). 16 | */ 17 | 18 | void mt_shel_wdef(const char *lpcmd, const char *lpdir, short *global_aes) 19 | { 20 | AES_PARAMS(127,0,1,2,0); 21 | 22 | aes_addrin[0] = (long)lpcmd; 23 | aes_addrin[1] = (long)lpdir; 24 | 25 | AES_TRAP(aes_params); 26 | } 27 | -------------------------------------------------------------------------------- /a_wind_create_grect.c: -------------------------------------------------------------------------------- 1 | #include "gem_aesP.h" 2 | 3 | /** initializes a new window structure and allocates any necessary memory. 4 | * 5 | * @param Parts is a bit array whose elements determine the presence of 6 | * any 'widgets' on the window. 7 | * @param r specify the maximum extents of the window. 8 | * @param global_aes global AES array 9 | * 10 | * see mt_wind_create() documentation for more details 11 | */ 12 | 13 | short 14 | mt_wind_create_grect(short Parts, const GRECT *r, short *global_aes) 15 | { 16 | AES_PARAMS(100,5,1,0,0); 17 | 18 | aes_intin[0] = Parts; 19 | *(GRECT*)(aes_intin +1) = *r; 20 | 21 | AES_TRAP(aes_params); 22 | 23 | return aes_intout[0]; 24 | } 25 | -------------------------------------------------------------------------------- /a_wind_delete.c: -------------------------------------------------------------------------------- 1 | #include "gem_aesP.h" 2 | 3 | /** destroys the specified window and releases any memory allocated for it. 4 | * 5 | * @param WindowHandle specifies the window handle of the window to 6 | * destroy. 7 | * @param global_aes global AES array 8 | * 9 | * @return 0 if an error occurred or non-zero otherwise. 10 | * 11 | * @since All AES versions. 12 | * 13 | * @sa mt_wind_create(), mt_wind_open(), mt_wind_close(), mt_wind_new() 14 | * 15 | * A window should by closed with mt_wind_close() before deleting 16 | * it. 17 | * 18 | */ 19 | 20 | short 21 | mt_wind_delete (short WindowHandle, short *global_aes) 22 | { 23 | AES_PARAMS(103,1,1,0,0); 24 | 25 | aes_intin[0] = WindowHandle; 26 | 27 | AES_TRAP(aes_params); 28 | 29 | return (aes_intout[0]); 30 | } 31 | -------------------------------------------------------------------------------- /a_wind_draw.c: -------------------------------------------------------------------------------- 1 | #include "gem_aesP.h" 2 | 3 | /** Draws the Non-Client-Area (window widgets) of a window and checks the 4 | * list of rectangles of the window specified. 5 | * 6 | * @param whandle specifies the handle of the window to redraw 7 | * @param startob index of the start object 8 | * @param global_aes global AES array 9 | * 10 | * @return a 0 if an error occurred or non-zero otherwise. 11 | * 12 | * @since ??? 13 | * 14 | * @note This function is normaly not interesting for applications. 15 | * The function is used by the screen manager for redrawing the 16 | * window objects. 17 | * 18 | */ 19 | 20 | short 21 | mt_wind_draw (short whandle, short startob, short *global_aes) 22 | { 23 | AES_PARAMS(99,2,1,0,0); 24 | 25 | aes_intin[0] = whandle; 26 | aes_intin[1] = startob; 27 | 28 | AES_TRAP(aes_params); 29 | 30 | return (aes_intout[0]); 31 | } 32 | -------------------------------------------------------------------------------- /a_wind_get_grect.c: -------------------------------------------------------------------------------- 1 | #include "gem_aesP.h" 2 | 3 | /** returns various information about a window. 4 | * 5 | * @param WindowHandle specifies the handle of the window to return 6 | * information about (0 is the desktop window) 7 | * @param What specifies the information to return and the values 8 | * placed into \a r. 9 | * @param r 10 | * @param global_aes global AES array 11 | * 12 | * see mt_wind_get() documentation for more details. 13 | */ 14 | 15 | short 16 | mt_wind_get_grect(short WindowHandle, short What, GRECT *r, short *global_aes) 17 | { 18 | AES_PARAMS(104,2,5,0,0); 19 | 20 | aes_intin[0] = WindowHandle; 21 | aes_intin[1] = What; 22 | 23 | AES_TRAP(aes_params); 24 | 25 | *r = *(GRECT*)(aes_intout +1); 26 | 27 | return (aes_intout[0]); 28 | } 29 | -------------------------------------------------------------------------------- /a_wind_new.c: -------------------------------------------------------------------------------- 1 | #include "gem_aesP.h" 2 | 3 | /** closes and deletes all of the application's 4 | * windows. In addition, the state of mt_wind_update(), and the 5 | * mouse pointer hide count is reset. 6 | * 7 | * @param global_aes global AES array 8 | * 9 | * @return The return value is reserved and currently unused 10 | * 11 | * @since Available as of AES version 0x0140. 12 | * 13 | * @sa mt_wind_delete(), mt_graf_mouse(), mt_wind_update() 14 | * 15 | * This function should not be relied upon to clean up after 16 | * an application. It was designed for parent processes that 17 | * wish to ensure that a poorly written child process has 18 | * properly cleaned up after itself. 19 | * 20 | */ 21 | 22 | short 23 | mt_wind_new (short *global_aes) 24 | { 25 | AES_PARAMS(109,0,0,0,0); 26 | 27 | AES_TRAP(aes_params); 28 | 29 | return (1); 30 | } 31 | -------------------------------------------------------------------------------- /a_wind_open_grect.c: -------------------------------------------------------------------------------- 1 | #include "gem_aesP.h" 2 | 3 | /** opens the window specified. 4 | * 5 | * @param WindowHandle specifies the handle of the window to open as 6 | * returned by mt_wind_create() 7 | * @param r the rectangle into which the rectangle should be displayed. 8 | * @param global_aes global AES array 9 | * 10 | * see mt_wind_open() documentation for more details. 11 | */ 12 | 13 | short 14 | mt_wind_open_grect(short WindowHandle, const GRECT *r, short *global_aes) 15 | { 16 | AES_PARAMS(101,5,1,0,0); 17 | 18 | aes_intin[0] = WindowHandle; 19 | *(GRECT*)(aes_intin +1) = *r; 20 | 21 | AES_TRAP(aes_params); 22 | 23 | return aes_intout[0]; 24 | } 25 | -------------------------------------------------------------------------------- /a_wind_set_grect.c: -------------------------------------------------------------------------------- 1 | #include "gem_aesP.h" 2 | 3 | /** sets various window attributes. 4 | * 5 | * @param WindowHandle specifies the window handle of the window to modify. 6 | * @param What specifies the attribute to change 7 | * @param r a rectangle 8 | * @param global_aes global AES array 9 | * 10 | * see mt_wind_set() documentation for more details 11 | * 12 | * the fields x, y, w and h of \a r are respectively sent in place of the 13 | * parameters \a w1, \a w2, \a w3 and \a w4 of mt_wind_set(). 14 | */ 15 | 16 | short 17 | mt_wind_set_grect(short WindowHandle, short What, const GRECT *r, short *global_aes) 18 | { 19 | AES_PARAMS(105,6,1,0,0); 20 | 21 | aes_intin[0] = WindowHandle; 22 | aes_intin[1] = What; 23 | *(GRECT*)(aes_intin +2) = *r; 24 | 25 | AES_TRAP(aes_params); 26 | 27 | return (aes_intout[0]); 28 | 29 | } 30 | -------------------------------------------------------------------------------- /a_wind_xcreate_grect.c: -------------------------------------------------------------------------------- 1 | #include "gem_aesP.h" 2 | 3 | /** initializes a new window structure and allocates any necessary memory. 4 | * 5 | * @param Parts is a bit array whose elements determine the presence of 6 | * any 'widgets' on the window. 7 | * @param r specify the maximum extents of the window. 8 | * @param OutR Corrected maximum extents of window, if 'r' exceeded it. 9 | * @param global_aes global AES array 10 | * 11 | * see mt_wind_xcreate() documentation for more details 12 | */ 13 | 14 | short 15 | mt_wind_xcreate_grect(short Parts, const GRECT *r, GRECT *OutR, short *global_aes) 16 | { 17 | AES_PARAMS(100,5,5,0,0); 18 | 19 | aes_intin[0] = Parts; 20 | *(GRECT*)(aes_intin +1) = *r; 21 | 22 | AES_TRAP(aes_params); 23 | 24 | *OutR = *(GRECT *)(aes_intout + 1); 25 | 26 | return aes_intout[0]; 27 | } 28 | -------------------------------------------------------------------------------- /gcc.mak: -------------------------------------------------------------------------------- 1 | # 2 | # $Id$ 3 | # 4 | 5 | # makefile for gemlib 6 | # gcc >= 2.95.3 (sparemint) version 7 | CROSS = yes 8 | ifeq ($(CROSS),yes) 9 | CC = m68k-atari-mint-gcc 10 | AR = m68k-atari-mint-ar 11 | else 12 | CC = gcc 13 | AR = ar 14 | endif 15 | 16 | CFLAGS = -O2 -Wall -fomit-frame-pointer 17 | 18 | include files.mak 19 | 20 | .SUFFIXES: 21 | .SUFFIXES: .c .S .o 22 | 23 | .c.o: 24 | $(CC) $(CFLAGS) -c $*.c -o $*.o 25 | 26 | .S.o: 27 | $(CC) $(CFLAGS) -c $*.S -o $*.o 28 | 29 | TARGET = $(LIB_GCC) 30 | 31 | $(TARGET): $(OBJ) $(GC_OBJ) 32 | $(RM) $@ 33 | $(AR) cru $@ $^ 34 | -------------------------------------------------------------------------------- /gcc281-16.mak: -------------------------------------------------------------------------------- 1 | # makefile for gemlib 2 | # gcc 2.81 version (16 bits) 3 | 4 | # note: 5 | # CC_GCC281 must point to your gcc.ttp program 6 | # AR_GCC281 must point to your ar.ttp program 7 | 8 | CC = $(CC_GCC281) 9 | AR = $(AR_GCC281) 10 | 11 | CFLAGS = -O2 -Wall -m68000 -mshort 12 | 13 | include files.mak 14 | 15 | .SUFFIXES: 16 | .SUFFIXES: .c .S .o 17 | 18 | .c.o: 19 | $(CC) $(CFLAGS) -c $*.c -o $*.o 20 | 21 | .S.o: 22 | $(CC) $(CFLAGS) -c $*.S -o $*.o 23 | 24 | TARGET = $(LIB_GCC281_MSHORT) 25 | 26 | $(TARGET): $(OBJ) $(GC_OBJ) 27 | $(RM) $@ 28 | $(AR) cs $@ $^ 29 | -------------------------------------------------------------------------------- /gcc281.mak: -------------------------------------------------------------------------------- 1 | # makefile for gemlib 2 | # gcc 2.81 version (32 bits) 3 | 4 | # note: 5 | # CC_GCC281 must point to your gcc.ttp program 6 | # AR_GCC281 must point to your ar.ttp program 7 | 8 | CC = $(CC_GCC281) 9 | AR = $(AR_GCC281) 10 | 11 | CFLAGS = -O2 -Wall -m68000 12 | 13 | include files.mak 14 | 15 | .SUFFIXES: 16 | .SUFFIXES: .c .S .o 17 | 18 | .c.o: 19 | $(CC) $(CFLAGS) -c $*.c -o $*.o 20 | 21 | .S.o: 22 | $(CC) $(CFLAGS) -c $*.S -o $*.o 23 | 24 | TARGET = $(LIB_GCC281) 25 | 26 | $(TARGET): $(OBJ) $(GC_OBJ) 27 | $(RM) $@ 28 | $(AR) cs $@ $^ 29 | -------------------------------------------------------------------------------- /include/README: -------------------------------------------------------------------------------- 1 | This directory contains extra include file needed for some compiler 2 | to get gemlib compilable. 3 | 4 | 5 | For Pure C user: 6 | copy the file purec/compiler.h to your pure_c/include directory 7 | 8 | For VBCC user: 9 | copy the file vbcc/compiler.h to your vbcc/include directory 10 | 11 | For SozobonX user: 12 | copy the file sozobon/compiler.h to your sozobon/include directory 13 | 14 | For GCC 2.81 user: 15 | copy the file gcc281/compiler.h to your gcc_281/include directory 16 | 17 | For GCC >= 2.95 user: 18 | mintlib already have an up-to-date compiler.h file, nothing to do. 19 | 20 | For Lattice C user: 21 | copy the file lattice/compiler.h to your lattice/H directory (include directory) 22 | -------------------------------------------------------------------------------- /include/lattice/compiler.h: -------------------------------------------------------------------------------- 1 | /* compiler.h for lattice C */ 2 | 3 | #ifndef __COMPILER_H__ 4 | #define __COMPILER_H__ 1 5 | 6 | #ifndef cdecl 7 | #define cdecl __stdargs 8 | #endif 9 | 10 | #ifndef __CDECL 11 | #define __CDECL cdecl 12 | #endif 13 | 14 | #ifndef __cdecl 15 | #define __cdecl cdecl 16 | #endif 17 | 18 | #define __BEGIN_DECLS 19 | #define __END_DECLS 20 | 21 | #define inline 22 | 23 | #define __LATTICE__ 24 | 25 | #endif /* __COMPILER_H__ */ 26 | -------------------------------------------------------------------------------- /include/purec/compiler.h: -------------------------------------------------------------------------------- 1 | /* compiler.h for Pure C */ 2 | 3 | #ifndef __COMPILER_H__ 4 | #define __COMPILER_H__ 5 | 6 | #ifdef __PUREC__ 7 | 8 | #define __CDECL cdecl 9 | #define __BEGIN_DECLS 10 | #define __END_DECLS 11 | #define inline 12 | 13 | #endif /* __PURE_C__ */ 14 | 15 | #endif /* __COMPILER_H__ */ 16 | -------------------------------------------------------------------------------- /include/vbcc/compiler.h: -------------------------------------------------------------------------------- 1 | /* compiler.h for vbcc */ 2 | 3 | #ifndef __COMPILER_H__ 4 | #define __COMPILER_H__ 1 5 | 6 | #ifndef cdecl 7 | #define cdecl 8 | #endif 9 | 10 | #ifndef __CDECL 11 | #define __CDECL cdecl 12 | #endif 13 | 14 | #ifndef __cdecl 15 | #define __cdecl cdecl 16 | #endif 17 | 18 | #define __BEGIN_DECLS 19 | #define __END_DECLS 20 | 21 | #endif /* __COMPILER_H__ */ 22 | -------------------------------------------------------------------------------- /mt_gemx.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/freemint/gemlib/44d3e3a3cadc8fc7f085e0738660377ecfdcda4f/mt_gemx.h -------------------------------------------------------------------------------- /n_v_bez_off.c: -------------------------------------------------------------------------------- 1 | #include "gem_vdiP.h" 2 | #include "mt_gemx.h" 3 | 4 | /** This function exists only for compatibility reasons. It switches off the 5 | * special treatment of v_bez()/v_bez_fill(). 6 | * 7 | * @param handle Device handle 8 | * 9 | * @since since NVDI 2.10 10 | * 11 | * 12 | * 13 | */ 14 | 15 | void 16 | v_bez_off (short handle) 17 | { 18 | short vdi_control[VDI_CNTRLMAX]; 19 | 20 | VDI_PARAMS(vdi_control, 0L, 0L, vdi_dummy, vdi_dummy); 21 | 22 | VDI_TRAP_ESC (vdi_params, handle, 11,13, 0,0); 23 | } 24 | -------------------------------------------------------------------------------- /n_v_bez_qual.c: -------------------------------------------------------------------------------- 1 | #include "gem_vdiP.h" 2 | #include "mt_gemx.h" 3 | 4 | /** specifies the quality and accuracy of the bezier curves. You can 5 | * select the quality in a range between 0 and 100 per cent. 6 | * 7 | * @param handle Device handle 8 | * @param percent requested bezier quality 9 | * @param actual realized bezier quality 10 | * 11 | * @since since NVDI 2.10 12 | * 13 | * 14 | * 15 | */ 16 | 17 | short 18 | v_bez_qual (short handle, short percent, short *actual) 19 | { 20 | short vdi_control[VDI_CNTRLMAX]; 21 | short vdi_intin[3]; 22 | 23 | VDI_PARAMS(vdi_control, vdi_intin, 0L, actual, vdi_dummy); 24 | 25 | vdi_intin[0] = 32; 26 | vdi_intin[1] = 1; 27 | vdi_intin[2] = percent; 28 | 29 | VDI_TRAP_ESC (vdi_params, handle, 5,99, 0,3); 30 | return *actual; 31 | } 32 | -------------------------------------------------------------------------------- /n_v_clsbm.c: -------------------------------------------------------------------------------- 1 | #include "gem_vdiP.h" 2 | #include "mt_gemx.h" 3 | 4 | /** closes an offscreen bitmap. If the VDI has allocated the memory 5 | * for the bitmap, this call frees the memory. 6 | * 7 | * @param handle Device handle 8 | * 9 | * @since since EdDI 1.00 10 | * 11 | */ 12 | 13 | void 14 | v_clsbm (short handle) 15 | { 16 | short vdi_control[VDI_CNTRLMAX]; 17 | 18 | VDI_PARAMS(vdi_control, 0L, 0L, vdi_dummy, vdi_dummy); 19 | 20 | VDI_TRAP_ESC (vdi_params, handle, 101,1, 0,0); 21 | } 22 | -------------------------------------------------------------------------------- /n_v_color2value.c: -------------------------------------------------------------------------------- 1 | #include "gem_vdiP.h" 2 | #include "mt_gemx.h" 3 | 4 | /** 5 | * 6 | * @param handle Device handle 7 | * @param color_space color space 8 | * @param color COLOR_ENTRY of the color 9 | * 10 | * @return the pixel value 11 | * 12 | * @since NVDI 5 ? 13 | * 14 | * 15 | * 16 | */ 17 | 18 | unsigned long 19 | v_color2value (short handle, long color_space, COLOR_ENTRY * color) 20 | { 21 | short vdi_control[VDI_CNTRLMAX]; 22 | short vdi_intin[6]; 23 | short vdi_intout[2]; 24 | 25 | VDI_PARAMS(vdi_control, vdi_intin, 0L, vdi_intout, vdi_dummy); 26 | 27 | vdi_intin_long(0) = color_space; 28 | *(COLOR_ENTRY*)&vdi_intin[2] = *color; 29 | 30 | VDI_TRAP (vdi_params, handle, 204, 0,6); 31 | 32 | return vdi_intout_long(0); 33 | } 34 | -------------------------------------------------------------------------------- /n_v_create_ctab.c: -------------------------------------------------------------------------------- 1 | #include "gem_vdiP.h" 2 | #include "mt_gemx.h" 3 | 4 | /** 5 | * 6 | * @param handle Device handle 7 | * @param color_space color space 8 | * @param px_format pixel format 9 | * 10 | * @return pointer to the color table 11 | * 12 | * @since NVDI 5 ? 13 | * 14 | * 15 | * 16 | */ 17 | 18 | COLOR_TAB * 19 | v_create_ctab (short handle, long color_space, unsigned long px_format) 20 | { 21 | short vdi_control[VDI_CNTRLMAX]; 22 | short vdi_intin[4]; 23 | short vdi_intout[N_PTRINTS]; 24 | 25 | VDI_PARAMS(vdi_control, vdi_intin, 0L, vdi_intout, vdi_dummy); 26 | 27 | vdi_intin_long(0) = color_space; 28 | vdi_intin_long(2) = px_format; 29 | 30 | VDI_TRAP_ESC (vdi_params, handle, 206,8, 0,4); 31 | 32 | return vdi_intout_ptr(0, COLOR_TAB *); 33 | } 34 | -------------------------------------------------------------------------------- /n_v_create_driver_info.c: -------------------------------------------------------------------------------- 1 | #include "gem_vdiP.h" 2 | #include "mt_gemx.h" 3 | 4 | /** 5 | * 6 | * @param handle Device handle 7 | * @param driver_id device id (0-99) 8 | * 9 | * @return A pointer to a DRV_INFO structur or 0L 10 | * 11 | * @since NVDI 5.00 12 | * 13 | * 14 | * 15 | */ 16 | 17 | DRV_INFO *v_create_driver_info( short handle, short driver_id ) 18 | { 19 | short vdi_control[VDI_CNTRLMAX]; 20 | short vdi_intout[2]; 21 | 22 | VDI_PARAMS(vdi_control, &driver_id, 0L, vdi_intout, 0L); 23 | 24 | VDI_TRAP (vdi_params, handle, 180, 0,1); 25 | 26 | if ( vdi_control[4] >= 2 ) 27 | return vdi_intout_ptr(0, DRV_INFO *); 28 | 29 | return 0; 30 | } 31 | -------------------------------------------------------------------------------- /n_v_create_itab.c: -------------------------------------------------------------------------------- 1 | #include "gem_vdiP.h" 2 | #include "mt_gemx.h" 3 | 4 | /** 5 | * 6 | * @param handle Device handle 7 | * @param ctab pointer to color table 8 | * @param bits preferred resolution 9 | * 10 | * @return handle of a inverse color table 11 | * 12 | * @since NVDI 5 ? 13 | * 14 | * 15 | * 16 | */ 17 | 18 | ITAB_REF 19 | v_create_itab (short handle, COLOR_TAB * ctab, short bits) 20 | { 21 | short vdi_control[VDI_CNTRLMAX]; 22 | short vdi_intin[3 + N_PTRINTS]; 23 | short vdi_intout[N_PTRINTS]; 24 | 25 | VDI_PARAMS(vdi_control, vdi_intin, 0L, vdi_intout, vdi_dummy); 26 | 27 | vdi_intin_ptr(0, COLOR_TAB *) = ctab; 28 | vdi_intin [N_PTRINTS] = bits; 29 | vdi_intin [N_PTRINTS + 1] = 0; 30 | vdi_intin [N_PTRINTS + 2] = 0; 31 | 32 | VDI_TRAP (vdi_params, handle, 208, 0, 3 + N_PTRINTS); 33 | 34 | return vdi_intout_ptr(0, ITAB_REF); 35 | } 36 | -------------------------------------------------------------------------------- /n_v_ctab_idx2value.c: -------------------------------------------------------------------------------- 1 | #include "gem_vdiP.h" 2 | #include "mt_gemx.h" 3 | 4 | /** 5 | * 6 | * @param handle Device handle 7 | * @param index color table index 8 | * 9 | * @return pixel value 10 | * 11 | * @since NVDI 5 ? 12 | * 13 | * 14 | * 15 | */ 16 | 17 | unsigned long 18 | v_ctab_idx2value (short handle, short index) 19 | { 20 | short vdi_control[VDI_CNTRLMAX]; 21 | short vdi_intout[2]; 22 | 23 | VDI_PARAMS(vdi_control, &index, 0L, vdi_intout, vdi_dummy); 24 | 25 | VDI_TRAP_ESC (vdi_params, handle, 206,5, 0,1); 26 | 27 | return vdi_intout_long(0); 28 | } 29 | -------------------------------------------------------------------------------- /n_v_ctab_idx2vdi.c: -------------------------------------------------------------------------------- 1 | #include "gem_vdiP.h" 2 | #include "mt_gemx.h" 3 | 4 | /** 5 | * 6 | * @param handle Device handle 7 | * @param index Index of colortab entry 8 | * 9 | * @return Index of VDI color 10 | * 11 | * @since NVDI 5 ? 12 | * 13 | * 14 | * 15 | */ 16 | 17 | short 18 | v_ctab_idx2vdi (short handle, short index) 19 | { 20 | short vdi_control[VDI_CNTRLMAX]; 21 | short vdi_intout[1]; 22 | 23 | VDI_PARAMS(vdi_control, &index, 0L, vdi_intout, vdi_dummy); 24 | 25 | VDI_TRAP_ESC (vdi_params, handle, 206,3, 0,1); 26 | 27 | return vdi_intout[0]; 28 | } 29 | -------------------------------------------------------------------------------- /n_v_ctab_vdi2idx.c: -------------------------------------------------------------------------------- 1 | #include "gem_vdiP.h" 2 | #include "mt_gemx.h" 3 | 4 | /** 5 | * 6 | * @param handle Device handle 7 | * @param vdi_index index for the color table 8 | * 9 | * @return index for the color table 10 | * 11 | * @since NVDI 5 ? 12 | * 13 | * 14 | * 15 | */ 16 | 17 | short 18 | v_ctab_vdi2idx (short handle, short vdi_index) 19 | { 20 | short vdi_control[VDI_CNTRLMAX]; 21 | short vdi_intout[1]; 22 | 23 | VDI_PARAMS(vdi_control, &vdi_index, 0L, vdi_intout, vdi_dummy); 24 | 25 | VDI_TRAP_ESC (vdi_params, handle, 206,4, 0,1); 26 | 27 | return vdi_intout[0]; 28 | } 29 | -------------------------------------------------------------------------------- /n_v_delete_ctab.c: -------------------------------------------------------------------------------- 1 | #include "gem_vdiP.h" 2 | #include "mt_gemx.h" 3 | 4 | /** 5 | * 6 | * @param handle Device handle 7 | * @param ctab reference to color table 8 | * 9 | * @return 0=error, 1=all ok 10 | * 11 | * @since NVDI 5 ? 12 | * 13 | * 14 | * 15 | */ 16 | 17 | short 18 | v_delete_ctab (short handle, COLOR_TAB * ctab) 19 | { 20 | short vdi_control[VDI_CNTRLMAX]; 21 | short vdi_intout[1]; 22 | 23 | VDI_PARAMS(vdi_control, (short*)&ctab, 0L, vdi_intout, vdi_dummy); 24 | 25 | VDI_TRAP_ESC (vdi_params, handle, 206,9, 0,2); 26 | 27 | return vdi_intout[0]; 28 | } 29 | -------------------------------------------------------------------------------- /n_v_delete_driver_info.c: -------------------------------------------------------------------------------- 1 | #include "gem_vdiP.h" 2 | #include "mt_gemx.h" 3 | 4 | /** 5 | * 6 | * @param handle Device handle 7 | * @param drv_info Pointer from v_create_driver_info 8 | * 9 | * @return unknown 10 | * 11 | * @since NVDI 5.00 12 | * 13 | * 14 | * 15 | */ 16 | 17 | short v_delete_driver_info( short handle, DRV_INFO *drv_info ) 18 | { 19 | short vdi_control[VDI_CNTRLMAX]; 20 | short vdi_intin[N_PTRINTS]; 21 | short vdi_intout[1]; 22 | 23 | VDI_PARAMS(vdi_control, vdi_intin, 0L, vdi_intout, 0L); 24 | 25 | vdi_intin_ptr(0, DRV_INFO *) = drv_info; 26 | 27 | VDI_TRAP (vdi_params, handle, 181, 0, N_PTRINTS); 28 | 29 | return vdi_intout[0]; 30 | } 31 | -------------------------------------------------------------------------------- /n_v_delete_itab.c: -------------------------------------------------------------------------------- 1 | #include "gem_vdiP.h" 2 | #include "mt_gemx.h" 3 | 4 | /** 5 | * 6 | * @param handle Device handle 7 | * @param itab reference to inverse color table 8 | * 9 | * @return 0=error, 1=all ok 10 | * 11 | * @since NVDI 5 ? 12 | * 13 | * 14 | * 15 | */ 16 | 17 | short 18 | v_delete_itab (short handle, ITAB_REF itab) 19 | { 20 | short vdi_control[VDI_CNTRLMAX]; 21 | short vdi_intout[1]; 22 | 23 | VDI_PARAMS(vdi_control, (short*)&itab, 0L, vdi_intout, vdi_dummy); 24 | 25 | VDI_TRAP_ESC (vdi_params, handle, 208,1, 0,2); 26 | 27 | return vdi_intout[0]; 28 | } 29 | -------------------------------------------------------------------------------- /n_v_ftext16.c: -------------------------------------------------------------------------------- 1 | #include "gem_vdiP.h" 2 | #include "mt_gemx.h" 3 | 4 | /** see v_ftext() 5 | * 6 | * @param handle Device handle 7 | * @param x x-coordinate 8 | * @param y y-coordinate 9 | * @param wstr string (16 bits per character) 10 | * 11 | * 12 | * 13 | */ 14 | 15 | void 16 | v_ftext16 (short handle, short x, short y, const WCHAR * wstr) 17 | { 18 | short vdi_control[VDI_CNTRLMAX]; 19 | short vdi_ptsin[2]; 20 | short n = vdi_wstrlen ((const short *)wstr); 21 | 22 | VDI_PARAMS(vdi_control, (const short *)wstr, vdi_ptsin, vdi_dummy, vdi_dummy); 23 | 24 | vdi_ptsin[0] = x; 25 | vdi_ptsin[1] = y; 26 | 27 | VDI_TRAP (vdi_params, handle, 241, 1,n); 28 | } 29 | -------------------------------------------------------------------------------- /n_v_ftext16n.c: -------------------------------------------------------------------------------- 1 | #include "gem_vdiP.h" 2 | #include "mt_gemx.h" 3 | 4 | /** see v_ftext() 5 | * 6 | * @param handle Device handle 7 | * @param pos point for coordinates 8 | * @param wstr string (16 bits per character) 9 | * @param num string len 10 | * 11 | * 12 | * 13 | */ 14 | 15 | void 16 | v_ftext16n (short handle, PXY pos, const WCHAR * wstr, short num) 17 | { 18 | short vdi_control[VDI_CNTRLMAX]; 19 | 20 | VDI_PARAMS(vdi_control, (const short *)wstr, (short*)&pos, vdi_dummy, vdi_dummy); 21 | 22 | VDI_TRAP (vdi_params, handle, 241, 1,num); 23 | } 24 | -------------------------------------------------------------------------------- /n_v_get_ctab_id.c: -------------------------------------------------------------------------------- 1 | #include "gem_vdiP.h" 2 | #include "mt_gemx.h" 3 | 4 | /** 5 | * 6 | * @param handle Device handle 7 | * 8 | * @return id of the color table 9 | * 10 | * @since NVDI 5 ? 11 | * 12 | * 13 | * 14 | */ 15 | 16 | long 17 | v_get_ctab_id (short handle) 18 | { 19 | short vdi_control[VDI_CNTRLMAX]; 20 | short vdi_intout[2]; 21 | 22 | VDI_PARAMS(vdi_control, 0L, 0L, vdi_intout, vdi_dummy); 23 | 24 | VDI_TRAP_ESC (vdi_params, handle, 206,6, 0,0); 25 | 26 | return vdi_intout_long(0); 27 | } 28 | -------------------------------------------------------------------------------- /n_v_read_default_settings.c: -------------------------------------------------------------------------------- 1 | #include "gem_vdiP.h" 2 | #include "mt_gemx.h" 3 | 4 | /** 5 | * 6 | * @param handle Device handle 7 | * @param settings Pointer to a structur of the Typ PRN_SETTINGS 8 | * 9 | * @return 0 for an error 10 | * 11 | * @since NVDI 5.00 12 | * 13 | * 14 | * 15 | */ 16 | 17 | short v_read_default_settings( short handle, PRN_SETTINGS *settings ) 18 | { 19 | short vdi_control[VDI_CNTRLMAX]; 20 | short vdi_intin[N_PTRINTS]; 21 | short vdi_intout[1]; 22 | 23 | VDI_PARAMS(vdi_control, vdi_intin, 0L, vdi_intout, 0L); 24 | 25 | vdi_intin_ptr(0, PRN_SETTINGS *) = settings; 26 | 27 | VDI_TRAP (vdi_params, handle, 182, 0, N_PTRINTS); 28 | 29 | if ( vdi_control[4] >= 1 ) 30 | return vdi_intout[0]; 31 | 32 | return 0; 33 | } 34 | -------------------------------------------------------------------------------- /n_v_setrgb.c: -------------------------------------------------------------------------------- 1 | #include "gem_vdiP.h" 2 | #include "mt_gemx.h" 3 | 4 | /** 5 | * 6 | * @param handle Device handle 7 | * @param type 0=text color, 1=fill color, 2=line color, 3=marker color 8 | * @param r red portion in tenth of a precent 9 | * @param g green portion in tenth of a precent 10 | * @param b blue portion in tenth of a precent 11 | * 12 | * @since NVDI 5 ? 13 | * 14 | * 15 | * 16 | */ 17 | 18 | void 19 | v_setrgb (short handle, short type, short r, short g, short b) 20 | { 21 | short vdi_control[VDI_CNTRLMAX]; 22 | short vdi_intin[3]; 23 | 24 | VDI_PARAMS(vdi_control, vdi_intin, 0L, vdi_dummy, vdi_dummy); 25 | 26 | vdi_intin[0] = r; 27 | vdi_intin[1] = g; 28 | vdi_intin[2] = b; 29 | 30 | VDI_TRAP_ESC (vdi_params, handle, 138,type, 0,3); 31 | } 32 | -------------------------------------------------------------------------------- /n_v_value2color.c: -------------------------------------------------------------------------------- 1 | #include "gem_vdiP.h" 2 | #include "mt_gemx.h" 3 | 4 | /** 5 | * 6 | * @param handle Device handle 7 | * @param value pixel value 8 | * @param color \n 9 | * [option CHECK_NULLPTR] color may be NULL 10 | * 11 | * @return color value 12 | * 13 | * @since NVDI 5 ? 14 | * 15 | * 16 | * 17 | */ 18 | 19 | long 20 | v_value2color (short handle, unsigned long value, COLOR_ENTRY * color) 21 | { 22 | short vdi_control[VDI_CNTRLMAX]; 23 | short vdi_intout[6]; 24 | short vdi_intin[2]; 25 | 26 | VDI_PARAMS(vdi_control, vdi_intin, 0L, vdi_intout, vdi_dummy); 27 | vdi_intin_long(0) = value; 28 | 29 | VDI_TRAP_ESC (vdi_params, handle, 204,1, 0,2); 30 | 31 | #if CHECK_NULLPTR 32 | if (color) 33 | #endif 34 | *color = *(COLOR_ENTRY*)&vdi_intout[2]; 35 | 36 | return vdi_intout_long(0); 37 | } 38 | -------------------------------------------------------------------------------- /n_v_write_default_settings.c: -------------------------------------------------------------------------------- 1 | #include "gem_vdiP.h" 2 | #include "mt_gemx.h" 3 | 4 | /** 5 | * 6 | * @param handle Device handle 7 | * @param settings Pointer to a structur of the Typ PRN_SETTINGS 8 | * 9 | * @return 0 for an error 10 | * 11 | * @since NVDI 5.00 12 | * 13 | * 14 | * 15 | */ 16 | 17 | short v_write_default_settings( short handle, PRN_SETTINGS *settings ) 18 | { 19 | short vdi_control[VDI_CNTRLMAX]; 20 | short vdi_intin[N_PTRINTS]; 21 | short vdi_intout[1]; 22 | 23 | VDI_PARAMS(vdi_control, vdi_intin, 0L, vdi_intout, 0L); 24 | 25 | vdi_intin_ptr(0, PRN_SETTINGS *) = settings; 26 | 27 | VDI_TRAP_ESC (vdi_params, handle, 182, 1, 0, N_PTRINTS); 28 | 29 | if ( vdi_control[4] >= 1 ) 30 | return vdi_intout[0]; 31 | 32 | return 0; 33 | } 34 | -------------------------------------------------------------------------------- /n_vq_ctab.c: -------------------------------------------------------------------------------- 1 | #include "gem_vdiP.h" 2 | #include "mt_gemx.h" 3 | 4 | /** 5 | * 6 | * @param handle Device handle 7 | * @param ctab_length length of memory block to which ctab points 8 | * @param ctab memory block to which the color table is copied 9 | * 10 | * @return 0=error, 1=all ok 11 | * 12 | * @since NVDI 5 ? 13 | * 14 | * 15 | * 16 | */ 17 | 18 | short 19 | vq_ctab (short handle, long ctab_length, COLOR_TAB * ctab) 20 | { 21 | short vdi_control[VDI_CNTRLMAX]; 22 | 23 | VDI_PARAMS(vdi_control, (short*)&ctab_length, 0L, (short*)ctab, vdi_dummy); 24 | 25 | VDI_TRAP (vdi_params, handle, 206, 0,2); 26 | 27 | return (vdi_control[4] ? 1 : 0); 28 | } 29 | -------------------------------------------------------------------------------- /n_vq_ctab_entry.c: -------------------------------------------------------------------------------- 1 | #include "gem_vdiP.h" 2 | #include "mt_gemx.h" 3 | 4 | /** 5 | * 6 | * @param handle Device handle 7 | * @param index Index of colortab entry 8 | * @param color \n 9 | * [option CHECK_NULLPTR] color may be NULL 10 | * 11 | * @return currently active color space 12 | * 13 | * @since NVDI 5 ? 14 | * 15 | * 16 | * 17 | */ 18 | 19 | long 20 | vq_ctab_entry (short handle, short index, COLOR_ENTRY * color) 21 | { 22 | short vdi_control[VDI_CNTRLMAX]; 23 | short vdi_intout[6]; 24 | 25 | VDI_PARAMS(vdi_control, &index, 0L, vdi_intout, vdi_dummy); 26 | 27 | VDI_TRAP_ESC (vdi_params, handle, 206,1, 0,1); 28 | 29 | #if CHECK_NULLPTR 30 | if (color) 31 | #endif 32 | *color = *(COLOR_ENTRY*)&vdi_intout[2]; 33 | 34 | return vdi_intout_long(0); 35 | } 36 | -------------------------------------------------------------------------------- /n_vq_ctab_id.c: -------------------------------------------------------------------------------- 1 | #include "gem_vdiP.h" 2 | #include "mt_gemx.h" 3 | 4 | /** 5 | * 6 | * @param handle Device handle 7 | * 8 | * @return id of the current color table 9 | * 10 | * @since NVDI 5 ? 11 | * 12 | * 13 | * 14 | */ 15 | 16 | long 17 | vq_ctab_id (short handle) 18 | { 19 | short vdi_control[VDI_CNTRLMAX]; 20 | short vdi_intout[2]; 21 | 22 | VDI_PARAMS(vdi_control, 0L, 0L, vdi_intout, vdi_dummy); 23 | 24 | VDI_TRAP_ESC (vdi_params, handle, 206,2, 0,0); 25 | 26 | return vdi_intout_long(0); 27 | } 28 | -------------------------------------------------------------------------------- /n_vq_dflt_ctab.c: -------------------------------------------------------------------------------- 1 | #include "gem_vdiP.h" 2 | #include "mt_gemx.h" 3 | 4 | /** 5 | * 6 | * @param handle Device handle 7 | * @param ctab_length length of memory block to which ctab points 8 | * @param ctab memory block to which the color table is copied 9 | * 10 | * @return 0=error, 1=all ok 11 | * 12 | * @since NVDI 5 ? 13 | * 14 | * 15 | * 16 | */ 17 | 18 | short 19 | vq_dflt_ctab (short handle, long ctab_length, COLOR_TAB * ctab) 20 | { 21 | short vdi_control[VDI_CNTRLMAX]; 22 | 23 | VDI_PARAMS(vdi_control, (short*)&ctab_length, 0L, (short*)ctab, vdi_dummy); 24 | 25 | VDI_TRAP_ESC (vdi_params, handle, 206,7, 0,2); 26 | 27 | return (vdi_control[4] ? 1 : 0); 28 | } 29 | -------------------------------------------------------------------------------- /n_vq_hilite_color.c: -------------------------------------------------------------------------------- 1 | #include "gem_vdiP.h" 2 | #include "mt_gemx.h" 3 | 4 | /** 5 | * 6 | * @param handle Device handle 7 | * @param hilite_color \n 8 | * [option CHECK_NULLPTR] hilite_color may be NULL 9 | * 10 | * @return color space set 11 | * 12 | * @since NVDI 5 ? 13 | * 14 | * 15 | * 16 | */ 17 | 18 | long 19 | vq_hilite_color (short handle, COLOR_ENTRY * hilite_color) 20 | { 21 | short vdi_control[VDI_CNTRLMAX]; 22 | short vdi_intout[VDI_INTOUTMAX]; 23 | 24 | VDI_PARAMS(vdi_control, 0L, 0L, vdi_intout, vdi_dummy); 25 | 26 | VDI_TRAP_00 (vdi_params, handle, 209); 27 | 28 | #if CHECK_NULLPTR 29 | if (hilite_color) 30 | #endif 31 | *hilite_color = *(COLOR_ENTRY*)&vdi_intout[2]; 32 | 33 | return vdi_intout_long(0); 34 | } 35 | -------------------------------------------------------------------------------- /n_vq_max_color.c: -------------------------------------------------------------------------------- 1 | #include "gem_vdiP.h" 2 | #include "mt_gemx.h" 3 | 4 | /** 5 | * 6 | * @param handle Device handle 7 | * @param hilite_color \n 8 | * [option CHECK_NULLPTR] hilite_color may be NULL 9 | * 10 | * @return color space set 11 | * 12 | * @since NVDI 5 ? 13 | * 14 | * 15 | * 16 | */ 17 | 18 | long 19 | vq_max_color (short handle, COLOR_ENTRY * hilite_color) 20 | { 21 | short vdi_control[VDI_CNTRLMAX]; 22 | short vdi_intout[6]; 23 | 24 | VDI_PARAMS(vdi_control, 0L, 0L, vdi_intout, vdi_dummy); 25 | 26 | VDI_TRAP_ESC (vdi_params, handle, 209,2, 0,0); 27 | 28 | #if CHECK_NULLPTR 29 | if (hilite_color) 30 | #endif 31 | *hilite_color = *(COLOR_ENTRY *) & vdi_intout[2]; 32 | 33 | return vdi_intout_long(0); 34 | } 35 | -------------------------------------------------------------------------------- /n_vq_min_color.c: -------------------------------------------------------------------------------- 1 | #include "gem_vdiP.h" 2 | #include "mt_gemx.h" 3 | 4 | /** 5 | * 6 | * @param handle Device handle 7 | * @param hilite_color \n 8 | * [option CHECK_NULLPTR] hilite_color may be NULL 9 | * 10 | * @return color space set 11 | * 12 | * @since NVDI 5 ? 13 | * 14 | * 15 | * 16 | */ 17 | 18 | long 19 | vq_min_color (short handle, COLOR_ENTRY * hilite_color) 20 | { 21 | short vdi_control[VDI_CNTRLMAX]; 22 | short vdi_intout[6]; 23 | 24 | VDI_PARAMS(vdi_control, 0L, 0L, vdi_intout, vdi_dummy ); 25 | 26 | VDI_TRAP_ESC (vdi_params, handle, 209,1, 0,0); 27 | 28 | #if CHECK_NULLPTR 29 | if (hilite_color) 30 | #endif 31 | *hilite_color = *(COLOR_ENTRY*)&vdi_intout[2]; 32 | 33 | return vdi_intout_long(0); 34 | } 35 | -------------------------------------------------------------------------------- /n_vq_prn_scaling.c: -------------------------------------------------------------------------------- 1 | #include "gem_vdiP.h" 2 | #include "mt_gemx.h" 3 | 4 | /** 5 | * 6 | * @param handle Device handle 7 | * 8 | * @return -1 if scaling did not take place, else fix31 value of scaling factor 9 | * 10 | * @since NVDI 5 ? 11 | * 12 | * 13 | * 14 | */ 15 | 16 | long 17 | vq_prn_scaling (short handle) 18 | { 19 | short vdi_control[VDI_CNTRLMAX]; 20 | short vdi_intin[2] = {-1,-1}; 21 | short vdi_intout[2]; 22 | 23 | VDI_PARAMS(vdi_control, vdi_intin, 0L, vdi_intout, vdi_dummy); 24 | 25 | VDI_TRAP_ESC (vdi_params, handle, 5,39, 0,2); 26 | 27 | return vdi_control[4] == 2 ? vdi_intout_long(0) : -1L; 28 | } 29 | -------------------------------------------------------------------------------- /n_vq_px_format.c: -------------------------------------------------------------------------------- 1 | #include "gem_vdiP.h" 2 | #include "mt_gemx.h" 3 | 4 | /** 5 | * 6 | * @param handle Device handle 7 | * @param px_format \n 8 | * [option CHECK_NULLPTR] px_format may be NULL 9 | * 10 | * @return color space set 11 | * 12 | * @since NVDI 5 ? 13 | * 14 | * 15 | * 16 | */ 17 | 18 | long 19 | vq_px_format (short handle, unsigned long *px_format) 20 | { 21 | short vdi_control[VDI_CNTRLMAX]; 22 | short vdi_intout[4]; 23 | 24 | VDI_PARAMS(vdi_control, 0L, 0L, vdi_intout, vdi_dummy); 25 | 26 | VDI_TRAP_ESC (vdi_params, handle, 204,3, 0,0); 27 | 28 | #if CHECK_NULLPTR 29 | if (px_format) 30 | #endif 31 | { 32 | *px_format = vdi_intout_long(2); 33 | } 34 | 35 | return vdi_intout_long(0); 36 | } 37 | -------------------------------------------------------------------------------- /n_vq_weight_color.c: -------------------------------------------------------------------------------- 1 | #include "gem_vdiP.h" 2 | #include "mt_gemx.h" 3 | 4 | /** 5 | * 6 | * @param handle Device handle 7 | * @param hilite_color \n 8 | * [option CHECK_NULLPTR] hilite_color may be NULL 9 | * 10 | * @return color space set 11 | * 12 | * @since NVDI 5 ? 13 | * 14 | * 15 | * 16 | */ 17 | 18 | long 19 | vq_weight_color (short handle, COLOR_ENTRY * hilite_color) 20 | { 21 | short vdi_control[VDI_CNTRLMAX]; 22 | short vdi_intout[6]; 23 | 24 | VDI_PARAMS(vdi_control, 0L, 0L, vdi_intout, vdi_dummy); 25 | 26 | VDI_TRAP_ESC (vdi_params, handle, 209,3, 0,0); 27 | 28 | #if CHECK_NULLPTR 29 | if (hilite_color) 30 | #endif 31 | *hilite_color = *(COLOR_ENTRY*)&vdi_intout[2]; 32 | 33 | return vdi_intout_long(0); 34 | } 35 | -------------------------------------------------------------------------------- /n_vqf_bg_color.c: -------------------------------------------------------------------------------- 1 | #include "gem_vdiP.h" 2 | #include "mt_gemx.h" 3 | 4 | /** 5 | * 6 | * @param handle Device handle 7 | * @param bg_color \n 8 | * [option CHECK_NULLPTR] bg_color may be NULL 9 | * 10 | * @return color space set 11 | * 12 | * @since NVDI 5 ? 13 | * 14 | * 15 | * 16 | */ 17 | 18 | long 19 | vqf_bg_color (short handle, COLOR_ENTRY * bg_color) 20 | { 21 | short vdi_control[VDI_CNTRLMAX]; 22 | short vdi_intout[6]; 23 | 24 | VDI_PARAMS(vdi_control, 0L, 0L, vdi_intout, vdi_dummy); 25 | 26 | VDI_TRAP_ESC (vdi_params, handle, 203,1, 0,0); 27 | 28 | #if CHECK_NULLPTR 29 | if (bg_color) 30 | #endif 31 | *bg_color = *(COLOR_ENTRY*)&vdi_intout[2]; 32 | 33 | return vdi_intout_long(0); 34 | } 35 | -------------------------------------------------------------------------------- /n_vqf_fg_color.c: -------------------------------------------------------------------------------- 1 | #include "gem_vdiP.h" 2 | #include "mt_gemx.h" 3 | 4 | /** 5 | * 6 | * @param handle Device handle 7 | * @param fg_color \n 8 | * [option CHECK_NULLPTR] fg_color may be NULL 9 | * 10 | * @return color space set 11 | * 12 | * @since NVDI 5 ? 13 | * 14 | * 15 | * 16 | */ 17 | 18 | long 19 | vqf_fg_color (short handle, COLOR_ENTRY * fg_color) 20 | { 21 | short vdi_control[VDI_CNTRLMAX]; 22 | short vdi_intout[6]; 23 | 24 | VDI_PARAMS(vdi_control, 0L, 0L, vdi_intout, vdi_dummy); 25 | 26 | VDI_TRAP_ESC (vdi_params, handle, 202,1, 0,0); 27 | 28 | #if CHECK_NULLPTR 29 | if (fg_color) 30 | #endif 31 | *fg_color = *(COLOR_ENTRY*)&vdi_intout[2]; 32 | 33 | return vdi_intout_long(0); 34 | } 35 | -------------------------------------------------------------------------------- /n_vql_bg_color.c: -------------------------------------------------------------------------------- 1 | #include "gem_vdiP.h" 2 | #include "mt_gemx.h" 3 | 4 | /** 5 | * 6 | * @param handle Device handle 7 | * @param bg_color \n 8 | * [option CHECK_NULLPTR] bg_color may be NULL 9 | * 10 | * @return color space 11 | * 12 | * @since NVDI 5 ? 13 | * 14 | * 15 | * 16 | */ 17 | 18 | long 19 | vql_bg_color (short handle, COLOR_ENTRY * bg_color) 20 | { 21 | short vdi_control[VDI_CNTRLMAX]; 22 | short vdi_intout[6]; 23 | 24 | VDI_PARAMS(vdi_control, 0L, 0L, vdi_intout, vdi_dummy ); 25 | 26 | VDI_TRAP_ESC (vdi_params, handle, 203,2, 0,0); 27 | 28 | #if CHECK_NULLPTR 29 | if (bg_color) 30 | #endif 31 | *bg_color = *(COLOR_ENTRY*)&vdi_intout[2]; 32 | 33 | return vdi_intout_long(0); 34 | } 35 | -------------------------------------------------------------------------------- /n_vql_fg_color.c: -------------------------------------------------------------------------------- 1 | #include "gem_vdiP.h" 2 | #include "mt_gemx.h" 3 | 4 | /** 5 | * 6 | * @param handle Device handle 7 | * @param fg_color \n 8 | * [option CHECK_NULLPTR] fg_color may be NULL 9 | * 10 | * @return color space set 11 | * 12 | * @since NVDI 5 ? 13 | * 14 | * 15 | * 16 | */ 17 | 18 | long 19 | vql_fg_color (short handle, COLOR_ENTRY * fg_color) 20 | { 21 | short vdi_control[VDI_CNTRLMAX]; 22 | short vdi_intout[6]; 23 | 24 | VDI_PARAMS(vdi_control, 0L, 0L, vdi_intout, vdi_dummy); 25 | 26 | VDI_TRAP_ESC (vdi_params, handle, 202,2, 0,0); 27 | 28 | #if CHECK_NULLPTR 29 | if (fg_color) 30 | #endif 31 | *fg_color = *(COLOR_ENTRY*)&vdi_intout[2]; 32 | 33 | return vdi_intout_long(0); 34 | } 35 | -------------------------------------------------------------------------------- /n_vqm_bg_color.c: -------------------------------------------------------------------------------- 1 | #include "gem_vdiP.h" 2 | #include "mt_gemx.h" 3 | 4 | /** 5 | * 6 | * @param handle Device handle 7 | * @param bg_color \n 8 | * [option CHECK_NULLPTR] bg_color may be NULL 9 | * 10 | * @return color space set 11 | * 12 | * @since NVDI 5 ? 13 | * 14 | * 15 | * 16 | */ 17 | 18 | long 19 | vqm_bg_color (short handle, COLOR_ENTRY * bg_color) 20 | { 21 | short vdi_control[VDI_CNTRLMAX]; 22 | short vdi_intout[6]; 23 | 24 | VDI_PARAMS(vdi_control, 0L, 0L, vdi_intout, vdi_dummy); 25 | 26 | VDI_TRAP_ESC (vdi_params, handle, 203,3, 0,0); 27 | 28 | #if CHECK_NULLPTR 29 | if (bg_color) 30 | #endif 31 | *bg_color = *(COLOR_ENTRY*)&vdi_intout[2]; 32 | 33 | return vdi_intout_long(0); 34 | } 35 | -------------------------------------------------------------------------------- /n_vqm_fg_color.c: -------------------------------------------------------------------------------- 1 | #include "gem_vdiP.h" 2 | #include "mt_gemx.h" 3 | 4 | /** 5 | * 6 | * @param handle Device handle 7 | * @param fg_color \n 8 | * [option CHECK_NULLPTR] fg_color may be NULL 9 | * 10 | * @return color space 11 | * 12 | * @since NVDI 5 ? 13 | * 14 | * 15 | * 16 | */ 17 | 18 | long 19 | vqm_fg_color (short handle, COLOR_ENTRY * fg_color) 20 | { 21 | short vdi_control[VDI_CNTRLMAX]; 22 | short vdi_intout[6]; 23 | 24 | VDI_PARAMS(vdi_control, 0L, 0L, vdi_intout, vdi_dummy); 25 | 26 | VDI_TRAP_ESC (vdi_params, handle, 202,3, 0,0); 27 | 28 | #if CHECK_NULLPTR 29 | if (fg_color) 30 | #endif 31 | *fg_color = *(COLOR_ENTRY*)&vdi_intout[2]; 32 | 33 | return vdi_intout_long(0); 34 | } 35 | -------------------------------------------------------------------------------- /n_vqr_bg_color.c: -------------------------------------------------------------------------------- 1 | #include "gem_vdiP.h" 2 | #include "mt_gemx.h" 3 | 4 | /** 5 | * 6 | * @param handle Device handle 7 | * @param bg_color \n 8 | * [option CHECK_NULLPTR] bg_color may be NULL 9 | * 10 | * @return color space set 11 | * 12 | * @since NVDI 5 ? 13 | * 14 | * 15 | * 16 | */ 17 | 18 | long 19 | vqr_bg_color (short handle, COLOR_ENTRY * bg_color) 20 | { 21 | short vdi_control[VDI_CNTRLMAX]; 22 | short vdi_intout[6]; 23 | 24 | VDI_PARAMS(vdi_control, 0L, 0L, vdi_intout, vdi_dummy); 25 | 26 | VDI_TRAP_ESC (vdi_params, handle, 203,4, 0,0); 27 | 28 | #if CHECK_NULLPTR 29 | if (bg_color) 30 | #endif 31 | *bg_color = *(COLOR_ENTRY*)&vdi_intout[2]; 32 | 33 | return vdi_intout_long(0); 34 | } 35 | -------------------------------------------------------------------------------- /n_vqr_fg_color.c: -------------------------------------------------------------------------------- 1 | #include "gem_vdiP.h" 2 | #include "mt_gemx.h" 3 | 4 | /** 5 | * 6 | * @param handle Device handle 7 | * @param fg_color \n 8 | * [option CHECK_NULLPTR] fg_color may be NULL 9 | * 10 | * @return currently active color space 11 | * 12 | * @since NVDI 5 ? 13 | * 14 | * 15 | * 16 | */ 17 | 18 | long 19 | vqr_fg_color (short handle, COLOR_ENTRY * fg_color) 20 | { 21 | short vdi_control[VDI_CNTRLMAX]; 22 | short vdi_intout[6]; 23 | 24 | VDI_PARAMS(vdi_control, 0L, 0L, vdi_intout, vdi_dummy); 25 | 26 | VDI_TRAP_ESC (vdi_params, handle, 202,4, 0,0); 27 | 28 | #if CHECK_NULLPTR 29 | if (fg_color) 30 | #endif 31 | *fg_color = *(COLOR_ENTRY*)&vdi_intout[2]; 32 | 33 | return vdi_intout_long(0); 34 | } 35 | -------------------------------------------------------------------------------- /n_vqt_bg_color.c: -------------------------------------------------------------------------------- 1 | #include "gem_vdiP.h" 2 | #include "mt_gemx.h" 3 | 4 | /** 5 | * 6 | * @param handle Device handle 7 | * @param bg_color \n 8 | * [option CHECK_NULLPTR] bg_color may be NULL 9 | * 10 | * @return color space 11 | * 12 | * @since NVDI 5 ? 13 | * 14 | * 15 | * 16 | */ 17 | 18 | long 19 | vqt_bg_color (short handle, COLOR_ENTRY * bg_color) 20 | { 21 | short vdi_control[VDI_CNTRLMAX]; 22 | short vdi_intout[6]; 23 | 24 | VDI_PARAMS(vdi_control, 0L, 0L, vdi_intout, vdi_dummy ); 25 | 26 | VDI_TRAP_ESC (vdi_params, handle, 203,0, 0,0); 27 | 28 | #if CHECK_NULLPTR 29 | if (bg_color) 30 | #endif 31 | *bg_color = *(COLOR_ENTRY*)&vdi_intout[2]; 32 | 33 | return vdi_intout_long(0); 34 | } 35 | -------------------------------------------------------------------------------- /n_vqt_f_extent16.c: -------------------------------------------------------------------------------- 1 | #include "gem_vdiP.h" 2 | #include "mt_gemx.h" 3 | 4 | /** see vqt_f_extent() 5 | * 6 | * @param handle Device handle 7 | * @param wstr string (16 bits per character) 8 | * @param extent extent[0..7] : coordinates of the rectangle 9 | * 10 | * @since NVDI 3.00 11 | * 12 | * 13 | * 14 | */ 15 | 16 | void 17 | vqt_f_extent16 (short handle, const WCHAR * wstr, short extent[]) 18 | { 19 | short vdi_control[VDI_CNTRLMAX]; 20 | short n = vdi_wstrlen ((const short *)wstr); 21 | 22 | VDI_PARAMS(vdi_control, (short *)NO_CONST(wstr), 0L, vdi_dummy, extent); 23 | 24 | VDI_TRAP (vdi_params, handle, 240, 0,n); 25 | } 26 | -------------------------------------------------------------------------------- /n_vqt_f_extent16n.c: -------------------------------------------------------------------------------- 1 | #include "gem_vdiP.h" 2 | #include "mt_gemx.h" 3 | 4 | /** see vqt_f_extent() 5 | * 6 | * @param handle Device handle 7 | * @param wstr string (16 bits per character) 8 | * @param num string len 9 | * @param extent extent[0..7] : coordinates of the rectangle 10 | * 11 | * @since NVDI 3.00 12 | * 13 | * 14 | * 15 | */ 16 | 17 | void 18 | vqt_f_extent16n (short handle, const WCHAR * wstr, short num, short extent[]) 19 | { 20 | short vdi_control[VDI_CNTRLMAX]; 21 | 22 | VDI_PARAMS(vdi_control, (short *)NO_CONST(wstr), 0L, vdi_dummy, extent ); 23 | 24 | VDI_TRAP (vdi_params, handle, 240, 0,num); 25 | } 26 | -------------------------------------------------------------------------------- /n_vqt_fg_color.c: -------------------------------------------------------------------------------- 1 | #include "gem_vdiP.h" 2 | #include "mt_gemx.h" 3 | 4 | /** 5 | * 6 | * @param handle Device handle 7 | * @param fg_color \n 8 | * [option CHECK_NULLPTR] fg_color may be NULL 9 | * 10 | * @return color space set 11 | * 12 | * @since NVDI 5 ? 13 | * 14 | * 15 | * 16 | */ 17 | 18 | long 19 | vqt_fg_color (short handle, COLOR_ENTRY * fg_color) 20 | { 21 | short vdi_control[VDI_CNTRLMAX]; 22 | short vdi_intout[6]; 23 | 24 | VDI_PARAMS(vdi_control, 0L, 0L, vdi_intout, vdi_dummy); 25 | 26 | VDI_TRAP_ESC (vdi_params, handle, 202,0, 0,0); 27 | 28 | #if CHECK_NULLPTR 29 | if (fg_color) 30 | #endif 31 | *fg_color = *(COLOR_ENTRY*)&vdi_intout[2]; 32 | 33 | return vdi_intout_long(0); 34 | } 35 | -------------------------------------------------------------------------------- /n_vqt_real_extent16n.c: -------------------------------------------------------------------------------- 1 | #include "gem_vdiP.h" 2 | #include "mt_gemx.h" 3 | 4 | /** see vqt_real_extent 5 | * 6 | * @param handle Device handle 7 | * @param x x-coordinate 8 | * @param y y-coordinate 9 | * @param wstring string in 16 bits format 10 | * @param num string len 11 | * @param extent coordinates of the bounding box 12 | * 13 | * @since NVDI 3.00 14 | * 15 | * 16 | * 17 | */ 18 | 19 | void 20 | vqt_real_extent16n (short handle, short x, short y, const WCHAR *wstring, short num, short extent[]) 21 | { 22 | short vdi_control[VDI_CNTRLMAX]; 23 | short vdi_ptsin[2]; 24 | 25 | VDI_PARAMS(vdi_control, (short *)NO_CONST(wstring), vdi_ptsin, vdi_dummy, extent); 26 | 27 | vdi_ptsin[0] = x; 28 | vdi_ptsin[1] = y; 29 | 30 | VDI_TRAP_ESC (vdi_params, handle, 240,4200, 1,num); 31 | } 32 | -------------------------------------------------------------------------------- /n_vqt_trackkern.c: -------------------------------------------------------------------------------- 1 | #include "gem_vdiP.h" 2 | #include "mt_gemx.h" 3 | 4 | /** This function returns the adjustment vector per character for track kerning 5 | * 6 | * @param handle Device handle 7 | * @param x x-adjustment in 1/65536 pixels \n 8 | * [option CHECK_NULLPTR] x may be NULL 9 | * @param y y-adjustment in 1/65536 pixels \n 10 | * [option CHECK_NULLPTR] y may be NULL 11 | * 12 | * @since NVDI 3.00 13 | * 14 | */ 15 | 16 | void 17 | vqt_trackkern (short handle, long *x, long *y) 18 | { 19 | short vdi_control[VDI_CNTRLMAX]; 20 | short vdi_intout[4]; 21 | 22 | VDI_PARAMS(vdi_control, 0L, 0L, vdi_intout, vdi_dummy); 23 | 24 | VDI_TRAP_00 (vdi_params, handle, 234); 25 | 26 | #if CHECK_NULLPTR 27 | if (x) 28 | #endif 29 | { 30 | *x = vdi_intout_long(0); 31 | } 32 | #if CHECK_NULLPTR 33 | if (y) 34 | #endif 35 | { 36 | *y = vdi_intout_long(2); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /n_vs_ctab.c: -------------------------------------------------------------------------------- 1 | #include "gem_vdiP.h" 2 | #include "mt_gemx.h" 3 | 4 | /** 5 | * 6 | * @param handle Device handle 7 | * @param ctab memory block for color table 8 | * 9 | * @return number of entries set 10 | * 11 | * @since NVDI 5 ? 12 | * 13 | * 14 | * 15 | */ 16 | 17 | 18 | short 19 | vs_ctab (short handle, COLOR_TAB * ctab) 20 | { 21 | short vdi_control[VDI_CNTRLMAX]; 22 | short vdi_intout[1]; 23 | 24 | VDI_PARAMS(vdi_control, (short *) ctab, 0L, vdi_intout, vdi_dummy ); 25 | 26 | VDI_TRAP (vdi_params, handle, 205, 0,(short)(ctab->length /2)); 27 | 28 | return (vdi_intout[0]); 29 | } 30 | -------------------------------------------------------------------------------- /n_vs_ctab_entry.c: -------------------------------------------------------------------------------- 1 | #include "gem_vdiP.h" 2 | #include "mt_gemx.h" 3 | 4 | /** 5 | * 6 | * @param handle Device handle 7 | * @param index color table index 8 | * @param color_space color space 9 | * @param color color table 10 | * 11 | * @return number of entries set 12 | * 13 | * @since NVDI 5 ? 14 | * 15 | * 16 | * 17 | */ 18 | 19 | short 20 | vs_ctab_entry (short handle, short index, long color_space, COLOR_ENTRY * color) 21 | { 22 | short vdi_control[VDI_CNTRLMAX]; 23 | short vdi_intin[7]; 24 | short vdi_intout[1]; 25 | COLOR_ENTRY *ent; 26 | 27 | VDI_PARAMS(vdi_control, vdi_intin, 0L, vdi_intout, vdi_dummy); 28 | 29 | vdi_intin [0] = index; 30 | vdi_intin_long(1) = color_space; 31 | ent = (COLOR_ENTRY*)&vdi_intin[3]; 32 | *ent = *color; 33 | 34 | VDI_TRAP_ESC (vdi_params, handle, 205,1, 0,7); 35 | 36 | return vdi_intout[0]; 37 | } 38 | -------------------------------------------------------------------------------- /n_vs_dflt_ctab.c: -------------------------------------------------------------------------------- 1 | #include "gem_vdiP.h" 2 | #include "mt_gemx.h" 3 | 4 | /** 5 | * 6 | * @param handle Device handle 7 | * 8 | * @return number of entries set 9 | * 10 | * @since NVDI 5 ? 11 | * 12 | * 13 | * 14 | */ 15 | 16 | short 17 | vs_dflt_ctab (short handle) 18 | { 19 | short vdi_control[VDI_CNTRLMAX]; 20 | short vdi_intout[1]; 21 | 22 | VDI_PARAMS(vdi_control, 0L, 0L, vdi_intout, vdi_dummy); 23 | 24 | VDI_TRAP_ESC (vdi_params, handle, 205,2, 0,0); 25 | 26 | return vdi_intout[0]; 27 | } 28 | -------------------------------------------------------------------------------- /n_vs_hilite_color.c: -------------------------------------------------------------------------------- 1 | #include "gem_vdiP.h" 2 | #include "mt_gemx.h" 3 | 4 | /** 5 | * 6 | * @param handle Device handle 7 | * @param color_space color space 8 | * @param hilite_color COLOR_ENTRY of the highlighting color 9 | * 10 | * @return -1=wrong subfunction number, 0=function not present, 1=all ok 11 | * 12 | * @since NVDI 5 ? 13 | * 14 | * 15 | * 16 | */ 17 | 18 | short 19 | vs_hilite_color (short handle, long color_space, COLOR_ENTRY * hilite_color) 20 | { 21 | short vdi_control[VDI_CNTRLMAX]; 22 | short vdi_intin[6]; 23 | short vdi_intout[1]; 24 | 25 | VDI_PARAMS(vdi_control, vdi_intin, 0L, vdi_intout, vdi_dummy); 26 | 27 | vdi_intin_long(0) = color_space; 28 | *(COLOR_ENTRY*)&vdi_intin[2] = *hilite_color; 29 | 30 | VDI_TRAP (vdi_params, handle, 207, 0,6); 31 | 32 | return vdi_intout[0]; 33 | } 34 | -------------------------------------------------------------------------------- /n_vs_load_disp_list.c: -------------------------------------------------------------------------------- 1 | #include "gem_vdiP.h" 2 | #include "mt_gemx.h" 3 | 4 | /** This function is not documented. Dont use it! 5 | * 6 | * @param handle Device handle 7 | * @param name name 8 | * 9 | * @return unknow 10 | * 11 | * @since depend of the driver 12 | * 13 | */ 14 | 15 | 16 | short vs_load_disp_list(short handle, const char *name) 17 | { 18 | short vdi_control[VDI_CNTRLMAX]; 19 | short vdi_intout[2]; 20 | short vdi_intin[N_PTRINTS]; 21 | 22 | VDI_PARAMS (vdi_control, vdi_intin, vdi_dummy, vdi_intout, vdi_dummy); 23 | 24 | vdi_intin_ptr(0, const char *) = name; 25 | vdi_intout[0] = 0; 26 | VDI_TRAP_ESC (vdi_params, handle, 5,2107, 0, 2); 27 | 28 | return vdi_intout[0]; 29 | } 30 | -------------------------------------------------------------------------------- /n_vs_max_color.c: -------------------------------------------------------------------------------- 1 | #include "gem_vdiP.h" 2 | #include "mt_gemx.h" 3 | 4 | /** 5 | * 6 | * @param handle Device handle 7 | * @param color_space color space 8 | * @param max_color COLOR_ENTRY of the maximum color value 9 | * 10 | * @return -1=wrong subfunction number, 0=function not present, 1=all ok 11 | * 12 | * @since NVDI 5 ? 13 | * 14 | * 15 | * 16 | */ 17 | 18 | short 19 | vs_max_color (short handle, long color_space, COLOR_ENTRY * max_color) 20 | { 21 | short vdi_control[VDI_CNTRLMAX]; 22 | short vdi_intin[6]; 23 | short vdi_intout[1]; 24 | 25 | VDI_PARAMS(vdi_control, vdi_intin, 0L, vdi_intout, vdi_dummy); 26 | 27 | vdi_intin_long(0) = color_space; 28 | *(COLOR_ENTRY*)&vdi_intin[2] = *max_color; 29 | 30 | VDI_TRAP_ESC (vdi_params, handle, 207,2, 0,6); 31 | 32 | return vdi_intout[0]; 33 | } 34 | -------------------------------------------------------------------------------- /n_vs_min_color.c: -------------------------------------------------------------------------------- 1 | #include "gem_vdiP.h" 2 | #include "mt_gemx.h" 3 | 4 | /** 5 | * 6 | * @param handle Device handle 7 | * @param color_space color space 8 | * @param min_color COLOR_ENTRY of the minimum color value 9 | * 10 | * @return -1=wrong subfunction number, 0=function not present, 1=all ok 11 | * 12 | * @since NVDI 5 ? 13 | * 14 | * 15 | * 16 | */ 17 | 18 | short 19 | vs_min_color (short handle, long color_space, COLOR_ENTRY * min_color) 20 | { 21 | short vdi_control[VDI_CNTRLMAX]; 22 | short vdi_intin[6]; 23 | short vdi_intout[1]; 24 | 25 | VDI_PARAMS(vdi_control, vdi_intin, 0L, vdi_intout, vdi_dummy); 26 | 27 | vdi_intin_long(0) = color_space; 28 | *(COLOR_ENTRY*)&vdi_intin[2] = *min_color; 29 | 30 | VDI_TRAP_ESC (vdi_params, handle, 207,1, 0,6); 31 | 32 | return vdi_intout[0]; 33 | } 34 | -------------------------------------------------------------------------------- /n_vs_save_disp_list.c: -------------------------------------------------------------------------------- 1 | #include "gem_vdiP.h" 2 | #include "mt_gemx.h" 3 | 4 | /** This function is not documented. Dont use it! 5 | * 6 | * @param handle Device handle 7 | * @param name name 8 | * 9 | * @return unknow 10 | * 11 | * @since depend of the driver 12 | * 13 | */ 14 | 15 | 16 | short vs_save_disp_list(short handle, const char *name) 17 | { 18 | short vdi_control[VDI_CNTRLMAX]; 19 | short vdi_intout[2]; 20 | short vdi_intin[N_PTRINTS]; 21 | 22 | VDI_PARAMS (vdi_control, vdi_intin, vdi_dummy, vdi_intout, vdi_dummy); 23 | 24 | vdi_intin_ptr(0, const char *) = name; 25 | vdi_intout[0] = 0; 26 | VDI_TRAP_ESC (vdi_params, handle, 5,2106, 0, 2); 27 | 28 | return vdi_intout[0]; 29 | } 30 | -------------------------------------------------------------------------------- /n_vs_weight_color.c: -------------------------------------------------------------------------------- 1 | #include "gem_vdiP.h" 2 | #include "mt_gemx.h" 3 | 4 | /** 5 | * 6 | * @param handle Device handle 7 | * @param color_space color space 8 | * @param weight_color COLOR_ENTRY of the weighting 9 | * 10 | * @return -1=wrong subfunction number, 0=function not present, 1=all ok 11 | * 12 | * @since NVDI 5 ? 13 | * 14 | * 15 | * 16 | */ 17 | 18 | short 19 | vs_weight_color (short handle, long color_space, COLOR_ENTRY * weight_color) 20 | { 21 | short vdi_control[VDI_CNTRLMAX]; 22 | short vdi_intin[6]; 23 | short vdi_intout[1]; 24 | 25 | VDI_PARAMS(vdi_control, vdi_intin, 0L, vdi_intout, vdi_dummy); 26 | 27 | vdi_intin_long(0) = color_space; 28 | *(COLOR_ENTRY*)&vdi_intin[2] = *weight_color; 29 | 30 | VDI_TRAP_ESC (vdi_params, handle, 207,3, 0,6); 31 | 32 | return vdi_intout[0]; 33 | } 34 | -------------------------------------------------------------------------------- /n_vsf_bg_color.c: -------------------------------------------------------------------------------- 1 | #include "gem_vdiP.h" 2 | #include "mt_gemx.h" 3 | 4 | /** 5 | * 6 | * @param handle Device handle 7 | * @param color_space color space 8 | * @param bg_color COLOR_ENTRY of the background color 9 | * 10 | * @return -1=wrong subfunction number, 0=function not present, 1=all ok 11 | * 12 | * @since NVDI 5 ? 13 | * 14 | * 15 | * 16 | */ 17 | 18 | short 19 | vsf_bg_color (short handle, long color_space, COLOR_ENTRY * bg_color) 20 | { 21 | short vdi_control[VDI_CNTRLMAX]; 22 | short vdi_intin[6]; 23 | short vdi_intout[1]; 24 | 25 | VDI_PARAMS(vdi_control, vdi_intin, 0L, vdi_intout, vdi_dummy); 26 | 27 | vdi_intin_long(0) = color_space; 28 | *(COLOR_ENTRY*)&vdi_intin[2] = *bg_color; 29 | vdi_intout[0] = 0; 30 | 31 | VDI_TRAP_ESC (vdi_params, handle, 201,1, 0,6); 32 | 33 | return vdi_intout[0]; 34 | } 35 | -------------------------------------------------------------------------------- /n_vsf_fg_color.c: -------------------------------------------------------------------------------- 1 | #include "gem_vdiP.h" 2 | #include "mt_gemx.h" 3 | 4 | /** 5 | * 6 | * @param handle Device handle 7 | * @param color_space color space 8 | * @param fg_color COLOR_ENTRY of the foreground color 9 | * 10 | * @return -1=wrong subfunction number, 0=function not present, 1=all ok 11 | * 12 | * @since NVDI 5 ? 13 | * 14 | * 15 | * 16 | */ 17 | 18 | short 19 | vsf_fg_color (short handle, long color_space, COLOR_ENTRY * fg_color) 20 | { 21 | short vdi_control[VDI_CNTRLMAX]; 22 | short vdi_intin[6]; 23 | short vdi_intout[1]; 24 | 25 | VDI_PARAMS(vdi_control, vdi_intin, 0L, vdi_intout, vdi_dummy); 26 | 27 | vdi_intin_long(0) = color_space; 28 | *(COLOR_ENTRY*)&vdi_intin[2] = *fg_color; 29 | vdi_intout[0] = 0; 30 | 31 | VDI_TRAP_ESC (vdi_params, handle, 200,1, 0,6); 32 | 33 | return vdi_intout[0]; 34 | } 35 | -------------------------------------------------------------------------------- /n_vsl_bg_color.c: -------------------------------------------------------------------------------- 1 | #include "gem_vdiP.h" 2 | #include "mt_gemx.h" 3 | 4 | /** 5 | * 6 | * @param handle Device handle 7 | * @param color_space color space 8 | * @param bg_color COLOR_ENTRY of the background color 9 | * 10 | * @return -1=wrong subfunction number, 0=function not present, 1=all ok 11 | * 12 | * @since NVDI 5 ? 13 | * 14 | * 15 | * 16 | */ 17 | 18 | short 19 | vsl_bg_color (short handle, long color_space, COLOR_ENTRY * bg_color) 20 | { 21 | short vdi_control[VDI_CNTRLMAX]; 22 | short vdi_intin[6]; 23 | short vdi_intout[1]; 24 | 25 | VDI_PARAMS(vdi_control, vdi_intin, 0L, vdi_intout, vdi_dummy); 26 | 27 | vdi_intin_long(0) = color_space; 28 | *(COLOR_ENTRY*)&vdi_intin[2] = *bg_color; 29 | vdi_intout[0] = 0; 30 | 31 | VDI_TRAP_ESC (vdi_params, handle, 201,2, 0,6); 32 | 33 | return vdi_intout[0]; 34 | } 35 | -------------------------------------------------------------------------------- /n_vsl_fg_color.c: -------------------------------------------------------------------------------- 1 | #include "gem_vdiP.h" 2 | #include "mt_gemx.h" 3 | 4 | /** 5 | * 6 | * @param handle Device handle 7 | * @param color_space color space 8 | * @param fg_color COLOR_ENTRY of the foreground color 9 | * 10 | * @return -1=wrong subfunction number, 0=function not present, 1=all ok 11 | * 12 | * @since NVDI 5 ? 13 | * 14 | * 15 | * 16 | */ 17 | 18 | short 19 | vsl_fg_color (short handle, long color_space, COLOR_ENTRY * fg_color) 20 | { 21 | short vdi_control[VDI_CNTRLMAX]; 22 | short vdi_intin[6]; 23 | short vdi_intout[1]; 24 | 25 | VDI_PARAMS(vdi_control, vdi_intin, 0L, vdi_intout, vdi_dummy); 26 | 27 | vdi_intin_long(0) = color_space; 28 | *(COLOR_ENTRY*)&vdi_intin[2] = *fg_color; 29 | vdi_intout[0] = 0; 30 | 31 | VDI_TRAP_ESC (vdi_params, handle, 200,2, 0,6); 32 | 33 | return vdi_intout[0]; 34 | } 35 | -------------------------------------------------------------------------------- /n_vsm_bg_color.c: -------------------------------------------------------------------------------- 1 | #include "gem_vdiP.h" 2 | #include "mt_gemx.h" 3 | 4 | /** 5 | * 6 | * @param handle Device handle 7 | * @param color_space color space 8 | * @param bg_color COLOR_ENTRY of background color 9 | * 10 | * @return -1=wrong subfunction number, 0=function not present, 1=all ok 11 | * 12 | * @since NVDI 5 ? 13 | * 14 | * 15 | * 16 | */ 17 | 18 | short 19 | vsm_bg_color (short handle, long color_space, COLOR_ENTRY * bg_color) 20 | { 21 | short vdi_control[VDI_CNTRLMAX]; 22 | short vdi_intin[6]; 23 | short vdi_intout[1]; 24 | 25 | VDI_PARAMS(vdi_control, vdi_intin, 0L, vdi_intout, vdi_dummy); 26 | 27 | vdi_intin_long(0) = color_space; 28 | *(COLOR_ENTRY*)&vdi_intin[2] = *bg_color; 29 | vdi_intout[0] = 0; 30 | 31 | VDI_TRAP_ESC (vdi_params, handle, 201,3, 0,6); 32 | 33 | return vdi_intout[0]; 34 | } 35 | -------------------------------------------------------------------------------- /n_vsm_fg_color.c: -------------------------------------------------------------------------------- 1 | #include "gem_vdiP.h" 2 | #include "mt_gemx.h" 3 | 4 | /** 5 | * 6 | * @param handle Device handle 7 | * @param color_space color space 8 | * @param fg_color COLOR_ENTRY of foreground color 9 | * 10 | * @return -1=wrong subfunction number, 0=function not present, 1=all ok 11 | * 12 | * @since NVDI 5 ? 13 | * 14 | * 15 | * 16 | */ 17 | 18 | short 19 | vsm_fg_color (short handle, long color_space, COLOR_ENTRY * fg_color) 20 | { 21 | short vdi_control[VDI_CNTRLMAX]; 22 | short vdi_intin[6]; 23 | short vdi_intout[1]; 24 | 25 | VDI_PARAMS(vdi_control, vdi_intin, 0L, vdi_intout, vdi_dummy); 26 | 27 | vdi_intin_long(0) = color_space; 28 | *(COLOR_ENTRY*)&vdi_intin[2] = *fg_color; 29 | vdi_intout[0] = 0; 30 | 31 | VDI_TRAP_ESC (vdi_params, handle, 200,3, 0,6); 32 | 33 | return vdi_intout[0]; 34 | } 35 | -------------------------------------------------------------------------------- /n_vsr_bg_color.c: -------------------------------------------------------------------------------- 1 | #include "gem_vdiP.h" 2 | #include "mt_gemx.h" 3 | 4 | /** 5 | * 6 | * @param handle Device handle 7 | * @param color_space color space 8 | * @param bg_color COLOR_ENTRY of the background color 9 | * 10 | * @return -1=wrong subfunction number, 0=function not present, 1=all ok 11 | * 12 | * @since NVDI 5 ? 13 | * 14 | * 15 | * 16 | */ 17 | 18 | short 19 | vsr_bg_color (short handle, long color_space, COLOR_ENTRY * bg_color) 20 | { 21 | short vdi_control[VDI_CNTRLMAX]; 22 | short vdi_intin[6]; 23 | short vdi_intout[1]; 24 | 25 | VDI_PARAMS(vdi_control, vdi_intin, 0L, vdi_intout, vdi_dummy); 26 | 27 | vdi_intin_long(0) = color_space; 28 | *(COLOR_ENTRY*)&vdi_intin[2] = *bg_color; 29 | vdi_intout[0] = 0; 30 | 31 | VDI_TRAP_ESC (vdi_params, handle, 201,4, 0,6); 32 | 33 | return vdi_intout[0]; 34 | } 35 | -------------------------------------------------------------------------------- /n_vsr_fg_color.c: -------------------------------------------------------------------------------- 1 | #include "gem_vdiP.h" 2 | #include "mt_gemx.h" 3 | 4 | /** 5 | * 6 | * @param handle Device handle 7 | * @param color_space color space 8 | * @param fg_color COLOR_ENTRY of the background color 9 | * 10 | * @return -1=wrong subfunction number, 0=function not present, 1=all ok 11 | * 12 | * @since NVDI 5 ? 13 | * 14 | * 15 | * 16 | */ 17 | 18 | short 19 | vsr_fg_color (short handle, long color_space, COLOR_ENTRY * fg_color) 20 | { 21 | short vdi_control[VDI_CNTRLMAX]; 22 | short vdi_intin[6]; 23 | short vdi_intout[1]; 24 | 25 | VDI_PARAMS(vdi_control, vdi_intin, 0L, vdi_intout, vdi_dummy); 26 | 27 | vdi_intin_long(0) = color_space; 28 | *(COLOR_ENTRY*)&vdi_intin[2] = *fg_color; 29 | vdi_intout[0] = 0; 30 | 31 | VDI_TRAP_ESC (vdi_params, handle, 200,4, 0,6); 32 | 33 | return vdi_intout[0]; 34 | } 35 | -------------------------------------------------------------------------------- /n_vst_bg_color.c: -------------------------------------------------------------------------------- 1 | #include "gem_vdiP.h" 2 | #include "mt_gemx.h" 3 | 4 | /** 5 | * 6 | * @param handle Device handle 7 | * @param color_space color space 8 | * @param bg_color COLOR_ENTRY of background color 9 | * 10 | * @return -1=wrong subfunction number, 0=function not present, 1=all ok 11 | * 12 | * @since NVDI 5 ? 13 | * 14 | * 15 | * 16 | */ 17 | 18 | short 19 | vst_bg_color (short handle, long color_space, COLOR_ENTRY * bg_color) 20 | { 21 | short vdi_control[VDI_CNTRLMAX]; 22 | short vdi_intin[6]; 23 | short vdi_intout[1]; 24 | 25 | VDI_PARAMS(vdi_control, vdi_intin, 0L, vdi_intout, vdi_dummy); 26 | 27 | vdi_intin_long(0) = color_space; 28 | *(COLOR_ENTRY*)&vdi_intin[2] = *bg_color; 29 | vdi_intout[0] = 0; 30 | 31 | VDI_TRAP (vdi_params, handle, 201, 0,6); 32 | 33 | return vdi_intout[0]; 34 | } 35 | -------------------------------------------------------------------------------- /n_vst_fg_color.c: -------------------------------------------------------------------------------- 1 | #include "gem_vdiP.h" 2 | #include "mt_gemx.h" 3 | 4 | /** 5 | * 6 | * @param handle Device handle 7 | * @param color_space color space 8 | * @param fg_color COLOR_ENTRY of the foreground color 9 | * 10 | * @return -1=wrong subfunction number; 0=function not present; 1=all ok 11 | * 12 | * @since NVDI 5 ? 13 | * 14 | * 15 | * 16 | */ 17 | 18 | short 19 | vst_fg_color (short handle, long color_space, COLOR_ENTRY * fg_color) 20 | { 21 | short vdi_control[VDI_CNTRLMAX]; 22 | short vdi_intin[6]; 23 | short vdi_intout[1]; 24 | 25 | VDI_PARAMS(vdi_control, vdi_intin, 0L, vdi_intout, vdi_dummy); 26 | 27 | vdi_intin_long(0) = color_space; 28 | *(COLOR_ENTRY*)&vdi_intin[2] = *fg_color; 29 | vdi_intout[0] = 0; 30 | 31 | VDI_TRAP (vdi_params, handle, 200, 0,6); 32 | 33 | return vdi_intout[0]; 34 | } 35 | -------------------------------------------------------------------------------- /n_vst_skew.c: -------------------------------------------------------------------------------- 1 | #include "gem_vdiP.h" 2 | #include "mt_gemx.h" 3 | 4 | /** This function sets the skew of vector font characters in steps of 1/10 degrees. 5 | * The skewing angle is independent from vst_effects() and must be in a range 6 | * between -90 and +90 degrees. Positive angles will lean the characters to the 7 | * left whereas negative angles will lean them to the right. 8 | * 9 | * @param handle Device handle 10 | * @param skew angle in 1/10 degrees 11 | * 12 | * @return selected angle in 1/10 degrees 13 | * 14 | * @since NVDI 3.00 15 | * 16 | */ 17 | 18 | short 19 | vst_skew (short handle, short skew) 20 | { 21 | short vdi_control[VDI_CNTRLMAX]; 22 | short vdi_intout[1]; 23 | 24 | VDI_PARAMS(vdi_control, &skew, 0L, vdi_intout, vdi_dummy); 25 | 26 | VDI_TRAP (vdi_params, handle, 253, 0,1); 27 | 28 | return vdi_intout[0]; 29 | } 30 | -------------------------------------------------------------------------------- /pc.mak: -------------------------------------------------------------------------------- 1 | # makefile for gemlib 2 | # purec version 3 | 4 | # note: 5 | # CC_PUREC must point to your pcc.ttp program 6 | # AR_PUREC must point to your plink.ttp program 7 | # AS_PUREC must point to your pasm.ttp program 8 | # PURECINC must point to your purec/include directory 9 | 10 | CC = $(CC_PUREC) 11 | AS = $(AS_PUREC) 12 | AR = $(AR_PUREC) -J 13 | 14 | CFLAGS = -I$(PURECINC) -P 15 | 16 | include files.mak 17 | 18 | .SUFFIXES: 19 | .SUFFIXES: .c .s .o 20 | 21 | # PCC.TTP crashes with long filename, so... 22 | .c.o: 23 | cp $*.c tmppc.c 24 | $(CC) $(CFLAGS) -Otmppc.o tmppc.c 25 | mv -f tmppc.o $*.o 26 | 27 | # PASM.TTP generates filename in UPPERCASE, so... 28 | .s.o: 29 | $(AS) -OTMPPC.O $*.s 30 | mv TMPPC.O $*.o 31 | 32 | TARGET = $(LIB_PUREC) 33 | 34 | all: $(TARGET) 35 | 36 | $(TARGET): $(OBJ) $(PC_OBJ) 37 | rm -f $@ 38 | $(AR) $^ 39 | mv -f Linker.Out $@ 40 | -------------------------------------------------------------------------------- /pdlg_create.c: -------------------------------------------------------------------------------- 1 | #include "gem_aesP.h" 2 | #include "mt_gemx.h" 3 | 4 | /** initialises the print dialog 5 | * 6 | * @param dialog_flags Only 3D-flag at present: 7 | * - PDLG_3D (1) Display selection in 3D-look 8 | * @param global_aes global AES array 9 | * 10 | * @return Pointer to management structure 11 | * 12 | * @since mt_appl_getinfo(7) give informations on mt_pdlg_xx() functions availability 13 | * 14 | * On calling the function a 15 | * scan will be made for the printer drivers present and memory will be 16 | * allocated for the resource. 17 | * 18 | */ 19 | 20 | PRN_DIALOG * 21 | mt_pdlg_create(short dialog_flags, short *global_aes) 22 | { 23 | AES_PARAMS(200,1,0,0,1); 24 | 25 | aes_intin[0] = dialog_flags; 26 | aes_addrout[0] = 0; 27 | 28 | AES_TRAP(aes_params); 29 | 30 | return (void *)aes_addrout[0]; 31 | } 32 | -------------------------------------------------------------------------------- /pdlg_delete.c: -------------------------------------------------------------------------------- 1 | #include "gem_aesP.h" 2 | #include "mt_gemx.h" 3 | 4 | /** releases the memory for the print dialog 5 | * 6 | * @param prn_dialog Pointer to management structure 7 | * @param global_aes global AES array 8 | * 9 | * @return 1 10 | * 11 | * @since mt_appl_getinfo(7) give informations on mt_pdlg_xx() functions availability 12 | * 13 | */ 14 | 15 | short 16 | mt_pdlg_delete(PRN_DIALOG *prn_dialog, short *global_aes) 17 | { 18 | AES_PARAMS(201,0,1,1,0); 19 | 20 | aes_addrin[0] = (long)prn_dialog; 21 | aes_intout[0] = 0; 22 | 23 | AES_TRAP(aes_params); 24 | 25 | return aes_intout[0]; 26 | } 27 | -------------------------------------------------------------------------------- /pdlg_dflt_sett.c: -------------------------------------------------------------------------------- 1 | #include "gem_aesP.h" 2 | #include "mt_gemx.h" 3 | 4 | /** Initialises the structure to which \p settings points. 5 | * 6 | * @param prn_dialog Pointer to management structure 7 | * @param settings Printer settings 8 | * @param global_aes global AES array 9 | * 10 | * @return 1 11 | * 12 | * @since mt_appl_getinfo(7) give informations on mt_pdlg_xx() functions availability 13 | * 14 | * @note Structure length can be found with mt_pdlg_get_setsize(). 15 | * 16 | */ 17 | 18 | short 19 | mt_pdlg_dflt_settings(PRN_DIALOG *prn_dialog, PRN_SETTINGS *settings, short *global_aes) 20 | { 21 | AES_PARAMS(205,1,1,2,0); 22 | 23 | aes_intin[0] = 7; 24 | 25 | aes_addrin[0] = (long)prn_dialog; 26 | aes_addrin[1] = (long)settings; 27 | aes_intout[0] = 0; 28 | 29 | AES_TRAP(aes_params); 30 | 31 | return aes_intout[0]; 32 | } 33 | -------------------------------------------------------------------------------- /pdlg_free_sett.c: -------------------------------------------------------------------------------- 1 | #include "gem_aesP.h" 2 | #include "mt_gemx.h" 3 | 4 | /** Releases the memory allocated with mt_pdlg_new_settings(). 5 | * 6 | * @param settings Printer settings 7 | * @param global_aes global AES array 8 | * 9 | * @return unknown ??? 10 | * 11 | * @since mt_appl_getinfo(7) give informations on mt_pdlg_xx() functions availability 12 | * 13 | */ 14 | 15 | short 16 | mt_pdlg_free_settings(PRN_SETTINGS *settings, short *global_aes) 17 | { 18 | AES_PARAMS(205,1,1,1,0); 19 | 20 | aes_intin[0] = 6; 21 | 22 | aes_addrin[0] = (long)settings; 23 | aes_intout[0] = 0; 24 | 25 | AES_TRAP(aes_params); 26 | 27 | return aes_intout[0]; 28 | } 29 | -------------------------------------------------------------------------------- /pdlg_get_setsize.c: -------------------------------------------------------------------------------- 1 | #include "gem_aesP.h" 2 | #include "mt_gemx.h" 3 | 4 | /** returns the length of the PRN_SETTINGS structure 5 | * 6 | * @param global_aes global AES array 7 | * 8 | * @return length of the PRN_SETTINGS structure in bytes 9 | * 10 | * @since mt_appl_getinfo(7) give informations on mt_pdlg_xx() functions availability 11 | * 12 | */ 13 | 14 | long 15 | mt_pdlg_get_setsize(short *global_aes) 16 | { 17 | AES_PARAMS(204,1,2,0,0); 18 | 19 | aes_intin[0] = 0; 20 | aes_intout_long(0) = 0; 21 | 22 | AES_TRAP(aes_params); 23 | 24 | return aes_intout_long(0); 25 | } 26 | -------------------------------------------------------------------------------- /pdlg_new_sett.c: -------------------------------------------------------------------------------- 1 | #include "gem_aesP.h" 2 | #include "mt_gemx.h" 3 | 4 | /** Memory for printer settings is allocated, the structure is initialised 5 | * and returned 6 | * 7 | * @param prn_dialog Pointer to management structure 8 | * @param global_aes global AES array 9 | * 10 | * @return Printer settings 11 | * 12 | * @since mt_appl_getinfo(7) give informations on mt_pdlg_xx() functions availability 13 | * 14 | */ 15 | 16 | PRN_SETTINGS * 17 | mt_pdlg_new_settings(PRN_DIALOG *prn_dialog, short *global_aes) 18 | { 19 | AES_PARAMS(205,1,0,1,1); 20 | 21 | aes_intin[0] = 5; 22 | 23 | aes_addrin[0] = (long)prn_dialog; 24 | aes_addrout[0] = 0; 25 | 26 | AES_TRAP(aes_params); 27 | 28 | return (PRN_SETTINGS*) aes_addrout[0]; 29 | } 30 | -------------------------------------------------------------------------------- /pdlg_rmv_printers.c: -------------------------------------------------------------------------------- 1 | #include "gem_aesP.h" 2 | #include "mt_gemx.h" 3 | 4 | /** removes the printers installed with mt_pdlg_add_printers() from the binding. 5 | * 6 | * @param prn_dialog Pointer to management structure 7 | * @param global_aes global AES array 8 | * 9 | * @return unknown ??? 10 | * 11 | * @since mt_appl_getinfo(7) give informations on mt_pdlg_xx() functions availability 12 | * 13 | * @note mt_pdlg_remove_printers() must be called before mt_pdlg_delete(). 14 | * 15 | */ 16 | 17 | short 18 | mt_pdlg_remove_printers(PRN_DIALOG *prn_dialog, short *global_aes) 19 | { 20 | AES_PARAMS(205,1,1,1,0); 21 | 22 | aes_intin[0] = 1; 23 | 24 | aes_addrin[0] = (long) prn_dialog; 25 | aes_intout[0] = 0; 26 | 27 | AES_TRAP(aes_params); 28 | 29 | return aes_intout[0]; 30 | } 31 | -------------------------------------------------------------------------------- /pdlg_rmv_sub_dlgs.c: -------------------------------------------------------------------------------- 1 | #include "gem_aesP.h" 2 | #include "mt_gemx.h" 3 | 4 | /** removes the application's custom sub-dialogs 5 | * 6 | * @param prn_dialog Pointer to management structure 7 | * @param global_aes global AES array 8 | * 9 | * @return unknown ??? 10 | * 11 | * @since mt_appl_getinfo(7) give informations on mt_pdlg_xx() functions availability 12 | * 13 | */ 14 | 15 | short 16 | mt_pdlg_remove_sub_dialogs(PRN_DIALOG *prn_dialog, short *global_aes) 17 | { 18 | AES_PARAMS(205,1,1,1,0); 19 | 20 | aes_intin[0] = 4; 21 | 22 | aes_addrin[0] = (long)prn_dialog; 23 | aes_intout[0] = 0; 24 | 25 | AES_TRAP(aes_params); 26 | 27 | return aes_intout[0]; 28 | } 29 | -------------------------------------------------------------------------------- /pdlg_save_dflt_sett.c: -------------------------------------------------------------------------------- 1 | #include "gem_aesP.h" 2 | #include "mt_gemx.h" 3 | 4 | /** 5 | * 6 | * @param prn_dialog 7 | * @param settings 8 | * @param global_aes global AES array 9 | * 10 | * @return 11 | * 12 | * @since mt_appl_getinfo(7) give informations on mt_pdlg_xx() functions availability 13 | * 14 | * 15 | * 16 | */ 17 | 18 | short 19 | mt_pdlg_save_default_settings(PRN_DIALOG *prn_dialog, PRN_SETTINGS *settings, short *global_aes) 20 | { 21 | AES_PARAMS(205,1,1,2,0); 22 | 23 | aes_intin[0] = 10; 24 | 25 | aes_addrin[0] = (long)prn_dialog; 26 | aes_addrin[1] = (long)settings; 27 | aes_intout[0] = 0; 28 | 29 | AES_TRAP(aes_params); 30 | 31 | return aes_intout[0]; 32 | } 33 | -------------------------------------------------------------------------------- /pdlg_validate_sett.c: -------------------------------------------------------------------------------- 1 | #include "gem_aesP.h" 2 | #include "mt_gemx.h" 3 | 4 | /** Validate the printer settings and if necessary correct the structure 5 | * contents. 6 | * 7 | * @param prn_dialog Pointer to management structure 8 | * @param settings Printer settings 9 | * @param global_aes global AES array 10 | * 11 | * @return 0: Error \n 1: All OK 12 | * 13 | * @since mt_appl_getinfo(7) give informations on mt_pdlg_xx() functions availability 14 | * 15 | */ 16 | 17 | short 18 | mt_pdlg_validate_settings(PRN_DIALOG *prn_dialog, PRN_SETTINGS *settings, short *global_aes) 19 | { 20 | AES_PARAMS(205,1,1,2,0); 21 | 22 | aes_intin[0] = 8; 23 | 24 | aes_addrin[0] = (long)prn_dialog; 25 | aes_addrin[1] = (long)settings; 26 | aes_intout[0] = 0; 27 | 28 | AES_TRAP(aes_params); 29 | 30 | return aes_intout[0]; 31 | } 32 | -------------------------------------------------------------------------------- /rc_array_to_grect.c: -------------------------------------------------------------------------------- 1 | #include "mt_gem.h" 2 | 3 | /** transform a PXY-array structure to a GRECT structure 4 | * 5 | * @param array specify the area using a PXY-array 6 | * @param area will then contain the area in a GRECT structure 7 | * 8 | * @return \p area is returned. 9 | * 10 | * @sa grect_to_array() 11 | * 12 | */ 13 | 14 | GRECT * 15 | array_to_grect (const short *array, GRECT * area) 16 | { 17 | area->g_x = array[0]; 18 | area->g_y = array[1]; 19 | area->g_w = array[2]-array[0]+1; 20 | area->g_h = array[3]-array[1]+1; 21 | 22 | return area; 23 | } 24 | -------------------------------------------------------------------------------- /rc_copy.c: -------------------------------------------------------------------------------- 1 | #include "mt_gem.h" 2 | 3 | /** copy a GRECT structure 4 | * 5 | * @param src 6 | * @param dst 7 | * 8 | */ 9 | 10 | void rc_copy (const GRECT * src, GRECT * dst) 11 | { 12 | *dst = *src; 13 | } 14 | -------------------------------------------------------------------------------- /rc_equal.c: -------------------------------------------------------------------------------- 1 | #include "mt_gem.h" 2 | 3 | /** return non-zero value if both area are equal 4 | * 5 | * @param p1 an area 6 | * @param p2 an other area 7 | * 8 | * @return 0 if \p p1 and \p p2 are not the same area, any other 9 | * value (not 0) otherwise (\p p1 equal \p p2). 10 | * 11 | */ 12 | 13 | short 14 | rc_equal (const GRECT * p1, const GRECT * p2) 15 | { 16 | const long * a = (const long*)p1, 17 | * b = (const long*)p2; 18 | 19 | return ((a[0] == b[0]) && (a[1] == b[1])); 20 | } 21 | -------------------------------------------------------------------------------- /rc_grect_to_array.c: -------------------------------------------------------------------------------- 1 | #include "mt_gem.h" 2 | 3 | /** transform a GRECT structure to a PXY-array structure 4 | * 5 | * @param area specify the area using a GRECT structure 6 | * @param array will then contain the area in a PXY-array 7 | * 8 | * @return \p array is returned. 9 | * 10 | * @sa array_to_grect() 11 | * 12 | */ 13 | 14 | short * 15 | grect_to_array (const GRECT * area, short *array) 16 | { 17 | array[0] = area->g_x; 18 | array[1] = area->g_y; 19 | array[2] = area->g_x + area->g_w - 1; 20 | array[3] = area->g_y + area->g_h - 1; 21 | 22 | return array; 23 | } 24 | -------------------------------------------------------------------------------- /sox.mak: -------------------------------------------------------------------------------- 1 | # makefile for gemlib 2 | # sozobon version 3 | 4 | # note: 5 | # CC_SOX must point to your cc.ttp program 6 | # AR_SOX must point to your ar.ttp program 7 | 8 | CC = $(CC_SOX) 9 | AS = $(AS_SOX) 10 | AR = $(AR_SOX) 11 | 12 | CFLAGS = -O 13 | 14 | include files.mak 15 | 16 | .SUFFIXES: 17 | .SUFFIXES: .c .s .o 18 | 19 | .c.o: 20 | $(CC) $(CFLAGS) -c $*.c -o $*.o 21 | 22 | .s.o: 23 | $(CC) $(CFLAGS) -c $*.s -o $*.o 24 | 25 | TARGET = $(LIB_SOZOBON) 26 | 27 | all: $(TARGET) 28 | 29 | $(TARGET): $(OBJ) $(SX_OBJ) 30 | $(RM) $@ 31 | $(AR) -r $@ $^ 32 | -------------------------------------------------------------------------------- /u_v_alpha_text.c: -------------------------------------------------------------------------------- 1 | #include "gem_vdiP.h" 2 | #include "vdi_userdef.h" 3 | 4 | /** UDEF version of v_alpha_text(). See \ref overviewUDEF for details about UDEF feature 5 | */ 6 | 7 | void 8 | udef_v_alpha_text (short handle, const char *str) 9 | { 10 | short n = vdi_str2array_n (str, _VDIParBlk.vdi_intin, VDI_INTINMAX); 11 | 12 | VDI_PARAMS(_VDIParBlk.vdi_control, _VDIParBlk.vdi_intin, 0L, _VDIParBlk.vdi_intout, vdi_dummy); 13 | 14 | VDI_TRAP_ESC (vdi_params, handle, 5,25, 0,n); 15 | } 16 | -------------------------------------------------------------------------------- /u_v_bit_image.c: -------------------------------------------------------------------------------- 1 | #include "gem_vdiP.h" 2 | #include "vdi_userdef.h" 3 | 4 | 5 | /** UDEF version of v_bit_image(). See \ref overviewUDEF for details about UDEF feature 6 | */ 7 | 8 | void 9 | udef_v_bit_image (short handle, const char *filename, short aspect, short x_scale, 10 | short y_scale, short h_align, short v_align, short *pxy) 11 | { 12 | 13 | short n = 5 + vdi_str2array_n (filename, _VDIParBlk.vdi_intin + 5, VDI_INTINMAX-5); 14 | 15 | VDI_PARAMS(_VDIParBlk.vdi_control, _VDIParBlk.vdi_intin, pxy, vdi_dummy, vdi_dummy); 16 | 17 | _VDIParBlk.vdi_intin[0] = aspect; 18 | _VDIParBlk.vdi_intin[1] = x_scale; 19 | _VDIParBlk.vdi_intin[2] = y_scale; 20 | _VDIParBlk.vdi_intin[3] = h_align; 21 | _VDIParBlk.vdi_intin[4] = v_align; 22 | 23 | VDI_TRAP_ESC (vdi_params, handle, 5,23, 2,n); 24 | } 25 | -------------------------------------------------------------------------------- /u_v_curtext.c: -------------------------------------------------------------------------------- 1 | #include "gem_vdiP.h" 2 | #include "vdi_userdef.h" 3 | 4 | 5 | /** UDEF version of v_curtext(). See \ref overviewUDEF for details about UDEF feature 6 | */ 7 | 8 | void 9 | udef_v_curtext (short handle, const char *str) 10 | { 11 | short n = vdi_str2array_n (str, _VDIParBlk.vdi_intin, VDI_INTINMAX); 12 | 13 | VDI_PARAMS(_VDIParBlk.vdi_control, _VDIParBlk.vdi_intin, 0L, vdi_dummy, vdi_dummy ); 14 | 15 | VDI_TRAP_ESC (vdi_params, handle, 5,12, 0,n); 16 | } 17 | -------------------------------------------------------------------------------- /u_v_ftext.c: -------------------------------------------------------------------------------- 1 | #include "gem_vdiP.h" 2 | #include "mt_gemx.h" 3 | #include "vdi_userdef.h" 4 | 5 | 6 | /** UDEF version of v_ftext(). See \ref overviewUDEF for details about UDEF feature 7 | */ 8 | 9 | void 10 | udef_v_ftext (short handle, short x, short y, const char *str) 11 | { 12 | short n = vdi_str2array_n (str, _VDIParBlk.vdi_intin, VDI_INTINMAX); 13 | 14 | VDI_PARAMS(_VDIParBlk.vdi_control, _VDIParBlk.vdi_intin, _VDIParBlk.vdi_ptsin, vdi_dummy, vdi_dummy); 15 | 16 | _VDIParBlk.vdi_ptsin[0] = x; 17 | _VDIParBlk.vdi_ptsin[1] = y; 18 | 19 | VDI_TRAP (vdi_params, handle, 241, 1,n); 20 | } 21 | -------------------------------------------------------------------------------- /u_v_ftext_offset.c: -------------------------------------------------------------------------------- 1 | #include "gem_vdiP.h" 2 | #include "mt_gemx.h" 3 | #include "vdi_userdef.h" 4 | 5 | 6 | /** UDEF version of v_ftext_offset(). See \ref overviewUDEF for details about UDEF feature 7 | */ 8 | 9 | void 10 | udef_v_ftext_offset (short handle, short x, short y, 11 | const char *str, const short *offset) 12 | { const long * src = (const long*)offset; 13 | long * dst = (long*)_VDIParBlk.vdi_ptsin; 14 | short i, len = vdi_str2array_n (str, _VDIParBlk.vdi_intin, VDI_PTSINMAX); 15 | 16 | VDI_PARAMS(_VDIParBlk.vdi_control, _VDIParBlk.vdi_intin, _VDIParBlk.vdi_ptsin, vdi_dummy, vdi_dummy); 17 | 18 | _VDIParBlk.vdi_ptsin[0] = x; 19 | _VDIParBlk.vdi_ptsin[1] = y; 20 | for (i = 0; i < len; i++) { 21 | *(++dst) = *(src++); 22 | } 23 | 24 | VDI_TRAP (vdi_params, handle, 241, (len +1),len); 25 | } 26 | -------------------------------------------------------------------------------- /u_v_ftext_offset16.c: -------------------------------------------------------------------------------- 1 | #include "gem_vdiP.h" 2 | #include "mt_gemx.h" 3 | #include "vdi_userdef.h" 4 | 5 | 6 | /** UDEF version of v_ftext_offset16(). See \ref overviewUDEF for details about UDEF feature 7 | */ 8 | 9 | void 10 | udef_v_ftext_offset16 (short handle, short x, short y, 11 | const WCHAR * wstr, const short * offset) 12 | { 13 | const long * src = (const long*)offset; 14 | long * dst = (long*)_VDIParBlk.vdi_ptsin; 15 | short i, len = vdi_wstrlen ((const short *)wstr); 16 | 17 | VDI_PARAMS(_VDIParBlk.vdi_control, (const short *)wstr, _VDIParBlk.vdi_ptsin, vdi_dummy, vdi_dummy); 18 | if(len>VDI_PTSINMAX) len=VDI_PTSINMAX; 19 | 20 | 21 | _VDIParBlk.vdi_ptsin[0] = x; 22 | _VDIParBlk.vdi_ptsin[1] = y; 23 | for (i = 0; i < len; i++) { 24 | *(++dst) = *(src++); 25 | } 26 | 27 | VDI_TRAP (vdi_params, handle, 241, (len +1),len); 28 | } 29 | -------------------------------------------------------------------------------- /u_v_ftext_offset16n.c: -------------------------------------------------------------------------------- 1 | #include "gem_vdiP.h" 2 | #include "mt_gemx.h" 3 | #include "vdi_userdef.h" 4 | 5 | 6 | /** UDEF version of v_ftext_offset16n(). See \ref overviewUDEF for details about UDEF feature 7 | */ 8 | 9 | void 10 | udef_v_ftext_offset16n (short handle, short x, short y, 11 | const WCHAR * wstr, short num, const short * offset) 12 | { 13 | const long * src = (const long*)offset; 14 | long * dst = (long*)_VDIParBlk.vdi_ptsin; 15 | short i; 16 | 17 | VDI_PARAMS(_VDIParBlk.vdi_control, (const short *)wstr, _VDIParBlk.vdi_ptsin, vdi_dummy, vdi_dummy); 18 | if(num>VDI_PTSINMAX) num=VDI_PTSINMAX; 19 | 20 | 21 | _VDIParBlk.vdi_ptsin[0] = x; 22 | _VDIParBlk.vdi_ptsin[1] = y; 23 | for (i = 0; i < num; i++) { 24 | *(++dst) = *(src++); 25 | } 26 | 27 | VDI_TRAP (vdi_params, handle, 241, (num +1),num); 28 | } 29 | -------------------------------------------------------------------------------- /u_v_ftextn.c: -------------------------------------------------------------------------------- 1 | #include "gem_vdiP.h" 2 | #include "mt_gemx.h" 3 | #include "vdi_userdef.h" 4 | 5 | 6 | /** UDEF version of v_ftext(). See \ref overviewUDEF for details about UDEF feature 7 | */ 8 | 9 | void 10 | udef_v_ftextn (short handle, short x, short y, const char *str, short num) 11 | { 12 | VDI_PARAMS(_VDIParBlk.vdi_control, _VDIParBlk.vdi_intin, _VDIParBlk.vdi_ptsin, vdi_dummy, vdi_dummy); 13 | 14 | num = vdi_str2array_n (str, _VDIParBlk.vdi_intin, num); 15 | 16 | _VDIParBlk.vdi_ptsin[0] = x; 17 | _VDIParBlk.vdi_ptsin[1] = y; 18 | 19 | VDI_TRAP (vdi_params, handle, 241, 1,num); 20 | } 21 | -------------------------------------------------------------------------------- /u_v_gtext.c: -------------------------------------------------------------------------------- 1 | #include "gem_vdiP.h" 2 | #include "vdi_userdef.h" 3 | 4 | 5 | /** UDEF version of v_gtext(). See \ref overviewUDEF for details about UDEF feature 6 | */ 7 | 8 | void 9 | udef_v_gtext (short handle, short x, short y, const char *str) 10 | { 11 | short n = vdi_str2array_n (str, _VDIParBlk.vdi_intin, VDI_INTINMAX); 12 | 13 | VDI_PARAMS(_VDIParBlk.vdi_control, _VDIParBlk.vdi_intin, _VDIParBlk.vdi_ptsin, vdi_dummy, vdi_dummy ); 14 | 15 | _VDIParBlk.vdi_ptsin[0] = x; 16 | _VDIParBlk.vdi_ptsin[1] = y; 17 | 18 | VDI_TRAP (vdi_params, handle, 8, 1,n); 19 | } 20 | -------------------------------------------------------------------------------- /u_v_loadcache.c: -------------------------------------------------------------------------------- 1 | #include "gem_vdiP.h" 2 | #include "vdi_userdef.h" 3 | 4 | 5 | /** UDEF version of v_loadcache(). See \ref overviewUDEF for details about UDEF feature 6 | */ 7 | 8 | short 9 | udef_v_loadcache (short handle, const char *filename, short mode) 10 | { 11 | short n = 1 + vdi_str2array_n (filename, _VDIParBlk.vdi_intin + 1, VDI_INTINMAX-1); 12 | 13 | VDI_PARAMS(_VDIParBlk.vdi_control, _VDIParBlk.vdi_intin, 0L, _VDIParBlk.vdi_intout, _VDIParBlk.vdi_ptsout ); 14 | 15 | _VDIParBlk.vdi_intin[0] = mode; 16 | 17 | VDI_TRAP (vdi_params, handle, 250, 0, n); 18 | 19 | return _VDIParBlk.vdi_intout[0]; 20 | } 21 | -------------------------------------------------------------------------------- /u_v_savecache.c: -------------------------------------------------------------------------------- 1 | #include "gem_vdiP.h" 2 | #include "vdi_userdef.h" 3 | 4 | 5 | /** UDEF version of v_savecache(). See \ref overviewUDEF for details about UDEF feature 6 | */ 7 | 8 | short 9 | udef_v_savecache (short handle, const char *filename) 10 | { 11 | short n = vdi_str2array_n (filename, _VDIParBlk.vdi_intin, VDI_INTINMAX); 12 | 13 | VDI_PARAMS(_VDIParBlk.vdi_control, _VDIParBlk.vdi_intin, 0L, _VDIParBlk.vdi_intout, vdi_dummy ); 14 | 15 | VDI_TRAP (vdi_params, handle, 249, 0,n); 16 | 17 | return _VDIParBlk.vdi_intout[0]; 18 | } 19 | -------------------------------------------------------------------------------- /u_vm_filename.c: -------------------------------------------------------------------------------- 1 | #include "gem_vdiP.h" 2 | #include "vdi_userdef.h" 3 | 4 | 5 | /** UDEF version of vm_filename(). See \ref overviewUDEF for details about UDEF feature 6 | */ 7 | 8 | void 9 | udef_vm_filename (short handle, const char *filename) 10 | { 11 | short n = vdi_str2array_n (filename, _VDIParBlk.vdi_intin, VDI_INTINMAX); 12 | 13 | VDI_PARAMS(_VDIParBlk.vdi_control, _VDIParBlk.vdi_intin, 0L, vdi_dummy, vdi_dummy); 14 | 15 | VDI_TRAP_ESC (vdi_params, handle, 5,100, 0,n); 16 | } 17 | -------------------------------------------------------------------------------- /u_vq_hilite_color.c: -------------------------------------------------------------------------------- 1 | #include "gem_vdiP.h" 2 | #include "mt_gemx.h" 3 | #include "vdi_userdef.h" 4 | 5 | 6 | /** UDEF version of vq_hilite_color(). See \ref overviewUDEF for details about UDEF feature 7 | */ 8 | 9 | long 10 | udef_vq_hilite_color (short handle, COLOR_ENTRY * hilite_color) 11 | { 12 | VDI_PARAMS(_VDIParBlk.vdi_control, 0L, 0L, _VDIParBlk.vdi_intout, vdi_dummy); 13 | 14 | VDI_TRAP_00 (vdi_params, handle, 209); 15 | 16 | #if CHECK_NULLPTR 17 | if (hilite_color) 18 | #endif 19 | *hilite_color = *(COLOR_ENTRY*)&_VDIParBlk.vdi_intout[2]; 20 | 21 | return vdi_intout_long(0); 22 | } 23 | -------------------------------------------------------------------------------- /u_vqt_extent.c: -------------------------------------------------------------------------------- 1 | #include "gem_vdiP.h" 2 | #include "vdi_userdef.h" 3 | 4 | 5 | /** UDEF version of vqt_extent(). See \ref overviewUDEF for details about UDEF feature 6 | */ 7 | 8 | void 9 | udef_vqt_extent (short handle, const char *str, short extent[]) 10 | { 11 | short n = vdi_str2array_n (str, _VDIParBlk.vdi_intin, VDI_INTINMAX); 12 | 13 | VDI_PARAMS(_VDIParBlk.vdi_control, _VDIParBlk.vdi_intin, 0L, vdi_dummy, extent ); 14 | 15 | VDI_TRAP (vdi_params, handle, 116, 0,n); 16 | } 17 | -------------------------------------------------------------------------------- /u_vqt_f_extent.c: -------------------------------------------------------------------------------- 1 | #include "gem_vdiP.h" 2 | #include "mt_gemx.h" 3 | #include "vdi_userdef.h" 4 | 5 | 6 | /** UDEF version of vqt_f_extent(). See \ref overviewUDEF for details about UDEF feature 7 | */ 8 | 9 | void 10 | udef_vqt_f_extent (short handle, const char *str, short extent[]) 11 | { 12 | short n = vdi_str2array_n (str, _VDIParBlk.vdi_intin, VDI_INTINMAX); 13 | 14 | VDI_PARAMS(_VDIParBlk.vdi_control, _VDIParBlk.vdi_intin, 0L, vdi_dummy, extent); 15 | 16 | VDI_TRAP (vdi_params, handle, 240, 0,n); 17 | } 18 | -------------------------------------------------------------------------------- /u_vqt_f_extentn.c: -------------------------------------------------------------------------------- 1 | #include "gem_vdiP.h" 2 | #include "mt_gemx.h" 3 | #include "vdi_userdef.h" 4 | 5 | 6 | /** UDEF version of vqt_f_extent(). See \ref overviewUDEF for details about UDEF feature 7 | */ 8 | 9 | void 10 | udef_vqt_f_extentn (short handle, const char *str, short num, short extent[]) 11 | { 12 | VDI_PARAMS(_VDIParBlk.vdi_control, _VDIParBlk.vdi_intin, 0L, vdi_dummy, extent); 13 | 14 | num = vdi_str2array_n (str, _VDIParBlk.vdi_intin, num); 15 | 16 | VDI_TRAP (vdi_params, handle, 240, 0,num); 17 | } 18 | -------------------------------------------------------------------------------- /u_vqt_fontheader.c: -------------------------------------------------------------------------------- 1 | #include "gem_vdiP.h" 2 | #include "mt_gemx.h" 3 | #include "vdi_userdef.h" 4 | 5 | 6 | /** UDEF version of vqt_fontheader(). See \ref overviewUDEF for details about UDEF feature 7 | */ 8 | 9 | void 10 | udef_vqt_fontheader (short handle, char *buffer, char *pathname) 11 | { 12 | VDI_PARAMS(_VDIParBlk.vdi_control, (short*)&buffer, 0L, _VDIParBlk.vdi_intout, vdi_dummy); 13 | 14 | VDI_TRAP (vdi_params, handle, 232, 0,2); 15 | 16 | vdi_array2str (_VDIParBlk.vdi_intout, pathname, _VDIParBlk.vdi_control[4]); 17 | } 18 | -------------------------------------------------------------------------------- /u_vqt_real_extent.c: -------------------------------------------------------------------------------- 1 | #include "gem_vdiP.h" 2 | #include "mt_gemx.h" 3 | #include "vdi_userdef.h" 4 | 5 | 6 | /** UDEF version of vqt_real_extent(). See \ref overviewUDEF for details about UDEF feature 7 | */ 8 | 9 | void 10 | udef_vqt_real_extent (short handle, short x, short y, const char *string, short extent[]) 11 | { 12 | short n = vdi_str2array_n (string, _VDIParBlk.vdi_intin, VDI_INTINMAX); 13 | 14 | VDI_PARAMS(_VDIParBlk.vdi_control, _VDIParBlk.vdi_intin, _VDIParBlk.vdi_ptsin, vdi_dummy, extent); 15 | 16 | _VDIParBlk.vdi_ptsin[0] = x; 17 | _VDIParBlk.vdi_ptsin[1] = y; 18 | 19 | VDI_TRAP_ESC (vdi_params, handle, 240,4200, 1,n); 20 | } 21 | -------------------------------------------------------------------------------- /u_vqt_real_extentn.c: -------------------------------------------------------------------------------- 1 | #include "gem_vdiP.h" 2 | #include "mt_gemx.h" 3 | #include "vdi_userdef.h" 4 | 5 | 6 | /** UDEF version of vqt_real_extentn(). See \ref overviewUDEF for details about UDEF feature 7 | */ 8 | 9 | void 10 | udef_vqt_real_extentn (short handle, short x, short y, const char *string, short num, short extent[]) 11 | { 12 | VDI_PARAMS(_VDIParBlk.vdi_control, _VDIParBlk.vdi_intin, _VDIParBlk.vdi_ptsin, vdi_dummy, extent); 13 | 14 | num = vdi_str2array_n (string, _VDIParBlk.vdi_intin, num); 15 | 16 | _VDIParBlk.vdi_ptsin[0] = x; 17 | _VDIParBlk.vdi_ptsin[1] = y; 18 | 19 | VDI_TRAP_ESC (vdi_params, handle, 240,4200, 1,num); 20 | } 21 | -------------------------------------------------------------------------------- /u_vrq_string.c: -------------------------------------------------------------------------------- 1 | #include "gem_vdiP.h" 2 | #include "vdi_userdef.h" 3 | 4 | 5 | /** UDEF version of vrq_string(). See \ref overviewUDEF for details about UDEF feature 6 | */ 7 | 8 | void 9 | udef_vrq_string (short handle, short len, short echo, short echoxy[], char *str) 10 | { 11 | 12 | VDI_PARAMS(_VDIParBlk.vdi_control, _VDIParBlk.vdi_intin, echoxy, _VDIParBlk.vdi_intout, vdi_dummy ); 13 | 14 | _VDIParBlk.vdi_intin[0] = len; 15 | _VDIParBlk.vdi_intin[1] = echo; 16 | 17 | VDI_TRAP (vdi_params, handle, 31, 1,2); 18 | 19 | vdi_array2str (_VDIParBlk.vdi_intout, str, _VDIParBlk.vdi_control[4]); 20 | } 21 | -------------------------------------------------------------------------------- /u_vs_document_info.c: -------------------------------------------------------------------------------- 1 | #include "gem_vdiP.h" 2 | #include "mt_gemx.h" 3 | #include "vdi_userdef.h" 4 | 5 | 6 | /** UDEF version of vs_document_info(). See \ref overviewUDEF for details about UDEF feature 7 | */ 8 | 9 | short 10 | udef_vs_document_info (short handle, short type, char *s, short wchar) 11 | { 12 | short n = 1; 13 | 14 | VDI_PARAMS(_VDIParBlk.vdi_control, _VDIParBlk.vdi_intin, 0L, _VDIParBlk.vdi_intout, vdi_dummy); 15 | 16 | _VDIParBlk.vdi_intout[0] = 0; 17 | _VDIParBlk.vdi_intin[0] = type; 18 | if (wchar) { 19 | /* 16bit strings not yet supported! */ 20 | return 0; 21 | 22 | } else { 23 | n += vdi_str2array_n (s, _VDIParBlk.vdi_intin + 1, VDI_INTINMAX-1); 24 | } 25 | VDI_TRAP_ESC (vdi_params, handle, 5,2103, 0,n); 26 | 27 | return _VDIParBlk.vdi_intout[0]; 28 | } 29 | -------------------------------------------------------------------------------- /u_vsm_string.c: -------------------------------------------------------------------------------- 1 | #include "gem_vdiP.h" 2 | #include "vdi_userdef.h" 3 | 4 | 5 | /** UDEF version of vsm_string(). See \ref overviewUDEF for details about UDEF feature 6 | */ 7 | 8 | 9 | short 10 | udef_vsm_string (short handle, short len, short echo, short echoxy[], char *str) 11 | { 12 | 13 | VDI_PARAMS(_VDIParBlk.vdi_control, _VDIParBlk.vdi_intin, _VDIParBlk.vdi_ptsin, _VDIParBlk.vdi_intout, vdi_dummy ); 14 | 15 | _VDIParBlk.vdi_intin[0] = len; 16 | _VDIParBlk.vdi_intin[1] = echo; 17 | _VDIParBlk.vdi_ptsin[0] = echoxy[0]; 18 | _VDIParBlk.vdi_ptsin[1] = echoxy[1]; 19 | 20 | VDI_TRAP (vdi_params, handle, 31, 1,2); 21 | 22 | vdi_array2str (_VDIParBlk.vdi_intout, str, _VDIParBlk.vdi_control[4]); 23 | 24 | return _VDIParBlk.vdi_control[4]; 25 | } 26 | -------------------------------------------------------------------------------- /u_vst_error.c: -------------------------------------------------------------------------------- 1 | #include "gem_vdiP.h" 2 | #include "vdi_userdef.h" 3 | 4 | 5 | /** UDEF version of vst_error(). See \ref overviewUDEF for details about UDEF feature 6 | */ 7 | 8 | void 9 | udef_vst_error (short handle, short mode, short *errorvar) 10 | { 11 | 12 | VDI_PARAMS(_VDIParBlk.vdi_control, _VDIParBlk.vdi_intin, 0L, _VDIParBlk.vdi_intout, _VDIParBlk.vdi_ptsout ); 13 | 14 | _VDIParBlk.vdi_intin[0] = mode; 15 | vdi_intin_ptr(1, short *) = errorvar; 16 | 17 | VDI_TRAP (vdi_params, handle, 245, 0, 1 + N_PTRINTS); 18 | } 19 | -------------------------------------------------------------------------------- /v_alpha_text.c: -------------------------------------------------------------------------------- 1 | #include "gem_vdiP.h" 2 | 3 | /** 4 | * 5 | * @param handle Device handle 6 | * @param str string 7 | * 8 | * @since all VDI versions 9 | * 10 | * 11 | * 12 | */ 13 | 14 | void 15 | v_alpha_text (short handle, const char *str) 16 | { 17 | short vdi_control[VDI_CNTRLMAX]; 18 | short vdi_intin[VDI_INTINMAX]; 19 | short vdi_intout[5]; /* from TOS.HYP */ 20 | short n = vdi_str2array_n (str, vdi_intin, VDI_INTINMAX); 21 | 22 | VDI_PARAMS(vdi_control, vdi_intin, 0L, vdi_intout, vdi_dummy); 23 | 24 | VDI_TRAP_ESC (vdi_params, handle, 5,25, 0,n); 25 | } 26 | -------------------------------------------------------------------------------- /v_alpha_text16n.c: -------------------------------------------------------------------------------- 1 | #include "gem_vdiP.h" 2 | 3 | /** 4 | * 5 | * @param handle Device handle 6 | * @param wstr string (16 bits per character) 7 | * @param num string len 8 | * 9 | * @since all VDI versions 10 | * 11 | * 12 | * 13 | */ 14 | 15 | void 16 | v_alpha_text16n (short handle, const short * wstr, short num) 17 | { 18 | short vdi_control[VDI_CNTRLMAX]; 19 | short vdi_intout[5]; /* from TOS.HYP */ 20 | 21 | VDI_PARAMS(vdi_control, wstr, 0L, vdi_intout, vdi_dummy); 22 | 23 | VDI_TRAP_ESC (vdi_params, handle, 5,25, 0,num); 24 | } 25 | -------------------------------------------------------------------------------- /v_bar.c: -------------------------------------------------------------------------------- 1 | #include "gem_vdiP.h" 2 | 3 | /** draws a filled rectangle. In contrast to "FILLED RECTANGLE" a 4 | * border is drawn. 5 | * 6 | * @param handle Device handle 7 | * @param pxy coordinates of the rectangle 8 | * 9 | * @since all VDI versions 10 | * 11 | */ 12 | 13 | void 14 | v_bar (short handle, short pxy[]) 15 | { 16 | short vdi_control[VDI_CNTRLMAX]; 17 | 18 | VDI_PARAMS(vdi_control, 0L, pxy, vdi_dummy, vdi_dummy); 19 | 20 | VDI_TRAP_ESC (vdi_params, handle, 11,1, 2,0); 21 | } 22 | -------------------------------------------------------------------------------- /v_circle.c: -------------------------------------------------------------------------------- 1 | #include "gem_vdiP.h" 2 | 3 | /** draws a filled circle 4 | * 5 | * @param handle Device handle 6 | * @param x x-coordinate of center point of circle 7 | * @param y y-coordinate of center point of circle 8 | * @param radius radius 9 | * 10 | * @since all VDI versions 11 | * 12 | */ 13 | 14 | void 15 | v_circle (short handle, short x, short y, short radius) 16 | { 17 | short vdi_control[VDI_CNTRLMAX]; 18 | short vdi_ptsin[6]; 19 | 20 | VDI_PARAMS(vdi_control, 0L, vdi_ptsin, vdi_dummy, vdi_dummy); 21 | 22 | vdi_ptsin[0] = x; 23 | vdi_ptsin[1] = y; 24 | vdi_ptsin[2] = 0; 25 | vdi_ptsin[3] = 0; 26 | vdi_ptsin[4] = radius; 27 | vdi_ptsin[5] = 0; 28 | 29 | VDI_TRAP_ESC (vdi_params, handle, 11,4, 3,0); 30 | } 31 | -------------------------------------------------------------------------------- /v_clear_disp_list.c: -------------------------------------------------------------------------------- 1 | #include "gem_vdiP.h" 2 | 3 | /** This function for printer or plotter drivers clears the printing buffer 4 | * (and deletes all previous commands). In contrast to v_clrwk() it does 5 | * not advance the page. 6 | * 7 | * @param handle Device handle 8 | * 9 | * @since all VDI versions 10 | * 11 | * This function should be called if the user interrupts printing while your 12 | * application generates the page. 13 | * 14 | */ 15 | 16 | void 17 | v_clear_disp_list (short handle) 18 | { 19 | short vdi_control[VDI_CNTRLMAX]; 20 | 21 | VDI_PARAMS(vdi_control, 0L, 0L, vdi_dummy, vdi_dummy); 22 | 23 | VDI_TRAP_ESC (vdi_params, handle, 5,22, 0,0); 24 | } 25 | -------------------------------------------------------------------------------- /v_clrwk.c: -------------------------------------------------------------------------------- 1 | #include "gem_vdiP.h" 2 | 3 | /** erases the screen or - if the device is a printer or 4 | * plotter - advances the page and clears the printing buffer. 5 | * 6 | * @param handle Device handle 7 | * 8 | * @since all VDI versions 9 | * 10 | * @note With GEM VDI, you do not need to do a 11 | * Clear Workstation after an Open Workstation 12 | * because the display is cleared at Open 13 | * Workstation. 14 | * 15 | */ 16 | 17 | void 18 | v_clrwk (short handle) 19 | { 20 | short vdi_control[VDI_CNTRLMAX]; 21 | 22 | VDI_PARAMS(vdi_control, 0L, 0L, vdi_dummy, vdi_dummy); 23 | 24 | VDI_TRAP_00 (vdi_params, handle, 3); 25 | } 26 | -------------------------------------------------------------------------------- /v_clsvwk.c: -------------------------------------------------------------------------------- 1 | #include "gem_vdiP.h" 2 | 3 | /** closes a virtual workstation 4 | * 5 | * @param handle Device handle 6 | * 7 | * @since all VDI versions 8 | * 9 | */ 10 | 11 | void 12 | v_clsvwk (short handle) 13 | { 14 | short vdi_control[VDI_CNTRLMAX]; 15 | 16 | VDI_PARAMS(vdi_control, 0L, 0L, vdi_dummy, vdi_dummy ); 17 | 18 | VDI_TRAP_00 (vdi_params, handle, 101); 19 | } 20 | -------------------------------------------------------------------------------- /v_clswk.c: -------------------------------------------------------------------------------- 1 | #include "gem_vdiP.h" 2 | 3 | /** closes a physical workstation 4 | * 5 | * @param handle Device handle 6 | * 7 | * @since all VDI versions 8 | * 9 | * If you call v_clswk() for a printer driver and if you have not called v_updwk() 10 | * or v_clear_disp_list() before, buffered commands will be executed and sent to 11 | * the printer. 12 | * 13 | */ 14 | 15 | void 16 | v_clswk (short handle) 17 | { 18 | short vdi_control[VDI_CNTRLMAX]; 19 | 20 | VDI_PARAMS(vdi_control, 0L, 0L, vdi_dummy, vdi_dummy); 21 | 22 | VDI_TRAP_00 (vdi_params, handle, 2); 23 | } 24 | -------------------------------------------------------------------------------- /v_contourfill.c: -------------------------------------------------------------------------------- 1 | #include "gem_vdiP.h" 2 | 3 | /** fills an area which is limited by another color or the edges of 4 | * the display. Use this function on the screen only! 5 | * 6 | * @param handle Device handle 7 | * @param x x-coordinate 8 | * @param y y-coordinate 9 | * @param index color index 10 | * 11 | * @since all VDI versions 12 | * 13 | */ 14 | 15 | void 16 | v_contourfill (short handle, short x, short y, short index) 17 | { 18 | short vdi_control[VDI_CNTRLMAX]; 19 | short vdi_ptsin[2]; 20 | 21 | VDI_PARAMS(vdi_control, &index, vdi_ptsin, vdi_dummy, vdi_dummy); 22 | 23 | vdi_ptsin[0] = x; 24 | vdi_ptsin[1] = y; 25 | 26 | VDI_TRAP (vdi_params, handle, 103, 1,1); 27 | } 28 | -------------------------------------------------------------------------------- /v_curdown.c: -------------------------------------------------------------------------------- 1 | #include "gem_vdiP.h" 2 | 3 | /** moves the cursor down one row. If the cursor is already in 4 | * the last row, nothing happens. 5 | * 6 | * @param handle Device handle 7 | * 8 | * @since all VDI versions 9 | * 10 | */ 11 | 12 | void 13 | v_curdown (short handle) 14 | { 15 | short vdi_control[VDI_CNTRLMAX]; 16 | 17 | VDI_PARAMS(vdi_control, 0L, 0L, vdi_dummy, vdi_dummy ); 18 | 19 | VDI_TRAP_ESC (vdi_params, handle, 5,5, 0,0); 20 | } 21 | -------------------------------------------------------------------------------- /v_curhome.c: -------------------------------------------------------------------------------- 1 | #include "gem_vdiP.h" 2 | 3 | /** This function moves the cursor to the upper left character cell 4 | * 5 | * @param handle Device handle 6 | * 7 | * @since all VDI versions 8 | * 9 | */ 10 | 11 | void 12 | v_curhome (short handle) 13 | { 14 | short vdi_control[VDI_CNTRLMAX]; 15 | 16 | VDI_PARAMS(vdi_control, 0L, 0L, vdi_dummy, vdi_dummy ); 17 | 18 | VDI_TRAP_ESC (vdi_params, handle, 5,8, 0,0); 19 | } 20 | -------------------------------------------------------------------------------- /v_curleft.c: -------------------------------------------------------------------------------- 1 | #include "gem_vdiP.h" 2 | 3 | /** The cursor is moved left. If it is already in 4 | * the first column, nothing happens. 5 | * 6 | * @param handle Device handle 7 | * 8 | * @since all VDI versions 9 | * 10 | */ 11 | 12 | void 13 | v_curleft (short handle) 14 | { 15 | short vdi_control[VDI_CNTRLMAX]; 16 | 17 | VDI_PARAMS(vdi_control, 0L, 0L, vdi_dummy, vdi_dummy ); 18 | 19 | VDI_TRAP_ESC (vdi_params, handle, 5,7, 0,0); 20 | } 21 | -------------------------------------------------------------------------------- /v_curright.c: -------------------------------------------------------------------------------- 1 | #include "gem_vdiP.h" 2 | 3 | /** moves the cursor right. If the cursor is already in the 4 | * last column, nothing happens. 5 | * 6 | * @param handle Device handle 7 | * 8 | * @since all VDI versions 9 | * 10 | */ 11 | 12 | void 13 | v_curright (short handle) 14 | { 15 | short vdi_control[VDI_CNTRLMAX]; 16 | 17 | VDI_PARAMS(vdi_control, 0L, 0L, vdi_dummy, vdi_dummy ); 18 | 19 | VDI_TRAP_ESC (vdi_params, handle, 5,6, 0,0); 20 | } 21 | -------------------------------------------------------------------------------- /v_curtext.c: -------------------------------------------------------------------------------- 1 | #include "gem_vdiP.h" 2 | 3 | /** This function displays a string. The string starts at the current cursor 4 | * position. 5 | * 6 | * @param handle Device handle 7 | * @param str string 8 | * 9 | * @since all VDI versions 10 | * 11 | */ 12 | 13 | void 14 | v_curtext (short handle, const char *str) 15 | { 16 | short vdi_control[VDI_CNTRLMAX]; 17 | short vdi_intin[VDI_INTINMAX]; 18 | short n = vdi_str2array_n (str, vdi_intin, VDI_INTINMAX); 19 | 20 | VDI_PARAMS(vdi_control, vdi_intin, 0L, vdi_dummy, vdi_dummy ); 21 | 22 | VDI_TRAP_ESC (vdi_params, handle, 5,12, 0,n); 23 | } 24 | -------------------------------------------------------------------------------- /v_curtext16n.c: -------------------------------------------------------------------------------- 1 | #include "gem_vdiP.h" 2 | 3 | /** This function displays a string. The string starts at the current cursor 4 | * position. 5 | * 6 | * @param handle Device handle 7 | * @param wstr string (16 bits per character) 8 | * @param num string len 9 | * 10 | * @since all VDI versions 11 | * 12 | */ 13 | 14 | void 15 | v_curtext16n (short handle, const short * wstr, short num) 16 | { 17 | short vdi_control[VDI_CNTRLMAX]; 18 | 19 | VDI_PARAMS(vdi_control, wstr, 0L, vdi_dummy, vdi_dummy ); 20 | 21 | VDI_TRAP_ESC (vdi_params, handle, 5,12, 0,num); 22 | } 23 | -------------------------------------------------------------------------------- /v_curup.c: -------------------------------------------------------------------------------- 1 | #include "gem_vdiP.h" 2 | 3 | /** The cursor is moved up one row. If the cursor is already in the first row, 4 | * nothing happens. 5 | * 6 | * @param handle Device handle 7 | * 8 | * @since all VDI versions 9 | * 10 | */ 11 | 12 | void 13 | v_curup (short handle) 14 | { 15 | short vdi_control[VDI_CNTRLMAX]; 16 | 17 | VDI_PARAMS(vdi_control, 0L, 0L, vdi_dummy, vdi_dummy ); 18 | 19 | VDI_TRAP_ESC (vdi_params, handle, 5,4, 0,0); 20 | } 21 | -------------------------------------------------------------------------------- /v_eeol.c: -------------------------------------------------------------------------------- 1 | #include "gem_vdiP.h" 2 | 3 | /** This function erases the screen from the cursor position to the end of line 4 | * 5 | * @param handle Device handle 6 | * 7 | * @since all VDI versions 8 | * 9 | */ 10 | 11 | void 12 | v_eeol (short handle) 13 | { 14 | short vdi_control[VDI_CNTRLMAX]; 15 | 16 | VDI_PARAMS(vdi_control, 0L, 0L, vdi_dummy, vdi_dummy ); 17 | 18 | VDI_TRAP_ESC (vdi_params, handle, 5,10, 0,0); 19 | } 20 | -------------------------------------------------------------------------------- /v_eeos.c: -------------------------------------------------------------------------------- 1 | #include "gem_vdiP.h" 2 | 3 | /** The screen is erased from the cursor position to the end of the screen 4 | * 5 | * @param handle Device handle 6 | * 7 | * @since all VDI versions 8 | * 9 | */ 10 | 11 | void 12 | v_eeos (short handle) 13 | { 14 | short vdi_control[VDI_CNTRLMAX]; 15 | 16 | VDI_PARAMS(vdi_control, 0L, 0L, vdi_dummy, vdi_dummy ); 17 | 18 | VDI_TRAP_ESC (vdi_params, handle, 5,9, 0,0); 19 | } 20 | -------------------------------------------------------------------------------- /v_ellipse.c: -------------------------------------------------------------------------------- 1 | #include "gem_vdiP.h" 2 | 3 | /** 4 | * 5 | * @param handle Device handle 6 | * @param x x-coordinate 7 | * @param y y-coordinate 8 | * @param xrad radius of x-axis 9 | * @param yrad radius of y-axis 10 | * 11 | * @since all VDI versions 12 | * 13 | */ 14 | 15 | void 16 | v_ellipse (short handle, short x, short y, short xrad, short yrad) 17 | { 18 | short vdi_control[VDI_CNTRLMAX]; 19 | short vdi_ptsin[4]; 20 | 21 | VDI_PARAMS(vdi_control, 0L, vdi_ptsin, vdi_dummy, vdi_dummy ); 22 | 23 | vdi_ptsin[0] = x; 24 | vdi_ptsin[1] = y; 25 | vdi_ptsin[2] = xrad; 26 | vdi_ptsin[3] = yrad; 27 | 28 | VDI_TRAP_ESC (vdi_params, handle, 11,5, 2,0); 29 | } 30 | -------------------------------------------------------------------------------- /v_enter_cur.c: -------------------------------------------------------------------------------- 1 | #include "gem_vdiP.h" 2 | 3 | /** This function enables text mode. The screen is cleared and the text 4 | * cursor is displayed in the upper left cell of the screen. 5 | * 6 | * @param handle Device handle 7 | * 8 | * @since all VDI versions 9 | * 10 | */ 11 | 12 | void 13 | v_enter_cur (short handle) 14 | { 15 | short vdi_control[VDI_CNTRLMAX]; 16 | 17 | VDI_PARAMS(vdi_control, 0L, 0L, vdi_dummy, vdi_dummy ); 18 | 19 | VDI_TRAP_ESC (vdi_params, handle, 5,3, 0,0); 20 | } 21 | -------------------------------------------------------------------------------- /v_escape2000.c: -------------------------------------------------------------------------------- 1 | #include "gem_vdiP.h" 2 | 3 | /** In contrast to v_copies() this function sets the number of 4 | * copies additional to the "original" page. 5 | * 6 | * @param handle Device handle 7 | * @param times number of additional copies 8 | * 9 | * @since depends on the driver 10 | * 11 | * @note 12 | * Not every printer driver supports this call and since it has no return 13 | * values, you cannot inquire if it exists. Use v_copies()... 14 | * 15 | */ 16 | 17 | void 18 | v_escape2000 (short handle, short times) 19 | { 20 | short vdi_control[VDI_CNTRLMAX]; 21 | 22 | VDI_PARAMS(vdi_control, ×, 0L, vdi_dummy, vdi_dummy ); 23 | 24 | VDI_TRAP_ESC (vdi_params, handle, 5,2000, 0,1); 25 | } 26 | -------------------------------------------------------------------------------- /v_exit_cur.c: -------------------------------------------------------------------------------- 1 | #include "gem_vdiP.h" 2 | 3 | /** "EXIT ALPHA MODE" switches back to graphics mode. 4 | * 5 | * @param handle Device handle 6 | * 7 | * @since all VDI versions 8 | * 9 | */ 10 | 11 | void 12 | v_exit_cur (short handle) 13 | { 14 | short vdi_control[VDI_CNTRLMAX]; 15 | 16 | VDI_PARAMS(vdi_control, 0L, 0L, vdi_dummy, vdi_dummy ); 17 | 18 | VDI_TRAP_ESC (vdi_params, handle, 5,2, 0,0); 19 | } 20 | -------------------------------------------------------------------------------- /v_flushcache.c: -------------------------------------------------------------------------------- 1 | #include "gem_vdiP.h" 2 | 3 | /** 4 | * 5 | * @param handle Device handle 6 | * 7 | * @return -1 in case of error, else 0 8 | * 9 | * @since NVDI 3.0 10 | * 11 | * 12 | * 13 | */ 14 | 15 | short 16 | v_flushcache (short handle) 17 | { 18 | short vdi_control[VDI_CNTRLMAX]; 19 | short vdi_intout[2]; /* todo (doc wanted) */ 20 | 21 | VDI_PARAMS(vdi_control, 0L, 0L, vdi_intout, vdi_dummy ); 22 | 23 | VDI_TRAP_00 (vdi_params, handle, 251); 24 | 25 | return vdi_intout[0]; 26 | } 27 | -------------------------------------------------------------------------------- /v_fontinit.c: -------------------------------------------------------------------------------- 1 | #include "gem_vdiP.h" 2 | 3 | /** this escape install the given font as font system. 4 | * 5 | * @param handle Device handle 6 | * @param font_header address of the font header 7 | * 8 | * @since ??? 9 | * 10 | * @note this function is not descibed in any doc. Usage at your 11 | * own risk! BTW, it seems that characters must be 8 pixels width (constant), 12 | * and the format used must be the motorola format. 13 | * 14 | */ 15 | 16 | void 17 | v_fontinit (short handle, const void * font_header) 18 | { 19 | short vdi_control[VDI_CNTRLMAX]; 20 | 21 | VDI_PARAMS(vdi_control, (const short*)&font_header, 0L, vdi_dummy, vdi_dummy ); 22 | 23 | VDI_TRAP_ESC (vdi_params, handle, 5,102, 0,2); 24 | } 25 | -------------------------------------------------------------------------------- /v_form_adv.c: -------------------------------------------------------------------------------- 1 | #include "gem_vdiP.h" 2 | 3 | /** is required only for printers. 4 | * It advances the printer page. This escape can 5 | * be used instead of invoking a Clear Workstation 6 | * function if it is desirable to retain the 7 | * current printer display list while advancing to 8 | * the next page. 9 | * 10 | * @param handle Device handle 11 | * 12 | * @since all VDI versions 13 | * 14 | */ 15 | 16 | void 17 | v_form_adv (short handle) 18 | { 19 | short vdi_control[VDI_CNTRLMAX]; 20 | 21 | VDI_PARAMS(vdi_control, 0L, 0L, vdi_dummy, vdi_dummy ); 22 | 23 | VDI_TRAP_ESC (vdi_params, handle, 5,20, 0,0); 24 | } 25 | -------------------------------------------------------------------------------- /v_gtext16.c: -------------------------------------------------------------------------------- 1 | #include "gem_vdiP.h" 2 | 3 | /** same as v_gtext() 4 | * 5 | * @param handle Device handle 6 | * @param x x-coordinate 7 | * @param y y-coordinate 8 | * @param wstr string, with 16 bits per character. 9 | * 10 | * @since all VDI versions 11 | * 12 | */ 13 | 14 | void 15 | v_gtext16 (short handle, short x, short y, const short *wstr) 16 | { 17 | short n = vdi_wstrlen (wstr); 18 | short vdi_control[VDI_CNTRLMAX]; 19 | short vdi_ptsin[2]; 20 | 21 | VDI_PARAMS(vdi_control, wstr, vdi_ptsin, vdi_dummy, vdi_dummy ); 22 | 23 | vdi_ptsin[0] = x; 24 | vdi_ptsin[1] = y; 25 | 26 | VDI_TRAP (vdi_params, handle, 8, 1,n); 27 | } 28 | 29 | -------------------------------------------------------------------------------- /v_gtext16n.c: -------------------------------------------------------------------------------- 1 | #include "gem_vdiP.h" 2 | 3 | /** same as v_gtext() 4 | * 5 | * @param handle Device handle 6 | * @param x x-coordinate 7 | * @param y y-coordinate 8 | * @param wstr string, with 16 bits per character. 9 | * @param num len of the string 10 | * 11 | * @since all VDI versions 12 | * 13 | */ 14 | 15 | void 16 | v_gtext16n (short handle, short x, short y, const short *wstr, short num) 17 | { 18 | short vdi_control[VDI_CNTRLMAX]; 19 | short vdi_ptsin[2]; 20 | 21 | VDI_PARAMS(vdi_control, wstr, vdi_ptsin, vdi_dummy, vdi_dummy ); 22 | 23 | vdi_ptsin[0] = x; 24 | vdi_ptsin[1] = y; 25 | 26 | VDI_TRAP (vdi_params, handle, 8, 1,num); 27 | } 28 | -------------------------------------------------------------------------------- /v_gtextn.c: -------------------------------------------------------------------------------- 1 | #include "gem_vdiP.h" 2 | 3 | /** same as v_gtext() 4 | * 5 | * @param handle Device handle 6 | * @param x x-coordinate 7 | * @param y y-coordinate 8 | * @param str string 9 | * @param num len of the string 10 | * 11 | * @since all VDI versions 12 | * 13 | */ 14 | 15 | void 16 | v_gtextn (short handle, short x, short y, const char *str, short num) 17 | { 18 | short vdi_control[VDI_CNTRLMAX]; 19 | short vdi_intin[VDI_INTINMAX]; 20 | short vdi_ptsin[2]; 21 | 22 | VDI_PARAMS(vdi_control, vdi_intin, vdi_ptsin, vdi_dummy, vdi_dummy ); 23 | 24 | num = vdi_str2array_n (str, vdi_intin, num); 25 | vdi_ptsin[0] = x; 26 | vdi_ptsin[1] = y; 27 | 28 | VDI_TRAP (vdi_params, handle, 8, 1,num); 29 | } 30 | -------------------------------------------------------------------------------- /v_hardcopy.c: -------------------------------------------------------------------------------- 1 | #include "gem_vdiP.h" 2 | 3 | /** The device generates a hard copy with this 4 | * escape. The escape is device-specific and 5 | * copies the physical screen to a printer or 6 | * other attached hard copy device. 7 | * 8 | * @param handle Device handle 9 | * 10 | * @since all VDI versions 11 | * 12 | */ 13 | 14 | void 15 | v_hardcopy (short handle) 16 | { 17 | short vdi_control[VDI_CNTRLMAX]; 18 | 19 | VDI_PARAMS(vdi_control, 0L, 0L, vdi_dummy, vdi_dummy ); 20 | 21 | VDI_TRAP_ESC (vdi_params, handle, 5,17, 0,0); 22 | } 23 | -------------------------------------------------------------------------------- /v_hide_c.c: -------------------------------------------------------------------------------- 1 | #include "gem_vdiP.h" 2 | 3 | /** switches the mouse cursor off 4 | * 5 | * @param handle Device handle 6 | * 7 | * @since all VDI versions 8 | * 9 | * @note Use mt_graf_mouse() to switch the cursor on or off. 10 | * 11 | */ 12 | 13 | void 14 | v_hide_c (short handle) 15 | { 16 | short vdi_control[VDI_CNTRLMAX]; 17 | 18 | VDI_PARAMS(vdi_control, 0L, 0L, vdi_dummy, vdi_dummy ); 19 | 20 | VDI_TRAP_00 (vdi_params, handle, 123); 21 | } 22 | -------------------------------------------------------------------------------- /v_justified.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/freemint/gemlib/44d3e3a3cadc8fc7f085e0738660377ecfdcda4f/v_justified.c -------------------------------------------------------------------------------- /v_justified16n.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/freemint/gemlib/44d3e3a3cadc8fc7f085e0738660377ecfdcda4f/v_justified16n.c -------------------------------------------------------------------------------- /v_loadcache.c: -------------------------------------------------------------------------------- 1 | #include "gem_vdiP.h" 2 | 3 | /** 4 | * 5 | * @param handle Device handle 6 | * @param filename name of the file 7 | * @param mode fill mode 8 | * 9 | * @return -1 i case of error, else 0 10 | * 11 | * @since FSMGDOS, SpeedoGDOS 4.0 12 | * 13 | * 14 | * 15 | */ 16 | 17 | short 18 | v_loadcache (short handle, const char *filename, short mode) 19 | { 20 | short vdi_control[VDI_CNTRLMAX]; 21 | short vdi_intin[VDI_INTINMAX]; 22 | short vdi_intout[VDI_INTOUTMAX]; /* todo (doc wanted) */ 23 | short vdi_ptsout[VDI_PTSOUTMAX]; /* todo (doc wanted) */ 24 | short n = 1 + vdi_str2array_n (filename, vdi_intin + 1, VDI_INTINMAX-1); 25 | 26 | VDI_PARAMS(vdi_control, vdi_intin, 0L, vdi_intout, vdi_ptsout ); 27 | 28 | vdi_intin[0] = mode; 29 | 30 | VDI_TRAP (vdi_params, handle, 250, 0, n); 31 | 32 | return vdi_intout[0]; 33 | } 34 | 35 | -------------------------------------------------------------------------------- /v_offset.c: -------------------------------------------------------------------------------- 1 | #include "gem_vdiP.h" 2 | 3 | /** this function set the screen offset in raster lines from the begining 4 | * of the logical screen. 5 | * 6 | * @param handle Device handle 7 | * @param offset offset in raster lines to the start of the logical screen 8 | * 9 | * @since ??? 10 | * 11 | * @note this function is not descibe in any doc. Usage at your own risk! 12 | * 13 | */ 14 | 15 | void 16 | v_offset (short handle, short offset) 17 | { 18 | short vdi_control[VDI_CNTRLMAX]; 19 | 20 | VDI_PARAMS(vdi_control, &offset, 0L, vdi_dummy, vdi_dummy ); 21 | 22 | VDI_TRAP_ESC (vdi_params, handle, 5,101, 0,1); 23 | } 24 | -------------------------------------------------------------------------------- /v_pline.c: -------------------------------------------------------------------------------- 1 | #include "gem_vdiP.h" 2 | 3 | /** connects all points in \p pxy with lines 4 | * 5 | * @param handle Device handle 6 | * @param count 7 | * @param pxy coordinates 8 | * 9 | * @since all VDI versions 10 | * 11 | */ 12 | 13 | void 14 | v_pline (short handle, short count, short pxy[]) 15 | { 16 | short vdi_control[VDI_CNTRLMAX]; 17 | 18 | VDI_PARAMS(vdi_control, 0L, pxy, vdi_dummy, vdi_dummy ); 19 | 20 | VDI_TRAP (vdi_params, handle, 6, count,0); 21 | } 22 | -------------------------------------------------------------------------------- /v_pmarker.c: -------------------------------------------------------------------------------- 1 | #include "gem_vdiP.h" 2 | 3 | /** draws markers 4 | * 5 | * @param handle Device handle 6 | * @param count number of coordinates 7 | * @param pxy coordinates 8 | * 9 | * @since all VDI versions 10 | * 11 | */ 12 | 13 | void 14 | v_pmarker (short handle, short count, short pxy[]) 15 | { 16 | short vdi_control[VDI_CNTRLMAX]; 17 | 18 | VDI_PARAMS(vdi_control, 0L, pxy, vdi_dummy, vdi_dummy ); 19 | 20 | VDI_TRAP (vdi_params, handle, 7, count,0); 21 | } 22 | -------------------------------------------------------------------------------- /v_rbox.c: -------------------------------------------------------------------------------- 1 | #include "gem_vdiP.h" 2 | 3 | /** draws an unfilled rectangle with rounded corners 4 | * 5 | * @param handle Device handle 6 | * @param pxy coordinates 7 | * 8 | * @since all VDI versions 9 | * 10 | */ 11 | 12 | void 13 | v_rbox (short handle, short pxy[]) 14 | { 15 | short vdi_control[VDI_CNTRLMAX]; 16 | 17 | VDI_PARAMS(vdi_control, 0L, pxy, vdi_dummy, vdi_dummy ); 18 | 19 | VDI_TRAP_ESC (vdi_params, handle, 11,8, 2,0); 20 | } 21 | -------------------------------------------------------------------------------- /v_rfbox.c: -------------------------------------------------------------------------------- 1 | #include "gem_vdiP.h" 2 | 3 | /** A filled rectangle with rounded corners is drawn by this function. 4 | * 5 | * @param handle Device handle 6 | * @param pxy Koordinaten 7 | * 8 | * @since all VDI versions 9 | * 10 | */ 11 | 12 | void 13 | v_rfbox (short handle, short pxy[]) 14 | { 15 | short vdi_control[VDI_CNTRLMAX]; 16 | 17 | VDI_PARAMS(vdi_control, 0L, pxy, vdi_dummy, vdi_dummy ); 18 | 19 | VDI_TRAP_ESC (vdi_params, handle, 11,9, 2,0); 20 | } 21 | 22 | -------------------------------------------------------------------------------- /v_rmcur.c: -------------------------------------------------------------------------------- 1 | #include "gem_vdiP.h" 2 | 3 | /** This escape removes the last graphic cursor placed on the screen 4 | * 5 | * @param handle Device handle 6 | * 7 | * @since all VDI versions 8 | * 9 | */ 10 | 11 | void 12 | v_rmcur (short handle) 13 | { 14 | short vdi_control[VDI_CNTRLMAX]; 15 | 16 | VDI_PARAMS(vdi_control, 0L, 0L, vdi_dummy, vdi_dummy ); 17 | 18 | VDI_TRAP_ESC (vdi_params, handle, 5,19, 0,0); 19 | } 20 | -------------------------------------------------------------------------------- /v_rvoff.c: -------------------------------------------------------------------------------- 1 | #include "gem_vdiP.h" 2 | 3 | /** This call switches reverse text output off 4 | * 5 | * @param handle Device handle 6 | * 7 | * @since all VDI versions 8 | * 9 | */ 10 | 11 | void 12 | v_rvoff (short handle) 13 | { 14 | short vdi_control[VDI_CNTRLMAX]; 15 | 16 | VDI_PARAMS(vdi_control, 0L, 0L, vdi_dummy, vdi_dummy ); 17 | 18 | VDI_TRAP_ESC (vdi_params, handle, 5,14, 0,0); 19 | } 20 | -------------------------------------------------------------------------------- /v_rvon.c: -------------------------------------------------------------------------------- 1 | #include "gem_vdiP.h" 2 | 3 | /** After calling this function text will be displayed reverse 4 | * 5 | * @param handle Device handle 6 | * 7 | * @since all VDI versions 8 | * 9 | */ 10 | 11 | void 12 | v_rvon (short handle) 13 | { 14 | short vdi_control[VDI_CNTRLMAX]; 15 | 16 | VDI_PARAMS(vdi_control, 0L, 0L, vdi_dummy, vdi_dummy ); 17 | 18 | VDI_TRAP_ESC (vdi_params, handle, 5,13, 0,0); 19 | } 20 | -------------------------------------------------------------------------------- /v_savecache.c: -------------------------------------------------------------------------------- 1 | #include "gem_vdiP.h" 2 | 3 | /** 4 | * 5 | * @param handle Device handle 6 | * @param filename name of the file 7 | * 8 | * @return -1 in case of error, else 0 9 | * 10 | * @since SpeedoGDOS 5.1 11 | * 12 | * 13 | * 14 | */ 15 | 16 | short 17 | v_savecache (short handle, const char *filename) 18 | { 19 | short vdi_control[VDI_CNTRLMAX]; 20 | short vdi_intin[VDI_INTINMAX]; 21 | short vdi_intout[2]; /* todo (doc wanted) */ 22 | short n = vdi_str2array_n (filename, vdi_intin, VDI_INTINMAX); 23 | 24 | VDI_PARAMS(vdi_control, vdi_intin, 0L, vdi_intout, vdi_dummy ); 25 | 26 | VDI_TRAP (vdi_params, handle, 249, 0,n); 27 | 28 | return vdi_intout[0]; 29 | } 30 | -------------------------------------------------------------------------------- /v_set_app_buff.c: -------------------------------------------------------------------------------- 1 | #include "gem_vdiP.h" 2 | 3 | /** 4 | * 5 | * @param handle Device handle 6 | * @param buf_p address of the buffer 7 | * @param size buffer size in 16-byte blocks 8 | * 9 | * @since NVDI 2.0, SpeedoGDOS 4.0 10 | * 11 | * 12 | * 13 | */ 14 | 15 | void 16 | v_set_app_buff (short handle, void *buf_p, short size) 17 | { 18 | short vdi_control[VDI_CNTRLMAX]; 19 | short vdi_intin[1 + N_PTRINTS]; 20 | 21 | VDI_PARAMS(vdi_control, vdi_intin, 0L, vdi_dummy, vdi_dummy ); 22 | 23 | vdi_intin_ptr(0, void *) = buf_p; 24 | vdi_intin [N_PTRINTS] = size; 25 | 26 | VDI_TRAP_ESC (vdi_params, handle, -1,6, 0, 1 + N_PTRINTS); 27 | } 28 | -------------------------------------------------------------------------------- /v_show_c.c: -------------------------------------------------------------------------------- 1 | #include "gem_vdiP.h" 2 | 3 | /** 'neutralizes' a preceding call of "HIDE CURSOR". If you want to 4 | * display the mouse cursor immediately without regard to the hide counter, the 5 | * paramter \p reset has to be zero. 6 | * 7 | * @param handle Device handle 8 | * @param reset 9 | * - 0 : display cursor immediately 10 | * - any nonzero value: decrement hide counter and display cursor if necessary 11 | * 12 | * @since all VDI versions 13 | * 14 | * @note Use mt_graf_mouse() to switch the cursor on or off. 15 | * 16 | */ 17 | 18 | void 19 | v_show_c (short handle, short reset) 20 | { 21 | short vdi_control[VDI_CNTRLMAX]; 22 | 23 | VDI_PARAMS(vdi_control, &reset, 0L, vdi_dummy, vdi_dummy ); 24 | 25 | VDI_TRAP (vdi_params, handle, 122, 0,1); 26 | } 27 | -------------------------------------------------------------------------------- /v_sound.c: -------------------------------------------------------------------------------- 1 | #include "gem_vdiP.h" 2 | 3 | /** This escape plays a sound with the given frequency and duration 4 | * 5 | * @param handle Device handle 6 | * @param freq tone frequency in hertz 7 | * @param duration tone length im timer ticks 8 | * 9 | * @since PC-GEM >= 2.00 10 | * 11 | * 12 | */ 13 | 14 | void 15 | v_sound (short handle, short freq, short duration) 16 | { 17 | short vdi_control[VDI_CNTRLMAX]; 18 | short vdi_intin[2]; 19 | 20 | VDI_PARAMS(vdi_control, vdi_intin, 0L, vdi_dummy, vdi_dummy ); 21 | 22 | vdi_intin[0] = freq; 23 | vdi_intin[1] = duration; 24 | 25 | VDI_TRAP_ESC (vdi_params, handle, 5,61, 0,2); 26 | } 27 | -------------------------------------------------------------------------------- /v_updwk.c: -------------------------------------------------------------------------------- 1 | #include "gem_vdiP.h" 2 | 3 | /** starts output on devices like printers or plotters, which 4 | * buffer VDI commands in a display list and do not execute them immediately 5 | * 6 | * @param handle Device handle 7 | * 8 | * @since all VDI versions 9 | * 10 | * The screen driver executes VDI commands immediately and therefore you do not 11 | * have to call "UPDATE WORKSTATION". 12 | * 13 | * Note: The picture is drawn to the printer but 14 | * no new page occurs. A Clear Workstation causes 15 | * a new page. 16 | * 17 | */ 18 | 19 | void 20 | v_updwk (short handle) 21 | { 22 | short vdi_control[VDI_CNTRLMAX]; 23 | 24 | VDI_PARAMS(vdi_control, 0L, 0L, vdi_dummy, vdi_dummy ); 25 | 26 | VDI_TRAP_00 (vdi_params, handle, 4); 27 | } 28 | -------------------------------------------------------------------------------- /v_write_meta.c: -------------------------------------------------------------------------------- 1 | #include "gem_vdiP.h" 2 | 3 | /** allows you to save application specific opcodes in a 4 | * metafile. Opcodes 0 to 100 are reserved, the range above it can be used. 5 | * 6 | * @param handle Device handle 7 | * @param numvdi_intin number of values in intin arra 8 | * @param avdi_intin user-defined information 9 | * @param num_ptsin number of values in ptsin array 10 | * @param a_ptsin user-defined information 11 | * 12 | * @since all VDI versions 13 | * 14 | * The opcode is stored in a_intin[0]. 15 | * 16 | */ 17 | 18 | void 19 | v_write_meta (short handle, short numvdi_intin, short *avdi_intin, 20 | short num_ptsin, short *a_ptsin) 21 | { 22 | short vdi_control[VDI_CNTRLMAX]; 23 | 24 | VDI_PARAMS(vdi_control, avdi_intin, a_ptsin, vdi_dummy, vdi_dummy ); 25 | 26 | VDI_TRAP_ESC (vdi_params, handle, 5,99, num_ptsin,numvdi_intin); 27 | } 28 | -------------------------------------------------------------------------------- /vbcc.mak: -------------------------------------------------------------------------------- 1 | 2 | 3 | # makefile for gemlib 4 | # vbcc version 5 | 6 | 7 | CC = vc 8 | AS = vasmm68k_mot 9 | AR = ar 10 | 11 | CFLAGS = -O1 -c99 -no-trigraphs 12 | SFLAGS = -Faout -quiet 13 | CFLAGS += $(MORE_CFLAGS) 14 | SFLAGS += $(MORE_SFLAGS) 15 | 16 | include files.mak 17 | 18 | .SUFFIXES: 19 | .SUFFIXES: .c .S .o 20 | 21 | .c.o: 22 | $(CC) $(CFLAGS) -c $*.c -o .vbcc/$*.o 23 | 24 | .S.o: 25 | $(AS) $(SFLAGS) $*.S -o .vbcc/$*.o 26 | 27 | TARGET = libgem.a 28 | 29 | all: libgem.a 30 | 31 | $(TARGET): $(OBJ) $(VC_OBJ) 32 | $(RM) $@ 33 | cd .vbcc; $(AR) -rcs ../$@ $^; $(RM) $^ 34 | -------------------------------------------------------------------------------- /vdi_array2str.c: -------------------------------------------------------------------------------- 1 | #include "mt_gem.h" 2 | 3 | /** transform VDI-string (each character is 16-bit wide, the string is not 4 | * null-terminated and len is in another parameter) to standard C-string. 5 | * 6 | * @param src input str, each char is 16-bit wide. 7 | * (src[0] is the 1st character, src[1] is the 2nd char, etc...) 8 | * @param des output string, each char is 8-bit wide (standard NULL-terminated 9 | * C-string) 10 | * @param len is the len of the input string. 11 | * 12 | * 13 | */ 14 | 15 | void 16 | vdi_array2str (const short *src, char *des, short len) 17 | { 18 | while (len > 0) 19 | { 20 | *(des++) = (char) *(src++); 21 | len--; 22 | } 23 | *des = '\0'; 24 | } 25 | -------------------------------------------------------------------------------- /vdi_dummy.c: -------------------------------------------------------------------------------- 1 | #include "gem_vdiP.h" 2 | 3 | #if USE_VDI_DUMMY 4 | short vdi_dummy[1024]; 5 | #endif 6 | -------------------------------------------------------------------------------- /vdi_userdef.c: -------------------------------------------------------------------------------- 1 | #include "vdi_userdef.h" 2 | 3 | /** private global data used by all "udef" specific functions */ 4 | VDIPARBLK _VDIParBlk; 5 | 6 | -------------------------------------------------------------------------------- /vdi_wstrlen.c: -------------------------------------------------------------------------------- 1 | #include "mt_gem.h" 2 | 3 | /** return the length of a w-string 4 | * 5 | * @param wstr a string with 16 bits per character, null-terminated. 6 | * 7 | * @return the length of the string 8 | * 9 | * 10 | */ 11 | 12 | short 13 | vdi_wstrlen (const short *wstr) 14 | { 15 | register short len = 0; 16 | 17 | while (*wstr++) 18 | len++; 19 | 20 | return len; 21 | } 22 | -------------------------------------------------------------------------------- /vex_butv.c: -------------------------------------------------------------------------------- 1 | #include "gem_vdiP.h" 2 | 3 | /** installs a routine which is called when a mouse 4 | * button is pressed 5 | * 6 | * @param handle Device handle 7 | * @param newhdlr address of the new routine 8 | * @param old address of the old routine 9 | * 10 | * @since all VDI versions 11 | * 12 | * Register d0.w contains the button state. The subroutine must 13 | * save and restore modified registers and call the old status routine. 14 | * 15 | */ 16 | 17 | void 18 | vex_butv (short handle, void *newhdlr, void **old) 19 | { 20 | short vdi_control[VDI_CNTRLMAX]; 21 | 22 | VDI_PARAMS(vdi_control, 0L, 0L, vdi_dummy, vdi_dummy ); 23 | 24 | vdi_control_ptr(0, void *) = newhdlr; 25 | vdi_control_ptr(1, void *) = 0; 26 | 27 | VDI_TRAP_00 (vdi_params, handle, 125); 28 | 29 | if (old) 30 | *old = vdi_control_ptr(1, void *); 31 | } 32 | -------------------------------------------------------------------------------- /vm_coords.c: -------------------------------------------------------------------------------- 1 | #include "gem_vdiP.h" 2 | 3 | /** is a sub-opcode of WRITE METAFILE ITEM and sets the used coordinate system. 4 | * 5 | * @param handle Device handle 6 | * @param llx x-Koordinate links unten 7 | * @param lly y-Koordinate links unten 8 | * @param urx x-Koordinate rechts oben 9 | * @param ury y-Koordinate rechts oben 10 | * 11 | * @since supported by all metafile drivers 12 | * 13 | */ 14 | 15 | void 16 | vm_coords (short handle, short llx, short lly, short urx, short ury) 17 | { 18 | short vdi_control[VDI_CNTRLMAX]; 19 | short vdi_intin[5]; 20 | 21 | VDI_PARAMS(vdi_control, vdi_intin, 0L, vdi_dummy, vdi_dummy ); 22 | 23 | vdi_intin[0] = 1; 24 | vdi_intin[1] = llx; 25 | vdi_intin[2] = lly; 26 | vdi_intin[3] = urx; 27 | vdi_intin[4] = ury; 28 | 29 | VDI_TRAP_ESC (vdi_params, handle, 5,99, 0,5); 30 | } 31 | -------------------------------------------------------------------------------- /vm_pagesize.c: -------------------------------------------------------------------------------- 1 | #include "gem_vdiP.h" 2 | 3 | /** is a sub-opcode of WRITE METAFILE ITEM and sets the page size in 1/10 mm. 4 | * 5 | * @param handle Device handle 6 | * @param pgwidth width in 1/10 mm 7 | * @param pgheight height in 1/10 mm 8 | * 9 | * @since supported by all metafile drivers 10 | * 11 | * 12 | */ 13 | 14 | void 15 | vm_pagesize (short handle, short pgwidth, short pgheight) 16 | { 17 | short vdi_control[VDI_CNTRLMAX]; 18 | short vdi_intin[3]; 19 | 20 | VDI_PARAMS(vdi_control, vdi_intin, 0L, vdi_dummy, vdi_dummy ); 21 | 22 | vdi_intin[0] = 0; 23 | vdi_intin[1] = pgwidth; 24 | vdi_intin[2] = pgheight; 25 | 26 | VDI_TRAP_ESC (vdi_params, handle, 5,99, 0,3); 27 | } 28 | -------------------------------------------------------------------------------- /vq_calibrate.c: -------------------------------------------------------------------------------- 1 | #include "gem_vdiP.h" 2 | 3 | /** This function report back, if vs_calibrate() exists and if calibration is 4 | * switched on. 5 | * 6 | * @param handle Device handle 7 | * @param flag calibration aus (0) or ein (1) 8 | * 9 | * @return O if vs_calibrate() is not supported by the driver, any other value 10 | * if vs_calibrate() is supported by the driver. 11 | * 12 | * @since depends on the driver 13 | * 14 | */ 15 | 16 | short 17 | vq_calibrate (short handle, short *flag) 18 | { 19 | short vdi_control[VDI_CNTRLMAX]; 20 | 21 | VDI_PARAMS(vdi_control, 0L, 0L, flag, vdi_dummy ); 22 | 23 | VDI_TRAP_ESC (vdi_params, handle, 5,77, 0,0); 24 | 25 | return vdi_control[4]; 26 | } 27 | -------------------------------------------------------------------------------- /vq_curaddress.c: -------------------------------------------------------------------------------- 1 | #include "gem_vdiP.h" 2 | 3 | /** This call returns the current cursor position 4 | * 5 | * @param handle Device handle 6 | * @param cur_row (1 to the maximum number of rows) \n 7 | * [option CHECK_NULLPTR] cur_row may be NULL 8 | * @param cur_col (1 to the maximum number of columns) \n 9 | * [option CHECK_NULLPTR] cur_col may be NULL 10 | * 11 | * @since all VDI versions 12 | * 13 | */ 14 | 15 | void 16 | vq_curaddress (short handle, short *cur_row, short *cur_col) 17 | { 18 | short vdi_control[VDI_CNTRLMAX]; 19 | short vdi_intout[2]; 20 | 21 | VDI_PARAMS(vdi_control, 0L, 0L, vdi_intout, vdi_dummy ); 22 | 23 | VDI_TRAP_ESC (vdi_params, handle, 5,15, 0,0); 24 | 25 | #if CHECK_NULLPTR 26 | if (cur_row) 27 | #endif 28 | *cur_row = vdi_intout[0]; 29 | #if CHECK_NULLPTR 30 | if (cur_col) 31 | #endif 32 | *cur_col = vdi_intout[1]; 33 | } 34 | -------------------------------------------------------------------------------- /vq_key_s.c: -------------------------------------------------------------------------------- 1 | #include "gem_vdiP.h" 2 | 3 | /** "SAMPLE KEYBOARD STATE INFORMATION" returns the state of CONTROL, ALTERNATE 4 | * and the SHIFT key(s). 5 | * 6 | * @param handle Device handle 7 | * @param state keyboard (bit numbers): 8 | * - 0: Shift right 9 | * - 1: Shift left 10 | * - 2: Control 11 | * - 3: Alternate 12 | * 13 | * @since all VDI versions 14 | * 15 | * @note Use the AES event functions to inquire the keyboard state 16 | * 17 | * 18 | */ 19 | 20 | void 21 | vq_key_s (short handle, short *state) 22 | { 23 | short vdi_control[VDI_CNTRLMAX]; 24 | 25 | VDI_PARAMS(vdi_control, 0L, 0L, state, vdi_dummy ); 26 | 27 | VDI_TRAP_00 (vdi_params, handle, 128); 28 | } 29 | -------------------------------------------------------------------------------- /vq_mouse.c: -------------------------------------------------------------------------------- 1 | #include "gem_vdiP.h" 2 | 3 | /** This function returns the state of the mouse buttons and the mosue position 4 | * 5 | * @param handle Device handle 6 | * @param pstatus button status 7 | * @param x x-coordinate 8 | * @param y y-coordinate 9 | * 10 | * @since all VDI versions 11 | * 12 | * @note Use mt_graf_mkstate() or the event functions of the AES. 13 | * 14 | */ 15 | 16 | void 17 | vq_mouse (short handle, short *pstatus, short *x, short *y) 18 | { 19 | short vdi_control[VDI_CNTRLMAX]; 20 | short vdi_ptsout[2]; 21 | 22 | VDI_PARAMS(vdi_control, 0L, 0L, pstatus, vdi_ptsout ); 23 | 24 | VDI_TRAP_00 (vdi_params, handle, 124); 25 | 26 | *x = vdi_ptsout[0]; 27 | *y = vdi_ptsout[1]; 28 | } 29 | -------------------------------------------------------------------------------- /vq_tabstatus.c: -------------------------------------------------------------------------------- 1 | #include "gem_vdiP.h" 2 | 3 | /** This escape returns the availability status 4 | * of a graphics tablet, mouse, joystick, or 5 | * other similar device. 6 | * 7 | * @param handle Device handle 8 | * 9 | * @return Tablet status : 10 | * - 0 = tablet not available 11 | * - 1 = tablet available 12 | * 13 | * @since all VDI versions 14 | * 15 | */ 16 | 17 | short 18 | vq_tabstatus (short handle) 19 | { 20 | short vdi_control[VDI_CNTRLMAX]; 21 | short vdi_intout[1]; 22 | 23 | VDI_PARAMS(vdi_control, 0L, 0L, vdi_intout, vdi_dummy ); 24 | 25 | VDI_TRAP_ESC (vdi_params, handle, 5,16, 0,0); 26 | 27 | return vdi_intout[0]; 28 | } 29 | -------------------------------------------------------------------------------- /vq_tdimensions.c: -------------------------------------------------------------------------------- 1 | #include "gem_vdiP.h" 2 | 3 | /** 4 | * 5 | * @param handle Device handle 6 | * @param xdimension \n 7 | * [option CHECK_NULLPTR] xdimension may be NULL 8 | * @param ydimension \n 9 | * [option CHECK_NULLPTR] ydimension may be NULL 10 | * 11 | * @since supported by all table drivers 12 | * 13 | * 14 | * 15 | */ 16 | 17 | void 18 | vq_tdimensions (short handle, short *xdimension, short *ydimension) 19 | { 20 | short vdi_control[VDI_CNTRLMAX]; 21 | short vdi_intout[2]; 22 | 23 | VDI_PARAMS(vdi_control, 0L, 0L, vdi_intout, vdi_dummy ); 24 | 25 | VDI_TRAP_ESC (vdi_params, handle, 5,84, 0,0); 26 | 27 | #if CHECK_NULLPTR 28 | if (xdimension) 29 | #endif 30 | *xdimension = vdi_intout[0]; 31 | #if CHECK_NULLPTR 32 | if (ydimension) 33 | #endif 34 | *ydimension = vdi_intout[1]; 35 | } 36 | -------------------------------------------------------------------------------- /vqf_attributes.c: -------------------------------------------------------------------------------- 1 | #include "gem_vdiP.h" 2 | 3 | /** reports back the current attributes for filled objects. 4 | * 5 | * @param handle Device handle 6 | * @param attrib point to a 5-shorts array which will contain: 7 | * - attrib[0] fill type 8 | * - attrib[1] fill color 9 | * - attrib[2] fill style index 10 | * - attrib[3] writing mode 11 | * - attrib[4] perimeter flag 12 | * 13 | * @since all VDI versions 14 | * 15 | */ 16 | 17 | void 18 | vqf_attributes (short handle, short attrib[]) 19 | { 20 | short vdi_control[VDI_CNTRLMAX]; 21 | 22 | VDI_PARAMS(vdi_control, 0L, 0L, attrib, vdi_dummy ); 23 | 24 | VDI_TRAP_00 (vdi_params, handle, 37); 25 | } 26 | -------------------------------------------------------------------------------- /vqin_mode.c: -------------------------------------------------------------------------------- 1 | #include "gem_vdiP.h" 2 | 3 | /** inquires the input mode of the specified device 4 | * 5 | * @param handle Device handle 6 | * @param dev input device (see vsin_mode()) 7 | * @param mode mode 8 | * 9 | * @since all VDI versions 10 | * 11 | */ 12 | 13 | void 14 | vqin_mode (short handle, short dev, short *mode) 15 | { 16 | short vdi_control[VDI_CNTRLMAX]; 17 | 18 | VDI_PARAMS(vdi_control, &dev, 0L, mode, vdi_dummy ); 19 | 20 | VDI_TRAP (vdi_params, handle, 115, 0,1); 21 | } 22 | -------------------------------------------------------------------------------- /vqm_attributes.c: -------------------------------------------------------------------------------- 1 | #include "gem_vdiP.h" 2 | 3 | /** reports back the current marker attributes 4 | * 5 | * @param handle Device handle 6 | * @param attrib 7 | * - attrib[0] marker type 8 | * - attrib[1] marker color 9 | * - attrib[2] writing mode 10 | * - attrib[3] marker height 11 | * - attrib[4] marker width 12 | * 13 | * @since all VDI versions 14 | * 15 | */ 16 | 17 | void 18 | vqm_attributes (short handle, short attrib[]) 19 | { 20 | short vdi_control[VDI_CNTRLMAX]; 21 | short ptsout[2]; 22 | 23 | VDI_PARAMS(vdi_control, 0L, 0L, attrib, ptsout); 24 | 25 | VDI_TRAP_00 (vdi_params, handle, 36); 26 | 27 | attrib[3] = ptsout[1]; /* marker height */ 28 | attrib[4] = ptsout[0]; /* marker width; unused */ 29 | } 30 | -------------------------------------------------------------------------------- /vqp_filmname.c: -------------------------------------------------------------------------------- 1 | #include "gem_vdiP.h" 2 | 3 | /** this escape returns the name of a film. 4 | * 5 | * @param handle Device handle 6 | * @param index ??? 7 | * @param name ??? 8 | * 9 | * @return 0 (function not supported or wrong film index), or any positive 10 | * value otherwise. 11 | * 12 | * @since PC-GEM >= 2.0 13 | * 14 | * @note a wrong film index returns an empty filmname. 15 | * 16 | */ 17 | 18 | short 19 | vqp_filmname (short handle, short index, char * name) 20 | { 21 | short vdi_control[VDI_CNTRLMAX]; 22 | short vdi_intout[VDI_INTOUTMAX]; 23 | 24 | VDI_PARAMS(vdi_control, &index, 0L, vdi_intout, vdi_dummy ); 25 | 26 | VDI_TRAP_ESC (vdi_params, handle, 5,92, 0,1); 27 | 28 | vdi_array2str( vdi_intout, name, vdi_control[4]); 29 | 30 | return vdi_control[4]; 31 | } 32 | -------------------------------------------------------------------------------- /vqt_cachesize.c: -------------------------------------------------------------------------------- 1 | #include "gem_vdiP.h" 2 | 3 | /** 4 | * 5 | * @param handle Device handle 6 | * @param which_cache 0=character bitmap cache, 1=data cache 7 | * @param size size of largest allocatable block in cache 8 | * 9 | * @since SpeedoGDOS 4.0 10 | * 11 | */ 12 | 13 | void 14 | vqt_cachesize (short handle, short which_cache, long *size) 15 | { 16 | short vdi_control[VDI_CNTRLMAX]; 17 | short vdi_intout[VDI_INTOUTMAX]; /* todo (doc wanted) */ 18 | short vdi_ptsout[VDI_PTSOUTMAX]; /* todo (doc wanted) */ 19 | 20 | VDI_PARAMS(vdi_control, &which_cache, 0L, vdi_intout, vdi_ptsout ); 21 | 22 | VDI_TRAP (vdi_params, handle, 255, 0,1); 23 | 24 | *size = vdi_intout_long(0); 25 | } 26 | -------------------------------------------------------------------------------- /vqt_extent16.c: -------------------------------------------------------------------------------- 1 | #include "gem_vdiP.h" 2 | 3 | /** see vqt_extent() 4 | * 5 | * @param handle Device handle 6 | * @param wstr string in 16-bit format (16 bits per character) 7 | * @param extent coordinates of the rectangle 8 | * 9 | */ 10 | 11 | void 12 | vqt_extent16 (short handle, const short *wstr, short extent[]) 13 | { 14 | short n = vdi_wstrlen (wstr); 15 | short vdi_control[VDI_CNTRLMAX]; 16 | 17 | VDI_PARAMS( vdi_control, wstr, 0L, vdi_dummy, extent); 18 | 19 | VDI_TRAP (vdi_params, handle, 116, 0,n); 20 | } 21 | -------------------------------------------------------------------------------- /vqt_extent16n.c: -------------------------------------------------------------------------------- 1 | #include "gem_vdiP.h" 2 | 3 | /** see vqt_extent() 4 | * 5 | * @param handle Device handle 6 | * @param wstr string in 16-bit format (16 bits per character) 7 | * @param num length of the string 8 | * @param extent coordinates of the rectangle 9 | * 10 | */ 11 | 12 | void 13 | vqt_extent16n (short handle, const short *wstr, short num, short extent[]) 14 | { 15 | short vdi_control[VDI_CNTRLMAX]; 16 | 17 | VDI_PARAMS(vdi_control, wstr, 0L, vdi_dummy, extent ); 18 | 19 | VDI_TRAP (vdi_params, handle, 116, 0,num); 20 | } 21 | -------------------------------------------------------------------------------- /vqt_extentn.c: -------------------------------------------------------------------------------- 1 | #include "gem_vdiP.h" 2 | 3 | /** see vqt_extent() 4 | * 5 | * @param handle Device handle 6 | * @param str string 7 | * @param num length of the string 8 | * @param extent coordinates of the rectangle 9 | * 10 | */ 11 | 12 | void 13 | vqt_extentn (short handle, const char *str, short num, short extent[]) 14 | { 15 | short vdi_control[VDI_CNTRLMAX]; 16 | short vdi_intin[VDI_INTINMAX]; 17 | 18 | VDI_PARAMS(vdi_control, vdi_intin, 0L, vdi_dummy, extent ); 19 | num = vdi_str2array_n (str, vdi_intin, num); 20 | 21 | VDI_TRAP (vdi_params, handle, 116, 0,num); 22 | } 23 | -------------------------------------------------------------------------------- /vqt_get_table.c: -------------------------------------------------------------------------------- 1 | #include "gem_vdiP.h" 2 | 3 | /** 4 | * 5 | * @param handle Device handle 6 | * @param map address of character allocation table 7 | * 8 | * @since SpeedoGDOS 4.0 9 | * 10 | * 11 | * 12 | * 13 | */ 14 | 15 | void 16 | vqt_get_table (short handle, short **map) 17 | { 18 | short vdi_control[VDI_CNTRLMAX]; 19 | short vdi_intout[VDI_INTOUTMAX]; /* todo (doc wanted) */ 20 | short vdi_ptsout[VDI_PTSOUTMAX]; /* todo (doc wanted) */ 21 | 22 | VDI_PARAMS(vdi_control, 0L, 0L, vdi_intout, vdi_ptsout); 23 | 24 | VDI_TRAP_00 (vdi_params, handle, 254); 25 | 26 | *map = vdi_intout_ptr(0, short *); 27 | } 28 | -------------------------------------------------------------------------------- /vr_recfl.c: -------------------------------------------------------------------------------- 1 | #include "gem_vdiP.h" 2 | 3 | /** draw a filled rectangle (without outline). 4 | * 5 | * @param handle Device handle 6 | * @param pxy coordinates 7 | * 8 | * @since all VDI versions 9 | * 10 | */ 11 | 12 | void 13 | vr_recfl (short handle, short pxy[]) 14 | { 15 | short vdi_control[VDI_CNTRLMAX]; 16 | 17 | VDI_PARAMS(vdi_control, 0L, pxy, vdi_dummy, vdi_dummy ); 18 | 19 | VDI_TRAP (vdi_params, handle, 114, 2,0); 20 | } 21 | 22 | -------------------------------------------------------------------------------- /vr_trnfm.c: -------------------------------------------------------------------------------- 1 | #include "gem_vdiP.h" 2 | 3 | /** transforms a raster from standard format to device-specific format 4 | * and vice-versa. The transformation can be "in place" which means that both MFDBs 5 | * point to the same address. In this case transforming a big bitmap takes ages... 6 | * 7 | * @param handle Device handle 8 | * @param src pointer to the source MFDB 9 | * @param dst pointer to the destination MFDB 10 | * 11 | * @since all VDI versions 12 | * 13 | */ 14 | 15 | void 16 | vr_trnfm (short handle, MFDB * src, MFDB * dst) 17 | { 18 | short vdi_control[VDI_CNTRLMAX]; 19 | 20 | VDI_PARAMS(vdi_control, 0L, 0L, vdi_dummy, vdi_dummy ); 21 | 22 | vdi_control_ptr(0, MFDB *) = src; 23 | vdi_control_ptr(1, MFDB *) = dst; 24 | 25 | VDI_TRAP_00 (vdi_params, handle, 110); 26 | } 27 | -------------------------------------------------------------------------------- /vrq_choice.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/freemint/gemlib/44d3e3a3cadc8fc7f085e0738660377ecfdcda4f/vrq_choice.c -------------------------------------------------------------------------------- /vs_clip_off.c: -------------------------------------------------------------------------------- 1 | #include "gem_vdiP.h" 2 | 3 | /** same as vs_clip(handle,0,dummy) 4 | * 5 | * @param handle Device handle 6 | * 7 | */ 8 | 9 | void 10 | vs_clip_off (short handle) 11 | { 12 | short vdi_control[VDI_CNTRLMAX]; 13 | static short vdi_intin[1] = {0}; 14 | static short vdi_ptsin[4] = {0,0,0,0}; 15 | 16 | VDI_PARAMS(vdi_control, vdi_intin, vdi_ptsin, vdi_dummy, vdi_dummy ); 17 | 18 | VDI_TRAP (vdi_params, handle, 129, 2,1); 19 | } 20 | -------------------------------------------------------------------------------- /vs_clip_pxy.c: -------------------------------------------------------------------------------- 1 | #include "gem_vdiP.h" 2 | 3 | /** same as vs_clip(handle,1,pxy) 4 | * 5 | * @param handle Device handle 6 | * @param pxy same as vs_clip() 7 | * 8 | */ 9 | 10 | void 11 | vs_clip_pxy (short handle, PXY pxy[]) 12 | { 13 | short vdi_control[VDI_CNTRLMAX]; 14 | static short vdi_intin[1] = {1}; 15 | 16 | VDI_PARAMS(vdi_control, vdi_intin, (short*)pxy, vdi_dummy, vdi_dummy ); 17 | 18 | VDI_TRAP (vdi_params, handle, 129, 2,1); 19 | } 20 | -------------------------------------------------------------------------------- /vs_curaddress.c: -------------------------------------------------------------------------------- 1 | #include "gem_vdiP.h" 2 | 3 | /** moves 4 | * the alpha cursor directly to the specified 5 | * row and column address anywhere on the display 6 | * surface. Addresses beyond the displayable 7 | * range of the screen are set to the nearest 8 | * value that is within the displayable range of 9 | * the screen. 10 | * 11 | * @param handle Device handle 12 | * @param row Row number (1 to maximum number of rows) 13 | * @param col Column number (1 to maximum number of columns). 14 | * 15 | * @since all VDI versions 16 | * 17 | */ 18 | 19 | void 20 | vs_curaddress (short handle, short row, short col) 21 | { 22 | short vdi_control[VDI_CNTRLMAX]; 23 | short vdi_intin[2]; 24 | 25 | VDI_PARAMS(vdi_control, vdi_intin, 0L, vdi_dummy, vdi_dummy ); 26 | 27 | vdi_intin[0] = row; 28 | vdi_intin[1] = col; 29 | 30 | VDI_TRAP_ESC (vdi_params, handle, 5,11, 0,2); 31 | } 32 | -------------------------------------------------------------------------------- /vs_mute.c: -------------------------------------------------------------------------------- 1 | #include "gem_vdiP.h" 2 | 3 | /** This escape set/unset/return the tone mute flag 4 | * 5 | * @param handle Device handle 6 | * @param action 7 | * - (-1) inquire the mute flag 8 | * - 0 clear the mute flag (sound on) 9 | * - 1 set the mute flag (sound off) 10 | * 11 | * @return the mute flag set 12 | * 13 | * @since PC-GEM >= 2.0 14 | * 15 | * 16 | */ 17 | 18 | short 19 | vs_mute (short handle, short action) 20 | { 21 | short vdi_control[VDI_CNTRLMAX]; 22 | short vdi_intout[1]; 23 | 24 | VDI_PARAMS(vdi_control, &action, 0L, vdi_intout, vdi_dummy ); 25 | 26 | VDI_TRAP_ESC (vdi_params, handle, 5,62, 0,1); 27 | 28 | return vdi_intout[0]; 29 | } 30 | -------------------------------------------------------------------------------- /vs_palette.c: -------------------------------------------------------------------------------- 1 | #include "gem_vdiP.h" 2 | 3 | /** This escape allows the selection of the 4 | * palette on the IBM (Tm) medium-resolution color 5 | * screen. 6 | * 7 | * @param handle Device handle 8 | * @param palette Color selection : 9 | * - 0 = use red, green, brown palette (default) 10 | * - 1 = use cyan, magenta, white palette 11 | * 12 | * @return Palette selected 13 | * 14 | * @since all VDI versions 15 | * 16 | * 17 | */ 18 | 19 | short 20 | vs_palette (short handle, short palette) 21 | { 22 | short vdi_control[VDI_CNTRLMAX]; 23 | short vdi_intout[1]; 24 | 25 | VDI_PARAMS(vdi_control, &palette, 0L, vdi_intout, vdi_dummy ); 26 | 27 | VDI_TRAP_ESC (vdi_params, handle, 5,60, 0,1); 28 | 29 | return vdi_intout[0]; 30 | } 31 | -------------------------------------------------------------------------------- /vsc_expose.c: -------------------------------------------------------------------------------- 1 | #include "gem_vdiP.h" 2 | 3 | /** 4 | * 5 | * @param handle Device handle 6 | * @param state ??? 7 | * 8 | * @since all VDI versions 9 | * 10 | * 11 | * 12 | */ 13 | 14 | void 15 | vsc_expose (short handle, short state) 16 | { 17 | short vdi_control[VDI_CNTRLMAX]; 18 | 19 | VDI_PARAMS(vdi_control, &state, 0L, vdi_dummy, vdi_dummy); 20 | 21 | VDI_TRAP_ESC (vdi_params, handle, 5,93, 0,1); 22 | } 23 | -------------------------------------------------------------------------------- /vsf_color.c: -------------------------------------------------------------------------------- 1 | #include "gem_vdiP.h" 2 | 3 | /** sets the color index for filled areas 4 | * 5 | * @param handle Device handle 6 | * @param index requested fill color. If the index is invalid, color 7 | * index 1 will be selected. If you use a colored pattern (see vsf_udpat()) the 8 | * color index will be ignored; you should set it to 1. 9 | * 10 | * @return realized color 11 | * 12 | * @since all VDI versions 13 | * 14 | */ 15 | 16 | short 17 | vsf_color (short handle, short index) 18 | { 19 | short vdi_control[VDI_CNTRLMAX]; 20 | short vdi_intout[1]; 21 | 22 | VDI_PARAMS(vdi_control, &index, 0L, vdi_intout, vdi_dummy ); 23 | 24 | VDI_TRAP (vdi_params, handle, 25, 0,1); 25 | 26 | return vdi_intout[0]; 27 | } 28 | -------------------------------------------------------------------------------- /vsl_color.c: -------------------------------------------------------------------------------- 1 | #include "gem_vdiP.h" 2 | 3 | /** sets the color index for lines 4 | * 5 | * @param handle Device handle 6 | * @param index requested line color. If the index is invalid, color index 1 7 | * will be selected. 8 | * 9 | * @return realized line color 10 | * 11 | * @since all VDI versions 12 | */ 13 | 14 | short 15 | vsl_color (short handle, short index) 16 | { 17 | short vdi_control[VDI_CNTRLMAX]; 18 | short vdi_intout[1]; 19 | 20 | VDI_PARAMS(vdi_control, &index, 0L, vdi_intout, vdi_dummy ); 21 | 22 | VDI_TRAP (vdi_params, handle, 17, 0,1); 23 | 24 | return vdi_intout[0]; 25 | } 26 | -------------------------------------------------------------------------------- /vsl_udsty.c: -------------------------------------------------------------------------------- 1 | #include "gem_vdiP.h" 2 | 3 | /** set the pattern for the user-defined line type 4 | * 5 | * @param handle Device handle 6 | * @param pat user-defined line pattern specified in this 16-bit word. 7 | * The Most Significant Bit (MSB) of the pattern 8 | * word is the first pixel in the line. This line 9 | * style is used for subsequent polyline 10 | * operations when the application selects user 11 | * defined line style, index 7. 12 | * 13 | * @since all VDI versions 14 | * 15 | */ 16 | 17 | void 18 | vsl_udsty (short handle, short pat) 19 | { 20 | short vdi_control[VDI_CNTRLMAX]; 21 | 22 | VDI_PARAMS(vdi_control, &pat, 0L, vdi_dummy, vdi_dummy); 23 | 24 | VDI_TRAP (vdi_params, handle, 113, 0,1); 25 | } 26 | -------------------------------------------------------------------------------- /vsm_choice.c: -------------------------------------------------------------------------------- 1 | #include "gem_vdiP.h" 2 | 3 | /** If a function key has been pressed "INPUT CHOICE" returns its number. 4 | * 5 | * @param handle Device handle 6 | * @param choice key number (1-10) 7 | * 8 | * @return 0 (no key) or 1 (key pressed) 9 | * 10 | * @since all VDI versions 11 | * 12 | */ 13 | 14 | short 15 | vsm_choice (short handle, short *choice) 16 | { 17 | short vdi_control[VDI_CNTRLMAX]; 18 | 19 | VDI_PARAMS(vdi_control, 0L, 0L, choice, vdi_dummy ); 20 | 21 | VDI_TRAP_00 (vdi_params, handle, 30); 22 | 23 | return vdi_control[4]; 24 | } 25 | -------------------------------------------------------------------------------- /vsm_color.c: -------------------------------------------------------------------------------- 1 | #include "gem_vdiP.h" 2 | 3 | /** sets the color index for markers 4 | * 5 | * @param handle Device handle 6 | * @param index marker color. If the index is invalid, 7 | * color index 1 will be selected. 8 | * 9 | * @return selected color 10 | * 11 | * @since all VDI versions 12 | * 13 | */ 14 | 15 | short 16 | vsm_color (short handle, short index) 17 | { 18 | short vdi_control[VDI_CNTRLMAX]; 19 | short vdi_intout[1]; 20 | 21 | VDI_PARAMS(vdi_control, &index, 0L, vdi_intout, vdi_dummy ); 22 | 23 | VDI_TRAP (vdi_params, handle, 20, 0,1); 24 | 25 | return vdi_intout[0]; 26 | } 27 | -------------------------------------------------------------------------------- /vsp_film.c: -------------------------------------------------------------------------------- 1 | #include "gem_vdiP.h" 2 | 3 | /** 4 | * 5 | * @param handle Device handle 6 | * @param index ??? 7 | * @param lightness ??? 8 | * 9 | * @since all VDI versions 10 | * 11 | * 12 | * 13 | */ 14 | 15 | void 16 | vsp_film (short handle, short index, short lightness) 17 | { 18 | short vdi_control[VDI_CNTRLMAX]; 19 | short vdi_intin[2]; 20 | 21 | VDI_PARAMS(vdi_control, vdi_intin, 0L, vdi_dummy, vdi_dummy ); 22 | 23 | vdi_intin[0] = index; 24 | vdi_intin[1] = lightness; 25 | 26 | VDI_TRAP_ESC (vdi_params, handle, 5,91, 0,2); 27 | } 28 | -------------------------------------------------------------------------------- /vst_color.c: -------------------------------------------------------------------------------- 1 | #include "gem_vdiP.h" 2 | 3 | /** sets the color index for text output 4 | * 5 | * @param handle Device handle 6 | * @param index requested color index. If the index is invalid, color 7 | * index 1 will be selected. 8 | * 9 | * @return selected color index 10 | * 11 | * @since all VDI versions 12 | */ 13 | 14 | short 15 | vst_color (short handle, short index) 16 | { 17 | short vdi_control[VDI_CNTRLMAX]; 18 | short vdi_intout[1]; 19 | 20 | VDI_PARAMS(vdi_control, &index, 0L, vdi_intout, vdi_dummy ); 21 | 22 | VDI_TRAP (vdi_params, handle, 22, 0,1); 23 | 24 | return vdi_intout[0]; 25 | } 26 | -------------------------------------------------------------------------------- /vst_error.c: -------------------------------------------------------------------------------- 1 | #include "gem_vdiP.h" 2 | 3 | /** 4 | * 5 | * @param handle Device handle 6 | * @param mode type of error handling 7 | * @param errorvar address of the error variable 8 | * 9 | * @since SpeedoGDOS 4.0 10 | * 11 | * 12 | * 13 | */ 14 | 15 | void 16 | vst_error (short handle, short mode, short *errorvar) 17 | { 18 | short vdi_control[VDI_CNTRLMAX]; 19 | short vdi_intin[1 + N_PTRINTS]; 20 | short vdi_intout[VDI_INTOUTMAX]; /* todo (doc wanted) */ 21 | short vdi_ptsout[VDI_PTSOUTMAX]; /* todo (doc wanted) */ 22 | 23 | VDI_PARAMS(vdi_control, vdi_intin, 0L, vdi_intout, vdi_ptsout ); 24 | 25 | vdi_intin [0] = mode; 26 | vdi_intin_ptr(1, short *) = errorvar; 27 | 28 | VDI_TRAP (vdi_params, handle, 245, 0, 1 + N_PTRINTS); 29 | } 30 | -------------------------------------------------------------------------------- /vst_font.c: -------------------------------------------------------------------------------- 1 | #include "gem_vdiP.h" 2 | 3 | /** selects a font for text output 4 | * 5 | * @param handle Device handle 6 | * @param font requested font. If a font with the requested 7 | * does not exist, the system font will be chosen. 8 | * 9 | * @return selected font 10 | * 11 | * @since all VDI versions 12 | * 13 | */ 14 | 15 | short 16 | vst_font (short handle, short font) 17 | { 18 | short vdi_control[VDI_CNTRLMAX]; 19 | short vdi_intout[1]; 20 | 21 | VDI_PARAMS(vdi_control, &font, 0L, vdi_intout, vdi_dummy ); 22 | 23 | VDI_TRAP (vdi_params, handle, 21, 0,1); 24 | 25 | return vdi_intout[0]; 26 | } 27 | -------------------------------------------------------------------------------- /vst_load_fonts.c: -------------------------------------------------------------------------------- 1 | #include "gem_vdiP.h" 2 | 3 | /** loads the fonts for the device specified by \p handle and returns 4 | * the number of additional fonts. 5 | * 6 | * @param handle Device handle 7 | * @param select 0 (reserved) 8 | * 9 | * @return number of additional fonts 10 | * 11 | * @since all VDI versions 12 | * 13 | * Before you call vst_load_fonts(), call vq_gdos() or vq_vgdos() and make sure that the VDI can 14 | * load additional fonts. 15 | * 16 | */ 17 | 18 | short 19 | vst_load_fonts (short handle, short select) 20 | { 21 | short vdi_control[VDI_CNTRLMAX]; 22 | short vdi_intout[1]; 23 | 24 | VDI_PARAMS(vdi_control, &select, 0L, vdi_intout, vdi_dummy ); 25 | 26 | /* NVDI expects a FONTHDR ptr here */ 27 | *__vdi_array_ptr(10, vdi_control) = 0; 28 | 29 | VDI_TRAP (vdi_params, handle, 119, 0,1); 30 | 31 | return vdi_intout[0]; 32 | } 33 | -------------------------------------------------------------------------------- /vst_rotation.c: -------------------------------------------------------------------------------- 1 | #include "gem_vdiP.h" 2 | 3 | /** enables text rotation in 1/10 of degrees. If the selected font 4 | * is a bitmap font, rotation works only in steps of 90 degrees 5 | * 6 | * @param handle Device handle 7 | * @param ang requested angle 8 | * 9 | * @return realized angle 10 | * 11 | * @since all VDI versions\n 12 | * This function is not required and may 13 | * not be supported on all devices. The Extended 14 | * Inquire function returns the availability of 15 | * this function. 16 | * 17 | */ 18 | 19 | short 20 | vst_rotation (short handle, short ang) 21 | { 22 | short vdi_control[VDI_CNTRLMAX]; 23 | short vdi_intout[1]; 24 | 25 | VDI_PARAMS(vdi_control, &ang, 0L, vdi_intout, vdi_dummy ); 26 | 27 | VDI_TRAP (vdi_params, handle, 13, 0,1); 28 | 29 | return vdi_intout[0]; 30 | } 31 | -------------------------------------------------------------------------------- /vst_scratch.c: -------------------------------------------------------------------------------- 1 | #include "gem_vdiP.h" 2 | 3 | /** 4 | * 5 | * @param handle Device handle 6 | * @param mode type of buffer 7 | * 8 | * @since SpeedoGDOS 4.0 9 | * 10 | * 11 | * 12 | */ 13 | 14 | void 15 | vst_scratch (short handle, short mode) 16 | { 17 | short vdi_control[VDI_CNTRLMAX]; 18 | 19 | VDI_PARAMS(vdi_control, &mode, 0L, vdi_dummy, vdi_dummy ); 20 | 21 | VDI_TRAP (vdi_params, handle, 244, 0,1); 22 | } 23 | -------------------------------------------------------------------------------- /vt_alignment.c: -------------------------------------------------------------------------------- 1 | #include "gem_vdiP.h" 2 | 3 | /** 4 | * 5 | * @param handle Device handle 6 | * @param dx x-offset from origin 7 | * @param dy y-offset from origin 8 | * 9 | * @since supported by all table drivers 10 | * 11 | * 12 | * 13 | */ 14 | 15 | 16 | void 17 | vt_alignment (short handle, short dx, short dy) 18 | { 19 | short vdi_control[VDI_CNTRLMAX]; 20 | short vdi_intin[2]; 21 | 22 | VDI_PARAMS(vdi_control, vdi_intin, 0L, vdi_dummy, vdi_dummy ); 23 | 24 | vdi_intin[0] = dx; 25 | vdi_intin[1] = dy; 26 | 27 | VDI_TRAP_ESC (vdi_params, handle, 5,85, 0,2); 28 | } 29 | -------------------------------------------------------------------------------- /vt_origin.c: -------------------------------------------------------------------------------- 1 | #include "gem_vdiP.h" 2 | 3 | /** 4 | * 5 | * @param handle Device handle 6 | * @param xorigin x-coordinate 7 | * @param yorigin y-coordinate 8 | * 9 | * @since supported by all tablet drivers 10 | * 11 | * 12 | * 13 | */ 14 | 15 | void 16 | vt_origin (short handle, short xorigin, short yorigin) 17 | { 18 | short vdi_control[VDI_CNTRLMAX]; 19 | short vdi_intin[2]; 20 | short vdi_intout[2]; /* from TOS.HYP binding.... */ 21 | 22 | VDI_PARAMS(vdi_control, vdi_intin, 0L, vdi_intout, vdi_dummy); 23 | 24 | vdi_intin[0] = xorigin; 25 | vdi_intin[1] = yorigin; 26 | 27 | VDI_TRAP_ESC (vdi_params, handle, 5,83, 0,2); 28 | } 29 | -------------------------------------------------------------------------------- /x_appl_flags.c: -------------------------------------------------------------------------------- 1 | #include "gem_aesP.h" 2 | #include "mt_gemx.h" 3 | 4 | /** controls the execution flags that are used when determining how an application gets run 5 | * 6 | * @param getset 7 | * @param index 8 | * @param flags 9 | * @param global_aes global AES array 10 | * 11 | * @return 0 if an error has occurred 12 | * 13 | * @since Geneva 14 | * 15 | */ 16 | 17 | short 18 | mt_x_appl_flags(short getset, short index, APPFLAGS *flags, short *global_aes) 19 | { 20 | AES_PARAMS(0x7100,2,1,1,0); 21 | 22 | aes_intin[0] = getset; 23 | aes_intin[1] = index; 24 | aes_addrin[0] = (long)flags; 25 | 26 | AES_TRAP(aes_params); 27 | 28 | return (aes_intout[0]); 29 | } 30 | -------------------------------------------------------------------------------- /x_appl_font.c: -------------------------------------------------------------------------------- 1 | #include "gem_aesP.h" 2 | #include "mt_gemx.h" 3 | 4 | /** Change the characteristics of the large font used by Geneva, and also the window gadget borders. 5 | * 6 | * @param getset 7 | * @param zero 8 | * @param info 9 | * @param global_aes global AES array 10 | * 11 | * @return 0 if an error has occurred 12 | * 13 | * @since Geneva 14 | * 15 | */ 16 | 17 | short 18 | mt_x_appl_font(short getset, short zero, XFONTINFO *info, short *global_aes) 19 | { 20 | AES_PARAMS(0x7101,2,1,0,0); 21 | 22 | aes_intin[0] = getset; 23 | aes_intin[1] = zero; 24 | aes_addrin[0] = (long)info; 25 | 26 | AES_TRAP(aes_params); 27 | 28 | return (aes_intout[0]); 29 | } 30 | -------------------------------------------------------------------------------- /x_appl_sleep.c: -------------------------------------------------------------------------------- 1 | #include "gem_aesP.h" 2 | #include "mt_gemx.h" 3 | 4 | /** Put an application "to sleep", so that it will not receive any events. 5 | * 6 | * @param id Application ID of the app to affect 7 | * @param sleep the type of control 8 | * @param global_aes global AES array 9 | * 10 | * @return -1 if an error has occurred or a value>0 otherwise. 11 | * 12 | * @since Geneva 13 | * 14 | */ 15 | 16 | short 17 | mt_x_appl_sleep(short id, short sleep, short *global_aes) 18 | { 19 | AES_PARAMS(0x7102,2,1,0,0); 20 | 21 | aes_intin[0] = id; 22 | aes_intin[1] = sleep; 23 | 24 | AES_TRAP(aes_params); 25 | 26 | return (aes_intout[0]); 27 | } 28 | -------------------------------------------------------------------------------- /x_appl_term.c: -------------------------------------------------------------------------------- 1 | #include "gem_aesP.h" 2 | #include "mt_gemx.h" 3 | 4 | /** Terminate an application and remove it from memory. 5 | * 6 | * @param apid Application ID of program to terminate 7 | * @param retrn Return value to be received by parent 8 | * @param set_me Must always be non-zero 9 | * @param global_aes global AES array 10 | * 11 | * @return 0: The application was not found 12 | * 13 | * @since Geneva 14 | * 15 | */ 16 | 17 | short 18 | mt_x_appl_term(short apid, short retrn, short set_me, short *global_aes) 19 | { 20 | AES_PARAMS(0x7103,3,1,0,0); 21 | 22 | aes_intin[0] = apid; 23 | aes_intin[1] = retrn; 24 | aes_intin[2] = set_me; 25 | 26 | AES_TRAP(aes_params); 27 | 28 | return (aes_intout[0]); 29 | } 30 | -------------------------------------------------------------------------------- /x_appl_trecord.c: -------------------------------------------------------------------------------- 1 | #include "gem_aesP.h" 2 | #include "mt_gemx.h" 3 | 4 | /** records AES events for later playback. 5 | * 6 | * @param mem points to an array of \a Count ::EVNTREC structures 7 | * @param count dimension of the array of ::EVNTREC structures into which 8 | * the AES will record events 9 | * @param cancel 10 | * @param mode 11 | * @param global_aes global AES array 12 | * 13 | * @return addreturns the number of events actually recorded. 14 | * 15 | * @since Geneva 16 | * 17 | * @sa mt_x_appl_tplay() 18 | * 19 | */ 20 | 21 | short 22 | mt_x_appl_trecord(void *mem, short count, KEYCODE *cancel, short mode, short *global_aes) 23 | { 24 | AES_PARAMS(15,2,1,2,0); 25 | 26 | aes_intin[0] = count; 27 | aes_intin[1] = mode; 28 | aes_addrin[0] = (long)mem; 29 | aes_addrin[1] = (long)cancel; 30 | 31 | AES_TRAP(aes_params); 32 | 33 | return aes_intout[0]; 34 | } 35 | -------------------------------------------------------------------------------- /x_fnts_close.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/freemint/gemlib/44d3e3a3cadc8fc7f085e0738660377ecfdcda4f/x_fnts_close.c -------------------------------------------------------------------------------- /x_fnts_delete.c: -------------------------------------------------------------------------------- 1 | #include "gem_aesP.h" 2 | #include "mt_gemx.h" 3 | 4 | /** releases the memory allocated for the font selector. 5 | * 6 | * @param fnt_dialog Pointer to management structure 7 | * @param vdi_handle Handle of the Workstation or 0, if vst_unload_fonts() is not 8 | * to be called 9 | * @param global_aes global AES array 10 | * 11 | * @return 1 12 | * 13 | * @since mt_appl_getinfo(7) give informations on mt_fnts_xx() functions availability 14 | * 15 | * 16 | * 17 | */ 18 | 19 | short 20 | mt_fnts_delete(FNT_DIALOG *fnt_dialog, short vdi_handle, short *global_aes) 21 | { 22 | AES_PARAMS(181,1,1,1,0); 23 | 24 | aes_intin[0] = vdi_handle; 25 | aes_addrin[0] = (long)fnt_dialog; 26 | aes_intout[0] = 0; 27 | 28 | AES_TRAP(aes_params); 29 | 30 | return aes_intout[0]; 31 | } 32 | -------------------------------------------------------------------------------- /x_fnts_remove.c: -------------------------------------------------------------------------------- 1 | #include "gem_aesP.h" 2 | #include "mt_gemx.h" 3 | 4 | /** removes the fonts installed with mt_fnts_add() 5 | * 6 | * @param fnt_dialog Pointer to management structure 7 | * @param global_aes global AES array 8 | * 9 | * @since mt_appl_getinfo(7) give informations on mt_fnts_xx() functions availability 10 | * 11 | * @note If a program's user fonts have been installed, then 12 | * mt_fnts_remove() must be called before mt_fnts_delete(). 13 | * 14 | */ 15 | 16 | void 17 | mt_fnts_remove(FNT_DIALOG *fnt_dialog, short *global_aes) 18 | { 19 | AES_PARAMS(185,1,0,1,0); 20 | 21 | aes_intin[0] = 1; 22 | 23 | aes_addrin[0] = (long)fnt_dialog; 24 | 25 | AES_TRAP(aes_params); 26 | } 27 | -------------------------------------------------------------------------------- /x_form_filename.c: -------------------------------------------------------------------------------- 1 | #include "gem_aesP.h" 2 | #include "mt_gemx.h" 3 | 4 | /** Convert to/from a standard GEMDOS filename in editable field in a dialog. 5 | * 6 | * @param tree 7 | * @param obj 8 | * @param to_from 9 | * @param string 10 | * @param global_aes global AES array 11 | * 12 | * @return always 1 13 | * 14 | * @since Geneva 15 | * 16 | */ 17 | 18 | short 19 | mt_x_form_filename(OBJECT *tree, short obj, short to_from, char *string, short *global_aes) 20 | { 21 | AES_PARAMS(0x7112,2,1,2,0); 22 | 23 | aes_intin[0] = obj; 24 | aes_intin[1] = to_from; 25 | aes_addrin[0] = (long)tree; 26 | aes_addrin[1] = (long)string; 27 | 28 | AES_TRAP(aes_params); 29 | 30 | return aes_intout[0]; 31 | } 32 | -------------------------------------------------------------------------------- /x_fsel_input.c: -------------------------------------------------------------------------------- 1 | #include "gem_aesP.h" 2 | #include "mt_gemx.h" 3 | 4 | /** Extended file selector. 5 | * 6 | * @param inpath 7 | * @param pathlen 8 | * @param insel 9 | * @param sels 10 | * @param exbutton 11 | * @param label 12 | * @param global_aes global AES array 13 | * 14 | * @return 0 = An object was selected 15 | * 16 | * @since Geneva 17 | * 18 | */ 19 | 20 | short 21 | mt_x_fsel_input(char *inpath, short pathlen, char *insel, short sels, 22 | short *exbutton, const char *label, short *global_aes) 23 | { 24 | AES_PARAMS(0x7120,2,2,3,0); 25 | 26 | aes_intin[0] = pathlen; 27 | aes_intin[1] = sels; 28 | aes_addrin[0] = (long)inpath; 29 | aes_addrin[1] = (long)insel; 30 | aes_addrin[2] = (long)label; 31 | 32 | AES_TRAP(aes_params); 33 | 34 | #if CHECK_NULLPTR 35 | if (exbutton) 36 | #endif 37 | *exbutton = aes_intout[1]; 38 | 39 | return aes_intout[0]; 40 | } 41 | -------------------------------------------------------------------------------- /x_fslx_close.c: -------------------------------------------------------------------------------- 1 | #include "gem_aesP.h" 2 | #include "mt_gemx.h" 3 | 4 | /** Close file selector window or file selector dialog 5 | * 6 | * @param fsd Descriptor that was passed at the 7 | * successful opening of a file selector window. 8 | * @param global_aes global AES array 9 | * 10 | * @return 0 for error, else 1 11 | * 12 | * @since mt_appl_getinfo(7) give informations on mt_fslx_xx() functions availability 13 | * 14 | * The corresponding descriptor is cleared and the file selector window or 15 | * dialog is closed. 16 | * 17 | * 18 | */ 19 | 20 | short 21 | mt_fslx_close(XFSL_DIALOG *fsd, short *global_aes) 22 | { 23 | AES_PARAMS(191,0,1,1,0); 24 | 25 | aes_addrin[0] = (long)fsd; 26 | 27 | AES_TRAP(aes_params); 28 | 29 | return aes_intout[0]; 30 | } 31 | -------------------------------------------------------------------------------- /x_fslx_getnxtfile.c: -------------------------------------------------------------------------------- 1 | #include "gem_aesP.h" 2 | #include "mt_gemx.h" 3 | 4 | /** Examine further selected files 5 | * 6 | * @param fsd Descriptor that was passed at a 7 | * successful opening of a file selector 8 | * window 9 | * @param fname see below 10 | * @param global_aes global AES array 11 | * 12 | * @return 0, when no further file is selected, \p fname is unchanged.\n 13 | * 1, when a filename after \p fname was copied. 14 | * 15 | * @since mt_appl_getinfo(7) give informations on mt_fslx_xx() functions availability 16 | * 17 | * 18 | * 19 | */ 20 | 21 | short 22 | mt_fslx_getnxtfile(XFSL_DIALOG *fsd, char *fname, short *global_aes) 23 | { 24 | AES_PARAMS(192,0,1,2,0); 25 | 26 | aes_addrin[0] = (long)fsd; 27 | aes_addrin[1] = (long)fname; 28 | 29 | AES_TRAP(aes_params); 30 | 31 | return aes_intout[0]; 32 | } 33 | -------------------------------------------------------------------------------- /x_graf_blit.c: -------------------------------------------------------------------------------- 1 | #include "gem_aesP.h" 2 | #include "mt_gemx.h" 3 | 4 | /** Blit one area of the screen to another location, or save/restore a block of screen data. 5 | * 6 | * @param source 7 | * @param dest 8 | * @param global_aes global AES array 9 | * 10 | * @return 0 if an error occured or non-zero otherwise. 11 | * 12 | * @since Geneva 13 | * 14 | */ 15 | 16 | short 17 | mt_x_graf_blit(GRECT *source, GRECT *dest, short *global_aes) 18 | { 19 | AES_PARAMS(0x7130,0,1,2,0); 20 | 21 | aes_addrin[0] = (long)source; 22 | aes_addrin[1] = (long)dest; 23 | 24 | AES_TRAP(aes_params); 25 | 26 | return aes_intout[0]; 27 | } 28 | -------------------------------------------------------------------------------- /x_graf_rast2rez.c: -------------------------------------------------------------------------------- 1 | #include "gem_aesP.h" 2 | #include "mt_gemx.h" 3 | 4 | /** 5 | * 6 | * @param src_data 7 | * @param plane_len 8 | * @param old_planes 9 | * @param mfdb 10 | * @param devspef 11 | * @param global_aes global AES array 12 | * 13 | * @since Geneva 14 | * 15 | */ 16 | 17 | void 18 | mt_x_graf_rast2rez(unsigned short *src_data, long plane_len, 19 | short old_planes, MFDB *mfdb, short devspef, short *global_aes) 20 | { 21 | AES_PARAMS(0x7132,4,0,2,0); 22 | 23 | aes_intin_long(0) = plane_len; 24 | aes_intin[2] = old_planes; 25 | aes_intin[3] = devspef; 26 | aes_addrin[0] = (long)src_data; 27 | aes_addrin[1] = (long)mfdb; 28 | 29 | AES_TRAP(aes_params); 30 | } 31 | -------------------------------------------------------------------------------- /x_help.c: -------------------------------------------------------------------------------- 1 | #include "gem_aesP.h" 2 | #include "mt_gemx.h" 3 | 4 | /** Inform the Help display program of a request for help text. 5 | * 6 | * @param sensitive 7 | * @param topic 8 | * @param helpfile 9 | * @param global_aes global AES array 10 | * 11 | * @return An error code (0) is returned if either the help program could not be loaded, or there was insufficient free memory to send the message. 12 | * 13 | * @since Geneva 14 | * 15 | */ 16 | 17 | short 18 | mt_x_help(const char *topic, const char *helpfile, short sensitive, short *global_aes) 19 | { 20 | AES_PARAMS(0x7185,1,1,2,0); 21 | 22 | aes_intin[0] = sensitive; 23 | aes_addrin[0] = (long)topic; 24 | aes_addrin[1] = (long)helpfile; 25 | 26 | AES_TRAP(aes_params); 27 | 28 | return aes_intout[0]; 29 | } 30 | -------------------------------------------------------------------------------- /x_lbox_cnt_items.c: -------------------------------------------------------------------------------- 1 | #include "gem_aesP.h" 2 | #include "mt_gemx.h" 3 | 4 | /** counts the items of the chained list 5 | * 6 | * @param box Pointer to the list box structure 7 | * @param global_aes global AES array 8 | * 9 | * @return Number of the items in the list 10 | * 11 | * @since mt_appl_getinfo(7) give informations on mt_lbox_xx() functions availability 12 | * 13 | */ 14 | 15 | short 16 | mt_lbox_cnt_items( LIST_BOX *box, short *global_aes ) 17 | { 18 | AES_PARAMS(174,1,1,1,0); 19 | 20 | aes_intin[0] = 0; 21 | 22 | aes_addrin[0] = (long)box; 23 | 24 | AES_TRAP(aes_params); 25 | 26 | return(aes_intout[0]); 27 | } 28 | -------------------------------------------------------------------------------- /x_lbox_delete.c: -------------------------------------------------------------------------------- 1 | #include "gem_aesP.h" 2 | #include "mt_gemx.h" 3 | 4 | /** releases the memory allocated for the list box. 5 | * 6 | * @param box Pointer to the list box structure 7 | * @param global_aes global AES array 8 | * 9 | * @return 1 10 | * 11 | * @since mt_appl_getinfo(7) give informations on mt_lbox_xx() functions availability 12 | * 13 | */ 14 | 15 | short 16 | mt_lbox_delete( LIST_BOX *box, short *global_aes ) 17 | { 18 | AES_PARAMS(173,0,1,1,0); 19 | 20 | aes_addrin[0] = (long)box; 21 | 22 | AES_TRAP(aes_params); 23 | 24 | return(aes_intout[0]); 25 | } 26 | -------------------------------------------------------------------------------- /x_lbox_free_list.c: -------------------------------------------------------------------------------- 1 | #include "gem_aesP.h" 2 | #include "mt_gemx.h" 3 | 4 | /** This functions works exactly the same as mt_lbox_free_items(). 5 | * 6 | * @param items Pointer to linked list with LBOX_ITEMs 7 | * @param global_aes global AES array 8 | * 9 | * @since mt_appl_getinfo(7) give informations on mt_lbox_xx() functions availability 10 | * 11 | * This functions works exactly the same as mt_lbox_free_items(). 12 | * In contrast to that however mt_lbox_free_list() is called with the pointer 13 | * on the first LBOX_ITEM of the list. 14 | * 15 | */ 16 | 17 | void 18 | mt_lbox_free_list( LBOX_ITEM *items, short *global_aes ) 19 | { 20 | AES_PARAMS(175,1,0,1,0); 21 | 22 | aes_intin[0] = 3; 23 | 24 | aes_addrin[0] = (long)items; 25 | 26 | AES_TRAP(aes_params); 27 | } 28 | -------------------------------------------------------------------------------- /x_lbox_get_afirst.c: -------------------------------------------------------------------------------- 1 | #include "gem_aesP.h" 2 | #include "mt_gemx.h" 3 | 4 | /** returns the index of the first visible item 5 | * 6 | * @param box Pointer to the list box structure 7 | * @param global_aes global AES array 8 | * 9 | * @return Index of the first visible item 10 | * 11 | * @since mt_appl_getinfo(7) give informations on mt_lbox_xx() functions availability 12 | * 13 | */ 14 | 15 | short 16 | mt_lbox_get_afirst( LIST_BOX *box, short *global_aes ) 17 | { 18 | AES_PARAMS(174,1,1,1,0); 19 | 20 | aes_intin[0] = 4; 21 | 22 | aes_addrin[0] = (long)box; 23 | 24 | AES_TRAP(aes_params); 25 | 26 | return aes_intout[0]; 27 | } 28 | -------------------------------------------------------------------------------- /x_lbox_get_bentries.c: -------------------------------------------------------------------------------- 1 | #include "gem_aesP.h" 2 | #include "mt_gemx.h" 3 | 4 | /** returns the number of items for Slider B. 5 | * 6 | * @param box Pointer to the list box structure 7 | * @param global_aes global AES array 8 | * 9 | * @return Number of items 10 | * 11 | * @since mt_appl_getinfo(7) give informations on mt_lbox_xx() functions availability 12 | * 13 | */ 14 | 15 | short 16 | mt_lbox_get_bentries( LIST_BOX *box, short *global_aes ) 17 | { 18 | AES_PARAMS(174,1,1,1,0); 19 | 20 | aes_intin[0] = 11; 21 | 22 | aes_addrin[0] = (long)box; 23 | 24 | AES_TRAP(aes_params); 25 | 26 | return aes_intout[0]; 27 | } 28 | -------------------------------------------------------------------------------- /x_lbox_get_bfirst.c: -------------------------------------------------------------------------------- 1 | #include "gem_aesP.h" 2 | #include "mt_gemx.h" 3 | 4 | /** returns the index of the first visible item (Slider B!). 5 | * 6 | * @param box Pointer to the list box structure 7 | * @param global_aes global AES array 8 | * 9 | * @return Index of the first visible item 10 | * 11 | * @since mt_appl_getinfo(7) give informations on mt_lbox_xx() functions availability 12 | * 13 | */ 14 | 15 | short 16 | mt_lbox_get_bfirst( LIST_BOX *box, short *global_aes ) 17 | { 18 | AES_PARAMS(174,1,1,1,0); 19 | 20 | aes_intin[0] = 12; 21 | 22 | aes_addrin[0] = (long)box; 23 | 24 | AES_TRAP(aes_params); 25 | 26 | return aes_intout[0]; 27 | } 28 | -------------------------------------------------------------------------------- /x_lbox_get_bvis.c: -------------------------------------------------------------------------------- 1 | #include "gem_aesP.h" 2 | #include "mt_gemx.h" 3 | 4 | /** returns the number of visible entries, slider B. 5 | * 6 | * @param box Pointer to the list box structure 7 | * @param global_aes global AES array 8 | * 9 | * @return Number of visible entries 10 | * 11 | * @since mt_appl_getinfo(7) give informations on mt_lbox_xx() functions availability 12 | * 13 | */ 14 | 15 | short 16 | mt_lbox_get_bvis( LIST_BOX *box, short *global_aes ) 17 | { 18 | AES_PARAMS(174,1,1,1,0); 19 | 20 | aes_intin[0] = 10; 21 | aes_addrin[0] = (long)box; 22 | 23 | AES_TRAP(aes_params); 24 | 25 | return aes_intout[0]; 26 | } 27 | -------------------------------------------------------------------------------- /x_lbox_get_idx.c: -------------------------------------------------------------------------------- 1 | #include "gem_aesP.h" 2 | #include "mt_gemx.h" 3 | 4 | /** list box - get item index 5 | * 6 | * @param items Pointer to the first item of the list 7 | * @param search Pointer to the item to be found 8 | * @param global_aes global AES array 9 | * 10 | * @return Index of the item or -1 11 | * 12 | * @since mt_appl_getinfo(7) give informations on mt_lbox_xx() functions availability 13 | * 14 | * This function returns the index \p n of the item \p item. 15 | * If \p item is not an element of the list, the return value is -1. 16 | * 17 | */ 18 | 19 | short 20 | mt_lbox_get_idx( LBOX_ITEM *items, LBOX_ITEM *search, short *global_aes ) 21 | { 22 | AES_PARAMS(174,1,1,2,0); 23 | 24 | aes_intin[0] = 9; 25 | 26 | aes_addrin[0] = (long)items; 27 | aes_addrin[1] = (long)search; 28 | 29 | AES_TRAP(aes_params); 30 | 31 | return aes_intout[0]; 32 | } 33 | -------------------------------------------------------------------------------- /x_lbox_get_item.c: -------------------------------------------------------------------------------- 1 | #include "gem_aesP.h" 2 | #include "mt_gemx.h" 3 | 4 | /** returns a pointer to item \p n of the list 5 | * 6 | * @param box Pointer to the list box structure 7 | * @param n Index des items 8 | * @param global_aes global AES array 9 | * 10 | * @return Pointer to item n or 0L 11 | * 12 | * @since mt_appl_getinfo(7) give informations on mt_lbox_xx() functions availability 13 | * 14 | */ 15 | 16 | LBOX_ITEM * 17 | mt_lbox_get_item( LIST_BOX *box, short n, short *global_aes ) 18 | { 19 | AES_PARAMS(174,2,0,1,1); 20 | 21 | aes_intin[0] = 7; 22 | aes_intin[1] = n; 23 | 24 | aes_addrin[0] = (long)box; 25 | 26 | AES_TRAP(aes_params); 27 | 28 | return (LBOX_ITEM *) aes_addrout[0]; 29 | } 30 | -------------------------------------------------------------------------------- /x_lbox_get_items.c: -------------------------------------------------------------------------------- 1 | #include "gem_aesP.h" 2 | #include "mt_gemx.h" 3 | 4 | /** returns a pointer to the list of the LBOX_ITEMs 5 | * 6 | * @param box Pointer to the list box structure 7 | * @param global_aes global AES array 8 | * 9 | * @return Pointer to the chained list 10 | * 11 | * @since mt_appl_getinfo(7) give informations on mt_lbox_xx() functions availability 12 | * 13 | */ 14 | 15 | LBOX_ITEM * 16 | mt_lbox_get_items( LIST_BOX *box, short *global_aes ) 17 | { 18 | AES_PARAMS(174,1,0,1,1); 19 | 20 | aes_intin[0] = 6; 21 | 22 | aes_addrin[0] = (long)box; 23 | 24 | AES_TRAP(aes_params); 25 | 26 | return (LBOX_ITEM *) aes_addrout[0]; 27 | } 28 | -------------------------------------------------------------------------------- /x_lbox_get_slct_idx.c: -------------------------------------------------------------------------------- 1 | #include "gem_aesP.h" 2 | #include "mt_gemx.h" 3 | 4 | /** Establish the index of the first selected item 5 | * 6 | * @param box Pointer to the list box structure 7 | * @param global_aes global AES array 8 | * 9 | * @return Index of the selected item. If no item in the 10 | * list is selected then -1 will be returned. 11 | * 12 | * @since mt_appl_getinfo(7) give informations on mt_lbox_xx() functions availability 13 | * 14 | */ 15 | 16 | short 17 | mt_lbox_get_slct_idx( LIST_BOX *box, short *global_aes ) 18 | { 19 | AES_PARAMS(174,1,1,1,0); 20 | 21 | aes_intin[0] = 5; 22 | 23 | aes_addrin[0] = (long)box; 24 | 25 | AES_TRAP(aes_params); 26 | 27 | return aes_intout[0]; 28 | } 29 | -------------------------------------------------------------------------------- /x_lbox_get_slct_item.c: -------------------------------------------------------------------------------- 1 | #include "gem_aesP.h" 2 | #include "mt_gemx.h" 3 | 4 | /** returns a pointer to the first selected item of the list. 5 | * 6 | * @param box Pointer to the list box structure 7 | * @param global_aes global AES array 8 | * 9 | * @return Pointer to first selected item or 0L 10 | * 11 | * @since mt_appl_getinfo(7) give informations on mt_lbox_xx() functions availability 12 | * 13 | */ 14 | 15 | LBOX_ITEM * 16 | mt_lbox_get_slct_item( LIST_BOX *box, short *global_aes ) 17 | { 18 | AES_PARAMS(174,1,0,1,1); 19 | 20 | aes_intin[0] = 8; 21 | 22 | aes_addrin[0] = (long)box; 23 | 24 | AES_TRAP(aes_params); 25 | 26 | return (LBOX_ITEM *) aes_addrout[0]; 27 | } 28 | -------------------------------------------------------------------------------- /x_lbox_get_tree.c: -------------------------------------------------------------------------------- 1 | #include "gem_aesP.h" 2 | #include "mt_gemx.h" 3 | 4 | /** returns the pointer to the object tree of the dialog box 5 | * 6 | * @param box Pointer to the list box structure 7 | * @param global_aes global AES array 8 | * 9 | * @return Pointer to the object tree of the dialog 10 | * 11 | * @since mt_appl_getinfo(7) give informations on mt_lbox_xx() functions availability 12 | * 13 | */ 14 | 15 | OBJECT * 16 | mt_lbox_get_tree( LIST_BOX *box, short *global_aes ) 17 | { 18 | AES_PARAMS(174,1,0,1,1); 19 | 20 | aes_intin[0] = 1; 21 | 22 | aes_addrin[0] = (long)box; 23 | 24 | AES_TRAP(aes_params); 25 | 26 | return((OBJECT *)aes_addrout[0]); 27 | } 28 | -------------------------------------------------------------------------------- /x_lbox_get_udata.c: -------------------------------------------------------------------------------- 1 | #include "gem_aesP.h" 2 | #include "mt_gemx.h" 3 | 4 | /** returns the pointer \p user_data. 5 | * 6 | * @param box Pointer to the list box structure 7 | * @param global_aes global AES array 8 | * 9 | * @return \p user_data 10 | * 11 | * @since mt_appl_getinfo(7) give informations on mt_lbox_xx() functions availability 12 | * 13 | */ 14 | 15 | void * 16 | mt_lbox_get_udata( LIST_BOX *box, short *global_aes ) 17 | { 18 | AES_PARAMS(174,1,0,1,1); 19 | 20 | aes_intin[0] = 3; 21 | 22 | aes_addrin[0] = (long)box; 23 | 24 | AES_TRAP(aes_params); 25 | 26 | return (void*) aes_addrout[0]; 27 | } 28 | -------------------------------------------------------------------------------- /x_lbox_get_visible.c: -------------------------------------------------------------------------------- 1 | #include "gem_aesP.h" 2 | #include "mt_gemx.h" 3 | 4 | /** returns the number of visible items 5 | * 6 | * @param box Pointer to the list box structure 7 | * @param global_aes global AES array 8 | * 9 | * @return Number of visible items 10 | * 11 | * @since mt_appl_getinfo(7) give informations on mt_lbox_xx() functions availability 12 | * 13 | */ 14 | 15 | short 16 | mt_lbox_get_visible( LIST_BOX *box, short *global_aes ) 17 | { 18 | AES_PARAMS(174,1,1,1,0); 19 | 20 | aes_intin[0] = 2; 21 | 22 | aes_addrin[0] = (long)box; 23 | 24 | AES_TRAP(aes_params); 25 | 26 | return(aes_intout[0]); 27 | } 28 | -------------------------------------------------------------------------------- /x_lbox_set_bentries.c: -------------------------------------------------------------------------------- 1 | #include "gem_aesP.h" 2 | #include "mt_gemx.h" 3 | 4 | /** This Function sets the number of items (the subdivisions) for Slider B. 5 | * 6 | * @param box Pointer to the list box structure 7 | * @param entries Number of items 8 | * @param global_aes global AES array 9 | * 10 | * @since mt_appl_getinfo(7) give informations on mt_lbox_xx() functions availability 11 | * 12 | */ 13 | 14 | void 15 | mt_lbox_set_bentries( LIST_BOX *box, short entries, short *global_aes ) 16 | { 17 | AES_PARAMS(175,2,0,1,0); 18 | 19 | aes_intin[0] = 6; 20 | aes_intin[1] = entries; 21 | 22 | aes_addrin[0] = (long)box; 23 | 24 | AES_TRAP(aes_params); 25 | } 26 | -------------------------------------------------------------------------------- /x_lbox_set_items.c: -------------------------------------------------------------------------------- 1 | #include "gem_aesP.h" 2 | #include "mt_gemx.h" 3 | 4 | /** This function sets a new list with list box entries 5 | * 6 | * @param box Pointer to the list box structure 7 | * @param items 8 | * @param global_aes global AES array 9 | * 10 | * @since mt_appl_getinfo(7) give informations on mt_lbox_xx() functions availability 11 | * 12 | * This function sets a new list with list box entries. The old list must 13 | * first be freed with mt_lbox_free_items(). 14 | * 15 | * The pointer \p items can also be 0L if the list box is empty 16 | * and contains no entries. 17 | */ 18 | 19 | void 20 | mt_lbox_set_items( LIST_BOX *box, LBOX_ITEM *items, short *global_aes ) 21 | { 22 | AES_PARAMS(175,1,0,2,0); 23 | 24 | aes_intin[0] = 1; 25 | 26 | aes_addrin[0] = (long)box; 27 | aes_addrin[1] = (long)items; 28 | 29 | AES_TRAP(aes_params); 30 | } 31 | -------------------------------------------------------------------------------- /x_malloc.c: -------------------------------------------------------------------------------- 1 | #include "gem_aesP.h" 2 | #include "mt_gemx.h" 3 | 4 | /** Allocate memory from Geneva. 5 | * 6 | * @param addr 7 | * @param size 8 | * @param global_aes global AES array 9 | * 10 | * @since Geneva 11 | * 12 | */ 13 | 14 | void 15 | mt_x_malloc(void **addr, long size, short *global_aes) 16 | { 17 | AES_PARAMS(0x7186,2,0,1,0); 18 | 19 | aes_intin_long(0) = size; 20 | aes_addrin[0] = (long)addr; 21 | 22 | AES_TRAP(aes_params); 23 | } 24 | -------------------------------------------------------------------------------- /x_mfree.c: -------------------------------------------------------------------------------- 1 | #include "gem_aesP.h" 2 | #include "mt_gemx.h" 3 | 4 | /** Free memory allocated with x_malloc. 5 | * 6 | * @param addr 7 | * @param global_aes global AES array 8 | * 9 | * @return 0 if an error has occurred 10 | * 11 | * @since Geneva 12 | * 13 | */ 14 | 15 | short 16 | mt_x_mfree(void *addr, short *global_aes) 17 | { 18 | AES_PARAMS(0x7187,0,1,1,0); 19 | 20 | aes_addrin[0] = (long)addr; 21 | 22 | AES_TRAP(aes_params); 23 | 24 | return aes_intout[0]; 25 | } 26 | -------------------------------------------------------------------------------- /x_mshrink.c: -------------------------------------------------------------------------------- 1 | #include "gem_aesP.h" 2 | #include "mt_gemx.h" 3 | 4 | /** Shrink a memory block allocated with x_malloc. 5 | * 6 | * @param addr 7 | * @param newsize 8 | * @param global_aes global AES array 9 | * 10 | * @return 0 if an error has occurred 11 | * 12 | * @since Geneva 13 | * 14 | */ 15 | 16 | short 17 | mt_x_mshrink(void *addr, long newsize, short *global_aes) 18 | { 19 | AES_PARAMS(0x7188,2,1,1,0); 20 | 21 | aes_intin_long(0) = newsize; 22 | aes_addrin[0] = (long)addr; 23 | 24 | AES_TRAP(aes_params); 25 | 26 | return aes_intout[0]; 27 | } 28 | -------------------------------------------------------------------------------- /x_objc_wchange.c: -------------------------------------------------------------------------------- 1 | #include "gem_aesP.h" 2 | #include "mt_gemx.h" 3 | 4 | /** Alter object status and redraw object 5 | * 6 | * @param tree as for mt_objc_change() 7 | * @param obj as for mt_objc_change() 8 | * @param new_state as for mt_objc_change() 9 | * @param clip NULL => whole window 10 | * @param whandle window handle 11 | * @param global_aes global AES array 12 | * 13 | * @since Magic 5.10 14 | * 15 | * This call is equivalent to mt_objc_change() without a redraw followed by 16 | * mt_objc_wdraw(). 17 | * 18 | */ 19 | 20 | void 21 | mt_objc_wchange(OBJECT *tree, short obj, short new_state, GRECT *clip, short whandle, short *global_aes) 22 | { 23 | AES_PARAMS(61,3,0,2,0); 24 | 25 | aes_intin[0] = obj; 26 | aes_intin[1] = new_state; 27 | aes_intin[2] = whandle; 28 | 29 | aes_addrin[0] = (long)tree; 30 | aes_addrin[1] = (long)clip; 31 | 32 | AES_TRAP(aes_params); 33 | } 34 | -------------------------------------------------------------------------------- /x_objc_wdraw.c: -------------------------------------------------------------------------------- 1 | #include "gem_aesP.h" 2 | #include "mt_gemx.h" 3 | 4 | /** Draw object(tree) 5 | * 6 | * @param tree as for mt_objc_draw() 7 | * @param start as for mt_objc_draw() 8 | * @param depth as for mt_objc_draw() 9 | * @param clip clipping area applied when drawing the \a tree. If \a clip is NULL, then 10 | * this function will take the work area of the window as clipping area. 11 | * @param whandle window handle 12 | * @param global_aes global AES array 13 | * 14 | * @since MagiC 5.10 15 | * 16 | */ 17 | 18 | void 19 | mt_objc_wdraw(OBJECT *tree, short start, short depth, GRECT *clip, short whandle, short *global_aes) 20 | { 21 | AES_PARAMS(60,3,0,2,0); 22 | 23 | aes_intin[0] = start; 24 | aes_intin[1] = depth; 25 | aes_intin[2] = whandle; 26 | 27 | aes_addrin[0] = (long)tree; 28 | aes_addrin[1] = (long)clip; 29 | 30 | AES_TRAP(aes_params); 31 | } 32 | -------------------------------------------------------------------------------- /x_realloc.c: -------------------------------------------------------------------------------- 1 | #include "gem_aesP.h" 2 | #include "mt_gemx.h" 3 | 4 | /** Change the size of memory allocated with x_malloc. 5 | * 6 | * @param addr 7 | * @param size 8 | * @param global_aes global AES array 9 | * 10 | * @return 0 if an error has occurred 11 | * 12 | * @since Geneva 13 | * 14 | */ 15 | 16 | short 17 | mt_x_realloc(void **addr, long size, short *global_aes) 18 | { 19 | AES_PARAMS(0x7189,2,1,1,0); 20 | 21 | aes_intin_long(0) = size; 22 | aes_addrin[0] = (long)addr; 23 | 24 | AES_TRAP(aes_params); 25 | 26 | return aes_intout[0]; 27 | } 28 | -------------------------------------------------------------------------------- /x_scrp_get.c: -------------------------------------------------------------------------------- 1 | #include "gem_aesP.h" 2 | #include "mt_gemx.h" 3 | 4 | /** Obtain pathname of the clipboard. 5 | * 6 | * @param deleteit 7 | * @param out 8 | * @param global_aes global AES array 9 | * 10 | * @return 0 if an error has occurred 11 | * 12 | * @since Geneva 13 | * 14 | */ 15 | 16 | short 17 | mt_x_scrp_get(char *out, short deleteit, short *global_aes) 18 | { 19 | AES_PARAMS(0x7160,1,1,1,0); 20 | 21 | aes_intin[0] = deleteit; 22 | aes_addrin[0] = (long)out; 23 | 24 | AES_TRAP(aes_params); 25 | 26 | return aes_intout[0]; 27 | } 28 | -------------------------------------------------------------------------------- /x_settings.c: -------------------------------------------------------------------------------- 1 | #include "gem_aesP.h" 2 | #include "mt_gemx.h" 3 | 4 | /** Get or alter a window's OBJECT tree and gadget control flags. 5 | * 6 | * @param getset 7 | * @param length 8 | * @param user 9 | * @param global_aes global AES array 10 | * 11 | * @return 0 if an error has occurred or a value>0 otherwise. 12 | * 13 | * @since Geneva 14 | * 15 | */ 16 | 17 | short 18 | mt_x_settings(short getset, short length, SETTINGS *user, short *global_aes) 19 | { 20 | AES_PARAMS(0x7180,2,1,1,0); 21 | 22 | aes_intin[0] = getset; 23 | aes_intin[1] = length; 24 | aes_addrin[0] = (long)user; 25 | 26 | AES_TRAP(aes_params); 27 | 28 | return aes_intout[0]; 29 | } 30 | -------------------------------------------------------------------------------- /x_shel_get.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/freemint/gemlib/44d3e3a3cadc8fc7f085e0738660377ecfdcda4f/x_shel_get.c -------------------------------------------------------------------------------- /x_shel_put.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/freemint/gemlib/44d3e3a3cadc8fc7f085e0738660377ecfdcda4f/x_shel_put.c -------------------------------------------------------------------------------- /x_sprintf.c: -------------------------------------------------------------------------------- 1 | #include "gem_aesP.h" 2 | #include "mt_gemx.h" 3 | #include "gem.h" 4 | #include 5 | 6 | /** Print data to a string, with extended formats. 7 | * 8 | * @param buf 9 | * @param fmt 10 | * @param global_aes global AES array 11 | * 12 | * @since Geneva 13 | * 14 | */ 15 | 16 | /* this only available with -mshort, because otherwise size of int does not match */ 17 | #ifdef __MSHORT__ 18 | #define global_aes aes_global 19 | void 20 | mt_x_sprintf(char *buf, const char *fmt, ...) 21 | { 22 | va_list args; 23 | AES_PARAMS(0x7183,0,0,3,0); 24 | 25 | va_start(args, fmt); 26 | aes_addrin[0] = (long)buf; 27 | aes_addrin[1] = (long)fmt; 28 | aes_addrin[2] = (long)args; 29 | va_end(args); 30 | 31 | AES_TRAP(aes_params); 32 | } 33 | #undef global_aes 34 | #endif 35 | -------------------------------------------------------------------------------- /x_sscanf.c: -------------------------------------------------------------------------------- 1 | #include "gem_aesP.h" 2 | #include "mt_gemx.h" 3 | #include "gem.h" 4 | #include 5 | 6 | /** Read formatted data from a string, with extended formats. 7 | * 8 | * @param buf 9 | * @param fmt 10 | * @param global_aes global AES array 11 | * 12 | * @since Geneva 13 | * 14 | */ 15 | 16 | /* this is only available with -mshort, because otherwise size of int does not match */ 17 | #ifdef __MSHORT__ 18 | #define global_aes aes_global 19 | void 20 | mt_x_sscanf(const char *buf, const char *fmt, ...) 21 | { 22 | va_list args; 23 | AES_PARAMS(0x7184,0,0,3,0); 24 | 25 | va_start(args, fmt); 26 | aes_addrin[0] = (long)buf; 27 | aes_addrin[1] = (long)fmt; 28 | aes_addrin[2] = (long)args; 29 | va_end(args); 30 | 31 | AES_TRAP(aes_params); 32 | } 33 | #undef global_aes 34 | #endif 35 | -------------------------------------------------------------------------------- /x_wdial_change.c: -------------------------------------------------------------------------------- 1 | #include "gem_aesP.h" 2 | #include "mt_gemx.h" 3 | 4 | /** Redraw one object within a window dialog, showing a new state. 5 | * 6 | * @param handle 7 | * @param start 8 | * @param newstate 9 | * @param global_aes global AES array 10 | * 11 | * @return 0 if an error occured or non-zero otherwise. 12 | * 13 | * @since Geneva 14 | * 15 | */ 16 | 17 | short 18 | mt_x_wdial_change(short handle, short start, short newstate, short *global_aes) 19 | { 20 | AES_PARAMS(0x7151,3,1,0,0); 21 | 22 | aes_intin[0] = handle; 23 | aes_intin[1] = start; 24 | aes_intin[2] = newstate; 25 | 26 | AES_TRAP(aes_params); 27 | 28 | return aes_intout[0]; 29 | } 30 | -------------------------------------------------------------------------------- /x_wdial_draw.c: -------------------------------------------------------------------------------- 1 | #include "gem_aesP.h" 2 | #include "mt_gemx.h" 3 | 4 | /** Redraw a dialog within a window. 5 | * 6 | * @param handle 7 | * @param start 8 | * @param depth 9 | * @param global_aes global AES array 10 | * 11 | * @return 0 if an error occured or non-zero otherwise. 12 | * 13 | * @since Geneva 14 | * 15 | */ 16 | 17 | short 18 | mt_x_wdial_draw(short handle, short start, short depth, short *global_aes) 19 | { 20 | AES_PARAMS(0x7150,3,1,0,0); 21 | 22 | aes_intin[0] = handle; 23 | aes_intin[1] = start; 24 | aes_intin[2] = depth; 25 | 26 | AES_TRAP(aes_params); 27 | 28 | return aes_intout[0]; 29 | } 30 | -------------------------------------------------------------------------------- /x_wdlg_delete.c: -------------------------------------------------------------------------------- 1 | #include "gem_aesP.h" 2 | #include "mt_gemx.h" 3 | 4 | /** releases the memory allocated for a window dialog 5 | * 6 | * @param dialog Pointer to the dialog structure 7 | * @param global_aes global AES array 8 | * 9 | * @return 1 10 | * 11 | * @since mt_appl_getinfo(7) give informations on mt_wdlg_xx() functions availability 12 | * 13 | */ 14 | 15 | short 16 | mt_wdlg_delete( DIALOG *dialog, short *global_aes ) 17 | { 18 | AES_PARAMS(163,0,1,1,0); 19 | 20 | aes_addrin[0] = (long)dialog; 21 | 22 | AES_TRAP(aes_params); 23 | 24 | return aes_intout[0]; 25 | } 26 | -------------------------------------------------------------------------------- /x_wdlg_get_handle.c: -------------------------------------------------------------------------------- 1 | #include "gem_aesP.h" 2 | #include "mt_gemx.h" 3 | 4 | /** returns the handle of the dialog window 5 | * 6 | * @param dialog Pointer to the dialog structure 7 | * @param global_aes global AES array 8 | * 9 | * @return Window handle 10 | * 11 | * @since mt_appl_getinfo(7) give informations on mt_wdlg_xx() functions availability 12 | * 13 | */ 14 | 15 | short 16 | mt_wdlg_get_handle( DIALOG *dialog, short *global_aes ) 17 | { 18 | AES_PARAMS(164,1,1,1,0); 19 | 20 | aes_intin[0] = 3; 21 | 22 | aes_addrin[0] = (long)dialog; 23 | 24 | AES_TRAP(aes_params); 25 | 26 | return aes_intout[0]; 27 | } 28 | -------------------------------------------------------------------------------- /x_wdlg_get_udata.c: -------------------------------------------------------------------------------- 1 | #include "gem_aesP.h" 2 | #include "mt_gemx.h" 3 | 4 | /** returns the variable \p user_data that was passed at the 5 | * mt_wdlg_create() call. 6 | * 7 | * @param dialog Pointer to the dialog structure 8 | * @param global_aes global AES array 9 | * 10 | * @return The pointer user_data 11 | * 12 | * @since mt_appl_getinfo(7) give informations on mt_wdlg_xx() functions availability 13 | * 14 | */ 15 | 16 | void * 17 | mt_wdlg_get_udata( DIALOG *dialog, short *global_aes ) 18 | { 19 | AES_PARAMS(164,1,0,1,1); 20 | 21 | aes_intin[0] = 2; 22 | 23 | aes_addrin[0] = (long) dialog; 24 | 25 | AES_TRAP(aes_params); 26 | 27 | return (void *) aes_addrout[0]; 28 | } 29 | -------------------------------------------------------------------------------- /x_wdlg_set_edit.c: -------------------------------------------------------------------------------- 1 | #include "gem_aesP.h" 2 | #include "mt_gemx.h" 3 | 4 | /** activates an edit object, i.e. the cursor will be drawn 5 | * in object \p obj and deleted from any previously active object. 6 | * 7 | * @param dialog Pointer to the dialog structure 8 | * @param obj Number of the new edit object 9 | * (or 0, if none is to be active) 10 | * @param global_aes global AES array 11 | * 12 | * @return Number of the current edit object 13 | * 14 | * @since mt_appl_getinfo(7) give informations on mt_wdlg_xx() functions availability 15 | * 16 | */ 17 | 18 | short 19 | mt_wdlg_set_edit( DIALOG *dialog, short obj, short *global_aes ) 20 | { 21 | AES_PARAMS(165,2,1,1,0); 22 | 23 | aes_intin[0] = 0; 24 | aes_intin[1] = obj; 25 | 26 | aes_addrin[0] = (long)dialog; 27 | 28 | AES_TRAP(aes_params); 29 | 30 | return aes_intout[0]; 31 | } 32 | -------------------------------------------------------------------------------- /x_wdlg_set_tree.c: -------------------------------------------------------------------------------- 1 | #include "gem_aesP.h" 2 | #include "mt_gemx.h" 3 | 4 | /** represents a new object tree in a dialog. If the new root 5 | * object has a different size, the window size will be adapted to suit. 6 | * The window contents will be updated in each case. 7 | * 8 | * @param dialog Pointer to the dialog structure 9 | * @param new_tree Pointer to the new object tree 10 | * @param global_aes global AES array 11 | * 12 | * @return 1 13 | * 14 | * @since mt_appl_getinfo(7) give informations on mt_wdlg_xx() functions availability 15 | * 16 | */ 17 | 18 | short 19 | mt_wdlg_set_tree( DIALOG *dialog, OBJECT *new_tree, short *global_aes ) 20 | { 21 | AES_PARAMS(165,1,1,2,0); 22 | 23 | aes_intin[0] = 1; 24 | 25 | aes_addrin[0] = (long)dialog; 26 | aes_addrin[1] = (long)new_tree; 27 | 28 | AES_TRAP(aes_params); 29 | 30 | return aes_intout[0]; 31 | } 32 | -------------------------------------------------------------------------------- /x_wind_tree.c: -------------------------------------------------------------------------------- 1 | #include "gem_aesP.h" 2 | #include "mt_gemx.h" 3 | 4 | /** Get or alter a window's OBJECT tree and gadget control flags. 5 | * 6 | * @param mode 7 | * @param wt 8 | * @param global_aes global AES array 9 | * 10 | * @return 0 if an error has occurred or a value>0 otherwise. 11 | * 12 | * @since Geneva 13 | * 14 | */ 15 | 16 | short 17 | mt_x_wind_tree(short mode, WIND_TREE *wt, short *global_aes) 18 | { 19 | AES_PARAMS(0x7152,1,1,1,0); 20 | 21 | aes_intin[0] = mode; 22 | aes_addrin[0] = (long)wt; 23 | 24 | AES_TRAP(aes_params); 25 | 26 | return aes_intout[0]; 27 | } 28 | --------------------------------------------------------------------------------