Giter Site home page Giter Site logo

simplexidev / sdevlibs Goto Github PK

View Code? Open in Web Editor NEW
34.0 5.0 6.0 1.41 MB

[WIP] A collection of cross-platform .NET libraries that provide tools for creating robust desktop applications.

Home Page: https://github.com/simplexidev/sdevlibs

License: Other

C# 100.00%
drawing cross-platform component-model console dotnet hosting libui-ng zstd

sdevlibs's Introduction

GitHubWatchers.Image GitHubForks.Image GitHubStars.Image Gitter.Image

NOTICE: This project was just renamed from LibUISharp to sdfx.
NOTICE: This project is still a work-in-progress, and should not be used in a production environment.
NOTICE: The native dependency 'andlabs/libui' is early-alpha software, and as such is unstable.

SimplexiDev Framework

SimplexiDev Framework, or SDFx for short, is a collection of .NET libraries to create robust desktop applications on Windows, macOS, and Linux.

Contributing

GitHubOpenIssues.Image GitHubClosedIssues.Image
GitHubOpenPulls.Image GitHubMergedPulls.Image GitHubClosedPulls.Image

Contributing is as easy as filing an issue, fixing a bug, starting a discussion, or suggesting a new feature. For more information about contributing to this project, see the CONTRIBUTING.md file.

Please hold off on submitting pull requests until #39 is merged. If you really want to prepare a pull request until then, please use the branch feature/internal/new-infrastructure.

Project Status

Codacy.Badge Dependabot.Badge

Build Status

We currently use Azure DevOps for our automated build process. While we only build for a few platforms, our packages should be able to be used on any platform supported by .NET 6.

Package Status
SimplexiDev.Audio Build.Audio.Windows2019
Build.Audio.Windows2022
Build.Audio.Ubuntu1804
Build.Audio.Ubuntu2004
Build.Audio.macOS1015
Build.Audio.macOS11
SimplexiDev.Build.Annotations Build.BuildAnnotations.Windows2019
Build.BuildAnnotations.Windows2022
Build.BuildAnnotations.Ubuntu1804
Build.BuildAnnotations.Ubuntu2004
Build.BuildAnnotations.macOS1015
Build.BuildAnnotations.macOS11
SimplexiDev.Build.NativeCallGenerator Build.BuildNativeCallGenerator.Windows2019
Build.BuildNativeCallGenerator.Windows2022
Build.BuildNativeCallGenerator.Ubuntu1804
Build.BuildNativeCallGenerator.Ubuntu2004
Build.BuildNativeCallGenerator.macOS1015
Build.BuildNativeCallGenerator.macOS11
SimplexiDev.Core Build.Core.Windows2019
Build.Core.Windows2022
Build.Core.Ubuntu1804
Build.Core.Ubuntu2004
Build.Core.macOS1015
Build.Core.macOS11
SimplexiDev.IO.Compression Build.IOCompression.Windows2019
Build.IOCompression.Windows2022
Build.IOCompression.Ubuntu1804
Build.IOCompression.Ubuntu2004
Build.IOCompression.macOS1015
Build.IOCompression.macOS11
SimplexiDev.Native.Libui Build.NativeLibui.Windows2019
Build.NativeLibui.Windows2022
Build.NativeLibui.Ubuntu1804
Build.NativeLibui.Ubuntu2004
Build.NativeLibui.macOS1015
Build.NativeLibui.macOS11
SimplexiDev.Native.Miniaudio Build.NativeMiniaudio.Windows2019
Build.NativeMiniaudio.Windows2022
Build.NativeMiniaudio.Ubuntu1804
Build.NativeMiniaudio.Ubuntu2004
Build.NativeMiniaudio.macOS1015
Build.NativeMiniaudio.macOS11
SimplexiDev.Native.Zstd Build.NativeZstd.Windows2019
Build.NativeZstd.Windows2022
Build.NativeZstd.Ubuntu1804
Build.NativeZstd.Ubuntu2004
Build.NativeZstd.macOS1015
Build.NativeZstd.macOS11
SimplexiDev.UI Build.UI.Windows2019
Build.UI.Windows2022
Build.UI.Ubuntu1804
Build.UI.Ubuntu2004
Build.UI.macOS1015
Build.UI.macOS11
SimplexiDev.UI.Extras Build.UIExtras.Windows2019
Build.UIExtras.Windows2022
Build.UIExtras.Ubuntu1804
Build.UIExtras.Ubuntu2004
Build.UIExtras.macOS1015
Build.UIExtras.macOS11

Current Releases

Stable and preview packages are published on NuGet. Our CI builds are published to MyGet.

Using SDFx Packages

For examples, see the examples\ directory.

Utilizing Pre-Built Packages

While following these instructions:

  • Replace {YourProject} with the the name of your project file.
  • Replace {PackageName} with the package you want to use.
  • Replace {PackageVersion} with the version of the package.

Install using .NET CLI

Run the following command in a command-line interface:

dotnet add {YourProject} package {PackageName} -v {PackageName}

Building From Source

You can build the packages by installing the .NET 6 SDK and using the following command in the root of the repository:

dotnet build sdfx.sln

sdevlibs's People

Contributors

scriptam avatar simplexidev avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

sdevlibs's Issues

New Example Projects

Essentially, this will be the main list of example projects that need finished. The list is subject to change at any time:

LibUISharp.Core:

  • DisposableExample
  • EventHandlerExample
  • PlatformExample (incl. in #39)
  • NativeAssemblyExample
  • NativeCallGeneratorExample

LibUISharp.UI

  • SimpleWindowExample (incl. in #39)
  • MenuedWindowExample
  • ControlGalleryExample
  • DrawingExample

Custom NativeLibraryLoader Implementation

This will allow for using the new C# unmanaged delegates as function pointers, rather than just IntPtr or void*. Hoping for a performane boost from it.

I also plan on adding FreeBSD/macOS support for it.

The Definition for NETStandard 2.0 is not found.

This issue is dependent on dotnet/standard#542.

The compiler and Intellisense complains with this error when using NativeLibrary.LoadFunction<T>() from NativeLibraryLoader:

Error CS0012: The type 'Object' is defined in an assembly that is not referenced. You must add a reference to assembly 'netstandard, Version=2.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'.

This occurs in Kernel32Library.csL24, LibuiLibrary.csL30, and User32Library.csL24.

Various Exceptions Thrown in ControlGallery on Load.

Depending on how you go about debugging ControlGallery on Windows, you will encounter a EngineExecutionException or an AccessViolationException.

The EngineExecutionException is thrown while debugging the app in Visual Studio as DEBUG or RELEASE. If you build it with DEBUG, the error is thrown while initializing the Slider on the NumbersTab. If you build with RELEASE, it is thrown while initializing the ComboBox on the same tab.

If you build as either DEBUG or RELEASE, and you start the app without debugging, then attach to it once it crashes, you'll notice that an AccessViolationException is thrown on the ProgressBar initializer right after the ComboBox.

This references commit 4712a3c in api-changes

Colors aren't displayed correctly

When the application opens, the color isn't the selected green, but it's purple.

When the color is changed to black (#FF000000), the resulting image turns gray (#FF7F7F7F).

Setup Azure Pipelines for Managed and Native Builds

This issue replaces #28
Depends on #46
This issue may be moved to another repository in the future

Essentially, this is what was left of the last major PR that needs finished, besides the API for libui.

Here is a list of tasks that need done to finish this:

  • Setup Managed Builds
    • SDFx
  • Setup Native Builds
    • libui-ng
    • miniaudio
    • zstd

For the native builds, each pipeline will be built on a weekly basis.

The second window is closed…

Hi,
I was in trouble.

Try the following code.

    class Program
    {
        static void Main(string[] args)
        {
            var app=new Application();
            var win=new Window1();
            app.Run(win);
        }
    }

    class Window1:Window
    {
        private readonly Button _btn=new Button("Show Window2");
        public Window1() : base("Window1") => InitializeComponent();

        protected sealed override void InitializeComponent()
        {
            base.InitializeComponent();
            Child = _btn;
            _btn.Click += (sender, args) =>
            {
                var window2 = new Window2();
                window2.Show();
            };
        }
    }

    class Window2:Window
    {
        public Window2():base("Window2"){}
    }

After I closed the window2,the application exited.Why?

Also,the application cannot show Chinese.

Thank in advance for any help.

InvalidOperationException thrown in Histogram Demo

When launching the LibUISharp.Demos.Histogram project, a mysterious `InvalidOperationException is thrown, and the application closes immediately. Odd thing is, that when the exception is thrown, it will only write a line to the Debug Output:

Exception thrown: 'System.InvalidOperationException' in LibUISharp.dll

In Visual Studio, debugging just stops when the exception is thrown, so there's no stack trace to see (that I know of).

I don't have a clue as to what is causing this, but it's affecting Windows and Linux (I assume macOS too, but I don't have access to a macOS installation).

How to use Menu?

Hi,
I found Menu in LibUISharp.However I dot not find any demo to use Menu.
When I ran the following code, a window did not appear and the dotnet process exited at once.

 public class MainWindow : Window
    {
        private readonly Menu _menu=new Menu("Demo");
	
        public MainWindow() : base("LibUISharp Control Gallery", new Size(640, 480), true) => InitializeComponent();
	
        protected sealed override void InitializeComponent()
        {
            IsMargined = true;
            Child = _menu;
            _menu.AddAboutItem(arg=>ShowMessageBox("Demo","Demo"));
            _menu.AddSeparator();
            _menu.AddQuitItem();
        }
    }

I hope you can help me.
Thanks.

Implementing xUnit Testing

Currently I do not have any test suites made up for this project, mostly because I don't know much about it. I'll have to look into it more.

Update:

Anyone is more than welcome to have at this, since I don't have the time to learn a test API, and write said tests. To be honest, I don't even know where to start when it comes to writing them.

That said, If anyone wants to work on this, create a new folder in the {ProjectRoot}/source/LibUISharp/tests/, with the project file {ProjectRoot}/source/LibUISharp/LibUISharp.Tests.csproj.

Nuget?

Is your feature request related to a problem? Please describe.
Kinda. can you upload this to nuget?

Describe the solution you'd like
Upload as .net 5 nuget package

Describe alternatives you've considered
I have considered Eto.Forms but its too complicated.

Additional Information
Please separate stable and unstable releases

Finish Demo Projects

I'm missing some demos that feature the functions of LibUISharp. Here's the current demos as well as missing ones:

  • SimpleWindow
    Displays an empty Window with default properties. (Thanks to @ashelleyPurdue)
  • ControlGallery
    Displays a gallery displaying all controls in the LibUISharp namespace.
  • DrawText
    Displays a Window with decorated text using font and text functions from LibUISharp.Drawing.
  • Histogram
    Displays a user-drawn histogram using drawing functions from LibUISharp.Drawing.

Correctly include native libraries into LibUISharp.csproj

Any library that referenecs LibUISharp as-is, will recive a FileNotFoundException, complaining about not being able to find the libui assembly. I can't seem to find a way to add them to the project and avoid this issue right now, but this needs fixed before anything else.

Improvements to Continuous Integration

It would be ideal to have a submodule for libui, and then build libui using TravisCI and Appveyor. This would make releasing the binaries for libui (and keeping the libraries up-to-date) a whole lot easier.

The downside is I know nothing about CMake, nor TravisCI, so this is definitely out of my scope for now.

Possible MDI implimentation? I don't think libui supports it natively.

Is your feature request related to a problem? Please describe.
No its more of a sad reality of the modern world and of nostalgia.
But in reality it's about game editors and size limitation of small single monitors.

Describe the solution you'd like
MDI (M)ultiple (D)ocument (I)nterface.

Would it be possible to hack in multiple document interface if it isn't too hard?
I don't think libui supports it so if it's even possible it would be a hacky solution.

Describe alternatives you've considered
Many many other GUI libraries.

Additional Information
Mac uses a totally different ui layout.
It could probably just use separate windows and close them when the main window closes.

Finish Documentation

Mostly just drawing classes need documentation. I will work on that after merging #27. This will be finished (mostly) in api-changes (#27).

Replace `libui` with `libui-ng`

As the libui community has decided, there is a new repository that will be updated and is currently maintained. I will eventually get to moving it over.

Hide the Console Window on startup

This seems to be a looming issue with .NET Core, since you can only compile as a library or console application. I would love to do it programatically, rather than try to use binedit.exe or whatever NSubsys is (which may be an option).

This is definitely a help wanted issue, as I'm not quite sure where to start with this. At least there's a simple way on Windows to accomplish this.

CLS Compliance

I need to see about how compliant the library is, and see what needs to be done to be compliant, if not already.

SafeHandle Implementation

I'm working on this in the api-changes branch. Wanted an issue here to keep track of what I'm working on.

Histogram demo crashes immediately on MacOS

The culprit is the following line:
Matrix matrix = Matrix.SetIdentity();
on LibUISharp.Demos.Histogram.SurfaceHandler class (Line 54)

It throws the following system access violation:

Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
libui.dylib [areaView drawRect:] + 537
com.apple.AppKit NSViewDrawRect + 83

When the following three lines are commented out, the histogram shows fine, albeit without the correct offset:

Matrix matrix = Matrix.SetIdentity();
matrix.Translate(xoffLeft, yoffTop);
e.Context.Transform(matrix);

The crash is observed even calling the SetIdentity method on its own without translating it or transforming the context with it, i.e.:

Matrix matrix = Matrix.SetIdentity();
// matrix.Translate(xoffLeft, yoffTop);
// e.Context.Transform(matrix);

This narrows down the issue to:
LibuiLibrary.uiDrawMatrixSetIdentity(matrix.ToLibuiDrawMatrix());
on LibUISharp.Drawing.Matrix.SetIdentity() static method (Line 31)

LibuiException thrown on Application Initialization

On initialization of a lLibUISharp application throws a LibuiException, which is caused by a COMException with the following error message:

LibuiException: error initializing libui: initializing COM; code -2147417850 (0x80010106) Cannot change thread mode after it is set.

@ashelleyPurdue I figured I'd mention you since you mentioned this exception earlier in #10.

The fix is to call Encoding.RegisterProvider(CodePagesEncodingProvider.Instance); in the initializer of LibUISharp.Application, and locking the rest of the method call. I'll be pushing a fix within an hour.

Can't compile on Linux and .net core 2.0 SDK

Hi,

I'm trying to compile your library on linux, but I always getting this error:

src/LibUISharp/FileDialog.cs(2,25): error CS0234: The type or namespace name 'Internal' does not exist in the namespace 'LibUISharp' ...

The same error for most files. I'll be grateful to get some hint how to overcome this.

0.4.0 Release

Version 0.4.0 of libui was released a few days ago, and that means it's time for a release, and a stable package on NuGet.

Issues/PRs that need that need to be resolved/finished:

[ ] Issue #3
[ ] Issue #21
[ ] Issue #24
[ ] Pull #27

For status of each listed, see the 0.4.0 project board

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.