This way there's less redundancy, and if the library name changes in the
future, it will be changed only in one place.
Signed-off-by: Bertrand Lorentz <bertrand.lorentz@gmail.com>
* glib/Global.cs: Kill the calling convention field again.
It breaks GLib 2.x compatibility in the generator and there is
probably no need to make the calling convention configurable.
* .cs, *.custom: Hardcode Cdecl calling convention instead of
using GLib's field.
svn path=/trunk/gtk-sharp/; revision=141283
* glib/Global.cs: Add a public constant field specifying the
calling convention used by GLib and depending libraries.
By now it's hardcoded to Cdecl as every non-Win32 runtime
should ignore this attribute.
* *.cs, *.custom: Use GLib.Global.CallingConvention for both
pinvokes and callbacks. Plugs a stack leak on Win32. All
pinvokes defaulted to StdCall and thus the stack was never
cleaned up.
svn path=/trunk/gtk-sharp/; revision=141175
* glib/Signal.cs: AddEmissionHook binding (for closing #386950), and
change API of Emit to mimic the detailed_signal pattern.
* glib/GType.cs: GType.FromName: new wrapper for native call.
* glib/ObjectManager.cs: Use the new FromName managed method.
svn path=/trunk/gtk-sharp/; revision=103198
* */*-api.xml: Regen, adding gtype="..." to many enum types
* generator/EnumGen.cs (Generate): if the enum has the
"gtype" property, add a GTypeAttribute pointing to an internal
FooGType class whose GType property can be used to get the enum's
GType.
* generator/ObjectGen.cs:
s/ObjectManager.RegisterType/GType.Register/
* glib/GTypeAttribute.cs: attribute for indicating a property that
will return the GType of a type (particularly for enums, which
can't have GType properties added to them).
* glib/GType.cs: renamed from Type.cs to match the type name
(public static readonly GType ...): add a few missing types.
(Register): moved from ObjectManager.RegisterType
(LookupGType): moved from TypeConverter.LookupType and extended to
handle GTypeAttribute. Also, fix mappings for sbyte/byte/char, and
return specific GTypes for Object subclasses rather than always
returning GType.Object. [Fixes#74699]
(LookupType): moved from ObjectWrapper.LookupType
(ToString): return the type name
* glib/Object.cs (RegisterGType):
s/ObjectManager.Register/GType.Register/
(LookupGType): Make this protected internal so GType can access
it.
* glib/ObjectManager.cs (RegisterType): deprecate in favor of
GType.Register.
(LookupType): moved to GType
* glib/TypeConverter.cs (LookupType): now a deprecated wrapper
around GType.LookupGType.
* glib/Value.cs: Use GType casts rather than TypeConverter
* gtk/NodeStore.cs (ScanType):
* gtk/ListStore.custom (ListStore):
* gtk/TreeStore.custom (TreeStore): Use (GType) cast rather than
TypeConverter. Remove the error check and exception, since the
cast never returns GType.Invalid. (The check probably predates
GLib.ManagedValue.)
* gnome/PanelAppletFactory.cs (Register): Use a GType cast rather
than GLib.Object.LookupGType (which is no longer accessible after
an mcs bugfix)
* sample/GtkDemo/DemoIconView.cs (CreateStore): use the Type[]
constructor rather than the GType[] constructor, since it
translates typeof(Gdk.Pixbuf) correctly now.
svn path=/trunk/gtk-sharp/; revision=44038
* generator/CallbackGen.cs : don't create native delegates for nulls.
* generator/ObjectGen.cs : revamp the ObjectManager code.
* glib/Object.cs : use new ObjectManager.RegisterType overload.
* glib/ObjectManager.cs : rewrite to kill the lameass LoadWithPartial
hack and keep a GType to Type mapping for quicker lookup/activation.
svn path=/trunk/gtk-sharp/; revision=42241
* */*.cs : scrub for StringToPtrAnsi and string usage in DllImports.
* */*.custom : begin the scrub here too.
* generator/ConstStringGen.cs : implement IManualMarshaler and move to
100% IntPtr marshaling.
* generator/Ctor.cs : call Body.Finish too.
* generator/IManualMarshaler.cs : new interface for generatables that
marshal manually and need cleanup.
* generator/Makefile.am : new file.
* generator/MethodBody.cs : use IManualMarshaler if applicable.
svn path=/trunk/gtk-sharp/; revision=41579
* glib/ObjectManager.cs (GetValidParentType): return null if
G_TYPE_INVALID is returned from glue. [Fixes#72150]
svn path=/trunk/gtk-sharp/; revision=40063
* generator/Signal.cs : use typeof instead of Type.GetType to
specify the event args type.
* glib/ObjectManager.cs : beef up the type lookup code using
Assembly.LoadWithPartialName to fix a very popular win32 bug.
[Fixes#61139 and friends] Thanks to John Luke for expert
patch testing on win32.
svn path=/trunk/gtk-sharp/; revision=32831
* */*.cs : add lgpl license blurb and clean up (c)'s.
* */*.custom : add lgpl license blurb and clean up (c)'s.
* */glue/*.c : add lgpl license blurb and clean up (c)'s.
file adds without license from now on are punishable by wedgie.
svn path=/trunk/gtk-sharp/; revision=30401
* generator/ObjectGen.cs : adjust to ObjectManager ns change.
* glib/ManagedValue.cs : move to GLib and internalize.
* glib/Object.cs : adjust to ObjectManager ns change.
* glib/ObjectManager.cs : move to GLib.
* glib/TypeConverter.cs : move to GLib. return ManagedValue.GType
when we can't match a type instead of GType.None.
* gtk/*.custom: adjust for new TypeConverter ns and behavior.
2004-05-28 Mike Kestner <mkestner@ximian.com>
* en/* : run updater. fix a few *Sharp copy/pastisms.
svn path=/trunk/gtk-sharp/; revision=28362
* glib/MissingIntPtrCtorException.cs : new exception to throw if
unable to access an IntPtr ctor on a GLib.Object subclass. We need
an IntPtr ctor to be able to wrap arbitrary object handles.
* glib/Object.cs : have NativeType call LookupGType.
* glib/ObjectManager.cs : throw the new exception in a try/catch.
svn path=/trunk/gtk-sharp/; revision=27563
[Derived from a patch by Ben Maurer]
* generator/Ctor.cs : generate code to detect subclassing and handle
GType registration and native object creation properly.
* generator/Parameters.cs : add PropertyName accessor for param attr.
* generator/Property.cs : use a new GLib.Value ctor.
* glib/ObjectManager.cs : redo hash access.
* glib/Object.cs : CreateNativeObject method to invoke g_object_newv
and some refactoring of RegisterGType and LookupGType.
* glib/Value.cs : make gtype field an IntPtr.
* glib/glue/object.c : glue for g_object_newv use.
* glib/glue/value.c : new glue for value creation.
* gtk/Dialog.custom : fix a ctor declaration for auto-reg.
* gtk/Gtk.metadata : mark a couple property_name attrs as examples.
* sample/Subclass.cs : use auto-GType-registration now.
svn path=/trunk/gtk-sharp/; revision=26916
* */Makefile.am : automakify the build
* */Makefile.in : kill
* *.custom : remove System.Drawing dependencies
* *.cs : remove System.Drawing dependencies
* *-api.xml : mv to *-api.raw
* glue/* : mv to lib specific gluelibs for glib, gdk, gtk, and glade.
* gtk/gtk-symbols : alias GtkType to GType
* sources/gtk-sharp-sources.xml : create .raw files. They are now
transformed to .xml files by the metadata compilation step.
svn path=/trunk/gtk-sharp/; revision=23967
* gconf/Value.cs: Update to use new string marshalling.
* generator/StringGen.cs, ConstStringGen.cs: Added.
* generator/IGeneratable.cs: Add new method ToNativeReturn.
* generator/CallbackGen.cs: Implement ToNativeReturn. Call
ToNativeReturn for the return statement. Fix a couple of
places where s_ret was being used incorrectly for m_ret.
* generator/ClassGen.cs, EnumGen.cs, ManualGen.cs,
SimpleGen.cs, StructBase.cs: Implement ToNativeReturn.
* generator/SignalHandler.cs: Call ToNativeReturn for the
return statement, instead of CallByName.
* generator/SymbolTable.cs: Use StringGen for gchar, char,
and gunichar, and ConstStringGen for their const variants.
Add a new method wrapper for ToNativeReturn.
(Trim): Add a special-case for const strings so that the
const is not stripped. Otherwise there is no way of
resolving the const case.
* glade/XML.custom: Update to use new string marshalling.
* glib/Marshaller.cs: Added.
* glib/GException.cs, Markup.cs, ObjectManager.cs,
Value.cs: Update to use new string marshalling.
* glib/Object.cs: Remove old g_type_name DllImport
as it is no longer used.
* glue/fileselection.c (gtksharp_file_selection_get_fileop_entry):
Mark this as const return.
* gtk/ColorSelection.custom, FileSelection.custom,
SelectionData.custom: Update to use new string marshalling.
svn path=/trunk/gtk-sharp/; revision=15286
an exact match for a C GObject class (i.e. BluecurveStyle),
walk up the gobject type hierarchy until we find a type
that we do have a wrapper for, and return that. This means
that you'll always, worst-case, end up with a GObject.
* glib/Value.cs, glue/value.c: Added default constructor
to GLib.Value() that creates a new value with a type of
INVALID, and changed the glue function to not call
gtk_type_init if INVALID is passed.
svn path=/trunk/gtk-sharp/; revision=7994
* art/Makefile.in (clean): Change to avoid bugging out on generated/CVS.
* glib/ObjectManager.cs: Added. Used to be auto-generated, but
now it can infer names, and relies on per-namespace ObjectManager
classes to inform it of oddly-named classes.
* generator/IGeneratable.cs, GenBase.cs: New "DoGenerate" property.
* generator/*Gen.cs: Honor DoGenerate.
* generator/CodeGenerator.cs: Support including dependency files
which will not be generated.
* generator/ObjectGen.cs: Generate mapping file per-namespace, as one
that calls back to the one in glib. Only generate if the name does
not follow the normal conventions, otherwise, GtkSharp.ObjectManager
can infer the name.
* generator/Parser.cs: Accept 'generate' flag to pass on to the
IGeneratables. Parse a new toplevel element, "symbol", which adds
a type to the SymbolTable (instead of hard-coding it).
* generator/SignalHandler.cs: Do not optimize signal handler creation,
instead creating them in their own namespaces. Do not generate
if the calling Signal told us not to.
* generator/Signal.cs: Do not generate handlers if container's DoGenerate
is false. Adjust to the marshaller name being in a sub-namespace.
* generator/SymbolTable.cs (AddSimpleType, AddManualType): Used
to add simple and manually wrapped types at runtime instead of
compile-time.
(FromNative): Remove hard-coded cases for manually wrapped types, use
a generic case instead.
* api: Added. Move api files and generation targets here.
* source: Added. Move source parsing here.
* generator/makefile: Move actual generation to api/.
* glib/Makefile.in: Remove generated/* target.
* glue/Makefile.am: Fix to include canvas-marshal. Move canvas stuff
to GNOME target.
* gnome/CanvasProxy.cs: Update to work with SignalHandlers being
namespace-specific.
* parser/Metadata.pm: Moved to GAPI/Metadata.pm, renamed, etc.
* parser/gapi2xml.pl: Use GAPI::Metadata.
* parser/makefile: Install scripts, remove source parse build target.
Rename formatXML to gapi_format_xml.
svn path=/trunk/gtk-sharp/; revision=6818
* HACKING : New rulez.
* NOTES: Killed. We have a mailing list now for this kind of stuff.
* glib/makefile : New, to build the new glib-sharp.dll target.
* glib/Object.cs : (GetObject): Commented out. Design problems here.
IntPtr's can't be used in the manner this code attempts to use them.
(Data prop): Commented out. Apparently keyed properties are not
supported.
(Object prop): Renamed RawObject, and made it protected.
(Events): Fixed to cause list to be initialized if null and then
return the list.
* glib/ObjectManager.cs : commented out entirely. Not sure what this
code is trying to accomplish and it doesn't compile.
* glib/Value.cs : New attempt at implementing GValues. Doesn't work
yet.
* gtk/Button.cs : Updated to use RawObject.
(Clicked event): s/EmitDeleteEvent/EmitClickedEvent.
(Button(String)): s/gtk_label_new_with_lable/gtk_button_new_with_label.
* gtk/Label.cs : Fixed some yank and paste errors where 2 value params
were getting passed to all the set_* property methods.
* gtk/Window.cs : Fixed hanging GTK namespace ref.
* sample/HelloWorld.cs : Fixed hanging GTK namespace ref.
svn path=/trunk/gtk-sharp/; revision=884