GDK2 Alternative for gdk_window_set_fullscreen_mode - gtk

I'm trying to set my window to be GDK_FULLSCREEN_ON_ALL_MONITORS but for this I have to use gdk_window_set_fullscreen_mode, what is the GDK2 version of this?
Thanks

There is no GDK 2.x version of this API. The set_fullscreen_mode() method was added in 2013, long after GTK+ 2.x was API frozen; this means that no new function is going to be added to the GTK+ 2.x API.
The implementation of the set_fullscreen_mode() on X11 is not trivial; it implies getting the XINERAMA index of each monitor and sending a specially crafter ClientMessage to the running window manager for the _NET_WM_FULLSCREEN_MONITORS atom. You can see the implementation used in GDK attached to the issue that introduced it.
If you need this kind of functionality, you will have to use GTK+ 3.x.

Related

Robot Framework Language Server Extension automatically opening CANoe application

I use Visual Studio Code with Robot Framework and Python for test purposes. I also use CANoe application as a simulator.
I installed the Robot Framework Language Server and for some reason when I open VSCode or even just click on it CANoe automatically opens, I know that the extension is causing this because if I disable the extension the application stops to automatically open.
Do you already had any similar behavior with Robot Framework Language Server and any other process? If yes, how did you solve it?
There are 2 different LSP implementations for robot framework. This answer relates mainly to the one Robocorp maintains.
That particular implementation of lsp works by executing each LIBRARY settings section in python interpreter and executing the actual library's constructor to get the data it needs for auto completion / typing / whatnot. If the python library makes any connection to com API thats associated with CANoe during execution of the constructor, it will trigger actual CANoe application to start - even if that's not mandatory at this point but that's how COM works.
I'm quite there are ways to hack around the issue but essentially, the easiest way to fix this is to;
Fix the library that provides your keywords that interact with CANoe and/or ecutest or similar that requires CANoe to be running.
Try switching to https://github.com/d-biehl/robotcode within vsc to provide you autocomplete and the rest ..
If you where using robotcode lsp, see first suggestion.

Use Qt4 widget in Qt5, without recompiling

I have written some code that relies on the Qt4 library and was using it in some projects. It deals with displaying PDFs, printing and so on and employs the poppler library
My new project is made using Qt5, and I need those functionalities in it.
My qt4 library is represented by DLL that simply returns an object of QWidget-derived class.
Is it possible to use this QWidget inside my new qt5 project? Maybe after some wrapping?
Also, while exploring this issue I came by to Qt plugins. I haven't researched this field yet, but may be it's possible to resolve the problem using them?
Thanks in advance.
Qt 4 and Qt 5 are not binary compatible, so no, you can't use the widget directly. Using both Qt 4 and Qt 5 inside the same application sounds like a dangerous idea...
The best bet is of course porting libpoppler to Qt 5 (have you evaluated how complex such a port would be? Probably not too much). The second best would've been using QX11Embed, but those classes are currently missing from Qt 5, awaiting for someone to port them to QPA / XCB.

What is the difference between Java Deployment Toolkit Plug-in and deployJava.js?

I was reading this article:
http://www.java.com/en/download/faq/deployment_toolkit.xml
and I get confused about the purpose and use of the DT Plug-in and the deployJava.js.
I always believe that the Deployment Toolkit is the set of functions of the deployJava.js file (like this link says: http://blogs.oracle.com/thejavatutorials/entry/deployment_toolkit_101) but according to the article there are two parts of the Deployment Toolkit: the Plug-in and the interface for the developer.
I'm asking about all of this because the deployJava.js fails to detect the appropriate version of Java in some of the machines of our users and I was wondering if the DT Plug-in could help us improve the detection, but I don't know how exactly it detects the Java version and when it does it or how can I use it to solve detection problems?
Most of this doubts are driven by the question in the article:
"Does deployJava.js work if the Java DT Toolkit plug-in is disabled?
Yes, deployJava.js contains some pure JavaScript functions, which will continue to work even if the Java DT Toolkit plug-in is disabled."
So... why do I need the deployJava.js if the DT Plug-in exists or vice versa?
Any help on this matter would be very appreciated.
Thank you very much.
If anyone has doubts about it, I've posted this question in the oracle forum and this was the reply:
Deployment toolkit is combination of native library and javascript
helpers. javascript is the only official public API to native library.
JRE is installed with DT native library that is left on the system if
JRE is uninstalled. As of now DT native library is only available on
Windows.
Javascript helper functions use native library if it is available but
many actions can be performed (with degraded accuracy, etc.) even if
native library is not present.
Note that there is new Javascript APIs for DT as alternative to
deployJava.js. it is called
[dtjava.js|http://download.oracle.com/javafx/2.0/deployment/deployment_toolkit.htm#BABJHEJA]
and is primary API for JavaFX applications. However, it also supports
pure Java apps and likely will be main JS API for DT going forward
(some more testing and bug fixing may be needed).
Hope this helps to clarify the relationship.
Thxs to igor
Link to oracle post: https://forums.oracle.com/forums/message.jspa?messageID=9932788#9932788

What is the relation between GTK, GTK+ and GTK2?

I'm confused by the GTK terminology. According to Wikipedia, there seem to be bindings to GTK+ that are called GTK (GtkAda) and GTK2 (gtk2hs, Gtk2-Perl).
Could someone clear this up for me?
The first incarnation of the project was called GTK (which stood for GIMP Toolkit).
At some very early point, while the project was still part of The GIMP (and before version 1.0), it was renamed to GTK+. Despite this, people often referred to it as GTK out of convenience or ignorance.
The GTK+ name was used for more than 20 years through versions 1.x, 2.x, and 3.x, but the "GIMP Toolkit" expansion was dropped. I don't know when exactly this happened but perhaps during the 1.x → 2.x transition.
There is nothing officially called GTK2. It's just what some people call the 2.x series of GTK+.
On 2019-02-06, the project was renamed back to GTK, which will affect version 4.0 onwards.
GTK/GTK+ and GTK2 are different versions of the same API. GTK is an old, deprecated version, GTK2 is the previous one, GTK+ 3/GTK3 is the current version.
GTK+ is the correct name of the old API, but most people just call it GTK.
The C++ bindings for GTK+ are part of the project GTKmm.
GTK is the library for creating GUI-s for Linux / GNU. It has several versions (I think the latest is version 3).
In order for other programming languages to use it (other than C), there have to exist libraries that can bind GTK to that particular language.
PHP-GTK means that there's a library binding GTK to PHP enabling PHP to create apps that can be displayed in a nice interface. It supports, however, only up to version 2.2 of the GTK.
Same goes for other languages, they have a prefix / suffix and (GtkAda for example) those libraries also tell you up to what version they support GTK (since you might want to try newer GTK functions that aren't available in the library binding GTK to your language).

Using GtkMenu in Gtk+-2.14.0

I am building an application which has GtkMenu widget. I am using Glade RAD tool to develop UI and while creating project in Glade I have specified version of GTK as 2.16 which supports GtkMenu and GtkMenuItems.
So I used GtkMenu everywhere in app (for File Menu and for Right Click Menu).
But I tried this application on my target platform, which has GTK+ 2.14 installed
Does not recognize GtkMenu or GtkMenuItem.
What should I do now? I need to use GtkMenu with GtkMenuItems but I can't upgrade target platform to use GTK+ 2.16.
So questions are:
Does GTK+ 2.14 support GtkMenu and GtkImageMenuItem/GtkMenuItems?
If not what should we use instead?
GtkMenu is a core GTK+ class. It's been in there since the first (2.0) version of the current series, and was even in GTK+ 1.x.
I think the same holds true for GtkMenuItem; there are things (like the submenu property) that are noted as having been added in 2.12, for instance.
Not sure what that says about your problem; perhaps you're mis-interpreting some error message?
UPDATE: It does seem GtkImageMenuItem is new; perhaps you can emulate it using a plain menu item?
The issue isn't that GTK+ 2.14 doesn't support GtkMenu and friends. It's that the UI building infrastructure, GtkBuilder, doesn't support creating them from XML specifications. Unfortunately I'm not sure what the recommended solution is/was; I'm dealing with the same problem myself.
Gtk 2.14 definitly support menuitem, menubar etc..
You are most likely saving your user interface as a gtkbuilder UI.
GtkBuilder is taking over libglade. Unfortunatly, GtkBuilder in gtk2.14 doesn't yet support the construction of menubar and menuitem, even though gtk2.14 totally support menubar and menuitem.
What are your options?
Stay as you are, your project is fully operational on gtk >= 2.16 (gtkbuilder can create menuitem in gtk >=2.16)
Save your user interface as a glade user interface and then your project will work fine on gtk 2.14. You will need to use libglade instead of gtkbuilder to load the interface, connect the signals etc. However it is a bad option since libglade will slowly diseapear.
If building your app on gtk2.14 is really important, then you will want to build your menu without gtkbuilder, but directly write the code. (you will need to see the 2.14 documentation, go to http://library.gnome.org/devel/gtk/2.14/GtkMenuBar.html ).
I'll go for option 3. Good luck.
Christophe