python-gtkextra-commits Mailing List for GtkExtra Python Language Bindings
Status: Beta
Brought to you by:
treeves
You can subscribe to this list here.
| 2002 |
Jan
(13) |
Feb
(7) |
Mar
|
Apr
|
May
|
Jun
|
Jul
(13) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(9) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2003 |
Jan
(18) |
Feb
|
Mar
|
Apr
(3) |
May
|
Jun
|
Jul
(3) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2004 |
Jan
|
Feb
|
Mar
(5) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2005 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(3) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|
From: <pyt...@li...> - 2005-05-26 15:12:36
|
Update of /cvsroot/python-gtkextra/python-gtkextra2 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8776 Modified Files: autogen.sh configure.in Log Message: First cut at building with Python-2.4.1, gtk+-2.6.7, pygtk-2.6.2. Test programs testgtkplot.py and testrealtime.py run but not exactly as the C version yet. Index: autogen.sh =================================================================== RCS file: /cvsroot/python-gtkextra/python-gtkextra2/autogen.sh,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** autogen.sh 30 Dec 2002 20:42:12 -0000 1.3 --- autogen.sh 26 May 2005 15:12:23 -0000 1.4 *************** *** 1,107 **** #!/bin/sh - # Run this to generate all the initial makefiles, etc. - - srcdir=`dirname $0` - test -z "$srcdir" && srcdir=. - - ORIGDIR=`pwd` - cd $srcdir - PROJECT=python-gtkextra2 - TEST_TYPE=-d - FILE=gtkextra - - DIE=0 - - - test -z "$AUTOMAKE" && AUTOMAKE=automake - test -z "$ACLOCAL" && ACLOCAL=aclocal - test -z "$AUTOCONF" && AUTOCONF=autoconf - test -z "$AUTOHEADER" && AUTOHEADER=autoheader - - (autoconf --version) < /dev/null > /dev/null 2>&1 || { - echo - echo "You must have autoconf installed to compile $PROJECT." - echo "Download the appropriate package for your distribution," - echo "or get the source tarball at ftp://ftp.gnu.org/pub/gnu/" - DIE=1 - } - - (libtool --version) < /dev/null > /dev/null 2>&1 || { - echo - echo "You must have libtool installed to compile gnome-xml." - echo "Get ftp://ftp.gnu.org/gnu/libtool/libtool-1.4.tar.gz" - echo "(or a newer version if it is available)" - DIE=1 - } - - ($AUTOMAKE --version) < /dev/null > /dev/null 2>&1 || { - echo - echo "You must have automake installed to compile $PROJECT." - echo "Get ftp://ftp.cygnus.com/pub/home/tromey/automake-1.2d.tar.gz" - echo "(or a newer version if it is available)" - DIE=1 - } - - if test "$DIE" -eq 1; then - exit 1 - fi - - test $TEST_TYPE $FILE || { - echo "You must run this script in the top-level $PROJECT directory" - exit 1 - } - - if test -z "$*"; then - echo "I am going to run ./configure with no arguments - if you wish " - echo "to pass any to it, please specify them on the $0 command line." - fi - - case $CC in - *xlc | *xlc\ * | *lcc | *lcc\ *) am_opt=--include-deps;; - esac - - if test -z "$ACLOCAL_FLAGS"; then - - acdir=`$ACLOCAL --print-ac-dir` - m4list="glib-2.0.m4 gtk-2.0.m4 gettext.m4" ! for file in $m4list ! do ! if [ ! -f "$acdir/$file" ]; then ! echo "WARNING: aclocal's directory is $acdir, but..." ! echo " no file $acdir/$file" ! echo " You may see fatal macro warnings below." ! echo " If these files are installed in /some/dir, set the ACLOCAL_FLAGS " ! echo " environment variable to \"-I /some/dir\", or install" ! echo " $acdir/$file." ! echo "" ! fi ! done ! fi ! ! # Delete all symbolic links to files rooted at "/" ! find $srcdir -lname "/*" -exec rm {} \; ! ! #echo "Running gettextize... Ignore non-fatal messages." ! # Hmm, we specify --force here, since otherwise things dont' ! # get added reliably, but we don't want to overwrite intl ! # while making dist. ! #echo "no" | gettextize --copy --force ! ! $ACLOCAL $ACLOCAL_FLAGS ! # optionally feature autoheader ! ($AUTOHEADER --version) < /dev/null > /dev/null 2>&1 && $AUTOHEADER ! # run libtoolize ... ! libtoolize --force ! $AUTOMAKE -a $am_opt ! #$AUTOHEADER ! $AUTOCONF ! cd $ORIGDIR ! $srcdir/configure --enable-maintainer-mode "$@" ! echo ! echo "Now type 'make' to compile $PROJECT." --- 1,36 ---- #!/bin/sh ! export AUTOMAKE=/usr/bin/automake ! export AUTOCONF=/usr/bin/autoconf ! export ACLOCAL=/usr/bin/aclocal ! export LIBTOOLIZE=/usr/bin/libtoolize ! FILES=" ! stamp-h* ! INSTALL ! config.cache ! decomp ! config.guess ! missing ! mkinstalldirs ! mdate-sh ! ltconfig ! ltmain.sh ! install-sh ! compile ! ltcf-c.sh ! ltcf-cxx.sh ! ltcf-gcj.sh ! libtool ! " ! rm -f ${FILES} ! find . -lname "/*" -exec rm {} \; ! ${LIBTOOLIZE} --force ! ${ACLOCAL} ! ${AUTOCONF} ! ${AUTOMAKE} -a ! ./configure --enable-static=no $@ Index: configure.in =================================================================== RCS file: /cvsroot/python-gtkextra/python-gtkextra2/configure.in,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** configure.in 7 Jan 2003 17:06:11 -0000 1.4 --- configure.in 26 May 2005 15:12:23 -0000 1.5 *************** *** 75,92 **** dnl checks to see if Numeric Python is installed. ! if test "x$enable_numpy" != xno; then ! save_CPPFLAGS="$CPPFLAGS" ! CPPFLAGS="$CPPFLAGS $PYTHON_INCLUDES" ! AC_CHECK_HEADER(arrayobject.h, ! [AC_DEFINE(HAVE_NUMPY) ! AC_DEFINE(HAVE_ARRAYOBJECT_H)], ! [AC_CHECK_HEADER(Extensions/arrayobject.h, ! [AC_DEFINE(HAVE_NUMPY) ! AC_DEFINE(HAVE_EXTENSIONS_ARRAYOBJECT_H)], ! [AC_CHECK_HEADER(Numeric/arrayobject.h, ! [AC_DEFINE(HAVE_NUMPY) ! AC_DEFINE(HAVE_NUMERIC_ARRAYOBJECT_H)])])]) ! CPPFLAGS="$save_CPPFLAGS" ! fi dnl add debugging options ... --- 75,92 ---- dnl checks to see if Numeric Python is installed. ! #if test "x$enable_numpy" != xno; then ! # save_CPPFLAGS="$CPPFLAGS" ! # CPPFLAGS="$CPPFLAGS $PYTHON_INCLUDES" ! # AC_CHECK_HEADER(arrayobject.h, ! # [AC_DEFINE(HAVE_NUMPY) ! # AC_DEFINE(HAVE_ARRAYOBJECT_H)], ! # [AC_CHECK_HEADER(Extensions/arrayobject.h, ! # [AC_DEFINE(HAVE_NUMPY) ! # AC_DEFINE(HAVE_EXTENSIONS_ARRAYOBJECT_H)], ! # [AC_CHECK_HEADER(Numeric/arrayobject.h, ! # [AC_DEFINE(HAVE_NUMPY) ! # AC_DEFINE(HAVE_NUMERIC_ARRAYOBJECT_H)])])]) ! # CPPFLAGS="$save_CPPFLAGS" ! #fi dnl add debugging options ... |
Update of /cvsroot/python-gtkextra/python-gtkextra2/gtkextra In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8776/gtkextra Modified Files: Makefile.am gtkextra-addons.defs gtkextra-types.defs gtkextra.defs gtkextra.override mycodegen.py Log Message: First cut at building with Python-2.4.1, gtk+-2.6.7, pygtk-2.6.2. Test programs testgtkplot.py and testrealtime.py run but not exactly as the C version yet. Index: Makefile.am =================================================================== RCS file: /cvsroot/python-gtkextra/python-gtkextra2/gtkextra/Makefile.am,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** Makefile.am 4 Mar 2004 11:39:19 -0000 1.9 --- Makefile.am 26 May 2005 15:12:24 -0000 1.10 *************** *** 30,34 **** pygtkextraexec_LTLIBRARIES = _gtkextramodule.la _gtkextramodule_la_CFLAGS = $(PYGTK_CFLAGS) $(GTK_CFLAGS) $(GTKEXTRA_CFLAGS) ! _gtkextramodule_la_LDFLAGS = -module -avoid-version -export-symbols-regex init_gtkextra _gtkextramodule_la_LIBADD = $(GTKEXTRA_LIBS) $(PYGTK_LIBS) $(GTK_LIBS) _gtkextramodule_la_SOURCES = gtkextramodule.c --- 30,35 ---- pygtkextraexec_LTLIBRARIES = _gtkextramodule.la _gtkextramodule_la_CFLAGS = $(PYGTK_CFLAGS) $(GTK_CFLAGS) $(GTKEXTRA_CFLAGS) ! #_gtkextramodule_la_LDFLAGS = -module -avoid-version -export-symbols-regex init_gtkextra ! _gtkextramodule_la_LDFLAGS = -module -avoid-version _gtkextramodule_la_LIBADD = $(GTKEXTRA_LIBS) $(PYGTK_LIBS) $(GTK_LIBS) _gtkextramodule_la_SOURCES = gtkextramodule.c Index: gtkextra-addons.defs =================================================================== RCS file: /cvsroot/python-gtkextra/python-gtkextra2/gtkextra/gtkextra-addons.defs,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** gtkextra-addons.defs 2 Jan 2003 22:00:53 -0000 1.4 --- gtkextra-addons.defs 26 May 2005 15:12:24 -0000 1.5 *************** *** 1,28 **** ;; Not from any header file - ;; Careful not to clash with GtkWindow.set_flags() - (define-method plot_canvas_set_flags - (of-object "GtkPlotCanvas") - (c-name "gtk_plot_canvas_set_flags") - (return-type "guint16") - (parameters - '("guint16" "flags") - ) - ) - - (define-method plot_canvas_unset_flags - (of-object "GtkPlotCanvas") - (c-name "gtk_plot_canvas_unset_flags") - (return-type "guint16") - (parameters - '("guint16" "flags") - ) - ) - (define-function _set_data_from_pyobject_callback (c-name "_set_data_from_pyobject_callback") ) - (define-function gtk_sheet_range_new (is-constructor-of "GtkSheetRange") --- 1,8 ---- Index: gtkextra-types.defs =================================================================== RCS file: /cvsroot/python-gtkextra/python-gtkextra2/gtkextra/gtkextra-types.defs,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** gtkextra-types.defs 4 Mar 2004 11:39:19 -0000 1.11 --- gtkextra-types.defs 26 May 2005 15:12:24 -0000 1.12 *************** *** 28,36 **** ) ! (define-object ComboBox (in-module "Gtk") (parent "GtkHBox") ! (c-name "GtkComboBox") ! (gtype-id "GTK_TYPE_COMBO_BOX") (fields '("GtkWidget*" "button") --- 28,36 ---- ) ! (define-object ComboButton (in-module "Gtk") (parent "GtkHBox") ! (c-name "GtkComboButton") ! (gtype-id "GTK_TYPE_COMBO_BUTTON") (fields '("GtkWidget*" "button") *************** *** 44,48 **** (define-object ColorCombo (in-module "Gtk") ! (parent "GtkComboBox") (c-name "GtkColorCombo") (gtype-id "GTK_TYPE_COLOR_COMBO") --- 44,48 ---- (define-object ColorCombo (in-module "Gtk") ! (parent "GtkComboButton") (c-name "GtkColorCombo") (gtype-id "GTK_TYPE_COLOR_COMBO") *************** *** 51,55 **** (define-object BorderCombo (in-module "Gtk") ! (parent "GtkComboBox") (c-name "GtkBorderCombo") (gtype-id "GTK_TYPE_BORDER_COMBO") --- 51,55 ---- (define-object BorderCombo (in-module "Gtk") ! (parent "GtkComboButton") (c-name "GtkBorderCombo") (gtype-id "GTK_TYPE_BORDER_COMBO") *************** *** 106,109 **** --- 106,112 ---- '("GtkWidget*" "file_list") '("GtkWidget*" "history_combo") + '("GtkWidget*" "up_button") + '("GtkWidget*" "refresh_button") + '("GtkWidget*" "home_button") '("GtkWidget*" "file_entry") '("GtkWidget*" "filter_entry") *************** *** 159,167 **** ) ! (define-object Plot3D (in-module "Gtk") ! (parent "GtkPlot") ! (c-name "GtkPlot3D") ! (gtype-id "GTK_TYPE_PLOT3_D") ) --- 162,179 ---- ) ! ;new ! (define-object PlotArray (in-module "Gtk") ! (parent "GObject") ! (c-name "GtkPlotArray") ! (gtype-id "GTK_TYPE_PLOT_ARRAY") ! ) ! ! ;new ! (define-object PlotArrayList ! (in-module "Gtk") ! (parent "GObject") ! (c-name "GtkPlotArrayList") ! (gtype-id "GTK_TYPE_PLOT_ARRAY_LIST") ) *************** *** 179,183 **** '("GtkPlotTicks" "ticks") '("GtkPlotOrientation" "orientation") - '("GtkPlotScale" "scale") '("GtkPlotLine" "line") '("GtkPlotLine" "major_grid") --- 191,194 ---- *************** *** 197,203 **** --- 208,294 ---- '("gint" "label_style") '("gint" "label_mask") + '("GtkPlotArray*" "tick_labels") ) ) + (define-object PlotCanvasChild + (in-module "Gtk") + (parent "GtkObject") + (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") + ) + ) + + (define-object PlotCanvasEllipse + (in-module "Gtk") + (parent "GtkPlotCanvasChild") + (c-name "GtkPlotCanvasEllipse") + (gtype-id "GTK_TYPE_PLOT_CANVAS_ELLIPSE") + ) + + (define-object PlotCanvasLine + (in-module "Gtk") + (parent "GtkPlotCanvasChild") + (c-name "GtkPlotCanvasLine") + (gtype-id "GTK_TYPE_PLOT_CANVAS_LINE") + ) + + (define-object PlotCanvasPixmap + (in-module "Gtk") + (parent "GtkPlotCanvasChild") + (c-name "GtkPlotCanvasPixmap") + (gtype-id "GTK_TYPE_PLOT_CANVAS_PIXMAP") + ) + + (define-object PlotCanvasPlot + (in-module "Gtk") + (parent "GtkPlotCanvasChild") + (c-name "GtkPlotCanvasPlot") + (gtype-id "GTK_TYPE_PLOT_CANVAS_PLOT") + (fields + ("GtkPlotCanvasPlotPos" "pos") + ("gint" "datapoint") + ("guint" "flags") + ) + ) + + (define-object PlotCanvasRectangle + (in-module "Gtk") + (parent "GtkPlotCanvasChild") + (c-name "GtkPlotCanvasRectangle") + (gtype-id "GTK_TYPE_PLOT_CANVAS_RECTANGLE") + ) + + (define-object PlotCanvasText + (in-module "Gtk") + (parent "GtkPlotCanvasChild") + (c-name "GtkPlotCanvasText") + (gtype-id "GTK_TYPE_PLOT_CANVAS_TEXT") + (fields + ("GtkPlotText" "text") + ) + ) + + (define-object Plot3D + (in-module "Gtk") + (parent "GtkPlot") + (c-name "GtkPlot3D") + (gtype-id "GTK_TYPE_PLOT3_D") + ) + (define-object PlotDT (in-module "Gtk") *************** *** 224,227 **** --- 315,332 ---- ) + (define-object PlotCandle + (in-module "Gtk") + (parent "GtkPlotData") + (c-name "GtkPlotCandle") + (gtype-id "GTK_TYPE_PLOT_CANDLE") + ) + + (define-object PlotBubble + (in-module "Gtk") + (parent "GtkPlotData") + (c-name "GtkPlotBubble") + (gtype-id "GTK_TYPE_PLOT_BUBBLE") + ) + (define-object PlotBox (in-module "Gtk") *************** *** 303,307 **** (define-object ToggleCombo (in-module "Gtk") ! (parent "GtkComboBox") (c-name "GtkToggleCombo") (gtype-id "GTK_TYPE_TOGGLE_COMBO") --- 408,412 ---- (define-object ToggleCombo (in-module "Gtk") ! (parent "GtkComboButton") (c-name "GtkToggleCombo") (gtype-id "GTK_TYPE_TOGGLE_COMBO") *************** *** 309,312 **** --- 414,418 ---- ;; Boxed types + ;; These need to be fixed up in gtkextra code. (define-pointer PSFont *************** *** 326,349 **** ) - ; Lot more to do from gtkplot.h. Also compare fields to accessor functions. - ; Also gtkextra code needs all of those boxed fixed up with types and macros. - - (define-boxed PlotLine - (in-module "Gtk") - (c-name "GtkPlotLine") - (gtype-id "GTK_TYPE_PLOT_LINE") - (fields - '("GtkPlotLineStyle" "line_style") - '("GdkCapStyle" "cap_style") - '("GdkJoinStyle" "join_style") - ) - ) - - (define-boxed PlotMarker - (in-module "Gtk") - (c-name "GtkPlotMarker") - (gtype-id "GTK_TYPE_PLOT_MARKER") - ) - (define-boxed PlotText (in-module "Gtk") --- 432,435 ---- *************** *** 368,395 **** ) ! (define-boxed PlotCanvasChild (in-module "Gtk") ! (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") - ;) ) --- 454,538 ---- ) ! (define-boxed PlotLine (in-module "Gtk") ! (c-name "GtkPlotLine") ! (gtype-id "GTK_TYPE_PLOT_LINE") ! (fields ! '("GtkPlotLineStyle" "line_style") ! '("GdkCapStyle" "cap_style") ! '("GdkJoinStyle" "join_style") ! '("gfloat" "line_width") ! '("GdkColor" "color") ! ) ! ) + ; (define-boxed PlotSymbol + ; (in-module "Gtk") + ; (c-name "GtkPlotSymbol") + ; (gtype-id "GTK_TYPE_PLOT_SYMBOL") + ; (fields + ; '("GtkPlotSymbolType" "symbol_type") + ; '("GtkPlotSymbolStyle" "symbol_style") + ; '("gint" "size") + ; '("GdkColor" "color") + ; '("GtkPlotLine" "border") + ; ) + ; ) + + ; (define-boxed PlotVector + ; (in-module "Gtk") + ; (c-name "GtkPlotVector") + ; (gtype-id "GTK_TYPE_PLOT_VECTOR") + ; (fields + ; '("gdouble" "x") + ; '("gdouble" "y") + ; '("gdouble" "z") + ; ) + ; ) + + ; (define-boxed PlotTick + ; (in-module "Gtk") + ; (c-name "GtkPlotTick") + ; (gtype-id "GTK_TYPE_PLOT_TICK") + ; (fields + ; '("gdouble" "value") + ; '("gbooleanb" "minor") + ; ) + ; ) + + ; (define-boxed PlotTicks + ; (in-module "Gtk") + ; (c-name "GtkPlotTicks") + ; (gtype-id "GTK_TYPE_PLOT_TICKS") + ; (fields + ; ("gdouble" "min") + ; ("gdouble" "max") + ; ("GtkPlotScale" "scale") + ; ("gint" "nmajorticks") + ; ("gint" "nminorticks") + ; ("gint" "nticks") + ; ("gdouble" "step") + ; ("gint" "nminor") + ; ("gboolean" "apply_break") + ; ("GtkPlotScale " "break_scale") + ; ("gdouble" "break_step") + ; ("gint" "break_nminor") + ; ("gdouble" "break_min") + ; ("gdouble" "break_max") + ; ("gdouble" "break_position") + ; ("GtkPlotTick*" "values") + ; ("gboolean" "set_limits") + ; ("gdouble" "begin") + ; ("gdouble" "end") + ; ) + ; ) + + (define-boxed PlotMarker + (in-module "Gtk") + (c-name "GtkPlotMarker") + (gtype-id "GTK_TYPE_PLOT_MARKER") (fields ! '("gint" "point") ) ) *************** *** 513,529 **** '("frozen" "GTK_PLOT_CANVAS_FROZEN") '("can-move" "GTK_PLOT_CANVAS_CAN_MOVE") ! '("can-x-resize" "GTK_PLOT_CANVAS_CAN_X_RESIZE") ! '("can-y-resize" "GTK_PLOT_CANVAS_CAN_Y_RESIZE") ! ) ! ) ! ! (define-flags PlotCanvasArrow ! (in-module "Gtk") ! (c-name "GtkPlotCanvasArrow") ! (gtype-id "GTK_TYPE_PLOT_CANVAS_ARROW") ! (values ! '("none" "GTK_PLOT_ARROW_NONE") ! '("origin" "GTK_PLOT_ARROW_ORIGIN") ! '("end" "GTK_PLOT_ARROW_END") ) ) --- 656,660 ---- '("frozen" "GTK_PLOT_CANVAS_FROZEN") '("can-move" "GTK_PLOT_CANVAS_CAN_MOVE") ! '("can-resize" "GTK_PLOT_CANVAS_CAN_RESIZE") ) ) *************** *** 550,575 **** ) - (define-enum PlotCanvasType - (in-module "Gtk") - (c-name "GtkPlotCanvasType") - (gtype-id "GTK_TYPE_PLOT_CANVAS_TYPE") - (values - '("none" "GTK_PLOT_CANVAS_NONE") - '("plot" "GTK_PLOT_CANVAS_PLOT") - '("axis" "GTK_PLOT_CANVAS_AXIS") - '("legends" "GTK_PLOT_CANVAS_LEGENDS") - '("title" "GTK_PLOT_CANVAS_TITLE") - '("text" "GTK_PLOT_CANVAS_TEXT") - '("data" "GTK_PLOT_CANVAS_DATA") - '("line" "GTK_PLOT_CANVAS_LINE") - '("rectangle" "GTK_PLOT_CANVAS_RECTANGLE") - '("ellipse" "GTK_PLOT_CANVAS_ELLIPSE") - '("pixmap" "GTK_PLOT_CANVAS_PIXMAP") - '("marker" "GTK_PLOT_CANVAS_MARKER") - '("polygon" "GTK_PLOT_CANVAS_POLYGON") - '("custom" "GTK_PLOT_CANVAS_CUSTOM") - ) - ) - (define-enum PlotCanvasPos (in-module "Gtk") --- 681,684 ---- *************** *** 590,593 **** --- 699,739 ---- ) + (define-flags PlotCanvasArrow + (in-module "Gtk") + (c-name "GtkPlotCanvasArrow") + (gtype-id "GTK_TYPE_PLOT_CANVAS_ARROW") + (values + '("none" "GTK_PLOT_CANVAS_ARROW_NONE") + '("origin" "GTK_PLOT_CANVAS_ARROW_ORIGIN") + '("end" "GTK_PLOT_CANVAS_ARROW_END") + ) + ) + + (define-enum PlotCanvasPlotPos + (in-module "Gtk") + (c-name "GtkPlotCanvasPlotPos") + (gtype-id "GTK_TYPE_PLOT_CANVAS_PLOT_POS") + (values + '("out" "GTK_PLOT_CANVAS_PLOT_OUT") + '("in-plot" "GTK_PLOT_CANVAS_PLOT_IN_PLOT") + '("in-legends" "GTK_PLOT_CANVAS_PLOT_IN_LEGENDS") + '("in-title" "GTK_PLOT_CANVAS_PLOT_IN_TITLE") + '("in-axis" "GTK_PLOT_CANVAS_PLOT_IN_AXIS") + '("in-data" "GTK_PLOT_CANVAS_PLOT_IN_DATA") + '("in-gradient" "GTK_PLOT_CANVAS_PLOT_IN_GRADIENT") + '("in-marker" "GTK_PLOT_CANVAS_PLOT_IN_MARKER") + ) + ) + + ;(define-flags PlotCanvasPlotFlag + ; (in-module "Gtk") + ; (c-name "GtkPlotCanvasPlotFlag") + ; (gtype-id "GTK_TYPE_PLOT_CANVAS_PLOT_FLAG") + ; (values + ; '("select_point" "GTK_PLOT_CANVAS_PLOT_SELECT_POINT") + ; '("dnd_point" "GTK_PLOT_CANVAS_PLOT_DND_POINT") + ; ) + ;) + (define-enum PlotProjection (in-module "Gtk") *************** *** 784,787 **** --- 930,944 ---- ) + (define-flags PlotArrow + (in-module "Gtk") + (c-name "GtkPlotArrow") + (gtype-id "GTK_TYPE_PLOT_ARROW") + (values + '("none" "GTK_PLOT_ARROW_NONE") + '("origin" "GTK_PLOT_ARROW_ORIGIN") + '("end" "GTK_PLOT_ARROW_END") + ) + ) + (define-enum SheetAttrType (in-module "Gtk") Index: gtkextra.defs =================================================================== RCS file: /cvsroot/python-gtkextra/python-gtkextra2/gtkextra/gtkextra.defs,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** gtkextra.defs 31 Mar 2004 20:56:47 -0000 1.13 --- gtkextra.defs 26 May 2005 15:12:24 -0000 1.14 *************** *** 142,159 **** ) ! (define-function gtk_combobox_get_type ! (c-name "gtk_combobox_get_type") (return-type "GtkType") ) ! (define-function gtk_combobox_new ! (is-constructor-of "GtkCombobox") ! (c-name "gtk_combobox_new") [...1816 lines suppressed...] ! (define-method ticks_inverse ! (of-object "GtkPlotAxis") ! (c-name "gtk_plot_axis_ticks_inverse") ! (return-type "gdouble") ! (parameters ! '("gdouble" "x") ! ) ! ) ! ! (define-method parse_label ! (of-object "GtkPlotAxis") ! (c-name "gtk_plot_axis_parse_label") ! (return-type "none") ! (parameters ! '("gdouble" "val") ! '("gint" "precision") ! '("gint" "style") ! '("gchar*" "label") ) ) Index: gtkextra.override =================================================================== RCS file: /cvsroot/python-gtkextra/python-gtkextra2/gtkextra/gtkextra.override,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** gtkextra.override 9 Mar 2004 11:43:15 -0000 1.20 --- gtkextra.override 26 May 2005 15:12:24 -0000 1.21 *************** *** 24,27 **** --- 24,29 ---- */ + //#define _DEBUG + #define NO_IMPORT_PYGOBJECT #include <pygobject.h> *************** *** 42,70 **** }; - /* - This exists in pygtk/gtk/gtk-types.c. It is not static there, but - is exported for our use. Especially since dlopen is now not done - with RTLD_GLOBAL flags by default. Might wish to ask James if it - could be published or if there is another way. - */ - - static gboolean - pygdk_rectangle_from_pyobject(PyObject *object, GdkRectangle *rectangle) - { - g_return_val_if_fail(rectangle != NULL, FALSE); - - if (pyg_boxed_check(object, GDK_TYPE_RECTANGLE)) { - *rectangle = *pyg_boxed_get(object, GdkRectangle); - return TRUE; - } - if (PyArg_ParseTuple(object, "iiii", &rectangle->x, &rectangle->y, - &rectangle->width, &rectangle->height)) { - return TRUE; - } - PyErr_Clear(); - PyErr_SetString(PyExc_TypeError, "could not convert to GdkRectangle"); - return FALSE; - } - /* ---------------------------------------------------------------------- Fixup boo-boo's or ommissions. Probably should be fixed in gtkextra. --- 44,47 ---- *************** *** 72,76 **** #define GTK_ICON_FILE_SEL GTK_ICON_FILESEL #define GTK_TYPE_ICON_FILE_SEL (gtk_icon_file_selection_get_type()) ! #define GTK_TYPE_COMBO_BOX (gtk_combobox_get_type()) #define GTK_TYPE_COLOR_COMBO (gtk_color_combo_get_type()) #define GTK_TYPE_BORDER_COMBO (gtk_border_combo_get_type()) --- 49,53 ---- #define GTK_ICON_FILE_SEL GTK_ICON_FILESEL #define GTK_TYPE_ICON_FILE_SEL (gtk_icon_file_selection_get_type()) ! #define GTK_TYPE_COMBO_BUTTON (gtk_combo_button_get_type()) #define GTK_TYPE_COLOR_COMBO (gtk_color_combo_get_type()) #define GTK_TYPE_BORDER_COMBO (gtk_border_combo_get_type()) *************** *** 78,81 **** --- 55,59 ---- #define GTK_TYPE_PLOT3_D (gtk_plot3d_get_type()) #define GTK_TYPE_TOGGLE_COMBO (gtk_toggle_combo_get_type()) + #define GTK_TYPE_PLOT_CANDLE (gtk_plot_candle_get_type()) /* Hack boxed types. Just enough to let code generator compile. Not correct! *************** *** 253,259 **** #define GTK_PLOT3_D GTK_PLOT3D - guint16 gtk_plot_canvas_set_flags(GtkPlotCanvas *canvas, guint16 flags) { return GTK_PLOT_CANVAS_SET_FLAGS(canvas, flags); } - guint16 gtk_plot_canvas_unset_flags(GtkPlotCanvas *canvas, guint16 flags) { return GTK_PLOT_CANVAS_UNSET_FLAGS(canvas, flags); } - /* cpp abuse */ #define _GET_ONE_DOUBLE(_f, _c) static PyObject * \ --- 231,234 ---- *************** *** 650,701 **** } %% - override-attr GtkPlotCanvasChild.data - static PyObject * - _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: - Py_INCREF(Py_None); - return Py_None; - - case GTK_PLOT_CANVAS_TEXT: - #if 0 // When boxed correctly - return pyg_boxed_new(GTK_TYPE_PLOT_TEXT, pyg_boxed_get(self, GtkPlotCanvasChild)->data, TRUE, TRUE); - #else // Might also be ok when boxed correctly. - 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); - } - } - %% override gtk_plot_data_new kwargs static int --- 625,628 ---- *************** *** 853,857 **** pygtkextra_plot_data_set(PyGObject *self, PyObject *value, const char *key, ! void (*func) (GtkPlotData *plot_data, gdouble *pd)) { gdouble *pd = NULL; --- 780,784 ---- pygtkextra_plot_data_set(PyGObject *self, PyObject *value, const char *key, ! GtkPlotArray * (*func) (GtkPlotData *plot_data, gdouble *pd)) { gdouble *pd = NULL; *************** *** 1005,1017 **** return NULL; ! if ( (plot_data -> x && pygtkextra_dict_set_item_double(py_ret, "x", x)) ! || (plot_data -> y && pygtkextra_dict_set_item_double(py_ret, "y", y)) ! || (plot_data -> z && pygtkextra_dict_set_item_double(py_ret, "z", z)) ! || (plot_data -> a && pygtkextra_dict_set_item_double(py_ret, "a", a)) ! || (plot_data -> dx && pygtkextra_dict_set_item_double(py_ret, "dx", dx)) ! || (plot_data -> dy && pygtkextra_dict_set_item_double(py_ret, "dy", dy)) ! || (plot_data -> dz && pygtkextra_dict_set_item_double(py_ret, "dz", dz)) ! || (plot_data -> da && pygtkextra_dict_set_item_double(py_ret, "da", da)) ! || (plot_data -> labels && pygtkextra_dict_set_item_string(py_ret, "label", label)) ) { Py_DECREF(py_ret); return NULL; --- 932,944 ---- return NULL; ! if ( (gtk_plot_data_find_dimension(plot_data, "x") && pygtkextra_dict_set_item_double(py_ret, "x", x)) ! || (gtk_plot_data_find_dimension(plot_data, "y") && pygtkextra_dict_set_item_double(py_ret, "y", y)) ! || (gtk_plot_data_find_dimension(plot_data, "z") && pygtkextra_dict_set_item_double(py_ret, "z", z)) ! || (gtk_plot_data_find_dimension(plot_data, "a") && pygtkextra_dict_set_item_double(py_ret, "a", a)) ! || (gtk_plot_data_find_dimension(plot_data, "dx") && pygtkextra_dict_set_item_double(py_ret, "dx", dx)) ! || (gtk_plot_data_find_dimension(plot_data, "dy") && pygtkextra_dict_set_item_double(py_ret, "dy", dy)) ! || (gtk_plot_data_find_dimension(plot_data, "dz") && pygtkextra_dict_set_item_double(py_ret, "dz", dz)) ! || (gtk_plot_data_find_dimension(plot_data, "da") && pygtkextra_dict_set_item_double(py_ret, "da", da)) ! || (gtk_plot_data_find_dimension(plot_data, "labels") && pygtkextra_dict_set_item_string(py_ret, "label", label)) ) { Py_DECREF(py_ret); return NULL; *************** *** 1427,1444 **** _GET_TWO_DOUBLE(gtk_plot_get_size, GTK_PLOT) %% ! override gtk_plot_axis_get_attributes kwargs static PyObject * ! _wrap_gtk_plot_axis_get_attributes(PyGObject *self, PyObject *args, PyObject *kwargs) { - static char *kwlist[] = { "axis", NULL }; - PyObject *py_axis = NULL; gfloat width; GdkColor color = {0, }; ! GtkPlotAxisPos axis; ! if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O:GtkPlot.axis_get_attributes", kwlist, &py_axis)) ! return NULL; ! if (pyg_enum_get_value(GTK_TYPE_PLOT_AXIS_POS, py_axis, (gint *)&axis)) ! return NULL; ! gtk_plot_axis_get_attributes(GTK_PLOT(self->obj), axis, &width, &color); return Py_BuildValue("(dN)", (double)width, pyg_boxed_new(GDK_TYPE_COLOR, &color, TRUE, TRUE)); } --- 1354,1364 ---- _GET_TWO_DOUBLE(gtk_plot_get_size, GTK_PLOT) %% ! override gtk_plot_axis_get_attributes noargs static PyObject * ! _wrap_gtk_plot_axis_get_attributes(PyGObject *self) { gfloat width; GdkColor color = {0, }; ! gtk_plot_axis_get_attributes(GTK_PLOT_AXIS(self->obj), &width, &color); return Py_BuildValue("(dN)", (double)width, pyg_boxed_new(GDK_TYPE_COLOR, &color, TRUE, TRUE)); } Index: mycodegen.py =================================================================== RCS file: /cvsroot/python-gtkextra/python-gtkextra2/gtkextra/mycodegen.py,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** mycodegen.py 30 Dec 2002 20:42:13 -0000 1.2 --- mycodegen.py 26 May 2005 15:12:24 -0000 1.3 *************** *** 14,17 **** matcher.register('GdkWChar', matcher.get('gint32')) ! codegen.codegen.main() ! --- 14,16 ---- matcher.register('GdkWChar', matcher.get('gint32')) ! codegen.codegen.main(sys.argv) |
|
From: <pyt...@li...> - 2005-05-26 15:12:33
|
Update of /cvsroot/python-gtkextra/python-gtkextra2/examples In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8776/examples Modified Files: test.sh testgtkplot.py testrealtime.py Removed Files: common.py Log Message: First cut at building with Python-2.4.1, gtk+-2.6.7, pygtk-2.6.2. Test programs testgtkplot.py and testrealtime.py run but not exactly as the C version yet. Index: test.sh =================================================================== RCS file: /cvsroot/python-gtkextra/python-gtkextra2/examples/test.sh,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** test.sh 2 Jul 2003 16:03:45 -0000 1.5 --- test.sh 26 May 2005 15:12:24 -0000 1.6 *************** *** 1,3 **** --- 1,5 ---- #!/bin/sh + PYTHON=${PYTHON:-python} + [ $1 = "-gdb" ] && DEBUG=1 && shift *************** *** 13,20 **** if test -z $DEBUG; then ! python -c "import common;execfile('$1')" else ! python -c "\ ! import common import os raw_input('Attach gdb on %d. Press return to begin \"$1\".' % os.getpid()) --- 15,33 ---- if test -z $DEBUG; then ! $PYTHON -c "\ ! try: ! import common; ! print 'Using:', common.__file__ ! except ImportError: ! pass ! execfile('$1') ! " else ! $PYTHON -c "\ ! try: ! import common; ! print 'Using:', common.__file__ ! except ImportError: ! pass import os raw_input('Attach gdb on %d. Press return to begin \"$1\".' % os.getpid()) Index: testgtkplot.py =================================================================== RCS file: /cvsroot/python-gtkextra/python-gtkextra2/examples/testgtkplot.py,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** testgtkplot.py 17 Apr 2003 16:39:51 -0000 1.10 --- testgtkplot.py 26 May 2005 15:12:24 -0000 1.11 *************** *** 5,13 **** class Application(gtk.Window): - scale = 1.0 ! def __del__(self): ! print 'Application.__del__' ! def __init__(self): self.nlayers = 0 --- 5,11 ---- class Application(gtk.Window): scale = 1.0 ! custom_labels = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"] ! def __init__(self): self.nlayers = 0 *************** *** 15,25 **** self.plots = [] ! page_width = gtkextra.PLOT_LETTER_W * self.scale ! page_height = gtkextra.PLOT_LETTER_H * self.scale gtk.Window.__init__(self) self.set_title("GtkPlot Demo") self.set_size_request(550, 650) ! #self.set_size_request(page_width, page_height) scrollwin = gtk.ScrolledWindow() --- 13,23 ---- self.plots = [] ! page_width = int(gtkextra.PLOT_LETTER_W * self.scale) ! page_height = int(gtkextra.PLOT_LETTER_H * self.scale) gtk.Window.__init__(self) self.set_title("GtkPlot Demo") self.set_size_request(550, 650) ! self.set_border_width(0) scrollwin = gtk.ScrolledWindow() *************** *** 32,36 **** self.canvas = canvas = gtkextra.PlotCanvas(page_width, page_height) ! canvas.plot_canvas_set_flags(gtkextra.PLOT_CANVAS_DND_FLAGS) scrollwin.add_with_viewport(canvas) canvas.set_size(page_width, page_height) --- 30,36 ---- self.canvas = canvas = gtkextra.PlotCanvas(page_width, page_height) ! #canvas.plot_canvas_set_flags(gtkextra.PLOT_CANVAS_DND_FLAGS) ! canvas.set_property("flags", canvas.get_property("flags") | gtkextra.PLOT_CANVAS_DND_FLAGS) ! scrollwin.add_with_viewport(canvas) canvas.set_size(page_width, page_height) *************** *** 38,52 **** plot = self.new_layer(canvas) plot.set_range(-1.0, 1.0, -1.0, 1.4) ! plot.legends_move(0.51, 0.05) plot.set_legends_border(gtkextra.PLOT_BORDER_NONE, gtkextra.PLOT_BORDER_NONE) ! plot.axis_hide_title(gtkextra.PLOT_AXIS_TOP) ! plot.axis_set_ticks(gtkextra.PLOT_AXIS_X, 1.0, 1) ! plot.axis_set_ticks(gtkextra.PLOT_AXIS_Y, 1.0, 1) ! plot.axis_set_visible(gtkextra.PLOT_AXIS_TOP, gtk.TRUE) ! plot.axis_set_visible(gtkextra.PLOT_AXIS_RIGHT, gtk.TRUE) ! plot.x0_set_visible(gtk.TRUE) ! plot.y0_set_visible(gtk.TRUE) ! plot.axis_set_labels_suffix(gtkextra.PLOT_AXIS_LEFT, "%"); ! canvas.add_plot(plot, 0.15, 0.06) self.build_example1(plot) --- 38,70 ---- plot = self.new_layer(canvas) plot.set_range(-1.0, 1.0, -1.0, 1.4) ! plot.legends_move(0.500, 0.05) plot.set_legends_border(gtkextra.PLOT_BORDER_NONE, gtkextra.PLOT_BORDER_NONE) ! ! axis_left = plot.get_axis(gtkextra.PLOT_AXIS_LEFT) ! axis_right = plot.get_axis(gtkextra.PLOT_AXIS_RIGHT) ! axis_top = plot.get_axis(gtkextra.PLOT_AXIS_TOP) ! axis_bottom = plot.get_axis(gtkextra.PLOT_AXIS_BOTTOM) ! axis_x = plot.get_axis(gtkextra.PLOT_AXIS_X) ! axis_y = plot.get_axis(gtkextra.PLOT_AXIS_Y) ! ! axis_top.hide_title() ! axis_bottom.show_ticks(15, 3) ! axis_x.set_ticks(1.0, 1) ! axis_y.set_ticks(1.0, 1) ! axis_top.set_visible(True) ! axis_right.set_visible(True) ! axis_x.set_visible(True) ! axis_y.set_visible(True) ! plot.x0_set_visible(True) ! plot.y0_set_visible(True) ! axis_left.set_labels_suffix("%") ! ! child = gtkextra.PlotCanvasPlot(plot) ! canvas.put_child(child, .15, .06, .65, .31); ! plot.show() ! #child.set_property("flags", ! # child.get_property("flags") | ! # gtkextra.PLOT_CANVAS_PLOT_SELECT_POINT | ! # gtkextra.PLOT_CANVAS_PLOT_DND_POINT) self.build_example1(plot) *************** *** 55,90 **** plot.legends_set_attributes(None, 0, None, light_blue) plot.set_range(0.0, 1.0, 0.0, 0.85) ! plot.axis_set_visible(gtkextra.PLOT_AXIS_TOP, gtk.TRUE) ! plot.axis_set_visible(gtkextra.PLOT_AXIS_RIGHT, gtk.TRUE) ! plot.axis_hide_title(gtkextra.PLOT_AXIS_TOP) ! plot.axis_hide_title(gtkextra.PLOT_AXIS_RIGHT) ! plot.grids_set_visible(gtk.TRUE, gtk.TRUE, gtk.TRUE, gtk.TRUE) plot.set_legends_border(gtkextra.PLOT_BORDER_SHADOW, 3) plot.legends_move(0.58, 0.05) ! canvas.add_plot(plot, 0.15, 0.4) self.build_example2(plot) ! canvas.connect("move_item", self.move_item) canvas.connect("select_item", self.select_item) - canvas.put_text(0.40, 0.02, "Helvetica", 16, 0, None, None, - gtk.TRUE, gtk.JUSTIFY_CENTER, "DnD titles, legends and plots") - canvas.put_text(0.40, 0.72, "Helvetica", 16, 0, None, None, - gtk.TRUE, gtk.JUSTIFY_CENTER, - "You can use \\ssubscripts\\b\\b\\b\\b\\b\\b\\b"\ - "\\b\\b\\b\\N\\Ssuperscripts") - child = canvas.put_text(0.40, 0.755, "Helvetica", 16, 0, None, None, - gtk.TRUE, gtk.JUSTIFY_CENTER, - "Format text mixing \\Bbold \\N\\i, italics, "\ - "\\ggreek \\4\\N and \\+different fonts") ! child.data.set_border(gtkextra.PLOT_BORDER_SHADOW, 2, 0, 2) self.show_all() ! ! canvas.export_ps_with_size("plotdemo.ps", epsflag=gtk.TRUE) print "Wrote plotdemo.ps" - def move_item(self, canvas, item, new_x, new_y, *args): print "move_item" --- 73,112 ---- plot.legends_set_attributes(None, 0, None, light_blue) plot.set_range(0.0, 1.0, 0.0, 0.85) ! ! axis_right = plot.get_axis(gtkextra.PLOT_AXIS_RIGHT) ! axis_top = plot.get_axis(gtkextra.PLOT_AXIS_TOP) ! axis_top.set_visible(True) ! axis_right.set_visible(True) ! axis_top.hide_title() ! axis_right.hide_title() ! plot.grids_set_visible(True, True, True, True) plot.set_legends_border(gtkextra.PLOT_BORDER_SHADOW, 3) plot.legends_move(0.58, 0.05) ! plot.show() ! ! child = gtkextra.PlotCanvasPlot(plot) ! canvas.put_child(child, .15, .4, .65, .65) ! plot.show() self.build_example2(plot) ! #canvas.connect("move_item", self.move_item) canvas.connect("select_item", self.select_item) ! child = gtkextra.PlotCanvasText("Times-BoldItalic", 16, 0, None, None, True, gtk.JUSTIFY_CENTER, ! "DnD titles, legends and plots") ! canvas.put_child(child, .40, .020, .0, .0) ! child = gtkextra.PlotCanvasText("Times-Roman", 16, 0, None, None, True, gtk.JUSTIFY_CENTER, ! "You can use \\ssubscripts\\b\\b\\b\\b\\b\\b\\b\\b\\b\\b\\N\\Ssuperscripts"); ! canvas.put_child(child, .40, .720, .0, .0) ! child = gtkextra.PlotCanvasText("Times-Roman", 12, 0, None, None, True, gtk.JUSTIFY_CENTER, ! "Format text mixing \\Bbold \\N\\i, italics, \\ggreek \\4\\N and \\+different fonts"); ! canvas.put_child(child, .40, .765, .0, .0) ! child.text.set_border(gtkextra.PLOT_BORDER_SHADOW, 2, 0, 2) #FIXME: does not work self.show_all() ! canvas.export_ps_with_size("plotdemo.ps", epsflag=True) print "Wrote plotdemo.ps" def move_item(self, canvas, item, new_x, new_y, *args): print "move_item" *************** *** 98,134 **** y[i] = new_y data.set_points(x=x, y=y, dx=dx, dy=dy) ! return gtk.TRUE ! def select_item(self, canvas, event, item, *args): ! if item.type == gtkextra.PLOT_CANVAS_TEXT: print "Item selected: TEXT" ! elif item.type == gtkextra.PLOT_CANVAS_TITLE: ! print "Item selected: TITLE" ! elif item.type == gtkextra.PLOT_CANVAS_LEGENDS: ! print "Item selected: LEGENDS" ! elif item.type == gtkextra.PLOT_CANVAS_PLOT: ! print "Item selected: PLOT" ! elif item.type == gtkextra.PLOT_CANVAS_AXIS: ! print "Item selected: AXIS" ! elif item.type == gtkextra.PLOT_CANVAS_PIXMAP: print "Item selected: PIXMAP" ! elif item.type == gtkextra.PLOT_CANVAS_DATA: ! print "Item selected: DATA" ! (i, x, y) = canvas.get_active_point() ! print "Active point: %d -> %f %f" % (i, x, y) ! canvas.get_active_data().add_marker(i) ! canvas.get_active_plot().queue_draw() ! elif item.type == gtkextra.PLOT_CANVAS_MARKER: ! print "Item selected: MARKER" ! elif item.type == gtkextra.PLOT_CANVAS_NONE: ! print "Item selected: NONE" ! plot = canvas.get_active_plot() ! for n in xrange(self.nlayers): ! if plot == self.plots[n]: ! canvas.set_active_plot(plot) ! self.buttons[n].set_active(gtk.TRUE) ! else: ! self.buttons[n].set_active(gtk.FALSE) ! return gtk.TRUE def activate_plot(self, button, canvas, *args): --- 120,160 ---- y[i] = new_y data.set_points(x=x, y=y, dx=dx, dy=dy) ! return True ! def select_item(self, canvas, event, item): ! if isinstance(item, gtkextra.PlotCanvasText): print "Item selected: TEXT" ! elif isinstance(item, gtkextra.PlotCanvasPixmap): print "Item selected: PIXMAP" ! elif isinstance(item, gtkextra.PlotCanvasRectangle): ! print "Item selected: RECTANGLE" ! elif isinstance(item, gtkextra.PlotCanvasEllipse): ! print "Item selected: ELLIPSE" ! elif isinstance(item, gtkextra.PlotCanvasLine): ! print "Item selected: LINE" ! elif isinstance(item, gtkextra.PlotCanvasPlot): ! #print "Item selected: PLOT", item.pos ! if item.pos == gtkextra.PLOT_CANVAS_PLOT_IN_TITLE: ! print "Item selected: TITLE" ! elif item.pos == gtkextra.PLOT_CANVAS_PLOT_IN_LEGENDS: ! print "Item selected: LEGENDS" ! elif item.pos == gtkextra.PLOT_CANVAS_PLOT_IN_PLOT: ! print "Item selected: PLOT" ! elif item.pos == gtkextra.PLOT_CANVAS_PLOT_IN_AXIS: ! print "Item selected: AXIS" ! elif item.pos == gtkextra.PLOT_CANVAS_PLOT_IN_MARKER: ! print "Item selected: MARKER" ! elif item.pos == gtkextra.PLOT_CANVAS_PLOT_IN_GRADIENT: ! print "Item selected: GRADIENT" ! elif item.pos == gtkextra.PLOT_CANVAS_PLOT_IN_DATA: ! print "Item selected: DATA" ! #FIXME ! #x = gtk_plot_data_get_x(GTK_PLOT_CANVAS_PLOT(child)->data, &n); ! #y = gtk_plot_data_get_y(GTK_PLOT_CANVAS_PLOT(child)->data, &n); ! #n = GTK_PLOT_CANVAS_PLOT(child)->datapoint; ! #printf("Item selected: DATA\n"); ! #printf("Active point: %d -> %f %f\n", ! #GTK_PLOT_CANVAS_PLOT(child)->datapoint, x[n], y[n]); ! return True def activate_plot(self, button, canvas, *args): *************** *** 138,143 **** canvas.set_active_plot(self.plots[n]) else: ! self.buttons[n].set_active(gtk.FALSE) ! return gtk.TRUE def activate_button(self, canvas, *args): --- 164,169 ---- canvas.set_active_plot(self.plots[n]) else: ! self.buttons[n].set_active(False) ! return True def activate_button(self, canvas, *args): *************** *** 145,152 **** for n in xrange(self.nlayers): if plot == self.plots[n]: ! self.buttons[n].set_active(gtk.TRUE) else: ! self.buttons[n].set_active(gtk.FALSE) ! return gtk.TRUE def new_layer(self, canvas): --- 171,178 ---- for n in xrange(self.nlayers): if plot == self.plots[n]: ! self.buttons[n].set_active(True) else: ! self.buttons[n].set_active(False) ! return True def new_layer(self, canvas): *************** *** 155,164 **** button.set_size_request(20, 20) canvas.put(button, (self.nlayers - 1) * 20, 0) ! button.connect("toggled", self.activate_plot, canvas) plot = gtkextra.Plot() plot.resize(0.5, 0.25) self.buttons.append(button) self.plots.append(plot) ! button.set_active(gtk.TRUE) return plot --- 181,190 ---- button.set_size_request(20, 20) canvas.put(button, (self.nlayers - 1) * 20, 0) ! #button.connect("toggled", self.activate_plot, canvas) #FIXME plot = gtkextra.Plot() plot.resize(0.5, 0.25) self.buttons.append(button) self.plots.append(plot) ! button.set_active(True) return plot *************** *** 180,183 **** --- 206,210 ---- data = gtkextra.PlotData() + data.show() plot.add_data(data) data.set_points(x=px1, y=py1, dx=dx1, dy=dy1) *************** *** 187,195 **** data.show_yerrbars() data.set_legend("Spline + EY") ! data.show_labels(gtk.TRUE) data.set_labels(['0', '1', '2', '3', '4', '5']) ! data.set_labels(['0', '1', '2', '3', '4', '99']) ! data = gtkextra.PlotData() plot.add_data(data) data.set_points(x=px2, y=py2, dx=dx2, dy=dy2) --- 214,222 ---- data.show_yerrbars() data.set_legend("Spline + EY") ! data.show_labels(True) data.set_labels(['0', '1', '2', '3', '4', '5']) ! data = gtkextra.PlotData() + data.show() plot.add_data(data) data.set_points(x=px2, y=py2, dx=dx2, dy=dy2) *************** *** 202,205 **** --- 229,233 ---- data = plot.add_function(self.function) + data.show() data.set_line_attributes(gtkextra.PLOT_LINE_SOLID, 0, 0, 0, blue) data.set_legend("Function Plot") *************** *** 215,222 **** --- 243,252 ---- data = plot.add_function(self.gaussian) + data.show() data.set_line_attributes(gtkextra.PLOT_LINE_DASHED, 0, 0, 2, dark_green) data.set_legend("Gaussian") data = gtkextra.PlotBar(gtk.ORIENTATION_VERTICAL) + data.show() plot.add_data(data) data.set_points(x=px2, y=py2, dx=dx2) Index: testrealtime.py =================================================================== RCS file: /cvsroot/python-gtkextra/python-gtkextra2/examples/testrealtime.py,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** testrealtime.py 17 Apr 2003 16:39:51 -0000 1.4 --- testrealtime.py 26 May 2005 15:12:24 -0000 1.5 *************** *** 1,4 **** --- 1,5 ---- #!/usr/bin/env python + import gobject import gtk, gtkextra from random import randint *************** *** 7,11 **** def __init__(self): ! gtk.Window.__init__(self) self.set_title("GtkPlot Real Time Demo") self.set_size_request(550, 600) --- 8,13 ---- def __init__(self): ! #gtk.Window.__init__(self) ! self.__gobject_init__() self.set_title("GtkPlot Real Time Demo") self.set_size_request(550, 600) *************** *** 31,66 **** plot.set_background(light_yellow) plot.legends_set_attributes(None, 0, None, white) - plot.set_range(0.0, 20.0, 0.0, 1.0) - plot.axis_set_ticks(gtkextra.PLOT_AXIS_X, 2.0, 1) - plot.axis_set_ticks(gtkextra.PLOT_AXIS_Y, 0.1, 1) - plot.axis_set_labels_style(gtkextra.PLOT_AXIS_TOP, gtkextra.PLOT_LABEL_FLOAT, 0) - plot.axis_set_labels_style(gtkextra.PLOT_AXIS_BOTTOM, gtkextra.PLOT_LABEL_FLOAT, 0) - plot.axis_set_visible(gtkextra.PLOT_AXIS_TOP, gtk.TRUE) - plot.axis_set_visible(gtkextra.PLOT_AXIS_RIGHT, gtk.TRUE) - plot.grids_set_visible(gtk.TRUE, gtk.TRUE, gtk.TRUE, gtk.TRUE) - plot.axis_hide_title(gtkextra.PLOT_AXIS_TOP) - plot.axis_hide_title(gtkextra.PLOT_AXIS_RIGHT) - plot.axis_set_title(gtkextra.PLOT_AXIS_LEFT, "Intensity") - plot.axis_set_title(gtkextra.PLOT_AXIS_BOTTOM, "Time (s)") plot.set_legends_border(gtkextra.PLOT_BORDER_SHADOW, 3) plot.legends_move(0.60, 0.10) - canvas.add_plot(plot, 0.15, 0.15) ! #canvas.put_text(0.45, 0.05, "Times-BoldItalic", 20, 0, None, None, ! #canvas.put_text(0.45, 0.05, "Courier-Bold", 20, 0, None, None, #OK ! canvas.put_text(0.45, 0.05, "Helvetica", 20, 0, None, None, #OK ! gtk.TRUE, gtk.JUSTIFY_CENTER, "Real Time Demo") data = gtkextra.PlotData() plot.add_data(data) data.set_legend("Random pulse") data.set_symbol(gtkextra.PLOT_SYMBOL_DIAMOND, gtkextra.PLOT_SYMBOL_OPAQUE, 10, 2, red, red) data.set_line_attributes(gtkextra.PLOT_LINE_SOLID, 0, 0, 1, red) ! plot.clip_data(gtk.TRUE) self.show_all() ! gtk.timeout_add(1000, self.update, canvas, plot, data) def update(self, canvas, plot, data, *args): --- 33,84 ---- plot.set_background(light_yellow) plot.legends_set_attributes(None, 0, None, white) plot.set_legends_border(gtkextra.PLOT_BORDER_SHADOW, 3) plot.legends_move(0.60, 0.10) ! plot.set_range(0.0, 20.0, 0.0, 1.0) ! plot.set_ticks(gtkextra.PLOT_AXIS_X, 2, 1) ! plot.set_ticks(gtkextra.PLOT_AXIS_Y, .1, 1) ! ! axis_left = plot.get_axis(gtkextra.PLOT_AXIS_LEFT) ! axis_right = plot.get_axis(gtkextra.PLOT_AXIS_RIGHT) ! axis_top = plot.get_axis(gtkextra.PLOT_AXIS_TOP) ! axis_bottom = plot.get_axis(gtkextra.PLOT_AXIS_BOTTOM) ! axis_x = plot.get_axis(gtkextra.PLOT_AXIS_X) ! axis_y = plot.get_axis(gtkextra.PLOT_AXIS_Y) ! ! axis_top.set_labels_style(gtkextra.PLOT_LABEL_FLOAT, 0) ! axis_bottom.set_labels_style(gtkextra.PLOT_LABEL_FLOAT, 0) ! ! axis_top.set_visible(True) ! axis_right.set_visible(True) ! plot.grids_set_visible(True, True, True, True) ! ! axis_top.hide_title() ! axis_right.hide_title() ! axis_left.set_title("Intensity") ! axis_bottom.set_title("Time (s)") ! ! child = gtkextra.PlotCanvasPlot(plot) ! canvas.put_child(child, .15, .15, .80, .65); ! plot.show() ! ! child = gtkextra.PlotCanvasText("Times-BoldItalic", 20, 0, None, None, True, gtk.JUSTIFY_CENTER, "Real Time Demo") ! canvas.put_child(child, .45, .05, 0., 0.) data = gtkextra.PlotData() plot.add_data(data) + data.show() data.set_legend("Random pulse") data.set_symbol(gtkextra.PLOT_SYMBOL_DIAMOND, gtkextra.PLOT_SYMBOL_OPAQUE, 10, 2, red, red) data.set_line_attributes(gtkextra.PLOT_LINE_SOLID, 0, 0, 1, red) ! plot.clip_data(True) ! ! canvas.paint() ! canvas.refresh() self.show_all() ! gobject.timeout_add(100, self.update, canvas, plot, data) def update(self, canvas, plot, data, *args): *************** *** 90,94 **** canvas.refresh() ! return gtk.TRUE def button_press_handler(self, canvas, event, *extra): --- 108,112 ---- canvas.refresh() ! return True def button_press_handler(self, canvas, event, *extra): --- common.py DELETED --- |
|
From: <pyt...@li...> - 2004-03-31 21:08:38
|
Update of /cvsroot/python-gtkextra/python-gtkextra2/gtkextra In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2128/gtkextra Modified Files: gtkextra.defs Log Message: fix GtkSheet.cell_get_text() Index: gtkextra.defs =================================================================== RCS file: /cvsroot/python-gtkextra/python-gtkextra2/gtkextra/gtkextra.defs,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** gtkextra.defs 2 Jul 2003 16:25:07 -0000 1.12 --- gtkextra.defs 31 Mar 2004 20:56:47 -0000 1.13 *************** *** 5721,5725 **** (of-object "GtkSheet") (c-name "gtk_sheet_cell_get_text") ! (return-type "gchar*" (null-ok)) (parameters '("gint" "row") --- 5721,5725 ---- (of-object "GtkSheet") (c-name "gtk_sheet_cell_get_text") ! (return-type "const-gchar*" (null-ok)) (parameters '("gint" "row") |
|
From: <pyt...@li...> - 2004-03-31 21:08:38
|
Update of /cvsroot/python-gtkextra/python-gtkextra2 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2128 Modified Files: ChangeLog Log Message: fix GtkSheet.cell_get_text() Index: ChangeLog =================================================================== RCS file: /cvsroot/python-gtkextra/python-gtkextra2/ChangeLog,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** ChangeLog 4 Mar 2004 11:39:18 -0000 1.2 --- ChangeLog 31 Mar 2004 20:56:47 -0000 1.3 *************** *** 1,5 **** 2004-03-04 Bernhard Rumpler <ru...@tt...> ! * gtk/gtkextra.override: Provided overrides for gtk_sheet_get_active_cell, gtk_sheet_get_pixel_info, and gtk_sheet_put --- 1,11 ---- + 2004-03-31 Toby D. Reeves <to...@so...> + + * gtkextra.gtkextra.defs: Make gtk_sheet_cell_get_text return a const-gchar* + to avoid generated code from g_free'ing the return pointer. + Reported by Bernhard Rumpler <ru...@tt...>. + 2004-03-04 Bernhard Rumpler <ru...@tt...> ! * gtkextra/gtkextra.override: Provided overrides for gtk_sheet_get_active_cell, gtk_sheet_get_pixel_info, and gtk_sheet_put |
|
From: <pyt...@li...> - 2004-03-09 12:00:23
|
Update of /cvsroot/python-gtkextra/python-gtkextra2/gtkextra In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23653 Modified Files: gtkextra.override Log Message: GtkSheet fixes Index: gtkextra.override =================================================================== RCS file: /cvsroot/python-gtkextra/python-gtkextra2/gtkextra/gtkextra.override,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** gtkextra.override 4 Mar 2004 11:39:19 -0000 1.19 --- gtkextra.override 9 Mar 2004 11:43:15 -0000 1.20 *************** *** 2055,2058 **** --- 2055,2100 ---- } %% + override gtk_sheet_get_active_cell + static PyObject * + _wrap_gtk_sheet_get_active_cell (PyGObject *self, PyObject *args, PyObject *kwargs) + { + gint row, column; + gtk_sheet_get_active_cell (GTK_SHEET(self->obj), &row, &column); + return Py_BuildValue ("(ii)", row, column); + } + %% + override gtk_sheet_get_pixel_info kwargs + static PyObject * + _wrap_gtk_sheet_get_pixel_info (PyGObject *self, PyObject *args, PyObject *kwargs) + { + static gchar *kwlist[] = { "x", "y", NULL }; + gint x, y, row, column, ret; + + if (!PyArg_ParseTupleAndKeywords (args, kwargs, "ii:GtkSheet.get_pixel_info", kwlist, &x, &y)) + return NULL; + ret = gtk_sheet_get_pixel_info(GTK_SHEET(self->obj), x, y, &row, &column); + if (ret) + return Py_BuildValue("(ii)", row, column); + Py_INCREF (Py_None); + return Py_None; + } + %% + override gtk_sheet_put kwargs + static PyObject * + _wrap_gtk_sheet_put (PyGObject *self, PyObject *args, PyObject *kwargs) + { + static char *kwlist[] = { "widget", "x", "y", NULL }; + gint x, y; + PyGObject *widget; + + if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O!ii:GtkSheet.put", kwlist, &PyGtkWidget_Type, &widget, &x, &y)) + return NULL; + + /* no need to return child here, other sheet methods dont't do that either! */ + (void) gtk_sheet_put (GTK_SHEET(self->obj), GTK_WIDGET(widget->obj), x, y); + Py_INCREF(Py_None); + return Py_None; + } + %% ignore gtk_sheet_new_browser |
|
From: <pyt...@li...> - 2004-03-04 11:52:53
|
Update of /cvsroot/python-gtkextra/python-gtkextra2/gtkextra In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17627/gtkextra Modified Files: Makefile.am gtkextra-types.defs gtkextra.override Log Message: a few accumulated minor changes Index: Makefile.am =================================================================== RCS file: /cvsroot/python-gtkextra/python-gtkextra2/gtkextra/Makefile.am,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** Makefile.am 10 Jan 2003 20:29:26 -0000 1.8 --- Makefile.am 4 Mar 2004 11:39:19 -0000 1.9 *************** *** 1,4 **** ! pygtkextradir = $(pythondir)/gtkextra ! pygtkextraexecdir = $(pyexecdir)/gtkextra pygtkextra_PYTHON = \ --- 1,4 ---- ! pygtkextradir = $(pythondir)/gtk-2.0/gtkextra ! pygtkextraexecdir = $(pyexecdir)/gtk-2.0/gtkextra pygtkextra_PYTHON = \ Index: gtkextra-types.defs =================================================================== RCS file: /cvsroot/python-gtkextra/python-gtkextra2/gtkextra/gtkextra-types.defs,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** gtkextra-types.defs 2 Jul 2003 16:25:07 -0000 1.10 --- gtkextra-types.defs 4 Mar 2004 11:39:19 -0000 1.11 *************** *** 3,7 **** ; object definitions ... ; As for fields, I'm not sure which are safe to expose. ! ; I also have no scrubbed which are set by functions. ; Somebody can help me here. --- 3,7 ---- ; object definitions ... ; As for fields, I'm not sure which are safe to expose. ! ; I also have not scrubbed which are set by functions. ; Somebody can help me here. Index: gtkextra.override =================================================================== RCS file: /cvsroot/python-gtkextra/python-gtkextra2/gtkextra/gtkextra.override,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** gtkextra.override 2 Jul 2003 16:25:07 -0000 1.18 --- gtkextra.override 4 Mar 2004 11:39:19 -0000 1.19 *************** *** 2111,2113 **** ignore-glob *_get_type ! *_construct --- 2111,2113 ---- ignore-glob *_get_type ! |
|
From: <pyt...@li...> - 2004-03-04 11:52:36
|
Update of /cvsroot/python-gtkextra/python-gtkextra2 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17627 Modified Files: AUTHORS python-gtkextra.spec.in ChangeLog Log Message: a few accumulated minor changes Index: AUTHORS =================================================================== RCS file: /cvsroot/python-gtkextra/python-gtkextra2/AUTHORS,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** AUTHORS 30 Dec 2002 20:42:12 -0000 1.2 --- AUTHORS 4 Mar 2004 11:39:18 -0000 1.3 *************** *** 1,4 **** Andreas Voegele wrote the python bindings for GtkExtra-0.99.x ! under PyGtk-1 and Gtk-1.2. He as since left the project. Toby D. Reeves <tr...@us...> wrote the python --- 1,4 ---- Andreas Voegele wrote the python bindings for GtkExtra-0.99.x ! under PyGtk-1 and Gtk-1.2. He has since left the project. Toby D. Reeves <tr...@us...> wrote the python Index: python-gtkextra.spec.in =================================================================== RCS file: /cvsroot/python-gtkextra/python-gtkextra2/python-gtkextra.spec.in,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** python-gtkextra.spec.in 7 Jan 2003 17:06:16 -0000 1.2 --- python-gtkextra.spec.in 4 Mar 2004 11:39:18 -0000 1.3 *************** *** 41,49 **** %files %defattr(644, root, root, 755) ! %dir %{_prefix}/lib/python?.?/site-packages/gtkextra ! %{_prefix}/lib/python?.?/site-packages/gtkextra/*.py* %defattr(755, root, root, 755) ! %{_prefix}/lib/python?.?/site-packages/gtkextra/_gtkextramodule.so %doc AUTHORS NEWS README ChangeLog --- 41,49 ---- %files %defattr(644, root, root, 755) ! %dir %{_prefix}/lib/python?.?/site-packages/gtk-2.0/gtkextra ! %{_prefix}/lib/python?.?/site-packages/gtk-2.0/gtkextra/*.py* %defattr(755, root, root, 755) ! %{_prefix}/lib/python?.?/site-packages/gtk-2.0/gtkextra/_gtkextramodule.so %doc AUTHORS NEWS README ChangeLog *************** *** 53,57 **** %defattr(755, root, root, 755) %{_prefix}/lib/pkgconfig/python-gtkextra.pc ! %{_prefix}/lib/python?.?/site-packages/gtkextra/_gtkextramodule.la %dir %{_prefix}/share/pygtk/2.0/defs %{_prefix}/share/pygtk/2.0/defs/gtkextra.defs --- 53,57 ---- %defattr(755, root, root, 755) %{_prefix}/lib/pkgconfig/python-gtkextra.pc ! %{_prefix}/lib/python?.?/site-packages/gtk-2.0/gtkextra/_gtkextramodule.la %dir %{_prefix}/share/pygtk/2.0/defs %{_prefix}/share/pygtk/2.0/defs/gtkextra.defs Index: ChangeLog =================================================================== RCS file: /cvsroot/python-gtkextra/python-gtkextra2/ChangeLog,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** ChangeLog 10 Jul 2002 19:06:50 -0000 1.1.1.1 --- ChangeLog 4 Mar 2004 11:39:18 -0000 1.2 *************** *** 1,2 **** --- 1,7 ---- + 2004-03-04 Bernhard Rumpler <ru...@tt...> + + * gtk/gtkextra.override: Provided overrides for gtk_sheet_get_active_cell, + gtk_sheet_get_pixel_info, and gtk_sheet_put + 2002-07-10 Toby D. Reeves <to...@so...> |
|
From: <pyt...@li...> - 2003-07-02 16:25:11
|
Update of /cvsroot/python-gtkextra/python-gtkextra2/gtkextra
In directory sc8-pr-cvs1:/tmp/cvs-serv18931
Modified Files:
gtkextra-types.defs gtkextra.defs gtkextra.override
Log Message:
A very few accumulated changes. Not much.
Index: gtkextra-types.defs
===================================================================
RCS file: /cvsroot/python-gtkextra/python-gtkextra2/gtkextra/gtkextra-types.defs,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** gtkextra-types.defs 21 Jan 2003 21:56:34 -0000 1.9
--- gtkextra-types.defs 2 Jul 2003 16:25:07 -0000 1.10
***************
*** 154,157 ****
--- 154,160 ----
(c-name "GtkPlot")
(gtype-id "GTK_TYPE_PLOT")
+ (fields
+ '("GList*" "data_sets")
+ )
)
***************
*** 564,567 ****
--- 567,571 ----
'("pixmap" "GTK_PLOT_CANVAS_PIXMAP")
'("marker" "GTK_PLOT_CANVAS_MARKER")
+ '("polygon" "GTK_PLOT_CANVAS_POLYGON")
'("custom" "GTK_PLOT_CANVAS_CUSTOM")
)
Index: gtkextra.defs
===================================================================
RCS file: /cvsroot/python-gtkextra/python-gtkextra2/gtkextra/gtkextra.defs,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -d -r1.11 -r1.12
*** gtkextra.defs 17 Apr 2003 16:39:52 -0000 1.11
--- gtkextra.defs 2 Jul 2003 16:25:07 -0000 1.12
***************
*** 1878,1881 ****
--- 1878,1896 ----
)
+ (define-method put_polygon
+ (of-object "GtkPlotCanvas")
+ (c-name "gtk_plot_canvas_put_polygon_PY")
+ (return-type "GtkPlotCanvasChild*")
+ (parameters
+ '("GtkPlotPoint*" "points")
+ '("guint" "npoints")
+ '("GtkPlotLineStyle" "style" (default "GTK_PLOT_LINE_SOLID"))
+ '("gfloat" "width" (default "1.0"))
+ '("const-GdkColor*" "fg" (default "NULL") (null-ok))
+ '("const-GdkColor*" "bg" (default "NULL") (null-ok))
+ '("gboolean" "fill" (default "TRUE"))
+ )
+ )
+
(define-method put_pixmap
(of-object "GtkPlotCanvas")
***************
*** 1957,1960 ****
--- 1972,2001 ----
(of-object "GtkPlotCanvasChild")
(c-name "gtk_plot_canvas_ellipse_set_attributes")
+ (return-type "none")
+ (parameters
+ '("GtkPlotLineStyle" "style")
+ '("gfloat" "width")
+ '("const-GdkColor*" "fg" (null-ok))
+ '("const-GdkColor*" "bg" (null-ok))
+ '("gboolean" "fill")
+ )
+ )
+
+ ;(define-function gtk_plot_canvas_polygon_set_attributes
+ ; (c-name "gtk_plot_canvas_polygon_set_attributes")
+ ; (return-type "none")
+ ; (parameters
+ ; '("GtkPlotCanvasChild*" "child")
+ ; '("GtkPlotLineStyle" "style")
+ ; '("gfloat" "width")
+ ; '("const-GdkColor*" "fg")
+ ; '("const-GdkColor*" "bg")
+ ; '("gboolean" "fill")
+ ; )
+ ;)
+
+ (define-method polygon_set_attributes
+ (of-object "GtkPlotCanvasChild")
+ (c-name "gtk_plot_canvas_polygon_set_attributes")
(return-type "none")
(parameters
Index: gtkextra.override
===================================================================
RCS file: /cvsroot/python-gtkextra/python-gtkextra2/gtkextra/gtkextra.override,v
retrieving revision 1.17
retrieving revision 1.18
diff -C2 -d -r1.17 -r1.18
*** gtkextra.override 17 Apr 2003 16:39:53 -0000 1.17
--- gtkextra.override 2 Jul 2003 16:25:07 -0000 1.18
***************
*** 1171,1178 ****
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));
}
--- 1171,1181 ----
py_copy = pygobject_new((GObject*)copy);
gtk_plot_data_clone(GTK_PLOT_DATA(self->obj), copy);
+ g_object_unref(copy);
for (i=0; i < G_N_ELEMENTS(pygtkextra_keys); i++) {
const char *key = pygtkextra_keys[i];
! PyObject *py_obj = pygtkextra_get_data(self, key);
! pygtkextra_set_data( (PyGObject*)py_copy, key, py_obj);
! Py_DECREF(py_obj);
}
***************
*** 1385,1388 ****
--- 1388,1416 ----
gtk_plot_get_point(GTK_PLOT(self->obj), x, y, &xx, &yy);
return Py_BuildValue("(dd)", xx, yy);
+ }
+ %%
+ override-attr GtkPlot.data_sets
+ static PyObject *
+ _wrap_gtk_plot__get_data_sets(PyGObject *self, void *closure)
+ {
+ GList *list, *tmp;
+ PyObject *py_list;
+
+ list = GTK_PLOT(self->obj)->data_sets;
+
+ if ((py_list = PyList_New(0)) == NULL) {
+ return NULL;
+ }
+ for (tmp = list; tmp != NULL; tmp = tmp->next) {
+ PyObject *gtk_obj = pygobject_new(G_OBJECT(tmp->data));
+
+ if (gtk_obj == NULL) {
+ Py_DECREF(py_list);
+ return NULL;
+ }
+ PyList_Append(py_list, gtk_obj);
+ Py_DECREF(gtk_obj);
+ }
+ return py_list;
}
%%
|
|
From: <pyt...@li...> - 2003-07-02 16:03:48
|
Update of /cvsroot/python-gtkextra/python-gtkextra2
In directory sc8-pr-cvs1:/tmp/cvs-serv15724
Modified Files:
Makefile.am
Log Message:
Make examples easier to run with python libraries in 'strange' locations.
Index: Makefile.am
===================================================================
RCS file: /cvsroot/python-gtkextra/python-gtkextra2/Makefile.am,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** Makefile.am 9 Jan 2003 13:16:07 -0000 1.3
--- Makefile.am 2 Jul 2003 16:03:45 -0000 1.4
***************
*** 15,18 ****
--- 15,19 ----
python-gtkextra.pc.in \
examples/test.sh \
+ examples/common.py \
examples/icons.py \
examples/pixmaps.py \
|
|
From: <pyt...@li...> - 2003-07-02 16:03:48
|
Update of /cvsroot/python-gtkextra/python-gtkextra2/examples
In directory sc8-pr-cvs1:/tmp/cvs-serv15724/examples
Modified Files:
test.sh
Added Files:
common.py
Log Message:
Make examples easier to run with python libraries in 'strange' locations.
--- NEW FILE: common.py ---
# This file is imported by all test programs before anything else.
# You probably do not need it, but I do.
#import sys
#prefix = '/usr/mbench/lib/python2.2/site-packages'
#sys.path.insert(0, prefix)
#sys.path.insert(0, prefix+'/gtk-2.0')
Index: test.sh
===================================================================
RCS file: /cvsroot/python-gtkextra/python-gtkextra2/examples/test.sh,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** test.sh 9 Jan 2003 13:16:07 -0000 1.4
--- test.sh 2 Jul 2003 16:03:45 -0000 1.5
***************
*** 13,19 ****
if test -z $DEBUG; then
! python -c "execfile('$1')"
else
python -c "\
import os
raw_input('Attach gdb on %d. Press return to begin \"$1\".' % os.getpid())
--- 13,20 ----
if test -z $DEBUG; then
! python -c "import common;execfile('$1')"
else
python -c "\
+ import common
import os
raw_input('Attach gdb on %d. Press return to begin \"$1\".' % os.getpid())
|
|
From: <pyt...@li...> - 2003-04-17 16:40:26
|
Update of /cvsroot/python-gtkextra/python-gtkextra2/examples
In directory sc8-pr-cvs1:/tmp/cvs-serv6663/examples
Modified Files:
testboxes.py testbubbles.py testcontour.py testflux.py
testgtkplot.py testgtkplot3d.py testiterator.py testpixmap.py
testrealtime.py
Log Message:
Implement clone(). Some other garbage.
Index: testboxes.py
===================================================================
RCS file: /cvsroot/python-gtkextra/python-gtkextra2/examples/testboxes.py,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** testboxes.py 2 Jan 2003 22:00:42 -0000 1.4
--- testboxes.py 17 Apr 2003 16:39:50 -0000 1.5
***************
*** 14,18 ****
self.add(scrollwin)
! canvas = gtkextra.PlotCanvas(gtkextra.PLOT_LETTER_W, gtkextra.PLOT_LETTER_H)
canvas.plot_canvas_set_flags(gtkextra.PLOT_CANVAS_DND_FLAGS)
scrollwin.add_with_viewport(canvas)
--- 14,18 ----
self.add(scrollwin)
! self.canvas = canvas = gtkextra.PlotCanvas(gtkextra.PLOT_LETTER_W, gtkextra.PLOT_LETTER_H)
canvas.plot_canvas_set_flags(gtkextra.PLOT_CANVAS_DND_FLAGS)
scrollwin.add_with_viewport(canvas)
Index: testbubbles.py
===================================================================
RCS file: /cvsroot/python-gtkextra/python-gtkextra2/examples/testbubbles.py,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** testbubbles.py 2 Jan 2003 22:00:43 -0000 1.2
--- testbubbles.py 17 Apr 2003 16:39:51 -0000 1.3
***************
*** 19,23 ****
self.add(scrollwin)
! canvas = gtkextra.PlotCanvas(gtkextra.PLOT_LETTER_W, gtkextra.PLOT_LETTER_H)
canvas.plot_canvas_set_flags(gtkextra.PLOT_CANVAS_DND_FLAGS)
scrollwin.add_with_viewport(canvas)
--- 19,23 ----
self.add(scrollwin)
! self.canvas = canvas = gtkextra.PlotCanvas(gtkextra.PLOT_LETTER_W, gtkextra.PLOT_LETTER_H)
canvas.plot_canvas_set_flags(gtkextra.PLOT_CANVAS_DND_FLAGS)
scrollwin.add_with_viewport(canvas)
Index: testcontour.py
===================================================================
RCS file: /cvsroot/python-gtkextra/python-gtkextra2/examples/testcontour.py,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** testcontour.py 15 Jan 2003 18:57:08 -0000 1.3
--- testcontour.py 17 Apr 2003 16:39:51 -0000 1.4
***************
*** 17,21 ****
self.add(scrollwin)
! canvas = gtkextra.PlotCanvas(gtkextra.PLOT_LETTER_W * scale, gtkextra.PLOT_LETTER_H * scale)
canvas.plot_canvas_set_flags(gtkextra.PLOT_CANVAS_DND_FLAGS)
scrollwin.add_with_viewport(canvas)
--- 17,21 ----
self.add(scrollwin)
! self.canvas = canvas = gtkextra.PlotCanvas(gtkextra.PLOT_LETTER_W * scale, gtkextra.PLOT_LETTER_H * scale)
canvas.plot_canvas_set_flags(gtkextra.PLOT_CANVAS_DND_FLAGS)
scrollwin.add_with_viewport(canvas)
Index: testflux.py
===================================================================
RCS file: /cvsroot/python-gtkextra/python-gtkextra2/examples/testflux.py,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** testflux.py 2 Jan 2003 22:00:46 -0000 1.3
--- testflux.py 17 Apr 2003 16:39:51 -0000 1.4
***************
*** 17,21 ****
self.add(scrollwin)
! canvas = gtkextra.PlotCanvas(gtkextra.PLOT_LETTER_W, gtkextra.PLOT_LETTER_H)
canvas.plot_canvas_set_flags(gtkextra.PLOT_CANVAS_DND_FLAGS)
canvas.connect("select_item", self.select_item)
--- 17,21 ----
self.add(scrollwin)
! self.canvas = canvas = gtkextra.PlotCanvas(gtkextra.PLOT_LETTER_W, gtkextra.PLOT_LETTER_H)
canvas.plot_canvas_set_flags(gtkextra.PLOT_CANVAS_DND_FLAGS)
canvas.connect("select_item", self.select_item)
Index: testgtkplot.py
===================================================================
RCS file: /cvsroot/python-gtkextra/python-gtkextra2/examples/testgtkplot.py,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** testgtkplot.py 15 Jan 2003 18:57:08 -0000 1.9
--- testgtkplot.py 17 Apr 2003 16:39:51 -0000 1.10
***************
*** 21,24 ****
--- 21,25 ----
self.set_title("GtkPlot Demo")
self.set_size_request(550, 650)
+ #self.set_size_request(page_width, page_height)
scrollwin = gtk.ScrolledWindow()
***************
*** 30,34 ****
light_blue = colormap.alloc_color("light blue")
! canvas = gtkextra.PlotCanvas(page_width, page_height)
canvas.plot_canvas_set_flags(gtkextra.PLOT_CANVAS_DND_FLAGS)
scrollwin.add_with_viewport(canvas)
--- 31,35 ----
light_blue = colormap.alloc_color("light blue")
! self.canvas = canvas = gtkextra.PlotCanvas(page_width, page_height)
canvas.plot_canvas_set_flags(gtkextra.PLOT_CANVAS_DND_FLAGS)
scrollwin.add_with_viewport(canvas)
Index: testgtkplot3d.py
===================================================================
RCS file: /cvsroot/python-gtkextra/python-gtkextra2/examples/testgtkplot3d.py,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** testgtkplot3d.py 2 Jan 2003 22:00:49 -0000 1.4
--- testgtkplot3d.py 17 Apr 2003 16:39:51 -0000 1.5
***************
*** 18,22 ****
self.add(scrollwin)
! canvas = gtkextra.PlotCanvas(gtkextra.PLOT_LETTER_W, gtkextra.PLOT_LETTER_H)
canvas.plot_canvas_set_flags(gtkextra.PLOT_CANVAS_DND_FLAGS)
scrollwin.add_with_viewport(canvas)
--- 18,22 ----
self.add(scrollwin)
! self.canvas = canvas = gtkextra.PlotCanvas(gtkextra.PLOT_LETTER_W, gtkextra.PLOT_LETTER_H)
canvas.plot_canvas_set_flags(gtkextra.PLOT_CANVAS_DND_FLAGS)
scrollwin.add_with_viewport(canvas)
Index: testiterator.py
===================================================================
RCS file: /cvsroot/python-gtkextra/python-gtkextra2/examples/testiterator.py,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** testiterator.py 15 Jan 2003 18:57:08 -0000 1.3
--- testiterator.py 17 Apr 2003 16:39:51 -0000 1.4
***************
*** 23,27 ****
self.add(scrollwin)
! canvas = gtkextra.PlotCanvas(gtkextra.PLOT_LETTER_W, gtkextra.PLOT_LETTER_H)
canvas.set_background(light_blue)
scrollwin.add_with_viewport(canvas)
--- 23,27 ----
self.add(scrollwin)
! self.canvas = canvas = gtkextra.PlotCanvas(gtkextra.PLOT_LETTER_W, gtkextra.PLOT_LETTER_H)
canvas.set_background(light_blue)
scrollwin.add_with_viewport(canvas)
Index: testpixmap.py
===================================================================
RCS file: /cvsroot/python-gtkextra/python-gtkextra2/examples/testpixmap.py,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** testpixmap.py 2 Jan 2003 22:00:51 -0000 1.3
--- testpixmap.py 17 Apr 2003 16:39:51 -0000 1.4
***************
*** 80,84 ****
colormap = self.get_colormap()
! canvas = gtkextra.PlotCanvas(gtkextra.PLOT_LETTER_W, gtkextra.PLOT_LETTER_H)
canvas.plot_canvas_set_flags(gtkextra.PLOT_CANVAS_DND_FLAGS)
self.add(canvas)
--- 80,84 ----
colormap = self.get_colormap()
! self.canvas = canvas = gtkextra.PlotCanvas(gtkextra.PLOT_LETTER_W, gtkextra.PLOT_LETTER_H)
canvas.plot_canvas_set_flags(gtkextra.PLOT_CANVAS_DND_FLAGS)
self.add(canvas)
Index: testrealtime.py
===================================================================
RCS file: /cvsroot/python-gtkextra/python-gtkextra2/examples/testrealtime.py,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** testrealtime.py 24 Dec 2002 18:49:10 -0000 1.3
--- testrealtime.py 17 Apr 2003 16:39:51 -0000 1.4
***************
*** 22,26 ****
self.add(scrollwin)
! canvas = gtkextra.PlotCanvas(gtkextra.PLOT_LETTER_W, gtkextra.PLOT_LETTER_H)
canvas.set_background(light_blue)
canvas.connect("button_press_event", self.button_press_handler)
--- 22,26 ----
self.add(scrollwin)
! self.canvas = canvas = gtkextra.PlotCanvas(gtkextra.PLOT_LETTER_W, gtkextra.PLOT_LETTER_H)
canvas.set_background(light_blue)
canvas.connect("button_press_event", self.button_press_handler)
|
|
From: <pyt...@li...> - 2003-04-17 16:40:23
|
Update of /cvsroot/python-gtkextra/python-gtkextra2 In directory sc8-pr-cvs1:/tmp/cvs-serv6663 Modified Files: README Log Message: Implement clone(). Some other garbage. Index: README =================================================================== RCS file: /cvsroot/python-gtkextra/python-gtkextra2/README,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** README 10 Jul 2002 19:06:50 -0000 1.1.1.1 --- README 17 Apr 2003 16:39:50 -0000 1.2 *************** *** 1 **** ! FIXME --- 1,4 ---- ! This package provided a Python interface to the GtkExtra2 widget set for GTK2. ! Its home on the web is <http://python-gtkextra.sourceforge.net>. ! ! Toby D. Reeves <tr...@us...>. |
|
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;
}
%%
|
|
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)
|
|
From: <pyt...@li...> - 2003-01-21 17:09:14
|
Update of /cvsroot/python-gtkextra/python-gtkextra2/gtkextra
In directory sc8-pr-cvs1:/tmp/cvs-serv16209/gtkextra
Modified Files:
gtkextra-types.defs gtkextra.override
Added Files:
mkfields.py
Log Message:
more fields
--- NEW FILE: mkfields.py ---
# Quick hack to help populate objects definitions in defs files.
# 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()
if v[0] == '*':
v = v[1:]
t += '*'
print """ '("%s" "%s")""" % (t,v)
print """ )"""
Index: gtkextra-types.defs
===================================================================
RCS file: /cvsroot/python-gtkextra/python-gtkextra2/gtkextra/gtkextra-types.defs,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** gtkextra-types.defs 15 Jan 2003 18:57:08 -0000 1.7
--- gtkextra-types.defs 21 Jan 2003 17:09:09 -0000 1.8
***************
*** 168,171 ****
--- 168,198 ----
(c-name "GtkPlotAxis")
(gtype-id "GTK_TYPE_PLOT_AXIS")
+ (fields
+ '("gboolean" "is_visible")
+ '("GtkPlotVector" "origin")
+ '("GtkPlotVector" "direction")
+ '("GtkPlotText" "title")
+ '("gboolean" "title_visible")
+ '("GtkPlotTicks" "ticks")
+ '("GtkPlotOrientation" "orientation")
+ '("GtkPlotScale" "scale")
+ '("GtkPlotLine" "line")
+ '("GtkPlotLine" "major_grid")
+ '("GtkPlotLine" "minor_grid")
+ '("gint" "major_mask")
+ '("gint" "minor_mask")
+ '("gint" "ticks_length")
+ '("gfloat" "ticks_width")
+ '("gboolean" "custom_labels")
+ '("gint" "labels_offset")
+ '("gchar*" "labels_prefix")
+ '("gchar*" "labels_suffix")
+ '("gboolean" "show_major_grid")
+ '("gboolean" "show_minor_grid")
+ '("GtkPlotText" "labels_attr")
+ '("gint" "label_precision")
+ '("gint" "label_style")
+ '("gint" "label_mask")
+ )
)
***************
*** 317,323 ****
--- 344,367 ----
(define-boxed PlotText
+ ;(define-pointer PlotText
(in-module "Gtk")
(c-name "GtkPlotText")
(gtype-id "GTK_TYPE_PLOT_TEXT")
+ (fields
+ '("gdouble" "x")
+ '("gdouble" "y")
+ '("gint" "angle")
+ '("GdkColor" "fg")
+ '("GdkColor" "bg")
+ '("gboolean" "transparent")
+ '("GtkPlotBorderStyle" "border")
+ '("gint" "border_width")
+ '("gint" "shadow_width")
+ '("gint" "border_space")
+ '("gchar*" "font")
+ '("gint" "height")
+ '("gchar*" "text")
+ '("GtkJustification" "justification")
+ )
)
Index: gtkextra.override
===================================================================
RCS file: /cvsroot/python-gtkextra/python-gtkextra2/gtkextra/gtkextra.override,v
retrieving revision 1.14
retrieving revision 1.15
diff -C2 -d -r1.14 -r1.15
*** gtkextra.override 15 Jan 2003 20:29:41 -0000 1.14
--- gtkextra.override 21 Jan 2003 17:09:09 -0000 1.15
***************
*** 130,133 ****
--- 130,158 ----
}
+ GtkPlotText*
+ gtk_plot_text_copy (const GtkPlotText *text)
+ {
+ /* FIXME: am I correct? */
+ GtkPlotText *copy;
+ g_return_val_if_fail (text != NULL, NULL);
+ copy = g_new (GtkPlotText, 1);
+ *copy = *text;
+ copy->font = g_strdup(text->font);
+ copy->text = g_strdup(text->text);
+ return copy;
+ }
+
+ void
+ gtk_plot_text_free (GtkPlotText *text)
+ {
+ /* FIXME: am I correct? */
+ g_return_if_fail (text != NULL);
+ if (text->font)
+ g_free(text->font);
+ if (text->text)
+ g_free(text->text);
+ g_free (text);
+ }
+
#define GTK_TYPE_PLOT_TEXT (gtk_plot_text_get_type ())
static GType
***************
*** 136,140 ****
static GType our_type = 0;
! #if 1 //HACK
if (our_type == 0)
our_type = g_pointer_type_register_static ("GtkPlotText");
--- 161,165 ----
static GType our_type = 0;
! #if 0 //HACK
if (our_type == 0)
our_type = g_pointer_type_register_static ("GtkPlotText");
***************
*** 142,147 ****
if (our_type == 0)
our_type = g_boxed_type_register_static ("GtkPlotText",
! (GBoxedCopyFunc) gtk_plot_text_ref,
! (GBoxedFreeFunc) gtk_plot_text_unref);
#endif
return our_type;
--- 167,172 ----
if (our_type == 0)
our_type = g_boxed_type_register_static ("GtkPlotText",
! (GBoxedCopyFunc) gtk_plot_text_copy,
! (GBoxedFreeFunc) gtk_plot_text_free);
#endif
return our_type;
|
|
From: <pyt...@li...> - 2003-01-16 14:45:45
|
Update of /cvsroot/python-gtkextra/python-gtkextra2/examples
In directory sc8-pr-cvs1:/tmp/cvs-serv20272
Modified Files:
www-examples.py
Log Message:
script to build www examples
Index: www-examples.py
===================================================================
RCS file: /cvsroot/python-gtkextra/python-gtkextra2/examples/www-examples.py,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** www-examples.py 16 Jan 2003 14:33:14 -0000 1.1
--- www-examples.py 16 Jan 2003 14:45:42 -0000 1.2
***************
*** 73,78 ****
for m,delay in modules:
! #process_html(m, odir)
! #process_gui(m, odir, delay)
! fd.write(pattern % locals())
--- 73,77 ----
for m,delay in modules:
! process_html(m, odir)
! process_gui(m, odir, delay)
|
|
From: <pyt...@li...> - 2003-01-16 14:33:17
|
Update of /cvsroot/python-gtkextra/python-gtkextra2/examples
In directory sc8-pr-cvs1:/tmp/cvs-serv18928
Added Files:
www-examples.py
Log Message:
script to build www examples
--- NEW FILE: www-examples.py ---
"""
Process the examples into html, png, eps, and pdf files.
"""
import sys
pydir='/usr/new-stuff/lib/python2.2/site-packages/'
sys.path.insert(0, pydir)
sys.path.insert(0, pydir+'/gtk-2.0')
import os
import time
import gtk
import gtkextra
def process_html(name, odir):
os.system('enscript -E --color -W html --color -p %(odir)s%(name)s.py.html %(name)s.py' % locals())
def process_images(app, name, odir):
eps_filename = "%(odir)s%(name)s.eps" % locals()
pdf_filename = "%(odir)s%(name)s.pdf" % locals()
png_filename = "%(odir)s%(name)s.png" % locals()
if hasattr(app, 'canvas'):
print 'Saving EPS:', eps_filename
app.canvas.export_ps_with_size(eps_filename, epsflag=gtk.TRUE)
print 'Converting to PDF:', pdf_filename
os.system('ps2pdf %s %s' % (eps_filename, pdf_filename) )
print 'Saving PNG:', png_filename
win = app.window
w, h = win.get_size()
pixbuf = gtk.gdk.Pixbuf(gtk.gdk.COLORSPACE_RGB, 0, 8, w, h)
pixbuf.get_from_drawable(win, win.get_colormap(), 0,0,0,0, w,h)
pixbuf.save(png_filename, "png")
app.destroy()
gtk.main_quit()
def process_gui(name, odir, delay=1):
exec("""\
gtkextra.psfont_init()
import %(name)s
app = %(name)s.Application()\
""" % locals() )
gtk.timeout_add(int(delay*1000), process_images, app, name, odir)
gtk.main()
################################################################################
modules = [
['testboxes', 1],
['testbubbles', 1],
['testcharsel', 1],
['testcontour', 1.5],
['testflux', 1],
#['testgtkfilesel', 1],
['testgtkfont', 1],
['testgtkiconlist', 1],
['testgtkplot3d', 1],
['testgtkplot', 1],
#['testgtksheet', 1],
['testiterator', 1],
['testpixmap', 1],
['testpolar', 1],
['testrealtime', 5]
]
odir = './output/'
if not os.path.exists(odir):
print 'Making output directory', odir
os.mkdir(odir)
for m,delay in modules:
#process_html(m, odir)
#process_gui(m, odir, delay)
fd.write(pattern % locals())
|
|
From: <pyt...@li...> - 2003-01-15 20:29:44
|
Update of /cvsroot/python-gtkextra/python-gtkextra2/gtkextra
In directory sc8-pr-cvs1:/tmp/cvs-serv5351/gtkextra
Modified Files:
gtkextra.override
Log Message:
handle error in data handler callback
Index: gtkextra.override
===================================================================
RCS file: /cvsroot/python-gtkextra/python-gtkextra2/gtkextra/gtkextra.override,v
retrieving revision 1.13
retrieving revision 1.14
diff -C2 -d -r1.13 -r1.14
*** gtkextra.override 15 Jan 2003 18:57:08 -0000 1.13
--- gtkextra.override 15 Jan 2003 20:29:41 -0000 1.14
***************
*** 288,291 ****
--- 288,294 ----
Py_DECREF(arglist);
+ if (PyErr_Occurred())
+ return -1;
+
if ( !result || !PyTuple_Check(result) || PyObject_Length(result) != 3) {
PyErr_SetString(PyExc_TypeError, "callback must return (in_obj, buffer, buffer_len)");
|
|
From: <pyt...@li...> - 2003-01-15 18:57:11
|
Update of /cvsroot/python-gtkextra/python-gtkextra2/gtkextra
In directory sc8-pr-cvs1:/tmp/cvs-serv26596/gtkextra
Modified Files:
gtkextra-types.defs gtkextra.defs gtkextra.override
gtkextramodule.c
Log Message:
lots more done
Index: gtkextra-types.defs
===================================================================
RCS file: /cvsroot/python-gtkextra/python-gtkextra2/gtkextra/gtkextra-types.defs,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** gtkextra-types.defs 2 Jan 2003 22:00:54 -0000 1.6
--- gtkextra-types.defs 15 Jan 2003 18:57:08 -0000 1.7
***************
*** 360,363 ****
--- 360,383 ----
)
+ (define-boxed PlotDTnode
+ (in-module "Gtk")
+ (c-name "GtkPlotDTnode")
+ (gtype-id "GTK_TYPE_PLOT_DT_NODE")
+ (fields
+ '("gdouble" "x")
+ '("gdouble" "y")
+ '("gdouble" "z")
+ '("gdouble" "px")
+ '("gdouble" "py")
+ '("gdouble" "pz")
+ '("gint" "id")
+ '("gint" "a")
+ '("gint" "b")
+ '("gint" "c")
+ '("gint" "d")
+ '("gint" "boundary_marker")
+ )
+ )
+
;; Enumerations and flags ...
Index: gtkextra.defs
===================================================================
RCS file: /cvsroot/python-gtkextra/python-gtkextra2/gtkextra/gtkextra.defs,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** gtkextra.defs 14 Jan 2003 15:32:09 -0000 1.9
--- gtkextra.defs 15 Jan 2003 18:57:08 -0000 1.10
***************
*** 179,183 ****
)
! (define-function gtkextra_check_version
(c-name "gtkextra_check_version")
(return-type "gchar*" (null-ok))
--- 179,183 ----
)
! (define-function check_version
(c-name "gtkextra_check_version")
(return-type "gchar*" (null-ok))
***************
*** 829,856 ****
)
! (define-function gtk_icon_list_get_entry
(c-name "gtk_icon_list_get_entry")
(return-type "GtkWidget*" (null-ok))
- (parameters
- '("GtkIconListItem*" "item")
- )
)
! (define-function gtk_icon_list_get_pixmap
(c-name "gtk_icon_list_get_pixmap")
(return-type "GtkWidget*" (null-ok))
- (parameters
- '("GtkIconListItem*" "item")
- )
)
! (define-function gtk_icon_list_set_pixmap
(c-name "gtk_icon_list_set_pixmap")
(return-type "none")
(parameters
! '("GtkIconListItem*" "item")
! '("GdkPixmap*" "pixmap")
! '("GdkBitmap*" "bitmap")
! )
)
--- 829,878 ----
)
! ;(define-function gtk_icon_list_get_entry
! ; (c-name "gtk_icon_list_get_entry")
! ; (return-type "GtkWidget*" (null-ok))
! ; (parameters
! ; '("GtkIconListItem*" "item")
! ; )
! ;)
!
! (define-method get_entry
! (of-object "GtkIconListItem")
(c-name "gtk_icon_list_get_entry")
(return-type "GtkWidget*" (null-ok))
)
! ;(define-function gtk_icon_list_get_pixmap
! ; (c-name "gtk_icon_list_get_pixmap")
! ; (return-type "GtkWidget*" (null-ok))
! ; (parameters
! ; '("GtkIconListItem*" "item")
! ; )
! ;)
!
! (define-method get_pixmap
! (of-object "GtkIconListItem")
(c-name "gtk_icon_list_get_pixmap")
(return-type "GtkWidget*" (null-ok))
)
! ;(define-function gtk_icon_list_set_pixmap
! ; (c-name "gtk_icon_list_set_pixmap")
! ; (return-type "none")
! ; (parameters
! ; '("GtkIconListItem*" "item")
! ; '("GdkPixmap*" "pixmap")
! ; '("GdkBitmap*" "bitmap")
! ; )
! ;)
!
! (define-method set_pixmap
! (of-object "GtkIconListItem")
(c-name "gtk_icon_list_set_pixmap")
(return-type "none")
(parameters
! '("GdkPixmap*" "pixmap")
! '("GdkBitmap*" "bitmap")
! )
)
***************
*** 910,913 ****
--- 932,936 ----
(define-function gtk_item_entry_new_with_max_length
+ (is-constructor-of "GtkItemEntry")
(c-name "gtk_item_entry_new_with_max_length")
(return-type "GtkWidget*")
***************
*** 1813,1820 ****
'("gdouble" "x2")
'("gdouble" "y2")
! '("GtkPlotLineStyle" "style")
! '("gfloat" "width")
! '("const-GdkColor*" "color")
! '("GtkPlotCanvasArrow" "arrow_mask")
)
)
--- 1836,1843 ----
'("gdouble" "x2")
'("gdouble" "y2")
! '("GtkPlotLineStyle" "style" (default "GTK_PLOT_LINE_SOLID"))
! '("gfloat" "width" (default "1.0"))
! '("const-GdkColor*" "color" (default "NULL") (null-ok))
! '("GtkPlotCanvasArrow" "arrow_mask" (default "GTK_PLOT_ARROW_NONE"))
)
)
***************
*** 1829,1838 ****
'("gdouble" "x2")
'("gdouble" "y2")
! '("GtkPlotLineStyle" "style")
! '("gfloat" "width")
! '("const-GdkColor*" "fg")
! '("const-GdkColor*" "bg")
! '("GtkPlotBorderStyle" "border")
! '("gboolean" "fill")
)
)
--- 1852,1861 ----
'("gdouble" "x2")
'("gdouble" "y2")
! '("GtkPlotLineStyle" "style" (default "GTK_PLOT_LINE_SOLID"))
! '("gfloat" "width" (default "1.0"))
! '("const-GdkColor*" "fg" (default "NULL") (null-ok))
! '("const-GdkColor*" "bg" (default "NULL") (null-ok))
! '("GtkPlotBorderStyle" "border" (default "GTK_PLOT_BORDER_LINE"))
! '("gboolean" "fill" (default "TRUE"))
)
)
***************
*** 1847,1855 ****
'("gdouble" "x2")
'("gdouble" "y2")
! '("GtkPlotLineStyle" "style")
! '("gfloat" "width")
! '("const-GdkColor*" "fg")
! '("const-GdkColor*" "bg")
! '("gboolean" "fill")
)
)
--- 1870,1878 ----
'("gdouble" "x2")
'("gdouble" "y2")
! '("GtkPlotLineStyle" "style" (default "GTK_PLOT_LINE_SOLID"))
! '("gfloat" "width" (default "1.0"))
! '("const-GdkColor*" "fg" (default "NULL") (null-ok))
! '("const-GdkColor*" "bg" (default "NULL") (null-ok))
! '("gboolean" "fill" (default "TRUE"))
)
)
***************
*** 1866,1904 ****
)
! (define-function gtk_plot_canvas_line_set_attributes
(c-name "gtk_plot_canvas_line_set_attributes")
(return-type "none")
(parameters
- '("GtkPlotCanvasChild*" "child")
'("GtkPlotLineStyle" "style")
'("gfloat" "width")
! '("const-GdkColor*" "color")
'("GtkPlotCanvasArrow" "mask")
)
)
! (define-function gtk_plot_canvas_rectangle_set_attributes
(c-name "gtk_plot_canvas_rectangle_set_attributes")
(return-type "none")
(parameters
! '("GtkPlotCanvasChild*" "child")
! '("GtkPlotLineStyle" "style")
! '("gfloat" "width")
! '("const-GdkColor*" "fg")
! '("const-GdkColor*" "bg")
! '("GtkPlotBorderStyle" "border")
! '("gboolean" "fill")
)
)
! (define-function gtk_plot_canvas_ellipse_set_attributes
(c-name "gtk_plot_canvas_ellipse_set_attributes")
(return-type "none")
(parameters
- '("GtkPlotCanvasChild*" "child")
'("GtkPlotLineStyle" "style")
'("gfloat" "width")
! '("const-GdkColor*" "fg")
! '("const-GdkColor*" "bg")
'("gboolean" "fill")
)
--- 1889,1966 ----
)
! ;(define-function gtk_plot_canvas_line_set_attributes
! ; (c-name "gtk_plot_canvas_line_set_attributes")
! ; (return-type "none")
! ; (parameters
! ; '("GtkPlotCanvasChild*" "child")
! ; '("GtkPlotLineStyle" "style")
! ; '("gfloat" "width")
! ; '("const-GdkColor*" "color")
! ; '("GtkPlotCanvasArrow" "mask")
! ; )
! ;)
!
! (define-method line_set_attributes
! (of-object "GtkPlotCanvasChild")
(c-name "gtk_plot_canvas_line_set_attributes")
(return-type "none")
(parameters
'("GtkPlotLineStyle" "style")
'("gfloat" "width")
! '("const-GdkColor*" "color" (null-ok))
'("GtkPlotCanvasArrow" "mask")
)
)
! ;(define-function gtk_plot_canvas_rectangle_set_attributes
! ; (c-name "gtk_plot_canvas_rectangle_set_attributes")
! ; (return-type "none")
! ; (parameters
! ; '("GtkPlotCanvasChild*" "child")
! ; '("GtkPlotLineStyle" "style")
! ; '("gfloat" "width")
! ; '("const-GdkColor*" "fg")
! ; '("const-GdkColor*" "bg")
! ; '("GtkPlotBorderStyle" "border")
! ; '("gboolean" "fill")
! ; )
! ;)
!
! (define-method rectangle_set_attributes
! (of-object "GtkPlotCanvasChild")
(c-name "gtk_plot_canvas_rectangle_set_attributes")
(return-type "none")
(parameters
! '("GtkPlotLineStyle" "style" (default "GTK_PLOT_LINE_SOLID"))
! '("gfloat" "width" (default "1.0"))
! '("const-GdkColor*" "fg" (default "NULL") (null-ok))
! '("const-GdkColor*" "bg" (default "NULL") (null-ok))
! '("GtkPlotBorderStyle" "border" (default "GTK_PLOT_BORDER_LINE"))
! '("gboolean" "fill" (default "FALSE"))
)
)
! ;(define-function gtk_plot_canvas_ellipse_set_attributes
! ; (c-name "gtk_plot_canvas_ellipse_set_attributes")
! ; (return-type "none")
! ; (parameters
! ; '("GtkPlotCanvasChild*" "child")
! ; '("GtkPlotLineStyle" "style")
! ; '("gfloat" "width")
! ; '("const-GdkColor*" "fg")
! ; '("const-GdkColor*" "bg")
! ; '("gboolean" "fill")
! ; )
! ;)
!
! (define-method ellipse_set_attributes
! (of-object "GtkPlotCanvasChild")
(c-name "gtk_plot_canvas_ellipse_set_attributes")
(return-type "none")
(parameters
'("GtkPlotLineStyle" "style")
'("gfloat" "width")
! '("const-GdkColor*" "fg" (null-ok))
! '("const-GdkColor*" "bg" (null-ok))
'("gboolean" "fill")
)
***************
*** 2900,2904 ****
(define-method add_node
(of-object "GtkPlotDT")
! (c-name "gtk_plot_dt_add_node")
(return-type "gboolean")
(parameters
--- 2962,2966 ----
(define-method add_node
(of-object "GtkPlotDT")
! (c-name "gtk_plot_dt_add_node_PY")
(return-type "gboolean")
(parameters
***************
*** 3369,3373 ****
)
! (define-function gtk_plot_text_get_size
(c-name "gtk_plot_text_get_size")
(return-type "none")
--- 3431,3435 ----
)
! (define-function plot_text_get_size
(c-name "gtk_plot_text_get_size")
(return-type "none")
***************
*** 3384,3388 ****
)
! (define-function gtk_plot_text_get_area
(c-name "gtk_plot_text_get_area")
(return-type "none")
--- 3446,3450 ----
)
! (define-function plot_text_get_area
(c-name "gtk_plot_text_get_area")
(return-type "none")
***************
*** 4400,4404 ****
(define-function gtk_plot_ps_new
! (is-constructor-of "GtkPlotPs")
(c-name "gtk_plot_ps_new")
(return-type "GtkObject*")
--- 4462,4466 ----
(define-function gtk_plot_ps_new
! (is-constructor-of "GtkPlotPS")
(c-name "gtk_plot_ps_new")
(return-type "GtkObject*")
***************
*** 4824,4828 ****
)
! (define-function gtk_psfont_init
(c-name "gtk_psfont_init")
(return-type "gint")
--- 4886,4890 ----
)
! (define-function psfont_init
(c-name "gtk_psfont_init")
(return-type "gint")
***************
*** 4834,4838 ****
)
! (define-function gtk_psfont_get_by_name
(c-name "gtk_psfont_get_by_name")
(return-type "GtkPSFont*" (null-ok))
--- 4896,4900 ----
)
! (define-function psfont_get_by_name
(c-name "gtk_psfont_get_by_name")
(return-type "GtkPSFont*" (null-ok))
***************
*** 4842,4846 ****
)
! (define-function gtk_psfont_get_by_family
(c-name "gtk_psfont_get_by_family")
(return-type "GtkPSFont*" (null-ok))
--- 4904,4908 ----
)
! (define-function psfont_get_by_family
(c-name "gtk_psfont_get_by_family")
(return-type "GtkPSFont*" (null-ok))
***************
*** 4876,4880 ****
)
! (define-function gtk_psfont_add_font
(c-name "gtk_psfont_add_font")
(return-type "none")
--- 4938,4942 ----
)
! (define-function psfont_add_font
(c-name "gtk_psfont_add_font")
(return-type "none")
***************
*** 4889,4893 ****
)
! (define-function gtk_psfont_add_i18n_font
(c-name "gtk_psfont_add_i18n_font")
(return-type "none")
--- 4951,4955 ----
)
! (define-function psfont_add_i18n_font
(c-name "gtk_psfont_add_i18n_font")
(return-type "none")
***************
*** 4904,4908 ****
)
! (define-function gtk_psfont_get_families
(c-name "gtk_psfont_get_families")
(return-type "none")
--- 4966,4970 ----
)
! (define-function psfont_get_families
(c-name "gtk_psfont_get_families")
(return-type "none")
***************
*** 4960,4963 ****
--- 5022,5026 ----
(define-function gtk_sheet_new_browser
+ (is-constructor-of "GtkSheet")
(c-name "gtk_sheet_new_browser")
(return-type "GtkWidget*")
***************
*** 4981,4984 ****
--- 5044,5048 ----
(define-function gtk_sheet_new_with_custom_entry
+ (is-constructor-of "GtkSheet")
(c-name "gtk_sheet_new_with_custom_entry")
(return-type "GtkWidget*")
Index: gtkextra.override
===================================================================
RCS file: /cvsroot/python-gtkextra/python-gtkextra2/gtkextra/gtkextra.override,v
retrieving revision 1.12
retrieving revision 1.13
diff -C2 -d -r1.12 -r1.13
*** gtkextra.override 14 Jan 2003 15:32:24 -0000 1.12
--- gtkextra.override 15 Jan 2003 18:57:08 -0000 1.13
***************
*** 166,169 ****
--- 166,181 ----
}
+ #define GTK_TYPE_PLOT_DT_NODE (gtk_plot_dt_node_get_type ())
+ static GType
+ gtk_plot_dt_node_get_type (void)
+ {
+ static GType our_type = 0;
+
+ if (our_type == 0)
+ our_type = g_pointer_type_register_static ("GtkPlotDTnode");
+
+ return our_type;
+ }
+
static GtkSheetRange*
gtk_sheet_range_new ( gint row0, gint col0, gint rowi, gint coli)
***************
*** 197,200 ****
--- 209,218 ----
}
+ static gboolean
+ gtk_plot_dt_add_node_PY (GtkPlotDT *data, GtkPlotDTnode *node)
+ {
+ return gtk_plot_dt_add_node(data, *node);
+ }
+
/* This one is probably an "error" in h2def.py */
#define GTK_PLOT3_D GTK_PLOT3D
***************
*** 220,223 ****
--- 238,266 ----
}
+ #if 0
+ static void
+ g_free_msg(void *p) {
+ fprintf(stderr, "g_free(%p)\n", p);
+ g_free(p);
+ }
+
+ static void
+ g_strfreev_msg(gchar **str_array) {
+ fprintf(stderr, "g_strfreev(%p)\n", str_array);
+ g_strfreev(str_array);
+ }
+ #endif
+
+ static void
+ wrong_number_of_values(int which, int expected, int given)
+ {
+ static const char *axis_name[] = { "X", "Y", "Z", "A", "DX", "DY", "DZ", "DA" };
+ gchar buf[256];
+ g_snprintf(buf, sizeof(buf),
+ "wrong number of %s values; expected %d, got %d",
+ axis_name[which], expected, given);
+ PyErr_SetString(PyExc_ValueError, buf);
+ }
+
int
pygtkextra_data_from_pyobject(PyObject **out_obj, PyObject *in_obj, gint *p_n, gdouble **p_points)
***************
*** 407,410 ****
--- 450,483 ----
static gint
+ pygtkextra_dict_set_item_double(PyObject *py_dict, gchar *key, const gdouble d)
+ {
+ PyObject *py_d = PyFloat_FromDouble(d);
+ if (!py_d) {
+ return -1;
+ }
+ if ( PyDict_SetItemString(py_dict, key, py_d) ) {
+ Py_DECREF(py_d);
+ return -1;
+ }
+ Py_DECREF(py_d);
+ return 0;
+ }
+
+ static gint
+ pygtkextra_dict_set_item_string(PyObject *py_dict, gchar *key, const gchar *s)
+ {
+ PyObject *py_s = PyString_FromString(s);
+ if (!py_s) {
+ return -1;
+ }
+ if ( PyDict_SetItemString(py_dict, key, py_s) ) {
+ Py_DECREF(py_s);
+ return -1;
+ }
+ Py_DECREF(py_s);
+ return 0;
+ }
+
+ static gint
pygtkextra_get_double(PyObject *py_obj, gdouble *pd)
{
***************
*** 663,667 ****
#if defined(_DEBUG)
! printf("num+_points = %d\n", num_points);
#endif
--- 736,740 ----
#if defined(_DEBUG)
! printf("num_points = %d\n", num_points);
#endif
***************
*** 721,725 ****
gdouble *pd = NULL;
PyObject *py_out = NULL;
! int num_points;
if ( pygtkextra_data_from_pyobject( &py_out, value, &num_points, &pd) < 0 ) {
--- 794,798 ----
gdouble *pd = NULL;
PyObject *py_out = NULL;
! int num_points, num_points_old;
if ( pygtkextra_data_from_pyobject( &py_out, value, &num_points, &pd) < 0 ) {
***************
*** 728,733 ****
}
! if ( num_points != gtk_plot_data_get_numpoints(GTK_PLOT_DATA(self->obj) ) ) {
! PyErr_SetString(PyExc_TypeError, "use set_points() to change size");
return -1;
}
--- 801,811 ----
}
! num_points_old = gtk_plot_data_get_numpoints(GTK_PLOT_DATA(self->obj));
! if ( num_points != num_points_old ) {
! gchar buf[256];
! g_snprintf(buf, sizeof(buf),"wrong number of %s values; expected %d, got %d;" \
! "use set_points() method to change size",
! key, num_points_old, num_points);
! PyErr_SetString(PyExc_TypeError, buf);
return -1;
}
***************
*** 839,844 ****
--- 917,1099 ----
}
%%
+ override gtk_plot_data_get_point
+ static PyObject *
+ _wrap_gtk_plot_data_get_point(PyGObject *self, PyObject *args)
+ {
+ PyObject *py_ret;
+ gint n;
+ gdouble x, y, z, a, dx, dy, dz, da;
+ gchar *label;
+ gboolean error;
+ GtkPlotData *plot_data = GTK_PLOT_DATA(self->obj);
+
+ if (!PyArg_ParseTuple(args, "i:PlotData.get_point", &n)) {
+ return NULL;
+ }
+
+ gtk_plot_data_get_point(plot_data, n, &x, &y, &z, &a, &dx, &dy, &dz, &da, &label, &error);
+
+ if (error) {
+ PyErr_SetString(PyExc_RuntimeError, "gtk_plot_data_get_point() returned an error");
+ return NULL;
+ }
+
+ if (! (py_ret = PyDict_New()) )
+ return NULL;
+
+ if ( (plot_data -> x && pygtkextra_dict_set_item_double(py_ret, "x", x))
+ || (plot_data -> y && pygtkextra_dict_set_item_double(py_ret, "y", y))
+ || (plot_data -> z && pygtkextra_dict_set_item_double(py_ret, "z", z))
+ || (plot_data -> a && pygtkextra_dict_set_item_double(py_ret, "a", a))
+ || (plot_data -> dx && pygtkextra_dict_set_item_double(py_ret, "dx", dx))
+ || (plot_data -> dy && pygtkextra_dict_set_item_double(py_ret, "dy", dy))
+ || (plot_data -> dz && pygtkextra_dict_set_item_double(py_ret, "dz", dz))
+ || (plot_data -> da && pygtkextra_dict_set_item_double(py_ret, "da", da))
+ || (plot_data -> labels && pygtkextra_dict_set_item_string(py_ret, "label", label)) ) {
+ Py_DECREF(py_ret);
+ return NULL;
+ }
+ return py_ret;
+ }
+ %%
+ override gtk_plot_data_set_labels kwargs
+ PyObject *
+ _wrap_gtk_plot_data_set_labels(PyGObject *self, PyObject *args, PyObject *kwargs)
+ {
+ static char *kwlist[] = { "labels", NULL };
+ PyObject *py_obj, *py_c_obj;
+ int i, num_labels;
+ gchar **labels = NULL;
+
+ if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O:PlotData.set_labels", kwlist, &py_obj))
+ return NULL;
+
+ if (!PySequence_Check(py_obj)) {
+ PyErr_SetString(PyExc_TypeError, "labels must be sequence");
+ return NULL;
+ }
+
+ num_labels = PySequence_Length(py_obj);
+ if (num_labels != gtk_plot_data_get_numpoints(GTK_PLOT_DATA(self->obj))) {
+ PyErr_SetString(PyExc_TypeError, "labels must have exactly one label for each existing data point");
+ return NULL;
+ }
+
+ 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);
+
+ for (i=0 ; i<num_labels; i++) {
+ PyObject *item = PySequence_GetItem(py_obj, i);
+ if (!item)
+ return NULL;
+ else if (item == Py_None) {
+ labels[i] = NULL; /* already was NULL */
+ }
+ else if (PyString_Check(item)) {
+ labels[i] = g_strdup(PyString_AS_STRING(item));
+ }
+ else {
+ Py_DECREF(item);
+ PyErr_SetString(PyExc_TypeError, "label items must be strings or None");
+ return NULL;
+ }
+ Py_DECREF(item);
+ }
+
+ gtk_plot_data_set_labels(GTK_PLOT_DATA(self->obj), labels);
+
+ Py_INCREF(Py_None);
+ return Py_None;
+ }
+ %%
+ override gtk_plot_data_get_labels noargs
+ PyObject *
+ _wrap_gtk_plot_data_get_labels(PyGObject *self)
+ {
+ PyObject *py_tup;
+ int len, i;
+ gchar **labels;
+ gboolean show_labels;
+
+ len = gtk_plot_data_get_numpoints(GTK_PLOT_DATA(self->obj));
+ labels = gtk_plot_data_get_labels(GTK_PLOT_DATA(self->obj), &show_labels);
+
+ if ( ! (py_tup = PyTuple_New(len)) )
+ return NULL;
+
+ for (i=0; i<len; i++) {
+ if (!labels || !labels[i]) {
+ Py_INCREF(Py_None);
+ PyTuple_SET_ITEM(py_tup, i, Py_None);
+ }
+ else {
+ PyTuple_SET_ITEM(py_tup, i, PyString_FromString(labels[i]));
+ }
+ }
+
+ return Py_BuildValue("iN", show_labels, py_tup);
+ }
+ %%
+ override gtk_plot_data_get_symbol noargs
+ static PyObject *
+ _wrap_gtk_plot_data_get_symbol(PyGObject *self)
+ {
+ GtkPlotSymbolType type;
+ GtkPlotSymbolStyle style;
+ gint size;
+ gfloat line_width;
+ GdkColor color = {0,};
+ GdkColor border_color = {0,};
+
+ gtk_plot_data_get_symbol( GTK_PLOT_DATA(self->obj), &type, &style, &size, &line_width, &color, &border_color);
+
+ return Py_BuildValue("(iiifNN)", type, style, size, line_width,
+ pyg_boxed_new(GDK_TYPE_COLOR, &color, TRUE, TRUE),
+ pyg_boxed_new(GDK_TYPE_COLOR, &color, TRUE, TRUE));
+ }
+
+ void
+ gtk_plot_data_get_line_attributes (GtkPlotData *dataset,
+ GtkPlotLineStyle *style,
+ GdkCapStyle *cap_style,
+ GdkJoinStyle *join_style,
+ gfloat *width,
+ GdkColor *color);
+ %%
+ override gtk_plot_data_get_line_attributes noargs
+ static PyObject *
+ _wrap_gtk_plot_data_get_line_attributes(PyGObject *self)
+ {
+ GtkPlotLineStyle line_style;
+ GdkCapStyle cap_style;
+ GdkJoinStyle join_style;
+ gfloat width;
+ GdkColor color = {0, };
+
+ gtk_plot_data_get_line_attributes( GTK_PLOT_DATA(self->obj),
+ &line_style, &cap_style, &join_style, &width, &color);
+
+ return Py_BuildValue("(iiifN)", line_style, cap_style, join_style, width,
+ pyg_boxed_new(GDK_TYPE_COLOR, &color, TRUE, TRUE));
+ }
+ %%
+ override gtk_plot_data_get_gradient noargs
+ static PyObject *
+ _wrap_gtk_plot_data_get_gradient(PyGObject *self)
+ {
+
+ gdouble min, max;
+ gint nlevels, nsublevels;
+ gtk_plot_data_get_gradient( GTK_PLOT_DATA(self->obj),
+ &min, &max, &nlevels, &nsublevels);
+ return Py_BuildValue("(ddii)", &min, &max, &nlevels, &nsublevels);
+ }
+ %%
ignore
+ gtk_plot_data_new_function
gtk_plot_data_construct_function
+ gtk_plot_data_new_iterator
gtk_plot_data_construct_iterator
gtk_plot_data_get_points
***************
*** 859,862 ****
--- 1114,1120 ----
gtk_plot_data_set_a
gtk_plot_data_set_da
+ gtk_plot_data_set_link
+ gtk_plot_data_get_link
+ gtk_plot_data_remove_link
%%
override gtk_plot_canvas_get_active_point noargs
***************
*** 917,921 ****
}
%%
- %%
override gtk_plot_new kwargs
static int
--- 1175,1178 ----
***************
*** 1068,1072 ****
return NULL;
gtk_plot_axis_get_attributes(GTK_PLOT(self->obj), axis, &width, &color);
! return Py_BuildValue("(dO)", (double)width, pyg_boxed_new(GDK_TYPE_COLOR, &color, TRUE, TRUE));
}
%%
--- 1325,1329 ----
return NULL;
gtk_plot_axis_get_attributes(GTK_PLOT(self->obj), axis, &width, &color);
! return Py_BuildValue("(dN)", (double)width, pyg_boxed_new(GDK_TYPE_COLOR, &color, TRUE, TRUE));
}
%%
***************
*** 1092,1095 ****
--- 1349,1355 ----
}
%%
+ ignore
+ gtk_plot_new_with_size
+ %%
override _set_data_from_pyobject_callback
static PyObject *
***************
*** 1169,1177 ****
}
%%
%%
ignore
! plot3d_construct
! plot3d_construct_with_size
!
%%
override gtk_plot_surface_new kwargs
--- 1429,1465 ----
}
%%
+ override gtk_plot3d_rotate_vector kwargs
+ static PyObject *
+ _wrap_gtk_plot3d_rotate_vector(PyGObject *self, PyObject *args, PyObject *kwargs)
+ {
+ static char *kwlist[] = { "x", "y", "z", "a1", "a2", "a3", NULL };
+ double a1, a2, a3;
+ GtkPlotVector vector;
+
+ if (!PyArg_ParseTupleAndKeywords(args, kwargs, "dddddd:GtkPlot3D.rotate", kwlist,
+ &vector.x, &vector.y, &vector.z, &a1, &a2, &a3))
+ return NULL;
+ gtk_plot3d_rotate_vector(GTK_PLOT3_D(self->obj), &vector, a1, a2, a3);
+ Py_INCREF(Py_None);
+ return Py_None;
+ }
+ %%
+ override gtk_plot3d_get_pixel
+ static PyObject *
+ _wrap_gtk_plot3d_get_pixel(PyGObject *self, PyObject *args)
+ {
+ double x, y, z;
+ double xx, yy, zz;
+ if (!PyArg_ParseTuple(args, "ddd", &xx, &yy, &zz)) {
+ return NULL;
+ }
+ gtk_plot3d_get_pixel(GTK_PLOT3_D(self->obj), xx, yy, zz, &x, &y, &z);
+ return Py_BuildValue("(ddd)", x, y, z);
+ }
%%
ignore
! gtk_plot3d_construct
! gtk_plot3d_construct_with_size
! gtk_plot3d_new_with_size
%%
override gtk_plot_surface_new kwargs
***************
*** 1204,1207 ****
--- 1492,1622 ----
}
%%
+ override gtk_plot_surface_set_points kwargs
+ static PyObject *
+ _wrap_gtk_plot_surface_set_points(PyGObject *self, PyObject *args, PyObject *kwargs)
+ {
+ /*
+ Treat kwargs as a complete data set.
+ If a key is specified set value.
+ If a key is not specified clear value.
+
+ NOTE: I have changed the symantics of this call slightly
+ from what the C gtk_plot_surface_set_points().
+ */
+
+ static char *kwlist[] = { "nx", "ny", "x", "y", "z", "dx", "dy", "dz", "build_mesh", NULL };
+ gdouble *x = NULL, *y = NULL, *dx = NULL, *dy = NULL, *z = NULL, *dz = NULL;
+ PyObject *py_x = NULL, *py_y = NULL, *py_z = NULL;
+ PyObject *py_dx = NULL, *py_dy = NULL, *py_dz = NULL;
+
+ PyObject *py_x_out = NULL, *py_y_out = NULL, *py_z_out = NULL;
+ PyObject *py_dx_out = NULL, *py_dy_out = NULL, *py_dz_out = NULL;
+
+ int nx, ndx, ny, ndy, nz, ndz;
+ int rx, rdx, ry, rdy, rz, rdz;
+ gint num_x, num_y, num_z;
+ gint build_mesh = 1;
+
+ if (!PyArg_ParseTupleAndKeywords(args, kwargs, "ii|OOOOOOi:GtkPlotSurface.set_points", kwlist,
+ &num_x, &num_y,
+ &py_x, &py_y, &py_z, &py_dx, &py_dy, &py_dz,
+ &build_mesh))
+ return NULL;
+
+ rx = pygtkextra_data_from_pyobject( &py_x_out, py_x, &nx, &x);
+ ry = pygtkextra_data_from_pyobject( &py_y_out, py_y, &ny, &y );
+ rz = pygtkextra_data_from_pyobject( &py_z_out, py_z, &nz, &z );
+ rdx = pygtkextra_data_from_pyobject( &py_dx_out, py_dx, &ndx, &dx );
+ rdy = pygtkextra_data_from_pyobject( &py_dy_out, py_dy, &ndy, &dy );
+ rdz = pygtkextra_data_from_pyobject( &py_dz_out, py_dz, &ndz, &dz );
+
+ #if defined(_DEBUG)
+ printf("n: %d %d %d %d %d %d\n", nx, ny, ndx, ndy, nz, ndz);
+ printf("r: %d %d %d %d %d %d\n", rx, ry, rdx, rdy, rz, rdz);
+ #endif
+
+ if ( (rx < 0) || (ry < 0) || (rdx < 0) || (rdy < 0) || (rz < 0) || (rdz < 0) ) {
+ goto do_err;
+ }
+
+ num_z = num_x * num_y;
+ if (nx != num_z) {
+ wrong_number_of_values(0, num_z, nx);
+ goto do_err;
+ }
+ if (ny != num_z) {
+ wrong_number_of_values(1, num_z, ny);
+ goto do_err;
+ }
+ if (nz != num_z) {
+ wrong_number_of_values(2, num_z, nz);
+ goto do_err;
+ }
+ if (ndx != num_z && ndx != 0) {
+ wrong_number_of_values(4, num_z, ndx);
+ goto do_err;
+ }
+ if (ndy != num_z && ndy != 0) {
+ wrong_number_of_values(5, num_z, ndy);
+ goto do_err;
+ }
+ if (ndz != num_z && ndz != 0) {
+ wrong_number_of_values(6, num_z, ndz);
+ goto do_err;
+ }
+
+ gtk_plot_surface_set_nx(GTK_PLOT_SURFACE(self->obj), num_x);
+ gtk_plot_surface_set_ny(GTK_PLOT_SURFACE(self->obj), num_y);
+ gtk_plot_data_set_numpoints(GTK_PLOT_DATA(self->obj), num_z);
+
+ #define _DO_ONE(_x) \
+ if ( pygtkextra_set_data(self, #_x, py_ ## _x ## _out) ) \
+ goto do_err; \
+ Py_DECREF(py_ ## _x ##_out); \
+ gtk_plot_surface_set_ ## _x (GTK_PLOT_SURFACE(self->obj), NULL); \
+ gtk_plot_surface_set_ ## _x (GTK_PLOT_SURFACE(self->obj), _x); \
+
+ _DO_ONE(x);
+ _DO_ONE(dx);
+ _DO_ONE(y);
+ _DO_ONE(dy);
+ _DO_ONE(z);
+ _DO_ONE(dz);
+
+ #undef _DO_ONE
+
+ if (build_mesh)
+ gtk_plot_surface_build_mesh(GTK_PLOT_SURFACE(self->obj));
+
+ Py_INCREF(Py_None);
+ return Py_None;
+
+ do_err:
+ Py_XDECREF(py_x_out);
+ Py_XDECREF(py_dx_out);
+ Py_XDECREF(py_y_out);
+ Py_XDECREF(py_dy_out);
+ Py_XDECREF(py_z_out);
+ Py_XDECREF(py_dz_out);
+ return NULL;
+ }
+ %%
+ ignore
+ gtk_plot_surface_new_function
+ gtk_plot_surface_construct_function
+ gtk_plot_surface_get_points
+ gtk_plot_surface_get_x
+ gtk_plot_surface_get_dx
+ gtk_plot_surface_get_y
+ gtk_plot_surface_get_dy
+ gtk_plot_surface_get_z
+ gtk_plot_surface_get_dz
+ gtk_plot_surface_set_x
+ gtk_plot_surface_set_dx
+ gtk_plot_surface_set_y
+ gtk_plot_surface_set_dy
+ gtk_plot_surface_set_z
+ gtk_plot_surface_set_dz
+ %%
override gtk_plot_csurface_new kwargs
static int
***************
*** 1233,1258 ****
}
%%
! override gtk_plot_csurface_construct_function kwargs
static PyObject *
! _wrap_gtk_plot_csurface_construct_function(PyGObject *self, PyObject *args, PyObject *kwargs)
{
! static char *kwlist[] = { "function", NULL };
! PyObject *function;
!
! if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O:GtkPlotCSurface.construct_function", kwlist, &function))
! return NULL;
!
! if (!PyCallable_Check(function)) {
! PyErr_SetString(PyExc_RuntimeError, "function argument must be callable");
! return NULL;
! }
!
! gtk_plot_csurface_construct_function(GTK_PLOT_CSURFACE(self->obj), pygtkextra_plot_function_3D);
! pygtkextra_set_data(self, function_key, function);
!
! Py_INCREF(Py_None);
! return Py_None;
}
%%
override gtk_color_combo_new kwargs
static int
--- 1648,1677 ----
}
%%
! override gtk_plot_csurface_get_levels_attributes noargs
static PyObject *
! _wrap_gtk_plot_csurface_get_levels_attributes(PyGObject *self)
{
! GtkPlotLineStyle style;
! gfloat width;
! GdkColor color = {0, };
! gtk_plot_csurface_get_levels_attributes(GTK_PLOT_CSURFACE(self->obj), &style, &width, &color);
! return Py_BuildValue("(ifN)", style, width, pyg_boxed_new(GDK_TYPE_COLOR, &color, TRUE, TRUE));
}
%%
+ override gtk_plot_csurface_get_sublevels_attributes noargs
+ static PyObject *
+ _wrap_gtk_plot_csurface_get_sublevels_attributes(PyGObject *self)
+ {
+ GtkPlotLineStyle style;
+ gfloat width;
+ GdkColor color = {0, };
+ gtk_plot_csurface_get_sublevels_attributes(GTK_PLOT_CSURFACE(self->obj), &style, &width, &color);
+ return Py_BuildValue("(ifN)", style, width, pyg_boxed_new(GDK_TYPE_COLOR, &color, TRUE, TRUE));
+ }
+ %%
+ ignore
+ gtk_plot_csurface_new_function
+ gtk_plot_csurface_construct_function
+ %%
override gtk_color_combo_new kwargs
static int
***************
*** 1317,1320 ****
--- 1736,1994 ----
pygobject_register_wrapper((PyObject *)self);
return 0;
+ }
+ %%
+ ignore
+ gtk_color_combo_new_with_values
+ %%
+ override gtk_check_item_new kwargs
+ static int
+ _wrap_gtk_check_item_new(PyGObject *self, PyObject *args, PyObject *kwargs)
+ {
+ static char *kwlist[] = { "label", NULL };
+ char *label = NULL;
+
+ if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|z:GtkCheckItem.__init__", kwlist, &label))
+ return -1;
+
+ if (label)
+ self->obj = (GObject *)gtk_check_item_new_with_label(label);
+ else
+ self->obj = (GObject *)gtk_check_item_new();
+
+ if (!self->obj) {
+ PyErr_SetString(PyExc_RuntimeError, "could not create GtkCheckItem object");
+ return -1;
+ }
+ pygobject_register_wrapper((PyObject *)self);
+ return 0;
+ }
+ %%
+ ignore
+ gtk_check_item_new_with_label
+ gtk_check_item_construct_with_label
+ %%
+ override gtk_item_entry_new kwargs
+ static int
+ _wrap_gtk_item_entry_new(PyGObject *self, PyObject *args, PyObject *kwargs)
+ {
+ static char *kwlist1[] = { NULL };
+ static char *kwlist2[] = { "max", NULL };
+ int max;
+
+ if (PyArg_ParseTupleAndKeywords(args, kwargs, ":GtkItemEntry.__init__", kwlist1))
+ self->obj = (GObject *)gtk_item_entry_new();
+ else if (PyErr_Clear(),
+ PyArg_ParseTupleAndKeywords(args, kwargs, "i:GtkItemEntry.__init__", kwlist2, &max)) {
+ self->obj = (GObject *)gtk_item_entry_new_with_max_length(max);
+ }
+ else
+ return -1;
+
+ if (!self->obj) {
+ PyErr_SetString(PyExc_RuntimeError, "could not create GtkItemEntry object");
+ return -1;
+ }
+ pygobject_register_wrapper((PyObject *)self);
+ return 0;
+ }
+ %%
+ ignore
+ gtk_item_entry_new_with_max_length
+ %%
+ override gtk_psfont_get_families
+ static PyObject *
+ _wrap_gtk_psfont_get_families(PyObject *self, PyObject *args)
+ {
+ int i;
+ gint len;
+ GList *families;
+ PyObject *list;
+
+ if (!PyArg_ParseTuple(args, ":gtk_psfont_get_families"))
+ return NULL;
+
+ gtk_psfont_get_families(&families, &len);
+
+ list = PyList_New(len);
+ if (!list)
+ return NULL;
+
+ for (i = 0; i < len; ++i) {
+ PyObject *family;
+
+ family = PyString_FromString((char *) g_list_nth_data(families, i));
+ if (!family) {
+ Py_DECREF(list);
+ return NULL;
+ }
+ PyList_SET_ITEM(list, i, family);
+ }
+ return list;
+ }
+ %%
+ ignore
+ gtk_psfont_unref
+ %%
+ %%
+ override gtk_plot_ps_new kwargs
+ static int
+ _wrap_gtk_plot_ps_new(PyGObject *self, PyObject *args, PyObject *kwargs)
+ {
+ static char *kwlist1[] = { "psname", "orientation", "epsflag", "pageflag", "scalex", "scaley", NULL };
+ static char *kwlist2[] = { "psname", "orientation", "epsflag", "units", "width", "height", "scalex", "scaley", NULL };
+ char *psname;
+ int orientation, epsflag, units, page_size;
+ double width, height, scalex, scaley;
+
+ if (PyArg_ParseTupleAndKeywords(args, kwargs, "siiidd:GtkPlotPS.__init__", kwlist1,
+ &psname, &orientation, &epsflag, &page_size, &scalex, &scaley)) {
+ self->obj = (GObject*) gtk_plot_ps_new(psname, orientation, epsflag, page_size, scalex, scaley);
+ }
+ else if (PyErr_Clear(),
+ PyArg_ParseTupleAndKeywords(args, kwargs, "siiidddd:GtkPlotPS.__init__", kwlist2,
+ &psname, &orientation, &epsflag, &units, &width, &height, &scalex, &scaley)) {
+ self->obj = (GObject*) gtk_plot_ps_new_with_size(psname, orientation, epsflag, units, width, height, scalex, scaley);
+ }
+ else
+ return -1;
+
+ if (!self->obj) {
+ PyErr_SetString(PyExc_RuntimeError, "could not create GtkPlotPS object");
+ return -1;
+ }
+ pygobject_register_wrapper((PyObject *)self);
+ return 0;
+ }
+ %%
+ ignore
+ gtk_plot_ps_new_with_size
+ gtk_plot_ps_construct
+ gtk_plot_ps_construct_with_size
+
+ %%
+ override gtk_plot_polar_new kwargs
+ static int
+ _wrap_gtk_plot_polar_new(PyGObject *self, PyObject *args, PyObject *kwargs)
+ {
+ static char *kwlist1[] = { "drawable", NULL };
+ static char *kwlist2[] = { "width", "height", "drawable", NULL };
+ PyGObject *drawable = NULL;
+ double width, height;
+
+ if (PyArg_ParseTupleAndKeywords(args, kwargs, "|O!:GtkPlotPolar.__init__", kwlist1,
+ &PyGdkDrawable_Type, &drawable)) {
+ self->obj = (GObject *)gtk_plot_polar_new(drawable ? GDK_DRAWABLE(drawable->obj) : NULL);
+ }
+ else if (PyErr_Clear(),
+ PyArg_ParseTupleAndKeywords(args, kwargs, "dd|O!:GtkPlotPolar.__init__", kwlist2,
+ &width, &height,
+ &PyGdkDrawable_Type, &drawable)) {
+ self->obj = (GObject *)gtk_plot_polar_new_with_size(drawable ? GDK_DRAWABLE(drawable->obj) : NULL,
+ width, height);
+ }
+ else
+ return -1;
+
+ if (!self->obj) {
+ PyErr_SetString(PyExc_RuntimeError, "could not create GtkPlotPolar object");
+ return -1;
+ }
+ pygobject_register_wrapper((PyObject *)self);
+ return 0;
+ }
+ %%
+ ignore
+ gtk_plot_polar_new_with_size
+ %%
+ override gtk_sheet_new kwargs
+ static int
+ _wrap_gtk_sheet_new(PyGObject *self, PyObject *args, PyObject *kwargs)
+ {
+ static char *kwlist1[] = { "rows", "columns", "title" "browser", NULL };
+ static char *kwlist2[] = { "rows", "columns", "title", "entry_type", NULL };
+
+ int rows, columns;
+ int browser = 0;
+ char *title;
+ GType entry_type;
+ PyObject *py_entry_type = NULL;
+
+ if (PyArg_ParseTupleAndKeywords(args, kwargs, "iis|i:GtkSheet.__init__", kwlist1,
+ &rows, &columns, &title, &browser)) {
+ if (browser)
+ self->obj = (GObject *)gtk_sheet_new_browser(rows, columns, title);
+ else
+ self->obj = (GObject *)gtk_sheet_new(rows, columns, title);
+ }
+ else if (PyErr_Clear(),
+ PyArg_ParseTupleAndKeywords(args, kwargs, "iisO:GtkSheet.__init__", kwlist2,
+ &rows, &columns, &title, &py_entry_type)) {
+ if ((entry_type = pyg_type_from_object(py_entry_type)) == 0)
+ return -1;
+ self->obj = (GObject *) gtk_sheet_new_with_custom_entry(rows, columns, title, entry_type);
+ }
+ else
+ return -1;
+
+ if (!self->obj) {
+ PyErr_SetString(PyExc_RuntimeError, "could not create GtkSheet object");
+ return -1;
+ }
+ pygobject_register_wrapper((PyObject *)self);
+ return 0;
+ }
+ %%
+ ignore
+ gtk_sheet_new_browser
+ gtk_sheet_construct_browser
+ gtk_sheet_new_with_custom_entry
+ gtk_sheet_construct_with_custom_entry
+ %%
+ override gtk_plot_text_get_size kwargs
+ static PyObject *
+ _wrap_gtk_plot_text_get_size(PyObject *self, PyObject *args, PyObject *kwargs)
+ {
+ gchar *text, *font_name;
+ gint angle, font_size, width, height, ascent, descent;
+ static char *kwlist[] = { "text", "angle", "font_name", "font_size", NULL };
+
+ if (PyArg_ParseTupleAndKeywords(args, kwargs, "sisi:plot_text_get_size", kwlist,
+ &text, &angle, &font_name, &font_size))
+ return NULL;
+ gtk_plot_text_get_size(text, angle, font_name, font_size,
+ &width, &height, &ascent, &descent);
+ return Py_BuildValue("(iiii)", width, height, ascent, descent);
+ }
+ %%
+ override gtk_plot_text_get_area kwargs
+ static PyObject *
+ _wrap_gtk_plot_text_get_area(PyObject *self, PyObject *args, PyObject *kwargs)
+ {
+ /*
+ '("const-gchar*" "text")
+ '("gint" "angle")
+ '("GtkJustification" "just")
+ '("const-gchar*" "font_name")
+ '("gint" "font_size")
+ '("gint*" "x")
+ '("gint*" "y")
+ '("gint*" "width")
+ '("gint*" "height")
+ */
+ gchar *text, *font_name;
+ gint angle, font_size, x, y, width, height;
+ GtkJustification just;
+ PyObject *py_just = NULL;
+
+ static char *kwlist[] = { "text", "angle", "just", "font_name", "font_size", NULL };
+
+ if (PyArg_ParseTupleAndKeywords(args, kwargs, "siOsi:plot_text_get_size", kwlist,
+ &text, &angle, &py_just, &font_name, &font_size))
+ return NULL;
+ if (pyg_enum_get_value(GTK_TYPE_JUSTIFICATION, py_just, (gint *)&just))
+ return NULL;
+
+ gtk_plot_text_get_area(text, angle, just, font_name, font_size, &x, &y, &width, &height);
+ return Py_BuildValue("(iiii)", x, y, width, height);
}
%%
Index: gtkextramodule.c
===================================================================
RCS file: /cvsroot/python-gtkextra/python-gtkextra2/gtkextra/gtkextramodule.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** gtkextramodule.c 14 Jan 2003 15:32:34 -0000 1.8
--- gtkextramodule.c 15 Jan 2003 18:57:08 -0000 1.9
***************
*** 60,63 ****
--- 60,65 ----
#undef _ADD_CONST
+ gtk_psfont_init();
+
if (PyErr_Occurred())
Py_FatalError("could not initialise module gtkextra._gtkextra");
|
|
From: <pyt...@li...> - 2003-01-15 18:57:11
|
Update of /cvsroot/python-gtkextra/python-gtkextra2/examples
In directory sc8-pr-cvs1:/tmp/cvs-serv26596/examples
Modified Files:
testcontour.py testgtkplot.py testgtksheet.py testiterator.py
Log Message:
lots more done
Index: testcontour.py
===================================================================
RCS file: /cvsroot/python-gtkextra/python-gtkextra2/examples/testcontour.py,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** testcontour.py 2 Jan 2003 22:00:45 -0000 1.2
--- testcontour.py 15 Jan 2003 18:57:08 -0000 1.3
***************
*** 7,11 ****
class Application(gtk.Window):
! def __init__(self):
gtk.Window.__init__(self)
self.set_title("Contour Demo")
--- 7,11 ----
class Application(gtk.Window):
! def __init__(self, use_function = 1):
gtk.Window.__init__(self)
self.set_title("Contour Demo")
***************
*** 27,33 ****
canvas.add_plot(plot, 0.16, 0.02)
! surface = gtkextra.PlotCSurface(self.function)
! surface.set_xstep(0.05)
! surface.set_ystep(0.05)
surface.set_legend("cos ((r-r\\s0\\N)\\S2\\N)")
surface.set_gradient(0.2, 0.8, 6, 1)
--- 27,46 ----
canvas.add_plot(plot, 0.16, 0.02)
! nx = 40
! ny = 40
! if use_function:
! surface = gtkextra.PlotCSurface(self.function)
! surface.set_xstep(1.0/nx)
! surface.set_ystep(1.0/ny)
! else:
! x=[]; y=[]; z=[]
! for ix in range(nx):
! for iy in range(ny):
! x.append(ix/float(nx))
! y.append(iy/float(ny))
! z.append(self.function(x[-1], y[-1]))
! surface = gtkextra.PlotCSurface()
! surface.set_points(nx, ny, x=x, y=y, z=z)
!
surface.set_legend("cos ((r-r\\s0\\N)\\S2\\N)")
surface.set_gradient(0.2, 0.8, 6, 1)
***************
*** 41,47 ****
canvas.add_plot(plot, 0.26, 0.56)
! surface = gtkextra.PlotCSurface(self.function)
! surface.set_xstep(0.10)
! surface.set_ystep(0.10)
surface.set_legend("cos ((r-r\\s0\\N)\\S2\\N)")
surface.set_gradient(0.2, 0.8, 6, 1)
--- 54,73 ----
canvas.add_plot(plot, 0.26, 0.56)
! nx = 20
! ny = 20
! if use_function:
! surface = gtkextra.PlotCSurface(self.function)
! surface.set_xstep(1.0/nx)
! surface.set_ystep(1.0/ny)
! else:
! x=[]; y=[]; z=[]
! for ix in range(nx):
! for iy in range(ny):
! x.append(ix/float(nx))
! y.append(iy/float(ny))
! z.append(self.function(x[-1], y[-1]))
! surface = gtkextra.PlotCSurface()
! surface.set_points(nx, ny, x=x, y=y, z=z)
!
surface.set_legend("cos ((r-r\\s0\\N)\\S2\\N)")
surface.set_gradient(0.2, 0.8, 6, 1)
***************
*** 52,56 ****
canvas.export_ps("democsurface.ps", 0, 0, gtkextra.PLOT_LETTER)
- canvas.export_ps("democsurface.ps", 0, 0, gtkextra.PLOT_LETTER)
self.show_all()
--- 78,81 ----
***************
*** 60,64 ****
if __name__ == '__main__':
! app = Application()
app.connect("destroy", lambda win : gtk.main_quit())
gtk.main()
--- 85,89 ----
if __name__ == '__main__':
! app = Application(0)
app.connect("destroy", lambda win : gtk.main_quit())
gtk.main()
Index: testgtkplot.py
===================================================================
RCS file: /cvsroot/python-gtkextra/python-gtkextra2/examples/testgtkplot.py,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** testgtkplot.py 2 Jan 2003 22:00:47 -0000 1.8
--- testgtkplot.py 15 Jan 2003 18:57:08 -0000 1.9
***************
*** 186,190 ****
data.show_yerrbars()
data.set_legend("Spline + EY")
!
data = gtkextra.PlotData()
plot.add_data(data)
--- 186,193 ----
data.show_yerrbars()
data.set_legend("Spline + EY")
! data.show_labels(gtk.TRUE)
! data.set_labels(['0', '1', '2', '3', '4', '5'])
! data.set_labels(['0', '1', '2', '3', '4', '99'])
!
data = gtkextra.PlotData()
plot.add_data(data)
Index: testgtksheet.py
===================================================================
RCS file: /cvsroot/python-gtkextra/python-gtkextra2/examples/testgtksheet.py,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** testgtksheet.py 2 Jan 2003 22:00:50 -0000 1.2
--- testgtksheet.py 15 Jan 2003 18:57:08 -0000 1.3
***************
*** 654,657 ****
--- 654,660 ----
if __name__ == '__main__':
+ print 'The Python binding for GtkSheet are not complete.'
+ print 'Patches will be accepted if you fix them.'
+ raw_input("Press enter to see what done so far.")
app = Application()
app.connect("destroy", lambda win : gtk.main_quit())
Index: testiterator.py
===================================================================
RCS file: /cvsroot/python-gtkextra/python-gtkextra2/examples/testiterator.py,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** testiterator.py 14 Jan 2003 15:32:03 -0000 1.2
--- testiterator.py 15 Jan 2003 18:57:08 -0000 1.3
***************
*** 1,4 ****
! #!/usr/env python
!
import sys
--- 1,3 ----
! #!/usr/bin/env python
import sys
|
|
From: <pyt...@li...> - 2003-01-14 15:33:27
|
Update of /cvsroot/python-gtkextra/python-gtkextra2/gtkextra
In directory sc8-pr-cvs1:/tmp/cvs-serv5904/gtkextra
Modified Files:
gtkextra.defs gtkextra.override gtkextramodule.c
Log Message:
support GtkPlotData functions and iterators
Index: gtkextra.defs
===================================================================
RCS file: /cvsroot/python-gtkextra/python-gtkextra2/gtkextra/gtkextra.defs,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** gtkextra.defs 2 Jan 2003 22:00:55 -0000 1.8
--- gtkextra.defs 14 Jan 2003 15:32:09 -0000 1.9
***************
*** 2415,2419 ****
'("gfloat" "line_width")
'("const-GdkColor*" "color")
! '("const-GdkColor*" "border_color" (default "NULL") (null-ok))
)
)
--- 2415,2419 ----
'("gfloat" "line_width")
'("const-GdkColor*" "color")
! '("const-GdkColor*" "border_color")
)
)
Index: gtkextra.override
===================================================================
RCS file: /cvsroot/python-gtkextra/python-gtkextra2/gtkextra/gtkextra.override,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -d -r1.11 -r1.12
*** gtkextra.override 10 Jan 2003 20:34:08 -0000 1.11
--- gtkextra.override 14 Jan 2003 15:32:24 -0000 1.12
***************
*** 32,35 ****
--- 32,36 ----
static PyObject *pygtkextra_data_from_pyobject_callback = NULL;
static const gchar *function_key = "pygtkextra::function";
+ static const gchar *iterator_key = "pygtkextra::iterator";
/*
***************
*** 405,408 ****
--- 406,514 ----
}
+ static gint
+ pygtkextra_get_double(PyObject *py_obj, gdouble *pd)
+ {
+ PyObject *py_value;
+
+ if (PyFloat_Check(py_obj)) {
+ *pd = PyFloat_AS_DOUBLE(py_obj);
+ return 0;
+ } else if (PyNumber_Check(py_obj) && (py_value = PyNumber_Float(py_obj))) {
+ *pd = PyFloat_AS_DOUBLE(py_value);
+ Py_DECREF(py_value);
+ return 0;
+ }
+ return -1;
+ }
+
+ static void
+ pygtkextra_plot_iterator (GtkPlot *plot,
+ GtkPlotData *data,
+ gint iter,
+ gdouble *x,
+ gdouble *y,
+ gdouble *z,
+ gdouble *a,
+ gdouble *dx,
+ gdouble *dy,
+ gdouble *dz,
+ gdouble *da,
+ gchar **label,
+ gboolean *error)
+ {
+ PyObject *py_iterator = NULL, *py_result = NULL, *py_data = NULL, *py_plot = NULL;
+
+ py_data = pygobject_new((GObject*) data);
+ py_plot = pygobject_new((GObject*) plot);
+ py_iterator = pygtkextra_get_data((PyGObject*) py_data, iterator_key);
+
+ *error = FALSE;
+
+ if (py_iterator == Py_None) {
+ PyErr_SetString(PyExc_TypeError, "could not retrieve the python plot iterator");
+ goto cleanup;
+ }
+ py_result = PyEval_CallFunction(py_iterator, "(OOi)", py_plot, py_data, iter);
+ if (py_result) {
+ int i, mask_bit_cnt=0;
+
+ if (!PyTuple_Check(py_result)) {
+ PyErr_SetString(PyExc_TypeError, "plot iterator must return a tuple");
+ goto cleanup;
+ }
+
+ for (i = 0; i < 9 ; i++)
+ if (data->iterator_mask & (0x1 << i))
+ mask_bit_cnt ++;
+
+ if ( PyTuple_GET_SIZE(py_result) != mask_bit_cnt ) {
+ PyErr_SetString(PyExc_TypeError, "iterator_mask and iterator fuction's results are mismatched");
+ goto cleanup;
+ }
+
+ i = 0;
+
+ #define _DO_ONE(_x, _X) \
+ if ( data->iterator_mask & GTK_PLOT_DATA_ ## _X) { \
+ if ( pygtkextra_get_double(PyTuple_GET_ITEM(py_result, i++), _x)) { \
+ PyErr_SetString(PyExc_TypeError, #_x " must be a number"); \
+ goto cleanup; \
+ } \
+ }
+
+ _DO_ONE(x, X);
+ _DO_ONE(y, Y);
+ _DO_ONE(z, Z);
+ _DO_ONE(a, A);
+ _DO_ONE(dx, DX);
+ _DO_ONE(dy, DY);
+ _DO_ONE(dz, DZ);
+ _DO_ONE(da, DA);
+
+ #undef _DO_ONE
+
+ if ( data->iterator_mask & GTK_PLOT_DATA_LABELS) {
+ PyObject *py_value = PyTuple_GET_ITEM(py_result, i);
+ if ( !PyString_Check(py_value) ) {
+ PyErr_SetString(PyExc_TypeError, "label must be a string");
+ goto cleanup;
+ }
+ *label = PyString_AS_STRING(py_value); /* FIXME: Is this safe here? */
+ }
+ }
+
+ cleanup:
+ if (PyErr_Occurred()) {
+ *error = TRUE;
+ PyErr_Print();
+ PyErr_Clear();
+ }
+
+ Py_XDECREF(py_iterator);
+ Py_XDECREF(py_result);
+ Py_XDECREF(py_data);
+ Py_XDECREF(py_plot);
+ }
+
/* ---------------------------------------------------------------------- */
%%
***************
*** 456,459 ****
--- 562,612 ----
}
%%
+ override gtk_plot_data_new kwargs
+ static int
+ _wrap_gtk_plot_data_new(PyGObject *self, PyObject *args, PyObject *kwargs)
+ {
+ static char *kwlist1[] = { NULL };
+ static char *kwlist2[] = { "function", NULL };
+ static char *kwlist3[] = { "iterator", "npoints", "iterator_mask", NULL };
+ PyObject *function, *iterator;
+ gint npoints, iterator_mask;
+
+ if (PyArg_ParseTupleAndKeywords(args, kwargs, ":GtkPlotData.__init__", kwlist1)) {
+ self->obj = (GObject *)gtk_plot_data_new();
+ }
+ else if (PyErr_Clear(),
+ PyArg_ParseTupleAndKeywords(args, kwargs, "O:GtkPlotData.__init__",
+ kwlist2, &function)) {
+ if (!PyCallable_Check(function)) {
+ PyErr_SetString(PyExc_RuntimeError, "function argument must be callable");
+ return -1;
+ }
+ self->obj = (GObject *)gtk_plot_data_new_function(pygtkextra_plot_function);
+ if(self->obj)
+ pygtkextra_set_data(self, function_key, function);
+ }
+ else if (PyErr_Clear(),
+ PyArg_ParseTupleAndKeywords(args, kwargs, "Oii:GtkPlotData.__init__",
+ kwlist3, &iterator, &npoints, &iterator_mask)) {
+ if (!PyCallable_Check(iterator)) {
+ PyErr_SetString(PyExc_RuntimeError, "iterator argument must be callable");
+ return -1;
+ }
+
+ self->obj = (GObject *)gtk_plot_data_new_iterator(pygtkextra_plot_iterator, npoints, iterator_mask);
+ if(self->obj)
+ pygtkextra_set_data(self, iterator_key, iterator);
+ }
+ else
+ return -1;
+
+ if (!self->obj) {
+ PyErr_SetString(PyExc_RuntimeError, "could not create GtkPlotData object");
+ return -1;
+ }
+ pygobject_register_wrapper((PyObject *)self);
+ return 0;
+ }
+ %%
override gtk_plot_data_set_points kwargs
static PyObject *
***************
*** 687,690 ****
--- 840,845 ----
%%
ignore
+ gtk_plot_data_construct_function
+ gtk_plot_data_construct_iterator
gtk_plot_data_get_points
gtk_plot_data_get_x
Index: gtkextramodule.c
===================================================================
RCS file: /cvsroot/python-gtkextra/python-gtkextra2/gtkextra/gtkextramodule.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** gtkextramodule.c 9 Jan 2003 13:10:50 -0000 1.7
--- gtkextramodule.c 14 Jan 2003 15:32:34 -0000 1.8
***************
*** 29,47 ****
pygtkextra_add_constants(m, "GTK_");
/* These were #defines's */
! PyModule_AddIntConstant(m, "PLOT_LETTER_W", GTK_PLOT_LETTER_W);
! PyModule_AddIntConstant(m, "PLOT_LETTER_H", GTK_PLOT_LETTER_H);
! PyModule_AddIntConstant(m, "PLOT_LEGAL_W", GTK_PLOT_LEGAL_W);
! PyModule_AddIntConstant(m, "PLOT_LEGAL_H", GTK_PLOT_LEGAL_H);
! PyModule_AddIntConstant(m, "PLOT_A4_W", GTK_PLOT_A4_W);
! PyModule_AddIntConstant(m, "PLOT_A4_H", GTK_PLOT_A4_H);
! PyModule_AddIntConstant(m, "PLOT_EXECUTIVE_W", GTK_PLOT_EXECUTIVE_W);
! PyModule_AddIntConstant(m, "PLOT_EXECUTIVE_H", GTK_PLOT_EXECUTIVE_H);
! PyModule_AddIntConstant(m, "PLOT_CANVAS_DND_FLAGS", GTK_PLOT_CANVAS_DND_FLAGS);
/* These were anonymous enum's. They really should be fixed in gtkextra. */
! PyModule_AddIntConstant(m, "ICON_LIST_ICON", GTK_ICON_LIST_ICON);
! PyModule_AddIntConstant(m, "ICON_LIST_TEXT_RIGHT", GTK_ICON_LIST_TEXT_RIGHT);
! PyModule_AddIntConstant(m, "ICON_LIST_TEXT_BELOW", GTK_ICON_LIST_TEXT_BELOW);
if (PyErr_Occurred())
--- 29,62 ----
pygtkextra_add_constants(m, "GTK_");
+ #define _ADD_CONST( _x ) \
+ PyModule_AddIntConstant(m, #_x, GTK_ ## _x);
+
/* These were #defines's */
! _ADD_CONST(PLOT_LETTER_W);
! _ADD_CONST(PLOT_LETTER_H);
! _ADD_CONST(PLOT_LEGAL_W);
! _ADD_CONST(PLOT_LEGAL_H);
! _ADD_CONST(PLOT_A4_W);
! _ADD_CONST(PLOT_A4_H);
! _ADD_CONST(PLOT_EXECUTIVE_W);
! _ADD_CONST(PLOT_EXECUTIVE_H);
! _ADD_CONST(PLOT_CANVAS_DND_FLAGS);
/* These were anonymous enum's. They really should be fixed in gtkextra. */
! _ADD_CONST(ICON_LIST_ICON);
! _ADD_CONST(ICON_LIST_TEXT_RIGHT);
! _ADD_CONST(ICON_LIST_TEXT_BELOW);
!
! _ADD_CONST(PLOT_DATA_X);
! _ADD_CONST(PLOT_DATA_Y);
! _ADD_CONST(PLOT_DATA_Z);
! _ADD_CONST(PLOT_DATA_A);
! _ADD_CONST(PLOT_DATA_DX);
! _ADD_CONST(PLOT_DATA_DY);
! _ADD_CONST(PLOT_DATA_DZ);
! _ADD_CONST(PLOT_DATA_DA);
! _ADD_CONST(PLOT_DATA_LABELS);
!
! #undef _ADD_CONST
if (PyErr_Occurred())
|
|
From: <pyt...@li...> - 2003-01-14 15:32:44
|
Update of /cvsroot/python-gtkextra/python-gtkextra2/examples
In directory sc8-pr-cvs1:/tmp/cvs-serv5904/examples
Modified Files:
testiterator.py
Log Message:
support GtkPlotData functions and iterators
Index: testiterator.py
===================================================================
RCS file: /cvsroot/python-gtkextra/python-gtkextra2/examples/testiterator.py,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -d -r1.1.1.1 -r1.2
*** testiterator.py 10 Jul 2002 19:06:54 -0000 1.1.1.1
--- testiterator.py 14 Jan 2003 15:32:03 -0000 1.2
***************
*** 1,71 ****
! #!/usr/bin/env python
! from gtk import *
! from gtkextra import *
from random import randint
! class Application(GtkWindow):
def __init__(self):
! GtkWindow.__init__(self, title="GtkPlot Iterator Demo")
! self.set_usize(550, 600)
! self.connect("destroy", mainquit)
!
colormap = self.get_colormap()
! red = colormap.alloc("red")
! light_blue = colormap.alloc("light blue")
! light_yellow = colormap.alloc("light yellow")
! white = colormap.alloc("white")
! scrollwin = GtkScrolledWindow()
! scrollwin.set_policy(POLICY_AUTOMATIC, POLICY_AUTOMATIC)
self.add(scrollwin)
! canvas = GtkPlotCanvas(PLOT_LETTER_W, PLOT_LETTER_H)
canvas.set_background(light_blue)
scrollwin.add_with_viewport(canvas)
! plot = GtkPlot(width=0.65, height=0.45)
plot.set_background(light_yellow)
plot.legends_set_attributes(None, 0, None, white)
plot.set_range(0.0, 20.0, 0.0, 1.0)
! plot.axis_set_ticks(PLOT_AXIS_X, 2.0, 1)
! plot.axis_set_ticks(PLOT_AXIS_Y, 0.1, 1)
! plot.axis_set_labels_numbers(PLOT_AXIS_TOP, PLOT_LABEL_FLOAT, 0)
! plot.axis_set_labels_numbers(PLOT_AXIS_BOTTOM, PLOT_LABEL_FLOAT, 0)
! plot.axis_set_visible(PLOT_AXIS_TOP, TRUE)
! plot.axis_set_visible(PLOT_AXIS_RIGHT, TRUE)
! plot.grids_set_visible(TRUE, TRUE, TRUE, TRUE)
! plot.axis_hide_title(PLOT_AXIS_TOP)
! plot.axis_hide_title(PLOT_AXIS_RIGHT)
! plot.axis_set_title(PLOT_AXIS_LEFT, "Intensity")
! plot.axis_set_title(PLOT_AXIS_BOTTOM, "Point")
! plot.set_legends_border(PLOT_BORDER_SHADOW, 3)
plot.legends_move(0.60, 0.10)
canvas.add_plot(plot, 0.15, 0.15)
canvas.put_text(0.45, 0.05, "Times-BoldItalic", 20, 0, None, None,
! TRUE, JUSTIFY_CENTER, "Iterator Demo")
! mask = PLOT_DATA_X | PLOT_DATA_Y | PLOT_DATA_LABELS
! data = GtkPlotData((self.iterator, 20, mask))
! data.show_labels(TRUE)
plot.add_data(data)
data.set_legend("Iterator")
! data.set_symbol(PLOT_SYMBOL_DIAMOND, PLOT_SYMBOL_OPAQUE, 10, 2, red)
! data.set_line_attributes(PLOT_LINE_SOLID, 1, red)
self.show_all()
! def iterator(self, i, *args):
! x = i
y = randint(0, 9) / 10.0
! label = str(i)
! return (x, y, None, None, None, None, None, None, label)
def mainloop(self):
mainloop()
! if __name__ == '__main__':
app = Application()
! app.mainloop()
--- 1,79 ----
! #!/usr/env python
! import sys
!
! import gtk
! import gtkextra
from random import randint
! class Application(gtk.Window):
def __init__(self):
! gtk.Window.__init__(self)
! self.set_title("GtkPlot Real Time Demo")
! self.set_size_request(550, 600)
!
colormap = self.get_colormap()
! red = colormap.alloc_color("red")
! light_blue = colormap.alloc_color("light blue")
! light_yellow = colormap.alloc_color("light yellow")
! white = colormap.alloc_color("white")
! scrollwin = gtk.ScrolledWindow()
! scrollwin.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC)
self.add(scrollwin)
! canvas = gtkextra.PlotCanvas(gtkextra.PLOT_LETTER_W, gtkextra.PLOT_LETTER_H)
canvas.set_background(light_blue)
scrollwin.add_with_viewport(canvas)
! plot = gtkextra.Plot(width=0.65, height=0.45)
plot.set_background(light_yellow)
plot.legends_set_attributes(None, 0, None, white)
plot.set_range(0.0, 20.0, 0.0, 1.0)
! plot.axis_set_ticks(gtkextra.PLOT_AXIS_X, 2.0, 1)
! plot.axis_set_ticks(gtkextra.PLOT_AXIS_Y, 0.1, 1)
! plot.axis_set_labels_style(gtkextra.PLOT_AXIS_TOP, gtkextra.PLOT_LABEL_FLOAT, 0)
! plot.axis_set_labels_style(gtkextra.PLOT_AXIS_BOTTOM, gtkextra.PLOT_LABEL_FLOAT, 0)
! plot.axis_set_visible(gtkextra.PLOT_AXIS_TOP, gtk.TRUE)
! plot.axis_set_visible(gtkextra.PLOT_AXIS_RIGHT, gtk.TRUE)
! plot.grids_set_visible(gtk.TRUE, gtk.TRUE, gtk.TRUE, gtk.TRUE)
! plot.axis_hide_title(gtkextra.PLOT_AXIS_TOP)
! plot.axis_hide_title(gtkextra.PLOT_AXIS_RIGHT)
! plot.axis_set_title(gtkextra.PLOT_AXIS_LEFT, "Intensity")
! plot.axis_set_title(gtkextra.PLOT_AXIS_BOTTOM, "Point")
! plot.set_legends_border(gtkextra.PLOT_BORDER_SHADOW, 3)
plot.legends_move(0.60, 0.10)
canvas.add_plot(plot, 0.15, 0.15)
canvas.put_text(0.45, 0.05, "Times-BoldItalic", 20, 0, None, None,
! gtk.TRUE, gtk.JUSTIFY_CENTER, "Iterator Demo")
! mask = gtkextra.PLOT_DATA_X | gtkextra.PLOT_DATA_Y | gtkextra.PLOT_DATA_LABELS
! data = gtkextra.PlotData(self.iterator, 20, mask)
! data.show_labels(gtk.TRUE)
plot.add_data(data)
data.set_legend("Iterator")
! data.set_symbol(gtkextra.PLOT_SYMBOL_DIAMOND, gtkextra.PLOT_SYMBOL_OPAQUE, 10, 2, red, red)
! data.set_line_attributes(gtkextra.PLOT_LINE_SOLID, 0, 0, 1, red)
self.show_all()
! def iterator(self, plot, data, iter):
! x = iter
y = randint(0, 9) / 10.0
! label = str(x)
! return (x, y, label)
def mainloop(self):
mainloop()
! def excepthook(type, value, traceback):
! print type, value, traceback
! sys.exit()
!
! if __name__ == '__main__':
! sys.excepthook = excepthook
app = Application()
! app.connect("destroy", lambda win : gtk.main_quit())
! gtk.main()
|
|
From: <pyt...@li...> - 2003-01-10 20:34:11
|
Update of /cvsroot/python-gtkextra/python-gtkextra2/gtkextra In directory sc8-pr-cvs1:/tmp/cvs-serv13016/gtkextra Modified Files: gtkextra.override Log Message: up year Index: gtkextra.override =================================================================== RCS file: /cvsroot/python-gtkextra/python-gtkextra2/gtkextra/gtkextra.override,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** gtkextra.override 10 Jan 2003 20:29:26 -0000 1.10 --- gtkextra.override 10 Jan 2003 20:34:08 -0000 1.11 *************** *** 6,10 **** * * Copyright (C) 2000-2001 Andreas Voegele ! * Copyright (C) 2002 Toby D. Reeves * * This library is free software; you can redistribute it and/or --- 6,10 ---- * * Copyright (C) 2000-2001 Andreas Voegele ! * Copyright (C) 2002-2003 Toby D. Reeves * * This library is free software; you can redistribute it and/or |
|
From: <pyt...@li...> - 2003-01-10 20:29:29
|
Update of /cvsroot/python-gtkextra/python-gtkextra2/gtkextra
In directory sc8-pr-cvs1:/tmp/cvs-serv11048/gtkextra
Modified Files:
Makefile.am gtkextra.override
Log Message:
GtkPlotData setters
Index: Makefile.am
===================================================================
RCS file: /cvsroot/python-gtkextra/python-gtkextra2/gtkextra/Makefile.am,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** Makefile.am 7 Jan 2003 17:06:19 -0000 1.7
--- Makefile.am 10 Jan 2003 20:29:26 -0000 1.8
***************
*** 1,3 ****
--- 1,5 ----
pygtkextradir = $(pythondir)/gtkextra
+ pygtkextraexecdir = $(pyexecdir)/gtkextra
+
pygtkextra_PYTHON = \
__init__.py \
***************
*** 7,11 ****
mycodegen.py
- pygtkextraexecdir = $(pyexecdir)/gtkextra
# FIXME: Do we want to drop files in the pygtk directory or in our own pkg directory
--- 9,12 ----
Index: gtkextra.override
===================================================================
RCS file: /cvsroot/python-gtkextra/python-gtkextra2/gtkextra/gtkextra.override,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** gtkextra.override 2 Jan 2003 22:00:58 -0000 1.9
--- gtkextra.override 10 Jan 2003 20:29:26 -0000 1.10
***************
*** 561,564 ****
--- 561,594 ----
%%
override-attr GtkPlotData.x
+ static int
+ pygtkextra_plot_data_set(PyGObject *self, PyObject *value,
+ const char *key,
+ void (*func) (GtkPlotData *plot_data, gdouble *pd))
+ {
+ gdouble *pd = NULL;
+ PyObject *py_out = NULL;
+ int num_points;
+
+ if ( pygtkextra_data_from_pyobject( &py_out, value, &num_points, &pd) < 0 ) {
+ Py_XDECREF(py_out);
+ return -1;
+ }
+
+ if ( num_points != gtk_plot_data_get_numpoints(GTK_PLOT_DATA(self->obj) ) ) {
+ PyErr_SetString(PyExc_TypeError, "use set_points() to change size");
+ return -1;
+ }
+
+ if ( pygtkextra_set_data(self, key, py_out) ) {
+ Py_XDECREF(py_out);
+ return -1;
+ }
+ Py_DECREF(py_out);
+
+ (*func)(GTK_PLOT_DATA(self->obj), NULL);
+ (*func)(GTK_PLOT_DATA(self->obj), pd);
+
+ return 0;
+ }
static PyObject *
_wrap_gtk_plot_data__get_x(PyGObject *self, void *closure)
***************
*** 566,569 ****
--- 596,604 ----
return pygtkextra_get_data(self, "x");
}
+ static int
+ _wrap_gtk_plot_data__set_x(PyGObject *self, PyObject *value, void *closure)
+ {
+ return pygtkextra_plot_data_set(self, value, "x", gtk_plot_data_set_x);
+ }
%%
override-attr GtkPlotData.dx
***************
*** 573,576 ****
--- 608,616 ----
return pygtkextra_get_data(self, "dx");
}
+ static int
+ _wrap_gtk_plot_data__set_dx(PyGObject *self, PyObject *value, void *closure)
+ {
+ return pygtkextra_plot_data_set(self, value, "dx", gtk_plot_data_set_dx);
+ }
%%
override-attr GtkPlotData.y
***************
*** 580,583 ****
--- 620,628 ----
return pygtkextra_get_data(self, "y");
}
+ static int
+ _wrap_gtk_plot_data__set_y(PyGObject *self, PyObject *value, void *closure)
+ {
+ return pygtkextra_plot_data_set(self, value, "y", gtk_plot_data_set_y);
+ }
%%
override-attr GtkPlotData.dy
***************
*** 587,590 ****
--- 632,640 ----
return pygtkextra_get_data(self, "dy");
}
+ static int
+ _wrap_gtk_plot_data__set_dy(PyGObject *self, PyObject *value, void *closure)
+ {
+ return pygtkextra_plot_data_set(self, value, "dy", gtk_plot_data_set_dy);
+ }
%%
override-attr GtkPlotData.z
***************
*** 594,597 ****
--- 644,652 ----
return pygtkextra_get_data(self, "z");
}
+ static int
+ _wrap_gtk_plot_data__set_z(PyGObject *self, PyObject *value, void *closure)
+ {
+ return pygtkextra_plot_data_set(self, value, "z", gtk_plot_data_set_z);
+ }
%%
override-attr GtkPlotData.dz
***************
*** 601,604 ****
--- 656,664 ----
return pygtkextra_get_data(self, "dz");
}
+ static int
+ _wrap_gtk_plot_data__set_dz(PyGObject *self, PyObject *value, void *closure)
+ {
+ return pygtkextra_plot_data_set(self, value, "dz", gtk_plot_data_set_dz);
+ }
%%
override-attr GtkPlotData.a
***************
*** 608,611 ****
--- 668,676 ----
return pygtkextra_get_data(self, "a");
}
+ static int
+ _wrap_gtk_plot_data__set_a(PyGObject *self, PyObject *value, void *closure)
+ {
+ return pygtkextra_plot_data_set(self, value, "a", gtk_plot_data_set_a);
+ }
%%
override-attr GtkPlotData.da
***************
*** 614,617 ****
--- 679,687 ----
{
return pygtkextra_get_data(self, "da");
+ }
+ static int
+ _wrap_gtk_plot_data__set_da(PyGObject *self, PyObject *value, void *closure)
+ {
+ return pygtkextra_plot_data_set(self, value, "da", gtk_plot_data_set_da);
}
%%
|