public virtual void Register(SafeContextHandle context)
 {
     unsafe
     {
         UnsafeNativeMethods.gvAddLibrary(context, (gvplugin_library_t*)_library.DangerousGetHandle());
     }
 }
Beispiel #2
0
 public override void Register(SafeContextHandle context)
 {
     base.Register(context);
     unsafe
     {
         GVC_t* gvc = (GVC_t*)context.DangerousGetHandle();
         PluginEngine textLayoutEngine = Engines.Single(i => i.Api == api_t.TextLayout);
         gvc->textlayout.engine = (gvtextlayout_engine_t*)textLayoutEngine.InstalledPluginData->engine;
     }
 }
Beispiel #3
0
        public static string[] gvPluginList(SafeContextHandle gvc, string kind)
        {
            int count;

            unsafe
            {
                byte **  data   = gvPluginList(gvc, kind, out count, null);
                string[] result = new string[count];
                for (int i = 0; i < count; i++)
                {
                    result[i] = Marshal.PtrToStringAnsi((IntPtr)data[i]);
                    gfree((IntPtr)data[i]);
                }

                gfree((IntPtr)data);
                return(result);
            }
        }
Beispiel #4
0
 public static extern int gvRender(SafeContextHandle gvc, GraphHandle g, [MarshalAs(UnmanagedType.LPStr)] string format, IntPtr FILE_out);
Beispiel #5
0
 public static extern int gvLayout(SafeContextHandle gvc, GraphHandle g, [MarshalAs(UnmanagedType.LPStr)] string engine);
Beispiel #6
0
 public static extern GraphHandle gvNextInputGraph(SafeContextHandle gvc);
Beispiel #7
0
 public static extern string gvcBuildDate(SafeContextHandle gvc);
Beispiel #8
0
 public static extern unsafe char **gvcInfo(SafeContextHandle gvc);
Beispiel #9
0
 public static extern void gvFinalize(SafeContextHandle gvc);
 public static extern void gvFinalize(SafeContextHandle gvc);
 public static extern string gvcVersion(SafeContextHandle gvc);
 public static unsafe extern char** gvcInfo(SafeContextHandle gvc);
 public static extern string gvcBuildDate(SafeContextHandle gvc);
 public static unsafe extern void gvAddLibrary(SafeContextHandle gvc, gvplugin_library_t* lib);
Beispiel #15
0
 public static extern unsafe int gvRenderContext(SafeContextHandle gvc, GraphHandle g, [MarshalAs(UnmanagedType.LPStr)] string format, void *context);
Beispiel #16
0
 public static extern int gvRenderJobs(SafeContextHandle gvc, GraphHandle g);
 public static extern int gvFreeLayout(SafeContextHandle gvc, GraphHandle g);
 public static extern int gvLayout(SafeContextHandle gvc, GraphHandle g, [MarshalAs(UnmanagedType.LPStr)]string engine);
 public static extern int gvLayoutJobs(SafeContextHandle gvc, GraphHandle g);
 private static unsafe extern byte** gvPluginList(SafeContextHandle gvc, [MarshalAs(UnmanagedType.LPStr)]string kind, out int sz, [MarshalAs(UnmanagedType.LPStr)]string unused);
 public static extern GraphHandle gvNextInputGraph(SafeContextHandle gvc);
Beispiel #22
0
 public static extern string gvcVersion(SafeContextHandle gvc);
 public static extern int gvParseArgs(SafeContextHandle gvc, int argc, [MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 1, ArraySubType = UnmanagedType.LPStr)]string[] argv);
Beispiel #24
0
 public static extern int gvParseArgs(SafeContextHandle gvc, int argc, [MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 1, ArraySubType = UnmanagedType.LPStr)] string[] argv);
        public static string[] gvPluginList(SafeContextHandle gvc, string kind)
        {
            int count;
            unsafe
            {
                byte** data = gvPluginList(gvc, kind, out count, null);
                string[] result = new string[count];
                for (int i = 0; i < count; i++)
                {
                    result[i] = Marshal.PtrToStringAnsi((IntPtr)data[i]);
                    gfree((IntPtr)data[i]);
                }

                gfree((IntPtr)data);
                return result;
            }
        }
Beispiel #26
0
 public static extern GraphHandle gvPluginsGraph(SafeContextHandle gvc);
 public static extern GraphHandle gvPluginsGraph(SafeContextHandle gvc);
Beispiel #28
0
 public static extern int gvLayoutJobs(SafeContextHandle gvc, GraphHandle g);
 public static extern int gvRender(SafeContextHandle gvc, GraphHandle g, [MarshalAs(UnmanagedType.LPStr)]string format, IntPtr FILE_out);
Beispiel #30
0
 public static extern int gvRenderFilename(SafeContextHandle gvc, GraphHandle g, [MarshalAs(UnmanagedType.LPStr)] string format, [MarshalAs(UnmanagedType.LPStr)] string filename);
 public static unsafe extern int gvRenderContext(SafeContextHandle gvc, GraphHandle g, [MarshalAs(UnmanagedType.LPStr)]string format, void* context);
Beispiel #32
0
 public static extern unsafe int gvRenderData(SafeContextHandle gvc, GraphHandle g, [MarshalAs(UnmanagedType.LPStr)] string format, byte **result, uint *length);
 public static unsafe extern int gvRenderData(SafeContextHandle gvc, GraphHandle g, [MarshalAs(UnmanagedType.LPStr)]string format, byte** result, uint* length);
Beispiel #34
0
 public static extern int gvFreeLayout(SafeContextHandle gvc, GraphHandle g);
 public static extern int gvRenderFilename(SafeContextHandle gvc, GraphHandle g, [MarshalAs(UnmanagedType.LPStr)]string format, [MarshalAs(UnmanagedType.LPStr)]string filename);
Beispiel #36
0
 private static extern unsafe byte **gvPluginList(SafeContextHandle gvc, [MarshalAs(UnmanagedType.LPStr)] string kind, out int sz, [MarshalAs(UnmanagedType.LPStr)] string unused);
 public static extern int gvRenderJobs(SafeContextHandle gvc, GraphHandle g);
Beispiel #38
0
 public static extern unsafe void gvAddLibrary(SafeContextHandle gvc, gvplugin_library_t *lib);
Beispiel #39
0
 private static void drawGraph(SafeContextHandle context, GraphHandle g)
 {
     int result = UnsafeNativeMethods.gvRenderFilename(context, g, "wpf", "test.dot");
     if (result != 0)
     {
         string message = UnsafeNativeMethods.aglasterr();
         throw new Exception(message);
     }
 }