Skip to content

Commit

Permalink
accessx: Convert icons from pixbuf to cairo surfaces
Browse files Browse the repository at this point in the history
This improves support for HiDPI displays. It also fixes some deprecation
warnings, adds auto-resizing, and updates the main applet icon.
  • Loading branch information
vkareh authored and raveit65 committed May 12, 2018
1 parent 2b9d8bf commit cbc200f
Show file tree
Hide file tree
Showing 151 changed files with 581 additions and 354 deletions.
642 changes: 359 additions & 283 deletions accessx-status/applet.c

Large diffs are not rendered by default.

77 changes: 51 additions & 26 deletions accessx-status/applet.h
Expand Up @@ -24,31 +24,56 @@

#include <mate-panel-applet.h>

#define ACCESSX_APPLET "ax-applet"
#define ACCESSX_BASE_ICON "ax-base"
#define ACCESSX_ACCEPT_BASE "ax-accept"
#define ACCESSX_REJECT_BASE "ax-reject"
#define MOUSEKEYS_BASE_ICON "ax-mouse-base"
#define MOUSEKEYS_BUTTON_LEFT "ax-button-left"
#define MOUSEKEYS_BUTTON_MIDDLE "ax-button-middle"
#define MOUSEKEYS_BUTTON_RIGHT "ax-button-right"
#define MOUSEKEYS_DOT_LEFT "ax-dot-left"
#define MOUSEKEYS_DOT_MIDDLE "ax-dot-middle"
#define MOUSEKEYS_DOT_RIGHT "ax-dot-right"
#define SHIFT_KEY_ICON "ax-shift-key"
#define CONTROL_KEY_ICON "ax-control-key"
#define ALT_KEY_ICON "ax-alt-key"
#define META_KEY_ICON "ax-meta-key"
#define SUPER_KEY_ICON "ax-super-key"
#define HYPER_KEY_ICON "ax-hyper-key"
#define ALTGRAPH_KEY_ICON "ax-altgraph-key"
#define SLOWKEYS_IDLE_ICON "ax-sk-idle"
#define SLOWKEYS_PENDING_ICON "ax-sk-pending"
#define SLOWKEYS_ACCEPT_ICON "ax-sk-accept"
#define SLOWKEYS_REJECT_ICON "ax-sk-reject"
#define BOUNCEKEYS_ICON "ax-bouncekeys"

#define STATUS_APPLET_ICON_SIZE GTK_ICON_SIZE_LARGE_TOOLBAR
#define ACCESSX_APPLET "preferences-desktop-accessibility"

#define ACCESSX_BASE_ICON "mate-ax-key-none"
#define ACCESSX_BASE_ICON_BASE "mate-ax-key-base"
#define ACCESSX_BASE_ICON_INVERSE "mate-ax-key-inverse"
#define ACCESSX_ACCEPT_BASE "mate-ax-key-yes"
#define ACCESSX_REJECT_BASE "mate-ax-key-no"

#define MOUSEKEYS_BASE_ICON "mate-mousekeys-base"
#define MOUSEKEYS_BUTTON_LEFT "mate-mousekeys-pressed-left"
#define MOUSEKEYS_BUTTON_MIDDLE "mate-mousekeys-pressed-middle"
#define MOUSEKEYS_BUTTON_RIGHT "mate-mousekeys-pressed-right"
#define MOUSEKEYS_DOT_LEFT "mate-mousekeys-default-left"
#define MOUSEKEYS_DOT_MIDDLE "mate-mousekeys-default-middle"
#define MOUSEKEYS_DOT_RIGHT "mate-mousekeys-default-right"

#define SHIFT_KEY_ICON "mate-sticky-shift-none"
#define SHIFT_KEY_ICON_LATCHED "mate-sticky-shift-latched"
#define SHIFT_KEY_ICON_LOCKED "mate-sticky-shift-locked"

#define CONTROL_KEY_ICON "mate-sticky-ctrl-none"
#define CONTROL_KEY_ICON_LATCHED "mate-sticky-ctrl-latched"
#define CONTROL_KEY_ICON_LOCKED "mate-sticky-ctrl-locked"

#define ALT_KEY_ICON "mate-sticky-alt-none"
#define ALT_KEY_ICON_LATCHED "mate-sticky-alt-latched"
#define ALT_KEY_ICON_LOCKED "mate-sticky-alt-locked"

#define META_KEY_ICON "mate-sticky-meta-none"
#define META_KEY_ICON_LATCHED "mate-sticky-meta-latched"
#define META_KEY_ICON_LOCKED "mate-sticky-meta-locked"

#define HYPER_KEY_ICON "mate-sticky-hyper-none"
#define HYPER_KEY_ICON_LATCHED "mate-sticky-hyper-latched"
#define HYPER_KEY_ICON_LOCKED "mate-sticky-hyper-locked"

#define SUPER_KEY_ICON "mate-sticky-super-none"
#define SUPER_KEY_ICON_LATCHED "mate-sticky-super-latched"
#define SUPER_KEY_ICON_LOCKED "mate-sticky-super-locked"

#define ALTGRAPH_KEY_ICON "mate-sticky-alt-none"
#define ALTGRAPH_KEY_ICON_LATCHED "mate-sticky-alt-latched"
#define ALTGRAPH_KEY_ICON_LOCKED "mate-sticky-alt-locked"

#define SLOWKEYS_IDLE_ICON "mate-ax-slowkeys"
#define SLOWKEYS_PENDING_ICON "mate-ax-slowkeys-pending"
#define SLOWKEYS_ACCEPT_ICON "mate-ax-slowkeys-yes"
#define SLOWKEYS_REJECT_ICON "mate-ax-slowkeys-no"

#define BOUNCEKEYS_ICON "mate-ax-bouncekeys"

typedef enum {
ACCESSX_STATUS_ERROR_NONE = 0,
Expand All @@ -73,7 +98,7 @@ typedef struct {
GtkWidget* alt_graph_indicator;
MatePanelAppletOrient orient;
GtkIconFactory* icon_factory;
gboolean initialized;
gboolean initialized;
XkbDescRec* xkb;
Display* xkb_display;
AccessxStatusErrorType error_type;
Expand Down
Expand Up @@ -7,7 +7,7 @@ _Description=Keyboard Accessibility Status Applet Factory
[AccessxStatusApplet]
_Name=Keyboard Accessibility Status
_Description=Shows the status of keyboard accessibility features
Icon=mate-ax-applet
Icon=preferences-desktop-accessibility
MateComponentId=OAFIID:MATE_AccessxStatusApplet
X-MATE-Bugzilla-Bugzilla=MATE
X-MATE-Bugzilla-Product=mate-applets
Expand Down
41 changes: 41 additions & 0 deletions accessx-status/pixmaps/16x16/Makefile.am
@@ -0,0 +1,41 @@
accessx_status_iconsdir = $(iconsdir)/hicolor/16x16/apps
accessx_status_icons_DATA = \
mate-ax-key-base.png \
mate-ax-key-inverse.png \
mate-ax-key-none.png \
mate-ax-key-yes.png \
mate-ax-key-no.png \
mate-mousekeys-base.png \
mate-mousekeys-pressed-left.png \
mate-mousekeys-pressed-middle.png \
mate-mousekeys-pressed-right.png \
mate-mousekeys-default-left.png \
mate-mousekeys-default-middle.png \
mate-mousekeys-default-right.png \
mate-sticky-shift-none.png \
mate-sticky-shift-latched.png \
mate-sticky-shift-locked.png \
mate-sticky-ctrl-none.png \
mate-sticky-ctrl-latched.png \
mate-sticky-ctrl-locked.png \
mate-sticky-alt-none.png \
mate-sticky-alt-latched.png \
mate-sticky-alt-locked.png \
mate-sticky-meta-latched.png \
mate-sticky-meta-locked.png \
mate-sticky-meta-none.png \
mate-sticky-hyper-latched.png \
mate-sticky-hyper-locked.png \
mate-sticky-hyper-none.png \
mate-sticky-super-latched.png \
mate-sticky-super-locked.png \
mate-sticky-super-none.png \
mate-ax-slowkeys.png \
mate-ax-slowkeys-pending.png \
mate-ax-slowkeys-yes.png \
mate-ax-slowkeys-no.png \
mate-ax-bouncekeys.png

EXTRA_DIST = \
$(accessx_status_icons_DATA)

Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added accessx-status/pixmaps/16x16/mate-ax-key-no.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added accessx-status/pixmaps/16x16/mate-ax-key-none.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added accessx-status/pixmaps/16x16/mate-ax-key-yes.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.