Essence » Blog

Automatic UI Layouts (part 2)

 — 2 months, 1 week ago
This is a continuation of part 1.

Flow layout mode

In the previous blog post, we discussed the table layout mode, where the layout element is divided into a grid with a fixed number of columns and rows.

However, this may not be how we want to layout our UI.

Consider a file manager:



This would be difficult to layout with a table. We'd either have to make two tables (a 2x1 table containing the navigation pane and folder contents, and 1x3 table containing the toolbar, the other table and the status bar), or use multi-cell positioning.

This layout ...
Read More →


Automatic UI Layouts (part 1)

 — 2 months, 1 week ago
Over the past week I've been thinking about UI layouts. In this blog post I'll discuss what I think the best way to do automatic UI layouts is. This system is based of this project's GUI library, but keep in mind not all of these features have been implemented; this blog post is mostly theoretical.

Manual vs automatic

There are 2 types of UI layouts, manual and automatic. In a manual layout, the programmer must specify where each UI element is placed themselves. This is notably used in the Windows Desktop API:

1
2
3
4
CreateWindow ...
Read More →


Rewriting and refactoring

 — 2 months, 2 weeks ago
Over the last months I haven't added many new features. It's mostly been rewriting and improving existing code.

Primarily, there's a new memory manager, and the GUI's been simplified.
However, there are two new features I want to show off.

Blackjack

I added a small Blackjack game to the OS.



SDL backend

The GUI can now run with a very-much-work-in-progress SDL backend on Windows.



If you want to try it out:
  1. Download the project's source
  2. Copy SDL2, Freetype, and GLEW includes and libraries to the sdl/ folder
  3. Put the DLLs at the root
  4. Run build ...
Read More →


Contributing

 — 3 months, 3 weeks ago
I've started to write up some documentation for the OS on the project's wiki.

If you want to help out with the project, I recommend you first read all the current documentation to get an overview of how the API and GUI work. Also see if you can complete the Getting Started tutorial.

After that, here is a list of things you could work on:
  • Rewrite the multi-line textbox control
  • Rewrite the image viewer
  • Making a modern dark-mode visual style
  • ... And possibly more things


If any of those sound interesting, please visit #essence on the Handmade Network Discord ...
Read More →


Writing a Simple Text Editor

 — 4 months, 3 weeks ago
I recently decided to make a version of "Notepad" for my OS, and it's mostly done now.
To take a deeper look into using the OS's API, I'll walk you through how you could recreate the program.
(Note: the API is still under constant revision, so any information presented in this blog could change at any time...)

We can start by creating a manifest file. The build system should automatically find it.
Let's add a definition for the program.

text_editor/text_editor.manifest
1
2
3
4
[program]
name = "Text Editor";
shortName = "text_editor";
systemMessageCallback = ProcessSystemMessage;


This specifies ...
Read More →


Plans

 — 6 months, 1 week ago
Although I can't remember exactly when I started this project, it was approximately 11 months ago.
Which means we're approaching the 1st year anniversary of development!

By the first anniversary I want to get the OS running on real hardware.
The things I still need to do for this are:
  • AHCI driver (the old one was buggy)
  • Proper VBE graphics mode selection
  • GPT partition table support
  • Possibly EFI booting?
  • Fixing whatever bugs we find!!

That's a worryingly long list, especially as I'm a bit busy this week.
But hopefully I'll manage to get something working ...
Read More →


Hello, world!

 — 7 months, 1 week ago
Let's take a look at what it takes to write a simple "Hello, world!" GUI program for my operating system.

First, we need to write a manifest file.
All we need to do is declare the properties for our main window, and how to build the program.

hello_world/hello_world.manifest
1
2
3
4
5
6
[build]
output = "Hello World.esx";
source = "hello_world/main.cpp";

[window mainWindow]
title = "Hello, world!";


Then, we write the program itself.

hello_world/main.cpp
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19 ...
Read More →


The Filesystem, Version 1

 — 8 months, 1 week ago
The Filesystem, Version 1

What is a filesystem?

As far as your drive is concerned, there is no such thing as a "file" or "folder".
Drives divide up their space into equally-sized sectors, 512 bytes each.

(This number, 512 bytes, originates from the sector size on floppy disks.
Modern drives have larger sectors behind the scenes.
However, drivers send commands to the drive controllers with a precision of 512-byte blocks.
As far as the filesystem driver should be considered, sectors are 512 bytes each.)

This isn't very useful for users.
They want to have hierachical folders which contain files ...
Read More →