Commit 86086570 authored by Mike Wey's avatar Mike Wey
Browse files

Update Sourceview to 4.2.

Closes: #256
parent e6621e09
Pipeline #198 failed with stages
in 25 seconds
......@@ -105,6 +105,6 @@ Atk | 2.32
Gdk-pixbuf | 2.38
Cairo | 1.12.2
LibRsvg | 2.44
GtksourceView | 3.24
GtksourceView | 4.2
GStreamer | 1.14
Vte3 | 0.56
......@@ -133,7 +133,7 @@ public class SourceCompletion : ObjectG, BuildableIF
*
* Returns: a new #GtkSourceCompletionContext.
* The reference being returned is a 'floating' reference,
* so if you invoke gtk_source_completion_show() with this context
* so if you invoke gtk_source_completion_start() with this context
* you don't need to unref it.
*/
public SourceCompletionContext createContext(TextIter position)
......@@ -212,19 +212,6 @@ public class SourceCompletion : ObjectG, BuildableIF
gtk_source_completion_hide(gtkSourceCompletion);
}
/**
* Move the completion window to a specific iter.
*
* Deprecated: Use gtk_source_completion_provider_get_start_iter() instead.
*
* Params:
* iter = a #GtkTextIter.
*/
public void moveWindow(TextIter iter)
{
gtk_source_completion_move_window(gtkSourceCompletion, (iter is null) ? null : iter.getTextIterStruct());
}
/**
* Remove @provider from the completion.
*
......@@ -268,9 +255,9 @@ public class SourceCompletion : ObjectG, BuildableIF
*
* Returns: %TRUE if it was possible to the show completion window.
*/
public bool show(ListG providers, SourceCompletionContext context)
public bool start(ListG providers, SourceCompletionContext context)
{
return gtk_source_completion_show(gtkSourceCompletion, (providers is null) ? null : providers.getListGStruct(), (context is null) ? null : context.getSourceCompletionContextStruct()) != 0;
return gtk_source_completion_start(gtkSourceCompletion, (providers is null) ? null : providers.getListGStruct(), (context is null) ? null : context.getSourceCompletionContextStruct()) != 0;
}
/**
......
......@@ -26,7 +26,6 @@ module gsv.SourceCompletionInfo;
private import glib.ConstructionException;
private import gobject.ObjectG;
private import gobject.Signals;
private import gsv.c.functions;
public import gsv.c.types;
public import gsvc.gsvtypes;
......@@ -34,9 +33,7 @@ private import gtk.BuildableIF;
private import gtk.BuildableT;
private import gtk.TextIter;
private import gtk.TextView;
private import gtk.Widget;
private import gtk.Window;
private import std.algorithm;
/** */
......@@ -92,25 +89,6 @@ public class SourceCompletionInfo : Window
this(cast(GtkSourceCompletionInfo*) p);
}
/**
* Get the current content widget.
*
* Deprecated: Use gtk_bin_get_child() instead.
*
* Returns: The current content widget.
*/
public Widget getWidget()
{
auto p = gtk_source_completion_info_get_widget(gtkSourceCompletionInfo);
if(p is null)
{
return null;
}
return ObjectG.getDObject!(Widget)(cast(GtkWidget*) p);
}
/**
* Moves the #GtkSourceCompletionInfo to @iter. If @iter is %NULL @info is
* moved to the cursor position. Moving will respect the #GdkGravity setting
......@@ -125,32 +103,4 @@ public class SourceCompletionInfo : Window
{
gtk_source_completion_info_move_to_iter(gtkSourceCompletionInfo, (view is null) ? null : view.getTextViewStruct(), (iter is null) ? null : iter.getTextIterStruct());
}
/**
* Sets the content widget of the info window. See that the previous widget will
* lose a reference and it can be destroyed, so if you do not want this to
* happen you must use g_object_ref() before calling this method.
*
* Deprecated: Use gtk_container_add() instead. If there is already a child
* widget, remove it with gtk_container_remove().
*
* Params:
* widget = a #GtkWidget.
*/
public void setWidget(Widget widget)
{
gtk_source_completion_info_set_widget(gtkSourceCompletionInfo, (widget is null) ? null : widget.getWidgetStruct());
}
/**
* This signal is emitted before any "show" management. You can connect
* to this signal if you want to change some properties or position
* before the real "show".
*
* Deprecated: This signal should not be used.
*/
gulong addOnBeforeShow(void delegate(SourceCompletionInfo) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0)
{
return Signals.connect(this, "before-show", dlg, connectFlags ^ ConnectFlags.SWAPPED);
}
}
......@@ -68,40 +68,6 @@ public class SourceCompletionItem : ObjectG, SourceCompletionProposalIF
// add the SourceCompletionProposal capabilities
mixin SourceCompletionProposalT!(GtkSourceCompletionItem);
/**
* Create a new GtkSourceCompletionItem with label label, icon icon and
* extra information info. Both icon and info can be NULL in which case
* there will be no icon shown and no extra information available.
* Params:
* label = The item label.
* text = The item text.
* icon = The item icon. [allow-none]
* info = The item extra information. [allow-none]
* markup = If true label will be treated as markup. using gtk_source_completion_item_new_with_markup.
* Throws: ConstructionException GTK+ fails to create the object.
*/
public this (string label, string text, Pixbuf icon, string info, bool markup = false)
{
GtkSourceCompletionItem* p;
if ( markup )
{
p = gtk_source_completion_item_new_with_markup(Str.toStringz(label), Str.toStringz(text), (icon is null) ? null : icon.getPixbufStruct(), Str.toStringz(info));
}
else
{
p = gtk_source_completion_item_new(Str.toStringz(label), Str.toStringz(text), (icon is null) ? null : icon.getPixbufStruct(), Str.toStringz(info));
}
if(p is null)
{
throw new ConstructionException("null returned by gtk_source_completion_item_new(Str.toStringz(label), Str.toStringz(text), (icon is null) ? null : icon.getPixbufStruct(), Str.toStringz(info))");
}
this(p, true);
}
/**
*/
/** */
public static GType getType()
......@@ -109,51 +75,23 @@ public class SourceCompletionItem : ObjectG, SourceCompletionProposalIF
return gtk_source_completion_item_get_type();
}
/**
* Creates a new #GtkSourceCompletionItem from a stock item. If @label is %NULL,
* the stock label will be used.
*
* Deprecated: Use gtk_source_completion_item_new2() instead.
*
* Params:
* label = The item label.
* text = The item text.
* stock = The stock icon.
* info = The item extra information.
*
* Returns: a new #GtkSourceCompletionItem.
*
* Throws: ConstructionException GTK+ fails to create the object.
*/
public this(string label, string text, string stock, string info)
{
auto p = gtk_source_completion_item_new_from_stock(Str.toStringz(label), Str.toStringz(text), Str.toStringz(stock), Str.toStringz(info));
if(p is null)
{
throw new ConstructionException("null returned by new_from_stock");
}
this(cast(GtkSourceCompletionItem*) p, true);
}
/**
* Creates a new #GtkSourceCompletionItem. The desired properties need to be set
* afterwards.
*
* Returns: a new #GtkSourceCompletionItem.
*
* Since: 3.24
* Since: 4.0
*
* Throws: ConstructionException GTK+ fails to create the object.
*/
public this()
{
auto p = gtk_source_completion_item_new2();
auto p = gtk_source_completion_item_new();
if(p is null)
{
throw new ConstructionException("null returned by new2");
throw new ConstructionException("null returned by new");
}
this(cast(GtkSourceCompletionItem*) p, true);
......
......@@ -24,7 +24,6 @@
module gsv.SourceGutter;
private import gdk.Window;
private import gobject.ObjectG;
private import gsv.SourceGutterRenderer;
private import gsv.SourceView;
......@@ -69,16 +68,6 @@ public class SourceGutter : ObjectG
return gtk_source_gutter_get_type();
}
/**
*
*
* Deprecated: Use gtk_source_gutter_renderer_get_padding() instead.
*/
public void getPadding(int* xpad, int* ypad)
{
gtk_source_gutter_get_padding(gtkSourceGutter, xpad, ypad);
}
/**
* Finds the #GtkSourceGutterRenderer at (x, y).
*
......@@ -117,29 +106,6 @@ public class SourceGutter : ObjectG
return ObjectG.getDObject!(SourceView)(cast(GtkSourceView*) p);
}
/**
* Get the #GdkWindow of the gutter. The window will only be available when the
* gutter has at least one, non-zero width, cell renderer packed.
*
* Deprecated: Use gtk_text_view_get_window() instead.
*
* Returns: the #GdkWindow of the gutter, or %NULL
* if the gutter has no window.
*
* Since: 2.8
*/
public Window getWindow()
{
auto p = gtk_source_gutter_get_window(gtkSourceGutter);
if(p is null)
{
return null;
}
return ObjectG.getDObject!(Window)(cast(GdkWindow*) p);
}
/**
* Returns: the #GtkTextWindowType of @gutter.
*
......@@ -205,14 +171,4 @@ public class SourceGutter : ObjectG
{
gtk_source_gutter_reorder(gtkSourceGutter, (renderer is null) ? null : renderer.getSourceGutterRendererStruct(), position);
}
/**
*
*
* Deprecated: Use gtk_source_gutter_renderer_set_padding() instead.
*/
public void setPadding(int xpad, int ypad)
{
gtk_source_gutter_set_padding(gtkSourceGutter, xpad, ypad);
}
}
......@@ -64,14 +64,6 @@ public class SourceGutterRendererPixbuf : SourceGutterRenderer
super(cast(GtkSourceGutterRenderer*)gtkSourceGutterRendererPixbuf, ownedRef);
}
/** */
public void setStockId(StockID stockId)
{
setStockId(cast(string)stockId);
}
/**
*/
/** */
public static GType getType()
......@@ -138,18 +130,6 @@ public class SourceGutterRendererPixbuf : SourceGutterRenderer
return ObjectG.getDObject!(Pixbuf)(cast(GdkPixbuf*) p);
}
/**
*
*
* Deprecated: Don't use this function.
*
* Returns: the stock id.
*/
public string getStockId()
{
return Str.toString(gtk_source_gutter_renderer_pixbuf_get_stock_id(gtkSourceGutterRendererPixbuf));
}
/** */
public void setGicon(IconIF icon)
{
......@@ -167,17 +147,4 @@ public class SourceGutterRendererPixbuf : SourceGutterRenderer
{
gtk_source_gutter_renderer_pixbuf_set_pixbuf(gtkSourceGutterRendererPixbuf, (pixbuf is null) ? null : pixbuf.getPixbufStruct());
}
/**
*
*
* Deprecated: Don't use this function.
*
* Params:
* stockId = the stock id
*/
public void setStockId(string stockId)
{
gtk_source_gutter_renderer_pixbuf_set_stock_id(gtkSourceGutterRendererPixbuf, Str.toStringz(stockId));
}
}
......@@ -69,14 +69,6 @@ public class SourceMarkAttributes : ObjectG
super(cast(GObject*)gtkSourceMarkAttributes, ownedRef);
}
/** */
public void setStockId(StockID stockId)
{
setStockId(cast(string)stockId);
}
/**
*/
/** */
public static GType getType()
......@@ -172,20 +164,6 @@ public class SourceMarkAttributes : ObjectG
return ObjectG.getDObject!(Pixbuf)(cast(GdkPixbuf*) p);
}
/**
* Gets a stock id of an icon used by this attributes. Note that the stock id can
* be %NULL if it wasn't set earlier.
*
* Deprecated: Don't use this function.
*
* Returns: Stock id. Returned string is owned by @attributes and
* shouldn't be freed.
*/
public string getStockId()
{
return Str.toString(gtk_source_mark_attributes_get_stock_id(gtkSourceMarkAttributes));
}
/**
* Queries for a tooltip by emitting
* a #GtkSourceMarkAttributes::query-tooltip-markup signal. The tooltip may contain
......@@ -227,9 +205,8 @@ public class SourceMarkAttributes : ObjectG
/**
* Renders an icon of given size. The base of the icon is set by the last call
* to one of: gtk_source_mark_attributes_set_pixbuf(),
* gtk_source_mark_attributes_set_gicon(),
* gtk_source_mark_attributes_set_icon_name() or
* gtk_source_mark_attributes_set_stock_id(). @size cannot be lower than 1.
* gtk_source_mark_attributes_set_gicon() or
* gtk_source_mark_attributes_set_icon_name(). @size cannot be lower than 1.
*
* Params:
* widget = widget of which style settings may be used.
......@@ -294,19 +271,6 @@ public class SourceMarkAttributes : ObjectG
gtk_source_mark_attributes_set_pixbuf(gtkSourceMarkAttributes, (pixbuf is null) ? null : pixbuf.getPixbufStruct());
}
/**
* Sets stock id to be used as a base for rendered icon.
*
* Deprecated: Don't use this function.
*
* Params:
* stockId = a stock id.
*/
public void setStockId(string stockId)
{
gtk_source_mark_attributes_set_stock_id(gtkSourceMarkAttributes, Str.toStringz(stockId));
}
/**
* The code should connect to this signal to provide a tooltip for given
* @mark. The tooltip can contain a markup.
......
......@@ -110,38 +110,6 @@ public class SourceSearchContext : ObjectG
* functions instead, to not block the user interface. However, if you are sure
* that the @buffer is small, this function is more convenient to use.
*
* Deprecated: Use gtk_source_search_context_backward2() instead.
*
* Params:
* iter = start of search.
* matchStart = return location for start of match, or %NULL.
* matchEnd = return location for end of match, or %NULL.
*
* Returns: whether a match was found.
*
* Since: 3.10
*/
public bool backward(TextIter iter, out TextIter matchStart, out TextIter matchEnd)
{
GtkTextIter* outmatchStart = sliceNew!GtkTextIter();
GtkTextIter* outmatchEnd = sliceNew!GtkTextIter();
auto p = gtk_source_search_context_backward(gtkSourceSearchContext, (iter is null) ? null : iter.getTextIterStruct(), outmatchStart, outmatchEnd) != 0;
matchStart = ObjectG.getDObject!(TextIter)(outmatchStart, true);
matchEnd = ObjectG.getDObject!(TextIter)(outmatchEnd, true);
return p;
}
/**
* Synchronous backward search. It is recommended to use the asynchronous
* functions instead, to not block the user interface. However, if you are sure
* that the @buffer is small, this function is more convenient to use.
*
* The difference with gtk_source_search_context_backward() is that the
* @has_wrapped_around out parameter has been added for convenience.
*
* If the #GtkSourceSearchSettings:wrap-around property is %FALSE, this function
* doesn't try to wrap around.
*
......@@ -158,15 +126,15 @@ public class SourceSearchContext : ObjectG
*
* Returns: whether a match was found.
*
* Since: 3.22
* Since: 4.0
*/
public bool backward2(TextIter iter, out TextIter matchStart, out TextIter matchEnd, out bool hasWrappedAround)
public bool backward(TextIter iter, out TextIter matchStart, out TextIter matchEnd, out bool hasWrappedAround)
{
GtkTextIter* outmatchStart = sliceNew!GtkTextIter();
GtkTextIter* outmatchEnd = sliceNew!GtkTextIter();
int outhasWrappedAround;
auto p = gtk_source_search_context_backward2(gtkSourceSearchContext, (iter is null) ? null : iter.getTextIterStruct(), outmatchStart, outmatchEnd, &outhasWrappedAround) != 0;
auto p = gtk_source_search_context_backward(gtkSourceSearchContext, (iter is null) ? null : iter.getTextIterStruct(), outmatchStart, outmatchEnd, &outhasWrappedAround) != 0;
matchStart = ObjectG.getDObject!(TextIter)(outmatchStart, true);
matchEnd = ObjectG.getDObject!(TextIter)(outmatchEnd, true);
......@@ -176,9 +144,9 @@ public class SourceSearchContext : ObjectG
}
/**
* The asynchronous version of gtk_source_search_context_backward2().
* The asynchronous version of gtk_source_search_context_backward().
*
* See the documentation of gtk_source_search_context_backward2() for more
* See the documentation of gtk_source_search_context_backward() for more
* details.
*
* See the #GAsyncResult documentation to know how to use this function.
......@@ -204,43 +172,7 @@ public class SourceSearchContext : ObjectG
* Finishes a backward search started with
* gtk_source_search_context_backward_async().
*
* Deprecated: Use gtk_source_search_context_backward_finish2() instead.
*
* Params:
* result = a #GAsyncResult.
* matchStart = return location for start of match, or %NULL.
* matchEnd = return location for end of match, or %NULL.
*
* Returns: whether a match was found.
*
* Since: 3.10
*
* Throws: GException on failure.
*/
public bool backwardFinish(AsyncResultIF result, out TextIter matchStart, out TextIter matchEnd)
{
GtkTextIter* outmatchStart = sliceNew!GtkTextIter();
GtkTextIter* outmatchEnd = sliceNew!GtkTextIter();
GError* err = null;
auto p = gtk_source_search_context_backward_finish(gtkSourceSearchContext, (result is null) ? null : result.getAsyncResultStruct(), outmatchStart, outmatchEnd, &err) != 0;
if (err !is null)
{
throw new GException( new ErrorG(err) );
}
matchStart = ObjectG.getDObject!(TextIter)(outmatchStart, true);
matchEnd = ObjectG.getDObject!(TextIter)(outmatchEnd, true);
return p;
}
/**
* Finishes a backward search started with
* gtk_source_search_context_backward_async().
*
* See the documentation of gtk_source_search_context_backward2() for more
* See the documentation of gtk_source_search_context_backward() for more
* details.
*
* Params:
......@@ -252,18 +184,18 @@ public class SourceSearchContext : ObjectG
*
* Returns: whether a match was found.
*
* Since: 3.22
* Since: 4.0
*
* Throws: GException on failure.
*/
public bool backwardFinish2(AsyncResultIF result, out TextIter matchStart, out TextIter matchEnd, out bool hasWrappedAround)
public bool backwardFinish(AsyncResultIF result, out TextIter matchStart, out TextIter matchEnd, out bool hasWrappedAround)
{
GtkTextIter* outmatchStart = sliceNew!GtkTextIter();
GtkTextIter* outmatchEnd = sliceNew!GtkTextIter();
int outhasWrappedAround;
GError* err = null;
auto p = gtk_source_search_context_backward_finish2(gtkSourceSearchContext, (result is null) ? null : result.getAsyncResultStruct(), outmatchStart, outmatchEnd, &outhasWrappedAround, &err) != 0;
auto p = gtk_source_search_context_backward_finish(gtkSourceSearchContext, (result is null) ? null : result.getAsyncResultStruct(), outmatchStart, outmatchEnd, &outhasWrappedAround, &err) != 0;
if (err !is null)
{
......@@ -282,38 +214,6 @@ public class SourceSearchContext : ObjectG
* functions instead, to not block the user interface. However, if you are sure
* that the @buffer is small, this function is more convenient to use.
*
* Deprecated: Use gtk_source_search_context_forward2() instead.
*
* Params:
* iter = start of search.
* matchStart = return location for start of match, or %NULL.
* matchEnd = return location for end of match, or %NULL.
*
* Returns: whether a match was found.
*
* Since: 3.10
*/
public bool forward(TextIter iter, out TextIter matchStart, out TextIter matchEnd)
{
GtkTextIter* outmatchStart = sliceNew!GtkTextIter();
GtkTextIter* outmatchEnd = sliceNew!GtkTextIter();
auto p = gtk_source_search_context_forward(gtkSourceSearchContext, (iter is null) ? null : iter.getTextIterStruct(), outmatchStart, outmatchEnd) != 0;
matchStart = ObjectG.getDObject!(TextIter)(outmatchStart, true);
matchEnd = ObjectG.getDObject!(TextIter)(outmatchEnd, true);
return p;
}
/**
* Synchronous forward search. It is recommended to use the asynchronous
* functions instead, to not block the user interface. However, if you are sure
* that the @buffer is small, this function is more convenient to use.
*
* The difference with gtk_source_search_context_forward() is that the
* @has_wrapped_around out parameter has been added for convenience.
*
* If the #GtkSourceSearchSettings:wrap-around property is %FALSE, this function
* doesn't try to wrap around.
*
......@@ -330,15 +230,15 @@ public class SourceSearchContext : ObjectG
*
* Returns: whether a match was found.
*
* Since: 3.22
* Since: 4.0
*/
public bool forward2(TextIter iter, out TextIter matchStart, out TextIter matchEnd, out bool hasWrappedAround)
public bool forward(TextIter iter, out TextIter matchStart, out TextIter matchEnd, out bool hasWrappedAround)
{
GtkTextIter* outmatchStart = sliceNew!GtkTextIter();
GtkTextIter* outmatchEnd = sliceNew!GtkTextIter();
int outhasWrappedAround;
auto p = gtk_source_search_context_forward2(gtkSourceSearchContext, (iter is null) ? null : iter.getTextIterStruct(), outmatchStart, outmatchEnd, &outhasWrappedAround) != 0;
auto p = gtk_source_search_context_forward(gtkSourceSearchContext, (iter is null) ? null : iter.getTextIterStruct(), outmatchStart, outmatchEnd, &outhasWrappedAround) != 0;
matchStart = ObjectG.getDObject!(TextIter)(outmatchStart, true);
matchEnd = ObjectG.getDObject!(TextIter)(outmatchEnd, true);
......@@ -348,9 +248,9 @@ public class SourceSearchContext : ObjectG
}
/**
* The asynchronous version of gtk_source_search_context_forward2().
* The asynchronous version of gtk_source_search_context_forward().
*
* See the documentation of gtk_source_search_context_forward2() for more
* See the documentation of gtk_source_search_context_forward() for more
* details.
*