lists.geany.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
List overview
Plugins-Commits
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
plugins-commits@lists.geany.org
1 participants
5470 discussions
Start a n
N
ew thread
[geany/geany-plugins] accf84: webhelper: Remove pre-GTK3 compatibility checks
by Colomban Wendling
09 Mar '23
09 Mar '23
Branch: refs/heads/master Author: Colomban Wendling <ban(a)herbesfolles.org> Committer: Colomban Wendling <ban(a)herbesfolles.org> Date: Sun, 05 Feb 2023 22:55:09 UTC Commit: accf845a6cc9ab78280d845b1759972380d42346
https://github.com/geany/geany-plugins/commit/accf845a6cc9ab78280d845b17599…
Log Message: ----------- webhelper: Remove pre-GTK3 compatibility checks Now we depend on the GTK3-only WebKit2Gtk, drop code for compatibility GTK2. Modified Paths: -------------- webhelper/src/gwh-browser.c webhelper/src/gwh-settings.c Modified: webhelper/src/gwh-browser.c 59 lines changed, 4 insertions(+), 55 deletions(-) =================================================================== @@ -37,50 +37,6 @@ #include "gwh-plugin.h" -#if ! GTK_CHECK_VERSION (2, 18, 0) -# ifndef gtk_widget_set_visible -# define gtk_widget_set_visible(w, v) \ - ((v) ? gtk_widget_show (w) : gtk_widget_hide (w)) -# endif /* defined (gtk_widget_set_visible) */ -# ifndef gtk_widget_get_visible -# define gtk_widget_get_visible(w) \ - (GTK_WIDGET_VISIBLE (w)) -# endif /* defined (gtk_widget_get_visible) */ -#endif /* GTK_CHECK_VERSION (2, 18, 0) */ -#if ! GTK_CHECK_VERSION (2, 20, 0) -# ifndef gtk_widget_get_mapped -# define gtk_widget_get_mapped(w) \ - (GTK_WIDGET_MAPPED ((w))) -# endif /* defined (gtk_widget_get_mapped) */ -#endif /* GTK_CHECK_VERSION (2, 20, 0) */ -#if ! GTK_CHECK_VERSION (3, 0, 0) -/* the GtkComboBoxText API is actually available in 2.24, but Geany's - * gtkcompat.h hides it on < 3.0.0 to keep ABI compatibility on all 2.x, so we - * need to use the old API there too. */ -# define gtk_combo_box_get_entry_text_column(c) \ - (gtk_combo_box_entry_get_text_column (GTK_COMBO_BOX_ENTRY (c))) -#endif /* GTK_CHECK_VERSION (3, 0, 0) */ -#if ! GTK_CHECK_VERSION (3, 0, 0) -static void -combo_box_text_remove_all (GtkComboBoxText *combo_box) -{ - GtkListStore *store; - - g_return_if_fail (GTK_IS_COMBO_BOX_TEXT (combo_box)); - - store = GTK_LIST_STORE (gtk_combo_box_get_model (GTK_COMBO_BOX (combo_box))); - gtk_list_store_clear (store); -} -# define gtk_combo_box_text_remove_all combo_box_text_remove_all -#endif /* GTK_CHECK_VERSION (3, 0, 0) */ -#if GTK_CHECK_VERSION (3, 0, 0) -/* alias GtkObject, we implement the :destroy signal */ -# define GtkObject GtkWidget -# define GtkObjectClass GtkWidgetClass -# define GTK_OBJECT_CLASS GTK_WIDGET_CLASS -#endif /* GTK_CHECK_VERSION (3, 0, 0) */ - - struct _GwhBrowserPrivate { GwhSettings *settings; @@ -737,11 +693,8 @@ on_web_view_scroll_event (GtkWidget *widget, { guint mods = event->state & gtk_accelerator_get_default_mod_mask (); gboolean handled = FALSE; - -#if GTK_CHECK_VERSION(3, 0, 0) gdouble delta; gdouble factor; -#endif if (mods == GDK_CONTROL_MASK) { handled = TRUE; @@ -754,14 +707,12 @@ on_web_view_scroll_event (GtkWidget *widget, web_view_zoom_in (WEBKIT_WEB_VIEW (self->priv->web_view)); break; -#if GTK_CHECK_VERSION(3, 0, 0) case GDK_SCROLL_SMOOTH: delta = event->delta_x + event->delta_y; factor = pow (delta < 0 ? zoom_in_factor : zoom_out_factor, fabs (delta)); web_view_zoom (WEBKIT_WEB_VIEW (self->priv->web_view), factor); break; -#endif default: handled = FALSE; @@ -781,9 +732,9 @@ on_orientation_notify (GObject *object, } static void -gwh_browser_destroy (GtkObject *object) +gwh_browser_destroy (GtkWidget *widget) { - GwhBrowser *self = GWH_BROWSER (object); + GwhBrowser *self = GWH_BROWSER (widget); gchar *geometry; /* save the setting now because we can't really set it at the time it changed, @@ -808,7 +759,7 @@ gwh_browser_destroy (GtkObject *object) /* also destroy the window, since it has no parent that will tell it to die */ gtk_widget_destroy (self->priv->inspector_window); - GTK_OBJECT_CLASS (gwh_browser_parent_class)->destroy (object); + GTK_WIDGET_CLASS (gwh_browser_parent_class)->destroy (widget); } static void @@ -914,16 +865,14 @@ static void gwh_browser_class_init (GwhBrowserClass *klass) { GObjectClass *object_class = G_OBJECT_CLASS (klass); - GtkObjectClass *gtkobject_class = GTK_OBJECT_CLASS (klass); GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass); object_class->finalize = gwh_browser_finalize; object_class->constructed = gwh_browser_constructed; object_class->get_property = gwh_browser_get_property; object_class->set_property = gwh_browser_set_property; - gtkobject_class->destroy = gwh_browser_destroy; - + widget_class->destroy = gwh_browser_destroy; widget_class->show_all = gwh_browser_show_all; signals[POPULATE_POPUP] = g_signal_new ("populate-popup", Modified: webhelper/src/gwh-settings.c 7 lines changed, 0 insertions(+), 7 deletions(-) =================================================================== @@ -29,13 +29,6 @@ #include <gtk/gtk.h> -#if ! GTK_CHECK_VERSION (3, 0, 0) -/* make gtk_adjustment_new() return a real GtkAdjustment, not a GtkObject */ -# define gtk_adjustment_new(v, l, u, si, pi, ps) \ - (GtkAdjustment *) (gtk_adjustment_new ((v), (l), (u), (si), (pi), (ps))) -#endif - - struct _GwhSettingsPrivate { GPtrArray *prop_array; -------------- This E-Mail was brought to you by github_commit_mail.py (Source:
https://github.com/geany/infrastructure
).
1
0
0
0
[geany/geany-plugins] 208b09: webhelper: Don't use deprecated GtkStock
by Colomban Wendling
09 Mar '23
09 Mar '23
Branch: refs/heads/master Author: Colomban Wendling <ban(a)herbesfolles.org> Committer: Colomban Wendling <ban(a)herbesfolles.org> Date: Sun, 05 Feb 2023 22:55:09 UTC Commit: 208b09b7edbfb3143409834caf522280bb582791
https://github.com/geany/geany-plugins/commit/208b09b7edbfb3143409834caf522…
Log Message: ----------- webhelper: Don't use deprecated GtkStock Modified Paths: -------------- webhelper/src/gwh-browser.c Modified: webhelper/src/gwh-browser.c 38 lines changed, 27 insertions(+), 11 deletions(-) =================================================================== @@ -938,6 +938,19 @@ url_completion_match_func (GtkEntryCompletion *comp, return match; } +static GtkToolItem * +tool_button_new (const gchar *mnemonic, + const gchar *icon_name, + const gchar *tooltip) +{ + return g_object_new (GTK_TYPE_TOOL_BUTTON, + "use-underline", TRUE, + "label", mnemonic, + "icon-name", icon_name, + "tooltip-text", tooltip, + NULL); +} + static GtkWidget * create_toolbar (GwhBrowser *self) { @@ -950,20 +963,20 @@ create_toolbar (GwhBrowser *self) "toolbar-style", GTK_TOOLBAR_ICONS, NULL); - self->priv->item_prev = gtk_tool_button_new_from_stock (GTK_STOCK_GO_BACK); - gtk_tool_item_set_tooltip_text (self->priv->item_prev, _("Back")); + self->priv->item_prev = tool_button_new (_("_Back"), "go-previous", + _("Go back")); gtk_toolbar_insert (GTK_TOOLBAR (toolbar), self->priv->item_prev, -1); gtk_widget_show (GTK_WIDGET (self->priv->item_prev)); - self->priv->item_next = gtk_tool_button_new_from_stock (GTK_STOCK_GO_FORWARD); - gtk_tool_item_set_tooltip_text (self->priv->item_next, _("Forward")); + self->priv->item_next = tool_button_new (_("_Forward"), "go-next", + _("Go forward")); gtk_toolbar_insert (GTK_TOOLBAR (toolbar), self->priv->item_next, -1); gtk_widget_show (GTK_WIDGET (self->priv->item_next)); - self->priv->item_cancel = gtk_tool_button_new_from_stock (GTK_STOCK_CANCEL); - gtk_tool_item_set_tooltip_text (self->priv->item_cancel, _("Cancel loading")); + self->priv->item_cancel = tool_button_new (_("_Cancel"), "process-stop", + _("Cancel loading")); gtk_toolbar_insert (GTK_TOOLBAR (toolbar), self->priv->item_cancel, -1); /* don't show cancel */ - self->priv->item_reload = gtk_tool_button_new_from_stock (GTK_STOCK_REFRESH); - gtk_tool_item_set_tooltip_text (self->priv->item_reload, _("Reload current page")); + self->priv->item_reload = tool_button_new (_("_Refresh"), "view-refresh", + _("Reload current page")); gtk_toolbar_insert (GTK_TOOLBAR (toolbar), self->priv->item_reload, -1); gtk_widget_show (GTK_WIDGET (self->priv->item_reload)); @@ -987,9 +1000,12 @@ create_toolbar (GwhBrowser *self) gtk_entry_completion_set_match_func (comp, url_completion_match_func, NULL, NULL); gtk_entry_set_completion (GTK_ENTRY (self->priv->url_entry), comp); - self->priv->item_inspector = gtk_toggle_tool_button_new_from_stock (GTK_STOCK_INFO); - gtk_tool_button_set_label (GTK_TOOL_BUTTON (self->priv->item_inspector), _("Web inspector")); - gtk_tool_item_set_tooltip_text (self->priv->item_inspector, _("Toggle web inspector")); + self->priv->item_inspector = g_object_new (GTK_TYPE_TOGGLE_TOOL_BUTTON, + "use-underline", TRUE, + "label", _("Web _Inspector"), + "tooltip-text", _("Toggle web inspector"), + "icon-name", "dialog-information", + NULL); gtk_toolbar_insert (GTK_TOOLBAR (toolbar), self->priv->item_inspector, -1); gtk_widget_show (GTK_WIDGET (self->priv->item_inspector)); -------------- This E-Mail was brought to you by github_commit_mail.py (Source:
https://github.com/geany/infrastructure
).
1
0
0
0
[geany/geany-plugins] 67e6aa: webhelper: Fix constness of a variable
by Colomban Wendling
09 Mar '23
09 Mar '23
Branch: refs/heads/master Author: Colomban Wendling <ban(a)herbesfolles.org> Committer: Colomban Wendling <ban(a)herbesfolles.org> Date: Sun, 05 Feb 2023 22:10:45 UTC Commit: 67e6aa628e6fa30e448806e604f50262017b79d2
https://github.com/geany/geany-plugins/commit/67e6aa628e6fa30e448806e604f50…
Log Message: ----------- webhelper: Fix constness of a variable cairo_image_surface_get_width() and friends expects a non-const cairo_surface_t. Modified Paths: -------------- webhelper/src/gwh-browser.c Modified: webhelper/src/gwh-browser.c 4 lines changed, 2 insertions(+), 2 deletions(-) =================================================================== @@ -140,7 +140,7 @@ static void inspector_set_detached (GwhBrowser *self, static void set_location_icon (GwhBrowser *self, - const cairo_surface_t *icon_surface) + cairo_surface_t *icon_surface) { gboolean success = FALSE; @@ -576,7 +576,7 @@ on_web_view_favicon_notify (GObject *object, GParamSpec *pspec, GwhBrowser *self) { - const cairo_surface_t *icon_surface; + cairo_surface_t *icon_surface; icon_surface = webkit_web_view_get_favicon (WEBKIT_WEB_VIEW (self->priv->web_view)); set_location_icon (self, icon_surface); -------------- This E-Mail was brought to you by github_commit_mail.py (Source:
https://github.com/geany/infrastructure
).
1
0
0
0
[geany/geany-plugins] 4b8c97: webhelper: Add missing G_CALLBACK() casts
by Colomban Wendling
09 Mar '23
09 Mar '23
Branch: refs/heads/master Author: Colomban Wendling <ban(a)herbesfolles.org> Committer: Colomban Wendling <ban(a)herbesfolles.org> Date: Sun, 05 Feb 2023 22:10:45 UTC Commit: 4b8c97f0e9de2212cd5ea96fcf27f916e25f3780
https://github.com/geany/geany-plugins/commit/4b8c97f0e9de2212cd5ea96fcf27f…
Log Message: ----------- webhelper: Add missing G_CALLBACK() casts Modified Paths: -------------- webhelper/src/gwh-browser.c webhelper/src/gwh-plugin.c Modified: webhelper/src/gwh-browser.c 2 lines changed, 1 insertions(+), 1 deletions(-) =================================================================== @@ -708,7 +708,7 @@ on_web_view_context_menu (WebKitWebView *view, g_simple_action_set_enabled (action, TRUE); webkit_context_menu_append (submenu, item); g_signal_connect (action, "activate", - on_item_full_content_zoom_activate, self); + G_CALLBACK (on_item_full_content_zoom_activate), self); /* flip panes orientation */ webkit_context_menu_append (context_menu, Modified: webhelper/src/gwh-plugin.c 2 lines changed, 1 insertions(+), 1 deletions(-) =================================================================== @@ -277,7 +277,7 @@ on_browser_populate_popup (GwhBrowser *browser, NULL); webkit_context_menu_append (menu, item); g_signal_connect (action, "activate", - on_item_auto_reload_toggled, NULL); + G_CALLBACK (on_item_auto_reload_toggled), NULL); } static void -------------- This E-Mail was brought to you by github_commit_mail.py (Source:
https://github.com/geany/infrastructure
).
1
0
0
0
[geany/geany-plugins] 6ad3b8: webhelper: Avoid a deprecation
by Colomban Wendling
09 Mar '23
09 Mar '23
Branch: refs/heads/master Author: Colomban Wendling <ban(a)herbesfolles.org> Committer: Colomban Wendling <ban(a)herbesfolles.org> Date: Sun, 05 Feb 2023 22:10:45 UTC Commit: 6ad3b8dc5989a05911b4f02626b75d529bbac760
https://github.com/geany/geany-plugins/commit/6ad3b8dc5989a05911b4f02626b75…
Log Message: ----------- webhelper: Avoid a deprecation Modified Paths: -------------- webhelper/src/gwh-settings.c Modified: webhelper/src/gwh-settings.c 2 lines changed, 1 insertions(+), 1 deletions(-) =================================================================== @@ -800,7 +800,7 @@ gwh_settings_widget_new_full (GwhSettings *self, GtkWidget *box; gchar *label; - box = gtk_hbox_new (FALSE, 6); + box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 6); label = g_strdup_printf (_("%s:"), g_param_spec_get_nick (pspec)); gtk_box_pack_start (GTK_BOX (box), gtk_label_new (label), FALSE, TRUE, 0); g_free (label); -------------- This E-Mail was brought to you by github_commit_mail.py (Source:
https://github.com/geany/infrastructure
).
1
0
0
0
[geany/geany-plugins] 81bae5: webhelper: Make gtk3-only
by Chow Loong Jin
09 Mar '23
09 Mar '23
Branch: refs/heads/master Author: Chow Loong Jin <hyperair(a)debian.org> Committer: Colomban Wendling <ban(a)herbesfolles.org> Date: Sun, 05 Feb 2023 22:54:46 UTC Commit: 81bae5faea2833caff46fb9492d9413edec2e136
https://github.com/geany/geany-plugins/commit/81bae5faea2833caff46fb9492d94…
Log Message: ----------- webhelper: Make gtk3-only webkit2gtk-4.0 doesn't exist for gtk2. Modified Paths: -------------- build/webhelper.m4 Modified: build/webhelper.m4 5 lines changed, 2 insertions(+), 3 deletions(-) =================================================================== @@ -19,14 +19,13 @@ AC_DEFUN([GP_CHECK_WEBHELPER], fi fi - GP_CHECK_GTK3([webkit_package=webkit2gtk-4.0], - [webkit_package=webkit-1.0]) + GP_CHECK_PLUGIN_GTK3_ONLY([webhelper]) GP_CHECK_PLUGIN_DEPS([WebHelper], [WEBHELPER], [$GP_GTK_PACKAGE >= ${GTK_VERSION} glib-2.0 >= ${GLIB_VERSION} gio-2.0 >= ${GIO_VERSION} gdk-pixbuf-2.0 >= ${GDK_PIXBUF_VERSION} - $webkit_package >= ${WEBKIT_VERSION} + webkit2gtk-4.0 >= ${WEBKIT_VERSION} gthread-2.0]) -------------- This E-Mail was brought to you by github_commit_mail.py (Source:
https://github.com/geany/infrastructure
).
1
0
0
0
[geany/geany-plugins] 941d15: webhelper: Port context menu to WebKitContextMenu
by Chow Loong Jin
09 Mar '23
09 Mar '23
Branch: refs/heads/master Author: Chow Loong Jin <hyperair(a)debian.org> Committer: Colomban Wendling <ban(a)herbesfolles.org> Date: Sun, 05 Feb 2023 22:10:44 UTC Commit: 941d15da06da22c352233586791271f95efdb599
https://github.com/geany/geany-plugins/commit/941d15da06da22c35223358679127…
Log Message: ----------- webhelper: Port context menu to WebKitContextMenu Modified Paths: -------------- webhelper/src/gwh-browser.c webhelper/src/gwh-browser.h webhelper/src/gwh-plugin.c Modified: webhelper/src/gwh-browser.c 152 lines changed, 89 insertions(+), 63 deletions(-) =================================================================== @@ -27,6 +27,7 @@ #include <string.h> #include <glib.h> #include <glib/gi18n-lib.h> +#include <gio/gio.h> #include <gtk/gtk.h> #include <webkit2/webkit2.h> @@ -597,8 +598,9 @@ on_web_view_progress_notify (GObject *object, static void -on_item_flip_orientation_activate (GtkMenuItem *item, - GwhBrowser *self) +on_item_flip_orientation_activate (GSimpleAction *action, + GVariant *parameter, + GwhBrowser *self) { gtk_orientable_set_orientation (GTK_ORIENTABLE (self), gtk_orientable_get_orientation (GTK_ORIENTABLE (self)) == GTK_ORIENTATION_VERTICAL @@ -607,20 +609,24 @@ on_item_flip_orientation_activate (GtkMenuItem *item, } static void -on_item_zoom_100_activate (GtkMenuItem *item, - GwhBrowser *self) +on_item_zoom_100_activate (WebKitWebView *view) { - webkit_web_view_set_zoom_level (WEBKIT_WEB_VIEW (self->priv->web_view), 1.0); + webkit_web_view_set_zoom_level (view, 1.0); } static void -on_item_full_content_zoom_activate (GtkCheckMenuItem *item, - GwhBrowser *self) +on_item_full_content_zoom_activate (GSimpleAction *action, + GVariant *dummy_parameter, + GwhBrowser *self) { WebKitSettings *settings; + gboolean zoom_text_only; + settings = webkit_web_view_get_settings (WEBKIT_WEB_VIEW (self->priv->web_view)); - webkit_settings_set_zoom_text_only (settings, !gtk_check_menu_item_get_active (item)); + zoom_text_only = !webkit_settings_get_zoom_text_only (settings); + webkit_settings_set_zoom_text_only (settings, zoom_text_only); + g_simple_action_set_state (action, g_variant_new_boolean (!zoom_text_only)); } static void web_view_zoom (WebKitWebView *view, gdouble factor) @@ -639,68 +645,88 @@ static void web_view_zoom_out (WebKitWebView *view) web_view_zoom (view, zoom_out_factor); } -static void -on_web_view_populate_popup (WebKitWebView *view, - GtkMenu *menu, - GwhBrowser *self) +static gboolean +on_web_view_context_menu (WebKitWebView *view, + WebKitContextMenu *context_menu, + GdkEvent *event, + WebKitHitTestResult *hit_test_result, + GwhBrowser *self) { - GtkWidget *item; - GtkWidget *submenu; - - #define ADD_SEPARATOR(menu) \ - item = gtk_separator_menu_item_new (); \ - gtk_widget_show (item); \ - gtk_menu_shell_append (GTK_MENU_SHELL (menu), item) - - ADD_SEPARATOR (menu); - + WebKitContextMenuItem *item; + WebKitContextMenu *submenu; + GAction *action; + GVariant *action_state; + + webkit_context_menu_append (context_menu, + webkit_context_menu_item_new_separator ()); + /* Zoom menu */ - submenu = gtk_menu_new (); - item = gtk_menu_item_new_with_mnemonic (_("_Zoom")); - gtk_widget_show (item); - gtk_menu_item_set_submenu (GTK_MENU_ITEM (item), submenu); - gtk_menu_shell_append (GTK_MENU_SHELL (menu), item); + submenu = webkit_context_menu_new (); + item = webkit_context_menu_item_new_with_submenu (_("_Zoom"), submenu); + webkit_context_menu_append (context_menu, item); + /* zoom in */ - item = gtk_image_menu_item_new_from_stock (GTK_STOCK_ZOOM_IN, NULL); - g_signal_connect_swapped (item, "activate", + action = g_simple_action_new ("zoom-in", NULL); + g_signal_connect_swapped (action, "activate", G_CALLBACK (web_view_zoom_in), view); - gtk_menu_shell_append (GTK_MENU_SHELL (submenu), item); + item = webkit_context_menu_item_new_from_gaction (action, _("Zoom _In"), + NULL); + webkit_context_menu_append (submenu, item); + /* zoom out */ - item = gtk_image_menu_item_new_from_stock (GTK_STOCK_ZOOM_OUT, NULL); - g_signal_connect_swapped (item, "activate", + action = g_simple_action_new ("zoom-out", NULL); + g_signal_connect_swapped (action, "activate", G_CALLBACK (web_view_zoom_out), view); - gtk_menu_shell_append (GTK_MENU_SHELL (submenu), item); + item = webkit_context_menu_item_new_from_gaction (action, _("Zoom _Out"), + NULL); + webkit_context_menu_append (submenu, item); + /* zoom 1:1 */ - ADD_SEPARATOR (submenu); - item = gtk_image_menu_item_new_from_stock (GTK_STOCK_ZOOM_100, NULL); - g_signal_connect (item, "activate", - G_CALLBACK (on_item_zoom_100_activate), self); - gtk_menu_shell_append (GTK_MENU_SHELL (submenu), item); + webkit_context_menu_append (submenu, + webkit_context_menu_item_new_separator ()); + action = g_simple_action_new ("zoom-reset", NULL); + g_signal_connect_swapped (action, "activate", + G_CALLBACK (on_item_zoom_100_activate), view); + item = webkit_context_menu_item_new_from_gaction (action, _("_Reset Zoom"), + NULL); + webkit_context_menu_append (submenu, item); + /* full content zoom */ - ADD_SEPARATOR (submenu); - item = gtk_check_menu_item_new_with_mnemonic (_("Full-_content zoom")); - gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (item), - !webkit_settings_get_zoom_text_only (webkit_web_view_get_settings(view))); - g_signal_connect (item, "activate", - G_CALLBACK (on_item_full_content_zoom_activate), self); - gtk_menu_shell_append (GTK_MENU_SHELL (submenu), item); - /* show zoom sumbenu */ - gtk_widget_show_all (submenu); - - ADD_SEPARATOR (menu); - - item = gtk_menu_item_new_with_label (_("Flip panes orientation")); - g_signal_connect (item, "activate", - G_CALLBACK (on_item_flip_orientation_activate), self); - gtk_widget_show (item); - gtk_menu_shell_append (GTK_MENU_SHELL (menu), item); + webkit_context_menu_append (submenu, + webkit_context_menu_item_new_separator ()); + action_state = g_variant_new_boolean ( + webkit_settings_get_zoom_text_only (webkit_web_view_get_settings (view))); + + action = g_simple_action_new_stateful ( + "full-content-zoom", + NULL, + action_state + ); + item = webkit_context_menu_item_new_from_gaction (action, + _("Full-_content zoom"), + NULL); + g_simple_action_set_enabled (action, TRUE); + webkit_context_menu_append (submenu, item); + g_signal_connect (action, "activate", + on_item_full_content_zoom_activate, self); + + /* flip panes orientation */ + webkit_context_menu_append (context_menu, + webkit_context_menu_item_new_separator ()); + action = g_simple_action_new ("flip-panes", NULL); + g_signal_connect_swapped (action, "activate", + G_CALLBACK (on_item_flip_orientation_activate), + view); + item = webkit_context_menu_item_new_from_gaction ( + action, _("_Flip panes orientation"), NULL); + webkit_context_menu_append (context_menu, item); if (! INSPECTOR_VISIBLE (self) || INSPECTOR_DETACHED (self)) { - gtk_widget_set_sensitive (item, FALSE); + g_simple_action_set_enabled (action, FALSE); } - - #undef ADD_SEPARATOR - - g_signal_emit (self, signals[POPULATE_POPUP], 0, menu); + + g_signal_emit (self, signals[POPULATE_POPUP], 0, context_menu); + + return FALSE; } static gboolean @@ -905,7 +931,7 @@ gwh_browser_class_init (GwhBrowserClass *klass) G_STRUCT_OFFSET (GwhBrowserClass, populate_popup), NULL, NULL, g_cclosure_marshal_VOID__OBJECT, - G_TYPE_NONE, 1, GTK_TYPE_MENU); + G_TYPE_NONE, 1, WEBKIT_TYPE_CONTEXT_MENU); g_object_class_override_property (object_class, PROP_ORIENTATION, @@ -1221,8 +1247,8 @@ gwh_browser_init (GwhBrowser *self) G_CALLBACK (on_web_view_load_failed), self); g_signal_connect (G_OBJECT (self->priv->web_view), "notify::favicon", G_CALLBACK (on_web_view_favicon_notify), self); - g_signal_connect (G_OBJECT (self->priv->web_view), "populate-popup", - G_CALLBACK (on_web_view_populate_popup), self); + g_signal_connect (G_OBJECT (self->priv->web_view), "context-menu", + G_CALLBACK (on_web_view_context_menu), self); g_signal_connect (G_OBJECT (self->priv->web_view), "scroll-event", G_CALLBACK (on_web_view_scroll_event), self); g_signal_connect (G_OBJECT (self->priv->web_view), "hovering-over-link", Modified: webhelper/src/gwh-browser.h 4 lines changed, 2 insertions(+), 2 deletions(-) =================================================================== @@ -56,8 +56,8 @@ struct _GwhBrowserClass { GtkVBoxClass parent_class; - void (*populate_popup) (GwhBrowser *browser, - GtkMenu *menu); + void (*populate_popup) (GwhBrowser *browser, + WebKitContextMenu *menu); }; Modified: webhelper/src/gwh-plugin.c 50 lines changed, 31 insertions(+), 19 deletions(-) =================================================================== @@ -240,33 +240,45 @@ on_document_save (GObject *obj, } static void -on_item_auto_reload_toggled (GtkCheckMenuItem *item, - gpointer dummy) +on_item_auto_reload_toggled (GAction *action, + GVariant *parameter, + gpointer dummy) { + gboolean browser_auto_reload; + + g_object_get (G_OBJECT (G_settings), + "browser-auto-reload", &browser_auto_reload, NULL); g_object_set (G_OBJECT (G_settings), "browser-auto-reload", - gtk_check_menu_item_get_active (item), NULL); + !browser_auto_reload, NULL); + g_simple_action_set_state (action, g_variant_new_boolean (browser_auto_reload)); } static void -on_browser_populate_popup (GwhBrowser *browser, - GtkMenu *menu, - gpointer dummy) +on_browser_populate_popup (GwhBrowser *browser, + WebKitContextMenu *menu, + gpointer dummy) { - GtkWidget *item; - gboolean auto_reload = FALSE; - - item = gtk_separator_menu_item_new (); - gtk_widget_show (item); - gtk_menu_shell_append (GTK_MENU_SHELL (menu), item); - + GAction *action; + gboolean auto_reload = FALSE; + GVariant *action_state; + WebKitContextMenuItem *item; + + webkit_context_menu_append (menu, + webkit_context_menu_item_new_separator ()); + g_object_get (G_OBJECT (G_settings), "browser-auto-reload", &auto_reload, NULL); - item = gtk_check_menu_item_new_with_mnemonic (_("Reload upon document saving")); - gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (item), auto_reload); - gtk_widget_show (item); - gtk_menu_shell_append (GTK_MENU_SHELL (menu), item); - g_signal_connect (item, "toggled", G_CALLBACK (on_item_auto_reload_toggled), - NULL); + action_state = g_variant_new_boolean (auto_reload); + action = g_simple_action_new_stateful ( + "browser-auto-reload", + NULL, + action_state + ); + item = webkit_context_menu_item_new_from_gaction ( + action, _("Reload upon document saving"), NULL); + webkit_context_menu_append (menu, item); + g_signal_connect (action, "activate", + on_item_auto_reload_toggled, NULL); } static void -------------- This E-Mail was brought to you by github_commit_mail.py (Source:
https://github.com/geany/infrastructure
).
1
0
0
0
[geany/geany-plugins] ded0ab: webhelper: Fix ctrl+scroll zooming in gtk3
by Chow Loong Jin
09 Mar '23
09 Mar '23
Branch: refs/heads/master Author: Chow Loong Jin <hyperair(a)debian.org> Committer: Colomban Wendling <ban(a)herbesfolles.org> Date: Sun, 05 Feb 2023 22:10:44 UTC Commit: ded0ab7e5f66ffcb0c5ba51cecc6e27d9ce11012
https://github.com/geany/geany-plugins/commit/ded0ab7e5f66ffcb0c5ba51cecc6e…
Log Message: ----------- webhelper: Fix ctrl+scroll zooming in gtk3 Modified Paths: -------------- webhelper/src/Makefile.am webhelper/src/gwh-browser.c Modified: webhelper/src/Makefile.am 3 lines changed, 2 insertions(+), 1 deletions(-) =================================================================== @@ -34,7 +34,8 @@ webhelper_la_CPPFLAGS = $(AM_CPPFLAGS) \ webhelper_la_CFLAGS = $(AM_CFLAGS) \ $(WEBHELPER_CFLAGS) webhelper_la_LIBADD = $(COMMONLIBS) \ - $(WEBHELPER_LIBS) + $(WEBHELPER_LIBS) \ + -lm # These are generated in $(srcdir) because they are part of the distribution, # and should anyway only be regenerated if the .tpl changes, which is a Modified: webhelper/src/gwh-browser.c 33 lines changed, 26 insertions(+), 7 deletions(-) =================================================================== @@ -21,6 +21,7 @@ #include "config.h" +#include <math.h> #include <stdio.h> #include <stdlib.h> #include <string.h> @@ -124,6 +125,8 @@ enum { }; static guint signals[LAST_SIGNAL] = {0}; +static const gdouble zoom_in_factor = 1.2; +static const gdouble zoom_out_factor = 1.0 / 1.2; G_DEFINE_TYPE_WITH_CODE (GwhBrowser, gwh_browser, GTK_TYPE_VBOX, @@ -620,18 +623,20 @@ on_item_full_content_zoom_activate (GtkCheckMenuItem *item, webkit_settings_set_zoom_text_only (settings, !gtk_check_menu_item_get_active (item)); } +static void web_view_zoom (WebKitWebView *view, gdouble factor) +{ + gdouble zoom_level = webkit_web_view_get_zoom_level (view); + webkit_web_view_set_zoom_level (view, zoom_level * factor); +} + static void web_view_zoom_in (WebKitWebView *view) { - gdouble target_zoom_level = webkit_web_view_get_zoom_level (view) + 0.05; - webkit_web_view_set_zoom_level (view, target_zoom_level); + web_view_zoom (view, zoom_in_factor); } static void web_view_zoom_out (WebKitWebView *view) { - gdouble target_zoom_level = webkit_web_view_get_zoom_level (view) - 0.05; - target_zoom_level = MIN(target_zoom_level, 0.05); - - webkit_web_view_set_zoom_level (view, target_zoom_level); + web_view_zoom (view, zoom_out_factor); } static void @@ -705,6 +710,11 @@ on_web_view_scroll_event (GtkWidget *widget, { guint mods = event->state & gtk_accelerator_get_default_mod_mask (); gboolean handled = FALSE; + +#if GTK_CHECK_VERSION(3, 0, 0) + gdouble delta; + gdouble factor; +#endif if (mods == GDK_CONTROL_MASK) { handled = TRUE; @@ -716,7 +726,16 @@ on_web_view_scroll_event (GtkWidget *widget, case GDK_SCROLL_UP: web_view_zoom_in (WEBKIT_WEB_VIEW (self->priv->web_view)); break; - + +#if GTK_CHECK_VERSION(3, 0, 0) + case GDK_SCROLL_SMOOTH: + delta = event->delta_x + event->delta_y; + factor = pow (delta < 0 ? zoom_in_factor : zoom_out_factor, + fabs (delta)); + web_view_zoom (WEBKIT_WEB_VIEW (self->priv->web_view), factor); + break; +#endif + default: handled = FALSE; } -------------- This E-Mail was brought to you by github_commit_mail.py (Source:
https://github.com/geany/infrastructure
).
1
0
0
0
[geany/geany-plugins] 83f6b8: webhelper: Use the right type for GSimpleAction
by Colomban Wendling
09 Mar '23
09 Mar '23
Branch: refs/heads/master Author: Colomban Wendling <ban(a)herbesfolles.org> Committer: Colomban Wendling <ban(a)herbesfolles.org> Date: Sun, 05 Feb 2023 22:10:45 UTC Commit: 83f6b88daf0b3911052056593141e291b67f7b64
https://github.com/geany/geany-plugins/commit/83f6b88daf0b3911052056593141e…
Log Message: ----------- webhelper: Use the right type for GSimpleAction Modified Paths: -------------- webhelper/src/gwh-browser.c webhelper/src/gwh-plugin.c Modified: webhelper/src/gwh-browser.c 21 lines changed, 11 insertions(+), 10 deletions(-) =================================================================== @@ -654,7 +654,7 @@ on_web_view_context_menu (WebKitWebView *view, { WebKitContextMenuItem *item; WebKitContextMenu *submenu; - GAction *action; + GSimpleAction *action; GVariant *action_state; webkit_context_menu_append (context_menu, @@ -669,16 +669,16 @@ on_web_view_context_menu (WebKitWebView *view, action = g_simple_action_new ("zoom-in", NULL); g_signal_connect_swapped (action, "activate", G_CALLBACK (web_view_zoom_in), view); - item = webkit_context_menu_item_new_from_gaction (action, _("Zoom _In"), - NULL); + item = webkit_context_menu_item_new_from_gaction (G_ACTION (action), + _("Zoom _In"), NULL); webkit_context_menu_append (submenu, item); /* zoom out */ action = g_simple_action_new ("zoom-out", NULL); g_signal_connect_swapped (action, "activate", G_CALLBACK (web_view_zoom_out), view); - item = webkit_context_menu_item_new_from_gaction (action, _("Zoom _Out"), - NULL); + item = webkit_context_menu_item_new_from_gaction (G_ACTION (action), + _("Zoom _Out"), NULL); webkit_context_menu_append (submenu, item); /* zoom 1:1 */ @@ -687,8 +687,8 @@ on_web_view_context_menu (WebKitWebView *view, action = g_simple_action_new ("zoom-reset", NULL); g_signal_connect_swapped (action, "activate", G_CALLBACK (on_item_zoom_100_activate), view); - item = webkit_context_menu_item_new_from_gaction (action, _("_Reset Zoom"), - NULL); + item = webkit_context_menu_item_new_from_gaction (G_ACTION (action), + _("_Reset Zoom"), NULL); webkit_context_menu_append (submenu, item); /* full content zoom */ @@ -702,7 +702,7 @@ on_web_view_context_menu (WebKitWebView *view, NULL, action_state ); - item = webkit_context_menu_item_new_from_gaction (action, + item = webkit_context_menu_item_new_from_gaction (G_ACTION (action), _("Full-_content zoom"), NULL); g_simple_action_set_enabled (action, TRUE); @@ -717,8 +717,9 @@ on_web_view_context_menu (WebKitWebView *view, g_signal_connect_swapped (action, "activate", G_CALLBACK (on_item_flip_orientation_activate), view); - item = webkit_context_menu_item_new_from_gaction ( - action, _("_Flip panes orientation"), NULL); + item = webkit_context_menu_item_new_from_gaction (G_ACTION (action), + _("_Flip panes orientation"), + NULL); webkit_context_menu_append (context_menu, item); if (! INSPECTOR_VISIBLE (self) || INSPECTOR_DETACHED (self)) { g_simple_action_set_enabled (action, FALSE); Modified: webhelper/src/gwh-plugin.c 17 lines changed, 8 insertions(+), 9 deletions(-) =================================================================== @@ -250,15 +250,16 @@ on_item_auto_reload_toggled (GAction *action, "browser-auto-reload", &browser_auto_reload, NULL); g_object_set (G_OBJECT (G_settings), "browser-auto-reload", !browser_auto_reload, NULL); - g_simple_action_set_state (action, g_variant_new_boolean (browser_auto_reload)); + g_simple_action_set_state (G_SIMPLE_ACTION (action), + g_variant_new_boolean (browser_auto_reload)); } static void on_browser_populate_popup (GwhBrowser *browser, WebKitContextMenu *menu, gpointer dummy) { - GAction *action; + GSimpleAction *action; gboolean auto_reload = FALSE; GVariant *action_state; WebKitContextMenuItem *item; @@ -269,13 +270,11 @@ on_browser_populate_popup (GwhBrowser *browser, g_object_get (G_OBJECT (G_settings), "browser-auto-reload", &auto_reload, NULL); action_state = g_variant_new_boolean (auto_reload); - action = g_simple_action_new_stateful ( - "browser-auto-reload", - NULL, - action_state - ); - item = webkit_context_menu_item_new_from_gaction ( - action, _("Reload upon document saving"), NULL); + action = g_simple_action_new_stateful ("browser-auto-reload", + NULL, action_state); + item = webkit_context_menu_item_new_from_gaction (G_ACTION (action), + _("Reload upon document saving"), + NULL); webkit_context_menu_append (menu, item); g_signal_connect (action, "activate", on_item_auto_reload_toggled, NULL); -------------- This E-Mail was brought to you by github_commit_mail.py (Source:
https://github.com/geany/infrastructure
).
1
0
0
0
[geany/geany-plugins] 2ac90e: webhelper: Port link hovering functionality to webkit2gtk
by Chow Loong Jin
09 Mar '23
09 Mar '23
Branch: refs/heads/master Author: Chow Loong Jin <hyperair(a)debian.org> Committer: Colomban Wendling <ban(a)herbesfolles.org> Date: Sun, 05 Feb 2023 22:10:45 UTC Commit: 2ac90ec9937e37f3c61af5cfbd5a4b6ee430b6c4
https://github.com/geany/geany-plugins/commit/2ac90ec9937e37f3c61af5cfbd5a4…
Log Message: ----------- webhelper: Port link hovering functionality to webkit2gtk Modified Paths: -------------- webhelper/src/gwh-browser.c Modified: webhelper/src/gwh-browser.c 20 lines changed, 13 insertions(+), 7 deletions(-) =================================================================== @@ -1114,18 +1114,24 @@ get_statusbar_context_id (GtkStatusbar *statusbar) } static void -on_web_view_hovering_over_link (WebKitWebView *view, - gchar *title, - gchar *uri, - GwhBrowser *self) +on_web_view_mouse_target_changed (WebKitWebView *view, + WebKitHitTestResult *hit_test_result, + guint modifiers, + GwhBrowser *self) { GtkStatusbar *statusbar = GTK_STATUSBAR (self->priv->statusbar); - + const gchar *uri; + if (self->priv->hovered_link) { gtk_statusbar_pop (statusbar, get_statusbar_context_id (statusbar)); g_free (self->priv->hovered_link); self->priv->hovered_link = NULL; } + + if (!webkit_hit_test_result_context_is_link (hit_test_result)) + return; + + uri = webkit_hit_test_result_get_link_uri (hit_test_result); if (uri && *uri) { self->priv->hovered_link = g_strdup (uri); gtk_statusbar_push (statusbar, get_statusbar_context_id (statusbar), @@ -1252,8 +1258,8 @@ gwh_browser_init (GwhBrowser *self) G_CALLBACK (on_web_view_context_menu), self); g_signal_connect (G_OBJECT (self->priv->web_view), "scroll-event", G_CALLBACK (on_web_view_scroll_event), self); - g_signal_connect (G_OBJECT (self->priv->web_view), "hovering-over-link", - G_CALLBACK (on_web_view_hovering_over_link), self); + g_signal_connect (G_OBJECT (self->priv->web_view), "mouse-target-changed", + G_CALLBACK (on_web_view_mouse_target_changed), self); g_signal_connect (G_OBJECT (self->priv->web_view), "leave-notify-event", G_CALLBACK (on_web_view_leave_notify_event), self); g_signal_connect (G_OBJECT (self->priv->web_view), "enter-notify-event", -------------- This E-Mail was brought to you by github_commit_mail.py (Source:
https://github.com/geany/infrastructure
).
1
0
0
0
← Newer
1
...
20
21
22
23
24
25
26
...
547
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
Results per page:
10
25
50
100
200