Reading Source Code: My thinking process

Table of Contents

1 About this document

This is a log of my thinking process when I first approach a new code project that I'm not familiar with.

The project to discuss here is ibus-bamboo, a Vietnamese input method engine.

2 Project Overview

Looking at README.md for an overview of the project, there's some information we can get:

  • It's a fork of ibus-teni.
  • It has preedit and surrounding text, ibus forward, x11 fake backspace support. This is actually what I want to see when approaching this repository.

Now, look at the Makefile to see how the project will be built and installed:

  • The Go application in src/ibus-bamboo will be compiled to a single binary file called ibus-engine-bamboo.
  • Then it will be copied to /usr/lib/ibus-engine-bamboo.
  • The component file bamboo.xml, will be copied to <ibus-dir>/component/ as well. This file register the ibus-engine-bamboo to ibus.
  • Finally, the data files (viet-on.png and data folder for dictionaries) will be copied to $DESTDIR/bamboo. IMHO, this is a pretty common name that has the potential of conflict with other applications, but not a big problem tho.

    Note: See how ibus communicate with its engines

At this point, we should have a decent amount of information about project's folder structure. Next, we'll explore the main source code folder (src/).

3 Source Folder Structure

It looks like this inside the src folder.

├── github.com
│   ├── BambooEngine
│   │   ├── bamboo-core
│   │   └── goibus
│   └── godbus
└── ibus-bamboo

The two projects at github.com/godbus and github.com/BambooEngine/goibus are the supporting libraries for ibus and dbus in Go. We're not gonna focus on those right now.

The project at github.com/BambooEngine/bamboo-core is the engine used to processing Vietnamese words, and ibus-bamboo is its frontend that will be communicating with ibus.

4 TODO Notes on bamboo-core project

5 TODO Notes on ibus-bamboo project

Date: 2019-01-02 Wed 00:00

Author: Huy Tran

Created: 2019-04-22 Mon 14:41