From ccc0dcafbd144ff6016395a1d413d8a71d864618 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Rochet?= Date: Fri, 17 Jan 2014 18:34:12 +0100 Subject: [PATCH 01/22] Fix black squares on gnome3 --- composite.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/composite.cc b/composite.cc index ec70ad10..55bbcc88 100644 --- a/composite.cc +++ b/composite.cc @@ -27,6 +27,7 @@ Popup::Popup(int x1, int y1, int x2, int y2) : Gtk::Window(Gtk::WINDOW_POPUP), r Glib::RefPtr visual = get_screen()->get_rgba_visual(); gtk_widget_set_visual(Widget::gobj(), visual->gobj()); + gtk_widget_set_app_paintable (Widget::gobj(), TRUE); signal_draw().connect(sigc::mem_fun(*this, &Popup::on_draw)); realize(); move(x1, y1); From 710d246eccf867b3e610b0720ca6883dfc14a7f7 Mon Sep 17 00:00:00 2001 From: Thomas Jaeger Date: Sun, 7 Sep 2014 14:10:29 -0700 Subject: [PATCH 02/22] Don't wipe XShape setting on load Fixes bug #36. --- prefdb.cc | 2 -- 1 file changed, 2 deletions(-) diff --git a/prefdb.cc b/prefdb.cc index 0c924f57..45be080a 100644 --- a/prefdb.cc +++ b/prefdb.cc @@ -72,8 +72,6 @@ template void PrefDB::serialize(Archive & ar, const unsigned int ar & help; } ar & trace.unsafe_ref(); - if (trace.get() == TraceShape) - trace.unsafe_ref() = TraceDefault; if (version < 3) { int delay; ar & delay; From ffe356c2c7d4d91bf384ed6db5ad8b971293a082 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Rochet?= Date: Tue, 7 Jul 2015 13:12:07 +0200 Subject: [PATCH 03/22] French translation update --- po/fr.po | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/po/fr.po b/po/fr.po index ad856369..cd36c142 100644 --- a/po/fr.po +++ b/po/fr.po @@ -8,15 +8,16 @@ msgstr "" "Project-Id-Version: easystroke\n" "Report-Msgid-Bugs-To: FULL NAME \n" "POT-Creation-Date: 2013-03-14 00:24-0400\n" -"PO-Revision-Date: 2012-10-28 10:42+0000\n" -"Last-Translator: Penegal \n" +"PO-Revision-Date: 2015-07-07 13:11+0200\n" +"Last-Translator: Raphael Rochet \n" "Language-Team: French \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=n > 1;\n" "X-Launchpad-Export-Date: 2013-03-14 04:28+0000\n" -"X-Generator: Launchpad (build 16532)\n" +"X-Generator: Poedit 1.8.2\n" +"Language: fr\n" #, c-format msgid "Error: can't execute command \"%s\": fork() failed\n" @@ -46,8 +47,7 @@ msgstr "rename() a échoué" #, c-format msgid "Error: Couldn't save action database: %s.\n" -msgstr "" -"Erreur : impossible d'enregistrer la base de données des actions %s.\n" +msgstr "Erreur : impossible d'enregistrer la base de données des actions %s.\n" msgid "" "Couldn't save %1. Your changes will be lost. Make sure that \"%2\" is a " @@ -292,7 +292,7 @@ msgid "D_isabled" msgstr "D_ésactivé" msgid "" -msgstr "" +msgstr "" msgid "Connection to DBus failed" msgstr "La connexion à DBus a échoué" @@ -390,7 +390,7 @@ msgid "Show popups (" msgstr "Afficher les popups (" msgid "to the right of the cursor)" -msgstr "" +msgstr "à droite du curseur)" msgid "Show tray icon" msgstr "Afficher l'icône dans la barre des tâches" @@ -418,6 +418,8 @@ msgstr "Préférences" msgid "Only enable easystroke for applications listed on 'Actions' tab" msgstr "" +"N'activer easystroke que pour les applications listées dans l'onglet " +"'Actions'" msgid "Timeout Gestures" msgstr "Gestes de temps mort" @@ -483,6 +485,5 @@ msgstr "Désactiver" #~ msgid "(window manager frame)" #~ msgstr "(cadre du gestionnaire de fenêtres)" -#, c-format #~ msgid "Error: A grab failed. Resetting...\n" #~ msgstr "Erreur : une saisie a échoué. Redémarrage...\n" From 0e60f1630fc6267fcaf287afef3f8c5eaafd3dd9 Mon Sep 17 00:00:00 2001 From: "John W. Trengrove" Date: Thu, 21 May 2015 22:35:05 +1000 Subject: [PATCH 04/22] switch from fork to g_spawn_async --- actiondb.cc | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/actiondb.cc b/actiondb.cc index 6b35f47c..d76192df 100644 --- a/actiondb.cc +++ b/actiondb.cc @@ -119,14 +119,9 @@ template void StrokeInfo::serialize(Archive & ar, const unsigned using namespace std; void Command::run() { - pid_t pid = fork(); - switch (pid) { - case 0: - execlp("/bin/sh", "sh", "-c", cmd.c_str(), nullptr); - exit(1); - case -1: - printf(_("Error: can't execute command \"%s\": fork() failed\n"), cmd.c_str()); - } + gchar* argv[] = {(gchar*) "/bin/sh", (gchar*) "-c", NULL, NULL}; + argv[2] = (gchar *) cmd.c_str(); + g_spawn_async(NULL, argv, NULL, G_SPAWN_SEARCH_PATH, NULL, NULL, NULL, NULL); } ButtonInfo Button::get_button_info() const { From 22b28d25bb696e37e73b4bc641439b3db9f564ed Mon Sep 17 00:00:00 2001 From: nagae-memooff <169192@gmail.com> Date: Sun, 2 Oct 2016 02:12:09 +0800 Subject: [PATCH 05/22] fix build failed in libsignc++ version 2.5.1 or newer --- actions.cc | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/actions.cc b/actions.cc index 45c03761..9676ee9f 100644 --- a/actions.cc +++ b/actions.cc @@ -51,10 +51,11 @@ void TreeViewMulti::on_drag_begin(const Glib::RefPtr &context) context->set_icon(pb, pb->get_width(), pb->get_height()); } -bool negate(bool b) { return !b; } - TreeViewMulti::TreeViewMulti() : Gtk::TreeView(), pending(false) { - get_selection()->set_select_function(sigc::group(&negate, sigc::ref(pending))); + get_selection()->set_select_function( + [this](Glib::RefPtr const&, Gtk::TreeModel::Path const&, bool) { + return !pending; + }); } enum Type { COMMAND, KEY, TEXT, SCROLL, IGNORE, BUTTON, MISC }; From 9e2c32390c5c253aade3bb703e51841748d2c37e Mon Sep 17 00:00:00 2001 From: Jonathan Wakely Date: Sat, 28 Jan 2017 01:26:00 +0000 Subject: [PATCH 06/22] Remove abs(float) function that clashes with std::abs(float) Depending on which C++ standard library headers have been included there might an abs(float) function already declared in the global namespace, so the definition in this file conflicts with it. This cause a build failure with GCC 7, which conforms more closely to the C++ standard with respect to overloads of abs. Including and adding a using-declaration for std::abs ensures that the standard std::abs(float) function is available. This solution should be portable to all compilers. --- handler.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/handler.cc b/handler.cc index 8830ea28..685b1ffe 100644 --- a/handler.cc +++ b/handler.cc @@ -23,6 +23,8 @@ #include #include #include +#include // std::abs(float) +using std::abs; XState *xstate = nullptr; @@ -533,8 +535,6 @@ class WaitForPongHandler : public Handler, protected Timeout { virtual Grabber::State grab_mode() { return parent->grab_mode(); } }; -static inline float abs(float x) { return x > 0 ? x : -x; } - class AbstractScrollHandler : public Handler { bool have_x, have_y; float last_x, last_y; From 5f6885c59d1366e28317c9553c2e406fbd6569f9 Mon Sep 17 00:00:00 2001 From: p2rkw Date: Wed, 1 Feb 2017 23:01:16 +0100 Subject: [PATCH 07/22] Remove requirement for current device to be in absolute mode, this will allow mtrack to be used with easystroke --- handler.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/handler.cc b/handler.cc index 8830ea28..fb3a1fad 100644 --- a/handler.cc +++ b/handler.cc @@ -563,7 +563,7 @@ class AbstractScrollHandler : public Handler { } protected: void move_back() { - if (!prefs.move_back.get() || (xstate->current_dev && xstate->current_dev->absolute)) + if (!prefs.move_back.get()) return; XTestFakeMotionEvent(dpy, DefaultScreen(dpy), orig_x, orig_y, 0); } @@ -968,7 +968,7 @@ class StrokeHandler : public Handler, public sigc::trackable { virtual void release(guint b, RTriple e) { RStroke s = finish(0); - if (prefs.move_back.get() && !xstate->current_dev->absolute) + if (prefs.move_back.get()) XTestFakeMotionEvent(dpy, DefaultScreen(dpy), orig->x, orig->y, 0); else XTestFakeMotionEvent(dpy, DefaultScreen(dpy), e->x, e->y, 0); From 1c0a0609489035805fedfe88fe97542d2aa37bf5 Mon Sep 17 00:00:00 2001 From: tzraeq Date: Fri, 14 Jul 2017 15:11:26 +0800 Subject: [PATCH 08/22] Add a duplicate action button, you can duplicate a action and move it to another app now! --- actions.cc | 37 +++++++++++++++++++++++++++++++++++++ actions.h | 3 ++- gui.glade | 20 +++++++++++++++++++- po/zh_CN.po | 3 +++ 4 files changed, 61 insertions(+), 2 deletions(-) diff --git a/actions.cc b/actions.cc index 45c03761..f2f77209 100644 --- a/actions.cc +++ b/actions.cc @@ -131,6 +131,7 @@ Actions::Actions() : Gtk::Button *button_add, *button_add_app, *button_add_group; widgets->get_widget("button_add_action", button_add); widgets->get_widget("button_delete_action", button_delete); + widgets->get_widget("button_dup_action", button_dup); widgets->get_widget("button_record", button_record); widgets->get_widget("button_add_app", button_add_app); widgets->get_widget("button_add_group", button_add_group); @@ -141,6 +142,7 @@ Actions::Actions() : widgets->get_widget("vpaned_apps", vpaned_apps); button_record->signal_clicked().connect(sigc::mem_fun(*this, &Actions::on_button_record)); button_delete->signal_clicked().connect(sigc::mem_fun(*this, &Actions::on_button_delete)); + button_dup->signal_clicked().connect(sigc::mem_fun(*this, &Actions::on_button_dup)); button_add->signal_clicked().connect(sigc::mem_fun(*this, &Actions::on_button_new)); button_add_app->signal_clicked().connect(sigc::mem_fun(*this, &Actions::on_add_app)); button_add_group->signal_clicked().connect(sigc::mem_fun(*this, &Actions::on_add_group)); @@ -511,6 +513,40 @@ void Actions::on_button_delete() { update_counts(); } +void Actions::on_button_dup() { + editing_new = true; + Unique *before = 0; + Glib::ustring name; + if (tv.get_selection()->count_selected_rows()) { + std::vector paths = tv.get_selection()->get_selected_rows(); + Gtk::TreeIter i = tm->get_iter(paths[paths.size()-1]); + //i++; + //if (i != tm->children().end()) + before = (*i)[cols.id]; + name = (*i)[cols.name]; + } + + RStrokeInfo src = action_list->get_info(before); + + Gtk::TreeModel::Row row = *(tm->append()); + StrokeInfo si; + si.action = src->action; + si.strokes = src->strokes; + Unique *id = action_list->add(si); + row[cols.id] = id; + action_list->set_name(id,name); + //std::string name; + /*if (action_list != actions.get_root()) + name = action_list->name + " "; + name += Glib::ustring::compose(_("Gesture %1"), action_list->order_size()); + action_list->set_name(id, name);*/ + + update_row(row); + focus(id, 1, true); + update_actions(); + update_counts(); +} + void Actions::on_cell_data_apps(Gtk::CellRenderer* cell, const Gtk::TreeModel::iterator& iter) { ActionListDiff *as = (*iter)[ca.actions]; Gtk::CellRendererText *renderer = dynamic_cast(cell); @@ -789,6 +825,7 @@ void Actions::on_selection_changed() { int n = tv.get_selection()->count_selected_rows(); button_record->set_sensitive(n == 1); button_delete->set_sensitive(n >= 1); + button_dup->set_sensitive(n >= 1); bool resettable = false; if (n) { std::vector paths = tv.get_selection()->get_selected_rows(); diff --git a/actions.h b/actions.h index 2bd7c7e3..b47f02ab 100644 --- a/actions.h +++ b/actions.h @@ -36,6 +36,7 @@ class Actions { public: Actions(); private: + void on_button_dup(); void on_button_delete(); void on_button_new(); void on_button_record(); @@ -138,7 +139,7 @@ class Actions { Glib::RefPtr type_store; - Gtk::Button *button_record, *button_delete, *button_remove_app, *button_reset_actions; + Gtk::Button *button_record, *button_delete, *button_remove_app, *button_reset_actions, *button_dup; Gtk::CheckButton *check_show_deleted; Gtk::Expander *expander_apps; Gtk::VPaned *vpaned_apps; diff --git a/gui.glade b/gui.glade index ac1c552c..35495024 100644 --- a/gui.glade +++ b/gui.glade @@ -815,6 +815,24 @@ Van Diep Duong (Vietnamese) 2 + + + _Duplicate Action(s) + False + True + True + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + False + image4 + True + + + False + False + 3 + + _Hide @@ -829,7 +847,7 @@ Van Diep Duong (Vietnamese) False False - 3 + 4 True diff --git a/po/zh_CN.po b/po/zh_CN.po index 9dfca926..2c3c72b0 100644 --- a/po/zh_CN.po +++ b/po/zh_CN.po @@ -341,6 +341,9 @@ msgstr "添加动作" msgid "_Delete Action(s)" msgstr "删除动作" +msgid "_Duplicate Action(s)" +msgstr "复制动作" + msgid "_Hide" msgstr "隐藏(_H)" From 7b69293d39d724ef2cc1d4130b0b3fb984da3f6e Mon Sep 17 00:00:00 2001 From: nouser Date: Sat, 16 Feb 2019 15:47:24 +0200 Subject: [PATCH 09/22] added experimental support for grabbing the extra buttons on disabled devices, and faking the last extra button of a disabled device as the default button. The basic idea is to allow using button 1 for touch screens but still allow disabling mouse gestures for button 1, but still allow default gestures with another mouse button. --- allow_disabled_extra_buttons.patch | 56 ++++++++++++++++++++++++++++++ grabber.cc | 16 ++++++--- handler.cc | 13 +++++++ 3 files changed, 81 insertions(+), 4 deletions(-) create mode 100644 allow_disabled_extra_buttons.patch diff --git a/allow_disabled_extra_buttons.patch b/allow_disabled_extra_buttons.patch new file mode 100644 index 00000000..328e2936 --- /dev/null +++ b/allow_disabled_extra_buttons.patch @@ -0,0 +1,56 @@ +diff -Naru src-orig/grabber.cc src-mod/grabber.cc +--- src-orig/grabber.cc 2013-03-27 17:52:38.000000000 +0200 ++++ src-mod/grabber.cc 2019-02-16 15:28:14.733994066 +0200 +@@ -424,10 +424,18 @@ + if (!xi_grabbed == !grab) + return; + xi_grabbed = grab; +- for (DeviceMap::iterator i = xi_devs.begin(); i != xi_devs.end(); ++i) +- if (i->second->active) +- for (std::vector::iterator j = buttons.begin(); j != buttons.end(); j++) +- i->second->grab_button(*j, grab); ++ if (! experimental) { //standard behaviour; only grab enabled devices ++ for (DeviceMap::iterator i = xi_devs.begin(); i != xi_devs.end(); ++i) ++ if (i->second->active) ++ for (std::vector::iterator j = buttons.begin(); j != buttons.end(); j++) ++ i->second->grab_button(*j, grab ); ++ } ++ else { //modified behaviour; also grab additional buttons of disabled devices ++ for (DeviceMap::iterator i = xi_devs.begin(); i != xi_devs.end(); ++i) ++ for (std::vector::iterator j = buttons.begin(); j != buttons.end(); j++) ++ if (i->second->active || j!=buttons.begin() ) ++ i->second->grab_button(*j, grab ); ++ } + } + + void Grabber::XiDevice::grab_device(GrabState grab) { +diff -Naru src-orig/handler.cc src-mod/handler.cc +--- src-orig/handler.cc 2019-02-16 02:15:45.324375909 +0200 ++++ src-mod/handler.cc 2019-02-16 15:33:46.584957312 +0200 +@@ -283,6 +283,16 @@ + break; + xinput_pressed.erase(event->detail); + in_proximity = get_axis(event->valuators, current_dev->proximity_axis); ++ ++ if (experimental) //if device is disabled, but extra buttons followed, treat last extra button as the default button ++ for (std::set::iterator i = prefs.excluded_devices.ref().begin(); i != prefs.excluded_devices.ref().end(); i++) ++ if (! i->compare(grabber->get_xi_dev(event->deviceid)->name) ) //check if the grabbed device name is in disabled device list ++ { ++ ++ if ( prefs.extra_buttons.ref().size() && (guint) event->detail == prefs.extra_buttons.ref().rbegin()->button) //check if the button is same as last extra button ++ event->detail = prefs.button.ref().button; //fake the default button ++ } ++ + H->release(event->detail, create_triple(event->root_x, event->root_y, event->time)); + break; + case XI_Motion: +@@ -969,6 +979,9 @@ + virtual void release(guint b, RTriple e) { + RStroke s = finish(0); + ++ if (experimental) //button 1 should be treated as trigger 0, other trigger buttons copied from the event button b itself ++ s->trigger = b>1 ? b : 0 ; ++ + if (prefs.move_back.get() && !xstate->current_dev->absolute) + XTestFakeMotionEvent(dpy, DefaultScreen(dpy), orig->x, orig->y, 0); + else diff --git a/grabber.cc b/grabber.cc index 3e8512f0..229286c0 100644 --- a/grabber.cc +++ b/grabber.cc @@ -424,10 +424,18 @@ void Grabber::grab_xi(bool grab) { if (!xi_grabbed == !grab) return; xi_grabbed = grab; - for (DeviceMap::iterator i = xi_devs.begin(); i != xi_devs.end(); ++i) - if (i->second->active) - for (std::vector::iterator j = buttons.begin(); j != buttons.end(); j++) - i->second->grab_button(*j, grab); + if (! experimental) { //standard behaviour; only grab enabled devices + for (DeviceMap::iterator i = xi_devs.begin(); i != xi_devs.end(); ++i) + if (i->second->active) + for (std::vector::iterator j = buttons.begin(); j != buttons.end(); j++) + i->second->grab_button(*j, grab ); + } + else { //modified behaviour; also grab additional buttons of disabled devices + for (DeviceMap::iterator i = xi_devs.begin(); i != xi_devs.end(); ++i) + for (std::vector::iterator j = buttons.begin(); j != buttons.end(); j++) + if (i->second->active || j!=buttons.begin() ) + i->second->grab_button(*j, grab ); + } } void Grabber::XiDevice::grab_device(GrabState grab) { diff --git a/handler.cc b/handler.cc index 8830ea28..75fa1cba 100644 --- a/handler.cc +++ b/handler.cc @@ -281,6 +281,16 @@ void XState::handle_xi2_event(XIDeviceEvent *event) { break; xinput_pressed.erase(event->detail); in_proximity = get_axis(event->valuators, current_dev->proximity_axis); + + if (experimental) //if device is disabled, but extra buttons followed, treat last extra button as the default button + for (std::set::iterator i = prefs.excluded_devices.ref().begin(); i != prefs.excluded_devices.ref().end(); i++) + if (! i->compare(grabber->get_xi_dev(event->deviceid)->name) ) //check if the grabbed device name is in disabled device list + { + + if ( prefs.extra_buttons.ref().size() && (guint) event->detail == prefs.extra_buttons.ref().rbegin()->button) //check if the button is same as last extra button + event->detail = prefs.button.ref().button; //fake the default button + } + H->release(event->detail, create_triple(event->root_x, event->root_y, event->time)); break; case XI_Motion: @@ -968,6 +978,9 @@ class StrokeHandler : public Handler, public sigc::trackable { virtual void release(guint b, RTriple e) { RStroke s = finish(0); + if (experimental) //button 1 should be treated as trigger 0, other trigger buttons copied from the event button b itself + s->trigger = b>1 ? b : 0 ; + if (prefs.move_back.get() && !xstate->current_dev->absolute) XTestFakeMotionEvent(dpy, DefaultScreen(dpy), orig->x, orig->y, 0); else From 453796c3efc811a2bffb31fc21f18d735aaea47c Mon Sep 17 00:00:00 2001 From: nouser Date: Sat, 16 Feb 2019 16:43:37 +0200 Subject: [PATCH 10/22] fixed button press not passing through if gesture was not detected --- allow_disabled_extra_buttons.patch | 86 +++++++++++++++--------------- handler.cc | 9 +++- 2 files changed, 50 insertions(+), 45 deletions(-) diff --git a/allow_disabled_extra_buttons.patch b/allow_disabled_extra_buttons.patch index 328e2936..af15dd47 100644 --- a/allow_disabled_extra_buttons.patch +++ b/allow_disabled_extra_buttons.patch @@ -1,56 +1,56 @@ -diff -Naru src-orig/grabber.cc src-mod/grabber.cc ---- src-orig/grabber.cc 2013-03-27 17:52:38.000000000 +0200 -+++ src-mod/grabber.cc 2019-02-16 15:28:14.733994066 +0200 -@@ -424,10 +424,18 @@ - if (!xi_grabbed == !grab) - return; - xi_grabbed = grab; -- for (DeviceMap::iterator i = xi_devs.begin(); i != xi_devs.end(); ++i) -- if (i->second->active) -- for (std::vector::iterator j = buttons.begin(); j != buttons.end(); j++) -- i->second->grab_button(*j, grab); -+ if (! experimental) { //standard behaviour; only grab enabled devices -+ for (DeviceMap::iterator i = xi_devs.begin(); i != xi_devs.end(); ++i) -+ if (i->second->active) -+ for (std::vector::iterator j = buttons.begin(); j != buttons.end(); j++) -+ i->second->grab_button(*j, grab ); -+ } -+ else { //modified behaviour; also grab additional buttons of disabled devices -+ for (DeviceMap::iterator i = xi_devs.begin(); i != xi_devs.end(); ++i) -+ for (std::vector::iterator j = buttons.begin(); j != buttons.end(); j++) -+ if (i->second->active || j!=buttons.begin() ) -+ i->second->grab_button(*j, grab ); -+ } - } - - void Grabber::XiDevice::grab_device(GrabState grab) { diff -Naru src-orig/handler.cc src-mod/handler.cc ---- src-orig/handler.cc 2019-02-16 02:15:45.324375909 +0200 -+++ src-mod/handler.cc 2019-02-16 15:33:46.584957312 +0200 -@@ -283,6 +283,16 @@ +--- src-orig/handler.cc 2019-02-16 16:10:30.158007582 +0200 ++++ src-mod/handler.cc 2019-02-16 16:32:26.005219510 +0200 +@@ -290,7 +290,8 @@ + { + + if ( prefs.extra_buttons.ref().size() && (guint) event->detail == prefs.extra_buttons.ref().rbegin()->button) //check if the button is same as last extra button +- event->detail = prefs.button.ref().button; //fake the default button ++ event->detail = 100+event->detail; //fake the default button ++ //event->detail = prefs.button.ref().button; //fake the default button + } + + H->release(event->detail, create_triple(event->root_x, event->root_y, event->time)); +@@ -980,7 +981,11 @@ + RStroke s = finish(0); + + if (experimental) //button 1 should be treated as trigger 0, other trigger buttons copied from the event button b itself +- s->trigger = b>1 ? b : 0 ; ++ if (b>100) ++ { ++ b=b-100; ++ s->trigger = prefs.button.ref().button-1; ++ } + + if (prefs.move_back.get() && !xstate->current_dev->absolute) + XTestFakeMotionEvent(dpy, DefaultScreen(dpy), orig->x, orig->y, 0); +diff -Naru src-orig/handler.cc.orig src-mod/handler.cc.orig +--- src-orig/handler.cc.orig 2019-02-16 16:10:30.158007582 +0200 ++++ src-mod/handler.cc.orig 2013-03-27 17:52:38.000000000 +0200 +@@ -281,16 +281,6 @@ break; xinput_pressed.erase(event->detail); in_proximity = get_axis(event->valuators, current_dev->proximity_axis); -+ -+ if (experimental) //if device is disabled, but extra buttons followed, treat last extra button as the default button -+ for (std::set::iterator i = prefs.excluded_devices.ref().begin(); i != prefs.excluded_devices.ref().end(); i++) -+ if (! i->compare(grabber->get_xi_dev(event->deviceid)->name) ) //check if the grabbed device name is in disabled device list -+ { -+ -+ if ( prefs.extra_buttons.ref().size() && (guint) event->detail == prefs.extra_buttons.ref().rbegin()->button) //check if the button is same as last extra button -+ event->detail = prefs.button.ref().button; //fake the default button -+ } -+ +- +- if (experimental) //if device is disabled, but extra buttons followed, treat last extra button as the default button +- for (std::set::iterator i = prefs.excluded_devices.ref().begin(); i != prefs.excluded_devices.ref().end(); i++) +- if (! i->compare(grabber->get_xi_dev(event->deviceid)->name) ) //check if the grabbed device name is in disabled device list +- { +- +- if ( prefs.extra_buttons.ref().size() && (guint) event->detail == prefs.extra_buttons.ref().rbegin()->button) //check if the button is same as last extra button +- event->detail = prefs.button.ref().button; //fake the default button +- } +- H->release(event->detail, create_triple(event->root_x, event->root_y, event->time)); break; case XI_Motion: -@@ -969,6 +979,9 @@ +@@ -979,9 +969,6 @@ virtual void release(guint b, RTriple e) { RStroke s = finish(0); -+ if (experimental) //button 1 should be treated as trigger 0, other trigger buttons copied from the event button b itself -+ s->trigger = b>1 ? b : 0 ; -+ +- if (experimental) //button 1 should be treated as trigger 0, other trigger buttons copied from the event button b itself +- s->trigger = b>1 ? b : 0 ; +- if (prefs.move_back.get() && !xstate->current_dev->absolute) XTestFakeMotionEvent(dpy, DefaultScreen(dpy), orig->x, orig->y, 0); else diff --git a/handler.cc b/handler.cc index 75fa1cba..9a54a741 100644 --- a/handler.cc +++ b/handler.cc @@ -288,7 +288,8 @@ void XState::handle_xi2_event(XIDeviceEvent *event) { { if ( prefs.extra_buttons.ref().size() && (guint) event->detail == prefs.extra_buttons.ref().rbegin()->button) //check if the button is same as last extra button - event->detail = prefs.button.ref().button; //fake the default button + event->detail = 100+event->detail; //fake the default button + //event->detail = prefs.button.ref().button; //fake the default button } H->release(event->detail, create_triple(event->root_x, event->root_y, event->time)); @@ -979,7 +980,11 @@ class StrokeHandler : public Handler, public sigc::trackable { RStroke s = finish(0); if (experimental) //button 1 should be treated as trigger 0, other trigger buttons copied from the event button b itself - s->trigger = b>1 ? b : 0 ; + if (b>100) + { + b=b-100; + s->trigger = prefs.button.ref().button-1; + } if (prefs.move_back.get() && !xstate->current_dev->absolute) XTestFakeMotionEvent(dpy, DefaultScreen(dpy), orig->x, orig->y, 0); From ece68e05aa31335f0b8bb7fde14a594e93bc5684 Mon Sep 17 00:00:00 2001 From: nouser Date: Sat, 16 Feb 2019 17:00:09 +0200 Subject: [PATCH 11/22] deleted the unnecessary patch --- allow_disabled_extra_buttons.patch | 56 ------------------------------ 1 file changed, 56 deletions(-) delete mode 100644 allow_disabled_extra_buttons.patch diff --git a/allow_disabled_extra_buttons.patch b/allow_disabled_extra_buttons.patch deleted file mode 100644 index af15dd47..00000000 --- a/allow_disabled_extra_buttons.patch +++ /dev/null @@ -1,56 +0,0 @@ -diff -Naru src-orig/handler.cc src-mod/handler.cc ---- src-orig/handler.cc 2019-02-16 16:10:30.158007582 +0200 -+++ src-mod/handler.cc 2019-02-16 16:32:26.005219510 +0200 -@@ -290,7 +290,8 @@ - { - - if ( prefs.extra_buttons.ref().size() && (guint) event->detail == prefs.extra_buttons.ref().rbegin()->button) //check if the button is same as last extra button -- event->detail = prefs.button.ref().button; //fake the default button -+ event->detail = 100+event->detail; //fake the default button -+ //event->detail = prefs.button.ref().button; //fake the default button - } - - H->release(event->detail, create_triple(event->root_x, event->root_y, event->time)); -@@ -980,7 +981,11 @@ - RStroke s = finish(0); - - if (experimental) //button 1 should be treated as trigger 0, other trigger buttons copied from the event button b itself -- s->trigger = b>1 ? b : 0 ; -+ if (b>100) -+ { -+ b=b-100; -+ s->trigger = prefs.button.ref().button-1; -+ } - - if (prefs.move_back.get() && !xstate->current_dev->absolute) - XTestFakeMotionEvent(dpy, DefaultScreen(dpy), orig->x, orig->y, 0); -diff -Naru src-orig/handler.cc.orig src-mod/handler.cc.orig ---- src-orig/handler.cc.orig 2019-02-16 16:10:30.158007582 +0200 -+++ src-mod/handler.cc.orig 2013-03-27 17:52:38.000000000 +0200 -@@ -281,16 +281,6 @@ - break; - xinput_pressed.erase(event->detail); - in_proximity = get_axis(event->valuators, current_dev->proximity_axis); -- -- if (experimental) //if device is disabled, but extra buttons followed, treat last extra button as the default button -- for (std::set::iterator i = prefs.excluded_devices.ref().begin(); i != prefs.excluded_devices.ref().end(); i++) -- if (! i->compare(grabber->get_xi_dev(event->deviceid)->name) ) //check if the grabbed device name is in disabled device list -- { -- -- if ( prefs.extra_buttons.ref().size() && (guint) event->detail == prefs.extra_buttons.ref().rbegin()->button) //check if the button is same as last extra button -- event->detail = prefs.button.ref().button; //fake the default button -- } -- - H->release(event->detail, create_triple(event->root_x, event->root_y, event->time)); - break; - case XI_Motion: -@@ -979,9 +969,6 @@ - virtual void release(guint b, RTriple e) { - RStroke s = finish(0); - -- if (experimental) //button 1 should be treated as trigger 0, other trigger buttons copied from the event button b itself -- s->trigger = b>1 ? b : 0 ; -- - if (prefs.move_back.get() && !xstate->current_dev->absolute) - XTestFakeMotionEvent(dpy, DefaultScreen(dpy), orig->x, orig->y, 0); - else From 686b7778767f1f94cf9f6d5c2acd401d76bb3d4a Mon Sep 17 00:00:00 2001 From: Marius Hillenbrand Date: Tue, 14 Apr 2020 16:00:36 +0200 Subject: [PATCH 12/22] Move Stroke::save() and load() into header The template member functions Stroke::save and Stroke::load get called via the serialize() function generated by boost's macro BOOST_SERIALIZATION_SPLIT_MEMBER() in gesture.h. Since the definitions of save()/load() are only available in gesture.cc, the compiler may produce two versions of Stroke::serialize() -- one with save()/load() inlined in gesture.o and one with calls to save()/load() in all other referencing translation units. Since the compiler inlined Stroke::save() and Stroke::load(), it will not export them in gesture.o (which is legitimate, since the code only requests an export of Stroke::serialize). As a result, some orders of object files can fail to link, when the linker picks the version of Stroke::serialize() that would call save()/load() (which are not available separately) instead of the version with these functions inlined. Avoid relying on this compiler- and optimization-level dependent behavior by moving the definition of template member functions Stroke::save() and Stroke::load() into gesture.h. As a side-effect, that change unifies code style, since all other classes have their ::save() and ::load() definitions in header files, too. These link failures surfaced when building on s390x with -march=zEC12 or later, and can be reproduced on x86_64 with gcc parameters --param max-inline-insns-auto=80 --param inline-min-speedup=2 Signed-off-by: Marius Hillenbrand --- gesture.cc | 36 ------------------------------------ gesture.h | 37 +++++++++++++++++++++++++++++++++++-- 2 files changed, 35 insertions(+), 38 deletions(-) diff --git a/gesture.cc b/gesture.cc index 8531c084..f97bce3a 100644 --- a/gesture.cc +++ b/gesture.cc @@ -14,7 +14,6 @@ * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "gesture.h" -#include "prefdb.h" #include #include @@ -35,41 +34,6 @@ RTriple create_triple(float x, float y, Time t) { return e; } -template void Stroke::save(Archive & ar, const unsigned int version) const { - std::vector ps; - for (unsigned int i = 0; i < size(); i++) - ps.push_back(points(i)); - ar & ps; - ar & button; - ar & trigger; - ar & timeout; - ar & modifiers; -} - -template void Stroke::load(Archive & ar, const unsigned int version) { - std::vector ps; - ar & ps; - if (ps.size()) { - stroke_t *s = stroke_alloc(ps.size()); - for (std::vector::iterator i = ps.begin(); i != ps.end(); ++i) - stroke_add_point(s, i->x, i->y); - stroke_finish(s); - stroke.reset(s, &stroke_free); - } - if (version == 0) return; - ar & button; - if (version >= 2) - ar & trigger; - if (version < 4 && (!button || trigger == (int)prefs.button.get().button)) - trigger = 0; - if (version < 3) - return; - ar & timeout; - if (version < 5) - return; - ar & modifiers; -} - Stroke::Stroke(PreStroke &ps, int trigger_, int button_, unsigned int modifiers_, bool timeout_) : trigger(trigger_), button(button_), modifiers(modifiers_), timeout(timeout_) { if (ps.valid()) { stroke_t *s = stroke_alloc(ps.size()); diff --git a/gesture.h b/gesture.h index accecdfe..1c318872 100644 --- a/gesture.h +++ b/gesture.h @@ -16,6 +16,7 @@ #ifndef __GESTURE_H__ #define __GESTURE_H__ +#include "prefdb.h" #include "stroke.h" #include #include @@ -83,8 +84,40 @@ class Stroke { static Glib::RefPtr pbEmpty; BOOST_SERIALIZATION_SPLIT_MEMBER() - template void load(Archive & ar, const unsigned int version); - template void save(Archive & ar, const unsigned int version) const; + template void load(Archive & ar, const unsigned int version) { + std::vector ps; + ar & ps; + if (ps.size()) { + stroke_t *s = stroke_alloc(ps.size()); + for (std::vector::iterator i = ps.begin(); i != ps.end(); ++i) + stroke_add_point(s, i->x, i->y); + stroke_finish(s); + stroke.reset(s, &stroke_free); + } + if (version == 0) return; + ar & button; + if (version >= 2) + ar & trigger; + if (version < 4 && (!button || trigger == (int)prefs.button.get().button)) + trigger = 0; + if (version < 3) + return; + ar & timeout; + if (version < 5) + return; + ar & modifiers; + + } + template void save(Archive & ar, const unsigned int version) const { + std::vector ps; + for (unsigned int i = 0; i < size(); i++) + ps.push_back(points(i)); + ar & ps; + ar & button; + ar & trigger; + ar & timeout; + ar & modifiers; + } public: int trigger; int button; From d9b8363b5854456671d21610a96cc1d6f9b25eaf Mon Sep 17 00:00:00 2001 From: albanobattistella <34811668+albanobattistella@users.noreply.github.com> Date: Sat, 7 Nov 2020 21:09:49 +0100 Subject: [PATCH 13/22] Update it.po --- po/it.po | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/po/it.po b/po/it.po index 44d69628..54ff898b 100644 --- a/po/it.po +++ b/po/it.po @@ -2,14 +2,14 @@ # Copyright (c) 2009 Rosetta Contributors and Canonical Ltd 2009 # This file is distributed under the same license as the easystroke package. # FIRST AUTHOR , 2009. -# +#ALBANO BATTISTELLA , 2020. msgid "" msgstr "" "Project-Id-Version: easystroke\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2013-03-14 00:24-0400\n" -"PO-Revision-Date: 2011-09-09 11:55+0000\n" -"Last-Translator: simone.sandri \n" +"PO-Revision-Date: 2020-11-07 11:55+0100\n" +"Last-Translator: Albano Battistella \n" "Language-Team: Italian \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" @@ -199,10 +199,10 @@ msgid "Enabled" msgstr "Attivo" msgid "About" -msgstr "" +msgstr "Informazioni" msgid "Quit" -msgstr "" +msgstr "Esci" #, c-format msgid "Couldn't open display.\n" @@ -290,7 +290,7 @@ msgid "D_isabled" msgstr "D_isabilitato" msgid "" -msgstr "" +msgstr "" msgid "Connection to DBus failed" msgstr "Connessione a DBus fallita" @@ -388,7 +388,7 @@ msgid "Show popups (" msgstr "Mostra popup (" msgid "to the right of the cursor)" -msgstr "" +msgstr "a destra del cursore)" msgid "Show tray icon" msgstr "Mostrare l'icona nell'area di notifica" @@ -415,7 +415,7 @@ msgid "Preferences" msgstr "Preferenze" msgid "Only enable easystroke for applications listed on 'Actions' tab" -msgstr "" +msgstr "Abilita easystroke solo per le applicazioni elencate nella scheda 'Azioni' " msgid "Timeout Gestures" msgstr "Timeout gesti" @@ -469,10 +469,10 @@ msgid "Control your desktop using mouse gestures" msgstr "Controlla la scrivania utilizzando i gesti del muse" msgid "Enable" -msgstr "" +msgstr "Abilita" msgid "Disable" -msgstr "" +msgstr "Disabilita" #, c-format #~ msgid "Error: A grab failed. Resetting...\n" From 5ac086969033256864e3803f8b8e01ad914c9d30 Mon Sep 17 00:00:00 2001 From: "berkeleybross@gmail.com" Date: Sat, 26 Dec 2020 22:25:09 +0000 Subject: [PATCH 14/22] Copied wiki into readme files --- README.md | 80 ++++++++++++++++++++++++++ docs/advanced-gestures.md | 23 ++++++++ docs/build-instructions.md | 110 +++++++++++++++++++++++++++++++++++ docs/index.md | 115 +++++++++++++++++++++++++++++++++++++ docs/tips-and-tricks.md | 98 +++++++++++++++++++++++++++++++ docs/translations.md | 32 +++++++++++ 6 files changed, 458 insertions(+) create mode 100644 README.md create mode 100644 docs/advanced-gestures.md create mode 100644 docs/build-instructions.md create mode 100644 docs/index.md create mode 100644 docs/tips-and-tricks.md create mode 100644 docs/translations.md diff --git a/README.md b/README.md new file mode 100644 index 00000000..2e0cd7a7 --- /dev/null +++ b/README.md @@ -0,0 +1,80 @@ +Easystroke is a gesture-recognition application for X11. Gestures or strokes are movements that you make with you mouse (or your pen, finger etc.) while holding down a specific mouse button. Easystroke will execute certain actions if it recognizes the stroke; currently easystroke can emulate key presses, execute shell commands, hold down modifiers and emulate a scroll wheel. The program was designed with Tablet PCs in mind and can be used effectively even without access to a keyboard. Easystroke tries to provide an intuitive and efficient user interface, while at the same time being highly configurable and offering many advanced features. + +# News + * [2018-12-05] Maintenance Update. As development has stalled, and the original Author is not available, but the program is still widely used, an update in terms of bugfixing and maintenance of the code has been attempted. See [BuildInstructions](https://github.com/thjaeger/easystroke/wiki/BuildInstructions) for more information. + * [2013-03-27] Released 0.6.0 This release contains few user-visible changes beside a few bugfixes. Easystroke has been ported to gtk3 and event handling code has been refactored in anticipation of touch support. Unfortunately, touch grab support in the X server is still too fragile for easystroke to be able to take advantage of it (you can preview touch support on the 'touch' branch). + * [2012-10-06] Released 0.5.6 This release incorporates fixes for most of the issues that have come up over the last year or so. It also adds Hungarian translations. Stay tuned, 0.6.0 with gtk3 and improved touch support will be released soon. The 0.5 branch will not see any new features, only bugfixes if necessary. + * [2011-08-16] Released 0.5.5.1 This fixes a build failure in 0.5.5. + * [2011-08-16] Released 0.5.5 This release adds per-device timeout settings. An extra click is now required for button actions to improve precision and scroll actions use XI2 Raw events so that the cursor is not confined to the screen. The release also includes various bugfixes and adds Catalan, Finnish, Korean and Traditional Chinese translations. + * [2010-07-27] Released 0.5.4 Just a few minor bug fixes. + * [2010-02-13] Released 0.5.3 This release adds an option to move the cursor back to the original position after each gesture and fixes a crash when a gesture times out during recording, along with a few minor bugs. + * [2010-01-09] Released 0.4.11 This release only fixes one bug that would cause a wrong key to be emitted under certain circumstances. + * [2010-01-02] Released 0.5.2 This release adds Hebrew translations and should improve keystroke handling. + * [2009-11-19] Released 0.4.10 This is a bugfix release for the non-xi2 branch of easystroke. It also adds Hebrew translations. + * [2009-10-27] Released 0.5.0 This release is a port of easystroke to XI 2 (it doesn't add any new features). You need a recent X server (at least 1.7) to run this version. Most people will probably want to stick with 0.4.9 for now. + * [2009-08-19] Released 0.4.9 This release fixes a bug regarding application groups and adds Polish translations. + * [2009-08-15] Released 0.4.8 This release fixes a long-standing bug that would prevent easystroke from working when only application-dependent gestures were defined. + * [2009-07-05] Released 0.4.7 This release adds a workaround an (1.6) X server bug causing problems with vertical gestures on some devices. + * [2009-06-16] Released 0.4.6 This release adds Russian translations and works around two issues on karmic and amd64 arch. + * [2009-06-01] Released 0.4.5 This release fixes one crash-bug and adds Chinese translations. + * [2009-05-12] Released 0.4.4 This fixes two annoying bugs in 0.4.3 + * [2009-05-09] Released 0.4.3 This is mostly a bugfix release, but it also improves drag-and-drop behavior + * [2009-05-09] Released 0.4.2 This is a bugfix-only version of 0.4.3 that I accidentally uploaded, please ignore. + * [2009-03-16] Released 0.4.1.1 This is a bugfix release. + * [2009-02-20] Released 0.4.1 This release introduces a new stroke-matching algorithm, adds click-and-hold gestures and contains various bug fixes. + * [2009-02-06] Released 0.4.0 This version adds support for the upcoming X Server 1.6, comes with Czech, German, Italian and Spanish translations and makes it possible to use multiple gesture buttons. + * [2008-12-22] Released 0.3.1 We now have a much better method for drawing strokes on composited desktops, but this release also contains a few bugfixes and an option to autostart the program. + * [2008-11-07] Released 0.3.0 This release introduces many new features, most notably application-dependent gestures. See the [changelog](http://github.com/thjaeger/easystroke/tree/master%2Fchangelog?raw=true) for details + * [2008-09-18] Released 0.2.2.1 This is a bug fix release, resolving a few minor issues. + * [2008-08-17] Released 0.2.2 This version features improved visual feedback, configurable gesture timeout, better pointer tracking and many minor improvements. + * [2008-08-06] Released 0.2.1.1. This just adds license information to the source files in order to facilitate Ubuntu packaging. An update is not necessary. + * [2008-08-03] Released 0.2.1, correcting some silly Makefile mistakes. + * [2008-08-03] Released 0.2.0. This version contains many tablet-related improvements and introduces [FeatureAdvancedGestures]. Please allow a few days for the documentation to be updated to the current version. + * [2008-06-22] Released 0.1.2. Fixes a few minor UI glitches. + * [2008-06-19] Released 0.1.1. This version introduces [FeatureClickDuringStroke], which allows you to emulate a mouse click by clicking a second button during a stroke (which can essentially turn a one-button tablet pen into three-button mouse). + * [2008-06-14] Released 0.1. This is first public release. + +# Download + +Releases can be found on the [sourceforge download page](http://sourceforge.net/project/showfiles.php?group_id=229797). See the [BuildInstructions Build Instructions] to learn how to build easystroke from source or see below if there are pre-built packages available for your distribution. + +## Ubuntu +You can find i386 and amd64 .debs for Ubuntu Karmic and Hardy on the [sourceforge download page](http://sourceforge.net/project/showfiles.php?group_id=229797). These packages, along with packages for Jaunty and Lucid, are also available through the [easystroke Lauchpad PPA](https://launchpad.net/~easystroke/+archive/ppa). Just add the following two lines to your /etc/apt/sources.list file (replace karmic with the verion of ubuntu that you're running). + + deb http://ppa.launchpad.net/easystroke/ppa/ubuntu karmic main + deb-src http://ppa.launchpad.net/easystroke/ppa/ubuntu karmic main + + +## OpenSUSE + +Easystroke is part of the openSUSE Contrib repository and the X11:Utilities devel +repository, see the [openSUSE Build Service](http://software.opensuse.org/search?baseproject=ALL&p=1&q=easystroke) for a list available builds. + +# Development + +You can fetch the [latest development tree](http://github.com/thjaeger/easystroke/tree/master) using git: + + git clone git://github.com/thjaeger/easystroke.git + + +# Documentation + +[Documentation](Documentation) + +[Tips & Tricks](TipsAndTricks) + +[Build Instructions](BuildInstructions) + +Easystroke is distributed under the [ISC License](http://github.com/thjaeger/easystroke/tree/master%2FLICENSE?raw=true). + +# How can I help out? + +If you encounter any bugs or problems with easystroke, please report them, preferably using [trac](https://sourceforge.net/apps/trac/easystroke/report) (be sure to assign the ticket to me (thjaeger), so that I get notified by e-mail). Feature suggestions are also welcome, but note that I only have limited time to implement new features (usually, changes in the X server are enough to keep me busy). + +The easystroke website is a wiki that anyone can edit (with the exception of the front page). Please feel free to add any information (tutorials, documentation, etc.) that might be interesting to other users. Work on the [Documentation](Documentation) page is especially appreciated, I don't have the time and patience to keep it up to date. + +To find out how to translate easystroke into your native language, see [Translations](Translations). + +# Author + +Easystroke is being developed by [Thomas Jaeger](mailto:ThJaeger@gmail.com). Comments, suggestions, bug reports, patches and criticism are very welcome! \ No newline at end of file diff --git a/docs/advanced-gestures.md b/docs/advanced-gestures.md new file mode 100644 index 00000000..7e6c33f2 --- /dev/null +++ b/docs/advanced-gestures.md @@ -0,0 +1,23 @@ +Back to the main [Documentation](../Documentation) page. + +Advanced gestures are gestures where you click an additional button while already holding down the trigger button. + +The feature can be used in two different ways, depending on the value of the option "Ignore strokes leading up to advanced gestures". If the option is set, the stroke that has been performed prior to triggering the advanced gesture will be discarded, so you essentially get as many advanced gestures as your mouse has buttons, minus the one that is used to trigger gestures. If the option is not checked, advanced gestures are also distinguished by their stroke. Note that until you release the gesture trigger button, the same stroke will be used for subsequent actions. + +# Preview pictures + +|| [[Image(MiscWikiFiles:advanced-button.png, align=center)]] || This is the picture of an advanced gesture where both buttons are pressed without moving the mouse in between. +|| [[Image(MiscWikiFiles:advanced-stroke.png, align=center)]] || This is the symbol for a stroke followed by a click of an additional button. The "Ignore..." option needs to be disabled in order to use this type of gesture. +|| [[Image(MiscWikiFiles:advanced-click.png, align=center)]] || This one is just a single click of the gesture trigger button. + +# Examples + +## Emulate a right-click on a Tablet PC pen +A big shortcoming of most Tablet PC pens is that they only two "buttons": The tip of the pen and one button on the side. You can set up easystroke to treat pressing the side button, followed by a regular click as a right click. Just open the "Actions" tab and add a new action. Choose "Button" as its type and then select the right button (Button3). Finally you need to record the stroke, which is just an unreleased middle-click followed by a right-click. + +## Alt+Tab switching in Compiz +Setting up regular gestures to switch between windows by pressing Alt+Tab won't work very well: The problem is that this requires holding down the Alt key, but regular gestures have to release the key immediately. This is where advanced gestures come in: Now the modifiers associated to the last action will be held down until the gesture is over, i.e. until you release the gesture trigger button. As an example, let's set up easystroke to allow Alt+Tab switching by performing an "up"-stroke (without releasing the trigger button), followed by flicking the scroll wheel. Make sure that the "Ignore..." option described above is disabled. This time we need to add two actions, one for the up button (Button4) and one for the down (Button5). Set them up to be key actions, pressing Alt+Tab and Alt+Shift+Tab, and then record the two strokes. Not that you will have to perform the stroke for both mouse buttons, once followed by an up flick and once by a down flick, but when you're actually executing the action multiple times in a row, you only need to perform the stroke once. + +# Preparation + +If you want to use this feature on a Tablet PC, you should turn off the linuxwacom driver's TPCButtons option, so that just pressing the side switch will produce a middle click, see [TipsAndTricks](../TipsAndTricks) for details. \ No newline at end of file diff --git a/docs/build-instructions.md b/docs/build-instructions.md new file mode 100644 index 00000000..697dca71 --- /dev/null +++ b/docs/build-instructions.md @@ -0,0 +1,110 @@ +Easystroke is written in C++ and uses gtkmm for its GUI, but it also depends on the availability of several X11 extensions (Xtst, Xrandr and Xinput) and on the boost::serialization library. Installation of the libraries is distribution-specific. Please feel free to add instructions for your distro of choice. + +# Debian/Ubuntu + + sudo apt-get install g++ libboost-serialization-dev libgtkmm-3.0-dev libxtst-dev libdbus-glib-1-dev intltool xserver-xorg-dev + +or + + + sudo apt-get build-dep easystroke + +NOTE: Easystroke 5.x and below need libgtkmm-2.4-dev to build, not 3.0. + +# Fedora + + yum install gcc-c++ gtkmm30-devel dbus-glib-devel boost-devel libXtst-devel intltool + +NOTE: You might have to install 'xorg-x11-server-devel' for easystroke to compile probably (I had to). + +# OpenSUSE + + zypper in make gcc gcc-c++ gtkmm2-devel glib2-devel dbus-1-glib-devel boost-devel intltool + +NOTE: You might have to install 'xorg-x11-server-sdk' to successfully build on 12.X. +# Pardus + + pisi it make gcc gtkmm boost-devel intltool + +For Pardus, you also have to add -lXi to the LIBS row in the Makefile in order to get the app to compile. + +# Releases +~~[Sourceforge download page](http://sourceforge.net/project/showfiles.php?group_id=229797)~~ + +NOTE: As for now, easystroke is in an unmaintained state. + +- The original author is not available. +- The last release was on 23. March 2013, so ~6 Years ago. +- Even the master tree is not build-able any more without patches from unmerged pull requests. +- As we do not have the credentials for this repository and the sourceforge page, an alternative solution has to be found. +- Many distributions still build their packages from 0.6.0 release, which causes numerous problems. + - A list of the commits to git master since release can be found [here](https://github.com/thjaeger/easystroke/pull/10#issuecomment-444132355) + - On Ubuntu's bug tracker for example, there are numerous bug entries where fixes are available, but they are not applied there. + +**The steady flow of pull requests nevertheless shows the interest in this unique program** + +- Preliminary binary bugfix-release of 2018/12/05: [AppImage](http://openartisthq.org/easystroke/easystroke-0.6.0-1ubuntu12-x86_64.AppImage) (built on Ubuntu 18.04; easystroke should run directly by making it executable and double clicking it.) + +- Preliminary Debian package release with all patches applied: +[easystroke_0.6.0-0ubuntu8_amd64.deb](http://openartisthq.org/easystroke/easystroke_0.6.0-0ubuntu8_amd64.deb) (built on Ubuntu 18.04) + +- Preliminary source-code bugfix-release of 2018/12/05: [patched-easystroke-master.tar.bz2](http://openartisthq.org/easystroke/patched-easystroke-master.tar.bz2) (already patched, patches included for reference) + + - Short instructions for compiling (after you installed the build-dependencies for your distribution as stated above) : + + ``` + wget http://openartisthq.org/easystroke/patched-easystroke-master.tar.bz2 + tar xvjf patched-easystroke-master.tar.bz2 + cd patched-easystroke-master/easystroke + make + ``` + + then run it with + `./easystroke` + + or install it to /usr/local with + `sudo make install` + + (in case your distribution does not have sudo installed, it's obviously just "make install" + + + + + +- These patches were applied on top of [git master](https://github.com/thjaeger/easystroke/): + + - [fix build failed in libsignc++ version 2.5.1 or newer](https://github.com/thjaeger/easystroke/pull/9/commits/22b28d25bb696e37e73b4bc641439b3db9f564ed) build fix + - [Remove abs(float) function that clashes with std::abs(float)](https://github.com/thjaeger/easystroke/pull/8/commits/9e2c32390c5c253aade3bb703e51841748d2c37e) build fix + - [fixed recurring crash when trying to render 0x0 tray icon](https://github.com/thjaeger/easystroke/pull/10/commits/140b9cae66ba874bf0994eea71210baf417a136e) bug fix + - [dont-ignore-xshape-when-saving.patch](https://aur.archlinux.org/cgit/aur.git/tree/dont-ignore-xshape-when-saving.patch?h=easystroke-git) bug fix, fixes [Changing 'method to show gestures' to Xshape does not persist](https://bugs.launchpad.net/ubuntu/+source/easystroke/+bug/1728746) + - [switch from fork to g_spawn_async](https://github.com/thjaeger/easystroke/pull/6/commits/0e60f1630fc6267fcaf287afef3f8c5eaafd3dd9) bug fix `This fixes a serious bug that can lead to system instability. Without this patch, if a 'Command' action is commonly used, it will lead to so many zombie processes that the OS will be unable to launch additional processes.` + - [add-toggle-option.patch](https://aur.archlinux.org/cgit/aur.git/tree/add-toggle-option.patch?h=easystroke-git) new feature: adds a actvation/deactivation toggle when right-clicking the tray icon`` + - [easystroke-0.6.0-gnome3-fix-desktop-file](https://src.fedoraproject.org/cgit/rpms/easystroke.git/commit/?id=4d59e8e1e849a09887c4588c84a1e1e02c350949) cosmetic fix + + +A list of all available Patches can be found [here](https://github.com/thjaeger/easystroke/pull/10#issuecomment-444132355) for now. + +Detailed instructions to follow. + +# Development Tree + +As development is stalled, the following section is not relevant for now. + +~~Most users will probably want to use a released version, so they can skip this section. However, there are a few reasons why someone would use the latest development version and you are absolutely encouraged to do so.~~ + + * ~~You want to get a sneak preview of the awesome features that are planned for the next release.~~ + * ~~You want to help me out by trying to catch bugs before they make it into a release. This is greatly appreciated.~~ + * ~~You want to send me a patch.~~ + +~~Please always *keep a backup of your .easystroke configuration directory*, as the file format is often unstable during development and it is usually not possible to go back to the stable release once the configuration has been saved in a newer file format.~~ + +Note that some advanced features are only available if easystroke is started with the -e command line option. +______________________ + +Easystroke uses git for revision control. To fetch the development tree for the first time, type + + git clone git://github.com/thjaeger/easystroke.git + +which will create a subdirectory 'easystroke' containing the sources. You can update to the latest tree anytime by changing into that directory and typing 'git pull'. + +Now we're ready to build the program. Change into the easystroke directory and type 'make -j2'. This will create an executable file that you can either run directly or copy into your $PATH (easystroke does not require additional files to be installed), but of course you can also use 'make install' to install the program to /usr/local/bin. You can also create a small manpage using help2man by typing 'make man'. \ No newline at end of file diff --git a/docs/index.md b/docs/index.md new file mode 100644 index 00000000..118e0c9c --- /dev/null +++ b/docs/index.md @@ -0,0 +1,115 @@ +Note: The documentation is outdated. Help in keeping this up to date is always appreciated. The changelog entries at the end of this page serve as a reminder what still needs to be documented. + +Easystroke is a gesture-recognition program, which can execute predefined actions based on "gestures" that you draw on the screen. To see what this is all about, start easystroke and begin drawing a few gestures by holding down the middle mouse button and moving your mouse/pen around. (Peek ahead a little bit if the middle button is inconvenient for you.) Right now, nothing happens yet when you draw a gesture, so let's define some actions next. + +Say you want to use gestures to switch tabs in Firefox. + +1. Click on the tray icon to open the program's configuration dialog +1. Click _Add Action_ to define your first action. An editable text field appears showing the preliminary name of the gesture, _Gesture 1_. +1. Change the name to _tab-left_, +1. Select _Key_ in the type column +1. Press the key combination that goes one tab to the left, namely _Ctrl+Page Up_ (you could also use _Ctrl+Left_, but that won't work in some other apps such as gnome-terminal). +1. Click on _Record Stroke_, hold down the middle button and move your mouse to the left. Of course you could have just as well used any other shape, including something curvy. + +A _tab-right_ gesture can be defined in the same way, this time moving the mouse to the right (the key combination is _Ctrl+Page Down_, by the way). If you open a Firefox window with a bunch of open tabs, you can now switch tabs just by drawing the gestures you just defined, without having to move you mouse to the other end of the screen). + +The rest of the document describes the program's options in more detail. Note that preferences are always saved instantly, so you don't need to worry about losing your newly-recorded strokes if there is a crash. You can quit easystroke by right-clicking on the tray icon and selecting _Quit_. + +# Action types +[[Image(MiscWikiFiles:easystroke-actions.png)]] + +This is the list of strokes and their associated actions. Adding and deleting lines and recording strokes is straightforward, but let's have a look at the different actions that are currently supported + +## Command + +Executes a shell command. For example, you could use the tool _xte_ (from the Debian/Ubuntu package _xautomation_) to emulate an arbitrary sequence of key presses (but see below for single key presses). + +## Key + +Emulates a single key press, possibly with modifiers held down. + +## Text + +Inserts a fixed text into the application. For characters that are not associated with any key on the keyboard, this requires working Unicode input (which generally present in gtk applications). + +## Ignore + +Sends the next "stroke" directly to the application. An useful feature of this action is that it can also hold down a modifier for the next thing you do with your mouse: To set this up, click on the entry in the _Argument_ column and hold down the modifier(s) and in arbitrary key. So for example, in most window managers, you can move or resize windows using the _move_ action in the screenshot above. + +## Scroll + +Allows you to emulate a scroll wheel by moving your mouse/pen up or down. The action is active until you press and release any button. You can define an additional modifiers to be held down in the same way as for _Ignore_. + +## Button + +Emulates a button press, again possibly with modifiers. If you need to be able to move the pointer while the button is held down, consider using the 'Ignore' action or [FeatureAdvancedGestures Advanced Gestures]. + +## Misc + * 'Unminimize' undoes the last minimize actions + * 'Show/Hide' brings up or hides the configuration dialog + * 'Disable (Enable)' disables (or enables if invoked from the command line) the program. + +[[Image(MiscWikiFiles:easystroke-apps.png)]] + +# Application and Groups +By default, gestures work in any application (unless the application is disabled entirely, which can be set up on the _Preferences_ tab). This feature allows you to set up easystroke to behave differently depending on which application the cursor is in. To use the feature, simply open the _Applications_ expander on the _Actions_ tab. You can maintain a list of applications, whose behavior differs from the default by using the _Add Application_ and _Remove Application_ buttons. The special entry _Default_ refers to all other applications. To edit the list of gestures for an application simply click on the application. + +It is important to understand how application-dependent gestures are stored: rather than maintaining a list of actions for each application, easystroke only stores the *difference* to its parent node _Default_. This means that all default actions are available in your applications, and if you add or delete a gesture in the _Default_ actions, this change will be reflected in all applications. On the other hand, adding, changing or deleting gestures for a specific application never affects the list of default actions in any way, and you can revert to the default at any time using the _Reset Action(s)_ button. You can even bring actions back from the dead by enabling the _Show deleted rows_ check box and then resetting the deleted actions. It is easy to tell which actions have been changed compared with the default: changed entries are rendered bold; deleted actions appear grayed out. + +The power of this approach is best illustrated by an example: The screenshot above shows some modifications that were made to the action list for the gnome-terminal application. Most applications with a tabbed interface use Ctrl+T as a shortcut for opening a tab, but gnome-terminal uses the non-standard Shift+Ctrl+T combination, so that the user can use Ctrl+T to interact with terminal applications. In easystroke, we can simply change the key combination for gnome-terminal to Shift+Ctrl+T without affecting any other applications. Similarly, gnome-terminal doesn't support to reopen a closed tab, so we can simply delete the action from the list. + +If you'd like several application to be have in a similar way, you may combine them to an _Application Group_. All applications belonging to the application group inherit their gestures from the group, which in turn inherits its actions from its parent. Easystroke allows arbitrary trees (with root _Default_) as its hierarchy for applications and groups. + +[[Image(MiscWikiFiles:easystroke-preferences.png)]] + +# Behavior + +'Gesture Button' allows you to choose which button strokes are performed with. The default is the middle button as this is the button that corresponds to the side switch on tablet pens. Note that the left mouse button (on a touch screen or a passive digitizer) works reasonably well, too. + +[Advanced Gestures](FeatureAdvancedGestures) have their own documentation page. + +Since it is hard to perform clicks without any motion on most pointing devices and since it is also difficult to reliably recognize gestures that are too short, easystroke will only treat motions as gestures that have a certain minimum length. This length can be configured using the 'Treat it as a click if the cursor isn't moved more than this many pixels away from the original position' option. + +If you enable the 'Accept gestures when menus are shown' option, easystroke will allow gesturing even when the server is grabbed (which happens when applications display menus and in a few other situations: many compiz plugins do this, too). Note that any clicks you make during a server grab will be passed to the grabbing application, which might result in unexpected behavior, especially if the gesture button is set to the left button. + +In 'Timeout profile' profile combo box, you can set up how fast gestures are timing out, or completely turn off timeouts. Note that you can get advanced timeout options if you start easystroke in experimental mode ("easystroke -e"). + +# Appearance + +The following three methods are available to show strokes on the screen: + * _None_ will disable any feedback when drawing a stroke + * _Default_ will try to use the best method available on your system. On composited desktops this draws (anti-aliased and subpixel-aware) strokes on transparent windows, otherwise it will fall back to the XShape method (see below). + * _XShape_ uses the (old) XShape extension to create a window whose shape is the stroke. This works well on non-composited desktops unless your strokes are very long. + * _Annotate (Compiz)_ communicates with compiz's annotate plugin via compiz. In order for this to work, you need to enable both the 'annotate' and the 'dbus' plugin. Color, thickness and transparency of strokes can be configured in the compizconfig settings manager. + * _Fire (compiz)_ Draws gestures as fire. Requires the firepaint and dbus compiz plugins to be enabled and needs a very recent firepaint version from compiz fusion git. + * _Water (compiz)_ Uses compiz' water plugin to draw gestures. + +If the 'Show popups' option is enabled a small popup will be shown whenever a gesture has been successfully identified. The 'optimized for left-handed operation' option will cause the popup to be shown to the left of the cursor so that left-handed Tablet PC users will be able to see it. + +# Tablet Options + +You should enable the 'Work around timing issues' options if you have a Tablet PC or a wacom tablet and you intend to use the [FeatureAdvancedGestures Advanced Gestures] feature. This will do the right thing if two click events come in at the same time even though you probably clicked the side switch first. + +If the 'Stay in scroll and ignore mode as long as the pen is within range' option is enabled, scroll and ignore mode stay activated until the pen is lifted far enough away from the screen. This is only available on devices that support proximity events such as tablets or Tablet PCs. + +The 'Abort stroke if pressure exceeds the number on the left' option allows you to abort gestures by exerting a certain pressure on the pen. This is only available on devices that support pressure such as tablets or Tablet PCs. + +# Exceptions + +'Exceptions' is a list of applications where easystroke is disabled. For example, you could add 'xournal' to the list in order to be able to use the tablet button as an eraser. + +[[Image(MiscWikiFiles:easystroke-advanced.png)]] + + +[[Image(MiscWikiFiles:easystroke-history.png)]] + +A common problem with gesture applications is the lack of feedback and transparency: If something goes wrong it's hard to tell what action was executed and why and how you can prevent a similar thing from happening in the future. The _Statistics_ tab tries to alleviate this problem by showing a history of the last few strokes and how close easystroke judged them to be to the strokes in the actions list. This might give you a clue which strokes you might have to re-record or replace by something totally different. + +Moreover, the matrix button will show you a complete table of how close the strokes in your database are to each other. It creates a file 'strokes.pdf' in the /tmp directory and then calls evince on it. + +# Experimental Mode + +For a small project like easystroke, it makes little sense to split development up into a stable and a development tree. Nevertheless, some features may take a little more time to develop, be of questionable usefulness or too poorly documented even for my tastes. I'd also like to release early, release often. That's why I've relegated these features to an _experimental mode_, which can only be enabled on the command line by supplying the parameter '-e'. So if you're curious what this is about, be sure to check it out. Don't worry, your computer won't blow up. Comments on whether any of the experimental features are indispensable or completely useless or how they could be improved are always appreciated. + +Finally, a short description of the current experimental features: +* Minimum speed: Specifies the minimum speed that you need to move the pointer with in order for the gesture not to time out. If you don't move the for the amount of time that 'Timeout' is set to, the click is passed along to the application immediately. \ No newline at end of file diff --git a/docs/tips-and-tricks.md b/docs/tips-and-tricks.md new file mode 100644 index 00000000..b09075d8 --- /dev/null +++ b/docs/tips-and-tricks.md @@ -0,0 +1,98 @@ +Configure Tap Zones and use them as buttons and separate scroll wheels. I've detailed it here + +Configure Tap Zones- http://ubuntuforums.org/showthread.php?t=1824870 +Set up tap zones to perform buttons and scroll wheels- http://ubuntuforums.org/showthread.php?t=1859936 + +*Using Easystroke to perform like Scrybe Gesture Workflows — Searching and Shopping* + +First install xsel + + sudo apt-get install xsel + +we will be using a command type + +Example: searching for "obama" in wikipedia +in the command entry type: + + + google-chrome "http://en.wikipedia.org/w/index.php?title=Special:Search&search=`xsel -p | tr [:space:] +`" + + + +now choose a gesture, lets choose a shape `w` + +highlight a word and perform the gesture and you should be there. + +to get any other website search perform a search query "test" in there search engine i,e, youtube +which gives the result +http://www.youtube.com/results?search_query=test&aq=f + +now replace "test" with `xsel -p | tr [:space:] +` (with those little brackets) + +then your command will be + + + google-chrome "http://www.youtube.com/results?search_query=`xsel -p | tr [:space:] +`&aq=f" + + + +make sure you use the brackets for your url. + +any other search engines can be done using this. + +# General + +## Mapping mouse buttons to keyboard shortcuts + +If you have a mouse button that you don't need, you can use easystroke to remap it to any command or keyboard shortcut. Just add the button as an additional button (or use the gesture button if you don't want to use gestures). Since you don't want to use the button for gestures, select "Instant Gestures" on the bottom of the button dialog. To assign an action to the button, just press the button when recording a new gesture. To assign a modifier to the mouse button, you can use the "Ignore" action type. + +## Emulating a scroll wheel using a button + +If you don't have a scroll wheel, you can make easystroke emulate one by pressing a button and moving the cursor. Add the button as an additional button of type "instant gestures" as above, and record a new gesture by clicking the button, then change the action's type to "Scroll". + +## xte +_xte_ is a handy little command-line tool that can emulate key presses and mouse clicks. In Debian/Ubuntu, it can be found in the xautomation package. + +You can use _xte_ to execute a squence of key presses. For example, the following command will go 5 tabs to the right in firefox: + + xte 'keydown Control_L'; for i in `seq 1 5`; do xte 'key Page_Down'; done; xte 'keyup Control_L' + +Here's a command that will enter today's date into a document: + + xte "str `date +%D`" + + +## wmctrl +_wmctrl_ allows you to do various window manager actions from the command line. A useful feature is "wmctrl -a ", which will switch to a window containing the string in the title. For example, to activate a firefox window, and start firefox if there is no such window, use the following command: + + wmctrl -a Firefox || firefox + + +## GUI testing frameworks +GUI testing frameworks such as [dogtail](http://people.redhat.com/zcerza/dogtail/) and [LDTP](http://ldtp.freedesktop.org/wiki/) offer much better control over applications than what is possible by emitting key strokes, but they're also more difficult to use and they also require assistive technologies to be enabled. If you have a good example of what is possible with those tools, please add it here. + +# Wacom Tablet PCs + +## TPCButtons +Turn TPCButtons off, so that you can click the button on your pen without having to tap the pen at the same time. This can be done using the command + + xsetwacom set stylus TPCButton 0 + +or, permanently, by adding the line + + Option "TPCButton" "off" + +to the *last* "InputDevice" section pertaining to your tablet. Note that in order for this to be persistent through suspend or switching VTs, you'll need the latest linuxwacom driver from git ([relevant commit](http://git.debian.org/?p=collab-maint/linux-wacom.git;a=commit;h=4a3811a1c3120b1a50bc2fd6848ea18470ea6465)). See also [FeatureAdvancedGestures]. + +## Don't use Rotate Scripts +There are tons of applications out there that allow you to change screen resolution and rotation. However, as a tablet user you will also need tell the wacom driver to rotate pen input. So people ditch these applications and replace them by something much worse: Custom-made rotate scripts that must be used if you want to your pen to be usable after rotate - very annoying and cumbersome to set up. + +But Xrandr is perfectly capable of notifying applications of screen changes, so a much better solution is to have a tiny daemon that performs the necessary actions whenever the screen is rotated. The wacomrotate daemon is an example of this: It will both rotate the pen and, if you're running gnome, adjust the orientation of subpixel smoothing, which will make fonts less blurry. You can find the source at [github](http://github.com/thjaeger/wacomrotate/tree/master), and packages for jaunty and karmic in one of my [PPAs](https://launchpad.net/~thjaeger/+archive/tabletpc) + +# Useful Tablet PC apps + +These applications have nothing to do with easystroke per se, but I've found them highly valuable, so I'd like to spread the word. + * [xournal](http://xournal.sourceforge.net/) is a great note-taking application. It supports PDF annotation and can take advantage of the full digitizer resolution. + * [cellwriter](http://risujin.org/cellwriter) is a handwriting input panel/onscreen keyboard with a very pleasant and intuitive user interface. + * [Grab and Drag](http://grabanddrag.mozdev.org/) is a firefox add-on that makes scrolling with a pen a breeze. It also works for thunderbird, by the way. + * Many Tablet PCs come with high-resolution displays (145 dpi in case of the x61t and the LE1700) that can cause strain when used at the default font settings. The [NoSquint](http://urandom.ca/nosquint/) firefox extension allows you to set a default zoom setting for all web pages and separate settings for specific sites. \ No newline at end of file diff --git a/docs/translations.md b/docs/translations.md new file mode 100644 index 00000000..1dbeea21 --- /dev/null +++ b/docs/translations.md @@ -0,0 +1,32 @@ +There are two ways to contribute translations to easystroke: + +# Launchpad + +I've set up a launchpad project so that you can edit the translation strings using a simple web interface: + +https://translations.launchpad.net/easystroke/trunk/+pots/easystroke + +Before each release, I will pull in the latest translations from launchpad. + +To test your translations (assuming you're running a recent enough version of easystroke), download the .mo file from launchpad and copy it to /usr/share/locale/??/LC_MESSAGES/easystroke.mo, where ?? represents the language code. + +# Manual + +The downside to the launchpad approach is that you don't immediately see the effects of your translations. You can also directly edit translations in the source: First clone the easystroke repository (as explained in BuildInstructions). If there already is a translation file for your language (po/??.po), you can either edit the file by hand or use an po file editor such as gtranslator. Otherwise you need to base the file off the messages.pot file that can be built by typing 'make translate' (or just ask me to create a .po file for your language). To test your translations, you need to compile the po file ('make compile-translations') and then execute easystroke from the root directory of the repository. + +If you go this route, please check whether launchpad has updated translations first. If that's the case, either download the .po file directly from launchpad and place it in the po directory or ask me to import it into git. + +# Strings that need additional explanation + +## %1 "%2" (containing %3 %4) is about to be deleted +%1 is your translation of "The application" or "The group" + +%2 is the name of the application or group + +%3 is the number of actions + +%4 is your translation of "action"/"actions". + +# Completeness + +Note that I will only import translations into git and include them into official releases if they're reasonably complete. I believe that mixing two languages is more confusing to the user than having the whole interface in a foreign language. In Launchpad, you can tell whether your new translations have been exported by their color: green means the translations are in git, light blue and purple mean they are only in Launchpad. \ No newline at end of file From 118380dfb59286401cafbc9604457f457daeac85 Mon Sep 17 00:00:00 2001 From: AppleBloom Date: Wed, 4 Nov 2015 20:22:56 +0100 Subject: [PATCH 15/22] Add option to toggle easystroke on/off. From https://aur.archlinux.org/packages/easystroke-git --- main.cc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/main.cc b/main.cc index 55d0b3c1..2c783139 100644 --- a/main.cc +++ b/main.cc @@ -315,6 +315,8 @@ int App::on_command_line(const Glib::RefPtr &comman disabled.set(true); } else if (!strcmp(arg[i], "enable")) { disabled.set(false); + } else if (!strcmp(arg[i], "toggle")) { + disabled.set(!disabled.get()); } else if (!strcmp(arg[i], "about")) { win->show_about(); } else if (!strcmp(arg[i], "quit")) { @@ -428,6 +430,7 @@ void App::usage(const char *me) { printf(" hide Hide configuration window\n"); printf(" disable Disable easystroke\n"); printf(" enable Enable easystroke\n"); + printf(" toggle Toggle easystroke\n"); printf(" about Show about dialog\n"); printf(" quit Quit easystroke\n"); printf("\n"); From 563650eb3869a6b5de36de0360e0877aba199182 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kondor=20D=C3=A1niel?= Date: Sat, 22 Sep 2018 22:42:06 +0800 Subject: [PATCH 16/22] fixed recurring crash when trying to render 0x0 tray icon (cherry picked from commit 140b9cae66ba874bf0994eea71210baf417a136e) --- win.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/win.cc b/win.cc index da41b0e8..36746430 100644 --- a/win.cc +++ b/win.cc @@ -275,7 +275,7 @@ void Win::timeout() { } void Win::set_icon(RStroke stroke, bool invert) { - if (!icon) + if (!icon || icon->get_size() <= 0) return; icon->set(stroke->draw(icon->get_size(), 2.0, invert)); set_timeout(10000); From 7a3e68428ea1adf50f43fe7e57a1f5250ca6370f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kondor=20D=C3=A1niel?= Date: Fri, 28 Aug 2020 17:00:02 +0800 Subject: [PATCH 17/22] Fix not being able to select Misc actions (cherry picked from commit 14b2a3726db3af64d5d38e7e2378cfff95e6f417) --- actions.cc | 2 +- cellrenderertextish.c | 842 ++++++++++++++++++++++++--------------- cellrenderertextish.h | 16 +- cellrenderertextish.vala | 10 +- 4 files changed, 549 insertions(+), 321 deletions(-) diff --git a/actions.cc b/actions.cc index 02ba72cb..4e7d9ff3 100644 --- a/actions.cc +++ b/actions.cc @@ -477,7 +477,7 @@ void Actions::on_type_edited(const Glib::ustring &path, const Glib::ustring &new update_actions(); } editing_new = false; - focus(row[cols.id], 3, edit); + if (new_type != MISC) focus(row[cols.id], 3, edit); } void Actions::on_button_delete() { diff --git a/cellrenderertextish.c b/cellrenderertextish.c index e9f4f59e..5bd8b720 100644 --- a/cellrenderertextish.c +++ b/cellrenderertextish.c @@ -1,8 +1,9 @@ -/* cellrenderertextish.c generated by valac 0.18.1, the Vala compiler +/* cellrenderertextish.c generated by valac 0.40.23, the Vala compiler * generated from cellrenderertextish.vala, do not modify */ /* compile with valac -c cellrenderertextish.vala --pkg gtk+-3.0 -C -H cellrenderertextish.h */ + #include #include #include @@ -22,8 +23,20 @@ typedef struct _CellRendererTextish CellRendererTextish; typedef struct _CellRendererTextishClass CellRendererTextishClass; typedef struct _CellRendererTextishPrivate CellRendererTextishPrivate; +typedef enum { + CELL_RENDERER_TEXTISH_MODE_Text, + CELL_RENDERER_TEXTISH_MODE_Key, + CELL_RENDERER_TEXTISH_MODE_Popup, + CELL_RENDERER_TEXTISH_MODE_Combo +} CellRendererTextishMode; + #define CELL_RENDERER_TEXTISH_TYPE_MODE (cell_renderer_textish_mode_get_type ()) +enum { + CELL_RENDERER_TEXTISH_0_PROPERTY, + CELL_RENDERER_TEXTISH_NUM_PROPERTIES +}; +static GParamSpec* cell_renderer_textish_properties[CELL_RENDERER_TEXTISH_NUM_PROPERTIES]; #define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL))) #define TYPE_CELL_EDITABLE_ACCEL (cell_editable_accel_get_type ()) @@ -55,19 +68,35 @@ typedef struct _CellEditableComboClass CellEditableComboClass; typedef struct _CellEditableDummy CellEditableDummy; typedef struct _CellEditableDummyClass CellEditableDummyClass; +enum { + CELL_RENDERER_TEXTISH_KEY_EDITED_SIGNAL, + CELL_RENDERER_TEXTISH_COMBO_EDITED_SIGNAL, + CELL_RENDERER_TEXTISH_NUM_SIGNALS +}; +static guint cell_renderer_textish_signals[CELL_RENDERER_TEXTISH_NUM_SIGNALS] = {0}; typedef struct _CellEditableDummyPrivate CellEditableDummyPrivate; +enum { + CELL_EDITABLE_DUMMY_0_PROPERTY, + CELL_EDITABLE_DUMMY_EDITING_CANCELED_PROPERTY, + CELL_EDITABLE_DUMMY_NUM_PROPERTIES +}; +static GParamSpec* cell_editable_dummy_properties[CELL_EDITABLE_DUMMY_NUM_PROPERTIES]; typedef struct _CellEditableAccelPrivate CellEditableAccelPrivate; +enum { + CELL_EDITABLE_ACCEL_0_PROPERTY, + CELL_EDITABLE_ACCEL_EDITING_CANCELED_PROPERTY, + CELL_EDITABLE_ACCEL_NUM_PROPERTIES +}; +static GParamSpec* cell_editable_accel_properties[CELL_EDITABLE_ACCEL_NUM_PROPERTIES]; #define _g_free0(var) (var = (g_free (var), NULL)) typedef struct _CellEditableComboPrivate CellEditableComboPrivate; +enum { + CELL_EDITABLE_COMBO_0_PROPERTY, + CELL_EDITABLE_COMBO_NUM_PROPERTIES +}; +static GParamSpec* cell_editable_combo_properties[CELL_EDITABLE_COMBO_NUM_PROPERTIES]; typedef struct _Block1Data Block1Data; -typedef enum { - CELL_RENDERER_TEXTISH_MODE_Text, - CELL_RENDERER_TEXTISH_MODE_Key, - CELL_RENDERER_TEXTISH_MODE_Popup, - CELL_RENDERER_TEXTISH_MODE_Combo -} CellRendererTextishMode; - struct _CellRendererTextish { GtkCellRendererText parent_instance; CellRendererTextishPrivate * priv; @@ -121,6 +150,7 @@ struct _CellEditableCombo { struct _CellEditableComboClass { GtkComboBoxTextClass parent_class; + void (*start_editing) (CellEditableCombo* self, GdkEvent* event); }; struct _CellEditableComboPrivate { @@ -130,7 +160,7 @@ struct _CellEditableComboPrivate { struct _Block1Data { int _ref_count_; - CellEditableCombo * self; + CellEditableCombo* self; CellRendererTextish* parent; gchar* path; }; @@ -138,77 +168,131 @@ struct _Block1Data { static gpointer cell_renderer_textish_parent_class = NULL; static gpointer cell_editable_dummy_parent_class = NULL; -static GtkCellEditableIface* cell_editable_dummy_gtk_cell_editable_parent_iface = NULL; +static GtkCellEditableIface * cell_editable_dummy_gtk_cell_editable_parent_iface = NULL; static gpointer cell_editable_accel_parent_class = NULL; -static GtkCellEditableIface* cell_editable_accel_gtk_cell_editable_parent_iface = NULL; +static GtkCellEditableIface * cell_editable_accel_gtk_cell_editable_parent_iface = NULL; static gpointer cell_editable_combo_parent_class = NULL; +static GtkCellEditableIface * cell_editable_combo_gtk_cell_editable_parent_iface = NULL; GType cell_renderer_textish_get_type (void) G_GNUC_CONST; GType cell_renderer_textish_mode_get_type (void) G_GNUC_CONST; #define CELL_RENDERER_TEXTISH_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), TYPE_CELL_RENDERER_TEXTISH, CellRendererTextishPrivate)) -enum { - CELL_RENDERER_TEXTISH_DUMMY_PROPERTY -}; CellRendererTextish* cell_renderer_textish_new (void); CellRendererTextish* cell_renderer_textish_construct (GType object_type); -CellRendererTextish* cell_renderer_textish_new_with_items (gchar** items, int items_length1); -CellRendererTextish* cell_renderer_textish_construct_with_items (GType object_type, gchar** items, int items_length1); -static gchar** _vala_array_dup1 (gchar** self, int length); -static GtkCellEditable* cell_renderer_textish_real_start_editing (GtkCellRenderer* base, GdkEvent* event, GtkWidget* widget, const gchar* path, GdkRectangle* background_area, GdkRectangle* cell_area, GtkCellRendererState flags); -CellEditableAccel* cell_editable_accel_new (CellRendererTextish* parent, const gchar* path, GtkWidget* widget); -CellEditableAccel* cell_editable_accel_construct (GType object_type, CellRendererTextish* parent, const gchar* path, GtkWidget* widget); +CellRendererTextish* cell_renderer_textish_new_with_items (gchar** items, + int items_length1); +CellRendererTextish* cell_renderer_textish_construct_with_items (GType object_type, + gchar** items, + int items_length1); +static gchar** _vala_array_dup1 (gchar** self, + int length); +static GtkCellEditable* cell_renderer_textish_real_start_editing (GtkCellRenderer* base, + GdkEvent* event, + GtkWidget* widget, + const gchar* path, + GdkRectangle* background_area, + GdkRectangle* cell_area, + GtkCellRendererState flags); +CellEditableAccel* cell_editable_accel_new (CellRendererTextish* parent, + const gchar* path, + GtkWidget* widget); +CellEditableAccel* cell_editable_accel_construct (GType object_type, + CellRendererTextish* parent, + const gchar* path, + GtkWidget* widget); GType cell_editable_accel_get_type (void) G_GNUC_CONST; -CellEditableCombo* cell_editable_combo_new (CellRendererTextish* parent, const gchar* path, GtkWidget* widget, gchar** items, int items_length1); -CellEditableCombo* cell_editable_combo_construct (GType object_type, CellRendererTextish* parent, const gchar* path, GtkWidget* widget, gchar** items, int items_length1); +CellEditableCombo* cell_editable_combo_new (CellRendererTextish* parent, + const gchar* path, + GtkWidget* widget, + gchar** items, + int items_length1); +CellEditableCombo* cell_editable_combo_construct (GType object_type, + CellRendererTextish* parent, + const gchar* path, + GtkWidget* widget, + gchar** items, + int items_length1); GType cell_editable_combo_get_type (void) G_GNUC_CONST; CellEditableDummy* cell_editable_dummy_new (void); CellEditableDummy* cell_editable_dummy_construct (GType object_type); GType cell_editable_dummy_get_type (void) G_GNUC_CONST; -static void g_cclosure_user_marshal_VOID__STRING_FLAGS_UINT (GClosure * closure, GValue * return_value, guint n_param_values, const GValue * param_values, gpointer invocation_hint, gpointer marshal_data); -static void g_cclosure_user_marshal_VOID__STRING_UINT (GClosure * closure, GValue * return_value, guint n_param_values, const GValue * param_values, gpointer invocation_hint, gpointer marshal_data); -static void cell_renderer_textish_finalize (GObject* obj); +static void g_cclosure_user_marshal_VOID__STRING_FLAGS_UINT (GClosure * closure, + GValue * return_value, + guint n_param_values, + const GValue * param_values, + gpointer invocation_hint, + gpointer marshal_data); +static void g_cclosure_user_marshal_VOID__STRING_UINT (GClosure * closure, + GValue * return_value, + guint n_param_values, + const GValue * param_values, + gpointer invocation_hint, + gpointer marshal_data); +static void cell_renderer_textish_finalize (GObject * obj); #define CELL_EDITABLE_DUMMY_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), TYPE_CELL_EDITABLE_DUMMY, CellEditableDummyPrivate)) -enum { - CELL_EDITABLE_DUMMY_DUMMY_PROPERTY, - CELL_EDITABLE_DUMMY_EDITING_CANCELED -}; -void cell_editable_dummy_start_editing (CellEditableDummy* self, GdkEvent* event); -static void cell_editable_dummy_real_start_editing (CellEditableDummy* self, GdkEvent* event); +void cell_editable_dummy_start_editing (CellEditableDummy* self, + GdkEvent* event); +static void cell_editable_dummy_real_start_editing (CellEditableDummy* self, + GdkEvent* event); gboolean cell_editable_dummy_get_editing_canceled (CellEditableDummy* self); -void cell_editable_dummy_set_editing_canceled (CellEditableDummy* self, gboolean value); -static void cell_editable_dummy_finalize (GObject* obj); -static void _vala_cell_editable_dummy_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec); -static void _vala_cell_editable_dummy_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec); +void cell_editable_dummy_set_editing_canceled (CellEditableDummy* self, + gboolean value); +static void cell_editable_dummy_finalize (GObject * obj); +static void _vala_cell_editable_dummy_get_property (GObject * object, + guint property_id, + GValue * value, + GParamSpec * pspec); +static void _vala_cell_editable_dummy_set_property (GObject * object, + guint property_id, + const GValue * value, + GParamSpec * pspec); #define CELL_EDITABLE_ACCEL_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), TYPE_CELL_EDITABLE_ACCEL, CellEditableAccelPrivate)) -enum { - CELL_EDITABLE_ACCEL_DUMMY_PROPERTY, - CELL_EDITABLE_ACCEL_EDITING_CANCELED -}; static void cell_editable_accel_on_editing_done (CellEditableAccel* self); -static void _cell_editable_accel_on_editing_done_gtk_cell_editable_editing_done (GtkCellEditable* _sender, gpointer self); -void cell_editable_accel_start_editing (CellEditableAccel* self, GdkEvent* event); -static void cell_editable_accel_real_start_editing (CellEditableAccel* self, GdkEvent* event); -static gboolean cell_editable_accel_on_key (CellEditableAccel* self, GdkEventKey* event); -static gboolean _cell_editable_accel_on_key_gtk_widget_key_press_event (GtkWidget* _sender, GdkEventKey* event, gpointer self); +static void _cell_editable_accel_on_editing_done_gtk_cell_editable_editing_done (GtkCellEditable* _sender, + gpointer self); +void cell_editable_accel_start_editing (CellEditableAccel* self, + GdkEvent* event); +static void cell_editable_accel_real_start_editing (CellEditableAccel* self, + GdkEvent* event); +static gboolean cell_editable_accel_on_key (CellEditableAccel* self, + GdkEventKey* event); +static gboolean _cell_editable_accel_on_key_gtk_widget_key_press_event (GtkWidget* _sender, + GdkEventKey* event, + gpointer self); gboolean cell_editable_accel_get_editing_canceled (CellEditableAccel* self); -void cell_editable_accel_set_editing_canceled (CellEditableAccel* self, gboolean value); -static void cell_editable_accel_finalize (GObject* obj); -static void _vala_cell_editable_accel_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec); -static void _vala_cell_editable_accel_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec); +void cell_editable_accel_set_editing_canceled (CellEditableAccel* self, + gboolean value); +static void cell_editable_accel_finalize (GObject * obj); +static void _vala_cell_editable_accel_get_property (GObject * object, + guint property_id, + GValue * value, + GParamSpec * pspec); +static void _vala_cell_editable_accel_set_property (GObject * object, + guint property_id, + const GValue * value, + GParamSpec * pspec); #define CELL_EDITABLE_COMBO_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), TYPE_CELL_EDITABLE_COMBO, CellEditableComboPrivate)) -enum { - CELL_EDITABLE_COMBO_DUMMY_PROPERTY -}; static Block1Data* block1_data_ref (Block1Data* _data1_); static void block1_data_unref (void * _userdata_); -static void __lambda2_ (Block1Data* _data1_); -static void ___lambda2__gtk_combo_box_changed (GtkComboBox* _sender, gpointer self); -static void cell_editable_combo_finalize (GObject* obj); -static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func); -static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify destroy_func); - - -GType cell_renderer_textish_mode_get_type (void) { +static void __lambda4_ (Block1Data* _data1_); +static void ___lambda4__gtk_combo_box_changed (GtkComboBox* _sender, + gpointer self); +void cell_editable_combo_start_editing (CellEditableCombo* self, + GdkEvent* event); +static void cell_editable_combo_real_start_editing (CellEditableCombo* self, + GdkEvent* event); +static void cell_editable_combo_finalize (GObject * obj); +static void _vala_array_destroy (gpointer array, + gint array_length, + GDestroyNotify destroy_func); +static void _vala_array_free (gpointer array, + gint array_length, + GDestroyNotify destroy_func); + + +GType +cell_renderer_textish_mode_get_type (void) +{ static volatile gsize cell_renderer_textish_mode_type_id__volatile = 0; if (g_once_init_enter (&cell_renderer_textish_mode_type_id__volatile)) { static const GEnumValue values[] = {{CELL_RENDERER_TEXTISH_MODE_Text, "CELL_RENDERER_TEXTISH_MODE_Text", "text"}, {CELL_RENDERER_TEXTISH_MODE_Key, "CELL_RENDERER_TEXTISH_MODE_Key", "key"}, {CELL_RENDERER_TEXTISH_MODE_Popup, "CELL_RENDERER_TEXTISH_MODE_Popup", "popup"}, {CELL_RENDERER_TEXTISH_MODE_Combo, "CELL_RENDERER_TEXTISH_MODE_Combo", "combo"}, {0, NULL, NULL}}; @@ -220,7 +304,9 @@ GType cell_renderer_textish_mode_get_type (void) { } -CellRendererTextish* cell_renderer_textish_construct (GType object_type) { +CellRendererTextish* +cell_renderer_textish_construct (GType object_type) +{ CellRendererTextish * self = NULL; self = (CellRendererTextish*) g_object_new (object_type, NULL); self->mode = CELL_RENDERER_TEXTISH_MODE_Text; @@ -233,12 +319,17 @@ CellRendererTextish* cell_renderer_textish_construct (GType object_type) { } -CellRendererTextish* cell_renderer_textish_new (void) { +CellRendererTextish* +cell_renderer_textish_new (void) +{ return cell_renderer_textish_construct (TYPE_CELL_RENDERER_TEXTISH); } -static gchar** _vala_array_dup1 (gchar** self, int length) { +static gchar** +_vala_array_dup1 (gchar** self, + int length) +{ gchar** result; int i; result = g_new0 (gchar*, length + 1); @@ -251,44 +342,57 @@ static gchar** _vala_array_dup1 (gchar** self, int length) { } -CellRendererTextish* cell_renderer_textish_construct_with_items (GType object_type, gchar** items, int items_length1) { +CellRendererTextish* +cell_renderer_textish_construct_with_items (GType object_type, + gchar** items, + int items_length1) +{ CellRendererTextish * self = NULL; gchar** _tmp0_; gint _tmp0__length1; - gchar** _tmp1_; - gint _tmp1__length1; self = (CellRendererTextish*) g_object_new (object_type, NULL); self->mode = CELL_RENDERER_TEXTISH_MODE_Text; _g_object_unref0 (self->priv->cell); self->priv->cell = NULL; - _tmp0_ = items; + _tmp0_ = (items != NULL) ? _vala_array_dup1 (items, items_length1) : ((gpointer) items); _tmp0__length1 = items_length1; - _tmp1_ = (_tmp0_ != NULL) ? _vala_array_dup1 (_tmp0_, _tmp0__length1) : ((gpointer) _tmp0_); - _tmp1__length1 = _tmp0__length1; self->items = (_vala_array_free (self->items, self->items_length1, (GDestroyNotify) g_free), NULL); - self->items = _tmp1_; - self->items_length1 = _tmp1__length1; + self->items = _tmp0_; + self->items_length1 = _tmp0__length1; return self; } -CellRendererTextish* cell_renderer_textish_new_with_items (gchar** items, int items_length1) { +CellRendererTextish* +cell_renderer_textish_new_with_items (gchar** items, + int items_length1) +{ return cell_renderer_textish_construct_with_items (TYPE_CELL_RENDERER_TEXTISH, items, items_length1); } -static gpointer _g_object_ref0 (gpointer self) { +static gpointer +_g_object_ref0 (gpointer self) +{ return self ? g_object_ref (self) : NULL; } -static GtkCellEditable* cell_renderer_textish_real_start_editing (GtkCellRenderer* base, GdkEvent* event, GtkWidget* widget, const gchar* path, GdkRectangle* background_area, GdkRectangle* cell_area, GtkCellRendererState flags) { +static GtkCellEditable* +cell_renderer_textish_real_start_editing (GtkCellRenderer* base, + GdkEvent* event, + GtkWidget* widget, + const gchar* path, + GdkRectangle* background_area, + GdkRectangle* cell_area, + GtkCellRendererState flags) +{ CellRendererTextish * self; GtkCellEditable* result = NULL; - gboolean _tmp0_ = FALSE; + gboolean _tmp0_; gboolean _tmp1_; CellRendererTextishMode _tmp3_; - GtkCellEditable* _tmp20_; + GtkCellEditable* _tmp12_; self = (CellRendererTextish*) base; g_return_val_if_fail (widget != NULL, NULL); g_return_val_if_fail (path != NULL, NULL); @@ -308,76 +412,67 @@ static GtkCellEditable* cell_renderer_textish_real_start_editing (GtkCellRendere switch (_tmp3_) { case CELL_RENDERER_TEXTISH_MODE_Text: { - GdkEvent* _tmp4_; - GtkWidget* _tmp5_; - const gchar* _tmp6_; - GdkRectangle _tmp7_; - GdkRectangle _tmp8_; - GtkCellRendererState _tmp9_; - GtkCellEditable* _tmp10_ = NULL; - GtkCellEditable* _tmp11_; - _tmp4_ = event; - _tmp5_ = widget; - _tmp6_ = path; - _tmp7_ = *background_area; - _tmp8_ = *cell_area; - _tmp9_ = flags; - _tmp10_ = GTK_CELL_RENDERER_CLASS (cell_renderer_textish_parent_class)->start_editing ((GtkCellRenderer*) G_TYPE_CHECK_INSTANCE_CAST (self, GTK_TYPE_CELL_RENDERER_TEXT, GtkCellRendererText), _tmp4_, _tmp5_, _tmp6_, &_tmp7_, &_tmp8_, _tmp9_); - _tmp11_ = _g_object_ref0 (_tmp10_); + GdkRectangle _tmp4_; + GdkRectangle _tmp5_; + GtkCellEditable* _tmp6_; + GtkCellEditable* _tmp7_; + _tmp4_ = *background_area; + _tmp5_ = *cell_area; + _tmp6_ = GTK_CELL_RENDERER_CLASS (cell_renderer_textish_parent_class)->start_editing ((GtkCellRenderer*) G_TYPE_CHECK_INSTANCE_CAST (self, gtk_cell_renderer_text_get_type (), GtkCellRendererText), event, widget, path, &_tmp4_, &_tmp5_, flags); + _tmp7_ = _g_object_ref0 (_tmp6_); _g_object_unref0 (self->priv->cell); - self->priv->cell = _tmp11_; + self->priv->cell = _tmp7_; break; } case CELL_RENDERER_TEXTISH_MODE_Key: { - const gchar* _tmp12_; - GtkWidget* _tmp13_; - CellEditableAccel* _tmp14_; - _tmp12_ = path; - _tmp13_ = widget; - _tmp14_ = cell_editable_accel_new (self, _tmp12_, _tmp13_); - g_object_ref_sink (_tmp14_); + CellEditableAccel* _tmp8_; + _tmp8_ = cell_editable_accel_new (self, path, widget); + g_object_ref_sink (_tmp8_); _g_object_unref0 (self->priv->cell); - self->priv->cell = (GtkCellEditable*) _tmp14_; + self->priv->cell = (GtkCellEditable*) _tmp8_; break; } case CELL_RENDERER_TEXTISH_MODE_Combo: { - const gchar* _tmp15_; - GtkWidget* _tmp16_; - gchar** _tmp17_; - gint _tmp17__length1; - CellEditableCombo* _tmp18_; - _tmp15_ = path; - _tmp16_ = widget; - _tmp17_ = self->items; - _tmp17__length1 = self->items_length1; - _tmp18_ = cell_editable_combo_new (self, _tmp15_, _tmp16_, _tmp17_, _tmp17__length1); - g_object_ref_sink (_tmp18_); + gchar** _tmp9_; + gint _tmp9__length1; + CellEditableCombo* _tmp10_; + _tmp9_ = self->items; + _tmp9__length1 = self->items_length1; + _tmp10_ = cell_editable_combo_new (self, path, widget, _tmp9_, _tmp9__length1); + g_object_ref_sink (_tmp10_); _g_object_unref0 (self->priv->cell); - self->priv->cell = (GtkCellEditable*) _tmp18_; + self->priv->cell = (GtkCellEditable*) _tmp10_; break; } case CELL_RENDERER_TEXTISH_MODE_Popup: { - CellEditableDummy* _tmp19_; - _tmp19_ = cell_editable_dummy_new (); - g_object_ref_sink (_tmp19_); + CellEditableDummy* _tmp11_; + _tmp11_ = cell_editable_dummy_new (); + g_object_ref_sink (_tmp11_); _g_object_unref0 (self->priv->cell); - self->priv->cell = (GtkCellEditable*) _tmp19_; + self->priv->cell = (GtkCellEditable*) _tmp11_; break; } default: break; } - _tmp20_ = self->priv->cell; - result = _tmp20_; + _tmp12_ = self->priv->cell; + result = _tmp12_; return result; } -static void g_cclosure_user_marshal_VOID__STRING_FLAGS_UINT (GClosure * closure, GValue * return_value, guint n_param_values, const GValue * param_values, gpointer invocation_hint, gpointer marshal_data) { - typedef void (*GMarshalFunc_VOID__STRING_FLAGS_UINT) (gpointer data1, const char* arg_1, gint arg_2, guint arg_3, gpointer data2); +static void +g_cclosure_user_marshal_VOID__STRING_FLAGS_UINT (GClosure * closure, + GValue * return_value, + guint n_param_values, + const GValue * param_values, + gpointer invocation_hint, + gpointer marshal_data) +{ + typedef void (*GMarshalFunc_VOID__STRING_FLAGS_UINT) (gpointer data1, const char* arg_1, guint arg_2, guint arg_3, gpointer data2); register GMarshalFunc_VOID__STRING_FLAGS_UINT callback; register GCClosure * cc; register gpointer data1; @@ -396,7 +491,14 @@ static void g_cclosure_user_marshal_VOID__STRING_FLAGS_UINT (GClosure * closure, } -static void g_cclosure_user_marshal_VOID__STRING_UINT (GClosure * closure, GValue * return_value, guint n_param_values, const GValue * param_values, gpointer invocation_hint, gpointer marshal_data) { +static void +g_cclosure_user_marshal_VOID__STRING_UINT (GClosure * closure, + GValue * return_value, + guint n_param_values, + const GValue * param_values, + gpointer invocation_hint, + gpointer marshal_data) +{ typedef void (*GMarshalFunc_VOID__STRING_UINT) (gpointer data1, const char* arg_1, guint arg_2, gpointer data2); register GMarshalFunc_VOID__STRING_UINT callback; register GCClosure * cc; @@ -416,22 +518,28 @@ static void g_cclosure_user_marshal_VOID__STRING_UINT (GClosure * closure, GValu } -static void cell_renderer_textish_class_init (CellRendererTextishClass * klass) { +static void +cell_renderer_textish_class_init (CellRendererTextishClass * klass) +{ cell_renderer_textish_parent_class = g_type_class_peek_parent (klass); g_type_class_add_private (klass, sizeof (CellRendererTextishPrivate)); - GTK_CELL_RENDERER_CLASS (klass)->start_editing = cell_renderer_textish_real_start_editing; + ((GtkCellRendererClass *) klass)->start_editing = (GtkCellEditable* (*) (GtkCellRenderer*, GdkEvent*, GtkWidget*, const gchar*, GdkRectangle*, GdkRectangle*, GtkCellRendererState)) cell_renderer_textish_real_start_editing; G_OBJECT_CLASS (klass)->finalize = cell_renderer_textish_finalize; - g_signal_new ("key_edited", TYPE_CELL_RENDERER_TEXTISH, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_user_marshal_VOID__STRING_FLAGS_UINT, G_TYPE_NONE, 3, G_TYPE_STRING, gdk_modifier_type_get_type (), G_TYPE_UINT); - g_signal_new ("combo_edited", TYPE_CELL_RENDERER_TEXTISH, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_user_marshal_VOID__STRING_UINT, G_TYPE_NONE, 2, G_TYPE_STRING, G_TYPE_UINT); + cell_renderer_textish_signals[CELL_RENDERER_TEXTISH_KEY_EDITED_SIGNAL] = g_signal_new ("key-edited", TYPE_CELL_RENDERER_TEXTISH, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_user_marshal_VOID__STRING_FLAGS_UINT, G_TYPE_NONE, 3, G_TYPE_STRING, gdk_modifier_type_get_type (), G_TYPE_UINT); + cell_renderer_textish_signals[CELL_RENDERER_TEXTISH_COMBO_EDITED_SIGNAL] = g_signal_new ("combo-edited", TYPE_CELL_RENDERER_TEXTISH, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_user_marshal_VOID__STRING_UINT, G_TYPE_NONE, 2, G_TYPE_STRING, G_TYPE_UINT); } -static void cell_renderer_textish_instance_init (CellRendererTextish * self) { +static void +cell_renderer_textish_instance_init (CellRendererTextish * self) +{ self->priv = CELL_RENDERER_TEXTISH_GET_PRIVATE (self); } -static void cell_renderer_textish_finalize (GObject* obj) { +static void +cell_renderer_textish_finalize (GObject * obj) +{ CellRendererTextish * self; self = G_TYPE_CHECK_INSTANCE_CAST (obj, TYPE_CELL_RENDERER_TEXTISH, CellRendererTextish); self->items = (_vala_array_free (self->items, self->items_length1, (GDestroyNotify) g_free), NULL); @@ -440,43 +548,57 @@ static void cell_renderer_textish_finalize (GObject* obj) { } -GType cell_renderer_textish_get_type (void) { +GType +cell_renderer_textish_get_type (void) +{ static volatile gsize cell_renderer_textish_type_id__volatile = 0; if (g_once_init_enter (&cell_renderer_textish_type_id__volatile)) { static const GTypeInfo g_define_type_info = { sizeof (CellRendererTextishClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) cell_renderer_textish_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (CellRendererTextish), 0, (GInstanceInitFunc) cell_renderer_textish_instance_init, NULL }; GType cell_renderer_textish_type_id; - cell_renderer_textish_type_id = g_type_register_static (GTK_TYPE_CELL_RENDERER_TEXT, "CellRendererTextish", &g_define_type_info, 0); + cell_renderer_textish_type_id = g_type_register_static (gtk_cell_renderer_text_get_type (), "CellRendererTextish", &g_define_type_info, 0); g_once_init_leave (&cell_renderer_textish_type_id__volatile, cell_renderer_textish_type_id); } return cell_renderer_textish_type_id__volatile; } -static void cell_editable_dummy_real_start_editing (CellEditableDummy* self, GdkEvent* event) { +static void +cell_editable_dummy_real_start_editing (CellEditableDummy* self, + GdkEvent* event) +{ gtk_cell_editable_editing_done ((GtkCellEditable*) self); gtk_cell_editable_remove_widget ((GtkCellEditable*) self); } -void cell_editable_dummy_start_editing (CellEditableDummy* self, GdkEvent* event) { +void +cell_editable_dummy_start_editing (CellEditableDummy* self, + GdkEvent* event) +{ g_return_if_fail (self != NULL); CELL_EDITABLE_DUMMY_GET_CLASS (self)->start_editing (self, event); } -CellEditableDummy* cell_editable_dummy_construct (GType object_type) { +CellEditableDummy* +cell_editable_dummy_construct (GType object_type) +{ CellEditableDummy * self = NULL; self = (CellEditableDummy*) g_object_new (object_type, NULL); return self; } -CellEditableDummy* cell_editable_dummy_new (void) { +CellEditableDummy* +cell_editable_dummy_new (void) +{ return cell_editable_dummy_construct (TYPE_CELL_EDITABLE_DUMMY); } -gboolean cell_editable_dummy_get_editing_canceled (CellEditableDummy* self) { +gboolean +cell_editable_dummy_get_editing_canceled (CellEditableDummy* self) +{ gboolean result; gboolean _tmp0_; g_return_val_if_fail (self != NULL, FALSE); @@ -486,63 +608,81 @@ gboolean cell_editable_dummy_get_editing_canceled (CellEditableDummy* self) { } -void cell_editable_dummy_set_editing_canceled (CellEditableDummy* self, gboolean value) { - gboolean _tmp0_; +void +cell_editable_dummy_set_editing_canceled (CellEditableDummy* self, + gboolean value) +{ g_return_if_fail (self != NULL); - _tmp0_ = value; - self->priv->_editing_canceled = _tmp0_; - g_object_notify ((GObject *) self, "editing-canceled"); + if (cell_editable_dummy_get_editing_canceled (self) != value) { + self->priv->_editing_canceled = value; + g_object_notify_by_pspec ((GObject *) self, cell_editable_dummy_properties[CELL_EDITABLE_DUMMY_EDITING_CANCELED_PROPERTY]); + } } -static void cell_editable_dummy_class_init (CellEditableDummyClass * klass) { +static void +cell_editable_dummy_class_init (CellEditableDummyClass * klass) +{ cell_editable_dummy_parent_class = g_type_class_peek_parent (klass); g_type_class_add_private (klass, sizeof (CellEditableDummyPrivate)); - CELL_EDITABLE_DUMMY_CLASS (klass)->start_editing = cell_editable_dummy_real_start_editing; + ((CellEditableDummyClass *) klass)->start_editing = (void (*) (CellEditableDummy*, GdkEvent*)) cell_editable_dummy_real_start_editing; G_OBJECT_CLASS (klass)->get_property = _vala_cell_editable_dummy_get_property; G_OBJECT_CLASS (klass)->set_property = _vala_cell_editable_dummy_set_property; G_OBJECT_CLASS (klass)->finalize = cell_editable_dummy_finalize; - g_object_class_install_property (G_OBJECT_CLASS (klass), CELL_EDITABLE_DUMMY_EDITING_CANCELED, g_param_spec_boolean ("editing-canceled", "editing-canceled", "editing-canceled", FALSE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE)); + g_object_class_install_property (G_OBJECT_CLASS (klass), CELL_EDITABLE_DUMMY_EDITING_CANCELED_PROPERTY, cell_editable_dummy_properties[CELL_EDITABLE_DUMMY_EDITING_CANCELED_PROPERTY] = g_param_spec_boolean ("editing-canceled", "editing-canceled", "editing-canceled", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE)); } -static void cell_editable_dummy_gtk_cell_editable_interface_init (GtkCellEditableIface * iface) { +static void +cell_editable_dummy_gtk_cell_editable_interface_init (GtkCellEditableIface * iface) +{ cell_editable_dummy_gtk_cell_editable_parent_iface = g_type_interface_peek_parent (iface); - iface->start_editing = (void (*)(GtkCellEditable*, GdkEvent*)) cell_editable_dummy_start_editing; + iface->start_editing = (void (*) (GtkCellEditable*, GdkEvent*)) cell_editable_dummy_start_editing; } -static void cell_editable_dummy_instance_init (CellEditableDummy * self) { +static void +cell_editable_dummy_instance_init (CellEditableDummy * self) +{ self->priv = CELL_EDITABLE_DUMMY_GET_PRIVATE (self); } -static void cell_editable_dummy_finalize (GObject* obj) { +static void +cell_editable_dummy_finalize (GObject * obj) +{ CellEditableDummy * self; self = G_TYPE_CHECK_INSTANCE_CAST (obj, TYPE_CELL_EDITABLE_DUMMY, CellEditableDummy); G_OBJECT_CLASS (cell_editable_dummy_parent_class)->finalize (obj); } -GType cell_editable_dummy_get_type (void) { +GType +cell_editable_dummy_get_type (void) +{ static volatile gsize cell_editable_dummy_type_id__volatile = 0; if (g_once_init_enter (&cell_editable_dummy_type_id__volatile)) { static const GTypeInfo g_define_type_info = { sizeof (CellEditableDummyClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) cell_editable_dummy_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (CellEditableDummy), 0, (GInstanceInitFunc) cell_editable_dummy_instance_init, NULL }; static const GInterfaceInfo gtk_cell_editable_info = { (GInterfaceInitFunc) cell_editable_dummy_gtk_cell_editable_interface_init, (GInterfaceFinalizeFunc) NULL, NULL}; GType cell_editable_dummy_type_id; - cell_editable_dummy_type_id = g_type_register_static (GTK_TYPE_EVENT_BOX, "CellEditableDummy", &g_define_type_info, 0); - g_type_add_interface_static (cell_editable_dummy_type_id, GTK_TYPE_CELL_EDITABLE, >k_cell_editable_info); + cell_editable_dummy_type_id = g_type_register_static (gtk_event_box_get_type (), "CellEditableDummy", &g_define_type_info, 0); + g_type_add_interface_static (cell_editable_dummy_type_id, gtk_cell_editable_get_type (), >k_cell_editable_info); g_once_init_leave (&cell_editable_dummy_type_id__volatile, cell_editable_dummy_type_id); } return cell_editable_dummy_type_id__volatile; } -static void _vala_cell_editable_dummy_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) { +static void +_vala_cell_editable_dummy_get_property (GObject * object, + guint property_id, + GValue * value, + GParamSpec * pspec) +{ CellEditableDummy * self; self = G_TYPE_CHECK_INSTANCE_CAST (object, TYPE_CELL_EDITABLE_DUMMY, CellEditableDummy); switch (property_id) { - case CELL_EDITABLE_DUMMY_EDITING_CANCELED: + case CELL_EDITABLE_DUMMY_EDITING_CANCELED_PROPERTY: g_value_set_boolean (value, cell_editable_dummy_get_editing_canceled (self)); break; default: @@ -552,11 +692,16 @@ static void _vala_cell_editable_dummy_get_property (GObject * object, guint prop } -static void _vala_cell_editable_dummy_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec) { +static void +_vala_cell_editable_dummy_set_property (GObject * object, + guint property_id, + const GValue * value, + GParamSpec * pspec) +{ CellEditableDummy * self; self = G_TYPE_CHECK_INSTANCE_CAST (object, TYPE_CELL_EDITABLE_DUMMY, CellEditableDummy); switch (property_id) { - case CELL_EDITABLE_DUMMY_EDITING_CANCELED: + case CELL_EDITABLE_DUMMY_EDITING_CANCELED_PROPERTY: cell_editable_dummy_set_editing_canceled (self, g_value_get_boolean (value)); break; default: @@ -566,126 +711,126 @@ static void _vala_cell_editable_dummy_set_property (GObject * object, guint prop } -static void _cell_editable_accel_on_editing_done_gtk_cell_editable_editing_done (GtkCellEditable* _sender, gpointer self) { - cell_editable_accel_on_editing_done (self); +static void +_cell_editable_accel_on_editing_done_gtk_cell_editable_editing_done (GtkCellEditable* _sender, + gpointer self) +{ + cell_editable_accel_on_editing_done ((CellEditableAccel*) self); } -CellEditableAccel* cell_editable_accel_construct (GType object_type, CellRendererTextish* parent, const gchar* path, GtkWidget* widget) { +CellEditableAccel* +cell_editable_accel_construct (GType object_type, + CellRendererTextish* parent, + const gchar* path, + GtkWidget* widget) +{ CellEditableAccel * self = NULL; CellRendererTextish* _tmp0_; - CellRendererTextish* _tmp1_; - const gchar* _tmp2_; - gchar* _tmp3_; - const gchar* _tmp4_ = NULL; - GtkLabel* _tmp5_; - GtkLabel* label; - GtkWidget* _tmp6_; - GtkStyleContext* _tmp7_ = NULL; - GdkRGBA _tmp8_ = {0}; - GtkWidget* _tmp9_; - GtkStyleContext* _tmp10_ = NULL; - GdkRGBA _tmp11_ = {0}; + gchar* _tmp1_; + GtkLabel* label = NULL; + GtkLabel* _tmp2_; + GtkStyleContext* _tmp3_; + GdkRGBA _tmp4_ = {0}; + GtkStyleContext* _tmp5_; + GdkRGBA _tmp6_ = {0}; g_return_val_if_fail (parent != NULL, NULL); g_return_val_if_fail (path != NULL, NULL); g_return_val_if_fail (widget != NULL, NULL); self = (CellEditableAccel*) g_object_new (object_type, NULL); - _tmp0_ = parent; - _tmp1_ = _g_object_ref0 (_tmp0_); + _tmp0_ = _g_object_ref0 (parent); _g_object_unref0 (self->priv->parent); - self->priv->parent = _tmp1_; - _tmp2_ = path; - _tmp3_ = g_strdup (_tmp2_); + self->priv->parent = _tmp0_; + _tmp1_ = g_strdup (path); _g_free0 (self->priv->path); - self->priv->path = _tmp3_; + self->priv->path = _tmp1_; g_signal_connect_object ((GtkCellEditable*) self, "editing-done", (GCallback) _cell_editable_accel_on_editing_done_gtk_cell_editable_editing_done, self, 0); - _tmp4_ = _ ("Key combination..."); - _tmp5_ = (GtkLabel*) gtk_label_new (_tmp4_); - g_object_ref_sink (_tmp5_); - label = _tmp5_; + _tmp2_ = (GtkLabel*) gtk_label_new (_ ("Key combination...")); + g_object_ref_sink (_tmp2_); + label = _tmp2_; gtk_misc_set_alignment ((GtkMisc*) label, 0.0f, 0.5f); gtk_container_add ((GtkContainer*) self, (GtkWidget*) label); - _tmp6_ = widget; - _tmp7_ = gtk_widget_get_style_context (_tmp6_); - gtk_style_context_get_background_color (_tmp7_, GTK_STATE_FLAG_SELECTED, &_tmp8_); - gtk_widget_override_background_color ((GtkWidget*) self, GTK_STATE_FLAG_NORMAL, &_tmp8_); - _tmp9_ = widget; - _tmp10_ = gtk_widget_get_style_context (_tmp9_); - gtk_style_context_get_color (_tmp10_, GTK_STATE_FLAG_SELECTED, &_tmp11_); - gtk_widget_override_color ((GtkWidget*) label, GTK_STATE_FLAG_NORMAL, &_tmp11_); + _tmp3_ = gtk_widget_get_style_context (widget); + gtk_style_context_get_background_color (_tmp3_, GTK_STATE_FLAG_SELECTED, &_tmp4_); + gtk_widget_override_background_color ((GtkWidget*) self, GTK_STATE_FLAG_NORMAL, &_tmp4_); + _tmp5_ = gtk_widget_get_style_context (widget); + gtk_style_context_get_color (_tmp5_, GTK_STATE_FLAG_SELECTED, &_tmp6_); + gtk_widget_override_color ((GtkWidget*) label, GTK_STATE_FLAG_NORMAL, &_tmp6_); gtk_widget_show_all ((GtkWidget*) self); _g_object_unref0 (label); return self; } -CellEditableAccel* cell_editable_accel_new (CellRendererTextish* parent, const gchar* path, GtkWidget* widget) { +CellEditableAccel* +cell_editable_accel_new (CellRendererTextish* parent, + const gchar* path, + GtkWidget* widget) +{ return cell_editable_accel_construct (TYPE_CELL_EDITABLE_ACCEL, parent, path, widget); } -static gboolean _cell_editable_accel_on_key_gtk_widget_key_press_event (GtkWidget* _sender, GdkEventKey* event, gpointer self) { +static gboolean +_cell_editable_accel_on_key_gtk_widget_key_press_event (GtkWidget* _sender, + GdkEventKey* event, + gpointer self) +{ gboolean result; - result = cell_editable_accel_on_key (self, event); + result = cell_editable_accel_on_key ((CellEditableAccel*) self, event); return result; } -static void cell_editable_accel_real_start_editing (CellEditableAccel* self, GdkEvent* event) { +static void +cell_editable_accel_real_start_editing (CellEditableAccel* self, + GdkEvent* event) +{ guint32 _tmp0_ = 0U; - GdkEvent* _tmp1_; - GdkWindow* _tmp4_ = NULL; - guint32 _tmp5_; + GdkWindow* _tmp1_; gtk_grab_add ((GtkWidget*) self); - _tmp1_ = event; - if (_tmp1_ != NULL) { - GdkEvent* _tmp2_; - guint32 _tmp3_ = 0U; - _tmp2_ = event; - _tmp3_ = gdk_event_get_time (_tmp2_); - _tmp0_ = _tmp3_; + if (event != NULL) { + _tmp0_ = gdk_event_get_time (event); } else { _tmp0_ = (guint32) GDK_CURRENT_TIME; } - _tmp4_ = gtk_widget_get_window ((GtkWidget*) self); - _tmp5_ = _tmp0_; - gdk_keyboard_grab (_tmp4_, FALSE, _tmp5_); + _tmp1_ = gtk_widget_get_window ((GtkWidget*) self); + gdk_keyboard_grab (_tmp1_, FALSE, _tmp0_); g_signal_connect_object ((GtkWidget*) self, "key-press-event", (GCallback) _cell_editable_accel_on_key_gtk_widget_key_press_event, self, 0); } -void cell_editable_accel_start_editing (CellEditableAccel* self, GdkEvent* event) { +void +cell_editable_accel_start_editing (CellEditableAccel* self, + GdkEvent* event) +{ g_return_if_fail (self != NULL); CELL_EDITABLE_ACCEL_GET_CLASS (self)->start_editing (self, event); } -static gboolean cell_editable_accel_on_key (CellEditableAccel* self, GdkEventKey* event) { +static gboolean +cell_editable_accel_on_key (CellEditableAccel* self, + GdkEventKey* event) +{ gboolean result = FALSE; - GdkEventKey _tmp0_; + guint _tmp0_; guint _tmp1_; - GdkEventKey _tmp2_; - guint _tmp3_; - GdkEventKey _tmp4_; + GdkModifierType mods = 0U; + GdkModifierType _tmp2_; + CellRendererTextish* _tmp3_; + const gchar* _tmp4_; GdkModifierType _tmp5_; - GdkModifierType _tmp6_ = 0; - GdkModifierType mods; - CellRendererTextish* _tmp7_; - const gchar* _tmp8_; - GdkModifierType _tmp9_; - GdkEventKey _tmp10_; - guint16 _tmp11_; + guint16 _tmp6_; g_return_val_if_fail (self != NULL, FALSE); g_return_val_if_fail (event != NULL, FALSE); - _tmp0_ = *event; - _tmp1_ = _tmp0_.is_modifier; - if (_tmp1_ != ((guint) 0)) { + _tmp0_ = event->is_modifier; + if (_tmp0_ != ((guint) 0)) { result = TRUE; return result; } - _tmp2_ = *event; - _tmp3_ = _tmp2_.keyval; - switch (_tmp3_) { + _tmp1_ = event->keyval; + switch (_tmp1_) { case GDK_KEY_Super_L: case GDK_KEY_Super_R: case GDK_KEY_Hyper_L: @@ -697,31 +842,32 @@ static gboolean cell_editable_accel_on_key (CellEditableAccel* self, GdkEventKey default: break; } - _tmp4_ = *event; - _tmp5_ = _tmp4_.state; - _tmp6_ = gtk_accelerator_get_default_mod_mask (); - mods = _tmp5_ & _tmp6_; + _tmp2_ = event->state; + mods = _tmp2_ & gtk_accelerator_get_default_mod_mask (); gtk_cell_editable_editing_done ((GtkCellEditable*) self); gtk_cell_editable_remove_widget ((GtkCellEditable*) self); - _tmp7_ = self->priv->parent; - _tmp8_ = self->priv->path; - _tmp9_ = mods; - _tmp10_ = *event; - _tmp11_ = _tmp10_.hardware_keycode; - g_signal_emit_by_name (_tmp7_, "key-edited", _tmp8_, _tmp9_, (guint) _tmp11_); + _tmp3_ = self->priv->parent; + _tmp4_ = self->priv->path; + _tmp5_ = mods; + _tmp6_ = event->hardware_keycode; + g_signal_emit (_tmp3_, cell_renderer_textish_signals[CELL_RENDERER_TEXTISH_KEY_EDITED_SIGNAL], 0, _tmp4_, _tmp5_, (guint) _tmp6_); result = TRUE; return result; } -static void cell_editable_accel_on_editing_done (CellEditableAccel* self) { +static void +cell_editable_accel_on_editing_done (CellEditableAccel* self) +{ g_return_if_fail (self != NULL); gtk_grab_remove ((GtkWidget*) self); gdk_keyboard_ungrab ((guint32) GDK_CURRENT_TIME); } -gboolean cell_editable_accel_get_editing_canceled (CellEditableAccel* self) { +gboolean +cell_editable_accel_get_editing_canceled (CellEditableAccel* self) +{ gboolean result; gboolean _tmp0_; g_return_val_if_fail (self != NULL, FALSE); @@ -731,38 +877,49 @@ gboolean cell_editable_accel_get_editing_canceled (CellEditableAccel* self) { } -void cell_editable_accel_set_editing_canceled (CellEditableAccel* self, gboolean value) { - gboolean _tmp0_; +void +cell_editable_accel_set_editing_canceled (CellEditableAccel* self, + gboolean value) +{ g_return_if_fail (self != NULL); - _tmp0_ = value; - self->priv->_editing_canceled = _tmp0_; - g_object_notify ((GObject *) self, "editing-canceled"); + if (cell_editable_accel_get_editing_canceled (self) != value) { + self->priv->_editing_canceled = value; + g_object_notify_by_pspec ((GObject *) self, cell_editable_accel_properties[CELL_EDITABLE_ACCEL_EDITING_CANCELED_PROPERTY]); + } } -static void cell_editable_accel_class_init (CellEditableAccelClass * klass) { +static void +cell_editable_accel_class_init (CellEditableAccelClass * klass) +{ cell_editable_accel_parent_class = g_type_class_peek_parent (klass); g_type_class_add_private (klass, sizeof (CellEditableAccelPrivate)); - CELL_EDITABLE_ACCEL_CLASS (klass)->start_editing = cell_editable_accel_real_start_editing; + ((CellEditableAccelClass *) klass)->start_editing = (void (*) (CellEditableAccel*, GdkEvent*)) cell_editable_accel_real_start_editing; G_OBJECT_CLASS (klass)->get_property = _vala_cell_editable_accel_get_property; G_OBJECT_CLASS (klass)->set_property = _vala_cell_editable_accel_set_property; G_OBJECT_CLASS (klass)->finalize = cell_editable_accel_finalize; - g_object_class_install_property (G_OBJECT_CLASS (klass), CELL_EDITABLE_ACCEL_EDITING_CANCELED, g_param_spec_boolean ("editing-canceled", "editing-canceled", "editing-canceled", FALSE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE)); + g_object_class_install_property (G_OBJECT_CLASS (klass), CELL_EDITABLE_ACCEL_EDITING_CANCELED_PROPERTY, cell_editable_accel_properties[CELL_EDITABLE_ACCEL_EDITING_CANCELED_PROPERTY] = g_param_spec_boolean ("editing-canceled", "editing-canceled", "editing-canceled", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE)); } -static void cell_editable_accel_gtk_cell_editable_interface_init (GtkCellEditableIface * iface) { +static void +cell_editable_accel_gtk_cell_editable_interface_init (GtkCellEditableIface * iface) +{ cell_editable_accel_gtk_cell_editable_parent_iface = g_type_interface_peek_parent (iface); - iface->start_editing = (void (*)(GtkCellEditable*, GdkEvent*)) cell_editable_accel_start_editing; + iface->start_editing = (void (*) (GtkCellEditable*, GdkEvent*)) cell_editable_accel_start_editing; } -static void cell_editable_accel_instance_init (CellEditableAccel * self) { +static void +cell_editable_accel_instance_init (CellEditableAccel * self) +{ self->priv = CELL_EDITABLE_ACCEL_GET_PRIVATE (self); } -static void cell_editable_accel_finalize (GObject* obj) { +static void +cell_editable_accel_finalize (GObject * obj) +{ CellEditableAccel * self; self = G_TYPE_CHECK_INSTANCE_CAST (obj, TYPE_CELL_EDITABLE_ACCEL, CellEditableAccel); _g_object_unref0 (self->priv->parent); @@ -771,25 +928,32 @@ static void cell_editable_accel_finalize (GObject* obj) { } -GType cell_editable_accel_get_type (void) { +GType +cell_editable_accel_get_type (void) +{ static volatile gsize cell_editable_accel_type_id__volatile = 0; if (g_once_init_enter (&cell_editable_accel_type_id__volatile)) { static const GTypeInfo g_define_type_info = { sizeof (CellEditableAccelClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) cell_editable_accel_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (CellEditableAccel), 0, (GInstanceInitFunc) cell_editable_accel_instance_init, NULL }; static const GInterfaceInfo gtk_cell_editable_info = { (GInterfaceInitFunc) cell_editable_accel_gtk_cell_editable_interface_init, (GInterfaceFinalizeFunc) NULL, NULL}; GType cell_editable_accel_type_id; - cell_editable_accel_type_id = g_type_register_static (GTK_TYPE_EVENT_BOX, "CellEditableAccel", &g_define_type_info, 0); - g_type_add_interface_static (cell_editable_accel_type_id, GTK_TYPE_CELL_EDITABLE, >k_cell_editable_info); + cell_editable_accel_type_id = g_type_register_static (gtk_event_box_get_type (), "CellEditableAccel", &g_define_type_info, 0); + g_type_add_interface_static (cell_editable_accel_type_id, gtk_cell_editable_get_type (), >k_cell_editable_info); g_once_init_leave (&cell_editable_accel_type_id__volatile, cell_editable_accel_type_id); } return cell_editable_accel_type_id__volatile; } -static void _vala_cell_editable_accel_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) { +static void +_vala_cell_editable_accel_get_property (GObject * object, + guint property_id, + GValue * value, + GParamSpec * pspec) +{ CellEditableAccel * self; self = G_TYPE_CHECK_INSTANCE_CAST (object, TYPE_CELL_EDITABLE_ACCEL, CellEditableAccel); switch (property_id) { - case CELL_EDITABLE_ACCEL_EDITING_CANCELED: + case CELL_EDITABLE_ACCEL_EDITING_CANCELED_PROPERTY: g_value_set_boolean (value, cell_editable_accel_get_editing_canceled (self)); break; default: @@ -799,11 +963,16 @@ static void _vala_cell_editable_accel_get_property (GObject * object, guint prop } -static void _vala_cell_editable_accel_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec) { +static void +_vala_cell_editable_accel_set_property (GObject * object, + guint property_id, + const GValue * value, + GParamSpec * pspec) +{ CellEditableAccel * self; self = G_TYPE_CHECK_INSTANCE_CAST (object, TYPE_CELL_EDITABLE_ACCEL, CellEditableAccel); switch (property_id) { - case CELL_EDITABLE_ACCEL_EDITING_CANCELED: + case CELL_EDITABLE_ACCEL_EDITING_CANCELED_PROPERTY: cell_editable_accel_set_editing_canceled (self, g_value_get_boolean (value)); break; default: @@ -813,17 +982,21 @@ static void _vala_cell_editable_accel_set_property (GObject * object, guint prop } -static Block1Data* block1_data_ref (Block1Data* _data1_) { +static Block1Data* +block1_data_ref (Block1Data* _data1_) +{ g_atomic_int_inc (&_data1_->_ref_count_); return _data1_; } -static void block1_data_unref (void * _userdata_) { +static void +block1_data_unref (void * _userdata_) +{ Block1Data* _data1_; _data1_ = (Block1Data*) _userdata_; if (g_atomic_int_dec_and_test (&_data1_->_ref_count_)) { - CellEditableCombo * self; + CellEditableCombo* self; self = _data1_->self; _g_object_unref0 (_data1_->parent); _g_free0 (_data1_->path); @@ -833,111 +1006,144 @@ static void block1_data_unref (void * _userdata_) { } -static void __lambda2_ (Block1Data* _data1_) { - CellEditableCombo * self; - CellRendererTextish* _tmp0_; - const gchar* _tmp1_; - gint _tmp2_; - gint _tmp3_; +static void +__lambda4_ (Block1Data* _data1_) +{ + CellEditableCombo* self; + gint _tmp0_; + gint _tmp1_; self = _data1_->self; - _tmp0_ = _data1_->parent; - _tmp1_ = _data1_->path; - _tmp2_ = gtk_combo_box_get_active ((GtkComboBox*) self); - _tmp3_ = _tmp2_; - g_signal_emit_by_name (_tmp0_, "combo-edited", _tmp1_, (guint) _tmp3_); + _tmp0_ = gtk_combo_box_get_active ((GtkComboBox*) self); + _tmp1_ = _tmp0_; + g_signal_emit (_data1_->parent, cell_renderer_textish_signals[CELL_RENDERER_TEXTISH_COMBO_EDITED_SIGNAL], 0, _data1_->path, (guint) _tmp1_); } -static void ___lambda2__gtk_combo_box_changed (GtkComboBox* _sender, gpointer self) { - __lambda2_ (self); +static void +___lambda4__gtk_combo_box_changed (GtkComboBox* _sender, + gpointer self) +{ + __lambda4_ (self); } -CellEditableCombo* cell_editable_combo_construct (GType object_type, CellRendererTextish* parent, const gchar* path, GtkWidget* widget, gchar** items, int items_length1) { +CellEditableCombo* +cell_editable_combo_construct (GType object_type, + CellRendererTextish* parent, + const gchar* path, + GtkWidget* widget, + gchar** items, + int items_length1) +{ CellEditableCombo * self = NULL; Block1Data* _data1_; CellRendererTextish* _tmp0_; - CellRendererTextish* _tmp1_; - const gchar* _tmp2_; + gchar* _tmp1_; + CellRendererTextish* _tmp2_; gchar* _tmp3_; - CellRendererTextish* _tmp4_; - CellRendererTextish* _tmp5_; - const gchar* _tmp6_; - gchar* _tmp7_; - gchar** _tmp8_; - gint _tmp8__length1; g_return_val_if_fail (parent != NULL, NULL); g_return_val_if_fail (path != NULL, NULL); g_return_val_if_fail (widget != NULL, NULL); _data1_ = g_slice_new0 (Block1Data); _data1_->_ref_count_ = 1; - _tmp0_ = parent; - _tmp1_ = _g_object_ref0 (_tmp0_); + _tmp0_ = _g_object_ref0 (parent); _g_object_unref0 (_data1_->parent); - _data1_->parent = _tmp1_; - _tmp2_ = path; - _tmp3_ = g_strdup (_tmp2_); + _data1_->parent = _tmp0_; + _tmp1_ = g_strdup (path); _g_free0 (_data1_->path); - _data1_->path = _tmp3_; + _data1_->path = _tmp1_; self = (CellEditableCombo*) g_object_new (object_type, NULL); _data1_->self = g_object_ref (self); - _tmp4_ = _data1_->parent; - _tmp5_ = _g_object_ref0 (_tmp4_); + _tmp2_ = _g_object_ref0 (_data1_->parent); _g_object_unref0 (self->priv->parent); - self->priv->parent = _tmp5_; - _tmp6_ = _data1_->path; - _tmp7_ = g_strdup (_tmp6_); + self->priv->parent = _tmp2_; + _tmp3_ = g_strdup (_data1_->path); _g_free0 (self->priv->path); - self->priv->path = _tmp7_; - _tmp8_ = items; - _tmp8__length1 = items_length1; + self->priv->path = _tmp3_; { gchar** item_collection = NULL; gint item_collection_length1 = 0; gint _item_collection_size_ = 0; gint item_it = 0; - item_collection = _tmp8_; - item_collection_length1 = _tmp8__length1; - for (item_it = 0; item_it < _tmp8__length1; item_it = item_it + 1) { - gchar* _tmp9_; + item_collection = items; + item_collection_length1 = items_length1; + for (item_it = 0; item_it < item_collection_length1; item_it = item_it + 1) { + gchar* _tmp4_; gchar* item = NULL; - _tmp9_ = g_strdup (item_collection[item_it]); - item = _tmp9_; + _tmp4_ = g_strdup (item_collection[item_it]); + item = _tmp4_; { - const gchar* _tmp10_; - const gchar* _tmp11_ = NULL; - _tmp10_ = item; - _tmp11_ = _ (_tmp10_); - gtk_combo_box_text_append_text ((GtkComboBoxText*) self, _tmp11_); + const gchar* _tmp5_; + _tmp5_ = item; + gtk_combo_box_text_append_text ((GtkComboBoxText*) self, _ (_tmp5_)); _g_free0 (item); } } } - g_signal_connect_data ((GtkComboBox*) self, "changed", (GCallback) ___lambda2__gtk_combo_box_changed, block1_data_ref (_data1_), (GClosureNotify) block1_data_unref, 0); + g_signal_connect_data ((GtkComboBox*) self, "changed", (GCallback) ___lambda4__gtk_combo_box_changed, block1_data_ref (_data1_), (GClosureNotify) block1_data_unref, 0); block1_data_unref (_data1_); _data1_ = NULL; return self; } -CellEditableCombo* cell_editable_combo_new (CellRendererTextish* parent, const gchar* path, GtkWidget* widget, gchar** items, int items_length1) { +CellEditableCombo* +cell_editable_combo_new (CellRendererTextish* parent, + const gchar* path, + GtkWidget* widget, + gchar** items, + int items_length1) +{ return cell_editable_combo_construct (TYPE_CELL_EDITABLE_COMBO, parent, path, widget, items, items_length1); } -static void cell_editable_combo_class_init (CellEditableComboClass * klass) { +static void +cell_editable_combo_real_start_editing (CellEditableCombo* self, + GdkEvent* event) +{ + cell_editable_combo_gtk_cell_editable_parent_iface->start_editing ((GtkCellEditable*) G_TYPE_CHECK_INSTANCE_CAST (self, gtk_combo_box_text_get_type (), GtkComboBoxText), event); + gtk_widget_show_all ((GtkWidget*) self); +} + + +void +cell_editable_combo_start_editing (CellEditableCombo* self, + GdkEvent* event) +{ + g_return_if_fail (self != NULL); + CELL_EDITABLE_COMBO_GET_CLASS (self)->start_editing (self, event); +} + + +static void +cell_editable_combo_class_init (CellEditableComboClass * klass) +{ cell_editable_combo_parent_class = g_type_class_peek_parent (klass); g_type_class_add_private (klass, sizeof (CellEditableComboPrivate)); + ((CellEditableComboClass *) klass)->start_editing = (void (*) (CellEditableCombo*, GdkEvent*)) cell_editable_combo_real_start_editing; G_OBJECT_CLASS (klass)->finalize = cell_editable_combo_finalize; } -static void cell_editable_combo_instance_init (CellEditableCombo * self) { +static void +cell_editable_combo_gtk_cell_editable_interface_init (GtkCellEditableIface * iface) +{ + cell_editable_combo_gtk_cell_editable_parent_iface = g_type_interface_peek_parent (iface); + iface->start_editing = (void (*) (GtkCellEditable*, GdkEvent*)) cell_editable_combo_start_editing; +} + + +static void +cell_editable_combo_instance_init (CellEditableCombo * self) +{ self->priv = CELL_EDITABLE_COMBO_GET_PRIVATE (self); } -static void cell_editable_combo_finalize (GObject* obj) { +static void +cell_editable_combo_finalize (GObject * obj) +{ CellEditableCombo * self; self = G_TYPE_CHECK_INSTANCE_CAST (obj, TYPE_CELL_EDITABLE_COMBO, CellEditableCombo); _g_object_unref0 (self->priv->parent); @@ -946,19 +1152,27 @@ static void cell_editable_combo_finalize (GObject* obj) { } -GType cell_editable_combo_get_type (void) { +GType +cell_editable_combo_get_type (void) +{ static volatile gsize cell_editable_combo_type_id__volatile = 0; if (g_once_init_enter (&cell_editable_combo_type_id__volatile)) { static const GTypeInfo g_define_type_info = { sizeof (CellEditableComboClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) cell_editable_combo_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (CellEditableCombo), 0, (GInstanceInitFunc) cell_editable_combo_instance_init, NULL }; + static const GInterfaceInfo gtk_cell_editable_info = { (GInterfaceInitFunc) cell_editable_combo_gtk_cell_editable_interface_init, (GInterfaceFinalizeFunc) NULL, NULL}; GType cell_editable_combo_type_id; - cell_editable_combo_type_id = g_type_register_static (GTK_TYPE_COMBO_BOX_TEXT, "CellEditableCombo", &g_define_type_info, 0); + cell_editable_combo_type_id = g_type_register_static (gtk_combo_box_text_get_type (), "CellEditableCombo", &g_define_type_info, 0); + g_type_add_interface_static (cell_editable_combo_type_id, gtk_cell_editable_get_type (), >k_cell_editable_info); g_once_init_leave (&cell_editable_combo_type_id__volatile, cell_editable_combo_type_id); } return cell_editable_combo_type_id__volatile; } -static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func) { +static void +_vala_array_destroy (gpointer array, + gint array_length, + GDestroyNotify destroy_func) +{ if ((array != NULL) && (destroy_func != NULL)) { int i; for (i = 0; i < array_length; i = i + 1) { @@ -970,7 +1184,11 @@ static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNoti } -static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify destroy_func) { +static void +_vala_array_free (gpointer array, + gint array_length, + GDestroyNotify destroy_func) +{ _vala_array_destroy (array, array_length, destroy_func); g_free (array); } diff --git a/cellrenderertextish.h b/cellrenderertextish.h index a9d217d0..c7aeee84 100644 --- a/cellrenderertextish.h +++ b/cellrenderertextish.h @@ -1,4 +1,4 @@ -/* cellrenderertextish.h generated by valac 0.18.1, the Vala compiler, do not modify */ +/* cellrenderertextish.h generated by valac 0.40.23, the Vala compiler, do not modify */ #ifndef __CELLRENDERERTEXTISH_H__ @@ -6,6 +6,7 @@ #include #include +#include #include #include @@ -22,9 +23,6 @@ G_BEGIN_DECLS typedef struct _CellRendererTextish CellRendererTextish; typedef struct _CellRendererTextishClass CellRendererTextishClass; typedef struct _CellRendererTextishPrivate CellRendererTextishPrivate; - -#define CELL_RENDERER_TEXTISH_TYPE_MODE (cell_renderer_textish_mode_get_type ()) - typedef enum { CELL_RENDERER_TEXTISH_MODE_Text, CELL_RENDERER_TEXTISH_MODE_Key, @@ -32,6 +30,9 @@ typedef enum { CELL_RENDERER_TEXTISH_MODE_Combo } CellRendererTextishMode; + +#define CELL_RENDERER_TEXTISH_TYPE_MODE (cell_renderer_textish_mode_get_type ()) + struct _CellRendererTextish { GtkCellRendererText parent_instance; CellRendererTextishPrivate * priv; @@ -49,8 +50,11 @@ GType cell_renderer_textish_get_type (void) G_GNUC_CONST; GType cell_renderer_textish_mode_get_type (void) G_GNUC_CONST; CellRendererTextish* cell_renderer_textish_new (void); CellRendererTextish* cell_renderer_textish_construct (GType object_type); -CellRendererTextish* cell_renderer_textish_new_with_items (gchar** items, int items_length1); -CellRendererTextish* cell_renderer_textish_construct_with_items (GType object_type, gchar** items, int items_length1); +CellRendererTextish* cell_renderer_textish_new_with_items (gchar** items, + int items_length1); +CellRendererTextish* cell_renderer_textish_construct_with_items (GType object_type, + gchar** items, + int items_length1); G_END_DECLS diff --git a/cellrenderertextish.vala b/cellrenderertextish.vala index b6aade9a..932ac49a 100644 --- a/cellrenderertextish.vala +++ b/cellrenderertextish.vala @@ -22,7 +22,7 @@ public class CellRendererTextish : Gtk.CellRendererText { this.items = items; } - public override unowned Gtk.CellEditable start_editing (Gdk.Event? event, Gtk.Widget widget, string path, Gdk.Rectangle background_area, Gdk.Rectangle cell_area, Gtk.CellRendererState flags) { + public override unowned Gtk.CellEditable? start_editing (Gdk.Event? event, Gtk.Widget widget, string path, Gdk.Rectangle background_area, Gdk.Rectangle cell_area, Gtk.CellRendererState flags) { cell = null; if (!editable) return cell; @@ -112,7 +112,7 @@ class CellEditableAccel : Gtk.EventBox, Gtk.CellEditable { } -class CellEditableCombo : Gtk.ComboBoxText { +class CellEditableCombo : Gtk.ComboBoxText, Gtk.CellEditable { new CellRendererTextish parent; new string path; @@ -124,4 +124,10 @@ class CellEditableCombo : Gtk.ComboBoxText { } changed.connect(() => parent.combo_edited(path, active)); } + + public virtual void start_editing(Gdk.Event? event) { + base.start_editing(event); + show_all(); + } } + From 299c7c0b23e6c30455d39a468eb2627c1d567a56 Mon Sep 17 00:00:00 2001 From: Norimasa Date: Fri, 24 Jul 2020 22:02:18 +0900 Subject: [PATCH 18/22] Change the translation (cherry picked from commit 1c6ceed0410a058e6c1ff40a04bf4f4d895300a3) --- po/ja.po | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/po/ja.po b/po/ja.po index b7173537..a83d9f82 100644 --- a/po/ja.po +++ b/po/ja.po @@ -402,7 +402,7 @@ msgid "Preferences" msgstr "設定" msgid "Only enable easystroke for applications listed on 'Actions' tab" -msgstr "" +msgstr "アクションタブに登録されているアプリケーションのみ easystroke を有効にする" msgid "Timeout Gestures" msgstr "タイムアウト・ジェスチャ" From d1aa19e702fb8493e5055b324aab70e16cd98f1e Mon Sep 17 00:00:00 2001 From: Norimasa Date: Fri, 24 Jul 2020 22:08:08 +0900 Subject: [PATCH 19/22] Change the translation to right the cursor (cherry picked from commit 438a0f8684d4b2d419edab2b9ef64421f921f890) --- po/ja.po | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/po/ja.po b/po/ja.po index a83d9f82..5cbfa4ff 100644 --- a/po/ja.po +++ b/po/ja.po @@ -375,7 +375,7 @@ msgid "Show popups (" msgstr "ポップアップを表示 (" msgid "to the right of the cursor)" -msgstr "" +msgstr "カーソルの右側)" msgid "Show tray icon" msgstr "トレイアイコンを表示" From 4f025b666abdf814a1c2ea2b528ec98d7f24d75e Mon Sep 17 00:00:00 2001 From: debuggerx Date: Wed, 12 Jul 2017 21:05:05 +0800 Subject: [PATCH 20/22] Init trace type with TraceShape when got TraceDefault , this just a simple solution for Deepin. (cherry picked from commit 31023e7a253bde9fabb273a294fc3d0837dcaf96) --- main.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/main.cc b/main.cc index df6a5ef3..8c224df9 100644 --- a/main.cc +++ b/main.cc @@ -70,6 +70,7 @@ static Trace *init_trace() { case TraceNone: return new Trivial(); case TraceShape: + case TraceDefault: return new Shape(); case TraceAnnotate: return new Annotate(); From a255b2af291a494ad43b9de9c891613eb2bb6027 Mon Sep 17 00:00:00 2001 From: Siloportem Date: Sat, 16 Jul 2016 22:33:09 +0200 Subject: [PATCH 21/22] FIXED: easystroke.desktop.in (cherry picked from commit 0fa53d80dcb845270f1f7ed42646ac5132b6d41f) --- easystroke.desktop.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/easystroke.desktop.in b/easystroke.desktop.in index 1257b05f..d6ca3f96 100644 --- a/easystroke.desktop.in +++ b/easystroke.desktop.in @@ -6,7 +6,7 @@ Terminal=false Exec=easystroke Icon=easystroke Categories=GTK;Utility;Accessibility; -Actions=About;Enable;Disable;Quit +Actions=About;Enable;Disable;Quit; _Comment=Control your desktop using mouse gestures [Desktop Action About] From 08f9ff68bf36326b1de959c841b7a1d45f0d8cbe Mon Sep 17 00:00:00 2001 From: Victor Dmitriev Date: Sat, 18 Jun 2022 13:28:04 +0300 Subject: [PATCH 22/22] Made Makefile use the environment vars explicitly --- Makefile | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/Makefile b/Makefile index 71beaa42..f1512433 100644 --- a/Makefile +++ b/Makefile @@ -12,23 +12,22 @@ # OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN # CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -DESTDIR = -PREFIX = /usr/local +#DESTDIR = +PREFIX ?= /usr/local BINDIR = $(PREFIX)/bin ICONDIR = $(PREFIX)/share/icons/hicolor/scalable/apps MENUDIR = $(PREFIX)/share/applications LOCALEDIR= $(PREFIX)/share/locale -DFLAGS = +#DFLAGS = OFLAGS = -O2 AOFLAGS = -O3 -STROKEFLAGS = -Wall -std=c11 $(DFLAGS) CXXSTD = -std=c++11 INCLUDES = $(shell pkg-config gtkmm-3.0 dbus-glib-1 --cflags) -CXXFLAGS = $(CXXSTD) -Wall $(DFLAGS) -DLOCALEDIR=\"$(LOCALEDIR)\" $(INCLUDES) -CFLAGS = -std=c11 -Wall $(DFLAGS) -DLOCALEDIR=\"$(LOCALEDIR)\" $(INCLUDES) -DGETTEXT_PACKAGE='"easystroke"' -LDFLAGS = $(DFLAGS) +CXXFLAGS += $(CXXSTD) -Wall $(DFLAGS) -DLOCALEDIR=\"$(LOCALEDIR)\" $(INCLUDES) +CFLAGS += -std=c11 -Wall $(DFLAGS) -DLOCALEDIR=\"$(LOCALEDIR)\" $(INCLUDES) -DGETTEXT_PACKAGE='"easystroke"' +LDFLAGS += $(DFLAGS) -LIBS = $(DFLAGS) -lboost_serialization -lX11 -lXext -lXi -lXfixes -lXtst `pkg-config gtkmm-3.0 dbus-glib-1 --libs` +LIBS = $(DFLAGS) -lboost_serialization -lX11 -lXext -lXi -lXfixes -lXtst $(shell pkg-config gtkmm-3.0 dbus-glib-1 --libs) BINARY = easystroke ICON = easystroke.svg @@ -65,7 +64,7 @@ $(BINARY): $(OFILES) $(CXX) $(LDFLAGS) -o $@ $(OFILES) $(LIBS) stroke.o: stroke.c - $(CC) $(STROKEFLAGS) $(AOFLAGS) -MT $@ -MMD -MP -MF $*.Po -o $@ -c $< + $(CC) $(CFLAGS) $(AOFLAGS) -MT $@ -MMD -MP -MF $*.Po -o $@ -c $< %.o: %.c $(CC) $(CFLAGS) $(OFLAGS) -MT $@ -MMD -MP -MF $*.Po -o $@ -c $<