libvtemm r6 - in trunk: . src/libvtemm src/libvtemm/g
- From: krnowak svn gnome org
- To: svn-commits-list gnome org
- Subject: libvtemm r6 - in trunk: . src/libvtemm src/libvtemm/g
- Date: Sun, 29 Mar 2009 15:19:04 +0000 (UTC)
Author: krnowak
Date: Sun Mar 29 15:19:03 2009
New Revision: 6
URL: http://svn.gnome.org/viewvc/libvtemm?rev=6&view=rev
Log:
added const version of getters
Modified:
trunk/ChangeLog
trunk/TODO
trunk/src/libvtemm/g/terminal.ccg
trunk/src/libvtemm/g/terminal.hg
trunk/src/libvtemm/textandcharattrs.cc
trunk/src/libvtemm/textandcharattrs.h
Modified: trunk/TODO
==============================================================================
--- trunk/TODO (original)
+++ trunk/TODO Sun Mar 29 15:19:03 2009
@@ -1,3 +1,8 @@
+src/libvtemm/g/terminal.(h|cc)g:
+ remove nonconst getter functions, when it will be possible.
+ fix possible memleaks in get_text functions.
+src/libvtemm/textandcharattrs.(h|cc):
+ remove nonconst getter functions, when it will be possible.
src/libvtemm/g/*.(h|cc)g:
src/libvtemm/*.(cc|h):
squashing bugs. as always.
Modified: trunk/src/libvtemm/g/terminal.ccg
==============================================================================
--- trunk/src/libvtemm/g/terminal.ccg (original)
+++ trunk/src/libvtemm/g/terminal.ccg Sun Mar 29 15:19:03 2009
@@ -62,6 +62,11 @@
return TextAndCharAttrs(text, attributes);
}
+TextAndCharAttrs Terminal::get_text(const Gnome::Vte::Terminal::SlotSelectedCallback& slot) const
+{
+ return const_cast<Terminal*>(this)->get_text(slot);
+}
+
TextAndCharAttrs Terminal::get_text_include_trailing_spaces(const Gnome::Vte::Terminal::SlotSelectedCallback& slot)
{
GArray* array = g_array_new(FALSE, FALSE, sizeof(struct _VteCharAttributes));
@@ -72,6 +77,11 @@
return TextAndCharAttrs(text, attributes);
}
+TextAndCharAttrs Terminal::get_text_include_trailing_spaces(const Gnome::Vte::Terminal::SlotSelectedCallback& slot) const
+{
+ return const_cast<Terminal*>(this)->get_text_include_trailing_spaces(slot);
+}
+
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));
@@ -82,6 +92,11 @@
return TextAndCharAttrs(text, attributes);
}
+TextAndCharAttrs Terminal::get_text_range(long start_row, long start_col, long end_row, long end_col, const Gnome::Vte::Terminal::SlotSelectedCallback& slot) const
+{
+ return const_cast<Terminal*>(this)->get_text_range(start_row, start_col, end_row, end_col, slot);
+}
+
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 15:19:03 2009
@@ -74,8 +74,10 @@
_WRAP_METHOD(void set_audible_bell(bool is_audible), vte_terminal_set_audible_bell)
_WRAP_METHOD(bool get_audible_bell(), vte_terminal_get_audible_bell)
+ _WRAP_METHOD(bool get_audible_bell() const, vte_terminal_get_audible_bell, constversion)
_WRAP_METHOD(void set_visible_bell(bool is_visible), vte_terminal_set_visible_bell)
_WRAP_METHOD(bool get_visible_bell(), vte_terminal_get_visible_bell)
+ _WRAP_METHOD(bool get_visible_bell() const, vte_terminal_get_visible_bell, constversion)
_WRAP_METHOD(void set_scroll_background(bool scroll), vte_terminal_set_scroll_background)
_WRAP_METHOD(void set_scroll_on_output(bool scroll), vte_terminal_set_scroll_on_output)
_WRAP_METHOD(void set_scroll_on_keystroke(bool scroll), vte_terminal_set_scroll_on_keystroke)
@@ -101,9 +103,11 @@
_WRAP_METHOD(void set_cursor_blinks(bool blink), vte_terminal_set_cursor_blinks, deprecated "Use set_cursor_blink_mode instead")
_WRAP_METHOD(void set_cursor_blink_mode(TerminalCursorBlinkMode mode), vte_terminal_set_cursor_blink_mode)
_WRAP_METHOD(TerminalCursorBlinkMode get_cursor_blink_mode(), vte_terminal_get_cursor_blink_mode)
+ _WRAP_METHOD(TerminalCursorBlinkMode get_cursor_blink_mode() const, vte_terminal_get_cursor_blink_mode, constversion)
_WRAP_METHOD(void set_cursor_shape(TerminalCursorShape shape), vte_terminal_set_cursor_shape)
_WRAP_METHOD(TerminalCursorShape get_cursor_shape(), vte_terminal_get_cursor_shape)
+ _WRAP_METHOD(TerminalCursorShape get_cursor_shape() const, vte_terminal_get_cursor_shape, constversion)
_WRAP_METHOD(void set_scrollback_lines(long lines), vte_terminal_set_scrollback_lines)
@@ -114,11 +118,15 @@
_WRAP_METHOD(void set_font_from_string(const Glib::ustring& name), vte_terminal_set_font_from_string)
_WRAP_METHOD(void set_font_from_string_full(const Glib::ustring name, TerminalAntiAlias antialias), vte_terminal_set_font_from_string_full, deprecated)
_WRAP_METHOD(const Pango::FontDescription get_font(), vte_terminal_get_font)
+ _WRAP_METHOD(const Pango::FontDescription get_font() const, vte_terminal_get_font, constversion)
_WRAP_METHOD(bool get_using_xft(), vte_terminal_get_using_xft, deprecated)
+ _WRAP_METHOD(bool get_using_xft() const, vte_terminal_get_using_xft, constversion, deprecated)
_WRAP_METHOD(void set_allow_bold(bool allow_bold), vte_terminal_set_allow_bold)
_WRAP_METHOD(bool get_allow_bold(), vte_terminal_get_allow_bold)
+ _WRAP_METHOD(bool get_allow_bold() const, vte_terminal_get_allow_bold, constversion)
_WRAP_METHOD(bool get_has_selection(), vte_terminal_get_has_selection)
+ _WRAP_METHOD(bool get_has_selection() const, vte_terminal_get_has_selection, constversion)
_WRAP_METHOD(void set_word_chars(const Glib::ustring& spec), vte_terminal_set_word_chars)
_WRAP_METHOD(bool is_word_char(gunichar c), vte_terminal_is_word_char)
@@ -127,19 +135,23 @@
_WRAP_METHOD(void set_delete_binding(TerminalEraseBinding binding), vte_terminal_set_delete_binding)
_WRAP_METHOD(void set_mouse_autohide(bool setting), vte_terminal_set_mouse_autohide)
- _WRAP_METHOD(bool get_mouse_autohide(), vte_terminal_get_mouse_autohide)
+ _WRAP_METHOD(bool get_mouse_autohide() const, vte_terminal_get_mouse_autohide, constversion)
_WRAP_METHOD(void reset(bool full, bool clear_history), vte_terminal_reset)
typedef sigc::slot<bool, Terminal& /* terminal */, long /* column */, long /* row */> SlotSelectedCallback;
_WRAP_METHOD_DOCS_ONLY(vte_terminal_get_text)
TextAndCharAttrs get_text(const SlotSelectedCallback& slot);
+ TextAndCharAttrs get_text(const SlotSelectedCallback& slot) const;
_WRAP_METHOD_DOCS_ONLY(vte_terminal_get_text_include_trailing_spaces)
TextAndCharAttrs get_text_include_trailing_spaces(const SlotSelectedCallback& slot);
+ TextAndCharAttrs get_text_include_trailing_spaces(const SlotSelectedCallback& slot) const;
_WRAP_METHOD_DOCS_ONLY(vte_terminal_get_text_range)
TextAndCharAttrs get_text_range(long start_row, long start_col, long end_row, long end_col, const SlotSelectedCallback& slot);
+ TextAndCharAttrs get_text_range(long start_row, long start_col, long end_row, long end_col, const SlotSelectedCallback& slot) const;
_IGNORE(vte_terminal_get_text, vte_terminal_get_text_include_trailing_spaces, vte_terminal_get_text_range)
_WRAP_METHOD(void get_cursor_position(long& column, long& row), vte_terminal_get_cursor_position)
+ _WRAP_METHOD(void get_cursor_position(long& column, long& row) const, vte_terminal_get_cursor_position, constversion)
_WRAP_METHOD(void match_clear_all(), vte_terminal_match_clear_all)
@@ -156,29 +168,45 @@
_WRAP_METHOD(void set_emulation(const Glib::ustring& emulation), vte_terminal_set_emulation)
_WRAP_METHOD(const Glib::ustring get_emulation(), vte_terminal_get_emulation)
+ _WRAP_METHOD(const Glib::ustring get_emulation() const, vte_terminal_get_emulation, constversion)
_WRAP_METHOD(const Glib::ustring get_default_emulation(), vte_terminal_get_default_emulation)
+ _WRAP_METHOD(const Glib::ustring get_default_emulation() const, vte_terminal_get_default_emulation, constversion)
_WRAP_METHOD(void set_encoding(const Glib::ustring& codeset), vte_terminal_set_encoding)
_WRAP_METHOD(const Glib::ustring get_encoding(), vte_terminal_get_encoding)
+ _WRAP_METHOD(const Glib::ustring get_encoding() const, vte_terminal_get_encoding, constversion)
_WRAP_METHOD(const Glib::ustring get_status_line(), vte_terminal_get_status_line)
+ _WRAP_METHOD(const Glib::ustring get_status_line() const, vte_terminal_get_status_line, constversion)
_WRAP_METHOD(void get_padding(int& xpad, int& ypad), vte_terminal_get_padding)
+ _WRAP_METHOD(void get_padding(int& xpad, int& ypad) const, vte_terminal_get_padding, constversion)
_WRAP_METHOD(void set_pty(int pty_master), vte_terminal_set_pty)
_WRAP_METHOD(int get_pty(), vte_terminal_get_pty)
+ _WRAP_METHOD(int get_pty() const, vte_terminal_get_pty, constversion)
_WRAP_METHOD(Gtk::Adjustment* get_adjustment(), vte_terminal_get_adjustment)
+ _WRAP_METHOD(Gtk::Adjustment const* get_adjustment() const, vte_terminal_get_adjustment, constversion)
_WRAP_METHOD(long get_char_width(), vte_terminal_get_char_width)
+ _WRAP_METHOD(long get_char_width() const, vte_terminal_get_char_width, constversion)
_WRAP_METHOD(long get_char_height(), vte_terminal_get_char_height)
+ _WRAP_METHOD(long get_char_height() const, vte_terminal_get_char_height, constversion)
_WRAP_METHOD(long get_char_descent(), vte_terminal_get_char_descent, deprecated)
+ _WRAP_METHOD(long get_char_descent() const, vte_terminal_get_char_descent, deprecated, constversion)
_WRAP_METHOD(long get_char_ascent(), vte_terminal_get_char_ascent, deprecated)
+ _WRAP_METHOD(long get_char_ascent() const, vte_terminal_get_char_ascent, deprecated, constversion)
_WRAP_METHOD(long get_row_count(), vte_terminal_get_row_count)
+ _WRAP_METHOD(long get_row_count() const, vte_terminal_get_row_count, constversion)
_WRAP_METHOD(long get_column_count(), vte_terminal_get_column_count)
+ _WRAP_METHOD(long get_column_count() const, vte_terminal_get_column_count, constversion)
_WRAP_METHOD(const Glib::ustring get_window_title(), vte_terminal_get_window_title)
+ _WRAP_METHOD(const Glib::ustring get_window_title() const, vte_terminal_get_window_title, constversion)
_WRAP_METHOD(const Glib::ustring get_icon_title(), vte_terminal_get_icon_title)
+ _WRAP_METHOD(const Glib::ustring get_icon_title() const, vte_terminal_get_icon_title, constversion)
_WRAP_METHOD(int get_child_exit_status(), vte_terminal_get_child_exit_status)
+ _WRAP_METHOD(int get_child_exit_status() const, vte_terminal_get_child_exit_status, const)
_WRAP_SIGNAL(void eof(), "eof")
_WRAP_SIGNAL(void child_exited(), "child-exited")
Modified: trunk/src/libvtemm/textandcharattrs.cc
==============================================================================
--- trunk/src/libvtemm/textandcharattrs.cc (original)
+++ trunk/src/libvtemm/textandcharattrs.cc Sun Mar 29 15:19:03 2009
@@ -41,11 +41,21 @@
return text;
}
+inline Glib::ustring TextAndCharAttrs::get_text() const
+{
+ return text;
+}
+
inline ArrayHandle_CharAttributes TextAndCharAttrs::get_attributes()
{
return attributes;
}
+inline ArrayHandle_CharAttributes TextAndCharAttrs::get_attributes() const
+{
+ return attributes;
+}
+
} // namespace Vte
} // namespace Gnome
Modified: trunk/src/libvtemm/textandcharattrs.h
==============================================================================
--- trunk/src/libvtemm/textandcharattrs.h (original)
+++ trunk/src/libvtemm/textandcharattrs.h Sun Mar 29 15:19:03 2009
@@ -47,10 +47,18 @@
* @return Stored string.
*/
Glib::ustring get_text();
+/** Gets stored string.
+ * @return Stored string.
+ */
+ Glib::ustring get_text() const;
/** Gets stored attributes.
* @return Stored attributes.
*/
ArrayHandle_CharAttributes get_attributes();
+/** Gets stored attributes.
+ * @return Stored attributes.
+ */
+ ArrayHandle_CharAttributes get_attributes() const;
// well, setters are not needed.
};
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]