Пример #1
0
        private static CSWindow CreateWin32(Gdk.Window gdkWindow)
        {
            NativeGdkWin.Gdk_window_ensure_native(gdkWindow.Handle);
            IntPtr windowHandle = NativeGdkWin.GetWindowHandle(gdkWindow.Handle);
            int    width;
            int    height;

            gdkWindow.GetSize(out width, out height);
            return(new CSWindow(windowHandle.ToInt32(), width, height, WindowHelp.GetStartupPath()));
        }
Пример #2
0
 public static CSWindow CreateCSWindow(Gdk.Window gdkWindow)
 {
     if (Platform.IsMac)
     {
         return(WindowHelp.CreateMac(gdkWindow));
     }
     if (Platform.IsWindows)
     {
         return(WindowHelp.CreateWin32(gdkWindow));
     }
     throw new NotImplementedException();
 }
Пример #3
0
        private static CSWindow CreateMac(Gdk.Window window)
        {
            WindowHelp.gdkWindow = window;
            IntPtr windowHandle = NativeGdkMac.GetWindowHandle(WindowHelp.gdkWindow.Handle);
            IntPtr nsViewHandle = NativeGdkMac.GetNSViewHandle(WindowHelp.gdkWindow.Handle);
            int    width;
            int    height;

            WindowHelp.gdkWindow.GetSize(out width, out height);
            string startupPath = WindowHelp.GetStartupPath();

            return(new CSWindow(windowHandle, nsViewHandle, width, height, startupPath));
        }
Пример #4
0
        public static CSWindow CreateCSWindow(Gdk.Window gdkWindow)
        {
            CSWindow result;

            if (Platform.IsMac)
            {
                result = WindowHelp.CreateMac(gdkWindow);
            }
            else
            {
                if (!Platform.IsWindows)
                {
                    throw new NotImplementedException();
                }
                result = WindowHelp.CreateWin32(gdkWindow);
            }
            return(result);
        }
Пример #5
0
 public static CSWindow CreateCSWindow(IntPtr windowHandle, int width, int height)
 {
     return(new CSWindow(windowHandle.ToInt32(), width, height, WindowHelp.GetStartupPath()));
 }