[Python-gtkextra-commits] CVS: python-gtkextra2/gtkextra gtkextra-types.defs,1.8,1.9 gtkextra.overri
Status: Beta
Brought to you by:
treeves
From: <pyt...@li...> - 2003-01-21 21:56:43
|
Update of /cvsroot/python-gtkextra/python-gtkextra2/gtkextra In directory sc8-pr-cvs1:/tmp/cvs-serv1848/gtkextra Modified Files: gtkextra-types.defs gtkextra.override mkfields.py Log Message: more Index: gtkextra-types.defs =================================================================== RCS file: /cvsroot/python-gtkextra/python-gtkextra2/gtkextra/gtkextra-types.defs,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** gtkextra-types.defs 21 Jan 2003 17:09:09 -0000 1.8 --- gtkextra-types.defs 21 Jan 2003 21:56:34 -0000 1.9 *************** *** 344,348 **** (define-boxed PlotText - ;(define-pointer PlotText (in-module "Gtk") (c-name "GtkPlotText") --- 344,347 ---- *************** *** 359,365 **** '("gint" "shadow_width") '("gint" "border_space") ! '("gchar*" "font") '("gint" "height") ! '("gchar*" "text") '("GtkJustification" "justification") ) --- 358,364 ---- '("gint" "shadow_width") '("gint" "border_space") ! '("gchar*" "font" (null-ok)) '("gint" "height") ! '("gchar*" "text" (null-ok)) '("GtkJustification" "justification") ) *************** *** 370,377 **** (c-name "GtkPlotCanvasChild") (gtype-id "GTK_TYPE_PLOT_CANVAS_CHILD") (fields ! '("gint" "data") ! '("gint" "type") ) ) --- 369,392 ---- (c-name "GtkPlotCanvasChild") (gtype-id "GTK_TYPE_PLOT_CANVAS_CHILD") + (fields ! '("gdouble" "rx1") ! '("gdouble" "rx2") ! '("gdouble" "ry1") ! '("gdouble" "ry2") ! '("gint" "min_width") ! '("gint" "min_height") ! '("GdkRectangle" "allocation") ! '("guint" "state") ! '("GtkPlotCanvasType" "type") ! '("GtkPlotCanvasFlag" "flags") ! '("GtkPlotCanvasSelection" "selection") ! '("GtkPlotCanvasSelectionMode" "mode") ! '("gpointer" "data") ) + ;(fields + ; '("gint" "data") + ; '("gint" "type") + ;) ) Index: gtkextra.override =================================================================== RCS file: /cvsroot/python-gtkextra/python-gtkextra2/gtkextra/gtkextra.override,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** gtkextra.override 21 Jan 2003 17:09:09 -0000 1.15 --- gtkextra.override 21 Jan 2003 21:56:35 -0000 1.16 *************** *** 138,143 **** copy = g_new (GtkPlotText, 1); *copy = *text; ! copy->font = g_strdup(text->font); ! copy->text = g_strdup(text->text); return copy; } --- 138,145 ---- copy = g_new (GtkPlotText, 1); *copy = *text; ! if(copy->font) ! copy->font = g_strdup(text->font); ! if(copy->text) ! copy->text = g_strdup(text->text); return copy; } *************** *** 644,647 **** --- 646,666 ---- _wrap_gtk_plot_canvas_child__get_data(PyObject *self, void *closure) { + /* + The GtkPlotCanvasType's are: + + GTK_PLOT_CANVAS_NONE + GTK_PLOT_CANVAS_PLOT + GTK_PLOT_CANVAS_AXIS + GTK_PLOT_CANVAS_LEGENDS + GTK_PLOT_CANVAS_TITLE + GTK_PLOT_CANVAS_TEXT + GTK_PLOT_CANVAS_DATA + GTK_PLOT_CANVAS_LINE + GTK_PLOT_CANVAS_RECTANGLE + GTK_PLOT_CANVAS_ELLIPSE + GTK_PLOT_CANVAS_PIXMAP + GTK_PLOT_CANVAS_MARKER + GTK_PLOT_CANVAS_CUSTOM + */ switch (pyg_boxed_get(self, GtkPlotCanvasChild)->type) { case GTK_PLOT_CANVAS_NONE: *************** *** 655,661 **** return pyg_boxed_new(GTK_TYPE_PLOT_TEXT, pyg_boxed_get(self, GtkPlotCanvasChild)->data, FALSE, FALSE); #endif case GTK_PLOT_CANVAS_PLOT: ! case GTK_PLOT_CANVAS_DATA: case GTK_PLOT_CANVAS_LEGENDS: default: return PyCObject_FromVoidPtr(pyg_pointer_get(self, GtkPlotCanvasChild)->data, NULL); --- 674,688 ---- return pyg_boxed_new(GTK_TYPE_PLOT_TEXT, pyg_boxed_get(self, GtkPlotCanvasChild)->data, FALSE, FALSE); #endif + case GTK_PLOT_CANVAS_PLOT: ! case GTK_PLOT_CANVAS_AXIS: case GTK_PLOT_CANVAS_LEGENDS: + case GTK_PLOT_CANVAS_TITLE: + case GTK_PLOT_CANVAS_DATA: + case GTK_PLOT_CANVAS_LINE: + case GTK_PLOT_CANVAS_RECTANGLE: + case GTK_PLOT_CANVAS_ELLIPSE: + case GTK_PLOT_CANVAS_PIXMAP: + case GTK_PLOT_CANVAS_MARKER: default: return PyCObject_FromVoidPtr(pyg_pointer_get(self, GtkPlotCanvasChild)->data, NULL); Index: mkfields.py =================================================================== RCS file: /cvsroot/python-gtkextra/python-gtkextra2/gtkextra/mkfields.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** mkfields.py 21 Jan 2003 17:09:10 -0000 1.1 --- mkfields.py 21 Jan 2003 21:56:37 -0000 1.2 *************** *** 3,29 **** # Copy C field definitions to this string. # Then run me. lines = """ ! """ - """ - (fields - '("gboolean" "is_visible") - '("GtkPlotVector" "origin") - '("GtkPlotVector" "direction") - '("GtkPlotText" "title") """ import string ! print """ (fields""" ! for line in lines.split('\n'): ! line = line.strip() ! line = line.replace(';', '') ! if not line: ! continue ! ! t,v = line.split(' ') t = t.strip() v = v.strip() --- 3,27 ---- # Copy C field definitions to this string. # Then run me. + lines = """ + gdouble rx1, rx2, ry1, ry2; + gint min_width, min_height; ! GdkRectangle allocation; + guint state; + + GtkPlotCanvasType type; + GtkPlotCanvasFlag flags; + GtkPlotCanvasSelection selection; + GtkPlotCanvasSelectionMode mode; + + gpointer data; """ import string ! def process_field(t,v): t = t.strip() v = v.strip() *************** *** 33,37 **** print """ '("%s" "%s")""" % (t,v) ! print """ )""" --- 31,56 ---- print """ '("%s" "%s")""" % (t,v) ! ! def fields(lines): ! print """ (fields""" ! for line in lines.split('\n'): ! line = line.strip() ! line = line.replace(';', '') ! if not line: ! continue ! ! ! x = line.split(',') ! t,v = x[0].split(' ') ! vlist = [v]+x[1:] ! ! for v in vlist: ! process_field(t,v) ! ! ! print """ )""" ! ! ! fields(lines) |