#include "modgmt.h" #include "modgmt_func.h" #include "modgmt_internals.h" #include "modgmt_gsfuncs.h" #include "modgmt_map.h" // Initialisation function int gmt_module_init(void* p) { // Fill header and footer void* gmtapi; int ret=0; gmtapi=GMT_Create_Session("gmt_makemap",2,GMTMODE,0); if(0==gmtapi) return 1; if(0==ret) ret=callgmtmodule(gmtapi,"psclip","-C -P -K",&header,gmt_filter_headfoot); if(0==ret) ret=callgmtmodule(gmtapi,"psclip","-C -P -O",&footer,gmt_filter_headfoot); if(0==ret) callgmtmodule(gmtapi,"psclip","--show-datadir",&datadir); GMT_Destroy_Session(gmtapi); if(0!=ret) return ret; gmt_projection::FillProjNames(); if(!gmt_font::FillFontNames()) return 1; RegisterFunction("GMT_Header",GMT_Header); RegisterFunction("GMT_Footer",GMT_Footer); RegisterFunction("GMT_Datadir",GMT_Datadir); RegisterFunction("GET",Get); RegisterFunction("GET",Get); RegisterFunction("GET",Get); RegisterFunction("GET",Get); RegisterFunction("GET",Get); RegisterFunction("GET",Get); RegisterFunction("GET",Get); RegisterFunction("GET",Get); RegisterFunction("Coord",GMT_Type); RegisterFunction("Region",GMT_Type); RegisterFunction("Projection",GMT_Type); RegisterFunction("Color",GMT_Type); RegisterFunction("ColorGray",GMT_ColorGray); RegisterFunction("ColorRGB",GMT_ColorRGB); RegisterFunction("ColorHSV",GMT_ColorHSV); RegisterFunction("ColorCMYK",GMT_ColorCMYK); RegisterFunction("Pen",GMT_Type); RegisterFunction("Font",GMT_Type); RegisterFunction("Shift",GMT_LayerShift); RegisterFunction("DrawFrame",GMT_DrawFrame); RegisterFunction("Map",GMT_Map); RegisterFunction("Convert2PDF",GMT_Convert2PDF); RegisterFunction("Convert2PNG",GMT_Convert2PNG); RegisterFunction("Convert2JPG",GMT_Convert2JPG); RegisterFunction("Convert2JPEG",GMT_Convert2JPG); CheckGhostscriptAbilities(); // Calculating bounding box is critical if(!gs_abilities.havebbox) return 1; return 0; }