* generator/ClassBase.cs : remove default ctor generation and
hasDefaultConstructor field.
* generator/Ctor.cs : chain to base (IntPtr.Zero).
* generator/StructBase.cs : remove hasDefaultConstructor usage.
* glib/Object.cs : remove Object () ctor. Add Ben's GetGType
method, although nothing uses it yet. Still working on integrating
the remainder of Ben's patch.
* gtk/Gtk.metadata : remove all the disabledefaultctor rules.
* */*.custom : add base (IntPtr.Zero) or this (...) chaining for
all ctors.
svn path=/trunk/gtk-sharp/; revision=25184
* glib/Value.cs : NULL check for g_value_get_string Thanks to Jeroen
Zwartepoorte for the bug report with patch [fixes#54979].
svn path=/trunk/gtk-sharp/; revision=24910
* generator/ObjectGen.cs : don't gen a Signals hash per class.
* generator/Signal.cs : gen checks for [ConnectBefore].
* generator/SignalHandler.cs : add connect_flags param to ctor.
* glib/ConnectBeforeAttribute.cs : new attr
* glib/Makefile.am : add new file
* glib/Object.cs : add before/after hashes and EventLists
* gnome/CanvasProxy.cs : use AfterSignals and AfterHandlers.
svn path=/trunk/gtk-sharp/; revision=24157
* */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
* glib/Value.cs: use g_value_set_pointer for
GType.Pointer/IWrapper objects
* glib/TypeConverter.cs: return GType.Pointer for Opaque objects
which do not have GType property
svn path=/trunk/gtk-sharp/; revision=23197
* glib/TypeConverter.cs : check for GType prop on all types,
not just value types, before we fall back to managed values.
* glib/Value.cs : use handle to set_boxed for IWrappers.
svn path=/trunk/gtk-sharp/; revision=23158
* glib/List.cs : add a ctor overload to create empty lists with
a specific element_type.
* glib/SList.cs : ditto
svn path=/trunk/gtk-sharp/; revision=22765
* glib/Value.cs : remove double free of ManagedValues. Fixes the
unfiled (cough, tberman, cough) bug in managed types as tree
store values.
svn path=/trunk/gtk-sharp/; revision=22745
* glib/ManagedValue.cs : null check on Free.
* glib/Value.cs : some ManagedValue rework because we unset now.
svn path=/trunk/gtk-sharp/; revision=22728
* glib/Value.cs : add dispose queue and idle handler so we can
unset GValues that are created by the binding ctors.
[Fixes#53490]
svn path=/trunk/gtk-sharp/; revision=22709
* glib/Marshaller.cs (ArrayPtrToArgv, ArgvToArrayPtr): new
functions for marshalling and unmarshalling string arrays
to/from char **. Not pretty, but lets us call gtk_init()
in Gtk.
* gtk/Application.cs (do_init): New helper function to handle
passing args to Gtk. Uses above functions.
(Init): Use do_init, take a new progname parameter.
(InitCheck): Same.
doc/:
2003-01-13 Peter Williams <peter@newton.cx>
* en/Gtk/Application.xml: Update Init, InitCheck functions
for new progname argument. Fix a paste-o in the docs for InitCheck.
svn path=/trunk/gtk-sharp/; revision=22237
* glib/Object.cs (ConnectDefaultHandlers): reflection code to
hook up overridden default signal handlers.
* glue/type.c (gtksharp_override_virtual_method): peek the gtype
and ref the class if it isn't created yet.
* sample/Subclass.cs : update to override Button.OnClicked.
svn path=/trunk/gtk-sharp/; revision=21559
* generator/BoxedGen.cs : s/uint/GLib.GType
* generator/ManualGen.cs : add a ctor to pass ToNative handle name
* generator/ObjectGen.cs : s/uint/GLib.GType
* generator/Signal.cs : use GLib.GType and call OverrideVirtualMethod
* generator/SymbolTable.cs : make GType a ManualGen and update a few
ManualGens to the new signatures.
* glib/DefaultSignalHandler.cs : s/Type/System.Type
* glib/ManagedValue.cs : s/uint/GLib.GType
* glib/Object.cs : s/uint/GLib.GType, add OverrideVirtualMethod.
* glib/Type.cs : s/uint/IntPtr, add static fields for fundamentals.
make it a value type and add ==, !=, Equals, and GetHashCode.
* glib/TypeConverter.cs : use new GType statics, not fundamentals.
* glib/Value.cs : use new GType statics, not fundamentals.
* gnome/*.custom : s/uint/GLib.GType
* gtk/*Store.custom : use GType statics, not fundamentals.
* sample/Subclass.cs : s/uint/GLib.GType.
svn path=/trunk/gtk-sharp/; revision=21181
* glib/Log.cs: Make LogLevelFlags CLS compliant.
* glib/SignalCallback.cs: Set the constructor protection level to
protected, since it can not be instantiate.d
* glib/Marshaller.cs: Do not allow instances of this class as it
only exposes static methods.
* glib/Source.cs, glib/FileUtils.cs, glib/Timeout.cs,
glib/Thread.cs, glib/Markup.cs, glib/TypeConverter.cs: Ditto.
svn path=/trunk/gtk-sharp/; revision=20573
* glib/DelegateWrapper.cs: Remove 'RemoveIfNotAlive'
and revamp the memory management to use destroy
notification.
* generator/CallbackGen.cs: Do not generate the call to
RemoveIfNotAlive.
* gtk/GtkSharp.GtkClipboardGetFuncNative,
GtkSharp.GtkClipboardClearFuncNative: Do not call
RemoveIfNotAlive.
svn path=/trunk/gtk-sharp/; revision=18163
* gdk/Pixbuf.custom: use windows dll name. Removed DllImport that is
already in the generated file.
* glib/Thread.cs: use windows dll name.
* gtk/ThreadNotify.cs: close <remark> comment.
svn path=/trunk/gtk-sharp/; revision=17731
* gconf/GConf/Value.cs: implemented support for lists.
* glib/ListBase.cs: implemented the IDisposable stuff and created a
new method, FreeList, to free the list when needed.
* glade/HandlerNotFoundException.cs: make it derive from
SystemException. Don't override Message, the message is created in the
.ctor.
svn path=/trunk/gtk-sharp/; revision=17646
[Equal credit to Ettore Perazzoli <ettore@ximian.com> for fixing
all the bugs in the initial patch]
* */*.custom : fix incorrect usage of new Object (IntPtr) where
Glib.Object.GetObject should've been used. add ref_owned param
to GetObject calls.
* generator/CallbackGen.cs : setup ref_owned in bodies
* generator/ClassBase.cs : add ref_owned to GetObject FromNative call
* generator/Method.cs : setup ref_owned in bodies
* generator/Property.cs : setup ref_owned in bodies
* generator/SignalHandler.cs : pass ref_owned to GetObject
* generator/StructBase.cs : setup ref_owned in bodies
* glib/Object.cs : kill Ref/Unref methods. Don't want it to be
easy for users to screw with ref counts, or make it look like they
should need to.
(GetObject): add ref_owned param and ref/unref to remain at 1
* glib/Value.cs : pass ref_owned to GetObject
svn path=/trunk/gtk-sharp/; revision=16581
* 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
* glib/ManagedValue.cs, glib/Value.cs: A few old-style
DllImports snuck in during my last commit; update them
to use Win32 dll names.
svn path=/trunk/gtk-sharp/; revision=14819
* glib/ManagedValue.cs, TypeConverter.cs: Added.
* glib/Value.cs: Make Value inherit from IDisposable, and
move dtor to Dispose. Add generic object constructor
with support for ManagedValue. Add a new Val property
which will call the appropriate explicit cast.
* glue/value.c: Add new glue function
gtksharp_value_get_value_type.
* gtk/TreeViewColumn.custom: Added.
* gtk/ListStore.custom, TreeStore.custom: Add a number
of SetValue overloads. Add convenience functtion
AppendValues. Add new ctor that takes System.Type instead
of GLib.TypeFundamentals. Add a GetValue convenience wrapper.
* gtk/TreeView.custom: Add AppendColumn convenience
functions.
* sample/ManagedTreeViewDemo.cs: Added.
* sample/Makefile.in: Update.
* sample/TreeViewDemo.cs: Update to use new convenience
APIs.
svn path=/trunk/gtk-sharp/; revision=14691
* glib/Object.cs:
(GetObject): check that the target of the WeakReference is still there. Otherwise,
create a new wrapper for the IntPtr.
This fixes the random nullrefs when running nunit-gtk.
svn path=/trunk/gtk-sharp/; revision=13450
* generator/CallbackGen.cs: the new generated wrappers have:
-(optional) Field of the same type returned by the callback.
-A call to RemoveIfNotAlive at the beginning. It returns true,
return the dummy field.
-Added an object to the ctor signature and pass it to the base
class.
* generator/Ctor.cs: added a Params property.
* generator/Method.cs: set Static property in Parameters if the method
is static.
* generator/Parameters.cs: added Static property. The call creation of
the delegate wrapper (if applicable) uses the new signature. Pass a null
as object is the method is static.
* generator/StructBase.cs: set Static for the parameters of the ctors.
* glib/DelegateWrapper.cs: the ctor takes an object (the one creating
the wrapper or null) and creates a weak reference to it. Store it in
a static Hashtable (this way the wrapper itself is not garbage
collected).
(RemoveIfNotAlive): called from the native delegate callbacks. If the
target of the weak reference has been garbage collected, removes itself
from the hashtable to let the GC dispose this instance and returns true.
* gdk/Pixbuf.custom:
* gtk/Clipboard.custom:
* gtk/GtkSharp.GtkClipboardClearFuncNative.cs:
* gtk/GtkSharp.GtkClipboardGetFuncNative.cs:
* glade/XML.custom: changed delegate wrappers to match the new
signature.
svn path=/trunk/gtk-sharp/; revision=13237
* sample: Update samples to new Glade.Widget.
* glade/WidgetAttribute.cs: Moved the old GladeWidgetattribute
here. Now its called `Glade.WidgetAttribute'.
* glade/GladeWidgetAttribute.cs: Removed
* glib/Idle.cs: Do not allow Idle class to be instantiated.
svn path=/trunk/gtk-sharp/; revision=12554
* gtk/Application.cs (CurrentEvent): Property implementing the
suggestion from Paolo.
* glib/Object.cs (Dispose): Destructor might be invoked in a
thread, queue the object for destruction using the Gtk idle
handler. We perform the real destruction of the object in the
same thread as the Gtk+ main thread.
svn path=/trunk/gtk-sharp/; revision=12551
* generator/Parser.cs: use XmlDocument.Load (Stream). The one using
(String) expects an uri.
* generator/Signal.cs: always remove the delegate from the signal
callback (prior to this, the last handler was not being removed).
Dispose the callback (ie, disconnect from the signal) when there are
no registered delegates to handle it.
* generator/SignalHandler.cs: added 2 new fields to hold the instance
and the handler ID. The finalization is now done in Dispose and
disconnects the signal handler when no delegate will handle the signal.
Changed gobject-2.0 to libgobject-2.0-0.dll.
* glib/SignalCallback.cs: implemented IDisposable interface.
svn path=/trunk/gtk-sharp/; revision=11976
* generator/ObjectGen.cs : gen GLib.Value ctor, not uint
* glib/Object.cs : use GLib.Type in RegisterGType and
make the g_object_new ctor use GLib.Type.
* glib/Type.cs : new thin wrapper for GValue type
* glib/*.cs : s/Type/System.Type
svn path=/trunk/gtk-sharp/; revision=11920
* glib/MainContext.cs: beginning of MainContext class, just
Iteration and Pending methods to be able to refresh Gtk in the
middle of time consuming function where it's not worth while to
use threads
* glue/style.c (gtksharp_gtk_style_get_font_description): new
function to access style's font_description field
* gtk/Style.custom: added font description property
svn path=/trunk/gtk-sharp/; revision=11358
* glib/SignalCallback.cs: new methods AddDelegate and RemoveDelegate.
* generator/Signal.cs: add/remove signal handlers from the delegate used
to invoke them.
* generator/SignalHandler.cs: use Delegate instead of MulticastDelegate.
svn path=/trunk/gtk-sharp/; revision=11255
* makefile: when doing distclean, attempt distclean on all the
C# subdirs too
* gconf/Makefile.in: added distclean target to rm the Makefiles
in the subdirs of gconf/
* glue/Makefile.am: build libgtksharpglue as an unversioned
module to avoid so -> so.0 -> so.0.0 symlink mess
* */Makefile.in: call mkinstalldirs before installing any files
so that subdirs can be installed seperately or in any sequence
(eg binding dirs before native dirs)
svn path=/trunk/gtk-sharp/; revision=9828
* glib/Log.cs: removed the IntPtr argument and keep a reference to
the delegate passed to unmanaged world as suggested by rachel.
svn path=/trunk/gtk-sharp/; revision=9586
* glib/Value.cs: cast Typefundamentals.* to uint (GType is
unsigned int), fix Value (GLib.Object) - use new GetGType method
* glib/Object.cs: new GetGType method, returns _obj GType
svn path=/trunk/gtk-sharp/; revision=9063
we need to ref this object once we have a pointer to it or not.
By default this is set to true -- constructors and other functions
where we do own the object need to set this to false before setting
the "Raw" property. Also added Unref and RefCount methods.
* glue/object.c, glue/type.c: some utility functions for
refcounting support
* gdk/Pixbuf.custom: manually wrap a few functions so that
the refcount ends up being correct at the end (need an extra Unref)
* api/gdk-api.xml, sources/Gdk.metadata: metadata updates for
hiding manually-wrapped Pixbuf stuff
svn path=/trunk/gtk-sharp/; revision=8913
Much of this patch from Vlad, with substantial rework by mk.
* */makefile.win32 : introduce mapdllnames.pl, api, and glue
* generator/CallbackGen.cs : rework namespacing for csc compilation
* generator/Parameters.cs : ditto
* generator/Signal.cs : ditto
* generator/SignalHandler.cs : ditto
* glue/win32dll.c : new dll construction source
* glib/Value.cs : new ushort ctor/cast operator
* gtk/Table.custom : comment this out until we add a default ctor tag
* gtk/ThreadNotify.cs : make ReadyEvent public
* sources/Gdk.metadata : mark a Parse() param as ref
svn path=/trunk/gtk-sharp/; revision=8590
WeakReferences instead of hashing the real objects. Without this
change, GObjects were never collected.
(Raw, set): Put a WeakReference to the object in Objects.
(Object.GetObject): Get the WeakReference from Objects, and from
there the actual object.
(Object.DisposeNative): Remove the Raw pointer from Objects.
svn path=/trunk/gtk-sharp/; revision=8578
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
* glade/HandlerNotFoundExeception.cs: Added.
* glade/Makefile.in
* glade/XML.custom: Support for autoconnecting signals using
reflection.
* glib/SignalAttribute.cs: Added.
* generator/Signal.cs: Mark events generated from glib signals
with the "Signal" attribute.
* sample/GladeTest.cs
* sample/Makefile.in
* sample/test.glade: Test of signal autoconnection.
svn path=/trunk/gtk-sharp/; revision=7430
* glib/Object.cs (Ref): Added.
* gtk/Object.custom (Ref): Overload. Note that we were reffed.
(DisposeNative): Unref if we were explicitly reffed.
* generator/Method.cs: Call Ref if needs_ret is set.
* generator/StructBase.cs: Call Ref on all object accessors.
* glue/style.c: Ref returned GCs.
* sources/Gtk.metadata: Set needs_ret on various gdk-related
accessors in GtkWidget. Hide Ref/Unref methods on Widget and
RcStyle as these ought to be deprecated anyway.
svn path=/trunk/gtk-sharp/; revision=7380
* 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