[Python-gtkextra-commits] CVS: python-gtkextra2/gtkextra gtkextra.defs,1.10,1.11 gtkextra.override,1
Status: Beta
                
                Brought to you by:
                
                    treeves
                    
                
            | 
     
      
      
      From: <pyt...@li...> - 2003-04-17 16:39:58
      
     
   | 
Update of /cvsroot/python-gtkextra/python-gtkextra2/gtkextra
In directory sc8-pr-cvs1:/tmp/cvs-serv6663/gtkextra
Modified Files:
	gtkextra.defs gtkextra.override 
Log Message:
Implement clone(). Some other garbage.
Index: gtkextra.defs
===================================================================
RCS file: /cvsroot/python-gtkextra/python-gtkextra2/gtkextra/gtkextra.defs,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -d -r1.10 -r1.11
*** gtkextra.defs	15 Jan 2003 18:57:08 -0000	1.10
--- gtkextra.defs	17 Apr 2003 16:39:52 -0000	1.11
***************
*** 2177,2180 ****
--- 2177,2189 ----
  )
  
+ (define-method clone
+   (of-object "GtkPlotData")
+   (c-name "gtk_plot_data_clone")
+   (return-type "none")
+   (parameters
+     '("GtkPlotData" "copy")
+   )
+ )
+ 
  (define-method paint
    (of-object "GtkPlotData")
Index: gtkextra.override
===================================================================
RCS file: /cvsroot/python-gtkextra/python-gtkextra2/gtkextra/gtkextra.override,v
retrieving revision 1.16
retrieving revision 1.17
diff -C2 -d -r1.16 -r1.17
*** gtkextra.override	21 Jan 2003 21:56:35 -0000	1.16
--- gtkextra.override	17 Apr 2003 16:39:53 -0000	1.17
***************
*** 31,36 ****
  
  static PyObject *pygtkextra_data_from_pyobject_callback = NULL;
! static const gchar *function_key = "pygtkextra::function";
! static const gchar *iterator_key = "pygtkextra::iterator";
  
  /*
--- 31,44 ----
  
  static PyObject *pygtkextra_data_from_pyobject_callback = NULL;
! static const gchar *const function_key = "pygtkextra::function";
! static const gchar *const iterator_key = "pygtkextra::iterator";
! static const gchar *const labels_key = "pygtkextra::labels[]";
! 
! static gchar * pygtkextra_keys[] = {
!     "pygtkextra::function",
!     "pygtkextra::iterator",
!     "pygtkextra::labels[]",
!     "x", "y", "z", "a", "dx", "dy", "dz", "da"
! };
  
  /*
***************
*** 1037,1041 ****
      labels = g_new0(char *, num_labels+1);
      py_c_obj = PyCObject_FromVoidPtr(labels, (void*) g_strfreev);
!     pygtkextra_set_data(self, "pygtkextra::labels[]", py_c_obj);
      Py_DECREF(py_c_obj);
  
--- 1045,1049 ----
      labels = g_new0(char *, num_labels+1);
      py_c_obj = PyCObject_FromVoidPtr(labels, (void*) g_strfreev);
!     pygtkextra_set_data(self, labels_key, py_c_obj);
      Py_DECREF(py_c_obj);
  
***************
*** 1145,1148 ****
--- 1153,1181 ----
  				&min, &max, &nlevels, &nsublevels);
      return Py_BuildValue("(ddii)", &min, &max, &nlevels, &nsublevels);
+ }
+ %%
+ override gtk_plot_data_clone noargs
+ static PyObject *
+ _wrap_gtk_plot_data_clone(PyGObject *self)
+ {
+     GtkPlotData *copy;
+     PyObject *py_copy;
+     int i;
+ 
+     copy = gtk_type_new(G_OBJECT_TYPE(self->obj));
+     if (!copy) {
+ 	PyErr_SetString(PyExc_RuntimeError, "could not create new object");
+ 	return NULL;
+     }
+ 
+     py_copy = pygobject_new((GObject*)copy);
+     gtk_plot_data_clone(GTK_PLOT_DATA(self->obj), copy);
+ 
+     for (i=0; i < G_N_ELEMENTS(pygtkextra_keys); i++) {
+ 	const char *key  = pygtkextra_keys[i];
+ 	pygtkextra_set_data( (PyGObject*)py_copy, key, pygtkextra_get_data(self, key));
+     }
+ 
+     return py_copy;
  }
  %%
 |