[nautilus] [eel] remove functions to handle accelerators
- From: Cosimo Cecchi <cosimoc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [nautilus] [eel] remove functions to handle accelerators
- Date: Sat, 21 Aug 2010 16:31:28 +0000 (UTC)
commit 472f3e1433ecb3d5e1a7fc8707975f45dd8d0469
Author: Cosimo Cecchi <cosimoc gnome org>
Date: Sat Aug 21 17:22:53 2010 +0200
[eel] remove functions to handle accelerators
These are unused now.
eel/eel-gtk-extensions.c | 93 ----------------------------------------------
eel/eel-gtk-extensions.h | 3 -
2 files changed, 0 insertions(+), 96 deletions(-)
---
diff --git a/eel/eel-gtk-extensions.c b/eel/eel-gtk-extensions.c
index 35cf005..583132a 100644
--- a/eel/eel-gtk-extensions.c
+++ b/eel/eel-gtk-extensions.c
@@ -83,99 +83,6 @@ eel_gtk_window_get_geometry_string (GtkWindow *window)
}
static void
-send_delete_event (GtkWindow *window)
-{
- /* Synthesize delete_event to close window. */
-
- GdkEvent event;
- GtkWidget *widget;
-
- widget = GTK_WIDGET (window);
-
- event.any.type = GDK_DELETE;
- event.any.window = gtk_widget_get_window (widget);
- event.any.send_event = TRUE;
-
- g_object_ref (event.any.window);
- gtk_main_do_event (&event);
- g_object_unref (event.any.window);
-}
-
-static int
-handle_standard_close_accelerator (GtkWindow *window,
- GdkEventKey *event,
- gpointer user_data)
-{
- g_assert (GTK_IS_WINDOW (window));
- g_assert (event != NULL);
- g_assert (user_data == NULL);
-
- if (eel_gtk_window_event_is_close_accelerator (window, event)) {
- send_delete_event (window);
- g_signal_stop_emission_by_name (
- G_OBJECT (window), "key_press_event");
- return TRUE;
- }
-
- return FALSE;
-}
-
-/**
- * eel_gtk_window_event_is_close_accelerator:
- *
- * Tests whether a key event is a standard window close accelerator.
- * Not needed for clients that use eel_gtk_window_set_up_close_accelerator;
- * use only if you must set up your own key_event handler for your own reasons.
- **/
-gboolean
-eel_gtk_window_event_is_close_accelerator (GtkWindow *window, GdkEventKey *event)
-{
- g_return_val_if_fail (GTK_IS_WINDOW (window), FALSE);
- g_return_val_if_fail (event != NULL, FALSE);
-
- if (event->state & GDK_CONTROL_MASK) {
- /* Note: menu item equivalents are case-sensitive, so we will
- * be case-sensitive here too.
- */
- if (event->keyval == EEL_STANDARD_CLOSE_WINDOW_CONTROL_KEY) {
- return TRUE;
- }
- }
-
-
- return FALSE;
-}
-
-/**
- * eel_gtk_window_set_up_close_accelerator:
- *
- * Sets up the standard keyboard equivalent to close the window.
- * Call this for windows that don't set up a keyboard equivalent to
- * close the window some other way, e.g. via a menu item accelerator.
- *
- * NOTE: do not use for GtkDialog, it already sets up the right
- * stuff here.
- *
- * @window: The GtkWindow that should be hidden when the standard
- * keyboard equivalent is typed.
- **/
-void
-eel_gtk_window_set_up_close_accelerator (GtkWindow *window)
-{
- g_return_if_fail (GTK_IS_WINDOW (window));
-
- if (GTK_IS_DIALOG (window)) {
- g_warning ("eel_gtk_window_set_up_close_accelerator: Should not mess with close accelerator on GtkDialogs");
- return;
- }
-
- g_signal_connect (window,
- "key_press_event",
- G_CALLBACK (handle_standard_close_accelerator),
- NULL);
-}
-
-static void
sanity_check_window_position (int *left, int *top)
{
g_assert (left != NULL);
diff --git a/eel/eel-gtk-extensions.h b/eel/eel-gtk-extensions.h
index 8d80409..a6f8627 100644
--- a/eel/eel-gtk-extensions.h
+++ b/eel/eel-gtk-extensions.h
@@ -71,9 +71,6 @@ void eel_gtk_window_set_initial_geometry_from_string (GtkWindow
guint minimum_width,
guint minimum_height,
gboolean ignore_position);
-void eel_gtk_window_set_up_close_accelerator (GtkWindow *window);
-gboolean eel_gtk_window_event_is_close_accelerator (GtkWindow *window,
- GdkEventKey *event);
char * eel_gtk_window_get_geometry_string (GtkWindow *window);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]