mirror of
https://github.com/Ryujinx/GtkSharp.git
synced 2024-12-25 15:05:36 +00:00
9698c4d2f9
* gtk/Widget.custom: expose some easy bool properties for checking certain WidgetFlags. Make Allocation a settable property. * gtk/glue/widget.c: bit of glue to make Allocation settable. * gdk/Window.custom: expose UserData as a usable IntPtr property. * gdk/Gdk.metadata: hide old GetUserData/SetUserData methods. * doc/*: ran the updater. svn path=/trunk/gtk-sharp/; revision=28974
111 lines
2.6 KiB
Plaintext
111 lines
2.6 KiB
Plaintext
//
|
|
// Gtk.Widget.custom - Gtk Widget class customizations
|
|
//
|
|
// Author: Rachel Hestilow <hestilow@ximian.com>
|
|
//
|
|
// Copyright (C) 2002 Rachel Hestilow
|
|
//
|
|
// This code is inserted after the automatically generated code.
|
|
//
|
|
|
|
[DllImport("gtksharpglue")]
|
|
static extern IntPtr gtksharp_gtk_widget_get_allocation (IntPtr style);
|
|
|
|
[DllImport("gtksharpglue")]
|
|
static extern void gtksharp_gtk_widget_set_allocation (IntPtr raw, Gdk.Rectangle rect);
|
|
|
|
public Gdk.Rectangle Allocation {
|
|
get { return Gdk.Rectangle.New (gtksharp_gtk_widget_get_allocation (Handle)); }
|
|
set { gtksharp_gtk_widget_set_allocation (Handle, value); }
|
|
}
|
|
|
|
|
|
[DllImport ("gtksharpglue")]
|
|
static extern IntPtr gtksharp_gtk_widget_get_window (IntPtr widget);
|
|
[DllImport ("gtksharpglue")]
|
|
static extern void gtksharp_gtk_widget_set_window (IntPtr widget, IntPtr window);
|
|
public Gdk.Window GdkWindow {
|
|
get {
|
|
IntPtr raw_ret = gtksharp_gtk_widget_get_window (Handle);
|
|
|
|
if (raw_ret != (IntPtr) 0){
|
|
Gdk.Window ret = (Gdk.Window) GLib.Object.GetObject(raw_ret, false);
|
|
return ret;
|
|
}
|
|
return null;
|
|
}
|
|
set {
|
|
Gdk.Window window = value as Gdk.Window;
|
|
gtksharp_gtk_widget_set_window (Handle, window.Handle);
|
|
}
|
|
}
|
|
|
|
public void AddAccelerator (string accel_signal, AccelGroup accel_group, AccelKey accel_key)
|
|
{
|
|
this.AddAccelerator (accel_signal, accel_group, (uint) accel_key.Key, accel_key.AccelMods, accel_key.AccelFlags);
|
|
|
|
}
|
|
|
|
[DllImport("libgtk-win32-2.0-0.dll")]
|
|
static extern void gtk_widget_set_state (IntPtr raw, int state);
|
|
|
|
[DllImport("gtksharpglue")]
|
|
static extern int gtksharp_gtk_widget_get_state (IntPtr raw);
|
|
|
|
public Gtk.StateType State {
|
|
set {
|
|
gtk_widget_set_state (Handle, (int) value);
|
|
}
|
|
get {
|
|
return (Gtk.StateType) gtksharp_gtk_widget_get_state (Handle);
|
|
}
|
|
}
|
|
|
|
[DllImport("gtksharpglue")]
|
|
static extern int gtksharp_gtk_widget_get_flags (IntPtr raw);
|
|
|
|
[DllImport("gtksharpglue")]
|
|
static extern void gtksharp_gtk_widget_set_flags (IntPtr raw, int flags);
|
|
|
|
public int Flags {
|
|
get {
|
|
return gtksharp_gtk_widget_get_flags (Handle);
|
|
}
|
|
set {
|
|
gtksharp_gtk_widget_set_flags (Handle, (int) value);
|
|
}
|
|
}
|
|
|
|
public bool IsMapped {
|
|
get {
|
|
return ((Flags & (int)Gtk.WidgetFlags.Mapped) != 0);
|
|
}
|
|
}
|
|
|
|
public bool IsRealized {
|
|
get {
|
|
return ((Flags & (int)Gtk.WidgetFlags.Realized) != 0);
|
|
}
|
|
}
|
|
|
|
public bool NoWindow {
|
|
get {
|
|
return ((Flags & (int)Gtk.WidgetFlags.NoWindow) != 0);
|
|
}
|
|
}
|
|
|
|
public bool Drawable {
|
|
get {
|
|
return (Visible && IsMapped);
|
|
}
|
|
}
|
|
|
|
[DllImport("gtksharpglue")]
|
|
static extern int gtksharp_gtk_widget_style_get_int (IntPtr raw, string name);
|
|
|
|
public int FocusLineWidth {
|
|
get {
|
|
return gtksharp_gtk_widget_style_get_int (Handle, "focus-line-width");
|
|
}
|
|
}
|