Libadwaita on windows 10 & 11 - linux

I am new to GTK development. I started using GTK4 and it is really grea. As far as I understand libadwaita is used for reflecting dynamic system changes of colors (light/dark/contrast, etc) in a GTK4 application. This is system solution and if so, I think it's great. Instead of having custom based stylesheets the application will behave according to the system settings. At least on Linux.
My question is: is Libadwaita available for windows systems (my app should react on system changes on windows 10 & 11, as well) and if awailable how to use it? Github for libadwaita constains an example how to create application (HelloWorld) but it is disabled for MS Visaul Studio.
Is libadwaita only for Linux? If so, how to keep code portable?

Yes it is, for Visual Studio 2015 or later on the libadwaita-1-1 and later branches. Be sure to pass in -Dc_std=c99 if using VS2017 or 2015, and use -Dvapi=false unless you have Vala installed when you run Meson to configure the build (the dependencies should be aligned with GTK-4.6+) Run Ninja, and you should be good to go.
The sample program was (purposely) not updated to build with Visual Studio, but there is still adwaita-1-demo.exe that is being built.
The “system settings” would, by the way, depend on how you set up things via GSettings, which would in turn be done in the system registry. You need to install the gsettings-desktop-schemas package (it is also built with Meson and works with Windows), and run gsettings set org.gnome.desktop.interface color-scheme prefer-dark, and you would get the dark theme that you were asking for.
Hope this helps.

Related

Does Visual Studio 2022 have the same ability to open a javascript/nodejs project folder in a WSL2 Linux as VS Code is able to do?

If I'm in my WSL2 Ubuntu filesystem I can simply navigate to a javascript/nodejs folder and type code . to open that project folder and thanks to VS Code's Remote extensions, I'm essentially remoting into the Linux environment and ready to code.
Now Visual Studio 2022 has been released, I was wondering if it too supports the same level of cross-platform IDE capability as VS Code?
How, for instance, when in my WSL2 Ubuntu project in Windows Terminal, can I open my javascript/nodejs project in the Linux filesystem using VS2022, or is this not supported because VS Code is the only cross-platform IDE that can do this?
So its not really possible to do how your thinking. The problem here is that you your not understanding the difference between a "Code Editor", and an "Integrated Development Environment (IDE)", which is totally understandable, as the line that separates the two has become blurred in recent years, and also a topic of debate. There was a far more explicit distinction between the 2 10-15 years ago, however, Microsoft has done a good job at separating the two, where JetBrains will release a piece of software that can be used as an IDE, but is more often than not, used as an editor, but will still call it an IDE, even though its not an IDE in a pure sense.
How is all this related to your question?
When you open your Node.js project in VSCode via the code . command, you are opening it in an editor that implements Intelli-code, as well as a wealth of other tools, but essentially, the editor, and all the tools extract the names & file extensions of your documents, parse them (usually turning much of the info into an AST, where many extensions will make use of that info to offer the various tooling capabilities/features. The point is at the end of the day, the editor just parses all of your code, gives you info, and you make any changes as needed to your code. And again, this is what your doing with code .
With Visual Studio 2022, you can't open a project with it, unless its a project type the IDE supports, and enables the IDE, to embed its-self into your project. This includes things like built in environment, built in cache, built in build system, the files needed to bootstrap its-self. With an IDE, the IDE is part of the project.
So then why does Visual Stdio 2022 work with Node?
It works with node, to create Node.js applications within a windows environment, and it offers the ability to access different Windows SDK features via Node. These are things you could never do using server-side Linux builds with Node. When you build a Cpp application for windows, you package the entire thing in a .sin file, I haven't built a windows app in node, but I know that Node also uses the .sin file build system, which requires Visual Studio & Windows SDK to do, and parts of Visual Studio/Windows to be embedded into the project, for the project to be able to work in a Windows OS, and take advantage of MS Windows features.
Long story short, V.S. Code is the right tool for what your doing, why would Microsoft invest in two identical tools any way? If you ever want to build something for Windows, or for MS mobile device using Node, you will probably want to change your environment, to VS2022.

WindowsSdkDir per project?

I have a Visual C++ library which I want to compile for a certain platform (I try to compile POCO for a Win CE ARM platform, but that might not be relevant to this question). I got a vendor-specific Windows CE SDK (including all common Windows include files e.g. winbase.h) which is set as target platform within the Visual Studio project files. However, when I compile the program, I can see from the error log that the default Windows 6.0A SDK is used, resulting in a bunch of compilation errors.
I guess the WindowsSdkDir ist not set accordingly - I thought this would be automatically overriden when setting the target platform within Visual Studio.
So my question is: can I modify the WindowsSdkDir for a single project explicitly?
Thank you in advance
Which CE version, which VS version and on which Windows version? I know that I had problems installing CE5 and/or CE6 SDKs and getting them recognized by Visual Studio 2005 running on Windows 7 (64 bit). I don't remember the exact symptoms and fix, but you can test that by simply creating a smart device project for the target SDK.
If that is not the issue, there is also the pitfall with the target in both the project file (.vcproj) and the solution (.sln). You can change both independently from each other, up to the point where you compile the x64 debug version of a project in the win32 release version of the solution. Verify that these setting match.
Then, if you adjusted the .vcproj file to use your target platform (for which I personally would use a text editor), things should work. If you need to adjust the build or some paths, you can sometimes get by with e.g $(Platform) in the compiler/linker settings.
Lastly, if all that doesn't work, there are property sheets, which can adjust certain settings. You then create a property sheet once and then load it into the project that you want to compile. I'm not sure if you can change the target platform or the SDK paths with that approach though, and I'd rather try to find out why the SDK doesn't work and how to fix it instead.

Building on Windows XP, when development is on VS2012?

We're planning moving from Visual Studio 2005 to Visual Studio 2012 (Visual-C++-11).
(We would very much like to skip 2010 if we can help it, since the newer version is already there and offers a better C++ experience.)
But we've hit a little roadblock:
Our build servers still run Windows 2003r2 (all inside dedicated virtual machines), and due to messy tool support/issues, we're in no position to upgrade the build servers to a newer OS.
Developers mostly have switched to Windows7 by now, so moving the remaining Windows XP developer boxes shouldn't pose a problem.
Since VS2012 only runs on Win7 we are wondering whether we can leverage it's tools (C++ compiler, C#) and still do a full equivalent build on the W2k3 build server - after all, we don't really need a VS GUI there, just build C++ and C# projects from VS2012.
What are our options?
Will the SDK (7.1? 8?) compilers + msbuild command line get me anywhere?
In Project Property Pages, there an option "Platform Toolset" that allow you to choose compatibility of your project. So, you can work in VS2012, but built it with "VS2008 compiler"
Here is what we do:
Use CMake
CMake allows you to create build systems for your operating system. Thus we are able to use the same code within VS2005, VS2010 and Eclipse, XCode etc.
You could do something similar: Install VS2005 on your old machines and let CMake create the projects for you from the sources. On your newer machines you can use CMake to generate VS2012 Solutions (I don't know if they have 2012 support yet, because we don't use 2012 yet too).
A big pro here is: If you plan to migrate to any other IDE or even Linux you just can re-run CMake and get your source code within these environment easily compilable.
A big con: You have to start reading about CMake and create CMakeLists.txt for all your projects (might be a lot of work depending on the amount of projects, amount of source code files within each project, specific compiler options, linker options etc.)
Our build servers still run Windows 2003r2 (all inside dedicated
virtual machines), and due to messy tool support/issues, we're in no
position to upgrade the build servers to a newer OS.
Well. Not much came out of this question. We recently re-evaluated this issue, and I see two options (I haven't tried any yet):
Just do a full VS installation on a supported OS (Win7), zip up the whole VS+WinSDK directories (as well as the neccesary runtme DLLs that live somewhere under %WINDR%), and try if you can get that thing working on an XP based OS. Might work. Not a great idea if you ask me.
Split up the build process to distribute the build across several OS, so that we can work with tools that are only supported on one of them. -- This actually sounds more complicated than it'll be. We already run our build spread over several Jenkins jobs, so I should be able to get that to work. (And all build nodes are already VMs anyway, so adding more VMs isn't that much of an issue.)

Setting up a 1-step build for a Visual C++ Application

Any suggestions? Code and artwork/assets are all in SVN, and we don't want to port it to GCC or another compiler before anyone suggests it!
Simplicity and minimising 3rd-party tools is preferred, since we don't have a build-server it'll probably still be run on a developer's PC but we don't want them just doing a build manually and packaging it up.
It's basically just a C++ solution with several projects, plus we have an Inno Setup installer to build.
Right now it's a 3-step process (or 4 if you include uploading the release to FTP):
Get from SVN
Build solution from VC++
Run Inno to create the packaged
installer
You can use MSVC pre, post & custom build steps to do this, they run programs through the windows command line. also see this: http://blogs.msdn.com/b/visualstudio/archive/2010/04/26/custom-build-steps-tools-and-events.aspx
If you can't do it with the VS build steps (see Necrolis' answer), then in the past I've used makefiles run with nmake, which is included with VS (you need to start a command prompt with the right environment settings for VS - there's a shortcut on the start menu.)
Nowadays I use FinalBuilder ( http://www.finalbuilder.com/home.aspx ) for all this sort of stuff, which is expensive and doesn't meet your 'not 3rd party' desire, but is an excellent tool. Once you get into it, you'll realise that there are probably far more steps you'd like to do than merely compiling/packaging - you probably want to be incrementing version numbers, moving files around, creating directories, etc. FB is good at that sort of stuff.
I am adding up to date answer for other users:
Currently there is 3rd party extension available which integrates Inno Setup into Visual Studio and allows you to build installers directly from IDE (or from command line using MSBuild).
It is possible to use pre, post & custom build steps, batch files, code signing, running programs through the windows command line etc.
Check Visual Studio Marketplace for more info about Visual & Installer: https://marketplace.visualstudio.com/items?itemName=unSignedsro.VisualInstaller

CDC-1.0/Foundation-1.0,J2SE-1.3

How to setup/configure the environment "CDC-1.0/Foundation-1.0,J2SE-1.3" of an OS (for example windows XP, linux)?
Because I want to run the embedded AWT application which requires this environment.
one possibility is to install an IDE which contains all that. the one which seems the most appropriate to me is NetBeans. go and see on their site, there are some tutorials on installation, setup and project creation
note that there may be other IDEs to perform the same task, i am just not aware of them.

Resources