gtk: Re-indent code that was moved inside partial classes

No real code change in this commit, just whitespace changes.
This commit is contained in:
Bertrand Lorentz 2012-08-05 17:24:05 +02:00
parent a410d42975
commit a8e1e8fd7d
29 changed files with 1460 additions and 1459 deletions

View file

@ -19,12 +19,12 @@ namespace Gtk {
public partial struct AccelKey {
public AccelKey (Gdk.Key key, Gdk.ModifierType mods, Gtk.AccelFlags flags)
{
public AccelKey (Gdk.Key key, Gdk.ModifierType mods, Gtk.AccelFlags flags)
{
this.Key = key;
this.AccelMods = mods;
this._bitfield0 = 0;
this.AccelFlags = flags;
}
}
}
}

View file

@ -26,8 +26,7 @@ namespace Gtk {
public partial class Action {
public Action (string name, string label) : this (name, label, null, null)
{
}
{}
[DllImport ("libgtk-win32-3.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
static extern IntPtr gtk_action_get_proxies (IntPtr raw);

View file

@ -23,11 +23,11 @@ namespace Gtk {
public partial class Adjustment {
[DllImport ("libgtk-win32-3.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
static extern IntPtr gtk_adjustment_new(double value, double lower, double upper, double step_increment, double page_increment, double page_size);
[DllImport ("libgtk-win32-3.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
static extern IntPtr gtk_adjustment_new(double value, double lower, double upper, double step_increment, double page_increment, double page_size);
public Adjustment (double value, double lower, double upper, double step_increment, double page_increment, double page_size) : base (IntPtr.Zero)
{
public Adjustment (double value, double lower, double upper, double step_increment, double page_increment, double page_size) : base (IntPtr.Zero)
{
if (GetType () != typeof (Adjustment)) {
CreateNativeObject (new string [0], new GLib.Value [0]);
Value = value;
@ -40,16 +40,16 @@ public Adjustment (double value, double lower, double upper, double step_increme
}
Raw = gtk_adjustment_new(value, lower, upper, step_increment, page_increment, page_size);
}
}
[DllImport ("libgobject-2.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
static extern void g_object_freeze_notify (IntPtr inst);
[DllImport ("libgobject-2.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
static extern void g_object_freeze_notify (IntPtr inst);
[DllImport ("libgobject-2.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
static extern void g_object_thaw_notify (IntPtr inst);
[DllImport ("libgobject-2.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
static extern void g_object_thaw_notify (IntPtr inst);
public void SetBounds (double lower, double upper, double step_increment, double page_increment, double page_size)
{
public void SetBounds (double lower, double upper, double step_increment, double page_increment, double page_size)
{
// g_object_freeze_notify/g_object_thaw_notify calls are necessary to to avoid multiple emissions of the "changed" signal
g_object_freeze_notify (this.Handle);
@ -60,6 +60,6 @@ public void SetBounds (double lower, double upper, double step_increment, double
PageSize = page_size;
g_object_thaw_notify (this.Handle);
}
}
}
}

View file

@ -30,9 +30,9 @@ namespace Gtk {
public partial class Builder {
[System.Serializable]
public class HandlerNotFoundException : SystemException
{
[System.Serializable]
public class HandlerNotFoundException : SystemException
{
string handler_name;
string signal_name;
System.Reflection.EventInfo evnt;
@ -111,12 +111,12 @@ public class HandlerNotFoundException : SystemException
info.AddValue ("Event", evnt);
info.AddValue ("DelegateType", delegate_type);
}
}
}
[AttributeUsage (AttributeTargets.Field)]
public class ObjectAttribute : Attribute
{
[AttributeUsage (AttributeTargets.Field)]
public class ObjectAttribute : Attribute
{
private string name;
private bool specified;
@ -140,21 +140,21 @@ public class ObjectAttribute : Attribute
{
get { return specified; }
}
}
}
public IntPtr GetRawObject(string name) {
public IntPtr GetRawObject(string name) {
IntPtr native_name = GLib.Marshaller.StringToPtrGStrdup (name);
IntPtr raw_ret = gtk_builder_get_object(Handle, native_name);
GLib.Marshaller.Free (native_name);
return raw_ret;
}
}
public Builder (System.IO.Stream s) : this (s, null)
{
}
public Builder (System.IO.Stream s) : this (s, null)
{
}
public Builder (System.IO.Stream s, string translation_domain)
{
public Builder (System.IO.Stream s, string translation_domain)
{
if (s == null)
throw new ArgumentNullException ("s");
@ -166,18 +166,18 @@ public Builder (System.IO.Stream s, string translation_domain)
AddFromString(System.Text.Encoding.UTF8.GetString (buffer));
TranslationDomain = translation_domain;
}
}
public Builder (string resource_name) : this (resource_name, null)
{
}
public Builder (string resource_name) : this (resource_name, null)
{
}
public Builder (string resource_name, string translation_domain) : this (System.Reflection.Assembly.GetEntryAssembly (), resource_name, translation_domain)
{
}
public Builder (string resource_name, string translation_domain) : this (System.Reflection.Assembly.GetEntryAssembly (), resource_name, translation_domain)
{
}
public Builder (System.Reflection.Assembly assembly, string resource_name, string translation_domain) : this ()
{
public Builder (System.Reflection.Assembly assembly, string resource_name, string translation_domain) : this ()
{
if (GetType() != typeof (Builder))
throw new InvalidOperationException ("Cannot chain to this constructor from subclasses.");
@ -197,22 +197,22 @@ public Builder (System.Reflection.Assembly assembly, string resource_name, strin
AddFromString(System.Text.Encoding.UTF8.GetString (buffer));
TranslationDomain = translation_domain;
}
}
public void Autoconnect (object handler)
{
public void Autoconnect (object handler)
{
BindFields (handler);
(new SignalConnector (this, handler)).ConnectSignals ();
}
}
public void Autoconnect (Type handler_class)
{
public void Autoconnect (Type handler_class)
{
BindFields (handler_class);
(new SignalConnector (this, handler_class)).ConnectSignals ();
}
}
class SignalConnector
{
class SignalConnector
{
Builder builder;
Type handler_type;
object handler;
@ -364,21 +364,21 @@ class SignalConnector
return sb.ToString ();
}
}
}
void BindFields (object target)
{
void BindFields (object target)
{
BindFields (target, target.GetType ());
}
}
void BindFields (Type type)
{
void BindFields (Type type)
{
BindFields (null, type);
}
}
void BindFields (object target, Type type)
{
void BindFields (object target, Type type)
{
System.Reflection.BindingFlags flags = System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.DeclaredOnly;
if (target != null)
flags |= System.Reflection.BindingFlags.Instance;
@ -415,6 +415,6 @@ void BindFields (object target, Type type)
type = type.BaseType;
}
while (type != typeof(object) && type != null);
}
}
}
}

View file

@ -25,11 +25,11 @@ namespace Gtk {
public partial class Button {
[DllImport ("libgtk-win32-3.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
static extern IntPtr gtk_button_new_from_stock(IntPtr stock_id);
[DllImport ("libgtk-win32-3.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
static extern IntPtr gtk_button_new_from_stock(IntPtr stock_id);
public Button (string stock_id) : base (IntPtr.Zero)
{
public Button (string stock_id) : base (IntPtr.Zero)
{
if (GetType () != typeof (Button)) {
GLib.Value[] vals = new GLib.Value [2];
string[] names = new string [2];
@ -43,11 +43,11 @@ public Button (string stock_id) : base (IntPtr.Zero)
IntPtr native = GLib.Marshaller.StringToPtrGStrdup (stock_id);
Raw = gtk_button_new_from_stock (native);
GLib.Marshaller.Free (native);
}
}
public Button (Widget widget) : this ()
{
public Button (Widget widget) : this ()
{
Add (widget);
}
}
}
}

View file

@ -25,8 +25,8 @@ namespace Gtk {
public partial class Calendar {
public DateTime GetDate ()
{
public DateTime GetDate ()
{
uint year, month, day;
GetDate (out year, out month, out day);
DateTime result;
@ -38,14 +38,13 @@ public DateTime GetDate ()
result = new DateTime ((int) year, (int) month + 1, DateTime.DaysInMonth ((int) year, (int) month + 1));
}
return result;
}
}
// This defines a Date property for Calendar
// Note that the setter causes CalendarChange events to be fired
public DateTime Date
{
// This defines a Date property for Calendar
// Note that the setter causes CalendarChange events to be fired
public DateTime Date
{
get {
return this.GetDate();
}
@ -57,6 +56,6 @@ public DateTime Date
SelectMonth(month,year);
SelectDay(day);
}
}
}
}
}

View file

@ -23,8 +23,9 @@ namespace Gtk {
using System;
public partial class ColorSelectionDialog {
[Obsolete ("Do not use this class. It will cause your app to crash in mysterious ways.")]
public class ColorSelectionButton : Gtk.Button {
[Obsolete ("Do not use this class. It will cause your app to crash in mysterious ways.")]
public class ColorSelectionButton : Gtk.Button {
private ColorSelectionDialog color_sel;
public ColorSelectionDialog ColorSelectionDialog {
@ -34,6 +35,6 @@ public class ColorSelectionButton : Gtk.Button {
public ColorSelectionButton (ColorSelectionDialog cs, IntPtr raw) : base (raw) {
color_sel = cs;
}
}
}
}
}

View file

@ -26,47 +26,47 @@ namespace Gtk {
public partial class Container {
[DllImport("gtksharpglue-3")]
static extern void gtksharp_container_child_get_property (IntPtr container, IntPtr child, IntPtr property, ref GLib.Value value);
[DllImport("gtksharpglue-3")]
static extern void gtksharp_container_child_get_property (IntPtr container, IntPtr child, IntPtr property, ref GLib.Value value);
public GLib.Value ChildGetProperty (Gtk.Widget child, string property_name) {
public GLib.Value ChildGetProperty (Gtk.Widget child, string property_name) {
GLib.Value value = new GLib.Value ();
IntPtr native = GLib.Marshaller.StringToPtrGStrdup (property_name);
gtksharp_container_child_get_property (Handle, child.Handle, native, ref value);
GLib.Marshaller.Free (native);
return value;
}
}
public IEnumerator GetEnumerator ()
{
public IEnumerator GetEnumerator ()
{
return Children.GetEnumerator ();
}
}
class ChildAccumulator {
class ChildAccumulator {
public ArrayList Children = new ArrayList ();
public void Add (Gtk.Widget widget)
{
Children.Add (widget);
}
}
}
public IEnumerable AllChildren {
public IEnumerable AllChildren {
get {
ChildAccumulator acc = new ChildAccumulator ();
Forall (new Gtk.Callback (acc.Add));
return acc.Children;
}
}
}
[DllImport ("libgtk-win32-3.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
static extern bool gtk_container_get_focus_chain (IntPtr raw, out IntPtr list_ptr);
[DllImport ("libgtk-win32-3.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
static extern bool gtk_container_get_focus_chain (IntPtr raw, out IntPtr list_ptr);
[DllImport ("libgtk-win32-3.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
static extern void gtk_container_set_focus_chain (IntPtr raw, IntPtr list_ptr);
[DllImport ("libgtk-win32-3.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
static extern void gtk_container_set_focus_chain (IntPtr raw, IntPtr list_ptr);
public Widget[] FocusChain {
public Widget[] FocusChain {
get {
IntPtr list_ptr;
bool success = gtk_container_get_focus_chain (Handle, out list_ptr);
@ -86,24 +86,24 @@ public Widget[] FocusChain {
gtk_container_set_focus_chain (Handle, list.Handle);
}
}
}
[DllImport("gtksharpglue-3")]
static extern void gtksharp_container_base_forall (IntPtr handle, bool include_internals, IntPtr cb, IntPtr data);
[DllImport("gtksharpglue-3")]
static extern void gtksharp_container_base_forall (IntPtr handle, bool include_internals, IntPtr cb, IntPtr data);
[DllImport("gtksharpglue-3")]
static extern void gtksharp_container_override_forall (IntPtr gtype, ForallDelegate cb);
[DllImport("gtksharpglue-3")]
static extern void gtksharp_container_override_forall (IntPtr gtype, ForallDelegate cb);
[DllImport("gtksharpglue-3")]
static extern void gtksharp_container_invoke_gtk_callback (IntPtr cb, IntPtr handle, IntPtr data);
[DllImport("gtksharpglue-3")]
static extern void gtksharp_container_invoke_gtk_callback (IntPtr cb, IntPtr handle, IntPtr data);
[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
delegate void ForallDelegate (IntPtr container, bool include_internals, IntPtr cb, IntPtr data);
[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
delegate void ForallDelegate (IntPtr container, bool include_internals, IntPtr cb, IntPtr data);
static ForallDelegate ForallOldCallback;
static ForallDelegate ForallCallback;
static ForallDelegate ForallOldCallback;
static ForallDelegate ForallCallback;
public struct CallbackInvoker {
public struct CallbackInvoker {
IntPtr cb;
IntPtr data;
@ -129,10 +129,10 @@ public struct CallbackInvoker {
{
gtksharp_container_invoke_gtk_callback (cb, w.Handle, data);
}
}
}
static void ForallOld_cb (IntPtr container, bool include_internals, IntPtr cb, IntPtr data)
{
static void ForallOld_cb (IntPtr container, bool include_internals, IntPtr cb, IntPtr data)
{
try {
Container obj = GLib.Object.GetObject (container, false) as Container;
CallbackInvoker invoker = new CallbackInvoker (cb, data);
@ -140,24 +140,24 @@ static void ForallOld_cb (IntPtr container, bool include_internals, IntPtr cb, I
} catch (Exception e) {
GLib.ExceptionManager.RaiseUnhandledException (e, false);
}
}
}
static void OverrideForallOld (GLib.GType gtype)
{
static void OverrideForallOld (GLib.GType gtype)
{
if (ForallOldCallback == null)
ForallOldCallback = new ForallDelegate (ForallOld_cb);
gtksharp_container_override_forall (gtype.Val, ForallOldCallback);
}
}
[Obsolete ("Override the ForAll(bool,Gtk.Callback) method instead")]
[GLib.DefaultSignalHandler (Type=typeof(Gtk.Container), ConnectionMethod="OverrideForallOld")]
protected virtual void ForAll (bool include_internals, CallbackInvoker invoker)
{
[Obsolete ("Override the ForAll(bool,Gtk.Callback) method instead")]
[GLib.DefaultSignalHandler (Type=typeof(Gtk.Container), ConnectionMethod="OverrideForallOld")]
protected virtual void ForAll (bool include_internals, CallbackInvoker invoker)
{
gtksharp_container_base_forall (Handle, include_internals, invoker.Callback, invoker.Data);
}
}
static void Forall_cb (IntPtr container, bool include_internals, IntPtr cb, IntPtr data)
{
static void Forall_cb (IntPtr container, bool include_internals, IntPtr cb, IntPtr data)
{
try {
Container obj = GLib.Object.GetObject (container, false) as Container;
CallbackInvoker invoker = new CallbackInvoker (cb, data);
@ -165,18 +165,18 @@ static void Forall_cb (IntPtr container, bool include_internals, IntPtr cb, IntP
} catch (Exception e) {
GLib.ExceptionManager.RaiseUnhandledException (e, false);
}
}
}
static void OverrideForall (GLib.GType gtype)
{
static void OverrideForall (GLib.GType gtype)
{
if (ForallCallback == null)
ForallCallback = new ForallDelegate (Forall_cb);
gtksharp_container_override_forall (gtype.Val, ForallCallback);
}
}
[GLib.DefaultSignalHandler (Type=typeof(Gtk.Container), ConnectionMethod="OverrideForall")]
protected virtual void ForAll (bool include_internals, Gtk.Callback callback)
{
[GLib.DefaultSignalHandler (Type=typeof(Gtk.Container), ConnectionMethod="OverrideForall")]
protected virtual void ForAll (bool include_internals, Gtk.Callback callback)
{
CallbackInvoker invoker;
try {
invoker = (CallbackInvoker)callback.Target;
@ -184,11 +184,11 @@ protected virtual void ForAll (bool include_internals, Gtk.Callback callback)
throw new ApplicationException ("ForAll can only be called as \"base.ForAll()\". Use Forall() or Foreach().");
}
gtksharp_container_base_forall (Handle, include_internals, invoker.Callback, invoker.Data);
}
}
// Compatibility code for old ChildType() virtual method
static IntPtr ObsoleteChildType_cb (IntPtr raw)
{
// Compatibility code for old ChildType() virtual method
static IntPtr ObsoleteChildType_cb (IntPtr raw)
{
try {
Container obj = GLib.Object.GetObject (raw, false) as Container;
GLib.GType gtype = obj.ChildType ();
@ -198,24 +198,24 @@ static IntPtr ObsoleteChildType_cb (IntPtr raw)
}
return GLib.GType.Invalid.Val;
}
}
static ChildTypeNativeDelegate ObsoleteChildTypeVMCallback;
static ChildTypeNativeDelegate ObsoleteChildTypeVMCallback;
static void OverrideObsoleteChildType (GLib.GType gtype)
{
static void OverrideObsoleteChildType (GLib.GType gtype)
{
if (ObsoleteChildTypeVMCallback == null)
ObsoleteChildTypeVMCallback = new ChildTypeNativeDelegate (ObsoleteChildType_cb);
OverrideChildType (gtype, ObsoleteChildTypeVMCallback); // -> autogenerated method
}
}
[Obsolete ("Replaced by OnChildType for implementations and SupportedChildType for callers.")]
[GLib.DefaultSignalHandler (Type=typeof(Gtk.Container), ConnectionMethod="OverrideObsoleteChildType")]
public virtual GLib.GType ChildType() {
[Obsolete ("Replaced by OnChildType for implementations and SupportedChildType for callers.")]
[GLib.DefaultSignalHandler (Type=typeof(Gtk.Container), ConnectionMethod="OverrideObsoleteChildType")]
public virtual GLib.GType ChildType() {
return InternalChildType (); // -> autogenerated method
}
}
public class ContainerChild {
public class ContainerChild {
protected Container parent;
protected Widget child;
@ -236,12 +236,12 @@ public class ContainerChild {
return child;
}
}
}
}
public virtual ContainerChild this [Widget w] {
public virtual ContainerChild this [Widget w] {
get {
return new ContainerChild (this, w);
}
}
}
}
}

View file

@ -26,10 +26,10 @@ namespace Gtk {
using System.Runtime.InteropServices;
public partial class Dialog {
[DllImport ("libgtk-win32-3.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
static extern IntPtr gtk_dialog_new_with_buttons (IntPtr title, IntPtr i, int flags, IntPtr dummy);
public Dialog (string title, Gtk.Window parent, Gtk.DialogFlags flags, params object[] button_data) : base(IntPtr.Zero)
{
[DllImport ("libgtk-win32-3.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
static extern IntPtr gtk_dialog_new_with_buttons (IntPtr title, IntPtr i, int flags, IntPtr dummy);
public Dialog (string title, Gtk.Window parent, Gtk.DialogFlags flags, params object[] button_data) : base(IntPtr.Zero)
{
if (GetType() != typeof (Dialog)) {
GLib.Value[] vals = new GLib.Value [1];
string[] names = new string [1];
@ -49,27 +49,27 @@ public Dialog (string title, Gtk.Window parent, Gtk.DialogFlags flags, params ob
for (int i = 0; i < button_data.Length - 1; i += 2)
AddButton ((string) button_data [i], (int) button_data [i + 1]);
}
}
public void AddActionWidget (Widget child, ResponseType response)
{
public void AddActionWidget (Widget child, ResponseType response)
{
this.AddActionWidget (child, (int) response);
}
}
public Gtk.Widget AddButton (string button_text, ResponseType response)
{
public Gtk.Widget AddButton (string button_text, ResponseType response)
{
return this.AddButton (button_text, (int) response);
}
}
public void Respond (ResponseType response)
{
public void Respond (ResponseType response)
{
this.Respond ((int) response);
}
}
[Obsolete ("Replaced by AlternativeButtonOrder property")]
public int SetAlternativeButtonOrderFromArray (int n_params)
{
[Obsolete ("Replaced by AlternativeButtonOrder property")]
public int SetAlternativeButtonOrderFromArray (int n_params)
{
return -1;
}
}
}
}

View file

@ -20,24 +20,25 @@ namespace Gtk {
using System;
public partial class Entry {
public int InsertText (string new_text)
{
public int InsertText (string new_text)
{
int position = 0;
InsertText (new_text, ref position);
return position;
}
}
public Entry(string initialText): this()
{
public Entry(string initialText): this()
{
Text = initialText;
}
}
[Obsolete("Replaced by IsEditable property")]
public bool Editable {
[Obsolete("Replaced by IsEditable property")]
public bool Editable {
get { return IsEditable; }
set { IsEditable = value; }
}
}
}
}

View file

@ -19,7 +19,7 @@ namespace Gtk {
public partial class HBox {
public HBox () : this (false, 0) {}
public HBox () : this (false, 0) {}
}
}

View file

@ -20,14 +20,14 @@ namespace Gtk {
public partial class MessageDialog {
[DllImport ("libgtk-win32-3.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
static extern IntPtr gtk_message_dialog_new (IntPtr parent_window, DialogFlags flags, MessageType type, ButtonsType bt, IntPtr msg, IntPtr args);
[DllImport ("libgtk-win32-3.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
static extern IntPtr gtk_message_dialog_new (IntPtr parent_window, DialogFlags flags, MessageType type, ButtonsType bt, IntPtr msg, IntPtr args);
[DllImport ("libgtk-win32-3.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
static extern IntPtr gtk_message_dialog_new_with_markup (IntPtr parent_window, DialogFlags flags, MessageType type, ButtonsType bt, IntPtr msg, IntPtr args);
[DllImport ("libgtk-win32-3.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
static extern IntPtr gtk_message_dialog_new_with_markup (IntPtr parent_window, DialogFlags flags, MessageType type, ButtonsType bt, IntPtr msg, IntPtr args);
public MessageDialog (Gtk.Window parent_window, DialogFlags flags, MessageType type, ButtonsType bt, bool use_markup, string format, params object[] args)
{
public MessageDialog (Gtk.Window parent_window, DialogFlags flags, MessageType type, ButtonsType bt, bool use_markup, string format, params object[] args)
{
IntPtr p = (parent_window != null) ? parent_window.Handle : IntPtr.Zero;
if (format == null) {
@ -41,9 +41,9 @@ public MessageDialog (Gtk.Window parent_window, DialogFlags flags, MessageType t
else
Raw = gtk_message_dialog_new (p, flags, type, bt, nmsg, IntPtr.Zero);
GLib.Marshaller.Free (nmsg);
}
}
public MessageDialog (Gtk.Window parent_window, DialogFlags flags, MessageType type, ButtonsType bt, string format, params object[] args) : this (parent_window, flags, type, bt, true, format, args) {}
public MessageDialog (Gtk.Window parent_window, DialogFlags flags, MessageType type, ButtonsType bt, string format, params object[] args) : this (parent_window, flags, type, bt, true, format, args) {}
}
}

View file

@ -129,8 +129,7 @@ namespace Gtk {
throw new Exception (String.Format ("You have two TreeNodeValueAttributes with the Column={0}", col));
getters [col] = mi;
Type t = mi is PropertyInfo ? ((PropertyInfo) mi).PropertyType
: ((FieldInfo) mi).FieldType;
Type t = mi is PropertyInfo ? ((PropertyInfo) mi).PropertyType : ((FieldInfo) mi).FieldType;
ctypes [col] = (GLib.GType) t;
}
}

View file

@ -26,18 +26,18 @@ namespace Gtk {
public partial class Notebook {
public Widget CurrentPageWidget {
public Widget CurrentPageWidget {
get {
return GetNthPage (CurrentPage);
}
}
}
[DllImport ("libgtk-win32-3.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
static extern int gtk_notebook_page_num (IntPtr handle, IntPtr child);
[DllImport ("libgtk-win32-3.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
static extern int gtk_notebook_page_num (IntPtr handle, IntPtr child);
public int PageNum (Widget child)
{
public int PageNum (Widget child)
{
return gtk_notebook_page_num (Handle, child.Handle);
}
}
}
}

View file

@ -208,138 +208,138 @@ public void SetMidGC (StateType state, Gdk.GC gc)
}
#endif
[DllImport("gtksharpglue-3")]
static extern IntPtr gtksharp_gtk_style_get_bg (IntPtr style, int i);
[DllImport("gtksharpglue-3")]
static extern IntPtr gtksharp_gtk_style_get_bg (IntPtr style, int i);
public Gdk.Color Background (StateType state)
{
public Gdk.Color Background (StateType state)
{
IntPtr raw = gtksharp_gtk_style_get_bg (Handle, (int) state);
return Gdk.Color.New (raw);
}
}
public Gdk.Color[] Backgrounds {
public Gdk.Color[] Backgrounds {
get {
Gdk.Color[] ret = new Gdk.Color[5];
for (int i = 0; i < 5; i++)
ret[i] = Gdk.Color.New (gtksharp_gtk_style_get_bg (Handle, i));
return ret;
}
}
}
[DllImport("gtksharpglue-3")]
static extern IntPtr gtksharp_gtk_style_get_fg (IntPtr style, int i);
[DllImport("gtksharpglue-3")]
static extern IntPtr gtksharp_gtk_style_get_fg (IntPtr style, int i);
public Gdk.Color Foreground (StateType state)
{
public Gdk.Color Foreground (StateType state)
{
IntPtr raw = gtksharp_gtk_style_get_fg (Handle, (int) state);
return Gdk.Color.New (raw);
}
}
public Gdk.Color[] Foregrounds {
public Gdk.Color[] Foregrounds {
get {
Gdk.Color[] ret = new Gdk.Color[5];
for (int i = 0; i < 5; i++)
ret[i] = Gdk.Color.New (gtksharp_gtk_style_get_fg (Handle, i));
return ret;
}
}
}
[DllImport("gtksharpglue-3")]
static extern IntPtr gtksharp_gtk_style_get_text (IntPtr style, int i);
[DllImport("gtksharpglue-3")]
static extern IntPtr gtksharp_gtk_style_get_text (IntPtr style, int i);
public Gdk.Color Text (StateType state)
{
public Gdk.Color Text (StateType state)
{
IntPtr raw = gtksharp_gtk_style_get_text (Handle, (int) state);
return Gdk.Color.New (raw);
}
}
public Gdk.Color[] TextColors {
public Gdk.Color[] TextColors {
get {
Gdk.Color[] ret = new Gdk.Color[5];
for (int i = 0; i < 5; i++)
ret[i] = Gdk.Color.New (gtksharp_gtk_style_get_text (Handle, i));
return ret;
}
}
}
[DllImport("gtksharpglue-3")]
static extern IntPtr gtksharp_gtk_style_get_base (IntPtr style, int i);
[DllImport("gtksharpglue-3")]
static extern IntPtr gtksharp_gtk_style_get_base (IntPtr style, int i);
public Gdk.Color Base (StateType state)
{
public Gdk.Color Base (StateType state)
{
IntPtr raw = gtksharp_gtk_style_get_base (Handle, (int) state);
return Gdk.Color.New (raw);
}
}
public Gdk.Color[] BaseColors {
public Gdk.Color[] BaseColors {
get {
Gdk.Color[] ret = new Gdk.Color[5];
for (int i = 0; i < 5; i++)
ret[i] = Gdk.Color.New (gtksharp_gtk_style_get_base (Handle, i));
return ret;
}
}
}
[DllImport("gtksharpglue-3")]
static extern IntPtr gtksharp_gtk_style_get_light (IntPtr style, int i);
[DllImport("gtksharpglue-3")]
static extern IntPtr gtksharp_gtk_style_get_light (IntPtr style, int i);
public Gdk.Color Light (StateType state)
{
public Gdk.Color Light (StateType state)
{
IntPtr raw = gtksharp_gtk_style_get_light (Handle, (int) state);
return Gdk.Color.New (raw);
}
}
public Gdk.Color[] LightColors {
public Gdk.Color[] LightColors {
get {
Gdk.Color[] ret = new Gdk.Color[5];
for (int i = 0; i < 5; i++)
ret[i] = Gdk.Color.New (gtksharp_gtk_style_get_light (Handle, i));
return ret;
}
}
}
[DllImport("gtksharpglue-3")]
static extern IntPtr gtksharp_gtk_style_get_mid (IntPtr style, int i);
[DllImport("gtksharpglue-3")]
static extern IntPtr gtksharp_gtk_style_get_mid (IntPtr style, int i);
public Gdk.Color Mid (StateType state)
{
public Gdk.Color Mid (StateType state)
{
IntPtr raw = gtksharp_gtk_style_get_mid (Handle, (int) state);
return Gdk.Color.New (raw);
}
}
public Gdk.Color[] MidColors {
public Gdk.Color[] MidColors {
get {
Gdk.Color[] ret = new Gdk.Color[5];
for (int i = 0; i < 5; i++)
ret[i] = Gdk.Color.New (gtksharp_gtk_style_get_mid (Handle, i));
return ret;
}
}
}
[DllImport("gtksharpglue-3")]
static extern IntPtr gtksharp_gtk_style_get_dark (IntPtr style, int i);
[DllImport("gtksharpglue-3")]
static extern IntPtr gtksharp_gtk_style_get_dark (IntPtr style, int i);
public Gdk.Color Dark (StateType state)
{
public Gdk.Color Dark (StateType state)
{
IntPtr raw = gtksharp_gtk_style_get_dark (Handle, (int) state);
return Gdk.Color.New (raw);
}
}
public Gdk.Color[] DarkColors {
public Gdk.Color[] DarkColors {
get {
Gdk.Color[] ret = new Gdk.Color[5];
for (int i = 0; i < 5; i++)
ret[i] = Gdk.Color.New (gtksharp_gtk_style_get_dark (Handle, i));
return ret;
}
}
}
[DllImport ("gtksharpglue-3")]
static extern int gtksharp_gtk_style_get_thickness (IntPtr style, int x_axis);
[DllImport ("gtksharpglue-3")]
static extern void gtksharp_gtk_style_set_thickness (IntPtr style, int value);
[DllImport ("gtksharpglue-3")]
static extern int gtksharp_gtk_style_get_thickness (IntPtr style, int x_axis);
[DllImport ("gtksharpglue-3")]
static extern void gtksharp_gtk_style_set_thickness (IntPtr style, int value);
public int XThickness {
public int XThickness {
get {
return gtksharp_gtk_style_get_thickness (Handle, 0);
}
@ -347,9 +347,9 @@ public int XThickness {
set {
gtksharp_gtk_style_set_thickness (Handle, value);
}
}
}
public int YThickness {
public int YThickness {
get {
return gtksharp_gtk_style_get_thickness (Handle, 1);
}
@ -357,12 +357,12 @@ public int YThickness {
set {
gtksharp_gtk_style_set_thickness (Handle, -value);
}
}
}
[DllImport ("gtksharpglue-3")]
static extern IntPtr gtksharp_gtk_style_get_font_description (IntPtr style);
[DllImport ("gtksharpglue-3")]
static extern IntPtr gtksharp_gtk_style_get_font_description (IntPtr style);
public Pango.FontDescription FontDescription {
public Pango.FontDescription FontDescription {
get {
IntPtr Raw = gtksharp_gtk_style_get_font_description (Handle);
@ -373,6 +373,6 @@ public Pango.FontDescription FontDescription {
ret = new Pango.FontDescription (Raw);
return ret;
}
}
}
}
}

View file

@ -25,57 +25,57 @@ namespace Gtk {
public partial class TextBuffer {
[DllImport ("libgtk-win32-3.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
static extern void gtk_text_buffer_set_text (IntPtr raw, IntPtr text, int len);
[DllImport ("libgtk-win32-3.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
static extern void gtk_text_buffer_set_text (IntPtr raw, IntPtr text, int len);
public void Clear ()
{
public void Clear ()
{
Gtk.TextIter start = StartIter, end = EndIter;
Delete (ref start, ref end);
}
}
[Obsolete ("Replaced by 'ref TextIter, ref TextIter' overload")]
public void Delete (TextIter start, TextIter end )
{
[Obsolete ("Replaced by 'ref TextIter, ref TextIter' overload")]
public void Delete (TextIter start, TextIter end )
{
Delete (ref start, ref end);
}
}
// overload to paste clipboard contents at cursor editable by default.
public void PasteClipboard (Gtk.Clipboard clipboard)
{
// overload to paste clipboard contents at cursor editable by default.
public void PasteClipboard (Gtk.Clipboard clipboard)
{
gtk_text_buffer_paste_clipboard(Handle, clipboard.Handle, IntPtr.Zero, true);
}
}
[DllImport ("libgtk-win32-3.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
static extern void gtk_text_buffer_insert (IntPtr raw, ref Gtk.TextIter iter, IntPtr text, int len);
[DllImport ("libgtk-win32-3.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
static extern void gtk_text_buffer_insert (IntPtr raw, ref Gtk.TextIter iter, IntPtr text, int len);
[Obsolete ("Replaced by 'ref TextIter iter' overload")]
public void Insert (TextIter iter, string text)
{
[Obsolete ("Replaced by 'ref TextIter iter' overload")]
public void Insert (TextIter iter, string text)
{
Insert (ref iter, text);
}
}
public void Insert (ref Gtk.TextIter iter, string text)
{
public void Insert (ref Gtk.TextIter iter, string text)
{
IntPtr native = GLib.Marshaller.StringToPtrGStrdup (text);
gtk_text_buffer_insert (Handle, ref iter, native, -1);
GLib.Marshaller.Free (native);
}
}
[Obsolete ("Replaced by 'ref TextIter iter' overload")]
public void InsertRange (TextIter iter, TextIter start, TextIter end )
{
[Obsolete ("Replaced by 'ref TextIter iter' overload")]
public void InsertRange (TextIter iter, TextIter start, TextIter end )
{
InsertRange (ref iter, start, end);
}
}
[Obsolete ("Replaced by 'ref TextIter iter' overload")]
public void InsertWithTags (TextIter iter, string text, params TextTag[] tags)
{
[Obsolete ("Replaced by 'ref TextIter iter' overload")]
public void InsertWithTags (TextIter iter, string text, params TextTag[] tags)
{
InsertWithTags (ref iter, text, tags);
}
}
public void InsertWithTags (ref TextIter iter, string text, params TextTag[] tags)
{
public void InsertWithTags (ref TextIter iter, string text, params TextTag[] tags)
{
TextIter start;
int offset = iter.Offset;
Insert (ref iter, text);
@ -85,10 +85,10 @@ public void InsertWithTags (ref TextIter iter, string text, params TextTag[] tag
foreach (TextTag t in tags)
this.ApplyTag (t, start, iter);
}
}
public void InsertWithTagsByName (ref TextIter iter, string text, params string[] tagnames)
{
public void InsertWithTagsByName (ref TextIter iter, string text, params string[] tagnames)
{
TextIter start;
int offset = iter.Offset;
Insert (ref iter, text);
@ -101,51 +101,51 @@ public void InsertWithTagsByName (ref TextIter iter, string text, params string[
if (tag != null)
this.ApplyTag (tag, start, iter);
}
}
}
[Obsolete("Use the TextBuffer.Text property's setter")]
public void SetText (string text)
{
[Obsolete("Use the TextBuffer.Text property's setter")]
public void SetText (string text)
{
Text = text;
}
}
[DllImport ("libgtk-win32-3.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
static extern bool gtk_text_buffer_insert_interactive(IntPtr raw, ref Gtk.TextIter iter, IntPtr text, int len, bool default_editable);
[DllImport ("libgtk-win32-3.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
static extern bool gtk_text_buffer_insert_interactive(IntPtr raw, ref Gtk.TextIter iter, IntPtr text, int len, bool default_editable);
public bool InsertInteractive(ref Gtk.TextIter iter, string text, bool default_editable)
{
public bool InsertInteractive(ref Gtk.TextIter iter, string text, bool default_editable)
{
IntPtr native = GLib.Marshaller.StringToPtrGStrdup (text);
bool result = gtk_text_buffer_insert_interactive(Handle, ref iter, native, -1, default_editable);
GLib.Marshaller.Free (native);
return result;
}
}
[DllImport ("libgtk-win32-3.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
static extern bool gtk_text_buffer_insert_interactive_at_cursor(IntPtr raw, IntPtr text, int len, bool default_editable);
[DllImport ("libgtk-win32-3.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
static extern bool gtk_text_buffer_insert_interactive_at_cursor(IntPtr raw, IntPtr text, int len, bool default_editable);
public bool InsertInteractiveAtCursor(string text, bool default_editable)
{
public bool InsertInteractiveAtCursor(string text, bool default_editable)
{
IntPtr native = GLib.Marshaller.StringToPtrGStrdup (text);
bool result = gtk_text_buffer_insert_interactive_at_cursor(Handle, native, -1, default_editable);
GLib.Marshaller.Free (native);
return result;
}
}
[DllImport ("libgtk-win32-3.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
static extern void gtk_text_buffer_insert_at_cursor(IntPtr raw, IntPtr text, int len);
[DllImport ("libgtk-win32-3.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
static extern void gtk_text_buffer_insert_at_cursor(IntPtr raw, IntPtr text, int len);
public void InsertAtCursor(string text)
{
public void InsertAtCursor(string text)
{
IntPtr native = GLib.Marshaller.StringToPtrGStrdup (text);
gtk_text_buffer_insert_at_cursor(Handle, native, -1);
GLib.Marshaller.Free (native);
}
}
[DllImport ("libgtk-win32-3.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
static extern IntPtr gtk_text_buffer_serialize (IntPtr raw, IntPtr content_buffer, IntPtr format, ref Gtk.TextIter start, ref Gtk.TextIter end, out UIntPtr length);
[DllImport ("libgtk-win32-3.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
static extern IntPtr gtk_text_buffer_serialize (IntPtr raw, IntPtr content_buffer, IntPtr format, ref Gtk.TextIter start, ref Gtk.TextIter end, out UIntPtr length);
public byte[] Serialize(Gtk.TextBuffer content_buffer, Gdk.Atom format, Gtk.TextIter start, Gtk.TextIter end)
{
public byte[] Serialize(Gtk.TextBuffer content_buffer, Gdk.Atom format, Gtk.TextIter start, Gtk.TextIter end)
{
UIntPtr length;
IntPtr raw_ret = gtk_text_buffer_serialize (Handle, content_buffer == null ? IntPtr.Zero : content_buffer.Handle, format == null ? IntPtr.Zero : format.Handle, ref start, ref end, out length);
if (raw_ret == IntPtr.Zero)
@ -154,15 +154,15 @@ public byte[] Serialize(Gtk.TextBuffer content_buffer, Gdk.Atom format, Gtk.Text
byte[] ret = new byte [sz];
Marshal.Copy (raw_ret, ret, 0, sz);
return ret;
}
}
[DllImport ("libgtk-win32-3.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
static extern IntPtr gtk_text_buffer_get_serialize_formats(IntPtr raw, out int n_formats);
[DllImport ("libgtk-win32-3.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
static extern IntPtr gtk_text_buffer_get_serialize_formats(IntPtr raw, out int n_formats);
[DllImport ("libgtk-win32-3.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
static extern IntPtr gtk_text_buffer_get_deserialize_formats(IntPtr raw, out int n_formats);
[DllImport ("libgtk-win32-3.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
static extern IntPtr gtk_text_buffer_get_deserialize_formats(IntPtr raw, out int n_formats);
public Gdk.Atom[] DeserializeFormats {
public Gdk.Atom[] DeserializeFormats {
get {
int n_formats;
IntPtr raw_ret = gtk_text_buffer_get_deserialize_formats(Handle, out n_formats);
@ -173,9 +173,9 @@ public Gdk.Atom[] DeserializeFormats {
}
return result;
}
}
}
public Gdk.Atom[] SerializeFormats {
public Gdk.Atom[] SerializeFormats {
get {
int n_formats;
IntPtr raw_ret = gtk_text_buffer_get_serialize_formats(Handle, out n_formats);
@ -186,6 +186,6 @@ public Gdk.Atom[] SerializeFormats {
}
return result;
}
}
}
}
}

View file

@ -54,6 +54,7 @@ namespace Gtk {
Widget[] result = new Widget [list.Count];
for (int i = 0; i < list.Count; i++)
result [i] = list [i] as Widget;
return result;
}
@ -67,6 +68,7 @@ namespace Gtk {
ActionGroup[] result = new ActionGroup [list.Count];
for (int i = 0; i < list.Count; i++)
result [i] = list [i] as ActionGroup;
return result;
}
}

View file

@ -19,7 +19,7 @@ namespace Gtk {
public partial class VBox {
public VBox () : this (false, 0) {}
public VBox () : this (false, 0) {}
}
}

View file

@ -28,51 +28,51 @@ namespace Gtk {
using System.Runtime.InteropServices;
public partial class Widget {
[Obsolete ("Replaced by Window property.")]
public Gdk.Window GdkWindow {
[Obsolete ("Replaced by Window property.")]
public Gdk.Window GdkWindow {
get { return Window; }
set { Window = value; }
}
}
public void AddAccelerator (string accel_signal, AccelGroup accel_group, AccelKey accel_key)
{
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);
}
}
public int FocusLineWidth {
public int FocusLineWidth {
get {
return (int) StyleGetProperty ("focus-line-width");
}
}
}
struct GClosure {
struct GClosure {
long fields;
IntPtr marshaler;
IntPtr data;
IntPtr notifiers;
}
}
[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
delegate void ClosureMarshal (IntPtr closure, IntPtr return_val, uint n_param_vals, IntPtr param_values, IntPtr invocation_hint, IntPtr marshal_data);
[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
delegate void ClosureMarshal (IntPtr closure, IntPtr return_val, uint n_param_vals, IntPtr param_values, IntPtr invocation_hint, IntPtr marshal_data);
[DllImport ("libgobject-2.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
static extern IntPtr g_closure_new_simple (int closure_size, IntPtr dummy);
[DllImport ("libgobject-2.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
static extern IntPtr g_closure_new_simple (int closure_size, IntPtr dummy);
[DllImport ("libgobject-2.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
static extern void g_closure_set_marshal (IntPtr closure, ClosureMarshal marshaler);
[DllImport ("libgobject-2.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
static extern void g_closure_set_marshal (IntPtr closure, ClosureMarshal marshaler);
static IntPtr CreateClosure (ClosureMarshal marshaler) {
static IntPtr CreateClosure (ClosureMarshal marshaler) {
IntPtr raw_closure = g_closure_new_simple (Marshal.SizeOf (typeof (GClosure)), IntPtr.Zero);
g_closure_set_marshal (raw_closure, marshaler);
return raw_closure;
}
}
[DllImport ("libgobject-2.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
static extern uint g_signal_newv (IntPtr signal_name, IntPtr gtype, GLib.Signal.Flags signal_flags, IntPtr closure, IntPtr accumulator, IntPtr accu_data, IntPtr c_marshaller, IntPtr return_type, uint n_params, [MarshalAs (UnmanagedType.LPArray)] IntPtr[] param_types);
[DllImport ("libgobject-2.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
static extern uint g_signal_newv (IntPtr signal_name, IntPtr gtype, GLib.Signal.Flags signal_flags, IntPtr closure, IntPtr accumulator, IntPtr accu_data, IntPtr c_marshaller, IntPtr return_type, uint n_params, [MarshalAs (UnmanagedType.LPArray)] IntPtr[] param_types);
static uint RegisterSignal (string signal_name, GLib.GType gtype, GLib.Signal.Flags signal_flags, GLib.GType return_type, GLib.GType[] param_types, ClosureMarshal marshaler)
{
static uint RegisterSignal (string signal_name, GLib.GType gtype, GLib.Signal.Flags signal_flags, GLib.GType return_type, GLib.GType[] param_types, ClosureMarshal marshaler)
{
IntPtr[] native_param_types = new IntPtr [param_types.Length];
for (int parm_idx = 0; parm_idx < param_types.Length; parm_idx++)
native_param_types [parm_idx] = param_types [parm_idx].Val;
@ -83,10 +83,10 @@ static uint RegisterSignal (string signal_name, GLib.GType gtype, GLib.Signal.Fl
} finally {
GLib.Marshaller.Free (native_signal_name);
}
}
}
static void ActivateMarshal_cb (IntPtr raw_closure, IntPtr return_val, uint n_param_vals, IntPtr param_values, IntPtr invocation_hint, IntPtr marshal_data)
{
static void ActivateMarshal_cb (IntPtr raw_closure, IntPtr return_val, uint n_param_vals, IntPtr param_values, IntPtr invocation_hint, IntPtr marshal_data)
{
try {
GLib.Value inst_val = (GLib.Value) Marshal.PtrToStructure (param_values, typeof (GLib.Value));
Widget inst;
@ -99,26 +99,26 @@ static void ActivateMarshal_cb (IntPtr raw_closure, IntPtr return_val, uint n_pa
} catch (Exception e) {
GLib.ExceptionManager.RaiseUnhandledException (e, false);
}
}
}
static ClosureMarshal ActivateMarshalCallback;
static ClosureMarshal ActivateMarshalCallback;
static void ConnectActivate (GLib.GType gtype)
{
static void ConnectActivate (GLib.GType gtype)
{
if (ActivateMarshalCallback == null)
ActivateMarshalCallback = new ClosureMarshal (ActivateMarshal_cb);
GtkWidgetClass klass = GetClassStruct (gtype, false);
klass.ActivateSignal = RegisterSignal ("activate_signal", gtype, GLib.Signal.Flags.RunLast, GLib.GType.None, new GLib.GType [0], ActivateMarshalCallback);
OverrideClassStruct (gtype, klass);
}
}
[GLib.DefaultSignalHandler (Type=typeof (Gtk.Widget), ConnectionMethod="ConnectActivate")]
protected virtual void OnActivate ()
{
}
[GLib.DefaultSignalHandler (Type=typeof (Gtk.Widget), ConnectionMethod="ConnectActivate")]
protected virtual void OnActivate ()
{
}
private class BindingInvoker {
private class BindingInvoker {
System.Reflection.MethodInfo mi;
object[] parms;
@ -132,15 +132,15 @@ private class BindingInvoker {
{
mi.Invoke (w, parms);
}
}
}
/* As gtk_binding_entry_add_signall only allows passing long, double and string parameters to the specified signal, we cannot pass a pointer to the BindingInvoker directly
* to the signal. Instead, the signal takes the index of the BindingInvoker in binding_invokers.
*/
static ArrayList binding_invokers;
/* As gtk_binding_entry_add_signall only allows passing long, double and string parameters to the specified signal, we cannot pass a pointer to the BindingInvoker directly
* to the signal. Instead, the signal takes the index of the BindingInvoker in binding_invokers.
*/
static ArrayList binding_invokers;
static void BindingMarshal_cb (IntPtr raw_closure, IntPtr return_val, uint n_param_vals, IntPtr param_values, IntPtr invocation_hint, IntPtr marshal_data)
{
static void BindingMarshal_cb (IntPtr raw_closure, IntPtr return_val, uint n_param_vals, IntPtr param_values, IntPtr invocation_hint, IntPtr marshal_data)
{
try {
GLib.Value[] inst_and_params = new GLib.Value [n_param_vals];
int gvalue_size = Marshal.SizeOf (typeof (GLib.Value));
@ -153,42 +153,42 @@ static void BindingMarshal_cb (IntPtr raw_closure, IntPtr return_val, uint n_par
} catch (Exception e) {
GLib.ExceptionManager.RaiseUnhandledException (e, false);
}
}
}
static ClosureMarshal binding_delegate;
static ClosureMarshal BindingDelegate {
static ClosureMarshal binding_delegate;
static ClosureMarshal BindingDelegate {
get {
if (binding_delegate == null)
binding_delegate = new ClosureMarshal (BindingMarshal_cb);
return binding_delegate;
}
}
}
[DllImport ("libgtk-win32-3.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
static extern IntPtr gtk_binding_set_by_class (IntPtr class_ptr);
[DllImport ("libgtk-win32-3.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
static extern IntPtr gtk_binding_set_by_class (IntPtr class_ptr);
[DllImport ("libgtk-win32-3.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
static extern void gtk_binding_entry_add_signall (IntPtr binding_set, uint keyval, Gdk.ModifierType modifiers, IntPtr signal_name, IntPtr binding_args);
[DllImport ("libgtk-win32-3.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
static extern void gtk_binding_entry_add_signall (IntPtr binding_set, uint keyval, Gdk.ModifierType modifiers, IntPtr signal_name, IntPtr binding_args);
[StructLayout(LayoutKind.Sequential)]
struct GtkBindingArg {
[StructLayout(LayoutKind.Sequential)]
struct GtkBindingArg {
public IntPtr arg_type;
public GtkBindingArgData data;
}
}
[StructLayout(LayoutKind.Explicit)]
struct GtkBindingArgData {
#if WIN64LONGS
[StructLayout(LayoutKind.Explicit)]
struct GtkBindingArgData {
#if WIN64LONGS
[FieldOffset (0)] public int long_data;
#else
#else
[FieldOffset (0)] public IntPtr long_data;
#endif
#endif
[FieldOffset (0)] public double double_data;
[FieldOffset (0)] public IntPtr string_data;
}
}
static void ClassInit (GLib.GType gtype, Type t)
{
static void ClassInit (GLib.GType gtype, Type t)
{
object[] attrs = t.GetCustomAttributes (typeof (BindingAttribute), true);
if (attrs.Length == 0) return;
@ -218,10 +218,10 @@ static void ClassInit (GLib.GType gtype, Type t)
binding_args.Dispose ();
}
GLib.Marshaller.Free (native_signame);
}
}
public object StyleGetProperty (string property_name)
{
public object StyleGetProperty (string property_name)
{
GLib.Value value;
try {
value = StyleGetPropertyValue (property_name);
@ -231,16 +231,16 @@ public object StyleGetProperty (string property_name)
object ret = value.Val;
value.Dispose ();
return ret;
}
}
[DllImport ("libgtk-win32-3.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
static extern IntPtr gtk_widget_class_find_style_property (IntPtr class_ptr, IntPtr property_name);
[DllImport ("libgtk-win32-3.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
static extern IntPtr gtk_widget_class_find_style_property (IntPtr class_ptr, IntPtr property_name);
[DllImport ("libgtk-win32-3.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
static extern IntPtr gtk_widget_style_get_property (IntPtr inst, IntPtr property_name, ref GLib.Value value);
[DllImport ("libgtk-win32-3.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
static extern IntPtr gtk_widget_style_get_property (IntPtr inst, IntPtr property_name, ref GLib.Value value);
internal GLib.Value StyleGetPropertyValue (string property_name)
{
internal GLib.Value StyleGetPropertyValue (string property_name)
{
IntPtr native_name = GLib.Marshaller.StringToPtrGStrdup (property_name);
try {
IntPtr pspec_ptr = gtk_widget_class_find_style_property (this.LookupGType ().GetClassPtr (), native_name);
@ -253,13 +253,13 @@ internal GLib.Value StyleGetPropertyValue (string property_name)
} finally {
GLib.Marshaller.Free (native_name);
}
}
}
[DllImport ("libgtk-win32-3.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
static extern IntPtr gtk_widget_list_mnemonic_labels (IntPtr raw);
[DllImport ("libgtk-win32-3.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
static extern IntPtr gtk_widget_list_mnemonic_labels (IntPtr raw);
public Widget[] ListMnemonicLabels ()
{
public Widget[] ListMnemonicLabels ()
{
IntPtr raw_ret = gtk_widget_list_mnemonic_labels (Handle);
if (raw_ret == IntPtr.Zero)
return new Widget [0];
@ -268,33 +268,33 @@ public Widget[] ListMnemonicLabels ()
for (int i = 0; i < list.Count; i++)
result [i] = list [i] as Widget;
return result;
}
}
public void ModifyBase (Gtk.StateType state)
{
public void ModifyBase (Gtk.StateType state)
{
gtk_widget_modify_base (Handle, (int) state, IntPtr.Zero);
}
}
public void ModifyBg (Gtk.StateType state)
{
public void ModifyBg (Gtk.StateType state)
{
gtk_widget_modify_bg (Handle, (int) state, IntPtr.Zero);
}
}
public void ModifyFg (Gtk.StateType state)
{
public void ModifyFg (Gtk.StateType state)
{
gtk_widget_modify_fg (Handle, (int) state, IntPtr.Zero);
}
}
public void ModifyText (Gtk.StateType state)
{
public void ModifyText (Gtk.StateType state)
{
gtk_widget_modify_text (Handle, (int) state, IntPtr.Zero);
}
}
public void Path (out string path, out string path_reversed)
{
public void Path (out string path, out string path_reversed)
{
uint len;
Path (out len, out path, out path_reversed);
}
}
// Code from custom code for Gtk.Object in 2.x