[Your Thoughts] Macros for Cross-Platform API Functionality

Everything else that doesn't fall into one of the other PB categories.
Env
Enthusiast
Enthusiast
Posts: 151
Joined: Tue Apr 27, 2010 3:20 pm
Location: Wales, United Kingdom

[Your Thoughts] Macros for Cross-Platform API Functionality

Post by Env »

Wondering what you think of this idea...

Having a code library, which is designed to provide procedures and macros that will provide access to alternatives to each OS's API functions.


For instance;

Windows SetProp_(), would have a standard procedure name like 'SetProperty(...)' and in-code it would compile a version designed for each OS, be it Linux (g_object_set_property), or Mac (...)..


I know some API features in Windows may not exist in Linux, or Mac, but if a suitable work-around can be written as an alternative, it should provide a much wider function list that can be used in PureBasic regardless of OS.



Env
Last edited by Env on Wed Feb 16, 2011 1:09 am, edited 1 time in total.
Thanks!
Zach
Addict
Addict
Posts: 1675
Joined: Sun Dec 12, 2010 12:36 am
Location: Somewhere in the midwest
Contact:

Re: [Your Thoughts] Macros for Cross-Platform API Alternativ

Post by Zach »

Sounds like a neat idea to me!

Would make cross-platform development a lot easier too.

Although such a project would be a HUGE undertaking.. You'd need to decide what core components you are going to support, and as your list grows you have to constantly maintain it to keep up with changes in PB Syntax, as well as OS API
Env
Enthusiast
Enthusiast
Posts: 151
Joined: Tue Apr 27, 2010 3:20 pm
Location: Wales, United Kingdom

Re: [Your Thoughts] Macros for Cross-Platform API Alternativ

Post by Env »

Aye, no doubt it will be a long time, and a lot of work hours before a complete library can be completed, which in a sense will be never with changes always being made,

but if it were an opensource project, and available via SVN, it may be useful for some, and people can always contribute their own features.
Thanks!
Suirad
User
User
Posts: 42
Joined: Sun Sep 20, 2009 7:37 pm
Location: Melbourne, Florida, USA

Re: [Your Thoughts] Macros for Cross-Platform API Functional

Post by Suirad »

Now you see the process required from the pb devs to add thing to purebasic itself. Essentially all pb commands are macros that change depending on the compilers os. If there is a good general knowledge of each os' api it shouldnt be too difficult depending on what commands your wanting to have
Env
Enthusiast
Enthusiast
Posts: 151
Joined: Tue Apr 27, 2010 3:20 pm
Location: Wales, United Kingdom

Re: [Your Thoughts] Macros for Cross-Platform API Functional

Post by Env »

Yeah I know that to be the case, and with this, it may encourage, and assist the PBDevies to add more functionality.


If enough people are interested, I can set up a base for it, and a website for people to contribute their own code to provide a standard function/macro that will perform the same operation using the independent OS' API.
Thanks!
Post Reply