1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338
|
<?xml version="1.0"?>
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
"http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd"
[
<!ENTITY % local.common.attrib "xmlns:xi CDATA #FIXED 'http://www.w3.org/2003/XInclude'">
<!ENTITY % gtkdocentities SYSTEM "xml/gtkdocentities.ent">
%gtkdocentities;
]>
<part id="porting-guides">
<title>Porting Guides</title>
<chapter id="porting-guide-3-to-4">
<title>GtkSourceView 3 -> 4 Porting Guide</title>
<refsect1>
<title>GTK dependency</title>
<para>
Both GtkSourceView 3 and GtkSourceView 4 depend on GTK 3.
</para>
</refsect1>
<refsect1>
<title>Preparation in GtkSourceView 3</title>
<para>
GtkSourceView 3.24 is the latest stable GtkSourceView 3 version. Before
continuing this porting guide, you should use the 3.24 version without
using any deprecated API.
</para>
</refsect1>
<refsect1>
<title>New pkg-config name</title>
<para>
For GtkSourceView 4, the pkg-config name is:
<code>gtksourceview-4</code>
</para>
<para>
To compile a program that uses GtkSourceView 4, you
can for example use the following command:
</para>
<para>
<code>$ gcc hello.c `pkg-config --cflags --libs gtksourceview-4` -o hello</code>
</para>
</refsect1>
<refsect1>
<title>GtkSourceView 3.99.1</title>
<itemizedlist>
<listitem>
<para>
All the deprecated APIs have been removed.
</para>
</listitem>
<listitem>
<para>
Only <code><gtksourceview/gtksource.h></code> can be included
directly. There were already warnings about it in GtkSourceView 3. The
warnings have been changed to errors.
</para>
</listitem>
<listitem>
<para>
Only the version 2 of the <link linkend="lang-reference">GtkSourceView
language definition file format</link> is supported (for *.lang files,
used for syntax highlighting). The support for the version 1 has been
dropped.
</para>
</listitem>
</itemizedlist>
</refsect1>
<refsect1>
<title>GtkSourceView 3.99.2</title>
<itemizedlist>
<listitem>
<para>
<code>gtk_source_completion_item_new2()</code> has been renamed to
<link linkend="gtk-source-completion-item-new">gtk_source_completion_item_new()</link>.
</para>
</listitem>
<listitem>
<para>
<code>gtk_source_search_context_forward2()</code> has been renamed to
<link linkend="gtk-source-search-context-forward">gtk_source_search_context_forward()</link>.
</para>
</listitem>
<listitem>
<para>
<code>gtk_source_search_context_forward_finish2()</code> has been renamed to
<link linkend="gtk-source-search-context-forward-finish">gtk_source_search_context_forward_finish()</link>.
</para>
</listitem>
<listitem>
<para>
<code>gtk_source_search_context_backward2()</code> has been renamed to
<link linkend="gtk-source-search-context-backward">gtk_source_search_context_backward()</link>.
</para>
</listitem>
<listitem>
<para>
<code>gtk_source_search_context_backward_finish2()</code> has been renamed to
<link linkend="gtk-source-search-context-backward-finish">gtk_source_search_context_backward_finish()</link>.
</para>
</listitem>
<listitem>
<para>
<code>gtk_source_search_context_replace2()</code> has been renamed to
<link linkend="gtk-source-search-context-replace">gtk_source_search_context_replace()</link>.
</para>
</listitem>
<listitem>
<para>
The <link linkend="GtkSourceSearchContext--settings">GtkSourceSearchContext:settings</link>
property is now construct-only.
</para>
</listitem>
</itemizedlist>
</refsect1>
<refsect1>
<title>GtkSourceView 3.99.3</title>
<para>No API changes.</para>
</refsect1>
<refsect1>
<title>GtkSourceView 3.99.4</title>
<itemizedlist>
<listitem>
<para>
The API of the
<link linkend="GtkSourceView-move-lines">GtkSourceView::move-lines</link>
keybinding signal has been simplified: the <code>copy</code> parameter
was deprecated and has been removed; and the <code>count</code>
parameter has been replaced by the <code>down</code> boolean.
</para>
</listitem>
</itemizedlist>
</refsect1>
<refsect1>
<title>GtkSourceView 3.99.5 and 3.99.6</title>
<para>No API changes.</para>
</refsect1>
<refsect1>
<title>GtkSourceView 3.99.7</title>
<para>
In order to have a better *.gir file and have less metadata to generate
the *.vapi for Vala, the following change has been made:
</para>
<itemizedlist>
<listitem>
<para>
<code>gtk_source_completion_show()</code> has been renamed to
<link linkend="gtk-source-completion-start">gtk_source_completion_start()</link>.
The function conflicted with the
<link linkend="GtkSourceCompletion-show">GtkSourceCompletion::show</link> signal.
Note that in Vala this doesn't require code changes because the method
was already renamed to <code>start()</code> in GtkSourceView 3.
</para>
</listitem>
</itemizedlist>
<para>
Other changes in 3.99.7:
</para>
<itemizedlist>
<listitem>
<para>
For i18n initialization, the
<link linkend="gtk-source-init">gtk_source_init()</link> function
now needs to be called. There is also the
<link linkend="gtk-source-finalize">gtk_source_finalize()</link>
function which is convenient when using memory debugging tools.
</para>
</listitem>
</itemizedlist>
</refsect1>
</chapter>
<chapter id="porting-guide-gtksourceview-4-to-libgedit-gtksourceview-299-0">
<title>GtkSourceView 4 -> libgedit-gtksourceview 299.0 Porting Guide</title>
<refsect1>
<title>GTK dependency</title>
<para>
Both GtkSourceView 4 and libgedit-gtksourceview 299.x.y depend on GTK 3.
</para>
</refsect1>
<refsect1>
<title>pkg-config name</title>
<para>
The new pkg-config name is:
<code>libgedit-gtksourceview-300</code>
</para>
<para>
The “3” in “300” means that it targets GTK 3.
</para>
</refsect1>
<refsect1>
<title>For Vala</title>
<para>
For Vala code, use the GObject Introspection file, not the
<code>*.vapi</code>, because the <code>*.vapi</code> file has been
removed.
</para>
</refsect1>
<refsect1>
<title>For Glade</title>
<para>
The Glade catalog has been removed, so don't rely on it.
</para>
</refsect1>
<refsect1>
<title>Paths to lang and style files</title>
<para>
The paths to <code>*.lang</code> and style scheme files have changed. For
example,
<filename>/usr/share/libgedit-gtksourceview-300/language-specs/</filename>
is the usual location where <code>*.lang</code> files are found.
</para>
</refsect1>
<refsect1>
<title>API breaks</title>
<itemizedlist>
<listitem>
<para>
<code>GtkSourceMap</code> has been removed.
</para>
</listitem>
<listitem>
<para>
<code>GtkSourceStyleSchemeChooserButton</code> and
<code>GtkSourceStyleSchemeChooserWidget</code> have been removed. See
the Tepl library for a replacement.
</para>
</listitem>
<listitem>
<para>
The macros and functions to check the library version have been
removed: the <code>gtk_source_check_version()</code>,
<code>gtk_source_get_major_version()</code>, etc functions; as well as
all the macros such as <code>GTK_SOURCE_CHECK_VERSION()</code>.
</para>
</listitem>
<listitem>
<para>
The <code>GtkSourceStyleSchemeManager:scheme-ids</code> and
<code>GtkSourceStyleSchemeManager:search-path</code> properties have
been removed. Instead, you can connect to the
<link linkend="GtkSourceStyleSchemeManager-changed">GtkSourceStyleSchemeManager::changed</link>
signal to be notified.
</para>
<para>
The <code>gtk_source_style_scheme_manager_get_scheme_ids()</code>
function has been removed, use
<link linkend="gtk-source-style-scheme-manager-get-schemes">gtk_source_style_scheme_manager_get_schemes()</link>
instead.
</para>
<para>
All the <link linkend="GtkSourceStyleScheme">GtkSourceStyleScheme</link>
properties have been removed. Use the get functions instead.
</para>
<para>
All the <link linkend="GtkSourceStyle">GtkSourceStyle</link>
properties have been removed. Use the
<code>gtk_source_style_get_data()</code> function instead.
</para>
</listitem>
</itemizedlist>
</refsect1>
</chapter>
<chapter id="porting-guide-299-0-to-299-2">
<title>libgedit-gtksourceview 299.0 -> 299.2 Porting Guide</title>
<refsect1>
<title>API breaks</title>
<itemizedlist>
<listitem>
<para>
The <code>gtk_source_style_get_data()</code> function has been
removed. <link linkend="GtkSourceStyle">GtkSourceStyle</link> is now a
boxed type (a simple struct), no longer a GObject. Another important
difference is to call the right ref/unref functions for memory
management.
</para>
<para>
The <link linkend="GtkSourceSearchContext--match-style">GtkSourceSearchContext:match-style</link>
property is a <link linkend="GtkSourceStyle">GtkSourceStyle</link>, so
it may require some code changes when using it.
</para>
<para>
The <code>gtk_source_style_scheme_get_authors()</code> function has
been removed.
</para>
</listitem>
</itemizedlist>
</refsect1>
</chapter>
<chapter id="porting-guide-299-2-to-299-3">
<title>libgedit-gtksourceview 299.2 -> 299.3 Porting Guide</title>
<refsect1>
<title>API breaks</title>
<itemizedlist>
<listitem>
<para>
The <code>GtkSourceStyleSchemeChooser</code> interface has been
removed because it is no longer used by libgedit-tepl.
</para>
</listitem>
</itemizedlist>
</refsect1>
</chapter>
<chapter id="porting-guide-299-3-to-299-4">
<title>libgedit-gtksourceview 299.3 -> 299.4 Porting Guide</title>
<refsect1>
<title>API breaks</title>
<itemizedlist>
<listitem>
<para>
The background-pattern feature (with the grid pattern) has been
removed from the <link linkend="GtkSourceView">GtkSourceView</link>
class.
</para>
</listitem>
</itemizedlist>
</refsect1>
</chapter>
</part>
|