com gtk/php-gtk: gtk_tree_model_filter_new == n ew GtkTreeModelFilter() We have a problem: - gtk_tree_model_filter_new is the constructor of GtkTreeModelFilter - we used to have a Gt kTreeModel::filter_new([path]) method t hat was an instance method for GtkTreeModel, co nstructing a filter with the object as chil dmodel. Both use gtk_tree_model_filter_new as base C function...: ext/gtk+/gtktreevi ew.overrides

[email protected] (David Soria Parra)
Newsgroups php.gtk.cvs
Message-ID <[email protected]>
Commit:    5a6741082f1c80b55293286607fea365fa10dc11
Author:    Christian Weiske <[email protected]>         Mon, 12 Jun 2006 16:54:16 +0000
Parents:   ca2250a6998842df49be12434c88a7f72532ebb7
Branches:  master

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

Log:
gtk_tree_model_filter_new == new GtkTreeModelFilter()
We have a problem:
- gtk_tree_model_filter_new is the constructor of GtkTreeModelFilter
- we used to have a GtkTreeModel::filter_new([path]) method
  that was an instance method for GtkTreeModel, constructing a filter
  with the object as childmodel. Both use gtk_tree_model_filter_new
  as base C function...

So do we want to have both?

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


Diff:
5a6741082f1c80b55293286607fea365fa10dc11
diff --git a/ext/gtk+/gtktreeview.overrides b/ext/gtk+/gtktreeview.overrides
index 5d965b0..4b0337b 100644
--- a/ext/gtk+/gtktreeview.overrides
+++ b/ext/gtk+/gtktreeview.overrides
@@ -1204,47 +1204,6 @@ PHP_METHOD
 }
 
 %%
-add-arginfo GtkTreeModel filter_new
-static
-ZEND_BEGIN_ARG_INFO_EX(ARGINFO_NAME, 0, 0, 1)
-    ZEND_ARG_OBJ_INFO(0, model, GtkTreeModel, 1)
-    ZEND_ARG_INFO(0, root)
-ZEND_END_ARG_INFO();
-
-%%
-override gtk_tree_model_filter_new
-PHP_METHOD
-{
-    GObject *wrapped_obj;
-    GtkTreePath *path = NULL;
-    zval *php_model = NULL, *php_path = NULL;
-
-    if (!php_gtk_parse_args(ZEND_NUM_ARGS(), "V|s", &php_model, gtktreemodel_ce, &php_path))
-        return;
-
-    if (php_path && phpg_tree_path_from_zval(php_path, &path TSRMLS_CC) == FAILURE) {
-        php_error(E_WARNING, "%s::%s() expects path argument to be a valid tree path specification", get_active_class_name(NULL TSRMLS_CC), get_active_function_name(TSRMLS_C));
-        return;
-    }
-
-
-    wrapped_obj = g_object_new(phpg_gtype_from_zval(this_ptr),
-                               "child-model", GTK_TREE_MODEL(PHPG_GOBJECT(php_model)),
-                               "virtual-root", path,
-                               NULL);
-
-    if (path) {
-        gtk_tree_path_free(path);
-    }
-
-    if (!wrapped_obj) {
-        PHPG_THROW_CONSTRUCT_EXCEPTION(GtkTreeModelFilter);
-    }
-
-    phpg_gobject_set_wrapper(this_ptr, wrapped_obj TSRMLS_CC);
-}
-
-%%
 add-arginfo GtkTreeModel foreach
 static
 ZEND_BEGIN_ARG_INFO(ARGINFO_NAME, 0)
@@ -1385,6 +1344,47 @@ PHP_METHOD
 %% {{{ GtkTreeModelFilter
 
 %%
+add-arginfo GtkTreeModelFilter __construct
+static
+ZEND_BEGIN_ARG_INFO_EX(ARGINFO_NAME, 0, 0, 1)
+    ZEND_ARG_OBJ_INFO(0, model, GtkTreeModel, 1)
+    ZEND_ARG_INFO(0, root)
+ZEND_END_ARG_INFO();
+
+%%
+override gtk_tree_model_filter_new
+PHP_METHOD
+{
+    GObject *wrapped_obj;
+    GtkTreePath *path = NULL;
+    zval *php_model = NULL, *php_path = NULL;
+
+    if (!php_gtk_parse_args(ZEND_NUM_ARGS(), "V|s", &php_model, gtktreemodel_ce, &php_path))
+        return;
+
+    if (php_path && phpg_tree_path_from_zval(php_path, &path TSRMLS_CC) == FAILURE) {
+        php_error(E_WARNING, "%s::%s() expects path argument to be a valid tree path specification", get_active_class_name(NULL TSRMLS_CC), get_active_function_name(TSRMLS_C));
+        return;
+    }
+
+
+    wrapped_obj = g_object_new(phpg_gtype_from_zval(this_ptr),
+                               "child-model", GTK_TREE_MODEL(PHPG_GOBJECT(php_model)),
+                               "virtual-root", path,
+                               NULL);
+
+    if (path) {
+        gtk_tree_path_free(path);
+    }
+
+    if (!wrapped_obj) {
+        PHPG_THROW_CONSTRUCT_EXCEPTION(GtkTreeModelFilter);
+    }
+
+    phpg_gobject_set_wrapper(this_ptr, wrapped_obj TSRMLS_CC);
+}
+
+%%
 add-arginfo GtkTreeModelFilter set_visible_func
 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.