Commit 2abf20ce authored by Jeremy Bicha's avatar Jeremy Bicha

New upstream version 3.7.5

parents 8828843f 41b59df1
GtkD ChangeLog
==============
Release: 3.7.4
--------------
-Check for null when returning an object in gtkd.Implement.
-Handle out parameters correctly in gtkd.Implement.
Release: 3.7.4
--------------
-Fix building with dmd 2.079.
Release: 3.7.3
--------------
-Use the Slice allocator to allocate structs. #221
......
......@@ -59,7 +59,7 @@ RANLIB=ranlib
#######################################################################
GTKD_VERSION=3.7.3
GTKD_VERSION=3.7.5
SO_VERSION=0
MAJOR = $(word 1,$(subst ., ,$(GTKD_VERSION)))
......
......@@ -876,7 +876,7 @@ public class SocketClient : ObjectG
g_socket_client_set_tls_validation_flags(gSocketClient, flags);
}
protected class OnDelegateWrapper
protected class OnEventDelegateWrapper
{
void delegate(GSocketClientEvent, SocketConnectableIF, IOStream, SocketClient) dlg;
gulong handlerId;
......@@ -884,23 +884,23 @@ public class SocketClient : ObjectG
this(void delegate(GSocketClientEvent, SocketConnectableIF, IOStream, SocketClient) dlg)
{
this.dlg = dlg;
onListeners ~= this;
onEventListeners ~= this;
}
void remove(OnDelegateWrapper source)
void remove(OnEventDelegateWrapper source)
{
foreach(index, wrapper; onListeners)
foreach(index, wrapper; onEventListeners)
{
if (wrapper.handlerId == source.handlerId)
{
onListeners[index] = null;
onListeners = std.algorithm.remove(onListeners, index);
onEventListeners[index] = null;
onEventListeners = std.algorithm.remove(onEventListeners, index);
break;
}
}
}
}
OnDelegateWrapper[] onListeners;
OnEventDelegateWrapper[] onEventListeners;
/**
* Emitted when @client's activity on @connectable changes state.
......@@ -960,25 +960,25 @@ public class SocketClient : ObjectG
*
* Since: 2.32
*/
gulong addOn(void delegate(GSocketClientEvent, SocketConnectableIF, IOStream, SocketClient) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0)
gulong addOnEvent(void delegate(GSocketClientEvent, SocketConnectableIF, IOStream, SocketClient) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0)
{
auto wrapper = new OnDelegateWrapper(dlg);
auto wrapper = new OnEventDelegateWrapper(dlg);
wrapper.handlerId = Signals.connectData(
this,
"event",
cast(GCallback)&callBack,
cast(GCallback)&callBackEvent,
cast(void*)wrapper,
cast(GClosureNotify)&callBackDestroy,
cast(GClosureNotify)&callBackEventDestroy,
connectFlags);
return wrapper.handlerId;
}
extern(C) static void callBack(GSocketClient* socketclientStruct, GSocketClientEvent event, GSocketConnectable* connectable, GIOStream* connection, OnDelegateWrapper wrapper)
extern(C) static void callBackEvent(GSocketClient* socketclientStruct, GSocketClientEvent event, GSocketConnectable* connectable, GIOStream* connection, OnEventDelegateWrapper wrapper)
{
wrapper.dlg(event, ObjectG.getDObject!(SocketConnectableIF)(connectable), ObjectG.getDObject!(IOStream)(connection), wrapper.outer);
}
extern(C) static void callBackDestroy(OnDelegateWrapper wrapper, GClosure* closure)
extern(C) static void callBackEventDestroy(OnEventDelegateWrapper wrapper, GClosure* closure)
{
wrapper.remove(wrapper);
}
......
......@@ -500,7 +500,7 @@ public class SocketListener : ObjectG
g_socket_listener_set_backlog(gSocketListener, listenBacklog);
}
protected class OnDelegateWrapper
protected class OnEventDelegateWrapper
{
void delegate(GSocketListenerEvent, Socket, SocketListener) dlg;
gulong handlerId;
......@@ -508,23 +508,23 @@ public class SocketListener : ObjectG
this(void delegate(GSocketListenerEvent, Socket, SocketListener) dlg)
{
this.dlg = dlg;
onListeners ~= this;
onEventListeners ~= this;
}
void remove(OnDelegateWrapper source)
void remove(OnEventDelegateWrapper source)
{
foreach(index, wrapper; onListeners)
foreach(index, wrapper; onEventListeners)
{
if (wrapper.handlerId == source.handlerId)
{
onListeners[index] = null;
onListeners = std.algorithm.remove(onListeners, index);
onEventListeners[index] = null;
onEventListeners = std.algorithm.remove(onEventListeners, index);
break;
}
}
}
}
OnDelegateWrapper[] onListeners;
OnEventDelegateWrapper[] onEventListeners;
/**
* Emitted when @listener's activity on @socket changes state.
......@@ -538,25 +538,25 @@ public class SocketListener : ObjectG
*
* Since: 2.46
*/
gulong addOn(void delegate(GSocketListenerEvent, Socket, SocketListener) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0)
gulong addOnEvent(void delegate(GSocketListenerEvent, Socket, SocketListener) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0)
{
auto wrapper = new OnDelegateWrapper(dlg);
auto wrapper = new OnEventDelegateWrapper(dlg);
wrapper.handlerId = Signals.connectData(
this,
"event",
cast(GCallback)&callBack,
cast(GCallback)&callBackEvent,
cast(void*)wrapper,
cast(GClosureNotify)&callBackDestroy,
cast(GClosureNotify)&callBackEventDestroy,
connectFlags);
return wrapper.handlerId;
}
extern(C) static void callBack(GSocketListener* socketlistenerStruct, GSocketListenerEvent event, GSocket* socket, OnDelegateWrapper wrapper)
extern(C) static void callBackEvent(GSocketListener* socketlistenerStruct, GSocketListenerEvent event, GSocket* socket, OnEventDelegateWrapper wrapper)
{
wrapper.dlg(event, ObjectG.getDObject!(Socket)(socket), wrapper.outer);
}
extern(C) static void callBackDestroy(OnDelegateWrapper wrapper, GClosure* closure)
extern(C) static void callBackEventDestroy(OnEventDelegateWrapper wrapper, GClosure* closure)
{
wrapper.remove(wrapper);
}
......
......@@ -180,7 +180,7 @@ public class TextTag : ObjectG
gtk_text_tag_set_priority(gtkTextTag, priority);
}
protected class OnDelegateWrapper
protected class OnEventDelegateWrapper
{
bool delegate(ObjectG, Event, TextIter, TextTag) dlg;
gulong handlerId;
......@@ -188,23 +188,23 @@ public class TextTag : ObjectG
this(bool delegate(ObjectG, Event, TextIter, TextTag) dlg)
{
this.dlg = dlg;
onListeners ~= this;
onEventListeners ~= this;
}
void remove(OnDelegateWrapper source)
void remove(OnEventDelegateWrapper source)
{
foreach(index, wrapper; onListeners)
foreach(index, wrapper; onEventListeners)
{
if (wrapper.handlerId == source.handlerId)
{
onListeners[index] = null;
onListeners = std.algorithm.remove(onListeners, index);
onEventListeners[index] = null;
onEventListeners = std.algorithm.remove(onEventListeners, index);
break;
}
}
}
}
OnDelegateWrapper[] onListeners;
OnEventDelegateWrapper[] onEventListeners;
/**
* The ::event signal is emitted when an event occurs on a region of the
......@@ -218,25 +218,25 @@ public class TextTag : ObjectG
* Returns: %TRUE to stop other handlers from being invoked for the
* event. %FALSE to propagate the event further.
*/
gulong addOn(bool delegate(ObjectG, Event, TextIter, TextTag) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0)
gulong addOnEvent(bool delegate(ObjectG, Event, TextIter, TextTag) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0)
{
auto wrapper = new OnDelegateWrapper(dlg);
auto wrapper = new OnEventDelegateWrapper(dlg);
wrapper.handlerId = Signals.connectData(
this,
"event",
cast(GCallback)&callBack,
cast(GCallback)&callBackEvent,
cast(void*)wrapper,
cast(GClosureNotify)&callBackDestroy,
cast(GClosureNotify)&callBackEventDestroy,
connectFlags);
return wrapper.handlerId;
}
extern(C) static int callBack(GtkTextTag* texttagStruct, GObject* object, GdkEvent* event, GtkTextIter* iter, OnDelegateWrapper wrapper)
extern(C) static int callBackEvent(GtkTextTag* texttagStruct, GObject* object, GdkEvent* event, GtkTextIter* iter, OnEventDelegateWrapper wrapper)
{
return wrapper.dlg(ObjectG.getDObject!(ObjectG)(object), ObjectG.getDObject!(Event)(event), ObjectG.getDObject!(TextIter)(iter), wrapper.outer);
}
extern(C) static void callBackDestroy(OnDelegateWrapper wrapper, GClosure* closure)
extern(C) static void callBackEventDestroy(OnEventDelegateWrapper wrapper, GClosure* closure)
{
wrapper.remove(wrapper);
}
......
......@@ -428,6 +428,12 @@ private import std.conv;
* gtk_widget_class_bind_template_child_private (GTK_WIDGET_CLASS (klass),
* FooWidget, goodbye_button);
* }
*
* static void
* foo_widget_init (FooWidget *widget)
* {
*
* }
* ]|
*
* You can also use gtk_widget_class_bind_template_callback() to connect a signal
......@@ -1403,7 +1409,7 @@ public class Widget : ObjectG, ImplementorIF, BuildableIF
* button is held down for some time. Try to save the last event that you got
* from the mouse, using gdk_event_copy(), and pass it to this function
* (remember to free the event with gdk_event_free() when you are done).
* If you can really not pass a real event, pass #NULL instead.
* If you really cannot pass a real event, pass %NULL instead.
*
* Params:
* targets = The targets (data formats) in which the
......@@ -2464,7 +2470,7 @@ public class Widget : ObjectG, ImplementorIF, BuildableIF
* Unrealized widgets do not have a frame clock.
*
* Returns: a #GdkFrameClock,
* or #NULL if widget is unrealized
* or %NULL if widget is unrealized
*
* Since: 3.8
*/
......@@ -3349,13 +3355,20 @@ public class Widget : ObjectG, ImplementorIF, BuildableIF
* inside a #GtkSocket within the same application.
*
* To reliably find the toplevel #GtkWindow, use
* gtk_widget_get_toplevel() and call gtk_widget_is_toplevel()
* on the result.
* gtk_widget_get_toplevel() and call GTK_IS_WINDOW()
* on the result. For instance, to get the title of a widget's toplevel
* window, one might use:
* |[<!-- language="C" -->
* static const char *
* get_widget_toplevel_title (GtkWidget *widget)
* {
* GtkWidget *toplevel = gtk_widget_get_toplevel (widget);
* if (gtk_widget_is_toplevel (toplevel))
* if (GTK_IS_WINDOW (toplevel))
* {
* // Perform action on toplevel.
* return gtk_window_get_title (GTK_WINDOW (toplevel));
* }
*
* return NULL;
* }
* ]|
*
......@@ -7819,7 +7832,7 @@ public class Widget : ObjectG, ImplementorIF, BuildableIF
wrapper.remove(wrapper);
}
protected class OnDelegateWrapper
protected class OnEventDelegateWrapper
{
bool delegate(Event, Widget) dlg;
gulong handlerId;
......@@ -7827,23 +7840,23 @@ public class Widget : ObjectG, ImplementorIF, BuildableIF
this(bool delegate(Event, Widget) dlg)
{
this.dlg = dlg;
onListeners ~= this;
onEventListeners ~= this;
}
void remove(OnDelegateWrapper source)
void remove(OnEventDelegateWrapper source)
{
foreach(index, wrapper; onListeners)
foreach(index, wrapper; onEventListeners)
{
if (wrapper.handlerId == source.handlerId)
{
onListeners[index] = null;
onListeners = std.algorithm.remove(onListeners, index);
onEventListeners[index] = null;
onEventListeners = std.algorithm.remove(onEventListeners, index);
break;
}
}
}
}
OnDelegateWrapper[] onListeners;
OnEventDelegateWrapper[] onEventListeners;
/**
* The GTK+ main loop will emit three signals for each GDK event delivered
......@@ -7861,25 +7874,25 @@ public class Widget : ObjectG, ImplementorIF, BuildableIF
* the second signal. The ::event-after signal is emitted regardless of
* the return value.
*/
gulong addOn(bool delegate(Event, Widget) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0)
gulong addOnEvent(bool delegate(Event, Widget) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0)
{
auto wrapper = new OnDelegateWrapper(dlg);
auto wrapper = new OnEventDelegateWrapper(dlg);
wrapper.handlerId = Signals.connectData(
this,
"event",
cast(GCallback)&callBack,
cast(GCallback)&callBackEvent,
cast(void*)wrapper,
cast(GClosureNotify)&callBackDestroy,
cast(GClosureNotify)&callBackEventDestroy,
connectFlags);
return wrapper.handlerId;
}
extern(C) static int callBack(GtkWidget* widgetStruct, GdkEvent* event, OnDelegateWrapper wrapper)
extern(C) static int callBackEvent(GtkWidget* widgetStruct, GdkEvent* event, OnEventDelegateWrapper wrapper)
{
return wrapper.dlg(ObjectG.getDObject!(Event)(event), wrapper.outer);
}
extern(C) static void callBackDestroy(OnDelegateWrapper wrapper, GClosure* closure)
extern(C) static void callBackEventDestroy(OnEventDelegateWrapper wrapper, GClosure* closure)
{
wrapper.remove(wrapper);
}
......
......@@ -433,12 +433,12 @@ private string getWrapFunction(Impl, Member, string name)()
if ( (ParamStorage[i] == STC.out_ || ParamStorage[i] == STC.ref_) && isGtkdType!(DParamTypes[i]) )
{
result ~= "\tif ( d_"~ ParamNames[i] ~" !is null )\n"~
"\t\t"~ ParamNames[i] ~" = d_"~ ParamNames[i] ~".get"~ DParamTypes[i].stringof ~"Struct();\n";
"\t\t*"~ ParamNames[i] ~" = *d_"~ ParamNames[i] ~".get"~ DParamTypes[i].stringof ~"Struct();\n";
}
}
if ( isGtkdType!(ReturnType!(__traits(getMember, Impl, name))) && isPointer!(ReturnType!Member) )
result ~= "\treturn ret.get"~ (ReturnType!(__traits(getMember, Impl, name))).stringof ~"Struct();\n";
result ~= "\treturn ret ? ret.get"~ (ReturnType!(__traits(getMember, Impl, name))).stringof ~"Struct() : null;\n";
else if ( !is(ReturnType!Member == void) )
result ~= "\treturn ret;\n";
......
......@@ -433,12 +433,12 @@ private string getWrapFunction(Impl, Member, string name)()
if ( (ParamStorage[i] == STC.out_ || ParamStorage[i] == STC.ref_) && isGtkdType!(DParamTypes[i]) )
{
result ~= "\tif ( d_"~ ParamNames[i] ~" !is null )\n"~
"\t\t"~ ParamNames[i] ~" = d_"~ ParamNames[i] ~".get"~ DParamTypes[i].stringof ~"Struct();\n";
"\t\t*"~ ParamNames[i] ~" = *d_"~ ParamNames[i] ~".get"~ DParamTypes[i].stringof ~"Struct();\n";
}
}
if ( isGtkdType!(ReturnType!(__traits(getMember, Impl, name))) && isPointer!(ReturnType!Member) )
result ~= "\treturn ret.get"~ (ReturnType!(__traits(getMember, Impl, name))).stringof ~"Struct();\n";
result ~= "\treturn ret ? ret.get"~ (ReturnType!(__traits(getMember, Impl, name))).stringof ~"Struct() : null;\n";
else if ( !is(ReturnType!Member == void) )
result ~= "\treturn ret;\n";
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment