Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Just merge it xd #4

Open
wants to merge 23 commits into
base: master
Choose a base branch
from
Open

Just merge it xd #4

wants to merge 23 commits into from

Conversation

amarullz
Copy link
Member

@amarullz amarullz commented Apr 8, 2022

No description provided.

amarullz and others added 4 commits January 21, 2016 11:07
This commit is from my personal development, and never open to
public, because it was inside my corporate source (my lazyness)

But now it's time to update the source periodically if there is
any update in source.

Not much core function change, no new controls, or any new major
feature in this source. But I did alot of optimize, including
usage of jpeg-turbo, and add support to save canvas into jpeg file.

Many improvement in framebuffer and input driver, mainly to fit
my need (in my projects).

Example: we now can set the framebuffer to request new resolution :)

It also add device blacklist, some memory leaks and corrupt access,
improve some performance, and many tweaks that I forgot (need to
check all in my main project commit history :( ).

Anyway..... Thanks.
will add gitignore
And remove old jpeg-turbo simd
@amarullz amarullz closed this Apr 8, 2022
@M1cha
Copy link

M1cha commented Apr 8, 2022

why did you close the PR again?

@amarullz amarullz reopened this Apr 8, 2022
@amarullz amarullz requested a review from M1cha April 8, 2022 20:30
@amarullz amarullz self-assigned this Apr 8, 2022
@amarullz amarullz requested review from MLXProjects and removed request for MLXProjects April 9, 2022 03:00
MLXProjects and others added 2 commits April 9, 2022 00:43
Small bugs make big disasters :)
This should fix character rendering issues, as the font locking never worked until now.
text_common: fix font mutex locking
MLXProjects
MLXProjects previously approved these changes Apr 9, 2022
Comment on lines +52 to +69
static inline int __MAX(int a, int b){
return (a>b)?a:b;
}
static inline int __MIN(int a, int b){
return (a<b)?a:b;
}
static inline float __FMAX(float a, float b){
return (a>b)?a:b;
}
static inline float __FMIN(float a, float b){
return (a<b)?a:b;
}
static inline double __DMAX(double a, double b){
return (a>b)?a:b;
}
static inline double __DMIN(double a, double b){
return (a<b)?a:b;
}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

those names violate the C standard: http://port70.net/~nsz/c/c11/n1570.html#7.1.3
All identifiers that begin with an underscore and either an uppercase letter or another underscore are always reserved for any use.

Also, what's the point of e.g. calling it __MAX and then have a macro MAX alias it? Why not give it that name directly?
Also, MIN and MAX are defined in many headers and there's a reason non of them are implemented as C functions: so they work with all types.
While the prefixed DMIN/DMAX and FMIN/FMAX might be a good idea, MIN/MAX is not, since most people would expect them to work for all types.

Also, I'd suggest using lowercase names for functions because uppercase function names are generally accepted to be macros which users would expect to support all types.

@@ -153,5 +153,6 @@ byte libaroma_hid_get(LIBAROMA_HID_EVENTP e);
*/
byte libaroma_hid_config(char * name,char * svalue,dword dvalue);

void libaroma_hid_restart();
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you should enable -Wstrict-prototypes. While void is optional for C++, in C it has a different, quite dangerous semantic.

@@ -158,8 +158,11 @@ byte libaroma_start() {

#ifdef LIBAROMA_TTY_KDSETMODE
ALOGI("KDSETMODE = KD_GRAPHICS");
int tty1 = open("/dev/tty1", O_RDWR);
char ttydev[32];
snprintf(ttydev,32,"/dev/tty%i",LIBAROMA_TTY_KDSETMODE);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
snprintf(ttydev,32,"/dev/tty%i",LIBAROMA_TTY_KDSETMODE);
snprintf(ttydev,sizeof(ttydev),"/dev/tty%i",LIBAROMA_TTY_KDSETMODE);

@@ -158,8 +158,11 @@ byte libaroma_start() {

#ifdef LIBAROMA_TTY_KDSETMODE
ALOGI("KDSETMODE = KD_GRAPHICS");
int tty1 = open("/dev/tty1", O_RDWR);
char ttydev[32];
Copy link

@M1cha M1cha Apr 9, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that length seems arbitrary

  • /dev/tty1 == 9
  • max value of %i == is platform specific.
  • 0-terminator

I suggest doing this so you know the length is always 1

uint8_t value = LIBAROMA_TTY_KDSETMODE ? 1 : 0;

With that, you can use a length of 11.

@@ -158,8 +158,11 @@ byte libaroma_start() {

#ifdef LIBAROMA_TTY_KDSETMODE
ALOGI("KDSETMODE = KD_GRAPHICS");
int tty1 = open("/dev/tty1", O_RDWR);
char ttydev[32];
snprintf(ttydev,32,"/dev/tty%i",LIBAROMA_TTY_KDSETMODE);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

while I generally prefer using snprintf, in this case you know the length so you could just use sprintf.
Alternatively (what I'd prefer) since the function libaroma_start has an error code return value already anyway you could properly check the return value just in case we overlooked something.

A proper check would be:

int rc = snprintf(buf, len, ...);
if (rc < 0 || (size_t)rc >= len) {
    // error
}

int tty1 = open("/dev/tty1", O_RDWR);
char ttydev[32];
snprintf(ttydev,32,"/dev/tty%i",LIBAROMA_TTY_KDSETMODE);
int tty1 = open(ttydev, O_RDWR);
ioctl(tty1, KDSETMODE, KD_GRAPHICS);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know you didn't change this line in this PR but I just noticed: you forgot to check the return value of ioctl.

@M1cha
Copy link

M1cha commented Apr 9, 2022

@amarullz Okay so I just realized that the issues I brought up(and many more) were already present before. So I guess it'd make sense to just merge your PR so we have your current work in main and then we can start improving it, agree?

Also, a lot has happened between 2016 and today in terms of coding-standards and how to write safe, qualitative code. Also, I've learned a lot in the meantime 😋

Would you be fine with us realizing the following things before we start working on new things? I'd be willing to help a lot on this.

  • define and apply a .clang-format file to gain a unified, automatically applied codestyle across the whole codebase.
  • add and fix -Wstrict-prototypes
  • add and fix -Wconversion
  • use const on pointers wherever possible
  • remove typedevs on pointers (like LIBAROMA_CONFIGP), because users can't see they're passed by value instead of reference and it doesn't even reduce typing because the P simply replaces a *
  • remove all uses of reserved identifiers
  • give all functions lowercase names
  • you already wrote function documentation but used /* instead of /**. convert it to make them show up in doxygen and IDEs.
  • properly check the return values of all functions
  • remove all commented code
  • replace full license texts in source files with SPDX identifiers
  • add a github actions CI and configure it for use in PRs

What I'd appreciate but is a lot of work and needs your consent:

  • change all return values to something where 0 means success and everything else means error
  • change the return value type to either of those:
    • int (commonly used)
    • enum (less common, safer and easier to use since all values are defined)
    • a struct with a single int or enum field. This is not common at all but it should be since it prevents accidentally comparing the value to a constant or even to other ints or enums in case -Wconversion or -Wenum-compare are disabled

New build environment will only compiling/building
libexternals (zlib, png, jpeg, freetype, etc) and
libaroma as static object ( libexternals.a and libaroma.a ).

With that 2 static object, we can easily make simple app using
libaroma+external, with just something like this:

gcc -O2 \
    main.c libaroma.a libexternals.a \
    -Ilibaroma/include -o main

This build system is simple. There is 4 main files:

/build-config.ini
This file is your configuration for building libaroma.
We can set LIBAROMA_BUILD_FLAGS, LIBAROMA_ROOT_PATH,
and BUILD_ARCH

/build.sh
Is command that we can run to build the static libraries, with arguments
example like this:
   # ./build.sh
   # ./build.sh clean
   # ./build.sh armv7
   # ./build.sh armv7 clean
   # ./build.sh aarch64
   # ./build.sh aarch64 clean
   # ./build.sh x86_64
   # ./build.sh x86_64 clean

/build/build-ARCH.sh
This script will prepare any arch config, like compiling flags,
cross-compile, and which special arch-only file to compile.

/build/builder.sh
The real script that do all build process. Receiving all configuration
from others 3 scripts.

----
Ideal build environment is Linux or Windows+WSL.
since now I don't support and recommended building
it with bat scripts 😥😥

For cross-compiling in ubuntu/ubuntu-wsl, we can use:

ARMv7
    sudo apt install gcc-arm-linux-gnueabihf
AARCH64 / ARM64
    sudo apt install gcc-aarch64-linux-gnu

-----

This commit also remove all un-necessary files and libraries.
My plan before is to move all this file into /deprecated folder,
but the git won't simply move it, but act as it was deletion
+addition (which is wrong).

The script actually safe :), we can restore it again if we needed.
@amarullz
Copy link
Member Author

amarullz commented Apr 9, 2022

Yea. I agree... The problem with this code is, it didn't progress in so long time, only some place tweaked for some need.
There is a lot of things that need a fix and cleanup. libaroma is used in new and very "OLD" running project (Toll gate system).
That's why I keep my own source personal because I am afraid it will broke "ANDROID" support or if I change it so much
it will broke that old program 😉🥲🙂.

I also use and learn a lot of new coding standard, and used it in my newer c project.

For libaroma, I don't know yet what the best thing I should do. I still need it and library still need backward compatible,
but it was a pain to clean up all mess :)

Maybe I should move it to libaroma2? With whole new API, no backward compatibility. But all optimized code in current
version is usable. And I should limit it just for ui toolkit, not become runtime/vm.

I will try my best...

@M1cha
Copy link

M1cha commented Apr 9, 2022

IMO it's not worth preventing progress due to backwards compatibility.
If a company or person can't or doesn't want to invest the time to migrate to a new version they can just keep using the old version and do minor fixes themselves.

With that being said, yes, every time you break API compatibility you should increase the major version, but the version should not be part of the projects name and does not need a new git repository or anything. If you wanna keep maintain the old version you can simply do that in a release branch.

And while you probably have bigger ideas in mind, I'd be able to do most of the things in my list within a weekend (combined, not each) because I've done them many times in past. So if you want me to help you, just say so.

What I'd ask you to do first, would be to decide on a clangformat-supported codestyle though since that'd change every single line in the repo, making it hard to merge other features once you started working on them.
And since it's your project, you are the only one who gets to decide that :)
I recommend using an unmodified or slightly modified existing style instead of inventing your own but it's your choice.

@M1cha
Copy link

M1cha commented Apr 9, 2022

about versioning: https://semver.org/

@MLXProjects
Copy link
Member

MLXProjects commented Apr 9, 2022

Here it is my little apport:
I'm pretty sure it's possible to mantain backwards compatibility while rewriting libaroma almost from scratch, the heavy pointers usage is what makes it a lot easier to use :)
If you publish any major rework on this, I compromise to implement backwards compat with anything this currently supports (ALL data types like canvas, controls and graph engine, etc).
PD: I agree into making libaroma just a smaller UI toolkit, with runtime/vm things as a different project.
Something like what I was doing with libarec (some small library with just the basic recovery functions), the everything-is-a-module concept is great for such projects; plus if we separate runtime from ui toolkit it will be easier to update both.
Also, most times one don't need runtime if just developing ui apps, myself wrote desktop apps thanks to SDL support and they don't need it. Usage vary a lot seen how versatile it is.

@amarullz
Copy link
Member Author

amarullz commented Apr 9, 2022

I think I can implement new rewriting libaroma version that a lot cleaner. to maintain backward compatibility, I can add wrapper to call new functions.

I have a plan to make calls/naming nicer for every feature. usage likes libaroma_canvas_new or libaroma_listitem_option is something that I want to avoid (its become annoying when the project become bigger).

I will try my best to follow standard.

If you have any suggestion for func/struct/types naming, please tell me.

Something like

al_canvas * cv = alCanvas(x,y);

maybe.. still don't know.... (al -> aroma lib / la -> lib aroma), camel case or snake_case or combination???? 🤔🤔

@amarullz
Copy link
Member Author

amarullz commented Apr 9, 2022

And maybe I should start using libraries (zlib, png, etc) from external source, and not including in this source.

@M1cha
Copy link

M1cha commented Apr 10, 2022

About byte, word, dword, ... Those are fine as names or typedefs and I don't mind anybody using them but:

  • they're all of platform-dependent length and should never be the first choice, prefer to use uintX_t and intX_t instead.
  • are they signed or unsigned? the name doesn't tell me that

And just a related piece of information that might be interesting to you: There are platforms where 1 byte != 8 bits 😉

@amarullz
Copy link
Member Author

amarullz commented Apr 10, 2022

I use this as vscode setting for formatting, and I like google format without modification 😉

{
	"editor.formatOnPaste": true,
	"editor.formatOnSave": true,
	"editor.formatOnType": true,
	"editor.codeActionsOnSave": {
		"source.fixAll": true
	},
	"clang-format.executable": "clang-format-10",
	"clang-format.style": "google",
	"clang-format.language.c.enable": true,
	"[c]": {
		"editor.defaultFormatter": "xaver.clang-format",
		"editor.wordBasedSuggestions": false,
		"editor.suggest.insertMode": "replace",
		"editor.semanticHighlighting.enabled": true
	}
}

@M1cha
Copy link

M1cha commented Apr 10, 2022

If you create a .clang-format file in the root of the repo with the following contents you won't need to configure anything and it'll just work with all IDEs and on the console:

BasedOnStyle: Google

@amarullz
Copy link
Member Author

amarullz commented Apr 10, 2022

Let me know what do you think about this new source tree:

libaroma
├── .clang-format
├── .gitignore
├── AUTHORS.md
├── LICENSE
├── README.md
├── include
│   ├── aroma.h
│   └── libaroma
│       ├── alcanvas.h
│       ├── alctl.h
│       ├── aldialog.h
│       ├── aldraw.h
│       ├── algfx.h
│       ├── alimage.h
│       ├── alimage_writer.h
│       ├── almotion.h
│       ├── almsg.h
│       ├── alstream.h
│       ├── altext.h
│       ├── alwin.h
│       └── ctl
│           ├── alabel.h
│           ├── albar.h
│           ├── albutton.h
│           ├── alfragment.h
│           ├── alimgbox.h
│           ├── alist_caption.h
│           ├── alist_check.h
│           ├── alist_div.h
│           ├── alist_img.h
│           ├── alist_menu.h
│           ├── alist_option.h
│           ├── alistbox.h
│           ├── alpager.h
│           ├── alprogress.h
│           ├── alscroll.h
│           └── altab.h
├── libaroma.code-workspace
└── src
    ├── arch
    │   ├── arm
    │   │   ├── arch.c
    │   │   ├── arch.h
    │   │   ├── arm_neon_gfx.c
    │   │   └── memset32.S
    │   ├── arm64
    │   │   ├── android_memset.S
    │   │   ├── arch.c
    │   │   ├── arch.h
    │   │   └── arm64_neon_gfx.c
    │   └── x86
    │       ├── android_memset16.S
    │       ├── android_memset32.S
    │       ├── arch.c
    │       ├── arch.h
    │       ├── cache.h
    │       └── sse_gfx.c
    ├── aroma.c
    ├── aroma_config.h
    ├── aroma_graph.c
    ├── aroma_hid.c
    ├── aroma_internal.h
    ├── aroma_ui.c
    ├── aroma_utils.c
    ├── drivers
    │   ├── graph
    │   │   ├── linux_drm
    │   │   │   ├── graph_driver.c
    │   │   │   └── graph_driver.h
    │   │   ├── linux_fb
    │   │   │   ├── graph_driver.c
    │   │   │   └── graph_driver.h
    │   │   └── sdl
    │   │       ├── graph_driver.c
    │   │       └── graph_driver.h
    │   └── hid
    │       ├── linux_input
    │       │   ├── hid_driver.c
    │       │   └── hid_driver.h
    │       └── sdl
    │           ├── hid_driver.c
    │           └── hid_driver.h
    ├── libaroma
    │   ├── alcanvas.c
    │   ├── alctl.c
    │   ├── aldialog.c
    │   ├── aldraw.c
    │   ├── algfx.c
    │   ├── alimage.c
    │   ├── alimage_writer.c
    │   ├── almotion.c
    │   ├── almsg.c
    │   ├── alstream.c
    │   ├── altext.c
    │   ├── alwin.c
    │   └── ctl
    │       ├── alabel.c
    │       ├── albar.c
    │       ├── albutton.c
    │       ├── alfragment.c
    │       ├── alimgbox.c
    │       ├── alist_caption.c
    │       ├── alist_check.c
    │       ├── alist_div.c
    │       ├── alist_img.c
    │       ├── alist_menu.c
    │       ├── alist_option.c
    │       ├── alistbox.c
    │       ├── alpager.c
    │       ├── alprogress.c
    │       ├── alscroll.c
    │       └── altab.c
    └── platform
        └── linux
            ├── platform.c
            └── platform.h

20 directories, 96 files

@MLXProjects
Copy link
Member

MLXProjects commented Apr 11, 2022

about src/:

  • why not changing aroma_* to just a*?
  • it would be better to define wether to use aroma or libaroma for folders, preferredly I prefer aroma (src/aroma as the current version)
  • what about putting platform/arch folders inside of src/aroma?

about src/arch/:

  • just put <arch>.c/.h, e.g. arm.c, arm.h, i386.c and so on

about libaroma/ctl inside of src and include:

  • the alabel/alist file names should have two L's so what about just using la instead of al everywhere? not sure tho

about src/platform:

  • just like src/arch/ use <platform>.c/.h directly, to avoid unneeded use of subfolders which will just contain one/two files.

@amarullz
Copy link
Member Author

amarullz commented Apr 11, 2022

For platform, It can use /platform/platform_linux.h and platform_linux.c directly, because it just a configuration to set some functions that different in other os, like file_exists, gettime, etc, we can include all in 1 file actually.

But for arch, We can't just use 1 file, because there is features that need to implemented differently per arch, and not everything in C, like memset.S, gfx implementation (vector alpha blending, blit ops, dithering etc) with neon/sse.

The naming still subject to change, previously the folder is not /src/libaroma /include/libaroma, but /src/lib /include/lib just like curl (all library in libs all program in src), it's ok just change it to aroma i think.

I explain about source file naming: I use aroma_xxx.c for non-library calls files, and alXXXX.c for library/publics api 🤔🤔 (I confused myself).

I will try change it with la_, let me see again.

Here:

libaroma
├── .clang-format
├── .gitignore
├── AUTHORS.md
├── LICENSE
├── README.md
├── include
│   ├── aroma.h
│   └── aroma
│       ├── la_canvas.h
│       ├── la_ctl.h
│       ├── la_dialog.h
│       ├── la_draw.h
│       ├── la_gfx.h
│       ├── la_image.h
│       ├── la_image_writer.h
│       ├── la_motion.h
│       ├── la_msg.h
│       ├── la_stream.h
│       ├── la_text.h
│       ├── la_win.h
│       └── ctl
│           ├── la_label.h
│           ├── la_bar.h
│           ├── la_button.h
│           ├── la_fragment.h
│           ├── la_imgbox.h
│           ├── la_list_caption.h
│           ├── la_list_check.h
│           ├── la_list_div.h
│           ├── la_list_img.h
│           ├── la_list_menu.h
│           ├── la_list_option.h
│           ├── la_listbox.h
│           ├── la_pager.h
│           ├── la_progress.h
│           ├── la_scroll.h
│           └── la_tab.h
├── libaroma.code-workspace
└── src
    ├── arch
    │   ├── arm
    │   │   ├── arm_neon_gfx.c
    │   │   └── memset32.S
    │   ├── arm64
    │   │   ├── android_memset.S
    │   │   └── arm64_neon_gfx.c
    │   └── x86
    │       ├── android_memset16.S
    │       ├── android_memset32.S
    │       ├── cache.h
    │       └── sse_gfx.c
    ├── aroma.c
    ├── aroma_config.h
    ├── aroma_graph.c
    ├── aroma_hid.c
    ├── aroma_internal.h
    ├── aroma_ui.c
    ├── aroma_utils.c
    ├── drivers
    │   ├── graph
    │   │   ├── linux_drm
    │   │   │   ├── graph_driver.c
    │   │   │   └── graph_driver.h
    │   │   ├── linux_fb
    │   │   │   ├── graph_driver.c
    │   │   │   └── graph_driver.h
    │   │   └── sdl
    │   │       ├── graph_driver.c
    │   │       └── graph_driver.h
    │   └── hid
    │       ├── linux_input
    │       │   ├── hid_driver.c
    │       │   └── hid_driver.h
    │       └── sdl
    │           ├── hid_driver.c
    │           └── hid_driver.h
    ├── aroma
    │   ├── la_canvas.c
    │   ├── la_ctl.c
    │   ├── la_dialog.c
    │   ├── la_draw.c
    │   ├── la_gfx.c
    │   ├── la_image.c
    │   ├── la_image_writer.c
    │   ├── la_motion.c
    │   ├── la_msg.c
    │   ├── la_stream.c
    │   ├── la_text.c
    │   ├── la_win.c
    │   └── ctl
    │       ├── la_label.c
    │       ├── la_bar.c
    │       ├── la_button.c
    │       ├── la_fragment.c
    │       ├── la_imgbox.c
    │       ├── la_list_caption.c
    │       ├── la_list_check.c
    │       ├── la_list_div.c
    │       ├── la_list_img.c
    │       ├── la_list_menu.c
    │       ├── la_list_option.c
    │       ├── la_listbox.c
    │       ├── la_pager.c
    │       ├── la_progress.c
    │       ├── la_scroll.c
    │       └── la_tab.c
    └── platform
        ├── platform_linux.c
        ├── platform_linux_buildroot.c
        └── platform_qnx.c

I think, aroma_ prefix is better:

libaroma
├── .clang-format
├── .gitignore
├── AUTHORS.md
├── LICENSE
├── README.md
├── include
│   ├── aroma.h
│   └── aroma
│       ├── aroma_canvas.h
│       ├── aroma_ctl.h
│       ├── aroma_dialog.h
│       ├── aroma_draw.h
│       ├── aroma_gfx.h
│       ├── aroma_image.h
│       ├── aroma_image_writer.h
│       ├── aroma_motion.h
│       ├── aroma_msg.h
│       ├── aroma_stream.h
│       ├── aroma_text.h
│       ├── aroma_win.h
│       └── ctl
│           ├── aroma_label.h
│           ├── aroma_bar.h
│           ├── aroma_button.h
│           ├── aroma_fragment.h
│           ├── aroma_imgbox.h
│           ├── aroma_list_caption.h
│           ├── aroma_list_check.h
│           ├── aroma_list_div.h
│           ├── aroma_list_img.h
│           ├── aroma_list_menu.h
│           ├── aroma_list_option.h
│           ├── aroma_listbox.h
│           ├── aroma_pager.h
│           ├── aroma_progress.h
│           ├── aroma_scroll.h
│           └── aroma_tab.h
├── libaroma.code-workspace
└── src
    ├── arch
    │   ├── arm
    │   │   ├── arm_neon_gfx.c
    │   │   └── memset32.S
    │   ├── arm64
    │   │   ├── android_memset.S
    │   │   └── arm64_neon_gfx.c
    │   └── x86
    │       ├── android_memset16.S
    │       ├── android_memset32.S
    │       ├── cache.h
    │       └── sse_gfx.c
    ├── aroma.c
    ├── aroma_config.h
    ├── aroma_graph.c
    ├── aroma_hid.c
    ├── aroma_internal.h
    ├── aroma_ui.c
    ├── aroma_utils.c
    ├── drivers
    │   ├── graph
    │   │   ├── linux_drm
    │   │   │   ├── graph_driver.c
    │   │   │   └── graph_driver.h
    │   │   ├── linux_fb
    │   │   │   ├── graph_driver.c
    │   │   │   └── graph_driver.h
    │   │   └── sdl
    │   │       ├── graph_driver.c
    │   │       └── graph_driver.h
    │   └── hid
    │       ├── linux_input
    │       │   ├── hid_driver.c
    │       │   └── hid_driver.h
    │       └── sdl
    │           ├── hid_driver.c
    │           └── hid_driver.h
    ├── aroma
    │   ├── aroma_canvas.c
    │   ├── aroma_ctl.c
    │   ├── aroma_dialog.c
    │   ├── aroma_draw.c
    │   ├── aroma_gfx.c
    │   ├── aroma_image.c
    │   ├── aroma_image_writer.c
    │   ├── aroma_motion.c
    │   ├── aroma_msg.c
    │   ├── aroma_stream.c
    │   ├── aroma_text.c
    │   ├── aroma_win.c
    │   └── ctl
    │       ├── aroma_label.c
    │       ├── aroma_bar.c
    │       ├── aroma_button.c
    │       ├── aroma_fragment.c
    │       ├── aroma_imgbox.c
    │       ├── aroma_list_caption.c
    │       ├── aroma_list_check.c
    │       ├── aroma_list_div.c
    │       ├── aroma_list_img.c
    │       ├── aroma_list_menu.c
    │       ├── aroma_list_option.c
    │       ├── aroma_listbox.c
    │       ├── aroma_pager.c
    │       ├── aroma_progress.c
    │       ├── aroma_scroll.c
    │       └── aroma_tab.c
    └── platform
        ├── platform_linux.c
        ├── platform_linux_buildroot.c
        └── platform_qnx.c

@M1cha
Copy link

M1cha commented Apr 11, 2022

IMO the headers shouldn't have any prefix since they already are in their own directory.

And as for sources why does there have to be an "aroma" directory? This is the aroma git repository, what else would it be?
I also don't get why some files are in that directory and some aren't. The source files also don't need any prefix because this whole repo is for aroma.

@amarullz
Copy link
Member Author

amarullz commented Apr 11, 2022

You right, we don't need prefix for filename 😁, its cleaner.

About "aroma" directory, I like it managed in category, it makes me focus when coding it.

The /src/artos/* and /src/artos/ctl/* actually can be place directly in /src, but I don't like it.

libaroma
├── .clang-format
├── .gitignore
├── AUTHORS.md
├── LICENSE
├── README.md
├── include
│   ├── aroma.h
│   └── aroma
│       ├── canvas.h
│       ├── ctl.h
│       ├── dialog.h
│       ├── draw.h
│       ├── gfx.h
│       ├── image.h
│       ├── image_writer.h
│       ├── motion.h
│       ├── msg.h
│       ├── stream.h
│       ├── text.h
│       ├── win.h
│       └── ctl
│           ├── label.h
│           ├── bar.h
│           ├── button.h
│           ├── fragment.h
│           ├── imgbox.h
│           ├── list_caption.h
│           ├── list_check.h
│           ├── list_div.h
│           ├── list_img.h
│           ├── list_menu.h
│           ├── list_option.h
│           ├── listbox.h
│           ├── pager.h
│           ├── progress.h
│           ├── scroll.h
│           └── tab.h
├── libaroma.code-workspace
└── src
    ├── arch
    │   ├── arm
    │   │   ├── arm_neon_gfx.c
    │   │   └── memset32.S
    │   ├── arm64
    │   │   ├── android_memset.S
    │   │   └── arm64_neon_gfx.c
    │   └── x86
    │       ├── android_memset16.S
    │       ├── android_memset32.S
    │       ├── cache.h
    │       └── sse_gfx.c
    ├── aroma.c
    ├── aroma_config.h
    ├── aroma_internal.h
    ├── graph.c
    ├── hid.c
    ├── ui.c
    ├── utils.c
    ├── drivers
    │   ├── graph
    │   │   ├── linux_drm
    │   │   │   ├── graph_driver.c
    │   │   │   └── graph_driver.h
    │   │   ├── linux_fb
    │   │   │   ├── graph_driver.c
    │   │   │   └── graph_driver.h
    │   │   └── sdl
    │   │       ├── graph_driver.c
    │   │       └── graph_driver.h
    │   └── hid
    │       ├── linux_input
    │       │   ├── hid_driver.c
    │       │   └── hid_driver.h
    │       └── sdl
    │           ├── hid_driver.c
    │           └── hid_driver.h
    ├── aroma
    │   ├── canvas.c
    │   ├── ctl.c
    │   ├── dialog.c
    │   ├── draw.c
    │   ├── gfx.c
    │   ├── image.c
    │   ├── image_writer.c
    │   ├── motion.c
    │   ├── msg.c
    │   ├── stream.c
    │   ├── text.c
    │   ├── win.c
    │   └── ctl
    │       ├── label.c
    │       ├── bar.c
    │       ├── button.c
    │       ├── fragment.c
    │       ├── imgbox.c
    │       ├── list_caption.c
    │       ├── list_check.c
    │       ├── list_div.c
    │       ├── list_img.c
    │       ├── list_menu.c
    │       ├── list_option.c
    │       ├── listbox.c
    │       ├── pager.c
    │       ├── progress.c
    │       ├── scroll.c
    │       └── tab.c
    └── platform
        ├── platform_linux.c
        ├── platform_linux_buildroot.c
        └── platform_qnx.c

@MLXProjects
Copy link
Member

It's beautiful now! Just comfortable to my eyes, and makes faster to know what are you working on without needing to read the prefix (also wastes less screen space) :D
It's very nice, let's keep it if @M1cha agrees.
If you ever care about object names collisioning, that shouldn't ever happen because of how build systems handle file compiling (they don't put objs in a single, flat dir but actually use subdirs) .

@M1cha
Copy link

M1cha commented Apr 11, 2022

About "aroma" directory, I like it managed in category, it makes me focus when coding it.

I'm not sure if I understand how that helps, but It's fine by me. That code structure LGTM.

@amarullz
Copy link
Member Author

About "aroma" directory, I like it managed in category, it makes me focus when coding it.

I'm not sure if I understand how that helps, but It's fine by me. That code structure LGTM.

I do alot switching between one source to another, if whole source keep in one directory without any clear separation, it will take me a while to browse the file that I needed. I think @MLXProjects know what I mean (difficult to explain it 😜)

@MLXProjects
Copy link
Member

Yeah @amarullz, I understand pefectly! I also work on up to three projects at same time and the folder makes it easier for me to identify which project I'm working at.
Let's use the last source tree you've posted then!
PD: Should we communicate in some other way than this github pull? or it's fine lol

@amarullz
Copy link
Member Author

@MLXProjects maybe discord or something?, just invite me I will join.

@M1cha
Copy link

M1cha commented Apr 11, 2022

I'd prefer discord over telegram since it's easier to use on PC

@MLXProjects
Copy link
Member

I'm mainly a Telegram user, but will use a discord server and maybe bridge it to some Telegram group.
https://discord.gg/AKyQE8mM

amarullz and others added 15 commits April 12, 2022 22:45
* Fix text processing when double tags not rendered
* Add function libaroma_wm_message_noclear(), to prevent next
libaroma_wm_set_active_window from clearing message queue
Image control previously only support scalexy.
now it accept scale mode with this flags:
LIBAROMA_CTL_IMAGE_MODE_COVER
LIBAROMA_CTL_IMAGE_MODE_FIT
LIBAROMA_CTL_IMAGE_MODE_NOSCALE

and some drawing flags:
LIBAROMA_CTL_IMAGE_MODE_CENTER
LIBAROMA_CTL_IMAGE_MODE_NOSMOOTH
While updating just a region and not the full framebuffer, there was distortion because of using canvas width instead of line size (which is 4x the width).
This was most notably affecting SDL usage.
fb: fix non-fullscreen framebuffer update
* Add button left alignment
* Need -DLIBJPEG_HASRGB565_OUT in gcc flags
* LIBJPEG_HASRGB565_IN for encoding still not works (jpeg-turbo bugs?)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants