Coder Social home page Coder Social logo

manderby / nalib Goto Github PK

View Code? Open in Web Editor NEW
20.0 2.0 5.0 61.29 MB

General purpose C sourcecode collection

Home Page: http://manderc.com/apps/nalib/index_en.php

License: The Unlicense

C 99.20% Objective-C 0.30% CMake 0.50%
memory-management quadtree octtree stack binary endianness buffer datetime deflate heap

nalib's Issues

NAImageButton image storage

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.

Solve Cocoa AppDelegate problem

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);

Develop UI button size default

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)

Combine NAPool with NAStack

Add functionality to NAStack
Add possibility to explicitely store pointers.
Add possibility to define if pool initially is filled or empty

Write GUI playground

Enhance the GUI Hello World application with a playground window containing all possible GUI elements and behaviours.

Distinguish between left and right modifier keys

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.

Cleanup crash testing

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.

Fix "source has no cache" error

When opening a file with an NABuffer, the following error is outputted:

Error in na_GetBufferSourceCache: source has no cache

Remove the need of naCacheBufferRange in naWriteBufferToData

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.

NAOpenGLSpace redraw slows down with time

See HelloWorldGUI, watch the dot for some seconds, the framerate drops constantly. Potentially due to SetTimer and KillTimer which gets calld by naCallApplicationFunctionInSeconds

Break benchmark when using too much memory

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.

Do at least parts of Objective-C with C

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"));

Add detection for pointers deallocated with naDelete when they get deleted twice

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

Speed up na_GetUINALibEquivalent

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.