Commit Graph

76 Commits

Author SHA1 Message Date
Martin Kupec
a76f60df81 Add possibility to pick glib type name for custom classes
This patch adds TypeName attribute which can be used on custom class
derived from GLib.Object in order to set GLib type name of the class.
2015-10-29 12:25:16 -05:00
Stephan Sundermann
961b9ef348 glib: Add binding for GBytes
This patch adds bindings for GBytes https://developer.gnome.org/glib/stable/glib-Byte-Arrays.html

The code was first generated using gobject-introspection and then
refactored. The new type is also added to the generator SymbolTable.
2014-08-10 18:20:32 +02:00
Bertrand Lorentz
8885fa98af build: Fix references to AssemblyInfo.cs in makefiles on Windows
On Windows with MinGW, csc.exe is confused by paths like
"../AssemblyInfo.cs", so we need some trickery to have something that
works on both Linux and Windows.

This isn't pretty, but it's the best solution I could find right now.
The other approach would have been to go back to copying AssemblyInfo.cs
around, but that has it's own set of issues.
2014-02-23 19:17:05 +01:00
Bertrand Lorentz
85443823e9 build: Enclose gacutil calls in double quotes
On Windows, gacutil.exe is often installed in a path with spaces, like
"C:\Program Files...". This causes problem when trying to call it during
"make install". Enclosing in double quotes fixes this, and has no impact
on Linux.
2014-02-23 17:07:10 +01:00
Stephan Sundermann
6ab620d689 generator,glib: added GPollFD and GSource types
GSource type was already there (but was not mapped by
the generator yet) so then the autogenerated methods
have been added manually inside the class after the
custom methods.

Other Source-related class are also generated and added
(but not mapped in the SymbolTable) to glib.
2013-10-09 19:41:21 +02:00
Stephan Sundermann
8b101d5525 glib: Mutex is actually opaque
This means that we're modifying the generated code that
we checked in, so then we increase the future TODO about
more information about what we need to fix later.

The changes to Cond are a consequence of the changes to
Mutex because the former uses the latter.
2013-10-09 18:44:04 +02:00
Stephan Sundermann
9abde602ec glib: add GDate, GDateTime
Add GDate and GDateTime classes to glib, and map
them in the generator's SymbolTable.

(The types TimeZone and TimeVal are also added because
the Date* types depend on them, but there is no need
to map them in the generator.)

Also move the TODOs of other auto-generated classes
to a single TODO in the Makefile
2013-10-09 18:30:10 +02:00
Stephan Sundermann
112e2b9598 generator,glib: Added Mutex, RecMutex, Cond types
Bind these types manually and added generator support
for them.
2013-10-09 13:09:34 +02:00
Rickard Edström
8e07e7d225 Add a SynchronizationContext implementation for GLib (bnc#621444)
Create a GLibSynchronizationContext that sends code to be run on the
GLib main loop, and set it as the current SynchronizationContext in
Gtk.Init().

When you use the await keyword to do a task asynchronously, by default
the awaiter will capture the current SynchronizationContext, and if
there was one, when the task completes it’ll Post the supplied
continuation back to that context, rather than running it on whatever
thread it wants.

This means that if you use the async/await keywords in your Gtk# app,
things will now work as expected with the GTK main thread. For example:

static async void DoWork () // called in the GTK main thread
{
    // Do some stuff with the UI...
    label.Text = "Starting Work";

    // Run something asynchronously, UI is not frozen
    int res = await DoLongOperation ();

    // Do some more UI stuff, it'll run on the GTK main thread
    label.Text = "Work done";
}

Signed-off-by: Bertrand Lorentz <bertrand.lorentz@gmail.com>
2012-11-08 22:33:46 +01:00
Bertrand Lorentz
18d1af6907 build: Specify assembly version when uninstalling from the GAC
We need to qualify the assembly name with the version, otherwise gacutil
uninstall all versions of the assembly.
Fixes http://bugzilla.xamarin.com/show_bug.cgi?id=207
2011-08-11 18:44:58 +02:00
Mike Kestner
d3d32c8ff0 GKeyFile binding
* glib/KeyFile.cs: new pseudo-hand-binding for GKeyFile
* glib/Makefile.am: add file
* glib/Marshaller.cs: add string[] to strv marshaler
* glib/glib-api.xml: expose GKeyFile mapping
2011-04-14 14:35:47 -05:00
Mike Kestner
a56feb01e3 Some warning fixage.
* glib/GType.cs:
* glib/Makefile.am:
* glib/Object.cs:
* glib/ParamSpec.cs:
* glib/PtrArray.cs:
* glib/SignalClosure.cs:
* glib/Value.cs:
mark private struct fields public to avoid 0169, and remove the nowarn
from the csc command.  fixed one real warning, exposed a bunch of
obsolete usage still to fix.
2011-03-24 18:32:54 -05:00
Mike Kestner
88af56dd68 Implement GVariantType binding.
* generator/SymbolTable.cs: add GVariantType mapping.
* glib/Makefile.am: add file
* glib/Value.cs: add cast to VariantType.
* glib/VariantType.cs: hand binding for yet another ref counted glib
type system.
2011-02-11 13:52:13 -06:00
Mike Kestner
08eda8b7c2 More dead code removal.
* glib/Makefile.am: remove files
* glib/Boxed.cs: remove
* glib/DelegateWrapper.cs: remove
* glib/SignalCallback.cs: remove
* glib/TypeConverter.cs: remove
2011-02-10 21:16:05 -06:00
Mike Kestner
d33520b9c6 Kill UnwrappedObject obsolete code.
* glib/Makefile.am: remove file
* glib/UnwrappedObject.cs: remove
* glib/Value.cs: remove obsolete method
2011-02-10 21:16:05 -06:00
Mike Kestner
72cca1f93f Kill dead EnumWrapper type from the early days.
* glib/EnumWrapper.cs: remove
* glib/Makefile.am: remove file
* glib/Value.cs: remove obsolete EnumWrapper cast/ctor
2011-02-10 21:16:05 -06:00
Mike Kestner
22a83cc779 Move g_format_size_for_display to Global.
* glib/Format.cs: moved to Global.cs
* glib/Global.cs: moved from Format.cs
* glib/Makefile.am: update sources.
2011-02-09 10:48:19 -06:00
Mike Kestner
53fdda0f51 Kill the CDeclCallback attr.
* glib/CDeclCallbackAttribute.cs: kill, we now use UnmanagedFunctionPtr.
* glib/Makefile.am: remove file
2011-02-09 10:43:35 -06:00
Mike Kestner
7cdaf34aa2 Remove ClassInitializer attributes.
* AssemblyInfo.cs.in: remove the ignore attr from the assemblies.
* glib/ClassInitializerAttribute.cs: remove obsolete method target attr.
* glib/IgnoreClassInitializersAttribute.cs: remove.
* glib/Makefile.am: update sources and stop copying AssemblyInfo.cs around.
* glib/Object.cs: remove the obsolete ClassInitializer fallback mechanism.
2011-02-09 10:05:40 -06:00
Mike Kestner
8459ac5560 Initial support for GVariant
* generator/SymbolTable.cs : add GVariant type mapping.
* glib/Variant.cs: initial implementation of an opaque class to expose
the GVariant type from glib.  We won't make any attempt to combine managed
references since there is no "toggle" ref capability.  We'll do a one-to-one
ref_sink/unref pair on construction/dispose.
2011-01-22 12:52:38 -06:00
Mike Kestner
ec77219ad5 Use -keyfile instead of deprecated attr.
* AssemblyInfo.cs.in: kill keyfile attr
* Makefile.am: moved mono.snk to cairo dir
* Makefile.include: no need to copy snk into builddir any longer.
* cairo/AssemblyInfo.cs: kill keyfile attr
* cairo/Makefile.am: snk relocated into here. use it directly.
* glib/Makefile.am: no need to copy snk into builddir any longer.
* gtkdotnet/Makefile.am: no need to copy snk into builddir any longer.
2011-01-07 22:15:04 -06:00
Mike Kestner
ea7c52bbf9 Kill libglibsharpglue.
* configure.ac: remove glib/glue/Makefile expansion
* glib/Makefile.am: remove glue SUBDIR
* glib/Thread.cs: move to non-glue supported check
* glib/glue: kill
2011-01-07 21:22:35 -06:00
Mike Kestner
a948792be0 2009-11-30 Mike Kestner <mkestner@novell.com>
* */Makefile.am: standardize on - options over / options for 
	consistency.  Also assists with build on msys. [Fixes #550667]

svn path=/trunk/gtk-sharp/; revision=147125
2009-11-30 20:40:34 +00:00
Christian Hoff
1e97a1046f 2009-08-30 Christian Hoff <christian_hoff@gmx.net>
Complete the major version jump. Gtk# 3 and 2 are now both
	installable within the same prefix.

	* */glue/Makefile.am: Produce *sharpglue-3 gluelibs.
	* *.custom, *.cs: pinvoke the new glue library.
	* *-2.0.pc.in: Rename to *-3.0.pc.in.

svn path=/trunk/gtk-sharp/; revision=140941
2009-08-30 20:06:33 +00:00
Christian Hoff
940cf88750 2009-07-02 Christian Hoff <christian_hoff@gmx.net>
* configure.in.in: Target .net 2.0 profile
	* gapi-cdecl-insert: Kill. We are now using the UnmanagedFunctionPointerAttribute
	for callbacks.
	* glib/CdeclCallback: Mark obsolete.
	* generator/*.cs:
	* *.custom: Use [UnmanagedFunctionPointer (CallingConvention.Cdecl)] instead of
	[GLib.CDeclCallback].

svn path=/trunk/gtk-sharp/; revision=137323
2009-07-02 20:18:10 +00:00
Stephane Delcroix
983fb81a96 2009-05-03 Stephane Delcroix <sdelcroix@novell.com>
* glib/Idle.cs:
	* glib/Timeout.cs: add Add() overloads taking a priority
	* glib/Makefile.am:
	* glib/Property.cs: Property enum, used as argument for the new Add
	overloads

svn path=/trunk/gtk-sharp/; revision=133444
2009-05-03 19:34:22 +00:00
Andrés G. Aragoneses
a63841988e * atk/Makefile.am:
* glib/Makefile.am:
* Makefile.include: (Revert revision 131780) Track r131942.

svn path=/trunk/gtk-sharp/; revision=131943
2009-04-16 22:00:07 +00:00
Andrés G. Aragoneses
005731b75c 2009-04-15 Andrés G. Aragoneses <aaragoneses@novell.com>
* atk/Makefile.am
        * glib/Makefile.am: take advantage of the same InternalsVisibleTo
        because the moon assemblies will be monomerged.


svn path=/trunk/gtk-sharp/; revision=131835
2009-04-15 22:33:26 +00:00
Andrés G. Aragoneses
722954e799 2009-04-15 Andrés G. Aragoneses <aaragoneses@novell.com>
* atk/Makefile.am
        * glib/Makefile.am
        * Makefile.include: Added new 'moonlight' target, to build with
        smcs.


svn path=/trunk/gtk-sharp/; revision=131780
2009-04-15 15:32:41 +00:00
Mike Kestner
27c413091c 2009-01-23 Mike Kestner <mkestner@novell.com>
* Makefile.include:
	* doc/Makefile.am:
	* glib/Makefile.am:
	* gtkdotnet/Makefile.am: parallel make patches from Diego Pettenò  
	and Bertrand Lorentz. [Fixes #421063]

svn path=/trunk/gtk-sharp/; revision=124400
2009-01-24 04:47:54 +00:00
Mike Kestner
89afb3f49f 2008-12-19 Mike Kestner <mkestner@novell.com>
* generator/BoxedGen.cs: don't generate glue dependencies.
	* glib/*.cs: remove glibsharpglue usage except thread.c.
	* glib/glue/*.c: kill all but thread.c. need glib 2.20 to kill
	it eventually.
	* pango/Attr*.cs: kill glue usage.
	* pango/glue/*.c: kill all but generated.c. it's next.
	* gtk/TreeIter.custom: kill a dumb glibsharpglue usage.

svn path=/trunk/gtk-sharp/; revision=121880
2008-12-19 18:57:42 +00:00
Stephane Delcroix
68ec7f1ebd map g_format_size_for_display in Format.cs
2008-11-21  Stephane Delcroix  <sdelcroix@novell.com>

	* Makefile.am:
	* glib/Format.cs: new class to map the g_format methods

svn path=/trunk/gtk-sharp/; revision=119630
2008-11-21 16:42:46 +00:00
Mike Gorse
c9d658f381 2008-11-04 Mike Gorse <mgorse@novell.com>
* glib/PtrArray.cs, glib/glue/ptrarray.c, glib/Makefile.am,
	  glib/glue/Makefile.am, glib/gtype.cs, generator/SymbolTable.cs,
	  generator/ReturnValue.cs: Add PtrArray.
	* glib/Marshaller.cs: Add PtrArrayToArray.

	* atk/Atk.metadata: Specify GetTarget return type.

	* atk/Object.custom, atk/glue/object.c: Support overriding
	  RefRelationSet.

svn path=/trunk/gtk-sharp/; revision=117919
2008-11-04 20:17:00 +00:00
Mike Kestner
621b39b531 2008-05-15 Mike Kestner <mkestner@novell.com>
* kill the makefile.win32 build system.  it has been unmaintained
	for quite some time, replaced by the auto* build in cygwin.

svn path=/trunk/gtk-sharp/; revision=103308
2008-05-15 17:36:46 +00:00
Mike Kestner
0780ed3c0d 2008-04-30 Mike Kestner <mkestner@novell.com>
* generator/InterfaceGen.cs:
	* generator/Signal.cs: use generic signal marshaling instead of
	generating signature specific marshaling callbacks.
	* glib/glue/closure.c: glue for new closure impl.
	* glib/Object.cs: open up a couple hashes internally. 
	* glib/Signal.cs: hook in closure based connection and expose
	EmissionHook functionality for atk usage.
	* glib/SignalClosure.cs: new generic signal marshaling mechanism.
	* glib/ToggleRef.cs: null guarding in Target and let Signal remove
	itself from hash when it disposes itself.

svn path=/trunk/gtk-sharp/; revision=102241
2008-04-30 20:15:45 +00:00
Mike Kestner
213a3b99e3 2008-04-04 Mike Kestner <mkestner@novell.com>
* glib/Global.cs: renamed from Program.cs.  Program.Name is now 
	Global.ProgramName to try to avoid clashes with existing Gnome.Program
	usage.
	* gtk/Application.cs: s/GLib.Program.Name/GLib.Global.ProgramName.

svn path=/trunk/gtk-sharp/; revision=99875
2008-04-04 18:45:13 +00:00
Andrés G. Aragoneses
5fabaace5e * glib/Program.cs: Add new static class for utility property, moving
the code to call g_set_prgname() from gtk/Application.cs to here,
and changing return value of g_set_program_name from bool to void.
* gtk/Application.cs: Use Program.Name as a replacement of
calling the native function g_set_prgname().
* glib/Makefile.am: add Program.cs.
(Patch reviewed by mkestner)

svn path=/trunk/gtk-sharp/; revision=99134
2008-03-27 15:59:26 +00:00
Mike Kestner
04a642f070 2008-01-11 Mike Kestner <mkestner@novell.com>
* bootstrap-2.12: update version to 2.11.90.
	* configure.in.in: incorporate build service patch.
	* glib/glib-sharp-2.0.pc.in: add cflags for new api.xml.
	* glib/Makefile.am: install api.xml to correct dir.

svn path=/trunk/gtk-sharp/; revision=92686
2008-01-11 19:41:51 +00:00
Mike Kestner
209f353fc8 2007-12-06 Mike Kestner <mkestner@novell.com>
* * : update to 2.12 API.

svn path=/trunk/gtk-sharp/; revision=90823
2007-12-06 17:23:28 +00:00
Mike Kestner
70018d857d 2007-11-16 Mike Kestner <mkestner@novell.com>
* glib/Object.cs: use toggle refs for all objects.
	de-obsolete Data hash.  Add internal Signals hash.
	* glib/Signal.cs: switch to weak gchandles.
	* glib/WeakObject.cs: kill.

svn path=/trunk/gtk-sharp/; revision=89776
2007-11-16 18:35:38 +00:00
Mike Kestner
86d29321c3 2007-11-12 Mike Kestner <mkestner@novell.com>
* generator/SymbolTable.cs: remove GCallback mapping.
	* glib/GCallback.cs: kill, bad idea.

svn path=/trunk/gtk-sharp/; revision=89519
2007-11-13 03:04:32 +00:00
Mike Kestner
097537310e 2007-11-12 Mike Kestner <mkestner@novell.com>
* glib/IOChannel.cs: IOChannel wrapper implementation.
	* glib/Makefile.am: build new files.
	* glib/Marshaller.cs: new string array marshaling methods.
	* glib/Spawn.cs: g_spawn* wrapper implementation.
	* sample/SpawnTests.cs: tests for the new GLib.Process class
	and a cursory exercise of IOChannel for SpawnAsyncWithPipes.

svn path=/trunk/gtk-sharp/; revision=89477
2007-11-12 17:27:35 +00:00
Mike Kestner
1fa0231217 2007-10-24 Mike Kestner <mkestner@novell.com>
* generator/SymbolTable.cs: mappings for GCallback and GSourceFunc.
	* glib/GCallback.cs: GCallback declaration.
	* glib/Source.cs: GSourceFunc declaration.

svn path=/trunk/gtk-sharp/; revision=88126
2007-10-24 20:13:08 +00:00
Mike Kestner
c93ecb7f88 2007-09-11 Mike Kestner <mkestner@novell.com>
* gtk/Gtk.metadata: virtual_method rules for GInterface generation.
	* generator/ReturnValue.cs (ToNative): new method for the virtual
	method generation.
	* generator/Parameters.cs (FromNative): null guarding.
	* generator/ManagedCallString.cs: rework for interface method
	generation including callback and error param support.
	* generator/CallbackGen.cs: Invoker support. new class that deals
	with persistence of native and wrapper delegates in native to managed
	callback method signatures.
	* generator/VirtualMethod.cs: support for generation of interface
	methods, and all the funky parameters that come with that.
	* generator/InterfaceGen.cs: Fill out the adapter implementation.
	* generator/MethodBody.cs: Initialize overload. Extend ThrowsException
	to support GError outside the last parameter slot.
	* glib/GInterfaceAttribute.cs: New attribute to mark interfaces and
	obtain adapter type.
	* glib/Object.cs (AddInterfaces): interface registration method.
	* glib/GInterfaceAdapter.cs: New abstract class for interface
	adapter generation.
	* glib/Makefile.am: add new files.

svn path=/trunk/gtk-sharp/; revision=85658
2007-09-11 20:34:24 +00:00
Mike Kestner
c2230278b3 2007-09-06 Mike Kestner <mkestner@novell.com>
* AssemblyInfo.cs.in : add IgnoreClassInitializers attr to all.
 	* generator/ObjectGen.cs : add custom-attr generation for objects.
 	* glib/ClassInitializerAttribute.cs : obsolete
 	* glib/IgnoreClassInitializersAttribute.cs : new assembly attr
 	to avoid a blind GetMethods reflection.
 	* glib/Makefile.am : add files
 	* glib/TypeInitializerAttribute.cs : new attr to specify init
 	method to be run at type registration.
 	* gtk/Widget.custom : remove the ClassInitializerAttr.
 	* gtk/Gtk.metadata : add a custom-attr node to GtkWidget.
 	* sample/Subclass.cs : use the IgnoreClassInitializers attr.

svn path=/trunk/gtk-sharp/; revision=85480
2007-09-07 14:40:46 +00:00
Mike Kestner
32de2832db 2007-03-06 Mike Kestner <mkestner@novell.com>
* generator/Signal.cs : add try/catch blocks to native callback
	delegates so that exceptions are not propagated across the native
	boundary.  Now raises GLib.ExceptionManager.UnhandledException.
	* glib/ExceptionManager.cs : new class with UnhandledException
	event and a static method to raise it.
	* glib/Signal.cs : wrap the generic EventHandler callback delegate
	with try/catch blocks and raise the UnhandledException event.

svn path=/trunk/gtk-sharp/; revision=73840
2007-03-06 20:10:15 +00:00
Mike Kestner
2469ba16ef 2007-02-16 Mike Kestner <mkestner@novell.com>
* glib/Object.cs : switch to ToggleRefs for all items created with
	CreateNativeObject.  This gets all managed subclasses, with a little
	overhang into simple wrappers.
	* glib/ToggleRef.cs : new class to manage the weak to strong ref 
	transitions as a native object flips between shared and unshared
	ownership.
	* gtk/Object.custom : revamp of the Destroyed signal handling. 
	* gtk/Gtk.metadata : hide destroy signal so we can deal with it 
	manually. [Fixes the reopen note of #72018.]

svn path=/trunk/gtk-sharp/; revision=73023
2007-02-16 16:18:59 +00:00
Mike Kestner
2ac6bb5457 2006-05-10 Mike Kestner <mkestner@novell.com>
* bootstrap-2.10 : strap for the new 2.9.0 API.
	* generator/SymbolTable.cs : add GLib.InitiallyUnowned mapping.
	* glib/InitiallyUnowned.cs : new floating class "stub".
	* glib/Makefile.am : build new class.
	* gdk/gdk-api-2.10.raw: parse from 2.9.0
	* gtk/Gtk.metadata: cleanup conflicts in 2.10 API.
	* gtk/gtk-api-2.10.raw: parse from 2.9.0
	* pango/pango-api-2.10.raw: parse from 1.11.99
	* sources/Makefile.am : 2.10 parse setup and api-2.10 
	* sources/gtk_tree_model_signal_fix-2.10.patch : 2.10 patch.
	* sources/gtk-sharp-2.10-sources.xml : parse rules for 2.10

svn path=/trunk/gtk-sharp/; revision=60521
2006-05-10 17:13:30 +00:00
Mike Kestner
35ee367957 2005-10-09 Mike Kestner <mkestner@novell.com>
* configure.in.in : string quote the POLICY_VERSIONS.
	* Makefile.include : multiple policy fixes.
	* */Makefile.am : multiple policy fixes.

svn path=/trunk/gtk-sharp/; revision=51493
2005-10-09 18:55:31 +00:00
Mike Kestner
0435b45895 2005-09-23 Mike Kestner <mkestner@novell.com>
* configure.in.in : expand glib-sharp-2.0.pc.
	* glib/glib-sharp-2.0.pc.in : new pc file template.
	* glib/Makefile.am : dist and install pc file.
	* gtk/gtk-sharp-2.0.pc.in : Require glib-sharp-2.0.

svn path=/trunk/gtk-sharp/; revision=50641
2005-09-23 22:36:33 +00:00