MLXProjects / libaroma

an embedded ui toolkit
Apache License 2.0
12 stars 4 forks source link

Libaroma

an embedded UI toolkit

What is this?

It's a C library which provides graphics output, input management, utilities for drawing and a window system with controls that allows to create an entire user interface with few code lines.

Features

#include <aroma.h>
int main(int argc, char **argv){
  if (!libaroma_start()){
      printf("libaroma start failed\n");
      return 0;
  }
  LIBAROMA_WINDOWP win = libaroma_window(NULL, 0, 0, 
            LIBAROMA_SIZE_FULL, LIBAROMA_SIZE_FULL);
  if (win==NULL){
      printf("libaroma window failed\n");
      libaroma_end();
      return 0;
  }
  libaroma_window_show(win);
  LIBAROMA_MSG msg;
  do {
      libaroma_window_pool(win, &msg);
      if (msg.msg==LIBAROMA_MSG_EXIT){
          win->onpool=0;
      }
      else if (msg.msg==LIBAROMA_MSG_TOUCH &&
        msg.state==LIBAROMA_HID_EV_STATE_UP){
          libaroma_msg_post(LIBAROMA_MSG_EXIT, 0, 0, 0, 0, NULL);
      }
      else printf("msg=% state=%d, key=%d, x=%d, y=%d, data=%p\n", 
                  msg.msg, msg.state, msg.key, msg.x, msg.y, msg.d);
  } while(win->onpool);
  libaroma_window_free(win);
  libaroma_end();
}

After this, just compile the program as you would with any project, for example:
gcc main.c -o test -laroma
Run it and should show an empty screen/window that closes after releasing the mouse left click.

TODO