diff --git a/Source/Libs/GtkSharp/HBox.cs b/Source/Libs/GtkSharp/HBox.cs index 83fd52508..e9b75ea8a 100644 --- a/Source/Libs/GtkSharp/HBox.cs +++ b/Source/Libs/GtkSharp/HBox.cs @@ -19,6 +19,7 @@ namespace Gtk { public partial class HBox { + [Obsolete] public HBox () : this (false, 0) {} } diff --git a/Source/Libs/GtkSharp/HScale.cs b/Source/Libs/GtkSharp/HScale.cs index 5ae67c3f2..6eef0be32 100644 --- a/Source/Libs/GtkSharp/HScale.cs +++ b/Source/Libs/GtkSharp/HScale.cs @@ -28,6 +28,7 @@ namespace Gtk { delegate IntPtr d_gtk_hscale_new_with_range(double min, double max, double step); static d_gtk_hscale_new_with_range gtk_hscale_new_with_range = FuncLoader.LoadFunction(FuncLoader.GetProcAddress(GLibrary.Load(Library.Gtk), "gtk_hscale_new_with_range")); + [Obsolete] public HScale (double min, double max, double step) : base (IntPtr.Zero) { if (GetType() != typeof (HScale)) { diff --git a/Source/Libs/GtkSharp/IconFactory.cs b/Source/Libs/GtkSharp/IconFactory.cs index 04b1b4195..8ec8e9a4e 100644 --- a/Source/Libs/GtkSharp/IconFactory.cs +++ b/Source/Libs/GtkSharp/IconFactory.cs @@ -24,7 +24,7 @@ namespace Gtk { static d_gtk_icon_size_lookup gtk_icon_size_lookup = FuncLoader.LoadFunction(FuncLoader.GetProcAddress(GLibrary.Load(Library.Gtk), "gtk_icon_size_lookup")); /// Query icon dimensions - /// Queries dimensions for icons of the specified size. + /// Queries dimensions for icons of the specified size. public void LookupIconSize (IconSize size, out int width, out int height) { gtk_icon_size_lookup (size, out width, out height); diff --git a/Source/Libs/GtkSharp/IconSet.cs b/Source/Libs/GtkSharp/IconSet.cs index 91b5fd454..71dc2fd5b 100644 --- a/Source/Libs/GtkSharp/IconSet.cs +++ b/Source/Libs/GtkSharp/IconSet.cs @@ -25,6 +25,7 @@ namespace Gtk { /// Sizes Property /// To be completed + [Obsolete] public Gtk.IconSize [] Sizes { get { diff --git a/Source/Libs/GtkSharp/ImageMenuItem.cs b/Source/Libs/GtkSharp/ImageMenuItem.cs index c2644d93a..afbad46f6 100644 --- a/Source/Libs/GtkSharp/ImageMenuItem.cs +++ b/Source/Libs/GtkSharp/ImageMenuItem.cs @@ -28,6 +28,7 @@ namespace Gtk { delegate IntPtr d_gtk_image_menu_item_new_with_mnemonic(IntPtr label); static d_gtk_image_menu_item_new_with_mnemonic gtk_image_menu_item_new_with_mnemonic = FuncLoader.LoadFunction(FuncLoader.GetProcAddress(GLibrary.Load(Library.Gtk), "gtk_image_menu_item_new_with_mnemonic")); + [Obsolete] public ImageMenuItem (string label) : base (IntPtr.Zero) { if (GetType() != typeof (ImageMenuItem)) { diff --git a/Source/Libs/GtkSharp/RadioAction.cs b/Source/Libs/GtkSharp/RadioAction.cs index 5f3bc3482..3f7b319e4 100644 --- a/Source/Libs/GtkSharp/RadioAction.cs +++ b/Source/Libs/GtkSharp/RadioAction.cs @@ -32,6 +32,7 @@ namespace Gtk delegate void d_gtk_radio_action_set_group(IntPtr raw, IntPtr list); static d_gtk_radio_action_set_group gtk_radio_action_set_group = FuncLoader.LoadFunction(FuncLoader.GetProcAddress(GLibrary.Load(Library.Gtk), "gtk_radio_action_set_group")); + [Obsolete] [GLib.Property ("group")] public RadioAction[] Group { get { diff --git a/Source/Libs/GtkSharp/RadioToolButton.cs b/Source/Libs/GtkSharp/RadioToolButton.cs index 066143b78..439743815 100644 --- a/Source/Libs/GtkSharp/RadioToolButton.cs +++ b/Source/Libs/GtkSharp/RadioToolButton.cs @@ -49,6 +49,7 @@ namespace Gtk { delegate IntPtr d_gtk_radio_tool_button_new_from_stock(IntPtr group, IntPtr stock_id); static d_gtk_radio_tool_button_new_from_stock gtk_radio_tool_button_new_from_stock = FuncLoader.LoadFunction(FuncLoader.GetProcAddress(GLibrary.Load(Library.Gtk), "gtk_radio_tool_button_new_from_stock")); + [Obsolete] public RadioToolButton (RadioToolButton[] group, string stock_id) : base (IntPtr.Zero) { if (GetType () != typeof (RadioToolButton)) { diff --git a/Source/Libs/GtkSharp/StatusIcon.cs b/Source/Libs/GtkSharp/StatusIcon.cs index 116a9d467..6b476a043 100644 --- a/Source/Libs/GtkSharp/StatusIcon.cs +++ b/Source/Libs/GtkSharp/StatusIcon.cs @@ -87,6 +87,7 @@ namespace Gtk { delegate bool d_gtk_status_icon_get_geometry(IntPtr raw, out IntPtr screen, IntPtr area, out int orientation); static d_gtk_status_icon_get_geometry gtk_status_icon_get_geometry = FuncLoader.LoadFunction(FuncLoader.GetProcAddress(GLibrary.Load(Library.Gtk), "gtk_status_icon_get_geometry")); + [Obsolete] public bool GetGeometry(out Gdk.Screen screen, out Gdk.Rectangle area, out Gtk.Orientation orientation) { IntPtr native_screen; diff --git a/Source/Libs/GtkSharp/UIManager.cs b/Source/Libs/GtkSharp/UIManager.cs index 02fa9cb7e..56f1400a1 100644 --- a/Source/Libs/GtkSharp/UIManager.cs +++ b/Source/Libs/GtkSharp/UIManager.cs @@ -26,6 +26,7 @@ namespace Gtk { public partial class UIManager { + [Obsolete] [MethodImpl(MethodImplOptions.NoInlining)] public uint AddUiFromResource (string resource) { @@ -42,6 +43,7 @@ namespace Gtk { delegate uint d_gtk_ui_manager_new_merge_id(IntPtr raw); static d_gtk_ui_manager_new_merge_id gtk_ui_manager_new_merge_id = FuncLoader.LoadFunction(FuncLoader.GetProcAddress(GLibrary.Load(Library.Gtk), "gtk_ui_manager_new_merge_id")); + [Obsolete] public uint NewMergeId () { return gtk_ui_manager_new_merge_id (Handle); @@ -50,10 +52,11 @@ namespace Gtk { delegate IntPtr d_gtk_ui_manager_get_toplevels(IntPtr raw, int types); static d_gtk_ui_manager_get_toplevels gtk_ui_manager_get_toplevels = FuncLoader.LoadFunction(FuncLoader.GetProcAddress(GLibrary.Load(Library.Gtk), "gtk_ui_manager_get_toplevels")); + [Obsolete] public Widget[] GetToplevels (Gtk.UIManagerItemType types) { IntPtr raw_ret = gtk_ui_manager_get_toplevels (Handle, (int) types); GLib.SList list = new GLib.SList (raw_ret); - Widget[] result = new Widget [list.Count]; + Widget[] result = new Widget [list.Count]; for (int i = 0; i < list.Count; i++) result [i] = list [i] as Widget; @@ -63,11 +66,12 @@ namespace Gtk { delegate IntPtr d_gtk_ui_manager_get_action_groups(IntPtr raw); static d_gtk_ui_manager_get_action_groups gtk_ui_manager_get_action_groups = FuncLoader.LoadFunction(FuncLoader.GetProcAddress(GLibrary.Load(Library.Gtk), "gtk_ui_manager_get_action_groups")); + [Obsolete] public ActionGroup[] ActionGroups { get { IntPtr raw_ret = gtk_ui_manager_get_action_groups (Handle); GLib.List list = new GLib.List(raw_ret); - ActionGroup[] result = new ActionGroup [list.Count]; + ActionGroup[] result = new ActionGroup [list.Count]; for (int i = 0; i < list.Count; i++) result [i] = list [i] as ActionGroup; diff --git a/Source/Libs/GtkSharp/VBox.cs b/Source/Libs/GtkSharp/VBox.cs index d2fe292b6..48268859c 100644 --- a/Source/Libs/GtkSharp/VBox.cs +++ b/Source/Libs/GtkSharp/VBox.cs @@ -19,6 +19,7 @@ namespace Gtk { public partial class VBox { + [Obsolete] public VBox () : this (false, 0) {} } diff --git a/Source/Libs/GtkSharp/VScale.cs b/Source/Libs/GtkSharp/VScale.cs index cad220ce2..a320cf9cd 100644 --- a/Source/Libs/GtkSharp/VScale.cs +++ b/Source/Libs/GtkSharp/VScale.cs @@ -28,6 +28,7 @@ namespace Gtk { delegate IntPtr d_gtk_vscale_new_with_range(double min, double max, double step); static d_gtk_vscale_new_with_range gtk_vscale_new_with_range = FuncLoader.LoadFunction(FuncLoader.GetProcAddress(GLibrary.Load(Library.Gtk), "gtk_vscale_new_with_range")); + [Obsolete] public VScale (double min, double max, double step) : base (IntPtr.Zero) { if (GetType() != typeof (VScale)) { diff --git a/Source/Tools/GapiCodegen/Ctor.cs b/Source/Tools/GapiCodegen/Ctor.cs index 4c2fa1f0a..b931f86a8 100644 --- a/Source/Tools/GapiCodegen/Ctor.cs +++ b/Source/Tools/GapiCodegen/Ctor.cs @@ -30,12 +30,15 @@ namespace GtkSharp.Generation { public class Ctor : MethodBase { private bool preferred; + private bool deprecated; private string name; - private bool needs_chaining = false; + private bool needs_chaining; public Ctor (XmlElement elem, ClassBase implementor) : base (elem, implementor) { preferred = elem.GetAttributeAsBoolean ("preferred"); + deprecated = elem.GetAttributeAsBoolean("deprecated"); + if (implementor is ObjectGen) needs_chaining = true; @@ -47,6 +50,12 @@ namespace GtkSharp.Generation { set { preferred = value; } } + public bool IsDeprecated { + get { + return deprecated; + } + } + public string StaticName { get { if (!IsStatic) @@ -101,6 +110,10 @@ namespace GtkSharp.Generation { if (IsStatic) GenerateStatic (gen_info); else { + + if (IsDeprecated) + sw.WriteLine("\t\t[Obsolete]"); + sw.WriteLine("\t\t{0} {1}{2} ({3}) {4}", Protection, Safety, name, Signature.ToString(), needs_chaining ? ": base (IntPtr.Zero)" : ""); sw.WriteLine("\t\t{");