[geany/geany] 6d663c: Change all scintilla_send_message calls to use SSM macro

Matthew Brush git-noreply at xxxxx
Fri Aug 4 06:48:30 UTC 2017


Branch:      refs/heads/master
Author:      Matthew Brush <matt at geany.org>
Committer:   Matthew Brush <mbrush at codebrainz.ca>
Date:        Fri, 04 Aug 2017 06:48:30 UTC
Commit:      6d663cbb0ee2d2da9d65be4f704044cafa9bbe42
             https://github.com/geany/geany/commit/6d663cbb0ee2d2da9d65be4f704044cafa9bbe42

Log Message:
-----------
Change all scintilla_send_message calls to use SSM macro


Modified Paths:
--------------
    src/callbacks.c
    src/document.c
    src/editor.c
    src/keybindings.c
    src/printing.c
    src/search.c
    src/symbols.c

Modified: src/callbacks.c
2 lines changed, 1 insertions(+), 1 deletions(-)
===================================================================
@@ -579,7 +579,7 @@ void on_toggle_case1_activate(GtkMenuItem *menuitem, gpointer user_data)
 	{
 		gchar *result = NULL;
 		gint cmd = SCI_LOWERCASE;
-		gboolean rectsel = (gboolean) scintilla_send_message(sci, SCI_SELECTIONISRECTANGLE, 0, 0);
+		gboolean rectsel = (gboolean) SSM(sci, SCI_SELECTIONISRECTANGLE, 0, 0);
 		gchar *text = sci_get_selection_contents(sci);
 
 		if (utils_str_has_upper(text))


Modified: src/document.c
2 lines changed, 1 insertions(+), 1 deletions(-)
===================================================================
@@ -2687,7 +2687,7 @@ void document_update_tags(GeanyDocument *doc)
 	/* Parse Scintilla's buffer directly using TagManager
 	 * Note: this buffer *MUST NOT* be modified */
 	len = sci_get_length(doc->editor->sci);
-	buffer_ptr = (guchar *) scintilla_send_message(doc->editor->sci, SCI_GETCHARACTERPOINTER, 0, 0);
+	buffer_ptr = (guchar *) SSM(doc->editor->sci, SCI_GETCHARACTERPOINTER, 0, 0);
 	tm_workspace_update_source_file_buffer(doc->tm_file, buffer_ptr, len);
 
 	sidebar_update_tag_list(doc, TRUE);


Modified: src/editor.c
6 lines changed, 3 insertions(+), 3 deletions(-)
===================================================================
@@ -2146,7 +2146,7 @@ static GSList *get_doc_words(ScintillaObject *sci, gchar *root, gsize rootlen)
 	flags = SCFIND_WORDSTART | SCFIND_MATCHCASE;
 
 	/* search the whole document for the word root and collect results */
-	pos_find = scintilla_send_message(sci, SCI_FINDTEXT, flags, (uptr_t) &ttf);
+	pos_find = SSM(sci, SCI_FINDTEXT, flags, (uptr_t) &ttf);
 	while (pos_find >= 0 && pos_find < len)
 	{
 		word_end = pos_find + rootlen;
@@ -2172,7 +2172,7 @@ static GSList *get_doc_words(ScintillaObject *sci, gchar *root, gsize rootlen)
 			}
 		}
 		ttf.chrg.cpMin = word_end;
-		pos_find = scintilla_send_message(sci, SCI_FINDTEXT, flags, (uptr_t) &ttf);
+		pos_find = SSM(sci, SCI_FINDTEXT, flags, (uptr_t) &ttf);
 	}
 
 	return g_slist_sort(words, (GCompareFunc)utils_str_casecmp);
@@ -2189,7 +2189,7 @@ static gboolean autocomplete_doc_word(GeanyEditor *editor, gchar *root, gsize ro
 	words = get_doc_words(sci, root, rootlen);
 	if (!words)
 	{
-		scintilla_send_message(sci, SCI_AUTOCCANCEL, 0, 0);
+		SSM(sci, SCI_AUTOCCANCEL, 0, 0);
 		return FALSE;
 	}
 


Modified: src/keybindings.c
8 lines changed, 6 insertions(+), 2 deletions(-)
===================================================================
@@ -1558,13 +1558,17 @@ static gboolean cb_func_search_action(guint key_id)
 			gint pos = sci_get_current_position(sci);
 
 			/* clear existing search indicators instead if next to cursor */
-			if (scintilla_send_message(sci, SCI_INDICATORVALUEAT,
+			if (SSM(sci, SCI_INDICATORVALUEAT,
 					GEANY_INDICATOR_SEARCH, pos) ||
-				scintilla_send_message(sci, SCI_INDICATORVALUEAT,
+				SSM(sci, SCI_INDICATORVALUEAT,
 					GEANY_INDICATOR_SEARCH, MAX(pos - 1, 0)))
+			{
 				text = NULL;
+			}
 			else
+			{
 				text = get_current_word_or_sel(doc, TRUE);
+			}
 
 			if (sci_has_selection(sci))
 				search_mark_all(doc, text, GEANY_FIND_MATCHCASE);


Modified: src/printing.c
14 lines changed, 7 insertions(+), 7 deletions(-)
===================================================================
@@ -352,14 +352,14 @@ static void begin_print(GtkPrintOperation *operation, GtkPrintContext *context,
 	dinfo->sci = editor_create_widget(dinfo->doc->editor);
 	/* since we won't add the widget to any container, assume it's ownership */
 	g_object_ref_sink(dinfo->sci);
-	scintilla_send_message(dinfo->sci, SCI_SETDOCPOINTER, 0,
-			scintilla_send_message(dinfo->doc->editor->sci, SCI_GETDOCPOINTER, 0, 0));
+	SSM(dinfo->sci, SCI_SETDOCPOINTER, 0,
+			SSM(dinfo->doc->editor->sci, SCI_GETDOCPOINTER, 0, 0));
 	highlighting_set_styles(dinfo->sci, dinfo->doc->file_type);
 	sci_set_line_numbers(dinfo->sci, printing_prefs.print_line_numbers);
-	scintilla_send_message(dinfo->sci, SCI_SETVIEWWS, SCWS_INVISIBLE, 0);
-	scintilla_send_message(dinfo->sci, SCI_SETVIEWEOL, FALSE, 0);
-	scintilla_send_message(dinfo->sci, SCI_SETEDGEMODE, EDGE_NONE, 0);
-	scintilla_send_message(dinfo->sci, SCI_SETPRINTCOLOURMODE, SC_PRINT_COLOURONWHITE, 0);
+	SSM(dinfo->sci, SCI_SETVIEWWS, SCWS_INVISIBLE, 0);
+	SSM(dinfo->sci, SCI_SETVIEWEOL, FALSE, 0);
+	SSM(dinfo->sci, SCI_SETEDGEMODE, EDGE_NONE, 0);
+	SSM(dinfo->sci, SCI_SETPRINTCOLOURMODE, SC_PRINT_COLOURONWHITE, 0);
 
 	/* Scintilla doesn't respect the context resolution, so we'll scale ourselves.
 	 * Actually Scintilla simply doesn't know about the resolution since it creates its own
@@ -401,7 +401,7 @@ static gint format_range(DocInfo *dinfo, gboolean draw)
 
 	cairo_save(dinfo->fr.hdc);
 	cairo_scale(dinfo->fr.hdc, dinfo->sci_scale, dinfo->sci_scale);
-	pos = (gint) scintilla_send_message(dinfo->sci, SCI_FORMATRANGE, draw, (sptr_t) &dinfo->fr);
+	pos = (gint) SSM(dinfo->sci, SCI_FORMATRANGE, draw, (sptr_t) &dinfo->fr);
 	cairo_restore(dinfo->fr.hdc);
 
 	return pos;


Modified: src/search.c
4 lines changed, 2 insertions(+), 2 deletions(-)
===================================================================
@@ -1940,7 +1940,7 @@ static gint find_regex(ScintillaObject *sci, guint pos, GRegex *regex, gboolean
 	if (multiline)
 	{
 		/* Warning: any SCI calls will invalidate 'text' after calling SCI_GETCHARACTERPOINTER */
-		text = (void*)scintilla_send_message(sci, SCI_GETCHARACTERPOINTER, 0, 0);
+		text = (void*)SSM(sci, SCI_GETCHARACTERPOINTER, 0, 0);
 		g_regex_match_full(regex, text, -1, pos, 0, &minfo, NULL);
 	}
 	else /* single-line mode, manually match against each line */
@@ -1952,7 +1952,7 @@ static gint find_regex(ScintillaObject *sci, guint pos, GRegex *regex, gboolean
 			gint start = sci_get_position_from_line(sci, line);
 			gint end = sci_get_line_end_position(sci, line);
 
-			text = (void*)scintilla_send_message(sci, SCI_GETRANGEPOINTER, start, end - start);
+			text = (void*)SSM(sci, SCI_GETRANGEPOINTER, start, end - start);
 			if (g_regex_match_full(regex, text, end - start, pos - start, 0, &minfo, NULL))
 			{
 				offset = start;


Modified: src/symbols.c
10 lines changed, 5 insertions(+), 5 deletions(-)
===================================================================
@@ -1860,10 +1860,10 @@ static void goto_popup_position_func(GtkMenu *menu, gint *x, gint *y, gboolean *
 		GdkWindow *window = gtk_widget_get_window(GTK_WIDGET(sci));
 		gint pos = sci_get_current_position(sci);
 		gint line = sci_get_line_from_position(sci, pos);
-		gint pos_x = scintilla_send_message(sci, SCI_POINTXFROMPOSITION, 0, pos);
-		gint pos_y = scintilla_send_message(sci, SCI_POINTYFROMPOSITION, 0, pos);
+		gint pos_x = SSM(sci, SCI_POINTXFROMPOSITION, 0, pos);
+		gint pos_y = SSM(sci, SCI_POINTYFROMPOSITION, 0, pos);
 
-		line_height = scintilla_send_message(sci, SCI_TEXTHEIGHT, line, 0);
+		line_height = SSM(sci, SCI_TEXTHEIGHT, line, 0);
 
 		gdk_window_get_origin(window, x, y);
 		*x += pos_x;
@@ -2285,7 +2285,7 @@ static gint get_fold_header_after(ScintillaObject *sci, gint line)
 	{
 		if (sci_get_fold_level(sci, line) & SC_FOLDLEVELHEADERFLAG)
 		{
-			const gint last_child = scintilla_send_message(sci, SCI_GETLASTCHILD, line, -1);
+			const gint last_child = SSM(sci, SCI_GETLASTCHILD, line, -1);
 			const gint line_end = sci_get_line_end_position(sci, line);
 			const gint lexer = sci_get_lexer(sci);
 			gint parenthesis_match_line = -1;
@@ -2354,7 +2354,7 @@ static gint get_current_tag_name(GeanyDocument *doc, gchar **tagname, TMTagType
 			{
 				const gint tag_fold = get_fold_header_after(doc->editor->sci, tag_line);
 				if (tag_fold >= 0)
-					last_child = scintilla_send_message(doc->editor->sci, SCI_GETLASTCHILD, tag_fold, -1);
+					last_child = SSM(doc->editor->sci, SCI_GETLASTCHILD, tag_fold, -1);
 			}
 
 			if (line <= last_child)



--------------
This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).


More information about the Commits mailing list