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

abstract native calls #40

Closed
borzel opened this issue May 4, 2018 · 8 comments
Closed

abstract native calls #40

borzel opened this issue May 4, 2018 · 8 comments

Comments

@borzel
Copy link
Member

borzel commented May 4, 2018

No description provided.

@borzel borzel added this to the Cross Platform Support milestone May 4, 2018
@borzel borzel self-assigned this May 4, 2018
@johnbester
Copy link

johnbester commented May 8, 2018

I have created cross platform native call classes to allow using dlls in Windows and some other functionality in other operating systems. Since I am not registered as a developer, I would appreciate it if someone can integrate these files into the project. On their own they should be completely harmless and should only have an effect once native calls are replaced with calls to NativeCall class. The files should be included in XenCenterLib module, since it does not reference any of the other modules. Please see attached.
nativecalls.zip

@borzel
Copy link
Member Author

borzel commented May 8, 2018

I did exacty what you sad here in my prototype:

https://github.com/borzel/xenadmin/blob/linux-7.4/XenCenterLib/NativeCalls.cs
https://github.com/borzel/xenadmin/blob/linux-7.4/XenCenterLib/INativeCalls.cs
https://github.com/borzel/xenadmin/blob/linux-7.4/XenCenterLib/NativeCallsLinux.cs
https://github.com/borzel/xenadmin/blob/linux-7.4/XenCenterLib/NativeCallsWin32.cs

Do you have a sugestion, how to implement these calls in linux?

For Example:

 [DllImport("gdi32.dll", EntryPoint="CreateCompatibleDC")]
 static extern IntPtr CreateCompatibleDC(IntPtr hdc);

Whats the same call in linux for that? So far I understand, Mono draw Winforms with System.Drawing. System Drawing used also native calls. So how does this work?

@borzel
Copy link
Member Author

borzel commented May 8, 2018

@johnbester by the way, thants for your zip archiv. I will review and include it. You can also fork and do a pull request :-)
And of course can we add you to our team, if you want :-)

@johnbester
Copy link

johnbester commented May 9, 2018 via email

@johnbester
Copy link

johnbester commented May 9, 2018 via email

@borzel
Copy link
Member Author

borzel commented May 9, 2018

With XCP-ng this has now changed :-)

@borzel borzel changed the title [CrossPlatform] abstract native calls abstract native calls May 14, 2018
@ghost
Copy link

ghost commented Feb 8, 2019

Ultimately, we need to get rid of manual rendering in GDI and the P/Invoke calls that aren't implemented in gdiplus that is provided by Mono: https://www.mono-project.com/docs/gui/drawing/

We would need to rely on Cairo or other existing rendering libraries for scaling images or rendering onto surface more.

@borzel borzel removed this from the Cross Platform Support milestone Jan 26, 2020
@borzel
Copy link
Member Author

borzel commented Jun 24, 2020

As I have no spare time I close this :-(

@borzel borzel closed this as completed Jun 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants