com gtk/php-gtk: - Override for GtkTextBuffer::get_iter _at_child_anchor() - If we're going to throw construct exceptions, it'd be good to h ave the right widget names :\\: ext/gtk+/gt k.overrides ext/gtk+/gtktextview.overrides

[email protected] (David Soria Parra)
Newsgroups php.gtk.cvs
Message-ID <[email protected]>
Commit:    60ae771029e1d5b285227eeb80080655d6ca9a2a
Author:    Steph Fox <[email protected]>         Sat, 17 Jun 2006 20:44:14 +0000
Parents:   6cd99c9173227d25f1285699b801e22bb0e5a3f8
Branches:  master

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

Log:
- Override for GtkTextBuffer::get_iter_at_child_anchor()
- If we're going to throw construct exceptions, it'd be good to have the right widget names :\\

** Andrei - Should we be throwing construct exceptions on parse_arg failure anyway? It feels wrong...

Changed paths:
  M  ext/gtk+/gtk.overrides
  M  ext/gtk+/gtktextview.overrides


Diff:
60ae771029e1d5b285227eeb80080655d6ca9a2a
diff --git a/ext/gtk+/gtk.overrides b/ext/gtk+/gtk.overrides
index dc2fef5..6493263 100644
--- a/ext/gtk+/gtk.overrides
+++ b/ext/gtk+/gtk.overrides
@@ -1527,7 +1527,7 @@ PHP_METHOD
     zval *php_model = NULL;
 
     if (!php_gtk_parse_args(ZEND_NUM_ARGS(), "|N", &php_model, gtktreemodel_ce)) {
-        PHPG_THROW_CONSTRUCT_EXCEPTION(GtkButton);
+        PHPG_THROW_CONSTRUCT_EXCEPTION(GtkComboBox);
     }
 
     if (php_model && Z_TYPE_P(php_model) != IS_NULL) {
@@ -2332,7 +2332,7 @@ PHP_METHOD
             php_error(E_WARNING, "%s::%s(): button list has to contain pairs of items",
                       get_active_class_name(NULL TSRMLS_CC), get_active_function_name(TSRMLS_C));
             gtk_object_destroy(GTK_OBJECT(wrapped_obj));
-            PHPG_THROW_CONSTRUCT_EXCEPTION(GtkDialog);
+            PHPG_THROW_CONSTRUCT_EXCEPTION(GtkFileChooserDialog);
         }
 
         zend_hash_internal_pointer_reset(Z_ARRVAL_P(buttons));
@@ -2345,7 +2345,7 @@ PHP_METHOD
                 php_error(E_WARNING, "%s::%s(): each pair in button list has to string/number",
                           get_active_class_name(NULL TSRMLS_CC), get_active_function_name(TSRMLS_C));
                 gtk_object_destroy(GTK_OBJECT(wrapped_obj));
-                PHPG_THROW_CONSTRUCT_EXCEPTION(GtkDialog);
+                PHPG_THROW_CONSTRUCT_EXCEPTION(GtkFileChooserDialog);
             }
 
             gtk_dialog_add_button(GTK_DIALOG(wrapped_obj), Z_STRVAL_PP(text), Z_LVAL_PP(response));
@@ -2446,7 +2446,7 @@ PHP_METHOD
     zval *php_model = NULL;
 
     if (!php_gtk_parse_args(ZEND_NUM_ARGS(), "|N", &php_model, gtktreemodel_ce)) {
-        PHPG_THROW_CONSTRUCT_EXCEPTION(GtkButton);
+        PHPG_THROW_CONSTRUCT_EXCEPTION(GtkIconView);
     }
 
     if (php_model && Z_TYPE_P(php_model) != IS_NULL) {
@@ -3292,7 +3292,7 @@ PHP_METHOD
     GType gtype = phpg_gtype_from_zval(this_ptr);
 
     if (!php_gtk_parse_args(ZEND_NUM_ARGS(), "|Nub", &php_group, gtkradiomenuitem_ce, &label, &free_label, &use_underline)) {
-        PHPG_THROW_CONSTRUCT_EXCEPTION(GtkRadioButton);
+        PHPG_THROW_CONSTRUCT_EXCEPTION(GtkRadioMenuItem);
     }
 
     if (php_group && Z_TYPE_P(php_group) != IS_NULL) {
@@ -3320,7 +3320,7 @@ PHP_METHOD
     if (free_label) g_free(label);
 
     if (!wrapped_obj) {
-        PHPG_THROW_CONSTRUCT_EXCEPTION(GtkRadioButton);
+        PHPG_THROW_CONSTRUCT_EXCEPTION(GtkRadioMenuItem);
     }
     phpg_gobject_set_wrapper(this_ptr, wrapped_obj TSRMLS_CC);
 
diff --git a/ext/gtk+/gtktextview.overrides b/ext/gtk+/gtktextview.overrides
index d86b5b2..a96220d 100644
--- a/ext/gtk+/gtktextview.overrides
+++ b/ext/gtk+/gtktextview.overrides
@@ -122,6 +122,22 @@ PHP_METHOD
 }
 
 %%
+override gtk_text_buffer_get_iter_at_child_anchor
+PHP_METHOD
+{
+    GtkTextIter iter;
+    zval *anchor;
+
+    NOT_STATIC_METHOD();
+    if (!php_gtk_parse_args(ZEND_NUM_ARGS(), "O", &anchor, gtktextchildanchor_ce))
+        return;
+
+    gtk_text_buffer_get_iter_at_child_anchor(GTK_TEXT_BUFFER(PHPG_GOBJECT(this_ptr)), &iter,
+                                     GTK_TEXT_CHILD_ANCHOR(PHPG_GOBJECT(anchor)));
+    phpg_gboxed_new(&return_value, GTK_TYPE_TEXT_ITER, &iter, TRUE, TRUE TSRMLS_CC);
+}
+
+%%
 add-arginfo GtkTextBuffer get_iter_at_line_offset
 static
 ZEND_BEGIN_ARG_INFO(ARGINFO_NAME, 0)
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.