C++ bindings for monotouch using SWIG
![]() |
| (c) S. Delcroix 2013 |
But last week I faced something new. I wanted to bind (for monotouch) a C++ iPhone lib for which I only received the binaries and the headers files. The component was too large to even think about doing a manual C glue code. I googled about the possible solutions and the only valuable advice was to use SWIG, without any rationale or tutorial. This is then probably a first. An explanation on why SWIG can help you for this, the problem I ran into and the solutions I found.
Mono.Cxxi is sexy, but not all-purpose
Go SWIG
pro-tip: on Mac, install swig with homebrew
1. Get the DllImports right
[DllImport ("__Internal")]You can instruct swig to do that by passing the -dllimport option
public static extern void hello ();
swig -c++ -csharp -dllimport __Internal
2. Generate an obj-c++ wrapper
3. Getting rid of the AssemblyLoadExceptions
4. Putting all the pieces together
5. One last thing, set IsCxx = true
Don't forget to get your AssemblyInfo.cs right, i.e. setting IsCxx to true in your LinkWithAttribute.Wrapping up
At this point, you should be all set and you should be able to use your native c++ library directly from within monotouch. Now you have to use your brain, mess with your foo.i file and .NET-ify a bit your API.Would you have any issue with this, or any other binding or mobile development related stuff, contact me, I'm available for contracting.
KDE Platform, Workspaces, Applications 4.10 RC3: openSUSE packages available
Following up on the announcement from KDE, the openSUSE KDE team is happy to announce the availability of 4.10 RC3 packages. Remember that they are packages meant for testing and reporting bugs, so that the next release will be as polished as possible.
You will find the packages in the KDE:Distro:Factory repository. An updated live media based on the upcoming openSUSE 12.3 ([see previous post]({{ site.url }}/2013/01/test-the-upcoming-opensuse-12-3-and-kde-workspace-applications-and-platform-4-10-rc2)) is also available (files named KDE4-4.10.RC3) . The openSUSE 12.2 based version is also available (files named KDE Reloaded) at the same address.
Enjoy!
Replacing kio_sysinfo with kinfocenter
From openSUSE 12.3 on and currently already for the RC packages of KDE SC 4.10, kio_sysinfo will be replaced by kinfocenter. The icon for kinfocenter is still missing in the Kickoff > Computer tab but will be added soon. Until then you can start kinfocenter from the normal Kickoff menu.
The main reason for the replacement is that kio_sysinfo is basically unmaintained and hence bugs do not get fixed.
If you were using kio_sysinfo, please check whether kinfocenter provides all the info and functionality you used with kio_sysinfo. If not, post your suggestions here or to the opensuse-kde mailinglist.
Missing information from kinfocenter’s summary I noticed so far:
- temperatures
- free hard disk space for each partition
- current CPU frequency
Most info is available, even in more detail than kio_sysinfo did show it, yet not as part of the summary. E.g. graphics info, memory stats etc.
ownCloud Client 1.2.0 beta2
Yesterday the ownCloud Client team released the ownCloud Client 1.2.0 beta 2. It includes a couple of improvements compared to beta 1 which was released before Christmas.
The release of version 1.2.0 is planned for the next week if things go smooth.
[caption id=“attachment_219” align=“alignright” width=“595”]
New Sync Protocol Dialog[/caption]
In particular, the the following improvements were added:
- Proxy authentication fixed (Basic auth, NTLM will not yet work)
- The status dialog now provides statistics on the last sync run (via the info button). It will tell in detail which files have been synced, added or deleted.
- Client will go offline while the server in in maintenance mode (feature available with ownCoud master only)
- Improved SSL Certificate acceptance
- All sizes of the new icons are available.
- Support files > 2 GB on all platforms for uploading.
- Fixed some minor memory leaks and again saved some server requests through optimizations.
- Improved error reporting to the user.
- Remove legacy theming support.
We would appreciate if you give this release a test ride. Note that because it is beta you should make extra sure to have have backups of your data.
If you want to give feedback, please use our mailing list for general discussion and the issue tracker for bug reports. Please read our new guidelines on bug reporting before!
Download Links:
- Windows, 32/64 Bit: http://download.owncloud.com/download/testing/owncloud-1.2.0beta2-setup.exe
- Mac OS X ( >= 10.6, 64 bit): http://download.owncloud.com/download/testing/ownCloud-1.2.0beta2.dmg
- Linux: http://software.opensuse.org/download/package?project=isv:ownCloud:testing&package=owncloud-client
Sources:
- Mirall: http://download.owncloud.com/download/testing/mirall-1.2.0beta2.tar.bz2
- OCSync: http://download.owncloud.com/download/testing/ocsync-0.70.1.tar.bz2
Have fun!
My openSUSE 12 Journal - 8: IBM Notes 9.0 public beta
Link to download IBM Notes/Domino 9.0 public beta
Link to the public beta forum.
I would like to draw your attention to the fact that IBM has dropped the Lotus brand and name this new major version IBM Notes 9.0 Social Edition. This is a great statement of intent and direction for this product/solution.
Installation:
Pre-requisite: You will need to uninstall previous versions of Lotus Notes (if any). Note that installing both 8.5.x and 9.0b is not supported (officially).
After you have downloaded the tarball for Notes 9.0b, untar it. You will notice a bunch of RPMs and a smartupgrade.sh script. Run/execute the script as root. Its really that simple.
[Update on 23 Jan 2013]: If running smartupgrade.sh script did not work for you, don't fret. In the same directory where all the ibm_* rpms reside. Execute, as root, zypper in ibm_*.rpm and let zypper figure out all the dependencies for you. All good.
The Notes 9.0b icon can be found via Application Launcher -> Applications -> Office -> More Programs -> IBM Notes. You can right-click and select Add to Favourites so that you don't have to navigate that much just to start it later.
Note that in your very first startup, it will launch a text console for you to accept the license... just in case you miss it and wonder why you are stuck at the splash screen and nothing happens.
Read more »
My openSUSE 12 Journal - 7: Printing to PDF
I'm quite surprised this capability is not included in the base openSUSE 12.2 install since we have OSS version of the Adobe PDF reader (Okular).
Scenario/Use Case:
You need to print out a document directly into a PDF format file, instead of killing trees. Some examples are:
- Printing online receipts directly into a PDF for your electronic filing
- Converting some page or document into PDF format using the Print function
Solution:
Read more »
My openSUSE 12 Journal - 6: Hello 12.2!
Its a new year (2013), a new job, a new Laptop and a new openSUSE 12.2! I'll stop right there before I go off on a tangent, seeing & proclaiming trends where none existed previously.
Details:
- openSUSE 12.2 x86_64 (64-bit) - KDE desktop (default)
- Toshiba Tecra R840 (Intel i5, 4Gb RAM, 320Gb Hdd, Intel HD integrated graphics)
- Dual-boot with Windows 7 (/dev/sda1) and openSUSE (/dev/sda2)
Installation:
Smooth as silk is all I can say and something that has come to be expected.
Given the dual-boot setup, I created my own disk partitioning scheme. So this step deviated from the otherwise straight-forward install (ie click next till the end).
Disk partition scheme:
- /dev/sda1 - 100Gb - original factory installed Windows 7 (size shrunk to 100Gb)
- /dev/sda2 - 100Gb - root partition of openSUSE 12.2 ('/') formatted to ext4
- /dev/sda3 - 98Gb - extended partition
- /dev/sda5 - 6Gb - SWAP partition
- /dev/sda6 - 92Gb - common data partition formatted to NTFS (read/write for both Win7 & openSUSE 12.2)
Reboot into openSUSE 12.2 and use YaST Partitioner to set a mount point. I usually mount this under /mnt/common. Now, openSUSE 12.2 will automatically mount the common data partition in /mnt/common on boot.
The only outstanding part is that /mnt/common is accessible by root (super-user) but normal users access is troublesome. To make /mnt/common read-writeable by normal user, I edit the mount options of /mnt/common in the /etc/fstab file. Example, changed the options in bold from original (first line below) to the second:
/dev/disk/by-id/ata-xxxxxx-part6 /mnt/common ntfs-3g
/dev/disk/by-id/ata-xxxxxx-part6 /mnt/common ntfs-3g uid=han,gid=users,fmask=133,dmask=022,locale=en_US.UTF-8 0 0
where han in uid=han is my normal user account on openSUSE 12.2.
There might be a more user-friendly way to do this but I did not explore since I'm comfortable editing the /etc/fstab. Readers who knows how this can be done, please feel free to leave a comment. Thanks.
Grub vs Grub2:
I chose to stick with Grub instead of the newer Grub2 boot loader. The reason is simple, I could easily edit the boot options via /boot/grub/menu.lst because its a text file. In Grub2, this is non-trivial and until they have an easier editing interface, I'll stick with Grub.
Additional Software
Read more »
Test the upcoming openSUSE 12.3 and KDE Workspace, Applications and Platform 4.10 RC2
Following up on my previous post, a different type of image has been made by the openSUSE KDE community members. In particular, alin has created images sporting the same software from KDE (4.10 RC2) but using the upcoming openSUSE 12.3 as base.
Download links:
- 32 bit version
- 64 bit version
- Release directory (in case the above links go 404; the files are named KDE4-.4.10.RC2-Live)
These images are provided not only to test 4.10 in openSUSE, but also to test part of the distribution itself, without touching existing systems. Should you encounter a bug, please report it as follows:
- Bugs in KDE software will need to be reported to bugs.kde.org
- Bugs in openSUSE will need to be reported to bugzilla.novell.com
Don’t forget that those images are not persistent, i.e. the settings will not be saved between sessions.
With that said, let the testing commence (or continue)!
KDE:Unstable:SC is moving forward
For some time now, the KDE:Unstable:SC repository for openSUSE did not offer any new snapshot due to the work that was going into getting KDE 4.10 into the upcoming openSUSE 12.3 release. Now that the latest KDE 4.10 Release Candidate (RC2) was placed into the correct repositories, I found some time again to update the KDE:Unstable:SC to a new snapshot from KDE git-master (KDE 4.11). Of course at this moment not many changes are happening in git-master due to the polishing of the KDE 4.10 release (beginning of February).
KDE Workspaces and Applications 4.10 on live images courtesy of openSUSE
The 4.10 release for the KDE Development Platform, Workspaces and Applications is drawing nigh… as you may have read, there is now an additional release candidate in order to test some last-minute changes.
Of course, the KDE developers can only do so much: it’s impossible to test all possible combinations. That is, unless the community at large helps by finding and reporting issues the developers can fix. But doing so requires a 4.10 install. You can of course use packages from distributions, but you may not feel comfortable installing a prerelease on your system (and no one would blame you for that). Of course, if you had something to test without touching your own system…
And that’s exactly what you can do now. Alin and shumski from the openSUSE KDE team have generated live images (based on openSUSE 12.2) for USB and DVD offering a standard 4.10 install, which should provide enough to try the new release and be able to report bugs to the developers.
Some screenshots for the impatient:
[]({{ site.url }}/images/2013/01/snapshot11.png) []({{ site.url }}/images/2013/01/snapshot2.png) []({{ site.url }}/images/2013/01/snapshot31.png) []({{ site.url }}/images/2013/01/snapshot41.png)
And of course, the download links (EDIT: now fixed for good!):
It’s more than 650 Mb, so it won’t fit on a CD, but it will on an USB stick. Follow these instructions to install them to USB media. You can also burn these images to DVD.
If you decide to use it, don’t forget to test (see here what’s needed) and submit detailed bug reports to the developers.
Let’s make 4.10 rock solid!


