libvtemm r7 - in trunk: . src/libvtemm/g



Author: krnowak
Date: Sun Mar 29 18:38:07 2009
New Revision: 7
URL: http://svn.gnome.org/viewvc/libvtemm?rev=7&view=rev

Log:
fixed memleaks and stuff

Modified:
   trunk/ChangeLog
   trunk/NEWS
   trunk/TODO
   trunk/autogen.sh
   trunk/configure.ac
   trunk/src/libvtemm/g/libvte_docs_override.xml
   trunk/src/libvtemm/g/terminal.ccg
   trunk/src/libvtemm/g/terminal.hg

Modified: trunk/NEWS
==============================================================================
--- trunk/NEWS	(original)
+++ trunk/NEWS	Sun Mar 29 18:38:07 2009
@@ -6,3 +6,8 @@
 0.20.1
 
 * most changes backported from 0.19.1. (Krzesimir Nowak)
+
+0.20.2
+
+* added new API (const getter methods) and fixed some memleaks.
+  (Krzesimir Nowak)

Modified: trunk/TODO
==============================================================================
--- trunk/TODO	(original)
+++ trunk/TODO	Sun Mar 29 18:38:07 2009
@@ -1,8 +1,9 @@
 src/libvtemm/g/terminal.(h|cc)g:
-	remove nonconst getter functions, when it will be possible.
-	fix possible memleaks in get_text functions.
+	1. wrap commit signal by hand, when it will be possible.
+	("char, int" -> ("std::string"|"Glib::ustring"))
+	2. remove nonconst getter functions, when it will be possible.
 src/libvtemm/textandcharattrs.(h|cc):
-	remove nonconst getter functions, when it will be possible.
+	1. remove nonconst getter functions, when it will be possible.
 src/libvtemm/g/*.(h|cc)g:
 src/libvtemm/*.(cc|h):
-	squashing bugs. as always.
+	1. squashing bugs. as always.

Modified: trunk/autogen.sh
==============================================================================
--- trunk/autogen.sh	(original)
+++ trunk/autogen.sh	Sun Mar 29 18:38:07 2009
@@ -9,7 +9,7 @@
 fi
 
 echo "Running autoreconf."
-autoreconf -v -i -s -f || exit $?
+autoreconf -v -i -s || exit $?
 echo "Running configure."
 ./configure "$@" || exit $?
 echo

Modified: trunk/configure.ac
==============================================================================
--- trunk/configure.ac	(original)
+++ trunk/configure.ac	Sun Mar 29 18:38:07 2009
@@ -16,7 +16,7 @@
 #########################################################################
 m4_define([PACKAGEMM_MAJOR_VERSION], [0])
 m4_define([PACKAGEMM_MINOR_VERSION], [20])
-m4_define([PACKAGEMM_MICRO_VERSION], [1])
+m4_define([PACKAGEMM_MICRO_VERSION], [2])
 m4_define([PACKAGEMM_RELEASE], [PACKAGEMM_MAJOR_VERSION.PACKAGEMM_MINOR_VERSION])
 m4_define([PACKAGEMM_VERSION], [PACKAGEMM_RELEASE.PACKAGEMM_MICRO_VERSION])
 m4_define([PACKAGEMM_API_MAJOR_VERSION], [1])
@@ -26,6 +26,7 @@
 m4_define([PACKAGEMM_NAME], [lib]PACKAGEMM_C_NAME[mm])
 AC_INIT(PACKAGEMM_NAME, PACKAGEMM_VERSION, [krnowak svn gnome org])
 AC_CONFIG_SRCDIR([src/]PACKAGEMM_NAME[.h])
+AC_CONFIG_MACRO_DIR([scripts])
 
 #
 # +1 : ? : +1  == new interface that does not break old one
@@ -34,7 +35,7 @@
 #  ? :+1 : ?   == just some internal changes, nothing breaks but might work 
 #                 better
 # CURRENT : REVISION : AGE
-LIBVTEMM_SO_VERSION=5:0:3
+LIBVTEMM_SO_VERSION=6:0:4
 
 AC_SUBST([LIBVTEMM_SO_VERSION])
 

Modified: trunk/src/libvtemm/g/libvte_docs_override.xml
==============================================================================
--- trunk/src/libvtemm/g/libvte_docs_override.xml	(original)
+++ trunk/src/libvtemm/g/libvte_docs_override.xml	Sun Mar 29 18:38:07 2009
@@ -287,4 +287,40 @@
 </return>
 </function>
 
+<function name="vte_terminal_match_check">
+<description>
+Checks if the text in and around the specified position matches any of the
+regular expressions previously set using vte_terminal_match_add().  If a
+match exists, the text string is returned and the number associated with
+the matched regular expression will be stored in @tag.
+
+If more than one regular expression has been set with
+vte_terminal_match_add(), then expressions are checked in the order in
+which they were added.
+
+
+</description>
+<parameters>
+<parameter name="terminal">
+<parameter_description> a #VteTerminal
+</parameter_description>
+</parameter>
+<parameter name="column">
+<parameter_description> the text column
+</parameter_description>
+</parameter>
+<parameter name="row">
+<parameter_description> the text row
+</parameter_description>
+</parameter>
+<parameter name="tag">
+<parameter_description> pointer to an integer
+</parameter_description>
+</parameter>
+</parameters>
+<return> a string which matches one of the previously set regular
+expressions.
+</return>
+</function>
+
 </root>

Modified: trunk/src/libvtemm/g/terminal.ccg
==============================================================================
--- trunk/src/libvtemm/g/terminal.ccg	(original)
+++ trunk/src/libvtemm/g/terminal.ccg	Sun Mar 29 18:38:07 2009
@@ -55,9 +55,10 @@
 TextAndCharAttrs Terminal::get_text(const Gnome::Vte::Terminal::SlotSelectedCallback& slot)
 {
   GArray* array = g_array_new(FALSE, FALSE, sizeof(VteCharAttributes));
-  Glib::ustring text(vte_terminal_get_text(gobj(), &Private::SignalProxy_selected_gtk_callback, const_cast<Gnome::Vte::Terminal::SlotSelectedCallback*>(&slot), array));
-  // shallow, because release_c_type function body is empty, so there's no use of deep ownership.
-  ArrayHandle_CharAttributes attributes(reinterpret_cast<VteCharAttributes*>(array->data), array->len, Glib::OWNERSHIP_SHALLOW);
+  char* c_text = vte_terminal_get_text(gobj(), &Private::SignalProxy_selected_gtk_callback, const_cast<Gnome::Vte::Terminal::SlotSelectedCallback*>(&slot), array);
+  Glib::ustring text(c_text);
+  g_free(c_text);
+  ArrayHandle_CharAttributes attributes(reinterpret_cast<VteCharAttributes*>(array->data), array->len, Glib::OWNERSHIP_DEEP);
   g_array_free(array, FALSE);
   return TextAndCharAttrs(text, attributes);
 }
@@ -70,9 +71,10 @@
 TextAndCharAttrs Terminal::get_text_include_trailing_spaces(const Gnome::Vte::Terminal::SlotSelectedCallback& slot)
 {
   GArray* array = g_array_new(FALSE, FALSE, sizeof(struct _VteCharAttributes));
-  Glib::ustring text(vte_terminal_get_text_include_trailing_spaces(gobj(), &Private::SignalProxy_selected_gtk_callback, const_cast<Gnome::Vte::Terminal::SlotSelectedCallback*>(&slot), array));
-  // shallow, because release_c_type function body is empty, so there's no use of deep ownership.
-  ArrayHandle_CharAttributes attributes(reinterpret_cast<VteCharAttributes*>(array->data), static_cast<size_t>(array->len), Glib::OWNERSHIP_SHALLOW);
+  char* c_text = vte_terminal_get_text_include_trailing_spaces(gobj(), &Private::SignalProxy_selected_gtk_callback, const_cast<Gnome::Vte::Terminal::SlotSelectedCallback*>(&slot), array);
+  Glib::ustring text(c_text);
+  g_free(c_text);
+  ArrayHandle_CharAttributes attributes(reinterpret_cast<VteCharAttributes*>(array->data), static_cast<size_t>(array->len), Glib::OWNERSHIP_DEEP);
   g_array_free(array, FALSE);
   return TextAndCharAttrs(text, attributes);
 }
@@ -85,9 +87,10 @@
 TextAndCharAttrs Terminal::get_text_range(long start_row, long start_col, long end_row, long end_col, const Gnome::Vte::Terminal::SlotSelectedCallback& slot)
 {
   GArray* array = g_array_new(FALSE, FALSE, sizeof(struct _VteCharAttributes));
-  Glib::ustring text(vte_terminal_get_text_range(gobj(), start_row, start_col, end_row, end_col, &Private::SignalProxy_selected_gtk_callback, const_cast<Gnome::Vte::Terminal::SlotSelectedCallback*>(&slot), array));
-  // shallow, because release_c_type function body is empty, so there's no use of deep ownership.
-  ArrayHandle_CharAttributes attributes(reinterpret_cast<VteCharAttributes*>(array->data), static_cast<size_t>(array->len), Glib::OWNERSHIP_SHALLOW);
+  char* c_text = vte_terminal_get_text_range(gobj(), start_row, start_col, end_row, end_col, &Private::SignalProxy_selected_gtk_callback, const_cast<Gnome::Vte::Terminal::SlotSelectedCallback*>(&slot), array);
+  Glib::ustring text(c_text);
+  g_free(c_text);
+  ArrayHandle_CharAttributes attributes(reinterpret_cast<VteCharAttributes*>(array->data), static_cast<size_t>(array->len), Glib::OWNERSHIP_DEEP);
   g_array_free(array, FALSE);
   return TextAndCharAttrs(text, attributes);
 }
@@ -97,6 +100,14 @@
 	return const_cast<Terminal*>(this)->get_text_range(start_row, start_col, end_row, end_col, slot);
 }
 
+Glib::ustring Terminal::match_check(long column, long row, int& tag)
+{
+	char* c_text = vte_terminal_match_check(gobj(), column, row, &tag);
+	Glib::ustring text(c_text);
+	g_free(c_text);
+	return text;
+}
+
 void Terminal::set_colors(const Gdk::Color& foreground, const Gdk::Color& background, const Gdk::ArrayHandle_Color& palette)
 {
   vte_terminal_set_colors(gobj(), foreground.gobj(), background.gobj(), palette.data(), palette.size());

Modified: trunk/src/libvtemm/g/terminal.hg
==============================================================================
--- trunk/src/libvtemm/g/terminal.hg	(original)
+++ trunk/src/libvtemm/g/terminal.hg	Sun Mar 29 18:38:07 2009
@@ -164,7 +164,9 @@
 
   _WRAP_METHOD(void match_remove(int tag), vte_terminal_match_remove)
 
-  _WRAP_METHOD(Glib::ustring match_check(long column, long row, int& tag), vte_terminal_match_check)
+  _WRAP_METHOD_DOCS_ONLY(vte_terminal_match_check)
+  Glib::ustring match_check(long column, long row, int& tag);
+  _IGNORE(vte_terminal_match_check)
 
   _WRAP_METHOD(void set_emulation(const Glib::ustring& emulation), vte_terminal_set_emulation)
   _WRAP_METHOD(const Glib::ustring get_emulation(), vte_terminal_get_emulation)



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]