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
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.9.1"/>
<title>gtksourceviewmm: Migration from 2.0 to 3.0</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="doxygen-extra.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td style="padding-left: 0.5em;">
<div id="projectname">gtksourceviewmm
 <span id="projectnumber">3.18.0</span>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.9.1 -->
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main Page</span></a></li>
<li class="current"><a href="pages.html"><span>Related Pages</span></a></li>
<li><a href="modules.html"><span>Modules</span></a></li>
<li><a href="namespaces.html"><span>Namespaces</span></a></li>
<li><a href="annotated.html"><span>Classes</span></a></li>
</ul>
</div>
</div><!-- top -->
<div class="header">
<div class="headertitle">
<div class="title">Migration from 2.0 to 3.0 </div> </div>
</div><!--header-->
<div class="contents">
<div class="textblock"><p>This page lists some notable API/ABI breaks.</p>
<p>Probably not all were listed, but this is provided in hope that with help of this page migrating from gtksourceviewmm-2.0 to 3.0 won't be a cause of headaches.</p>
<ul>
<li>
Stuff marked as deprecated was removed of course. </li>
<li>
Removed Source prefix from all types, SOURCE_ prefix from all enum value names and source prefix from all file names. There is a helper script called source_truncate.pl in git repository in codegen directory to aid programmer in boring task of renaming everything. </li>
<li>
"source-mark-updated" signal in <a class="el" href="classGsv_1_1Buffer.html" title="Buffer object for View. ">Gsv::Buffer</a> now takes <a class="elRef" doxygen="gtkmm-3.0.tag:http://library.gnome.org/devel/gtkmm/unstable/" href="http://library.gnome.org/devel/gtkmm/unstable/classGtk_1_1TextMark.html">Gtk::TextMark</a> instead of Mark. </li>
<li>
Vfuncs in <a class="el" href="classGsv_1_1CompletionProposal.html" title="Completion proposal object. ">Gsv::CompletionProposal</a>, <a class="el" href="classGsv_1_1CompletionProvider.html" title="Completion provider interface. ">Gsv::CompletionProvider</a> and <a class="el" href="classGsv_1_1UndoManager.html" title="Undo manager interface for View. ">Gsv::UndoManager</a> are now private. They shouldn't be called directly anyway - there are respective methods for this. </li>
<li>
Some methods now takes <a class="elRef" doxygen="libstdc++.tag:http://gcc.gnu.org/onlinedocs/libstdc++/latest-doxygen/" href="http://gcc.gnu.org/onlinedocs/libstdc++/latest-doxygen/a01681.html#ga32db3d9898c44d3b3a578b560f7758cc">std::string</a> instead of <a class="elRef" doxygen="glibmm-2.4.tag:http://library.gnome.org/devel/glibmm/unstable/" href="http://library.gnome.org/devel/glibmm/unstable/classGlib_1_1ustring.html">Glib::ustring</a>. These are: <ul>
<li>
<a class="el" href="classGsv_1_1LanguageManager.html#a7ca7ee1059f086a01ef805ef5931486b" title="Gets the list directories where language manager looks for language files. ">Gsv::LanguageManager::get_search_path()</a> </li>
<li>
<a class="el" href="classGsv_1_1LanguageManager.html#ac524730cff2f25a747f18deaf5e621f9" title="Sets the list of directories where the language manager looks for language files. ...">Gsv::LanguageManager::set_search_path()</a> </li>
<li>
<a class="el" href="classGsv_1_1LanguageManager.html#ae691cb6f6d331677225894641db360b0" title="Returns the ids of the available languages. ">Gsv::LanguageManager::get_language_ids()</a> </li>
<li>
<a class="el" href="classGsv_1_1LanguageManager.html#a6bb00efcb29d98e69d8c70ca83e8dddf" title="Gets the Language identified by the given id in the language manager. ">Gsv::LanguageManager::get_language()</a> </li>
<li>
<a class="el" href="classGsv_1_1LanguageManager.html#adf16d8729a9a604d0bac606cf058da0a" title="Picks a Language for given file name and content type, according to the information in lang files...">Gsv::LanguageManager::guess_language()</a> </li>
<li>
<a class="el" href="classGsv_1_1StyleSchemeManager.html#abba091f6530fc57678a8dc1003bd9c0a" title="Sets the list of directories where the manager looks for style scheme files. ">Gsv::StyleSchemeManager::set_search_path()</a> </li>
<li>
<a class="el" href="classGsv_1_1StyleSchemeManager.html#a1137bd67ce073bc2768600b69c83b75c" title="Returns the current search path for the manager. ">Gsv::StyleSchemeManager::get_search_path()</a> </li>
<li>
<a class="el" href="classGsv_1_1StyleSchemeManager.html#aefc03f29d856154e2b05c2e077908618" title="Appends path to the list of directories where the manager looks for style scheme files. ">Gsv::StyleSchemeManager::append_search_path()</a> </li>
<li>
<a class="el" href="classGsv_1_1StyleSchemeManager.html#a3f7174b9d3baa1b6765b9b2be5c84f1f" title="Prepends path to the list of directories where the manager looks for style scheme files...">Gsv::StyleSchemeManager::prepend_search_path()</a> </li>
<li>
<a class="el" href="classGsv_1_1StyleSchemeManager.html#ab193fb63b61b64e2a88be1c87493a3dc" title="Looks up style scheme by id. ">Gsv::StyleSchemeManager::get_scheme()</a> </li>
<li>
<a class="el" href="classGsv_1_1StyleSchemeManager.html#ae6fd9e8fa78bf322b24436ac0d89957f" title="Returns the ids of the available style schemes. ">Gsv::StyleSchemeManager::get_scheme_ids()</a> </li>
</ul>
</li>
<li>
<a class="el" href="classGsv_1_1Mark.html" title="Mark class for Buffer. ">Gsv::Mark</a>'s constructor with category and name has parameter order the same as C gtk_source_mark_new(). Previously parameter order was reversed, because name parameter could be omitted - it has a default value of empty string, which was interpreted as creating anonymous <a class="el" href="classGsv_1_1Mark.html" title="Mark class for Buffer. ">Gsv::Mark</a>. Now there is separate constructor for creating anonymous SourceMarks. If there was: <div class="fragment"><div class="line"><a class="codeRef" doxygen="glibmm-2.4.tag:http://library.gnome.org/devel/glibmm/unstable/" href="http://library.gnome.org/devel/glibmm/unstable/classGlib_1_1RefPtr.html">Glib::RefPtr<Gsv::Mark></a> sm (<a class="code" href="classGsv_1_1Mark.html#a8c554f25d8051ef306770ed5376f1094">Gsv::Mark::create</a> (<span class="stringliteral">"category"</span>, <span class="stringliteral">"name"</span>));</div>
</div><!-- fragment --> Now should be: <div class="fragment"><div class="line"><a class="codeRef" doxygen="glibmm-2.4.tag:http://library.gnome.org/devel/glibmm/unstable/" href="http://library.gnome.org/devel/glibmm/unstable/classGlib_1_1RefPtr.html">Glib::RefPtr<Gsv::Mark></a> sm (<a class="code" href="classGsv_1_1Mark.html#a8c554f25d8051ef306770ed5376f1094">Gsv::Mark::create</a> (<span class="stringliteral">"name"</span>, <span class="stringliteral">"category"</span>));</div>
</div><!-- fragment --> If there was: <div class="fragment"><div class="line"><a class="codeRef" doxygen="glibmm-2.4.tag:http://library.gnome.org/devel/glibmm/unstable/" href="http://library.gnome.org/devel/glibmm/unstable/classGlib_1_1RefPtr.html">Glib::RefPtr<Gsv::Mark></a> sm (<a class="code" href="classGsv_1_1Mark.html#a8c554f25d8051ef306770ed5376f1094">Gsv::Mark::create</a> (<span class="stringliteral">"category"</span>));</div>
</div><!-- fragment --> Nothing needs to be changed. If there was: <div class="fragment"><div class="line"><a class="codeRef" doxygen="glibmm-2.4.tag:http://library.gnome.org/devel/glibmm/unstable/" href="http://library.gnome.org/devel/glibmm/unstable/classGlib_1_1RefPtr.html">Glib::RefPtr<Gsv::Mark></a> sm (<a class="code" href="classGsv_1_1Mark.html#a8c554f25d8051ef306770ed5376f1094">Gsv::Mark::create</a> (<span class="stringliteral">"category"</span>, <span class="stringliteral">""</span>));</div>
</div><!-- fragment --> Now should be: <div class="fragment"><div class="line"><a class="codeRef" doxygen="glibmm-2.4.tag:http://library.gnome.org/devel/glibmm/unstable/" href="http://library.gnome.org/devel/glibmm/unstable/classGlib_1_1RefPtr.html">Glib::RefPtr<Gsv::Mark></a> sm (<a class="code" href="classGsv_1_1Mark.html#a8c554f25d8051ef306770ed5376f1094">Gsv::Mark::create</a> (<span class="stringliteral">"category"</span>));</div>
</div><!-- fragment --> </li>
<li>
If there is a code that somehow depended on <a class="el" href="classGsv_1_1StyleScheme.html" title="Object controlling appearance of View. ">Gsv::StyleScheme</a> being a <a class="elRef" doxygen="glibmm-2.4.tag:http://library.gnome.org/devel/glibmm/unstable/" href="http://library.gnome.org/devel/glibmm/unstable/classGlib_1_1Interface.html">Glib::Interface</a>, then this code is wrong, because it should always be a <a class="elRef" doxygen="glibmm-2.4.tag:http://library.gnome.org/devel/glibmm/unstable/" href="http://library.gnome.org/devel/glibmm/unstable/classGlib_1_1Object.html">Glib::Object</a>. </li>
<li>
SourceIter is gone - all its features are now supported by <a class="elRef" doxygen="gtkmm-3.0.tag:http://library.gnome.org/devel/gtkmm/unstable/" href="http://library.gnome.org/devel/gtkmm/unstable/classGtk_1_1TextIter.html">Gtk::TextIter</a>. </li>
<li>
<a class="el" href="classGsv_1_1Completion.html" title="Main Completion Object. ">Gsv::Completion</a> is now a <a class="elRef" doxygen="glibmm-2.4.tag:http://library.gnome.org/devel/glibmm/unstable/" href="http://library.gnome.org/devel/glibmm/unstable/classGlib_1_1Object.html">Glib::Object</a>, not <a class="elRef" doxygen="gtkmm-3.0.tag:http://library.gnome.org/devel/gtkmm/unstable/" href="http://library.gnome.org/devel/gtkmm/unstable/classGtk_1_1Object.html">Gtk::Object</a>. So it should be used as Glib::RefPtr<Gsv::Completion> instead of plain <a class="el" href="classGsv_1_1Completion.html" title="Main Completion Object. ">Gsv::Completion</a>. </li>
<li>
Namespace <b>gtksourceview</b> was renamed to <b><a class="el" href="namespaceGsv.html">Gsv</a></b>. If there is a lot of code using <b>gtksourceview</b> namespace then a workaround would be creating a backward compatibility header and including it a place included by affected sources. A header could contain a lines like that: <div class="fragment"><div class="line"><span class="preprocessor">#ifndef GTKSOURCEVIEWMM_COMPAT_H</span></div>
<div class="line"><span class="preprocessor">#define GTKSOURCEVIEWMM_COMPAT_H</span></div>
<div class="line"><span class="keyword">namespace </span>gtksourceview = <a class="code" href="namespaceGsv.html">Gsv</a>;</div>
<div class="line"><span class="preprocessor">#endif // GTKSOURCEVIEWMM_COMPAT_H</span></div>
</div><!-- fragment --> </li>
<li>
Replaced <a class="elRef" doxygen="glibmm-2.4.tag:http://library.gnome.org/devel/glibmm/unstable/" href="http://library.gnome.org/devel/glibmm/unstable/namespaceGlib.html">Glib</a>::<em>Handle<> with std::vector<> - that means that passing std::list<> or std::deque<> is now not supported. Affected methods are: <ul>
<li>
<a class="el" href="classGsv_1_1Buffer.html#a9f15695f071d4035c6e6066acc68444d" title="Returns the list of marks of the given category at line. ">Gsv::Buffer::get_source_marks_at_line()</a> </li>
<li>
<a class="el" href="classGsv_1_1Buffer.html#a54c3f01e507936f763bae73588397592" title="Returns the list of marks of the given category at iter. ">Gsv::Buffer::get_source_marks_at_iter()</a> </li>
<li>
<a class="el" href="classGsv_1_1Buffer.html#a4dcd97d6df6388179a3e5cdd101b8eaf" title="Get all defined context classes at iter. ">Gsv::Buffer::get_context_classes_at_iter()</a> </li>
<li>
<a class="el" href="classGsv_1_1Completion.html#a91b2575d4b0255074df1aff469ce6ca7" title="Get list of providers registered on completion. ">Gsv::Completion::get_providers()</a> </li>
<li>
<a class="el" href="classGsv_1_1Completion.html#a1e6d91624ab8e229db7f4fb921a61008" title="Starts a new completion with the specified CompletionContext and a list of potential candidate provid...">Gsv::Completion::show()</a> </li>
<li>
<a class="el" href="classGsv_1_1CompletionContext.html#ab50b8b9871c61748b85f9a6a3c081009" title="Providers can use this function to add proposals to the completion. ">Gsv::CompletionContext::add_proposals()</a> </li>
<li>
<a class="el" href="classGsv_1_1Language.html#a3161fa1dce4f0af4fd4fdd6c598421a1" title="Returns the mime types associated to this language. ">Gsv::Language::get_mime_types()</a> </li>
<li>
<a class="el" href="classGsv_1_1Language.html#a5b6dea625ec414f1000a33d5a38f2bde" title="Returns the globs associated to this language. ">Gsv::Language::get_globs()</a> </li>
<li>
<a class="el" href="classGsv_1_1Language.html#a6b41ff4541ca063760001d7db0d6a662" title="Returns the ids of the styles defined by this language. ">Gsv::Language::get_style_ids()</a> </li>
<li>
<a class="el" href="classGsv_1_1LanguageManager.html#a7ca7ee1059f086a01ef805ef5931486b" title="Gets the list directories where language manager looks for language files. ">Gsv::LanguageManager::get_search_path()</a> </li>
<li>
<a class="el" href="classGsv_1_1LanguageManager.html#ac524730cff2f25a747f18deaf5e621f9" title="Sets the list of directories where the language manager looks for language files. ...">Gsv::LanguageManager::set_search_path()</a> </li>
<li>
<a class="el" href="classGsv_1_1LanguageManager.html#ae691cb6f6d331677225894641db360b0" title="Returns the ids of the available languages. ">Gsv::LanguageManager::get_language_ids()</a> </li>
<li>
<a class="el" href="classGsv_1_1StyleScheme.html#a01e6a247249fb4c0b7919b049beaf518" title="Gets scheme authors. ">Gsv::StyleScheme::get_authors()</a> </li>
<li>
<a class="el" href="classGsv_1_1StyleSchemeManager.html#a1137bd67ce073bc2768600b69c83b75c" title="Returns the current search path for the manager. ">Gsv::StyleSchemeManager::get_search_path()</a> </li>
<li>
<a class="el" href="classGsv_1_1StyleSchemeManager.html#abba091f6530fc57678a8dc1003bd9c0a" title="Sets the list of directories where the manager looks for style scheme files. ">Gsv::StyleSchemeManager::set_search_path()</a> </li>
<li>
<a class="el" href="classGsv_1_1StyleSchemeManager.html#ae6fd9e8fa78bf322b24436ac0d89957f" title="Returns the ids of the available style schemes. ">Gsv::StyleSchemeManager::get_scheme_ids()</a> </li>
</ul>
</em></li>
<li>
<em><a class="el" href="classGsv_1_1Markup.html" title="It is just a class holding markup string. ">Gsv::Markup</a> now has operator const void</em> instead of operator bool, so implicit casts to int are avoided. </li>
</ul>
</div></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Tue Sep 22 2015 13:28:09 for gtksourceviewmm by  <a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.9.1
</small></address>
</body>
</html>
|