Ejemplo n.º 1
0
 static CfxMainArgsWindows()
 {
     if (CfxApi.PlatformOS == CfxPlatformOS.Windows)
     {
         CfxApiLoader.LoadCfxMainArgsWindowsApi();
     }
 }
Ejemplo n.º 2
0
 static CfxWindowInfoLinux()
 {
     if (CfxApi.PlatformOS == CfxPlatformOS.Linux)
     {
         CfxApiLoader.LoadCfxWindowInfoLinuxApi();
     }
 }
Ejemplo n.º 3
0
 static CfxWindowInfoWindows()
 {
     if (CfxApi.PlatformOS == CfxPlatformOS.Windows)
     {
         CfxApiLoader.LoadCfxWindowInfoWindowsApi();
     }
 }
Ejemplo n.º 4
0
 static CfxMainArgsLinux()
 {
     if (CfxApi.PlatformOS == CfxPlatformOS.Linux)
     {
         CfxApiLoader.LoadCfxMainArgsLinuxApi();
     }
 }
        static CfxWindowInfo()
        {
            switch (CfxApi.PlatformOS)
            {
            case CfxPlatformOS.Windows:
                CfxApiLoader.LoadCfxWindowInfoWindowsApi();
                break;

            case CfxPlatformOS.Linux:
                CfxApiLoader.LoadCfxWindowInfoLinuxApi();
                break;
            }
        }
Ejemplo n.º 6
0
 static CfxBrowserHost()
 {
     CfxApiLoader.LoadCfxBrowserHostApi();
 }
Ejemplo n.º 7
0
 static CfxSslCertPrincipal()
 {
     CfxApiLoader.LoadCfxSslCertPrincipalApi();
 }
Ejemplo n.º 8
0
 static CfxResourceHandler()
 {
     CfxApiLoader.LoadCfxResourceHandlerApi();
 }
Ejemplo n.º 9
0
        private static void Load()
        {
            CfxDebug.Announce();

            string libCfx, libCef;

            FindLibraries(out libCef, out libCfx);

            var loader = NativeFunctionLoader.Create();

            var libcfxPath = System.IO.Path.Combine(libCfxDirPath, libCfx);
            var libcefPath = System.IO.Path.Combine(libCefDirPath, libCef);

            // as of 3.2883, this must be in the path due to libcef dependencies.

            var path = Environment.GetEnvironmentVariable("PATH");

            Environment.SetEnvironmentVariable("PATH", libCefDirPath + ";" + path);

            libcefPtr = loader.LoadNativeLibrary(libcefPath);
            if (libcefPtr == IntPtr.Zero)
            {
                throw new CfxException("Unable to load libcef library " + libcefPath);
            }

            libcfxPtr = loader.LoadNativeLibrary(libcfxPath);
            if (libcfxPtr == IntPtr.Zero)
            {
                throw new CfxException("Unable to load libcfx library " + libcfxPath);
            }

            cfx_gc_handle_switch = SwitchGcHandle;

            int    platform;
            IntPtr release;
            IntPtr string_get_pointer;
            IntPtr string_destroy;
            IntPtr get_function_pointer;

            cfx_api_initialize_delegate api_initialize = (cfx_api_initialize_delegate)LoadDelegate(loader, libcfxPtr, "cfx_api_initialize", typeof(cfx_api_initialize_delegate));
            int retval = api_initialize(
                libcefPtr,
                Marshal.GetFunctionPointerForDelegate(cfx_gc_handle_switch),
                out platform,
                out CW_USEDEFAULT,
                out release,
                out string_get_pointer,
                out string_destroy,
                out get_function_pointer
                );

            if (retval != 0)
            {
                switch (retval)
                {
                case 1:
                    throw new CfxException("Unable to get native function cef_api_hash from libcef library");

                case 2:
                    Runtime.cfx_api_hash_delegate api_hash = (Runtime.cfx_api_hash_delegate)LoadDelegate(loader, libcefPtr, "cef_api_hash", typeof(Runtime.cfx_api_hash_delegate));
                    var apiHash = System.Runtime.InteropServices.Marshal.PtrToStringAnsi(api_hash(0));
                    throw new CfxException("API hash mismatch: incompatible libcef.dll (" + apiHash + ")");
                }
            }

            PlatformOS = (CfxPlatformOS)platform;

            cfx_release              = (cfx_release_delegate)Marshal.GetDelegateForFunctionPointer(release, typeof(cfx_release_delegate));
            cfx_string_get_ptr       = (cfx_string_get_ptr_delegate)Marshal.GetDelegateForFunctionPointer(string_get_pointer, typeof(cfx_string_get_ptr_delegate));
            cfx_string_destroy       = (cfx_string_destroy_delegate)Marshal.GetDelegateForFunctionPointer(string_destroy, typeof(cfx_string_destroy_delegate));
            cfx_get_function_pointer = (cfx_get_function_pointer_delegate)Marshal.GetDelegateForFunctionPointer(get_function_pointer, typeof(cfx_get_function_pointer_delegate));

            cef_string_userfree_utf16_free = (cef_string_userfree_utf16_free_delegate)LoadDelegate(loader, libcefPtr, "cef_string_userfree_utf16_free", typeof(cef_string_userfree_utf16_free_delegate));

            CfxApiLoader.LoadCfxRuntimeApi();
            librariesLoaded = true;
        }
Ejemplo n.º 10
0
 static CfxTaskRunner()
 {
     CfxApiLoader.LoadCfxTaskRunnerApi();
 }
Ejemplo n.º 11
0
 static CfxBrowserSettings()
 {
     CfxApiLoader.LoadCfxBrowserSettingsApi();
 }
Ejemplo n.º 12
0
 static CfxBeforeDownloadCallback()
 {
     CfxApiLoader.LoadCfxBeforeDownloadCallbackApi();
 }
Ejemplo n.º 13
0
 static CfxCookie()
 {
     CfxApiLoader.LoadCfxCookieApi();
 }
Ejemplo n.º 14
0
 static StringFunctions()
 {
     CfxApiLoader.LoadStringCollectionApi();
 }
Ejemplo n.º 15
0
 internal static Delegate GetDelegate(CfxApiLoader.FunctionIndex apiIndex, Type delegateType)
 {
     IntPtr functionPtr = cfx_get_function_pointer((int)apiIndex);
     if(functionPtr == IntPtr.Zero) {
         throw new CfxException("Unable to load native function " + apiIndex.ToString() + ".");
     }
     return Marshal.GetDelegateForFunctionPointer(functionPtr, delegateType);
 }
Ejemplo n.º 16
0
 static CfxFindHandler()
 {
     CfxApiLoader.LoadCfxFindHandlerApi();
 }
Ejemplo n.º 17
0
 static CfxV8Exception()
 {
     CfxApiLoader.LoadCfxV8ExceptionApi();
 }
Ejemplo n.º 18
0
 static CfxMenuModel()
 {
     CfxApiLoader.LoadCfxMenuModelApi();
 }
Ejemplo n.º 19
0
 static CfxPrintDialogCallback()
 {
     CfxApiLoader.LoadCfxPrintDialogCallbackApi();
 }
Ejemplo n.º 20
0
 static CfxPrintJobCallback()
 {
     CfxApiLoader.LoadCfxPrintJobCallbackApi();
 }
Ejemplo n.º 21
0
 static CfxV8Context()
 {
     CfxApiLoader.LoadCfxV8ContextApi();
 }
Ejemplo n.º 22
0
 static CfxCommandLine()
 {
     CfxApiLoader.LoadCfxCommandLineApi();
 }
Ejemplo n.º 23
0
 static CfxPrintSettings()
 {
     CfxApiLoader.LoadCfxPrintSettingsApi();
 }
Ejemplo n.º 24
0
 static CfxUrlParts()
 {
     CfxApiLoader.LoadCfxUrlPartsApi();
 }
Ejemplo n.º 25
0
 static CfxPrintHandler()
 {
     CfxApiLoader.LoadCfxPrintHandlerApi();
 }
 static CfxDownloadImageCallback()
 {
     CfxApiLoader.LoadCfxDownloadImageCallbackApi();
 }
Ejemplo n.º 27
0
 static CfxResponse()
 {
     CfxApiLoader.LoadCfxResponseApi();
 }
Ejemplo n.º 28
0
 static CfxRequestContextSettings()
 {
     CfxApiLoader.LoadCfxRequestContextSettingsApi();
 }
Ejemplo n.º 29
0
 static CfxFrame()
 {
     CfxApiLoader.LoadCfxFrameApi();
 }
Ejemplo n.º 30
0
 static CfxWebPluginInfoVisitor()
 {
     CfxApiLoader.LoadCfxWebPluginInfoVisitorApi();
 }
Ejemplo n.º 31
0
 static CfxRequestContext()
 {
     CfxApiLoader.LoadCfxRequestContextApi();
 }