manderby / nalib Goto Github PK
View Code? Open in Web Editor NEWGeneral purpose C sourcecode collection
Home Page: http://manderc.com/apps/nalib/index_en.php
License: The Unlicense
General purpose C sourcecode collection
Home Page: http://manderc.com/apps/nalib/index_en.php
License: The Unlicense
Quick Start: ------------ - Download whole package. git clone --recurse-submodules https://github.com/Manderby/NALib.git There is a submodule for testing which you only need if you are testing. - To use NALib, there are two ways: 1. Compile NALib as part of your own solution by simply dragging the whole code\NALib\src folder into your project. 2. Use CMake to compile a static library of code/NALib Then, link to that library in your project. - Use CMake to build any of the example projects in the code folder. Description: ------------ NALib is a collection of source code written in the C programming language which contain code like system-dependent macros, high-performance functions and container structs, a small runtime system with memory pools and optional reference counting, a GUI implementation for Mac and Windows and many helpful comments. Email: [email protected] Follow on GitHub: https://github.com/Manderby/NALib/discussions - API is documented directly in the .h files. - Some design principles can be read in the doc/documentation.txt file. - NALib just needs the standard libraries. - Compilation of the whole collection usually takes less than 5 seconds. - The master branch contains the latest developments. - Older release versions are available as tags. Contribute & License: --------------------- - Write Issues and take part in the discussions on GitHub. - Write Emails to [email protected]. License: Public Domain History: -------- NALib originally started as a C++ helper code collection back in 2004 when I was working for an electric engineering company and was enhanced with many more helper snipplets by me over the following years during my research in a media technology institute. It allowed me and others to quickly implement our models, algorithms and data visualizations. In 2009, I collected all the snipplets together and formed a first combined version, known as MBLib. That version continued to be in use in the research lab for another three years and allowed me to get started with projects when I did found my own company Manderim in 2011. There, I used MBLib in projects for the consumer market and for the industry where it had been continuously verified in selling products. But as the field I was working in often times required implementations which work universally, I started to translate the whole library to plain C in 2013. This new library was then called NALib. NALib is short for "Not A Library". This name was chosen with the intention of it to be primarily used as source code, not as compiled libraries. The library was implemented so that it would build very fast but universally on multiple systems. With that, I had to spend less time on library compatibility issues. NALib was open to the public since the first version. After about 2 years, all crucial functionality of MBLib was translated to NALib. Therefore I discontinued development of MBLib and instead started to use NALib for all projects. Now, after some more years, the code collection did grow by quite a fair amount of code and functionality. Unfortunately, I had to close down my company in 2019, but still to this day, I am using NALib for my private projects and try to advance it whenever time fits. It currently uses C99 as well as some elements of C11 combined with a modern coding style which - hopefully - helps people value the C programming language as much as I do.
Add functionality to NAStack
Add possibility to explicitely store pointers.
Add possibility to define if pool initially is filled or empty
Store it as a flag. Implement the flag together with issue #31
Can we make sure only one enter or cancel button per window exists?
After the postStartup, the NSApplication sets its application delegate in naStartApplication to the default. Desired would be to the delegate class of NALib to capture more notifications. This interfered with some other mechanisms though (don't quite remember now).
Please have a look at the following comments removed from naStartApplication to get back in the mood:
//[NSApp setDelegate:(NA_COCOA_BRIDGE id)naGetUIElementNativePtr(app)];
// SEL selector = @selector(doSomethingWithObject:afterDelay:);
// IMP newImp = (IMP)swizzledDoSometingWithObjectAfterDelay;
// Method method = class_getClassMethod([MyClass class], selector);
// const char * encoding = method_getTypeEncoding(method);
// class_replaceMethod([MyClass class], selector, newIMP, encoding);
Do issue #12 first to have a valid 3D rendering environment.
When a window is set to use a different mode than the system settings, it outputs a warning and chooses the one of the system.
Either find a way to get the proper mode and get the proper color or define default colors which are valid in such a case where the two modes mismatch.
Having a button without an image is certainly useful during initialization.
At the same time, review the isImage flag if there is a better solution.
Have a look at #32.
There is the possiblilty to do things with plain C, see the code sniplet below which is an old comment (completely out of context, but this is just a hint where to start looking).
Idea is to move at least the NAPreferences out of the GUI code.
// The ((id (*)(id, SEL)) part is a cast of the objc_msgSend function which
// is requires since a later version of Objective-C
// ( (id (*)(id, SEL)) objc_msgSend)(objc_getClass("NSApplication"), sel_registerName("sharedApplication"));
Make Mac and Win equal.
These are some comments removed from the code. They might help:
// OptionButton: NSBezelStyleShadowlessSquare
// NSBezelStyleRegularSquare : 5 5 5 5
// NSBezelStyleShadowlessSquare : 3 3 3 3
// NSBezelStyleSmallSquare : 2 1 2 1
// Push (Text only) (24px height fixed)
// Option (Text / Image) (3px padding on all sides)
// Borderless (Image only) (0px padding on all sides)
When using a space with an alternate background it is erased with the wrong brush color for Labels and other UI elements.
Reiterate all NAStack benchmarks and delete all for loops which are not necessary.
Run HelloWorldGUI and select the text in one of the labels. Drag the mouse outside of the window. Crash.
Add NIST CODATA 2022 values as soon as they are public.
Should ned to test NATree first #42.
Loading files results in source apparently has no cache, althoug it loads well.
Probably linked to #25.
This is in response to #11 because Apple fucked up.
Deallocation using naRelease has this built in because of the NARefCount which is checked upon calling naRelease or naRetain. But naDelete does not have the storage capacity to do that.
Would need an additional dummy-space similar to the refcount but which is only available whe NA_DEBUG is 1.
When doing this, think about adding this functionality to all structs which use naClearXXX. Maybe do something with NAPtr
Leap seconds are about to be removed from the UTC standard. Find information and provide a proper implementation.
Done because the current PNG implementation is a little slow. And of course on windows, anything else than PNG is not yet supported.
Fix would be to improve the PNG implementation
When opening a file with an NABuffer, the following error is outputted:
Error in na_GetBufferSourceCache: source has no cache
When adding a command line argument to the testing, the application is expected to execute only the give group. But all groups after the given one are executed as well. Probably duplicate of #14
Enhance the GUI Hello World application with a playground window containing all possible GUI elements and behaviours.
Resizing the window the space is contained in helps to synchronize the vsync or something. Not quite sure why.
na_GetUINALibEquivalent is currently done using a list traversal which might be slow for very big UIs. It had beed tried to be done using the GWLP_USERDATA of HWND on windows and with the tag of NSView on macOS but that proved to be a maintenance catastrophy.
Optimal solution would be a a hash map. Maybe find something else.
Some sort of caching all of a buffer is required but it should not happen with naCacheBufferRange. The NABuffer should be self-updating.
Also have a look at other occurences in naWriteBufferBuffer, naGetStringUTF8Pointer, naNewStringWithBasenameOfPath, na_AllocPNGChunkFromBuffer
Note to Manderby: The issue can be reproduced by running Karo Graph without CACHING_ALWAYS and opening a file by double clicking.
No matter whether push or state button, the clickable region is not according to standard.
When running benchmarks (for example NAStack Push), a lot of memory is required. This may exceed the capabilities, especially on 32 bit systems. Find a suitable solution to capture this or break early.
Example:
Open NALibVisualStudio, Run test with arguments:
NALib NACore NAValueHelper Flags "Toggling int flags"
Probably duplicate of #24
During development, lots of code was necessary to create the arguments of the procedure call in na_ExecuteCrashProcess.
Try to store the expressions in the NATestData as NAString and try to move sysctl.h and Tlhelp32.h stuff into a separate module.
In the application Color Machine, the UI is set up using layout helper functions. Add those to NALib.
Very low priority task. Following removed comments might help:
// [event modifierFlags]; NSEventModifierFlagCapsLock;
// let isLeftShift = event.modifierFlags.rawValue & UInt(NX_DEVICELSHIFTKEYMASK) != 0
// let isRightShift = event.modifierFlags.rawValue & UInt(NX_DEVICERSHIFTKEYMASK) != 0
Note that distinguishing might not be possible depending on the system.
Cut, Copy, Paste do not work currently without a XIB.
So far, this has not been tackeled as it seems to be very undocumented and maybe even impossible. Best solution is to create a plain Cocoa Application with an automatically generated xib file and then start NAApplication in the main method.
Would be nice if NALib would be able to become stand-alone.
See HelloWorldGUI, watch the dot for some seconds, the framerate drops constantly. Potentially due to SetTimer and KillTimer which gets calld by naCallApplicationFunctionInSeconds
Do it using the default.
NAStack done
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.