コード例 #1
0
ファイル: MacCocoaHost.cs プロジェクト: tjloved/Chromely
        private static NativeMethods.ChromelyParam InitParam(InitCallbackEvent initCallback,
                                                             CreateCallbackEvent createCallback,
                                                             MovingCallbackEvent movingCallback,
                                                             ResizeCallbackEvent resizeCallback,
                                                             QuitCallbackEvent quitCallback)
        {
            NativeMethods.ChromelyParam configParam = new NativeMethods.ChromelyParam();
            configParam.initCallback   = Marshal.GetFunctionPointerForDelegate(initCallback);
            configParam.createCallback = Marshal.GetFunctionPointerForDelegate(createCallback);
            configParam.movingCallback = Marshal.GetFunctionPointerForDelegate(movingCallback);
            configParam.resizeCallback = Marshal.GetFunctionPointerForDelegate(resizeCallback);
            configParam.exitCallback   = Marshal.GetFunctionPointerForDelegate(quitCallback);

            return(configParam);
        }
コード例 #2
0
        private static ChromelyParam InitParam(RunMessageLoopCallback runCallback,
                                               CefShutdownCallback cefShutdownCallback,
                                               InitCallbackEvent initCallback,
                                               CreateCallbackEvent createCallback,
                                               MovingCallbackEvent movingCallback,
                                               ResizeCallbackEvent resizeCallback,
                                               QuitCallbackEvent quitCallback)
        {
            ChromelyParam configParam = new ChromelyParam();

            configParam.runMessageLoopCallback = Marshal.GetFunctionPointerForDelegate(runCallback);
            configParam.cefShutdownCallback    = Marshal.GetFunctionPointerForDelegate(cefShutdownCallback);
            configParam.initCallback           = Marshal.GetFunctionPointerForDelegate(initCallback);
            configParam.createCallback         = Marshal.GetFunctionPointerForDelegate(createCallback);
            configParam.movingCallback         = Marshal.GetFunctionPointerForDelegate(movingCallback);
            configParam.resizeCallback         = Marshal.GetFunctionPointerForDelegate(resizeCallback);
            configParam.exitCallback           = Marshal.GetFunctionPointerForDelegate(quitCallback);

            return(configParam);
        }