本文整理汇总了C#中IWindowInfo类的典型用法代码示例。如果您正苦于以下问题:C# IWindowInfo类的具体用法?C# IWindowInfo怎么用?C# IWindowInfo使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IWindowInfo类属于命名空间,在下文中一共展示了IWindowInfo类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: NewTabEventArgs
bool ILifeSpanHandler.OnBeforePopup(IWebBrowser browserControl, IBrowser browser, IFrame frame, string targetUrl, string targetFrameName, WindowOpenDisposition targetDisposition, bool userGesture, IPopupFeatures popupFeatures, IWindowInfo windowInfo, IBrowserSettings browserSettings, ref bool noJavascriptAccess, out IWebBrowser newBrowser)
{
newBrowser = null;
//browserControl.Load(targetUrl);
OpenInNewTab?.Invoke(this, new NewTabEventArgs(targetUrl)); //this breaks when there are multiple window.open calls from JS.
return true;
}
示例2: SampleBrowser
public SampleBrowser(Context context, IGraphicsContext graphicsContext, IWindowInfo windowInfo)
{
// TODO: Complete member initialization
this.androidContext = context;
this.GLGraphicsContext = graphicsContext;
this.GlWindowInfo = windowInfo;
}
示例3: iPhoneOSGraphicsContext
internal iPhoneOSGraphicsContext(ContextHandle handle, IWindowInfo window, IGraphicsContext sharedContext, int major, int minor, GraphicsContextFlags flags)
{
// ignore mode, window
iPhoneOSGraphicsContext shared = sharedContext as iPhoneOSGraphicsContext;
EAGLRenderingAPI version = 0;
if (major == 1 && minor == 1)
version = EAGLRenderingAPI.OpenGLES1;
else if (major == 2 && minor == 0)
version = EAGLRenderingAPI.OpenGLES2;
else if (major == 3 && minor == 0)
version = EAGLRenderingAPI.OpenGLES3;
else
throw new ArgumentException (string.Format("Unsupported GLES version {0}.{1}.", major, minor));
if (handle.Handle == IntPtr.Zero) {
EAGLContext = shared != null && shared.EAGLContext != null
? new EAGLContext(version, shared.EAGLContext.ShareGroup)
: new EAGLContext(version);
contextHandle = new ContextHandle(EAGLContext.Handle);
} else {
EAGLContext = (EAGLContext) Runtime.GetNSObject (handle.Handle);
contextHandle = handle;
}
}
示例4: AglContext
public AglContext(GraphicsMode mode, IWindowInfo window, IGraphicsContext shareContext)
{
Debug.Print("Context Type: {0}", shareContext);
Debug.Print("Window info: {0}", window);
this.graphics_mode = mode;
this.carbonWindow = (CarbonWindowInfo)window;
if (shareContext is AglContext)
shareContextRef = ((AglContext)shareContext).Handle.Handle;
if (shareContext is GraphicsContext)
{
ContextHandle shareHandle = shareContext != null ?
(shareContext as IGraphicsContextInternal).Context : (ContextHandle)IntPtr.Zero;
shareContextRef = shareHandle.Handle;
}
if (shareContextRef == IntPtr.Zero)
{
Debug.Print("No context sharing will take place.");
}
CreateContext(mode, carbonWindow, shareContextRef, true);
}
示例5: X11Input
public X11Input(IWindowInfo attach)
{
if (attach == null)
throw new ArgumentException("A valid parent window must be defined, in order to create an X11Input driver.");
X11WindowInfo x11WindowInfo = (X11WindowInfo) attach;
this.mouse.Description = "Default X11 mouse";
this.mouse.DeviceID = IntPtr.Zero;
this.mouse.NumberOfButtons = 5;
this.mouse.NumberOfWheels = 1;
this.dummy_mice_list.Add(this.mouse);
using (new XLock(x11WindowInfo.Display))
{
API.DisplayKeycodes(x11WindowInfo.Display, ref this.firstKeyCode, ref this.lastKeyCode);
IntPtr keyboardMapping = API.GetKeyboardMapping(x11WindowInfo.Display, (byte) this.firstKeyCode, this.lastKeyCode - this.firstKeyCode + 1, ref this.keysyms_per_keycode);
this.keysyms = new IntPtr[(this.lastKeyCode - this.firstKeyCode + 1) * this.keysyms_per_keycode];
Marshal.PtrToStructure(keyboardMapping, (object) this.keysyms);
API.Free(keyboardMapping);
KeyboardDevice keyboardDevice = new KeyboardDevice();
this.keyboard.Description = "Default X11 keyboard";
this.keyboard.NumberOfKeys = this.lastKeyCode - this.firstKeyCode + 1;
this.keyboard.DeviceID = IntPtr.Zero;
this.dummy_keyboard_list.Add(this.keyboard);
bool supported;
Functions.XkbSetDetectableAutoRepeat(x11WindowInfo.Display, true, out supported);
}
}
示例6: CreateGLContext
public override IGraphicsContext CreateGLContext(ContextHandle handle, IWindowInfo window, IGraphicsContext shareContext, bool directRendering, int major, int minor, GraphicsContextFlags flags)
{
WinWindowInfo winWindowInfo = (WinWindowInfo) window;
IntPtr display = this.GetDisplay(winWindowInfo.DeviceContext);
EglWindowInfo window1 = new EglWindowInfo(winWindowInfo.WindowHandle, display);
return (IGraphicsContext) new EglContext(handle, window1, shareContext, major, minor, flags);
}
示例7: CreateGLContext
public override OpenTK.Graphics.IGraphicsContext CreateGLContext(
GraphicsMode mode, IWindowInfo window, IGraphicsContext shareContext, bool directRendering,
int major, int minor, GraphicsContextFlags flags)
{
flags |= GraphicsContextFlags.Embedded;
return base.CreateGLContext(mode, window, shareContext, directRendering, major, minor, flags);
}
示例8: CreateGLContext
public override IGraphicsContext CreateGLContext(ContextHandle handle, IWindowInfo window, IGraphicsContext shareContext, bool directRendering, int major, int minor, GraphicsContextFlags flags)
{
X11WindowInfo x11_win = (X11WindowInfo)window;
//EglWindowInfo egl_win = new OpenTK.Platform.Egl.EglWindowInfo(x11_win.WindowHandle, Egl.GetDisplay(x11_win.Display));
EglWindowInfo egl_win = new OpenTK.Platform.Egl.EglWindowInfo(x11_win.WindowHandle, Egl.GetDisplay(new IntPtr(0)));
return new EglContext(handle, egl_win, shareContext, major, minor, flags);
}
示例9: Draw
public override void Draw( IWindowInfo info, Bitmap framebuffer )
{
using( FastBitmap bmp = new FastBitmap( framebuffer, true ) ) {
IntPtr scan0 = bmp.Scan0;
int size = bmp.Width * bmp.Height * 4;
IntPtr colorSpace = OSX.API.CGColorSpaceCreateDeviceRGB();
IntPtr provider = OSX.API.CGDataProviderCreateWithData( IntPtr.Zero, scan0, size, IntPtr.Zero );
const uint flags = 4 | (2 << 12);
IntPtr image = OSX.API.CGImageCreate( bmp.Width, bmp.Height, 8, 8 * 4, bmp.Stride,
colorSpace, flags, provider, IntPtr.Zero, 0, 0 );
IntPtr context = IntPtr.Zero;
OSStatus err = OSX.API.QDBeginCGContext( windowPort, ref context );
OSX.API.CheckReturn( err );
OSX.HIRect rect = new OSX.HIRect();
rect.Origin.X = 0; rect.Origin.Y = 0;
rect.Size.X = bmp.Width; rect.Size.Y = bmp.Height;
OSX.API.CGContextDrawImage( context, rect, image );
OSX.API.CGContextSynchronize( context );
err = OSX.API.QDEndCGContext( windowPort, ref context );
OSX.API.CheckReturn( err );
OSX.API.CGImageRelease( image );
OSX.API.CGDataProviderRelease( provider );
OSX.API.CGColorSpaceRelease( colorSpace );
}
}
示例10: CreateGLContext
public override IGraphicsContext CreateGLContext(ContextHandle handle, IWindowInfo window, IGraphicsContext shareContext, bool directRendering, int major, int minor, GraphicsContextFlags flags)
{
WinWindowInfo win_win = (WinWindowInfo)window;
IntPtr egl_display = GetDisplay(win_win.DeviceContext);
EglWindowInfo egl_win = new OpenTK.Platform.Egl.EglWindowInfo(win_win.WindowHandle, egl_display);
return new EglContext(handle, egl_win, shareContext, major, minor, flags);
}
示例11: AglContext
public AglContext(GraphicsMode mode, IWindowInfo window, IGraphicsContext shareContext,
GetInt xoffset, GetInt yoffset)
{
Debug.Print("Share context: {0}", shareContext);
Debug.Print("Window info: {0}", window);
IntPtr shareContextRef = IntPtr.Zero;
XOffset = xoffset;
YOffset = yoffset;
carbonWindow = window;
if (shareContext is AglContext)
{
shareContextRef = ((AglContext)shareContext).Handle.Handle;
}
else if (shareContext is GraphicsContext)
{
ContextHandle shareHandle = shareContext != null ? (shareContext as IGraphicsContextInternal).Context : (ContextHandle)IntPtr.Zero;
shareContextRef = shareHandle.Handle;
}
if (shareContextRef == IntPtr.Zero)
{
Debug.Print("No context sharing will take place.");
}
CreateContext(mode, carbonWindow, shareContextRef, true);
}
示例12: CreateGraphicsContext
public static IGraphicsContext CreateGraphicsContext(GraphicsMode mode, IWindowInfo window, int major, int minor, GraphicsContextFlags flags)
{
GraphicsContext graphicsContext = new GraphicsContext(mode, window, major, minor, flags);
graphicsContext.MakeCurrent(window);
graphicsContext.LoadAll();
return (IGraphicsContext) graphicsContext;
}
示例13: OnBeforePopup
public bool OnBeforePopup(IWebBrowser rpBrowserControl, IBlinkBrowser rpBrowser, IFrame rpFrame, string rpTargetUrl, string rpTargetFrameName, WindowOpenDisposition rpTargetDisposition, bool rpUserGesture, IPopupFeatures rpPopupFeatures, IWindowInfo rpWindowInfo, IBrowserSettings rpBrowserSettings, ref bool rrpNoJavascriptAccess, out IWebBrowser ropNewBrowser)
{
rpBrowserControl.Load(rpTargetUrl);
ropNewBrowser = rpBrowserControl;
return true;
}
示例14: X11GLContext
public X11GLContext(GraphicsMode mode, IWindowInfo window)
{
if (mode == null)
throw new ArgumentNullException("mode");
if (window == null)
throw new ArgumentNullException("window");
Debug.Print( "Creating X11GLContext context: " );
currentWindow = (X11WindowInfo)window;
Display = API.DefaultDisplay;
XVisualInfo info = currentWindow.VisualInfo;
Mode = GetGraphicsMode( info );
// Cannot pass a Property by reference.
ContextHandle = Glx.glXCreateContext(Display, ref info, IntPtr.Zero, true);
if (ContextHandle == IntPtr.Zero) {
Debug.Print("failed. Trying indirect... ");
ContextHandle = Glx.glXCreateContext(Display, ref info, IntPtr.Zero, false);
}
if (ContextHandle != IntPtr.Zero)
Debug.Print("Context created (id: {0}).", ContextHandle);
else
throw new GraphicsContextException("Failed to create OpenGL context. Glx.CreateContext call returned 0.");
if (!Glx.glXIsDirect(Display, ContextHandle))
Debug.Print("Warning: Context is not direct.");
}
示例15: AndroidGraphicsContext
public AndroidGraphicsContext (GraphicsMode mode, IWindowInfo window, IGraphicsContext sharedContext,
int major, int minor, GraphicsContextFlags flags)
{
if (major < 1 || major > 3)
throw new ArgumentException (string.Format("Unsupported GLES version {0}.{1}.", major, minor));
Init (mode, window, sharedContext, major, minor, flags);
}