Commit graph

3466 commits

Author SHA1 Message Date
Stephan Sundermann 388a2fe659 generator: added handling of optional parameters 2013-10-09 15:31:10 +02:00
Stephan Sundermann 33fd293b84 generator: null check for handle (NativeStructGen)
Check Handle against IntPtr.Zero before marshalling.
2013-10-09 14:02:46 +02:00
Stephan Sundermann 29a900e51e generator: added conversion for byref structs
The pointer from native is stored inside of a class which
wraps the structure. Fields can be accessed by marshalling
from and to the pointer. glib: Value.Update does now invoke
a private Update() method which is needed to update the new
structures.
2013-10-09 13:40:56 +02:00
Stephan Sundermann d01be26f0c generator: added defaultconstructoraccess attrib 2013-10-09 13:13:15 +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
Stephan Sundermann 747a4ad871 generator: Added conversion for unions
Also removed all assumptions for parameters when
ParserVersion >= 3
2013-10-08 20:22:16 +02:00
Stephan Sundermann fd2fb44f99 generator: readable&writable attribs to be backwards compat 2013-10-08 18:55:34 +02:00
Stephan Sundermann dc4e7f30b9 generator: Added long long conversion 2013-10-08 18:48:05 +02:00
Stephan Sundermann c5909d32fb generator: fixed string array return type for virtual_methods 2013-10-08 18:47:45 +02:00
Stephan Sundermann f6219b97e0 generator: Added count param detection for return values 2013-10-08 18:47:21 +02:00
Stephan Sundermann edde96c5be generator: fixed writeable and readable detection 2013-10-08 18:46:44 +02:00
Stephan Sundermann c53147c1c4 generator: Added constants to gapi
Unfortunately, gir marks all integers as gint regardless
of its size. We have to check if the value will really
fit into a int, that is why there is an automatic fallback
to long.
2013-10-08 18:45:42 +02:00
Stephan Sundermann b5806d2a1b generator: fixed string[] return types 2013-10-08 17:54:29 +02:00
Stephan Sundermann 8d4ec22ef2 generator: Added throws attribute to parameters
This enables gapi to decide whether a parameter is
really throwing or should be handled as a usual parameter.
2013-10-08 17:46:19 +02:00
Stephan Sundermann 94da3fb2ab generator: faster Equals implementation 2013-10-08 16:27:47 +02:00
Stephan Sundermann 115659f46b generator: fixed Equals/GetHashCode for no fields or padding
Fixed Equals/GetHashCode methods when struct has no fields,
or field is padding.
2013-10-08 15:52:47 +02:00
Stephan Sundermann c14277f391 generator: GThread type should be SimpleGen 2013-10-08 15:43:23 +02:00
Stephan Sundermann 4b470cadbb generator: Added GThread type 2013-10-08 15:41:14 +02:00
Stephan Sundermann 3eefa37272 generator: Bumped parser_version to 3
Added support for new closure and destroy attributes from which we can
determine which callback a parameter belongs to.
2013-10-08 15:39:31 +02:00
Andrés G. Aragoneses 7ce1457c13 gtk: Fix a KeyNotFoundException regression in Destroyed event
The migration to generic collections [1] caused another regression: a
KeyNotFoundException was being thrown (instead of returning null like
HashTable did) when using the Destroyed event of the Gtk.Widget class.

[1] 6850b343ca

A particular example of this problem is Banshee's Import Media feature,
which was generating the following stacktrace:

[1 Debug 23:24:36.898] Starting - Importing Media
Marshaling activate signal
Exception in Gtk# callback delegate
  Note: Applications can use GLib.ExceptionManager.UnhandledException
to handle the exception.
System.Reflection.TargetInvocationException: Exception has been thrown
by the target of an invocation. --->
System.Collections.Generic.KeyNotFoundException: The given key was not
present in the dictionary.
  at System.Collections.Generic.Dictionary`2[System.IntPtr,System.Delegate].get_Item
(IntPtr key) [0x00000] in <filename unknown>:0
  at Gtk.Widget.add_Destroyed (System.EventHandler value) [0x00000] in
/home/knocte/gtk-sharp/gtk/Widget.cs:333
  at Hyena.Widgets.AnimatedWidget..ctor (Gtk.Widget widget, UInt32
duration, Easing easing, Blocking blocking, Boolean horizontal)
[0x0004d] in /home/knocte/banshee/src/Hyena/Hyena.Gui/Hyena.Widgets/AnimatedWidget.cs:78
2013-09-24 18:58:33 +02:00
Bertrand Lorentz 2388d09bb7 release: Use the new interface name in NEWS 2013-09-24 18:58:06 +02:00
Bertrand Lorentz 33aa2820f8 Merge pull request #67 from knocte/nitpicks
Various nitpicks and clean-ups.
2013-09-24 09:51:40 -07:00
Andrés G. Aragoneses f033de7816 glib: reference .NET 3.5's System.Core in MSBuild project
glib.csproj needs to reference System.Core from .NET 3.5 because
glib-sharp now[1] uses System.Action [2] delegate (not to confuse
with System.Action<T>) which was not available in .NET 2.0's System
reference. This way MonoDevelop stops marking "Action" in red color.

[1] 8e07e7d225
[2] http://msdn.microsoft.com/en-us/library/system.action%28v=vs.90%29.aspx
2013-09-24 01:28:08 +02:00
Andrés G. Aragoneses bb0aa9a37c glib: mark MSBuild project with AllowUnsafe setting
In the same way it is needed for other projects such as gtk.csproj.
2013-09-24 01:24:44 +02:00
Andrés G. Aragoneses 872e0edfdd MSBuild: remove AssemblyInfo.cs where it's not present
The only autogenerated AssemblyInfo files are in cairo and in
gtk-sharp's root, not inside other libraries like atk, glib, etc.
Removing them will make MonoDevelop stop rendering a red element
underneath each project.
2013-09-24 01:24:39 +02:00
Andrés G. Aragoneses 9016c304de MSBuild: change some projects to Library type, not Executable
Even though gtk-sharp cannot be built via MSBuild (yet?), it's better
to make the .csproj reflect more closely what you get with the normal
build.
2013-09-24 01:24:33 +02:00
Andrés G. Aragoneses 0312613c32 glib: ObjectManager class can be made static 2013-09-24 01:24:28 +02:00
Andrés G. Aragoneses 234717712e glib: remove unused 'using' statements 2013-09-24 01:24:24 +02:00
Bertrand Lorentz fb1b607e81 Add some missing files in sample.csproj 2013-09-22 16:44:26 +02:00
Bertrand Lorentz 4c08527389 sample: Update description of DemoDrawingArea GtkDemo sample 2013-09-22 16:43:43 +02:00
Bertrand Lorentz f694b0fe50 release: Update NEWS for 2.99.1 2013-09-22 15:41:29 +02:00
Bertrand Lorentz 493f0db198 release: Update AUTHORS for 2.99.1 2013-09-22 15:41:11 +02:00
Bertrand Lorentz 3af005a6de build: Fix autogen.sh for recent changes in configure.ac
Autogen.sh was grepping for the obsolete macro AM_CONFIG_HEADER, which
was replaced by AC_CONFIG_HEADERS in configure.ac. As a consequence it
was not calling autoheader, and then causing automake to fail if
config.h.in was not already present.
2013-09-08 17:10:50 +02:00
Bertrand Lorentz 0188d30f7f Merge pull request #66 from knocte/fix_customscrollable_sample
sample: fix CustomScrollable sample to prevent too high Upper values
2013-08-31 09:00:17 -07:00
Andrés G. Aragoneses 26c7ef4cd9 sample: fix CustomScrollable sample to prevent too high Upper values
Upper values having higher values than PageSize or PageIncrement cause
rendering issues. This commit is a small adaptation of a fix from one
of the edge cases pointed out in this commit in hyena:
https://git.gnome.org/browse/hyena/commit/?h=gtk3&id=0745bfb75809886925dfa49a57c79e5f71565d08
2013-08-30 22:00:47 +02:00
Bertrand Lorentz 4125b1e820 Merge pull request #65 from knocte/datamarshal_interface_fix 2013-08-25 10:57:09 -07:00
Bertrand Lorentz 654b81c9f4 Merge pull request #64 from knocte/master
generator: fix possible unhandled KeyNotFoundException (regression)
2013-08-25 10:32:50 -07:00
Andrés G. Aragoneses 6f16031661 glib: fix NRE regression after interface naming changed
ListBase was throwing a NullReferenceException in DataMarshal() due
to the fact that Reflection was being used to find the adapter name
of the interface generated by the bindings, which has recently
changed [1].

[1] 6cb03440c1
2013-08-24 00:11:05 +02:00
Andrés G. Aragoneses 74b6340d86 MSBuild: update some project files to account for recent changes 2013-08-23 23:56:23 +02:00
Andrés G. Aragoneses 9327d7d085 generator: fix possible unhandled KeyNotFoundException (regression)
This regression surfaced after 82a957bc9d [1],
when many collections were migrated to generic collections. HashTables
simply return null when queried for certain key, while Dictionary objects
throw KeyNotFoundException.

The regression could be noticed, more particularly, when trying to
compile the gtk3 branch of the gudevsharp project [2].

[1] 82a957bc9d
[2] https://github.com/mono/gudev-sharp/commits/gtk3
2013-08-23 22:09:06 +02:00
Andrés G. Aragoneses 4046a4c4bd generator: avoid double lookup in dictionary when DeAlias is called
We can avoid a double lookup in the types dictionary here because the
method TryGetValue() was just called before.
2013-08-23 22:09:06 +02:00
Mike Krüger 6e0efb08f2 cairo: Added SetSourceColor method to Cairo.Context.
Cherry-picked from the gtk-sharp-2.12 branch.
2013-08-18 18:38:54 +02:00
Bertrand Lorentz 6352e7d2db build: Update and remove some obsolete automake macro calls 2013-08-18 18:32:21 +02:00
Jeffrey Stedfast d3c1826c37 gtk: Handle a null Gdk.Event passed to CellRenderer.StartEditing()
Cherry-picked from the gtk-sharp-2.12 branch.
2013-08-18 18:32:21 +02:00
Alan McGovern 100696b5c1 gdk: It is valid to pass a null gdk_event sometimes
For example gtk_drag_start allows a null Gdk.Event so we need to marshal
it to IntPtr.Zero instead of throwing a NullReferenceException

Cherry-picked from the gtk-sharp-2.12 branch.
2013-08-18 18:32:05 +02:00
Bertrand Lorentz 01520a9859 cairo: Don't disable the deprecation warnings during compilation
This makes the "#pragma warning disable 612" in Pattern.cs that were
removed previously actually useful, so we add it back.
2013-07-26 18:46:43 -05:00
Bertrand Lorentz 07dc9f6176 cairo: Remove superfluous #pragma in Pattern.cs 2013-07-26 17:43:27 -05:00
Bertrand Lorentz ebc5c048b4 Update Cairo samples for the latest API changes 2013-07-26 17:43:27 -05:00
Wolfgang Steffens 796cd1e8a1 cairo: Fix text API calls
The native functions require a NULL-terminated string of text encoded in
UTF-8.

This change is merged from Mono.Cairo in mono 3.2.
2013-07-26 17:43:27 -05:00
Bertrand Lorentz 21ce761271 cairo: Fix some whitespace and code formatting issues 2013-07-26 17:43:26 -05:00