amyedit-1.0-sourceviewmm2.patch 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332
  1. Index: amyedit-1.0/configure.in
  2. ===================================================================
  3. --- amyedit-1.0.orig/configure.in
  4. +++ amyedit-1.0/configure.in
  5. @@ -36,7 +36,7 @@ AC_ARG_ENABLE(precompiled-headers,
  6. AM_CONDITIONAL(PRECOMPILE_HEADERS, test x$enable_precompiled_headers = xyes)
  7. AC_CHECK_LIB([aspell], [new_aspell_config])
  8. -PKG_CHECK_MODULES(AMYEDIT, gtkmm-2.4 >= 2.6 gtksourceview-1.0)
  9. +PKG_CHECK_MODULES(AMYEDIT, gtkmm-2.4 >= 2.6 gtksourceview-2.0 gtksourceviewmm-2.0)
  10. AC_SUBST(AMYEDIT_CFLAGS)
  11. AC_SUBST(AMYEDIT_LIBS)
  12. Index: amyedit-1.0/src/Makefile.am
  13. ===================================================================
  14. --- amyedit-1.0.orig/src/Makefile.am
  15. +++ amyedit-1.0/src/Makefile.am
  16. @@ -25,12 +25,7 @@ sources = \
  17. TextListViewComboBox.cc \
  18. TextListViewListBox.cc \
  19. Utils.cc \
  20. - main.cc \
  21. - gtksourceviewmm/sourcebuffer.cpp \
  22. - gtksourceviewmm/sourcelanguage.cpp \
  23. - gtksourceviewmm/sourcelanguagesmanager.cpp \
  24. - gtksourceviewmm/sourceview.cpp \
  25. - gtksourceviewmm/init.cc
  26. + main.cc
  27. headers = \
  28. AboutDialog.hh \
  29. @@ -48,18 +43,9 @@ headers = \
  30. TextListModel.hh \
  31. TextListViewComboBox.hh \
  32. TextListViewListBox.hh \
  33. - Utils.hh \
  34. - gtksourceviewmm/sourcebuffer.h \
  35. - gtksourceviewmm/sourcelanguage.h \
  36. - gtksourceviewmm/sourcelanguagesmanager.h \
  37. - gtksourceviewmm/sourceview.h \
  38. - gtksourceviewmm/init.hh
  39. + Utils.hh
  40. privateheaders= \
  41. - gtksourceviewmm/private/sourcebuffer_p.h \
  42. - gtksourceviewmm/private/sourcelanguage_p.h \
  43. - gtksourceviewmm/private/sourcelanguagesmanager_p.h \
  44. - gtksourceviewmm/private/sourceview_p.h \
  45. Utils_p.hh
  46. if PRECOMPILE_HEADERS
  47. Index: amyedit-1.0/src/EditTabs.cc
  48. ===================================================================
  49. --- amyedit-1.0.orig/src/EditTabs.cc
  50. +++ amyedit-1.0/src/EditTabs.cc
  51. @@ -57,8 +57,8 @@ Foundation, Inc., 59 Temple Place, Suite
  52. #include <gtksourceview/gtksourcebuffer.h>
  53. #include <gtksourceviewmm/sourcelanguage.h>
  54. -#include <gtksourceviewmm/sourcelanguagesmanager.h>
  55. -#include <gtksourceview/gtksourcelanguagesmanager.h>
  56. +#include <gtksourceviewmm/sourcelanguagemanager.h>
  57. +#include <gtksourceview/gtksourcelanguagemanager.h>
  58. #include <gtksourceview/gtksourceiter.h>
  59. #include <gtkmm/stock.h>
  60. @@ -161,7 +161,7 @@ void EditTabs::OpenTab(Glib::ustring fil
  61. {
  62. try
  63. {
  64. - Glib::RefPtr<Gtk::SourceBuffer> buffer = is_buffer_open(filename);
  65. + Glib::RefPtr<gtksourceview::SourceBuffer> buffer = is_buffer_open(filename);
  66. Page *newpage;
  67. if (buffer){
  68. @@ -553,16 +553,15 @@ Glib::ustring EditTabs::GetUntitledTabNa
  69. void EditTabs::Undo()
  70. {
  71. - Glib::RefPtr<Gtk::SourceBuffer> buffer = get_current_view()->get_buffer();
  72. + Glib::RefPtr<gtksourceview::SourceBuffer> buffer = Glib::RefPtr<gtksourceview::SourceBuffer>::cast_static(get_current_view()->get_buffer());
  73. if (buffer->can_undo ())
  74. buffer->undo ();
  75. }
  76. -
  77. void EditTabs::Redo()
  78. {
  79. - Glib::RefPtr<Gtk::SourceBuffer> buffer = get_current_view()->get_buffer();
  80. + Glib::RefPtr<gtksourceview::SourceBuffer> buffer = Glib::RefPtr<gtksourceview::SourceBuffer>::cast_static(get_current_view()->get_buffer());
  81. if (buffer->can_redo ())
  82. buffer->redo ();
  83. @@ -625,10 +624,10 @@ void EditTabs::FindNext()
  84. Page *curtab = get_current_tab();
  85. if (curtab)
  86. {
  87. - Glib::RefPtr<Gtk::SourceBuffer::Mark> cursor=curtab->get_buffer()->get_insert();
  88. - Gtk::SourceBuffer::iterator start, end;
  89. + Glib::RefPtr<gtksourceview::SourceBuffer::Mark> cursor=curtab->get_buffer()->get_insert();
  90. + gtksourceview::SourceBuffer::iterator start, end;
  91. GtkTextIter climit;
  92. - Gtk::SourceBuffer::iterator limit(&climit);
  93. + gtksourceview::SourceBuffer::iterator limit(&climit);
  94. FindDialog fdialog;
  95. int result;
  96. do
  97. @@ -648,7 +647,7 @@ void EditTabs::FindNext()
  98. if(gtk_source_iter_forward_search(cursor->get_iter().gobj(),fdialog.get_text().c_str(),fdialog.get_flags(),start.gobj(),end.gobj(),0))
  99. {
  100. curtab->get_buffer()->select_range(end, start);
  101. - (static_cast<Gtk::SourceView*>(curtab->get_child()))->scroll_to(end);
  102. + (static_cast<gtksourceview::SourceView*>(curtab->get_child()))->scroll_to(end);
  103. }
  104. else
  105. {
  106. @@ -701,7 +700,7 @@ void EditTabs::on_switching_page(GtkNote
  107. }
  108. -Glib::RefPtr <Gtk::SourceBuffer> EditTabs::is_buffer_open(Glib::ustring filename){
  109. +Glib::RefPtr <gtksourceview::SourceBuffer> EditTabs::is_buffer_open(Glib::ustring filename){
  110. int p = get_n_pages();
  111. for (int x=0;x<p;x++){
  112. @@ -711,19 +710,19 @@ Glib::RefPtr <Gtk::SourceBuffer> EditTab
  113. return curtab->get_buffer();
  114. }
  115. - return Glib::RefPtr <Gtk::SourceBuffer> (NULL);
  116. + return Glib::RefPtr <gtksourceview::SourceBuffer> (NULL);
  117. }
  118. -EditTabs::Page::Page(EditTabs *parent, Glib::RefPtr<Gtk::SourceBuffer> buffer){
  119. +EditTabs::Page::Page(EditTabs *parent, Glib::RefPtr<gtksourceview::SourceBuffer> buffer){
  120. /* Note to self! CLEAN THIS UP!!!! */
  121. /* Page is actually a ScrollWindow thing */
  122. set_policy(Gtk::POLICY_AUTOMATIC, Gtk::POLICY_ALWAYS);
  123. - Gtk::SourceView *sourceview=Gtk::manage(new Gtk::SourceView());
  124. + gtksourceview::SourceView *sourceview=Gtk::manage(new gtksourceview::SourceView());
  125. if (buffer)
  126. sourceview->set_buffer(buffer);
  127. @@ -750,10 +749,10 @@ EditTabs::Page::Page(EditTabs *parent, G
  128. * (ie buffer is null) */
  129. if (!buffer){
  130. - Glib::ustring mime_type("text/x-tex");
  131. + Glib::ustring mime_type("latex");
  132. - Glib::RefPtr<Gtk::SourceLanguagesManager> lm = buffer->get_languages_manager();
  133. - Glib::RefPtr<Gtk::SourceLanguage> language = lm->get_language_from_mime_type(mime_type);
  134. + Glib::RefPtr<gtksourceview::SourceLanguageManager> lm = gtksourceview::SourceLanguageManager::create();
  135. + Glib::RefPtr<gtksourceview::SourceLanguage> language = lm->get_language(mime_type);
  136. if (language)
  137. @@ -820,7 +819,7 @@ void EditTabs::Page::on_changed()
  138. }
  139. -void EditTabs::Page::on_mark_changed(Gtk::SourceBuffer::iterator iter, Glib::RefPtr<Gtk::SourceBuffer::Mark> mark){
  140. +void EditTabs::Page::on_mark_changed(gtksourceview::SourceBuffer::iterator iter, Glib::RefPtr<gtksourceview::SourceBuffer::Mark> mark){
  141. if (mark->get_name()=="insert")
  142. {
  143. extern sigc::signal1<void, int> signal_line_set;
  144. @@ -835,14 +834,14 @@ EditTabs *EditTabs::Page::get_parent()
  145. return (static_cast<EditTabs*>(Gtk::Widget::get_parent()));
  146. }
  147. -Gtk::SourceView* EditTabs::Page::get_child()
  148. +gtksourceview::SourceView* EditTabs::Page::get_child()
  149. {
  150. - return (static_cast<Gtk::SourceView*>(Gtk::Bin::get_child()));
  151. + return (static_cast<gtksourceview::SourceView*>(Gtk::Bin::get_child()));
  152. }
  153. -Glib::RefPtr<Gtk::SourceBuffer> EditTabs::Page::get_buffer()
  154. +Glib::RefPtr<gtksourceview::SourceBuffer> EditTabs::Page::get_buffer()
  155. {
  156. - return (get_child()->get_buffer());
  157. + return Glib::RefPtr<gtksourceview::SourceBuffer>::cast_static(get_child()->get_buffer());
  158. }
  159. EditTabs::Page *EditTabs::get_current_tab()
  160. @@ -850,9 +849,9 @@ EditTabs::Page *EditTabs::get_current_ta
  161. return (static_cast<EditTabs::Page*>(get_nth_page(get_current_page())));
  162. }
  163. -Gtk::SourceView *EditTabs::get_current_view()
  164. +gtksourceview::SourceView *EditTabs::get_current_view()
  165. {
  166. - return (static_cast<Gtk::SourceView*>(get_current_tab()->get_child()));
  167. + return (static_cast<gtksourceview::SourceView*>(get_current_tab()->get_child()));
  168. }
  169. @@ -861,8 +860,8 @@ void EditTabs::Page::on_preferences_upda
  170. // For things that need to happen for all pages
  171. PrefStruct *prefs = PrefStruct::instance();
  172. - get_child()->set_tabs_width(prefs->get<int>("General", "tab_size"));
  173. - get_buffer()->set_highlight(prefs->get<bool>("General", "syntax_highlighting"));
  174. + get_child()->set_tab_width(prefs->get<int>("General", "tab_size"));
  175. + get_buffer()->set_highlight_syntax(prefs->get<bool>("General", "syntax_highlighting"));
  176. }
  177. Index: amyedit-1.0/src/EditTabs.hh
  178. ===================================================================
  179. --- amyedit-1.0.orig/src/EditTabs.hh
  180. +++ amyedit-1.0/src/EditTabs.hh
  181. @@ -63,11 +63,11 @@ class EditTabs: public Gtk::Notebook
  182. class Page:public Gtk::ScrolledWindow
  183. {
  184. public:
  185. - Page(EditTabs *parent, Glib::RefPtr<Gtk::SourceBuffer> buffer=Glib::RefPtr<Gtk::SourceBuffer>());
  186. + Page(EditTabs *parent, Glib::RefPtr<gtksourceview::SourceBuffer> buffer=Glib::RefPtr<gtksourceview::SourceBuffer>());
  187. EditTabs *get_parent();
  188. - Gtk::SourceView *get_child();
  189. - Glib::RefPtr<Gtk::SourceBuffer> get_buffer();
  190. + gtksourceview::SourceView *get_child();
  191. + Glib::RefPtr<gtksourceview::SourceBuffer> get_buffer();
  192. Glib::ustring filename;
  193. Gtk::Label *tablabel;
  194. @@ -77,8 +77,8 @@ class EditTabs: public Gtk::Notebook
  195. void on_close_me();
  196. void on_modified_changed();
  197. void on_changed();
  198. - void on_mark_changed(Gtk::SourceBuffer::iterator iter,
  199. - Glib::RefPtr<Gtk::SourceBuffer::Mark> mark);
  200. + void on_mark_changed(gtksourceview::SourceBuffer::iterator iter,
  201. + Glib::RefPtr<gtksourceview::SourceBuffer::Mark> mark);
  202. void on_preferences_update();
  203. };
  204. @@ -89,13 +89,13 @@ class EditTabs: public Gtk::Notebook
  205. Glib::ustring GetRootFileName();
  206. Glib::ustring TabNameFromFile(Glib::ustring start);
  207. Glib::ustring GetUntitledTabName(Glib::ustring start);
  208. - Glib::RefPtr<Gtk::SourceBuffer> is_buffer_open(Glib::ustring filename);
  209. + Glib::RefPtr<gtksourceview::SourceBuffer> is_buffer_open(Glib::ustring filename);
  210. void on_switching_page(GtkNotebookPage *page, guint number);
  211. public:
  212. Page *get_current_tab();
  213. private:
  214. - Gtk::SourceView *get_current_view();
  215. + gtksourceview::SourceView *get_current_view();
  216. void on_preferences_update();
  217. Index: amyedit-1.0/src/SpellDialog.cc
  218. ===================================================================
  219. --- amyedit-1.0.orig/src/SpellDialog.cc
  220. +++ amyedit-1.0/src/SpellDialog.cc
  221. @@ -267,9 +267,9 @@ int SpellDialog::checkDocument(){
  222. aspell_document_checker_reset(checker);
  223. view = getCurrentPage()->get_child();
  224. - buffer = view->get_buffer();
  225. + buffer = Glib::RefPtr<gtksourceview::SourceBuffer>::cast_static(view->get_buffer());
  226. - buffer->set_check_brackets(false);
  227. + buffer->set_highlight_matching_brackets(false);
  228. /* areastart has left gravity, arearight has right gravity, as inserts only
  229. * occur inside them, they should always mark the beginning and ends of the
  230. @@ -315,7 +315,7 @@ int SpellDialog::checkDocument(){
  231. buffer->delete_mark(areastart);
  232. buffer->delete_mark(areaend);
  233. - buffer->set_check_brackets(true);
  234. + buffer->set_highlight_matching_brackets(true);
  235. return 0;
  236. }
  237. @@ -370,7 +370,7 @@ bool SpellDialog::changeWord(AspellToken
  238. /* Close Clicked */
  239. buffer->place_cursor(wordend);
  240. - buffer->set_check_brackets();
  241. + buffer->set_highlight_matching_brackets();
  242. return false;
  243. }
  244. Index: amyedit-1.0/src/SpellDialog.hh
  245. ===================================================================
  246. --- amyedit-1.0.orig/src/SpellDialog.hh
  247. +++ amyedit-1.0/src/SpellDialog.hh
  248. @@ -49,8 +49,8 @@ class SpellDialog : public Gtk::Dialog,
  249. void on_preferences_update();
  250. - Gtk::SourceView* view;
  251. - Glib::RefPtr<Gtk::SourceBuffer> buffer;
  252. + gtksourceview::SourceView* view;
  253. + Glib::RefPtr<gtksourceview::SourceBuffer> buffer;
  254. Gtk::Entry misslabel;
  255. Gtk::Entry replaceentry;
  256. TextListViewListBox listbox;
  257. Index: amyedit-1.0/src/main.cc
  258. ===================================================================
  259. --- amyedit-1.0.orig/src/main.cc
  260. +++ amyedit-1.0/src/main.cc
  261. @@ -53,7 +53,7 @@
  262. #include <fstream>
  263. #include "AmyEdit.hh"
  264. -#include "gtksourceviewmm/init.hh"
  265. +#include "gtksourceviewmm/init.h"
  266. #include "Utils.hh"
  267. int main(int argc, char **argv)
  268. @@ -63,7 +63,7 @@ int main(int argc, char **argv)
  269. textdomain (GETTEXT_PACKAGE);
  270. Gtk::Main m(&argc, &argv);
  271. - Gtk::SourceViewmm_init();
  272. + gtksourceview::init();
  273. /* TODO This should probably be removed and created on demand */