com gtk/php-gtk: Override for GtkScintilla::get_text( ). This makes basic code completion possible. : ext/scintilla/scintilla.overrides

[email protected] (David Soria Parra)
Newsgroups php.gtk.cvs
Message-ID <[email protected]>
Commit:    5ed7fa8010b390e6b30acfd55eac829daffdbe4f
Author:    Anant Narayanan <[email protected]>         Mon, 10 Apr 2006 01:04:23 +0000
Parents:   a202db8a0454c4d71694dda2268dae5be4d0d620
Branches:  master

Link:       http://git.php.net/?p=gtk/php-gtk.git;a=commitdiff;h=5ed7fa8010b390e6b30acfd55eac829daffdbe4f

Log:
Override for GtkScintilla::get_text(). This makes basic code completion
possible.

Changed paths:
  M  ext/scintilla/scintilla.overrides


Diff:
5ed7fa8010b390e6b30acfd55eac829daffdbe4f
diff --git a/ext/scintilla/scintilla.overrides b/ext/scintilla/scintilla.overrides
index 7a7940d..9616cc8 100644
--- a/ext/scintilla/scintilla.overrides
+++ b/ext/scintilla/scintilla.overrides
@@ -7,3 +7,33 @@ headers
 %%
 ignore-glob
   *_get_type
+
+%%
+override gtk_scintilla_get_text
+PHP_METHOD
+{
+    int length, result;
+    char *text;
+    length = 0;
+
+    NOT_STATIC_METHOD();
+
+    if(!php_gtk_parse_args(ZEND_NUM_ARGS(), "|i", length)) {
+        return;
+    }
+
+    if(length==0) {
+        length = gtk_scintilla_get_length(GTK_SCINTILLA(PHPG_GOBJECT(this_ptr)));
+        length++;
+    }
+
+    text = safe_emalloc(length, sizeof(char), 0);
+
+    result = gtk_scintilla_get_text(GTK_SCINTILLA(PHPG_GOBJECT(this_ptr)), length, text);
+    
+    if(result) {
+        RETURN_STRING(text, 1);
+    } else {
+        RETURN_EMPTY_STRING();
+    }
+}
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.