diff options
author | Christian Persch <chpe@cvs.gnome.org> | 2006-01-30 05:47:22 +0800 |
---|---|---|
committer | Christian Persch <chpe@src.gnome.org> | 2006-01-30 05:47:22 +0800 |
commit | bf0ea37b5138af83fde8e7aaba16669c4e43fd9c (patch) | |
tree | 0577a38705f373970c0f167ca73b34e24a33ecd0 /src/ephy-link.c | |
parent | 34e421be7f10496d476266e656ddffe00b42b4e7 (diff) | |
download | gsoc2013-epiphany-bf0ea37b5138af83fde8e7aaba16669c4e43fd9c.tar gsoc2013-epiphany-bf0ea37b5138af83fde8e7aaba16669c4e43fd9c.tar.gz gsoc2013-epiphany-bf0ea37b5138af83fde8e7aaba16669c4e43fd9c.tar.bz2 gsoc2013-epiphany-bf0ea37b5138af83fde8e7aaba16669c4e43fd9c.tar.lz gsoc2013-epiphany-bf0ea37b5138af83fde8e7aaba16669c4e43fd9c.tar.xz gsoc2013-epiphany-bf0ea37b5138af83fde8e7aaba16669c4e43fd9c.tar.zst gsoc2013-epiphany-bf0ea37b5138af83fde8e7aaba16669c4e43fd9c.zip |
Add a convenience function to get current event data.
2006-01-29 Christian Persch <chpe@cvs.gnome.org>
* lib/ephy-gui.c: (ephy_gui_get_current_event):
* lib/ephy-gui.h:
Add a convenience function to get current event data.
* src/ephy-link.c: (ephy_link_open),
(ephy_link_flags_from_current_event):
* src/ephy-link.h:
Add a convenience function to translate the current event
into EphyLinkFlags.
* src/ephy-go-action.c: (ephy_go_action_get_type):
* src/ephy-go-action.h:
Make this an EphyLinkAction.
* lib/widgets/ephy-location-entry.c: (entry_key_press_cb):
* src/ephy-home-action.c: (ephy_home_action_activate):
* src/ephy-location-action.c: (entry_activate_cb):
* src/ephy-tab.c: (open_link_in_new),
(ephy_tab_dom_mouse_click_cb):
* src/window-commands.c: (window_cmd_load_location):
Fix link activation to respect ctrl and shift modifiers.
Part of bug #310814.
2006-01-29 Christian Persch <chpe@cvs.gnome.org>
Diffstat (limited to 'src/ephy-link.c')
-rw-r--r-- | src/ephy-link.c | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/src/ephy-link.c b/src/ephy-link.c index e48758e8c..67be0e221 100644 --- a/src/ephy-link.c +++ b/src/ephy-link.c @@ -25,6 +25,7 @@ #include "ephy-type-builtins.h"
#include "ephy-marshal.h"
#include "ephy-signal-accumulator.h"
+#include "ephy-gui.h"
#include "ephy-debug.h"
enum
@@ -97,3 +98,38 @@ ephy_link_open (EphyLink *link, return new_tab;
}
+
+EphyLinkFlags
+ephy_link_flags_from_current_event (void)
+{
+ GdkEventType type = GDK_NOTHING;
+ guint state = 0, button = (guint) -1;
+ EphyLinkFlags flags = 0;
+
+ ephy_gui_get_current_event (&type, &state, &button);
+
+ if (button == 2 && type == GDK_BUTTON_PRESS)
+ {
+ if (state == GDK_SHIFT_MASK)
+ {
+ flags = EPHY_LINK_NEW_WINDOW;
+ }
+ else
+ {
+ flags = EPHY_LINK_NEW_TAB;
+ }
+ }
+ else
+ {
+ if (state == (GDK_CONTROL_MASK | GDK_SHIFT_MASK))
+ {
+ flags = EPHY_LINK_NEW_WINDOW;
+ }
+ else if (state == GDK_CONTROL_MASK)
+ {
+ flags = EPHY_LINK_NEW_TAB;
+ }
+ }
+
+ return flags;
+}
|