Name: Wiliam Alves de Souza
Member since: 2006-11-11 14:53:34
Last Login: 2007-03-26 16:43:54

No personal information is available.

Recent blog entries by waa

8 Jan 2007 (updated 8 Jan 2007 at 17:11 UTC) »
Find and remove mp3 files:
$ find . -iname *.mp3 -exec rm -rf "{}" \;
24 Nov 2006 (updated 24 Nov 2006 at 15:04 UTC) »
PyGTK Widget Test #1

I'm trying to make a widget that roll texts and later to place in a gnome applet

import gobject
import pango
import gtk
from gtk import gdk

class ScrolledTextWidget(gtk.Widget): def __init__(self): gtk.Widget.__init__(self) self.__start = True self.set_font() self.set_text('Caio Eduardo Canestraro de Souza', 'Ana Julia Canestraro de Souza') # update once a milisecond - time.sleep(0.010) gobject.timeout_add(30, self.do_redraw)

def set_font(self, font='Sans', size=10): font = '%s %s' % (font, size) self._font = pango.FontDescription(font)

def set_text(self, t, tt): self.p = self.create_pango_layout(t) self.p.set_font_description(self._font) self.pp = self.create_pango_layout(tt) self.pp.set_font_description(self._font)

def do_realize(self): self.set_flags(self.flags() | gtk.REALIZED) self.window = gdk.Window( self.get_parent_window(), width=self.allocation.width, height=self.allocation.height, window_type=gdk.WINDOW_CHILD, wclass=gdk.INPUT_OUTPUT, event_mask=self.get_events() | gdk.EXPOSURE_MASK) self.window.set_user_data(self), gtk.STATE_NORMAL) self.window.move_resize(*self.allocation)

def do_unrealize(self): self.window.set_user_data(None)

def do_size_request(self, requisition): width, height = self.p.get_size() requisition.width = 150 # Fixed width requisition.height = height // pango.SCALE

def do_size_allocate(self, allocation): self.allocation = allocation if self.flags() & gtk.REALIZED: self.window.move_resize(*allocation)

def do_expose_event(self, event): # Create first context c = self.window.cairo_create() c.rectangle(event.area.x, event.area.y, event.area.width, event.area.height) c.clip() # Create second context cc = self.window.cairo_create() cc.rectangle(event.area.x, event.area.y, event.area.width, event.area.height) cc.clip() fw, fh = self.p.get_pixel_size() # First text size fww, fhh = self.pp.get_pixel_size() # Second text size x, y, h, w = self.get_allocation() # Window size if self.__start: self.x = h self.y = 3 # Fixed value self.xx = h + fw + 5 self.yy = self.y # First context c.move_to(self.x, self.y) c.update_layout(self.p) c.show_layout(self.p) # Second context cc.move_to(self.xx, self.yy) cc.update_layout(self.pp) cc.show_layout(self.pp) if self.x == -fw: self.x = self.xx + fww + 5 elif self.xx == -fw: self.xx = self.x + fw + 5 else: self.x = self.x - 1 self.xx = self.xx - 1 self.__start = False

def do_redraw(self): if self.window: alloc = self.get_allocation() rect = gdk.Rectangle(alloc.x, alloc.y, alloc.width, alloc.height) self.window.invalidate_rect(rect, True) self.window.process_updates(True) # keep running this event return True gobject.type_register(ScrolledTextWidget)

11 Nov 2006 (updated 29 Nov 2006 at 14:57 UTC) »
Starting with an installation

Yesterday, i made an installation of Ubuntu Edgy Eft and start to compiling GNOME 2.18 with jhbuild.


$ sudo aptitude install build-essential cvs m4 docbook docbook-xsl flex bison texinfo lynx doxygen gawk libpopt-dev libfreetype6-dev libpng3-dev libxrender-dev libtiff4-dev x11proto-kb-dev libxext-dev libexpat1-dev libbz2-dev libaudiofile-dev xlibs-dev docbook-utils docbook2x openjade libxft-dev git-core subversion libgdbm-dev libxml-simple-perl libcupsys-dev xnest libexif-dev libexchange-storage1.2-dev libldap2-dev libsdl1.2-dev libc6-dev cvs


$ sudo mkdir -p /opt/gnome2
$ sudo chown `whoami`:`whoami` /opt/gnome2
$ mkdir -p ~/cvs/gnome2
$ cd ~/cvs/gnome2
$ cvs -d login
Logging in to
CVS password: <hit enter>
cvs login: CVS password file /home/waa/.cvspass does not exist - creating a new file
$ cvs -d checkout jhbuild
$ cd jhbuild
$ make
$ make install
$ cp sample.jhbuildrc ~/.jhbuildrc

Add following lines and set the name of moduleset variable in ~/.jhbuildrc file

os.environ['PKG_CONFIG_PATH'] = "/usr/lib/pkgconfig"
os.environ['PWLIBDIR'] = "/opt/gnome2/include/ptlib/unix"
moduleset = 'gnome-2.18'


$ jhbuild bootstrap
$ jhbuild sanitycheck
$ jhbuild build

I had following problem:

Avahi dbus-protocol.c
Eel Can't find freetype/config/ftheader.h


Jhbuild Issues
Jhbuild Dependencies
Luis Menina Jhbuild Guide


[ Certification disabled because you're not logged in. ]

New Advogato Features

New HTML Parser: The long-awaited libxml2 based HTML parser code is live. It needs further work but already handles most markup better than the original parser.

Keep up with the latest Advogato features by reading the Advogato status blog.

If you're a C programmer with some spare time, take a look at the mod_virgule project page and help us with one of the tasks on the ToDo list!

Share this page