Commit graph

531 commits

Author SHA1 Message Date
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
Piotr Drąg
bd0d048944 wacom: use Unicode in translatable strings
See https://developer.gnome.org/hig/stable/typography.html

https://bugzilla.gnome.org/show_bug.cgi?id=772199
2016-10-03 15:21:28 +02:00
Georges Basile Stavracas Neto
2777fd583d panels: use the new categories
Following the previous patch, this patch adds the new alternative
categories to the panels' Desktop files. These alternative categories
are only relevant for the alternative Shell, and do not break the
current Shell in any way.

https://bugzilla.gnome.org/show_bug.cgi?id=767301
2016-06-14 12:16:43 -03:00
Bastien Nocera
5c10ce45b8 panels: Fix translators comments being truncated
Commit b3be076 added soft hyphens along with a comment for translators
to use those soft hyphens. Except that gettext would only grab the one
line out of the four we wrote for translators to read. Put them all on
the same line so that gettext actually extracts those.

https://bugzilla.gnome.org/show_bug.cgi?id=765778
2016-04-28 23:38:00 +02:00
Bastien Nocera
b3be07609a panels: Fix truncated panel names for larger fonts
Note that this fix will not automatically fix translations, which will
need to add soft-hyphens (U+00AD) to their translations themselves, and
will not fix larger fonts for which the split up syllables end up
being bigger than the maximum text width.

It's the best we can do without redesigning the Settings shell, which is
already something planned.

https://bugzilla.gnome.org/show_bug.cgi?id=647087#c13
2016-04-07 16:06:35 +02:00
Bastien Nocera
97c2a880c8 wacom: Update from gnome-settings-daemon 2016-03-24 17:01:37 +01:00
Bastien Nocera
d6765b0378 wacom: Use the fully qualified D-Bus name for the OSD
So that we don't end up seeing the fallback button mapping dialogue when
running gsd-test-wacom.
2016-03-10 17:19:30 +01:00
Debarshi Ray
84b65ddea0 wacom: Use the right API for setting the window width
We should be pairing gtk_window_get_size with
gtk_window_set_default_size to avoid inconsistencies between the size
reading and setting code. eg., in recent GTK+ versions,
gtk_window_get_size and gtk_widget_set_size_request differ in their
interpretation of the CSD chrome.

However, gtk_window_set_default_size didn't work with non-resizable
GtkWindows, until now.

https://bugzilla.gnome.org/show_bug.cgi?id=762548
2016-03-09 13:47:09 +01:00
Carlos Garnacho
ff2cfece51 wacom: Avoid deprecated Clutter API 2016-01-22 21:57:49 +01:00
Carlos Garnacho
c0e854a6dd wacom: Workaround deadlocks in Clutter event handlers
The way we destroy the window during the handling of a clutter event may
cause the window to generate a focus event that gets processed immediately,
causing Clutter to deadlock on its global lock.

Bypass these issues in the places where we finalize out of Clutter events,
The Esc key presses are now handled at the GTK+ level, and we postpone
finalization (with either success or failure) to an idle.

Works around https://bugzilla.gnome.org/show_bug.cgi?id=747880
2016-01-22 21:51:46 +01:00
Carlos Garnacho
65bd735937 wacom: Refactor calibrator finalization into separate function
Instead of calling the delete event handler everywhere.
2016-01-22 21:50:38 +01:00
Rui Matos
888e40eae8 wacom: Avoid crashing when opening the panel on wayland sessions
We don't yet support wacom devices under wayland and GsdWacomDevice
uses X APIs unconditionally which makes us crash under wayland.

Instead, let's return early and leave the GsdWacomDevice in an invalid
state which means that we just present the default UI for "no wacom
devices detected".
2016-01-18 14:53:28 +01:00
Jason Gerecke
ae11d34c60 wacom: Fix window decorations being visible in calibrator window
The 'on_fullscreen' function which handles the 'window-state-event'
signal should be returning a gboolean value. Fix the function
signature and have it return FALSE to allow the event to continue to
propagate.

https://bugzilla.gnome.org/show_bug.cgi?id=751129
2015-07-01 11:42:45 +02:00
Carlos Garnacho
adb82f0d00 wacom: Drop usage of last-calibration-resolution
This is gone from the g-s-d schema, so just stop setting it.

https://bugzilla.gnome.org/show_bug.cgi?id=748660
2015-04-29 19:35:34 +02:00
Carlos Garnacho
6365dafd92 wacom: Sync gsd-wacom-device.[ch] with g-s-d
And use the GdkDevice getter where it applies.
2015-04-13 14:38:24 +02:00
Benjamin Tissoires
e2a14f4d4c wacom: add an icon for stylii without an eraser
wacom-stylus-no-eraser.svg is an adaptation of wacom-stylus.svg

https://bugzilla.gnome.org/show_bug.cgi?id=746117
2015-04-01 11:15:29 +02:00
Benjamin Tissoires
e463a1eb55 wacom: Update from gnome-settings-daemon
https://bugzilla.gnome.org/show_bug.cgi?id=746117
2015-04-01 11:15:29 +02:00
Benjamin Tissoires
66cb45bdad wacom: do not bail out if the tablet doesn't have an eraser
Tablets have not always an eraser (most of the generic tablets like Huion,
UC-Logic, etc... don't). We should not reject such tablets.

Commit 54849a9 (wacom: Only the stylus and eraser tools need to exist)
mentioned that we were not sure about eraser, and I think we should not
assume one either.

To do so, we simply ignore the eraser xinput node and rely on
libwacom to actually provide the eraser information.

If the stylus does not have the eraser tip, we may fall in the
LAYOUT_OTHER case. We have a picture of a generic Wacom pen with an
eraser, and the leaders linking the widget to the picture are scrambled.

To prevent that, gray out the eraser pressure slider so that we do not
break the layout.

https://bugzilla.gnome.org/show_bug.cgi?id=746117
2015-04-01 11:15:29 +02:00
Benjamin Tissoires
5fcf43a135 wacom: Allow button mapping if the stylus has one button too
The airbrush tool has only one button, and the button mapping combo box
does not work.
We should not bail out if the widget has been removed, that means that
the stylus does not support the second button.

Check upfront the number of buttons to know if the top button parameter
is available.

https://bugzilla.gnome.org/show_bug.cgi?id=746263
2015-03-16 12:53:41 +01:00
Benjamin Tissoires
cf29acae5d wacom: test: add Huion H610 Pro panel
The tablet does not have an eraser, so it's good to have a test for it.

https://bugzilla.gnome.org/show_bug.cgi?id=746117
2015-03-13 17:00:30 +01:00
Bastien Nocera
555429009e wacom: Update from gnome-settings-daemon 2015-03-13 17:00:30 +01:00
David King
64014362eb wacom: Fix final use-stock deprecated property
https://bugzilla.gnome.org/show_bug.cgi?id=736052
2015-01-25 14:05:07 +01:00
Carlos Garnacho
be8d68c591 Update device configuration from gnome-settings-daemon
GsdWacomDevice has been updated, dragging GsdDeviceManager as a dependency
from g-s-d, which has been added to panels/common, and compiled as a
separate static libary, which is used by the wacom and mouse modules.

gsd-input-helper.[ch] is now in such library and has been removed from
the panel directories.

https://bugzilla.gnome.org/show_bug.cgi?id=743196
2015-01-20 20:44:13 +01:00
Rui Matos
205a0cd4bd wacom: Drop deprecated API usage
https://bugzilla.gnome.org/show_bug.cgi?id=740986
2014-12-05 16:13:29 +01:00
David King
86b7af3f0e panels: Mark label strings as translatable
https://bugzilla.gnome.org/show_bug.cgi?id=736052
2014-09-04 16:00:20 +01:00