We are going to create a simple Vala project to warm up. We will use this project to go through the features of Anjuta. So here we go:
hello-world
in the Project Name field, and fill the rest with your own preference and click on Continue.In Anjuta, we will create a project that is a container of all the files and resources that collectively make a software. We will add source codes, files, images, and so on, which are required for project building and deployment. What we have just done is that we have created a simple GTK+ project using the Vala programming language. Don't worry if you don't know what Vala is at this point and the code presented here does not make sense to you, because you are going to learn about it after this chapter.
The wizard that we just ran created a set of files, including generated source code and a user interface. These files can be considered as templates, and we will make changes to these files when we do the development.
As an IDE, Anjuta is quite full featured. It has a source code and general files' editor, a debugger, and Glade, a user interface layout designer. If you are familiar with other IDEs, you may find the view a bit different; so let's dissect this further.
The layout of the IDE is quite simple and is composed of a toolbar, an editor, and arrangeable docks. The toolbar is quite straightforward and is a familiar element. It is a shortcut of certain functions, such as file and editing operation, project running and building, and debugging operations.
There are two kinds of editors in Anjuta. The source code editor and Glade, the user interface editor. Let's talk about the first one.
Like other advanced source code editors, Anjuta provides quite a powerful editor. The notable features are:
Docks are a set of tools that contain specific functions. We can decide whether we want to show or hide the docks by toggling them individually in the View menu. Let's see a quick introduction of each dock.
This tool enables us to bookmark places inside the files that we are editing. When our source code becomes larger and more complex, this tool would come in handy. Whenever we edit more than one file and they are cross referenced with each other, we can go back and forth between the files quickly by just clicking on the bookmark entry.
This tool lists all the files in the project. It is a quick view of the files inside the project folder. If we want to edit the file, we just need to double-click on the file we are interested in, and the editor will pop up.
This tool acts as our view to the project. It categorically lists the contents of the project. We can easily see which files are user interface files, which files are source code, and so on. A double-click on the project item would either bring up the editor (for the user interface layout files or the source code) or a dialog (for other project items). Here we can control Anjuta and many aspects of the project items, such as the installation path, compiler switches, and so on.
This tool shows all the symbols inside our project. The File, Project, and Search tabs represent the scope of the symbol that we are interested in. When we double-click on the symbol, the editor will immediately go to the line where the symbol resides.
This is a debugger tool that shows the values of all the variables that we are interested in. If you are a "debugging-by-doing-printf" person, you may find that this tool is better. Unfortunately, this tool only works when we develop with the C language. However, we can still use this with C code that is generated from Vala.
This is also a debugger tool that manages the breakpoints. Breakpoints are places in the source code that we want to pause at when we run the program. Breakpoints and Watches are really useful and powerful tools that will make our life easier. It's the same with the Watches dock; this tool only works when we develop with the C language.