[vte] Bug 573976 – Typedef pointer to function



commit 26ab9f6a8685f6f26d419dcefbade13f561e1585
Author: Krzesimir Nowak <krnowak svn gnome org>
Date:   Tue Jun 2 16:56:09 2009 -0400

    Bug 573976 â?? Typedef pointer to function
    
    Typedefed a pointer to function used in get_text methods and
    replaced those pointers with VteSelectionFunc. Documentation for
    VteSelectionFunc is also added.
---
 doc/reference/vte-sections.txt |    1 +
 src/vte.c                      |   48 ++++++++++++++++-----------------------
 src/vte.h                      |   20 ++++++----------
 3 files changed, 29 insertions(+), 40 deletions(-)

diff --git a/doc/reference/vte-sections.txt b/doc/reference/vte-sections.txt
index 6a8ca4e..edfa51b 100644
--- a/doc/reference/vte-sections.txt
+++ b/doc/reference/vte-sections.txt
@@ -68,6 +68,7 @@ vte_terminal_reset
 vte_terminal_get_text
 vte_terminal_get_text_include_trailing_spaces
 vte_terminal_get_text_range
+VteSelectionFunc
 vte_terminal_get_cursor_position
 vte_terminal_match_clear_all
 vte_terminal_match_add
diff --git a/src/vte.c b/src/vte.c
index 656eacd..b0971c7 100644
--- a/src/vte.c
+++ b/src/vte.c
@@ -93,19 +93,13 @@ static char *vte_terminal_get_text_range_maybe_wrapped(VteTerminal *terminal,
 						       glong end_row,
 						       glong end_col,
 						       gboolean wrap,
-						       gboolean(*is_selected)(VteTerminal *,
-									      glong,
-									      glong,
-									      gpointer),
+						       VteSelectionFunc is_selected,
 						       gpointer data,
 						       GArray *attributes,
 						       gboolean include_trailing_spaces);
 static char *vte_terminal_get_text_maybe_wrapped(VteTerminal *terminal,
 						 gboolean wrap,
-						 gboolean(*is_selected)(VteTerminal *,
-									glong,
-									glong,
-									gpointer),
+						 VteSelectionFunc is_selected,
 						 gpointer data,
 						 GArray *attributes,
 						 gboolean include_trailing_spaces);
@@ -5844,6 +5838,19 @@ vte_terminal_copy_cb(GtkClipboard *clipboard, GtkSelectionData *data,
 }
 
 /**
+ * VteSelectionFunc:
+ * @terminal: terminal in which the cell is.
+ * @column: column in which the cell is.
+ * @row: row in which the cell is.
+ * @data: user data.
+ *
+ * Specifies the type of a selection function used to check whether
+ * a cell has to be selected or not.
+ *
+ * Returns: %TRUE if cell has to be selected; %FALSE if otherwise.
+ */
+
+/**
  * vte_terminal_get_text_range:
  * @terminal: a #VteTerminal
  * @start_row: first row to search for data
@@ -5868,10 +5875,7 @@ char *
 vte_terminal_get_text_range(VteTerminal *terminal,
 			    glong start_row, glong start_col,
 			    glong end_row, glong end_col,
-			    gboolean(*is_selected)(VteTerminal *,
-						   glong,
-						   glong,
-						   gpointer),
+			    VteSelectionFunc is_selected,
 			    gpointer data,
 			    GArray *attributes)
 {
@@ -5891,10 +5895,7 @@ vte_terminal_get_text_range_maybe_wrapped(VteTerminal *terminal,
 					  glong start_row, glong start_col,
 					  glong end_row, glong end_col,
 					  gboolean wrap,
-					  gboolean(*is_selected)(VteTerminal *,
-								 glong,
-								 glong,
-								 gpointer),
+					  VteSelectionFunc is_selected,
 					  gpointer data,
 					  GArray *attributes,
 					  gboolean include_trailing_spaces)
@@ -6030,10 +6031,7 @@ vte_terminal_get_text_range_maybe_wrapped(VteTerminal *terminal,
 static char *
 vte_terminal_get_text_maybe_wrapped(VteTerminal *terminal,
 				    gboolean wrap,
-				    gboolean(*is_selected)(VteTerminal *,
-							   glong,
-							   glong,
-							   gpointer),
+				    VteSelectionFunc is_selected,
 				    gpointer data,
 				    GArray *attributes,
 				    gboolean include_trailing_spaces)
@@ -6072,10 +6070,7 @@ vte_terminal_get_text_maybe_wrapped(VteTerminal *terminal,
  */
 char *
 vte_terminal_get_text(VteTerminal *terminal,
-		      gboolean(*is_selected)(VteTerminal *,
-					     glong,
-					     glong,
-					     gpointer),
+		      VteSelectionFunc is_selected,
 		      gpointer data,
 		      GArray *attributes)
 {
@@ -6111,10 +6106,7 @@ vte_terminal_get_text(VteTerminal *terminal,
  */
 char *
 vte_terminal_get_text_include_trailing_spaces(VteTerminal *terminal,
-					      gboolean(*is_selected)(VteTerminal *,
-								     glong,
-								     glong,
-								     gpointer),
+					      VteSelectionFunc is_selected,
 					      gpointer data,
 					      GArray *attributes)
 {
diff --git a/src/vte.h b/src/vte.h
index 8ecb406..2c71735 100644
--- a/src/vte.h
+++ b/src/vte.h
@@ -191,6 +191,11 @@ struct vte_char_attributes {
 	guint underline:1, strikethrough:1;
 };
 
+typedef gboolean (*VteSelectionFunc)(VteTerminal *terminal,
+                                     glong column,
+                                     glong row,
+                                     gpointer data);
+
 /* The widget's type. */
 GType vte_terminal_get_type(void);
 
@@ -341,26 +346,17 @@ void vte_terminal_reset(VteTerminal *terminal, gboolean full,
  * Note that it will have one entry per byte, not per character, so indexes
  * should match up exactly. */
 char *vte_terminal_get_text(VteTerminal *terminal,
-			    gboolean(*is_selected)(VteTerminal *terminal,
-						   glong column,
-						   glong row,
-						   gpointer data),
+			    VteSelectionFunc is_selected,
 			    gpointer data,
 			    GArray *attributes);
 char *vte_terminal_get_text_include_trailing_spaces(VteTerminal *terminal,
-						    gboolean(*is_selected)(VteTerminal *terminal,
-									   glong column,
-									   glong row,
-									   gpointer data),
+						    VteSelectionFunc is_selected,
 						    gpointer data,
 						    GArray *attributes);
 char *vte_terminal_get_text_range(VteTerminal *terminal,
 				  glong start_row, glong start_col,
 				  glong end_row, glong end_col,
-				  gboolean(*is_selected)(VteTerminal *terminal,
-							 glong column,
-							 glong row,
-							 gpointer data),
+				  VteSelectionFunc is_selected,
 				  gpointer data,
 				  GArray *attributes);
 void vte_terminal_get_cursor_position(VteTerminal *terminal,



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