Date: Thu, 19 Feb 2009 15:45:27 GMT From: Ashish Shukla <wahjava@gmail.com> To: freebsd-gnats-submit@FreeBSD.org Subject: ports/131877: New Port: devel/parasite GTK+ UI debugging tool Message-ID: <200902191545.n1JFjR4s032025@www.freebsd.org> Resent-Message-ID: <200902191550.n1JFo1v9057251@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>Number: 131877 >Category: ports >Synopsis: New Port: devel/parasite GTK+ UI debugging tool >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Thu Feb 19 15:50:01 UTC 2009 >Closed-Date: >Last-Modified: >Originator: Ashish Shukla >Release: 7.1-STABLE >Organization: N/A >Environment: FreeBSD monte-cristo.france 7.1-STABLE FreeBSD 7.1-STABLE #0: Thu Jan 29 05:08:23 IST 2009 root@monte-cristo.france:/usr/obj/usr/src/sys/GENERIC amd64 >Description: Developing and debugging UIs can be a pain. When something goes wrong, it's not always obvious why. You can waste hours writing logging statements only to find out that a widget is in the wrong container, or an attribute wasn't set correctly. Developing isn't much better either. Ever spend time writing temporary code just to test a new feature, code you know you're going to throw away in an hour, and yet you end up spending the next 20 minutes debugging your temporary code? Sucks, doesn't it? What your program really needs is a good Parasite infestation. Parasite is a debugging and development tool that runs inside your GTK+ application's process. It can inspect your application, giving you detailed information on your UI, such as the hierarchy, X window IDs, widget properties, and more. You can modify properties on the fly in order to experiment with the look of your UI. >How-To-Repeat: >Fix: # This is a shell archive. Save it in a file, remove anything before # this line, and then unpack it by entering "sh file". Note, it may # create directories; files and directories will be owned by you and # have default permissions. # # This archive contains: # # parasite # parasite/pkg-descr # parasite/Makefile # parasite/distinfo # parasite/files # parasite/files/patch-USAGE # echo c - parasite mkdir -p parasite > /dev/null 2>&1 echo x - parasite/pkg-descr sed 's/^X//' >parasite/pkg-descr << '11e695f808cbb499fd4db053d4fb41d4' XDeveloping and debugging UIs can be a pain. When something Xgoes wrong, it's not always obvious why. You can waste hours Xwriting logging statements only to find out that a widget is Xin the wrong container, or an attribute wasn't set correctly. X XDeveloping isn't much better either. Ever spend time writing Xtemporary code just to test a new feature, code you know you're Xgoing to throw away in an hour, and yet you end up spending the Xnext 20 minutes debugging your temporary code? Sucks, doesn't Xit? X XWhat your program really needs is a good Parasite infestation. X XParasite is a debugging and development tool that runs inside Xyour GTK+ application's process. It can inspect your application, Xgiving you detailed information on your UI, such as the hierarchy, XX window IDs, widget properties, and more. You can modify properties Xon the fly in order to experiment with the look of your UI. X XWWW: http://chipx86.github.com/gtkparasite/ 11e695f808cbb499fd4db053d4fb41d4 echo x - parasite/Makefile sed 's/^X//' >parasite/Makefile << 'b3700891278090e9e27e1ab89d172a6b' X# New ports collection makefile for: gtkparasite X# Date created: 2009-02-19 X# Whom: Ashish Shukla <wahjava@gmail.com> X# X# $FreeBSD$ X# X XPORTNAME= parasite XPORTVERSION= 20090219 XCATEGORIES= devel XMASTER_SITES= http://wahjava.googlepages.com/ XDISTNAME= gtkparasite-${PORTVERSION} X XMAINTAINER= wahjava@gmail.com XCOMMENT= GTK+ UI debugging tool X XBUILD_DEPENDS= ${LOCALBASE}/bin/autoconf:${PORTSDIR}/devel/autoconf262 \ X ${LOCALBASE}/bin/automake:${PORTSDIR}/devel/automake110 \ X ${LOCALBASE}/bin/libtoolize:${PORTSDIR}/devel/libtool15 X XUSE_BZIP2= yes XUSE_PYTHON= 2.5+ XUSE_GNOME= gtk20 pygtk2 XWRKSRC= ${WRKDIR}/gtkparasite XGNU_CONFIGURE= yes XPORTDOCS= USAGE XPLIST_FILES= lib/gtk-2.0/modules/libgtkparasite.a \ X lib/gtk-2.0/modules/libgtkparasite.la \ X lib/gtk-2.0/modules/libgtkparasite.so X Xpre-configure: X cd ${WRKSRC} && ${REINPLACE_CMD} -e '/.\/configure/d' ./autogen.sh \ X && ./autogen.sh X Xpost-install: X ${MKDIR} ${DOCSDIR} X ${INSTALL_MAN} ${WRKSRC}/USAGE ${DOCSDIR} X X.include <bsd.port.mk> b3700891278090e9e27e1ab89d172a6b echo x - parasite/distinfo sed 's/^X//' >parasite/distinfo << '63920553223edbb5522d18ede9041474' XMD5 (gtkparasite-20090219.tar.bz2) = a867bd992ffb6cf4581309703438d2ec XSHA256 (gtkparasite-20090219.tar.bz2) = 6a1b89bf88efbe6a628f1257f025854c2a6757dc59b06ee8bad0853ff15819cf XSIZE (gtkparasite-20090219.tar.bz2) = 20651 63920553223edbb5522d18ede9041474 echo c - parasite/files mkdir -p parasite/files > /dev/null 2>&1 echo x - parasite/files/patch-USAGE sed 's/^X//' >parasite/files/patch-USAGE << '09470fa916817d9cd0ac4b2284a6f255' X X$FreeBSD$ X X--- USAGE.orig X+++ USAGE X@@ -0,0 +1,23 @@ X+Parasite is pretty easy to use. Start off by launching with an application by doing the following: X+ X+$ GTK_MODULES=gtkparasite appname X+ X+The Parasite window will pop up immediately, followed by the application window. X+ X+Click the "Inspect" button and then click anywhere in your application's UI to load the widget tree for that window and focus in on the selected widget. You should then be able to browse around the widget tree. X+ X+The properties for the selected widget appear on the right-hand side of the Parasite window. Many properties can be modified (nearly anything other than pointer addresses) by clicking on the property value. You'll either be able to type in a new value, or select from a pop-up list. X+ X+Toggle "Show Graphic Updates" to see debug rectangles any time part of your UI redraws. This can be used to help optimize drawing performance of a widget. X+ X+The Python shell is located at the bottom of the screen. It works like a standard Python shell. You can import modules you need (such as "gtk") and write code to manipulate the widgets. X+ X+A special "parasite" module is imported for you that provides a "gobj" function for converting a pointer address for a widget into something you can use in the Python shell. For example: X+ X+>>> widget = parasite.gobj(0xDEADBEEF) X+ X+ X+You can get the pointer addresses from the "Pointer Address" column in the widget tree, or from right-clicking an item in the widget tree and choosing "Send Widget to Shell." X+ X+You can then use any PyGTK functions on the widget. X+ 09470fa916817d9cd0ac4b2284a6f255 exit >Release-Note: >Audit-Trail: >Unformatted:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200902191545.n1JFjR4s032025>