Disable client side decorations (CSD) on Wayland - qt

I am working on a Wayland Compositor, and I need to disable CSD for Qt and Gtk client apps.
Is there any environment variable I can use to do it so?
I have been searching without luck!

For Qt, you can set QT_WAYLAND_DISABLE_WINDOWDECORATION=1
2021 Update (only relevant for compositor development):
There's now also an official protocol extension for negotiating window decorations, called xdg-decoration, so if you're working on a compositor you can implement it and make sure to send a configure event with server_side:
<event name="configure">
<description summary="suggest a surface change">
The configure event asks the client to change its decoration mode. The
configured state should not be applied immediately. Clients must send an
ack_configure in response to this event. See xdg_surface.configure and
xdg_surface.ack_configure for details.
A configure event can be sent at any time. The specified mode must be
obeyed by the client.
</description>
<arg name="mode" type="uint" enum="mode" summary="the decoration mode"/>
</event>
This would be the standardized and clean way to do it, but note however that toolkits are free to not implement this extension, so there's no guarantee that you will be able to use it.
If you're using the Qt Wayland Compositor API, the docs are here
Qt clients implement and obey it and some other toolkits, but I don't think GTK does. It looks like they implement an unofficial extension developed by KDE, though, so if you really want to go out of your way to get rid of decorations on GTK, look into implementing server-decoration as well.

Related

How to use videojs-contrib-eme in local server

Could any one instruct me the steps of implementing Encrypted Media Extensions using videojs-contrib-eme in local server (with Access Point) which doesn't has internet.
Users connect to local server using WiFi with mobile and playback the videos in browser.
So my question is as
EME implementations use the following external components:
Key System
Content Decryption Module (CDM):
License (Key) server
Packaging service
(refer for more info -- https://developers.google.com/web/fundamentals/media/eme)
what components are already provided by videojs-contrib-eme , and what components do I need to implement ?
It sounds like you are building for an off-line case - the main DRM's supported by most browsers, Widevine, FairPlay and PlayReady, require an internet connection usually for the license request and response.
It is possible to have persistent licenses, i.e. a DRM license which will work offline for download and go use cases like watching movies offline, but even this requires internet connectivity for the original license request and response.
If you plan to implement your own proprietary DRM system, then you will need more changes than just to the player itself, i.e. video.js, in your example.
You will need to implement some form of key server, your own CDM and some form of packager.
It's certainly possible to do all this, but it is a lot of work. If this is not just for a learning exercise, it may be more practical to implement some simple encryption solution on your server and then add simple decryption functionality just before you play the content. This is not as secure but may be good enough for your needs.
Alternatively if you really want DRM level security, it might be worth seeing if you can have limited internet access just for the DRM license requests and responses which are typically very small. This would also you leverage standard browsers and packagers.

How to capture biometric information on a webpage by using Java

what's the proper way to capture biometric information (pressure, speed...) by signing with a stylus on a canvas developed in a JSP web Page
Alright, since no one else has attempted to answer this question, I shall elaborate on my comment and opefully it will serve as an answer to others as well.
First, Java Server Pages (JSP) is a server-side language. It is meant to run on the web-server and not on the user's browser. The same goes for other server-side languages like PHP and ASP.
So a server-side language is not able to directly interact with devices (keyboard, scanners, cameras, etc). Only when the data is submitted by the browser or client program, the server receives it for processing.
For a device to receive input, there are two key pieces of software needed.
The device driver: which must be installed on the user's machine
The application program to capture inputs and do any processing.
If either one is missing, the device cannot function. And then there's another issues. Depending on the device, there's various feedback from the driver/API that should go back to the application that reads it. For example, if a fingerprint scan was not very successful for some reason, the scanner should tell this to the user. So again, there's the need for interactivity between the device and the user's application.
Thus, using any server-side language is out of the question for such applicatoins.
Now, in order to make this possible, you may use a client-side program. Here are some options.
A native application in VB, C/C++, Pascal or other language. If this is an option, the user must install this application on their computer.
A browser-based program. This can be a program created using JAVA (not Javascript or JSP), or ActiveX component. ActiveX is largely OS/browser dependent. And the TRUTH is that even Java is not truly platform independent when it comes to different operating systems. There are some technical differences that you'll need to look into. But for the most part of interactivity and high-level operations, yes, Java is more platform-independent than the others. But on a personal note, Java is my worst language. I try not to use it anywhere anymore. That's a different story.
In both options above, every client machine must have their own proprietory drivers and often some sort of API for browser integration.
A year or so ago, I had to program a Bio-Mini fingerprint scanner using VB. It was all sweet in the beginning. Then due to the restrictions of networkability and concurrent usage, the drivers/SDK could not take the load and things were going wrong. By the way, the drivers/SDK were meant for MS-Access. Knowing that the DB was the problem, I started to port this to MySQL. And it was a severe climb from there. I had to do a near-rewrite of the SDK for capturing and comparing data using arrays in VB. And to make things worst, the device was changed and things went wrong again. But do note that the new device was from the same manufacturer.
So keep in mind that even a simple change like that can cause a problem.

Controlling Spotify through Processing/Arduino

I am making a tangible controller for Spotify (like the one from Jordi Parra, http://vimeo.com/21387481#at=0) using an Arduino microcontroller.
I have a Processing sketch running which does all the calculations with the data from the Arduino. I want this Processing sketch to be able to control different options in Spotify like: Next, Previous, Play/Pause, Volume Up/Down, Shuffle.
Right now I use an extra Arduino Leonardo which simulates key presses while AutoHotKey listens to those and sends them to Spotify. It does not work very well and I only have limited options.
I would love to get rid of that extra Arduino while getting more control.
I am working on a Windows thing so Apple script won't work (for me).
Is there a possibility to control the Spotify app from Processing? Or is it possible to use the library to create a new Spotify app in Processing?
Many thanks in advance!
Paul
Disclaimer: I work at Spotify
Right now there is no cross-platform way to control the Spotify application. On Linux, Spotify will respond to dbus commands, which means that a bit of hacking could send play/pause/next/previous. I have heard that it is also possible to control Spotify on Mac OSX via applescript, but I'm not 100% certain about this. A quick google search for "control spotify mac os x applescript" produced some interesting results, though I'm not sure how current or relevant any of them are. As for Windows, I'm not sure if/how one would control the application at all.
Otherwise, your best bet would be libspotify, for which you would need to write a Processing library to communicate with it. Based on a bit of quick research, it seems that Processing libraries are written in Java, which means you'd either need to use a wrapper such as jlibspotify or hand-roll your own JNI wrapper for libspotify.
I'm not sure how current jlibspotify is, given that they are wrapping a rather old version of the library. If you do any libspotify hacking it is better done in C/C++ with a minimal JNI wrapper, but all of this may be way more work than you are intending for this project.
Why not utilize Spotify's keyboard integration.
The Arduino Leonardo supports USB HID mode.
So, send the keyboard keys for Next, Previous, Play/Pause, Volume Up/Down, Shuffle.
Most everything has a single bound global key. I believe only shuffle does not. You could create a global hotkey in your OS to bind to the app's shuffle control key.
If you are looking for status feedback on the state of each button, this of course won't help you.
Good luck.

Softphone answer event in Asterisk

I want to make a web interface that prints out a form that needs to be filled.
The problem is that i want to print out the form only when a call is answered by a softphone.
What event should i listen for?
I'm using Asterisk 1.6 and I get all the events in XML using AsterClick.
thanks,
Sebastian
AsterClick is an excellent choice as it is the only
event based Asterisk AMI /(XML)/JavaScript interface
on the planet that can propagates those events to
JavaScript AS they occur!! All others use polling,
As to your question...
During your AsterClick development,when your JavaScript inherits from the
wSocket class, you should implement the method(s)
your_wSocket.wSocketsReceiveString(String) and/or
your_wSocket.wSocketsReceiveXML(XMLdocument).
These wSocket methods should be documented on the AsterClick site http://asterclick.drclue.net
with more help being available in the forums http://forums.drclue.net/viewforum.php?f=13.
These functions can be used to monitor the XML command and event flow in real time
and represents all the data Asterisk AMI provides.
I tend to route this information to an autoscrolling widget with a handy [clear]
button near by.
By pressing your [clear] button and then interacting with your
phones while examining the event flow, you
should be able to pick out the events and related data for
any automation sequence.
As to jQuery, I know that there are jQuery/Asterclick projects
running out there, including a real-time HUD system that manages
calls,conferencing,parking,queues, etc.
The AsterClick client SDK is also squarely aimed at HTML5 and running
on an ever increasing range of devices as the HTML5 features required are
implemented.
You can also use the AsterClick "WBEA" tool to deploy your HTML5
AsterClick applications as desktop executables for Windows,Linux.
Anyways I Hope some of that helps.
You should capture events from AMI, you can use Adhearsion for this (Adhearsion can be also connected to a Rails app):
https://github.com/adhearsion/adhearsion
or PAMI if you prefer PHP:
https://github.com/marcelog/PAMI

Should I expose the BlackBerry networking configuration settings to the end user?

When using the networking API in BB OS 5.0 (ConnectionFactory, etc.) there are a ton of options for configuring the connection. How much of this is it appropriate/expected to expose to the end user of the application?
Certainly, I will be setting what I think are appropriate defaults for my application, but some things (e.g. preferred and disallowed transports) seem like they are questions that the user can or should answer.
Is there any kind of best practice here?
Yes, this is one of the things I dislike in BB development - you never know what type of connectivity a BB user has on the device. As a result the code to detect a usable transport is complicated (even despite RIM has some sample code on how to do this).
In the apps development I've been involved in there were different approaches to this. However each app had networking settings which were implied to be populated by user.
For instance, one app asks user to select a transport type on app startup. :) This is definitelly an ideal solution for developers, but not for users (they simply may not know what the "network transport" is). If the target audience mostly consists of advanced users, then this will work good.
Another approach is to use some code to auto-detect a usable transport type, however this approach may also fail (for instance, if the code tries to cover a wide range of OS versions and device makes, then there are most likely will be some unexpected exclusions). So as a fallback scenario it is good to have some networking settings screen where user could check what transports to use (maybe just the only one) and APN settings.
It depends on the target audience. You could do a simplified view with basic options and and advanced view with every thing under the sun that is configurable with a reset button in case the user gets lost.

Resources