Commit graph

405 commits

Author SHA1 Message Date
Carlos Garnacho
d51336c2c2 wacom: Port calibrator UI to GTK+
Same dog, different collar. The UI has been ported 1:1 to GTK+, using
GtkBuilder, CSS and event controllers fairly reduced the amount of code
needed for this.

It also allows us to stop initializing clutter-gtk across the several
executables.
2018-11-07 23:02:10 +00:00
Robert Ancell
ead164b6da wacom: Remove unused tabs in UI
There were some tabs that were not visible and not used. They also
had translatable text that was not used.
2018-08-27 02:55:21 +00:00
Robert Ancell
b51af0fc58 wacom: Replace ifdefs with #pragma once 2018-08-02 21:48:03 +00:00
Robert Ancell
aeca65c729 wacom: Replace GObject boilerplate with G_DECLARE_TYPE 2018-08-02 21:48:02 +00:00
Sam Hewitt
e66ee02953 wacom: use dim-label class on icons instead of opacity for consistency 2018-07-10 17:53:56 -04:00
Sam Hewitt
24174173be common: update pixel_size values to base 16 for icon clarity 2018-07-10 17:52:08 -04:00
Bastien Nocera
0e2a4aa2d6 wacom: Hide Wacom panel when there are no tablets
Use GsdDeviceManager to monitor libwacom-supported tablets coming and
going. Hide the Wacom panel from the list when there's no supported
tablets plugged in.
2018-06-20 12:53:11 +00:00
Carlos Garnacho
35adc02d42 wacom: Use GdkMonitor API on calibrator UI
Replaces usage of deprecated GdkScreen API. We still have to pass
monitor numbers around for gdk_window_fullscreen_on_monitor(), such
is life.
2018-05-26 10:09:28 +02:00
Carlos Garnacho
c3b34e6798 wacom: Use GdkSeat grabs in g-c-c's pad button action mapper UI
Replaces usage of deprecated API.
2018-05-26 10:09:28 +02:00
Carlos Garnacho
2503832046 wacom: Use GdkSeat API to list slave stylus devices
Replaces usage of deprecated API.
2018-05-26 10:09:28 +02:00
Georges Basile Stavracas Neto
af0186aaf9 project: Update meson files
I probably have OCD. Seeing these files
with this poor alignment gives me physical
pain.
2018-05-03 00:45:29 -03:00
Piotr Drąg
7265bd53a0 Add translator comments to .desktop files
Icons are confusing translators, and gettext
is unlikely to get fixed any time soon.
2018-02-23 18:49:35 +01:00
Jason Gerecke
f57a192564 wacom: Support the WSTYLUS_3D stylus type
Wacom's new "Pro Pen 3D" stylus is declared as a new stylus type within
libwacom: WSTYLUS_3D. Now that the Wacom panel supports arbitrary three-
button styli, we can add specific support for this new stylus type to
suppress the warning message that is generated.

https://bugzilla.gnome.org/show_bug.cgi?id=790028
2018-01-30 21:23:24 +01:00
Jason Gerecke
039f30a535 wacom: Add support for three-button styli
Wacom has introduced its new "Pro Pen 3D" stylus which includes a third
button. This commit adds support for arbitrary three-button styli.

https://bugzilla.gnome.org/show_bug.cgi?id=790028
2018-01-30 21:23:24 +01:00
Jason Gerecke
69e94483b7 wacom: Make remove_buttons dynamic
Both 'remove_buttons' and 'remove_button' perform the same general task and
can be unified into a single function. This makes supporting an arbitrary
number of stylus buttons more straightforward.

https://bugzilla.gnome.org/show_bug.cgi?id=790028
2018-01-30 21:23:24 +01:00
Jason Gerecke
0c65e04b2e wacom: Set combo-topbutton to current value for styli with > 2 buttons
Although the Wacom panel doesn't have explicit support for styli with more
than two buttons, it tries to at least allow configuration of the upper and
lower buttons. This commit fixes an incorrect conditional which prevents
the panel from setting the combo box for the upper switch to the current
setting.

https://bugzilla.gnome.org/show_bug.cgi?id=790028
2018-01-30 21:23:24 +01:00
Iñigo Martínez
0dd386f405 build: Migrate from Intltool to Gettext
Recent versions of Gettext are able to translate several formats
that are used in GNOME applications. This patch migrates from
Intltool to Gettext by using meson's i18n features.

https://bugzilla.gnome.org/show_bug.cgi?id=787588
2018-01-23 10:49:31 +01:00
Iñigo Martínez
dc0988d47c build: Remove autotools
To avoid the burden of maintaining multiple build systems, this
patch removes autotools support.

https://bugzilla.gnome.org/show_bug.cgi?id=785414
2018-01-18 12:20:08 +01:00
Piotr Drąg
b65e31323a panels: Remove soft hyphens from .desktop files
With the old shell gone, there is no need to work around cut off panel
names (bug #647087). As it stands now, it only confuses translators
(invisible characters are hard to, well, see).

https://bugzilla.gnome.org/show_bug.cgi?id=792629
2018-01-18 00:12:04 -02:00
Iñigo Martínez
32edd6789e build: Port to meson build system
Meson is a build system focused on speed an ease of use, which
helps speeding up the software development. This patch adds meson
support along autotools.

https://bugzilla.gnome.org/show_bug.cgi?id=785414
2018-01-17 20:09:35 -02:00
Jason Gerecke
978ccdc9af wacom: Correct order of area calibration values
Commit cf408c27b0 changed how the values stored in the "area" key were
calculated in order be compatible with its updated schema. Unfortunately,
it overlooked the fact that updated schema also changed the order of the
values from "left, top, right, bottom" to "left, right, top, bottom".
Because of this, corrections intended to be applied to the top and right
screen edges were swapped. This can cause a noticible cursor offset to
occur after finishing calibration.

https://bugzilla.gnome.org/show_bug.cgi?id=784009
2017-07-05 23:46:22 +02:00
Jason Gerecke
50b39dc570 wacom: Drop old_axes from calibration API
The calibration utility was modified in cf408c27b0 to return unitless
padding measurements instead of axis values for storage in gsettings.
Unfortunately, the code still assumes in some places that it is working
with axes rather than paddings. This causes subtle math errors that
result in undesired cursor offsets after the calibration is applied.

Fortunately, this can be simplified, since tablet area is always reset
to the default state before starting calibration, we are sure that the
value will remain constant. Since both axes are in the same 0..1 scale,
calibration code doesn't need to swap X/Y back and forth to calculate
each axis scale.

Additionally, the code to get the calibrated axis values has been moved
into its own function along with a new function that returns padding
values suitable for consumption by g-c-c. All calculations are performed
internally in the 0..1 range.

https://bugzilla.gnome.org/show_bug.cgi?id=784009

Co-Authored-By: Carlos Garnacho <carlosg@gnome.org>
2017-07-05 23:46:22 +02:00
Carlos Garnacho
42489e2509 wacom: Map the GsdDevice to a GdkDevice when spawning the calibrator
This makes the calibrator only reactive to the tablet being calibrated
again.

https://bugzilla.gnome.org/show_bug.cgi?id=782040
2017-06-30 21:11:54 +02:00
Carlos Garnacho
b26d6acb5f wacom: Make calibrator use GDK for button events
This way we can cut down the last step in the mapping across
GUdevDevice->GsdDevice->GdkDevice->ClutterInputDevice.

https://bugzilla.gnome.org/show_bug.cgi?id=782040
2017-06-30 21:11:54 +02:00
Bastien Nocera
60ad6a35b4 wacom: Fix compile-time warning
expected ‘GtkWidget * {aka struct _GtkWidget *}’ but argument is of type ‘CcWacomNavButton * {aka struct _CcWacomNavButton *}’
2017-06-07 18:17:33 +02:00
Bastien Nocera
3f0510cac8 build: Better libm checks
Use AC_CHECK_LIBM instead of AC_CHECK_LIB(m,...
and use $(LIBM) instead of hardcoding "-lm" in Makefiles.
2017-02-08 19:21:53 +01:00
Bastien Nocera
aaf037d9a7 wacom: Fix format errors
format ‘%d’ expects argument of type ‘int’, but argument 2 has type
‘gdouble {aka const double}’
2016-11-16 17:03:49 +01:00
Alberts Muktupāvels
2536a6cfa2 wacom: fix build error
/usr/bin/ld: /mnt/wd20ezrx-00dc0b0/JHBuild/3.24/install/lib/libgnome-desktop-3.so: undefined reference to symbol 'XFree'
/usr/lib/gcc/x86_64-linux-gnu/6/../../../x86_64-linux-gnu/libX11.so: error adding symbols: DSO missing from command line

Change linking order to fix build.
2016-11-09 15:16:34 +02:00
Carlos Garnacho
2c00289f5f wacom: Remove g-s-d code synchronization rule
This code is going from g-s-d, the remaining bits should be adopted
by g-c-c.
2016-11-04 23:27:13 +01:00
Carlos Garnacho
1e31494f22 wacom: Remove GsdWacomDevice
It is now entirely unused.
2016-11-04 23:27:13 +01:00
Carlos Garnacho
0d402c8338 wacom: Update test to use CcWacomDevice
So it works again.
2016-11-04 23:27:13 +01:00
Carlos Garnacho
4babfe2e9f wacom: Add constructor for fake CcWacomDevice objects
So it can be used in test-wacom
2016-11-04 23:27:13 +01:00
Carlos Garnacho
7dfb7d2e5e wacom: Use updated ui files 2016-11-04 23:27:12 +01:00
Carlos Garnacho
b770d37457 wacom: Refurbish UI files
Some improvements to fit better with the new design:
- "no configured ..." page for both stylus/tablet sections
- the navigation buttons are now children of GtkRevealers, so
  size doesn't popup
- Empty placeholder in several containers have been removed.
2016-11-04 23:27:12 +01:00
Carlos Garnacho
cf408c27b0 wacom: Instaurate calibration
The "area" setting has a different treatment in the gsettings-desktop-schemas
tablet schema, the 4 double values express the padding (in unitless 0..1
range) on each of the sides of the tablet. It's been done so we don't rely
on input/output units, which we might have not the luxury to access.

Besides that, the dependency on GsdWacomDevice has been cleared.
2016-11-04 23:26:42 +01:00
Carlos Garnacho
dbff3d9284 wacom: Remove unused struct definition
It seems this was never used.
2016-11-04 23:26:42 +01:00
Carlos Garnacho
b5de120e3f wacom: Poke the org.gnome.Shell D-Bus call to show the pad OSD
This feature now belongs in gnome-shell, not g-s-d. The D-Bus API
changed correspondingly.
2016-11-04 23:26:42 +01:00
Carlos Garnacho
143b7ac849 wacom: Populate button mapping dialog
We now use the CcWacomDevice API for this.
2016-11-04 23:26:41 +01:00
Carlos Garnacho
5fdf5ad8ec wacom: Add cc_wacom_device_get_button_settings()
This function retrieves the GSettings pointing to the configuration
of the given button, or NULL if not found.
2016-11-04 23:26:41 +01:00
Carlos Garnacho
8122e43b31 wacom: Add cc_wacom_tool_get_num_buttons()
Uses libwacom underneath.
2016-11-04 23:26:41 +01:00
Carlos Garnacho
d118070a73 wacom: Clean up CcWacomButtonRow
We now only care of pad buttons, so this code can be quite simplified.
2016-11-04 23:26:41 +01:00
Carlos Garnacho
f06203a5b2 wacom: Update .ui files to look more like the mockups 2016-11-04 23:26:41 +01:00
Carlos Garnacho
2f4f3f994c wacom: Update .ui file to reflect GDesktopStylusButtonAction
The set of actions that can be mapped to an stylus button have been
reduced, due to inconsistent semantics in wayland.
2016-11-04 23:26:41 +01:00
Carlos Garnacho
4743770832 wacom: Update to the new data model
There's much going on under the hood here:
- Styli and tablets are now in split views, as per the mockups.
- CcWacomDevice and CcWacomTool are now in use, with the subsequent
  API use changes. Moreover, using these objects means using the
  newer schemas in gsettings-desktop-schemas, so there had to be
  changes in the settings we store too.
- We now use CcTabletToolMap, plus listen to tool proximity events,
  populating the "Stylus" sub-pane with those.
2016-11-04 23:26:41 +01:00
Carlos Garnacho
26ce8c4b2e wacom: Add display mapping API to CcWacomDevice
This can only be used for tablets that are not display nor system
integrated (eg. intuos models). The mapping of tablets with a builtin
display remain in g-s-d/GsdDeviceMapper.
2016-11-04 23:26:41 +01:00
Carlos Garnacho
fe5c5f97c8 wacom: Add CcTabletToolMap
In the wayland tablet input model, compositor and clients may
recognize the different physical styli in use, even if those are
used across compatible tablets.

This object is intended to be used as a persistent memory of
which stylus was used with which tablet. So you 1) can associate
tools and devices when such combination happens, and 2) query the
styli that were previously used with a tablet when it is detected/
plugged.

These associations are stored in two keyfiles in
~/.cache/gnome-control-center/wacom/, one for tablets and other
for styli.
2016-11-04 23:26:41 +01:00
Carlos Garnacho
0a6219886b wacom: Add CcWacomTool
Similar to CcWacomDevice vs GsdWacomDevice, CcWacomTool is meant to
replace the GsdWacomStylus object. There is a substantial difference
between these two objects, CcWacomTool offers constructor methods,
it expects the caller to maintain lifetime otherwise. while
GsdWacomStylus objects creation was rather fixed (GsdWacomDevice
created all possible styli on initialization). This latter model
doesn't help us use all the possibilities wrt wayland configurability.
2016-11-04 23:26:41 +01:00
Carlos Garnacho
2b75f5dfcc wacom: Add CcWacomDevice
This is a vast oversimplification of GsdWacomDevice. This one
has code that is largely unnecessary here (mostly devised for g-s-d),
plus it will be even eventually removed from g-s-d (the functionality
is moving into compositor domain), so the code sharing argument
remains pretty weak.

So, CcWacomDevice is thought to take over, just offering the basic
API we after all need in the gnome-control-center side.
2016-11-04 23:26:41 +01:00
Carlos Garnacho
b69cbe4e24 wacom: Add "Test your settings" button to wacom panel
A popover with a CcDrawingArea appears in that case.
2016-11-04 23:26:41 +01:00
Carlos Garnacho
472d87844e wacom: Add CcDrawingArea
This is a testing drawing widget that can be used to the a feeling
of changes to stylus settings.
2016-11-04 23:26:41 +01:00