GSoC WinForms Designer Report 3

Summary

I am sending my report earlier in, because I will be out of town for the weekend.

This week I have been researching on the logic and workings of the Design-Time Serialization and I’ve got scared. Seriously now. I have implemented a bunch of classes in the System.ComponentModel.Design.Serialization namespace. I have laid the foundations for building the CodeDom* part of the Design-Time Serialization. I am looking forward to implementing it, so I can start generating code!

Repository Data

Start of week revision: 35
End of week revision: 40
Plain Text ChangeSet (~2000 lines): http://monodt.i-nz.net/changeset?format=diff&new=40&old=35&new_path=trunk&old_path=trunk
Visual ChangeSet: http://monodt.i-nz.net/changeset?old_path=trunk&old=35&new_path=trunk&new=40

Details

1.) As planned I have been researching on the System.ComponentModel.Design.Serialization namespace, which resulted a few pretty diagrams (and not only).

2.) I have implemented the following class library classes from the same namespace:

  • ComponentSerializationService.cs
  • ObjectStatementCollection.cs
  • RootContext.cs
  • StatementContext.cs
  • ExpressionContext.cs
  • SerializationStore.cs
  • MemberRelationship.cs
  • MemberRelationshipService.cs
  • BasicDesignerLoader.cs
  • ContextStack - Refactored and updated to 2.0
  • CodeDomDesignerLoader.cs - implemented just the explicit INameCreationService interface.

3.) I did some refactoring in the loading/unloading behaviour of the design surface to result better interaction between the DesignerHost, DesignSurface and DesignerLoader.

Next Week

  • Research on and implement:
    • CodeDomSerializer
    • CodeDomSerializerBase
    • CodeDomSerializerException
    • CollectionCodeDomSerializer
    • MemberCodeDomSerializer
    • InstanceDescriptor
    • TypeCodeDomSerializer
Friday, June 15th, 2007 at 11:00

GSoC WinForms Designer Report 2

Introduction

That was one hell of a week and I am glad I have achieved all I had planned and even a bit more.

I have tested, fixed and refactored what I define to be the core designer and host code. This is everything but the visual user manipulation on the design-time surface. I am ready to proceed to the the design-time serialization, which is the 3rd very important component of the core code. Essentially as my first deliverable for the Mid-Term review I am planning on delivering the core code and as a second deliverable at the end of theGSoC I will deliver a basic frontend to it.

On the base of the work done this week I have refined my schedule.

Repository Data

Start of week revision: 19
End of week revision: 35
Plain Text ChangeSet (~5000 lines): http://monodt.i-nz.net/changeset?format=diff&new=35&old=35&new_path=trunk&old_path=tags%2Fgsoc-begin
Visual ChangeSet: http://monodt.i-nz.net/changeset?old_path=%2Ftags%2Fgsoc-begin&old=&new_path=%2Ftrunk&new=

Details

0.) In the beginning of the week I have spent some time to create an infrastructure for design-time testing and mainly to make my life easier. It has been implemented in the form of a DesignerTestHelper class, which allowed me to easily setup tests’ SetUp/TearOff, initialize a design surface and use helper methods to interact with it. Most importantly it allowed me to do some hacks to test on 1.1 as well (All of the hosting/services code is 2.0, where as the designers are 1.1+2.0).

I have stumbled upon a number of problems with testing the design-time code in the NUnit environment.

  • Drag and drop registration on win32 required running the test in a STA “environment”, which took me a while to figure out how to do.
  • Multi-Threaded tests - I had a lot of problems with that in NUnit and ended up refactoring to single-threaded based tests. I suspect I will have to give the issue a bit of more thought when it comes up to testing the visual behaviour (e.g win32 message routing), if I have to.
  • I get some exceptions on TearDown of some tests (I think 2), more than likely due to some internal MS design-time behaviour, of which I am not aware.

1.) I have covered the core winforms designers stack with unit tests:

  • ComponentDesigner (ITreeDesigner, IDesignerFilter)
  • ControlDesigner
  • ParentControlDesigner
  • ScrollableControlDesigner
  • DocumentDesigner

2.) I have covered the design surface (host) and its services (listed by interface name) with unit tests:

  • DesignSurface (IServiceContainer)
  • IDesignerHost
  • IContainer
  • ISite
  • INestedSite
  • INestedContainer
  • IDictionaryService
  • ITypeDescriptorFilterService

3) The following are new implementations:

  • NestedContainer
  • NestedContainerTest.cs
  • DesignModeNestedContainer and DesignModeNestedSite
  • ReferenceService
  • ComponentDesignerTest.cs
  • ControlDesignerTest.cs
  • DesignSurfaceTest.cs
  • DocumentDesignerTest.cs
  • ParentControlDesignerTest.cs

4) The tests resulted:

  • A lot of refactoring and a lot of MS behavioural compatibility fixes.
  • I have found that bits of information from MSDN2 on different classes is wrong and fixed that.
  • Complete code review.
  • A very nice way to get my head around a lot of different small bits that were not clean before.
  • They all pass on Mono and MSNET.

5) On the base of the work done this week I have refined my schedule.

Next Week

I won’t have as much time to spend on the project next week, due to personal stuff, which hopefully will take about 2 days. On top of everything today I passed out and hit my head while falling of the chair in a lab, where I went for a blood probe. I’ve been having a terrible headache and haven’t been feeling very well today (Monday), so I haven’t managed to achieve anything but write this report .And no, I do not get sick from seeing mine or others blood, so passing out today was something I wasn’t expecting to happen.

  • Research on Design-Time Serialization and more specifically on the:
    • Interaction between SerializationManager - DesignerLoader - Serializer
    • Code reuse in the specialized serializers (ImageListCodeDomSerializer, CollectionCodeDomSerializer, etc)
  • Classes to look at:
    • DesignerSerializationManager
    • DesignerLoader
    • BasicDesignerLoader
    • CodeDomDesignerLoader
    • CodeDomSerializerBase
    • CodeDomSerializer
  • Begin writing unit tests for the above.
Monday, June 11th, 2007 at 14:43

“Freedom”input Blutooth Keyboards - DO NOT BUY ONE!

DO NOT BUY ONE!!!!!!!

I was waiting for my plane at the Manchester airport yesterday and I had to waste 2 hours. I decided to get a bluetooth keyboard for my Nokia N800, so at least I can do some productive work. Fortunately there was a Dixons shop in the free duty area and I headed directly in and grabbed a what at the time seemed to be a very decent piece of BT keyboard with HID and SPP compatible with all major devices. Well the n800 wasn’t listed but it’s a HID bt device, so it should have worked out of the box.

I opened the box and read the quick setup guide and I was quite surprised to read extremely important information which is not mentioned on the packagingOne can only ever use the keyboard with 2 devices, because the keyboard is locked and requires a special driver. Each piece of hardware you want to use it on has to be registered on the web site via 2 unique codes, supplied in the box, so you end up with 2 unique unlock keys specific for the 2 pieces of hardware. What a fraud, lock-up and scam!

I went back and returned the keyboard and got full money refund from Dixons. It’s such a sad world we live in.

Monday, June 4th, 2007 at 12:24

Intel Mac ALSA Goodies

I am revising and not avoiding work again, I swear! Actually I *am* revising for my last exam on Friday namely “Networking Systems and Application” boo.

In the meanwhile I have some ALSA goodies for us the ones that run Linux on their Intel Macs. Your sound doesn’t work? Your built-in microphone doesn’t work? No more!

I’ve got my hands on the latest pinconfigs and cooked up a patch for ALSA, which adds support for all Intel Macs (macbooks, imacs, macminis etc, except for the 24” iMac and the Mac Pro) and also fixes the current configs. The changeset in HG is ff3ed7049f84. This patch enables the built-in microphone out of the box.

It took me a while to figure out how to get the microphone working, because, as I later found out, the Mux Capture control when maxed out disabled it. As I later found out after an investigation the Mux control is supposed to be limited to 2 step increase (+20db microphone boost), but was limited to 4 in ALSA. Without the boost the mic is pretty useless because the sound recorded has really low volume. The changeset to fix that in HG is 6ee58da0b892.

The last issue I stumbled upon is that when I had to unplug my speakers to plug in my headphones the microphone got disabled and I had to reload ALSA to fix it. The changeset to fix that in HG is 200fc3a7ef62.

At the end of the day thanks to Takashi Iwai and my pinconfigs patch everything works and behaves perfectly out of the box! Finally!

Tuesday, May 29th, 2007 at 21:53

Apple Mac Triple Boot HowTo

Introduction

In this HowTo I will cover how to configure a triple boot Apple Mac machine to boot openSUSE, Windows Vista and Mac OS X.

The Problems

Apple Macs are EFI systems and as such they do not have BIOS. Even though EFI does support the standard partition scheme (MBR), Apple is using the added support for a GUID partition table (GPT). GPT has a limit of 4 partitions and 1 is already used.

Linux supports the GPT and can boot by using elilo as a bootloader. However the lack of BIOS will not allow the video card drivers to operate properly.

Windows doesn’t support GPT.

The Solutions

Video

Apple has updated the firmware to allow emulation of BIOS for its Boot Camp tool to work. It should be noted that while Boot Camp offers an easy way to set up a dual boot Windows/OS X machine it does not come in handy for the purpose of this HowTo.

Partitioning

While GPT is a new scheme, it doesn’t fully replace the MBR, but rather keeps it in the beginning for compatibility reasons. Fortunately one can abuse that and create a MBR partitioning table to match the GPT one. It is very important that the MBR partioning table is kept in sync with the GPT one, because else it will provide false information for the actual physical layout to the software reading it.

Since there are only 3 free GPT partition table slots one can install the three OSes. Linux works just fine with swap on a file in /.

Booting and MBR/GPT syncing

There is an awesome tool available called rEFIt. It includes is not only a boot loader, but also has a built in MBR/GPT partition synchronization tool. It automatically recognizes bootable OSes by scanning the partitions (also scans external devices).

The HowTo

Partitioning

Boot from your Mac OS X CD 1 and use Disk Utility from the menu on top to create one partition for Mac OS X, one Unix type partition and one FAT32 type partition. It appears that it is crucial to have the Windows partition as the last one, else Vista will complain and won’t even install and Windows XP will install, but will throw missing hal.dll error and won’t boot.

Install Mac OS X

Install Mac OS X and update it to the latest version. Reboot and install rEFIt. Reboot and use the sync tool (called “Partition Tool” in the menu) in the rEFIt menu to sync MBR to GPT.

Install Windows Vista (setup NTFS partition)

In Vista’s setup select the FAT32 partition, format it and install there. After the first reboot during the installation use rEFIt sync tool again. This is just to get the NTFS partition in place. Do not finish off the installation now, but rather procceed to the Linux installation. Windows won’t be able to boot after the sync anyway.

Install Linux (openSUSE)

Crucial elements during the installation of openSUSE before the first reboot:

  • Install Linux (yes, everything) on the single UNIX type partition. Use custom partitioning to format the UNIX type partition to ext3 and set mount point to /. Do not create a swap partition and do not even think about resizing partitions.
  • Set the boot loader to LILO, because GRUB will fail to install.
  • Install the boot loader in the boot record for the partition. REFIt can boot it fine and also the master boot record will be free for Windows later on.
  • Remove the Windows entry from the lilo menu, because it causes LILO’s installation to fail.

Unfortunatly for unknown reasons to me after the first reboot during the installation the MBR partitioning table will be gone, so one has to use rEFIt to resync GPT and MBR. This of course will break lilo’s previous setup, so we have to reinstall it before continuing the installation. This can be done by boot from the openSUSE cd/dvd again and once the setup has loaded Ctrl + Fx to a terminal. From that point on we have to mount the partition where we have Linux installed and rerun lilo:

mkdir /media/suse;
mount /dev/sda3 /media/suse
mount --bind /dev /media/suse/dev
chroot /media/suse
lilo -v

Reboot and resync GPT/MBR once more (so that rEFIT sets proper partition types) and then reboot for the last time. You should see OS X, Windows (won’t boot) and Linux icons in the rEFIt menu now. Select the Linux one and finish your openSUSE installation.

Install Windows Vista

Run the Windows Vista installation from the start (again by formatting the partition) to end now. Do not sync MBR/GPT after!

Additional Notes

parted, fdisk, Boot Camp

Do not use parted nor fdisk once you have a working system. I have had very bad experiences with both of those. As bad as in missing GPT and/or MBR partition table after. Do not use Boot Camp as well.

Linux swap on a file

It works fine and can be done as follows. Example sets 2gb swap.

dd if=/dev/zero of=/swap bs=1024 count=2097152
mkswap /swap
swapon /swap
echo "/swap swap swap pri=1 0 0" >> /etc/fstab

Linux Built-in iSight WebCam Driver

Here or possibly supplied by your distribution of choice as uvcvideo patched with my isight patch.

Apple Mac Windows Driver CD iso

After installing Boot Camp the driver cd image is here: /Applications/Utilities/Boot Camp Assistant.app/Contents/Resources/DiskImage.dmg.

Have fun!

Monday, May 14th, 2007 at 19:26

Pidgin Plugins openSUSE RPMs

Today I’ve hacked up two more openSUSE packages for you, the Pidgin lovers:

You can find those in my experimental repository. Have fun!

Sunday, May 6th, 2007 at 17:59

Avoiding university work

Yeah avoiding university work is what I have been doing for tha past few days, which essentially resulted me working at 1am on a coursework. :) But there are a few things that happened too.

Firstly I found out that there was an equalizer element checked in GStreamer CVS, which resulted a second effort to finish off the Banshee Equalizer and hopefuly this time it is going to be the last one. As I’ve blogged before, the infrastructure was layed a few months ago and I had patched Helix and made my Xine media engine to support equalization. The show stopper was gstreamer and the non-existence of a equalizer plugin. I found some code, which was actually shared across quite a lot around different media applications (xmms, vlc, amarok, etc), unfortunatly GPL licensed. The new element in gstreamer’s CVS is LGPL which is a green light. You can monitor #426562 for progress.

Secondly I got tired of waiting for a fix to be released for the incredibly buggy (as in leaking memory + hanging) gnome-main-menu shipped with openSUSE 10.2. There has been a bug in bugzilla since 2006-12-15 (#229190)… That’s about 4 months since then. So I got my hands on that and cooked up my first RPMs ever (they work don’t be scared!). I backported the Factory to 10.2, which was quite challenging firstly because there have been some new macros introduced in Factory for gconf stuff and secondly and most importantly because I didn’t have any experience. Now I am enjoying a very stable new gnome-main-menu. :) I have also decided to run a small RPM repository of mine - http://rpm.i-nz.net and continue learning about packaging. Hopefuly one day I will be more useful to openSUSE. I already go through bugzilla and to a bit of cleanup from time to time. Probably I can make this my hobby or something.

Meh… have to continue writing coursework now… :(

P.S: I found out that uvcvideo in openSUSE Factory includes my isight.patch. Sweet!

UPDATE: rpm.i-nz.net is no more. I have got an account for openSUSE Build Service now. newer gnome-main-menu is on GNOME:Unstable and my stuff is here.

Monday, April 30th, 2007 at 00:42

A new toolbar for Tomboy proposal

I came up with the conclusion that I would be much more comfortable with having the formatting options in Tomboy in the toolbar. Of course polluting the toolbar with loads of formatting options is not a good idea either. I came up with the idea to have the very basic formatting options in the main toolbar and then at the end of it have a +/- to expand/hide a second toolbar with additional formatting options. Check out the mock-up below and drop your comments at #433616 . Feel free to shoot out my idea. :)
[[Image:software/tomboy-toolbar-mockup.png|center]]

Thursday, April 26th, 2007 at 17:27

I have an OpenID … now what?

OpenID - an open single sign-on system. Great! One user-name/pass for all sites requiring a login. I used phpMyID, so I can use my domain’s url, but one can easily get an OpenID at https://www.myopenid.com. It have been about two months since I’ve got my OpenID, but yet I haven’t had the change to use it for once. While there are popular sites like LiveJournal and more that support it, I haven’t had the luck to stumble upon a web site, which supports it and is of use to me.

Imagine if Bugzilla supported OpenID (there have been some efforts 2 years ago - #294608)? There are so many open source projects that use Bugzilla for bug tracking and yet a user wanting to report a bug will have to register on each of those. I bet two from three users just can’t be bothered to register for the sake of reporting a single bug with the thought “Surely someone else will report it very soon”. Developers lose and users lose. What about OpenID authenticated pick-your-version-control-system-name commits? There seem to be plugins to enable OpenID in Trac, MediaWiki and others, so why don’t people install those? Come one people, let’s embrace the technology and make our life easier! The more people that have OpenIDs the more demand on the web sites to embrace it. Also there is a large number of people that probably don’t have a clue what OpenID is, but have one for example AOL/AIM users, Yahoo! users, etc. I am waiting for the day when I will be able to login in let’s say Amazon with my OpenID…

Wednesday, April 25th, 2007 at 20:16

It’s a monkey and it’s evil!

Hey all! My name is Ivan and I’ll be working on the Design Time stuffs in the class library to bring up a Windows Forms Designer for GSoC. In other words … all your base are belong to me! Btw the dots in the name for the GSoC project are typos.

Not that anyone cares, but I am 20 years old, in the second year of my BSc Software Engineering degree in the University of Hull. I am a lover of C# and Mono and a lover of openSUSE. I like strange music, strange movies and strange people. That below is a photo of me and not a photo of the back of a sign in Italy!

[[Image:travel/Rome,%20Italy/DSC01248.JPG|center|512|384]]

Wednesday, April 25th, 2007 at 18:57