コード例 #1
0
ファイル: viz.c プロジェクト: sanbor/viz.js
__attribute__((used)) char* vizRenderFromString(const char *string, const char *format, const char *engine) {

  Agraph_t *graph;
  char *result;
  unsigned int length;
  
  if (context == NULL) {
    context = gvContext();
    gvAddLibrary(context, &gvplugin_core_LTX_library);
    gvAddLibrary(context, &gvplugin_dot_layout_LTX_library);
    gvAddLibrary(context, &gvplugin_neato_layout_LTX_library);
  }
  
  graph = agmemread((char *) string);
  
  gvLayout(context, graph, engine);
  
  gvRenderData(context, graph, format, &result, &length);

  gvFreeLayout(context, graph);
  
  agclose(graph);

  return result;
  
}
コード例 #2
0
ファイル: viz.c プロジェクト: dardevelin/viz.js
__attribute__((used)) char* vizRenderFromString(char *string, char *format) {
  
  GVC_t *context = gvContext();
  gvAddLibrary(context, &gvplugin_core_LTX_library);
  gvAddLibrary(context, &gvplugin_dot_layout_LTX_library);
  
  Agraph_t *graph = agmemread(string);
  gvLayout(context, graph, "dot");

  char *result;
  unsigned int length;
  gvRenderData(context, graph, format, &result, &length);

  gvFreeLayout(context, graph);
  agclose(graph);
  gvFinalize(context);
  gvFreeContext(context);

  return result;
}
コード例 #3
0
void
gvplugin_skillgui_cairo_setup(GVC_t *gvc, SkillGuiCairoRenderInstructor *sgcri)
{
  __sgcri = sgcri;
  gvAddLibrary(gvc, &gvplugin_skillgui_cairo_LTX_library);

#if CAIROMM_MAJOR_VERSION > 1 || (CAIROMM_MAJOR_VERSION == 1 && CAIROMM_MINO_VERSION > 8)
  __skillgui_cairo_render_dashed.clear();
  __skillgui_cairo_render_dashed.push_back(6.0);
  __skillgui_cairo_render_dotted.clear();
  __skillgui_cairo_render_dotted.push_back(2.0);
  __skillgui_cairo_render_dotted.push_back(6.0);
#else
  __skillgui_cairo_render_dashed[0] = 6.0;
  __skillgui_cairo_render_dotted[0] = 2.0;
  __skillgui_cairo_render_dotted[1] = 6.0;
#endif
}