diff options
author | Cosimo Cecchi <cosimoc@gnome.org> | 2012-01-25 17:52:54 -0500 |
---|---|---|
committer | Cosimo Cecchi <cosimoc@gnome.org> | 2012-01-25 19:18:53 -0500 |
commit | 07b354c2df075fc3e56ce0296873edbdaddc05e6 (patch) | |
tree | 34a7c94349138f8a37e01ad255df4c0ede3f6bd4 /src/screenshot-area-selection.c | |
parent | cb91896ed910e2afa04a80daa2f80f3f50d4a7a9 (diff) | |
download | gnome-screenshot-07b354c2df075fc3e56ce0296873edbdaddc05e6.tar.gz |
screenshot: port to GApplication
This further cleans up the screenshot setup code, and will allow us to
use GApplication facilities for unique application instead of using a X
selection.
Diffstat (limited to 'src/screenshot-area-selection.c')
-rw-r--r-- | src/screenshot-area-selection.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/screenshot-area-selection.c b/src/screenshot-area-selection.c index 9179815..fc01f86 100644 --- a/src/screenshot-area-selection.c +++ b/src/screenshot-area-selection.c @@ -205,6 +205,7 @@ create_select_window (void) typedef struct { GdkRectangle rectangle; SelectAreaCallback callback; + gpointer callback_data; gboolean aborted; } CallbackData; @@ -214,9 +215,9 @@ emit_select_callback_in_idle (gpointer user_data) CallbackData *data = user_data; if (!data->aborted) - data->callback (&data->rectangle); + data->callback (&data->rectangle, data->callback_data); else - data->callback (NULL); + data->callback (NULL, data->callback_data); g_slice_free (CallbackData, data); @@ -224,7 +225,8 @@ emit_select_callback_in_idle (gpointer user_data) } void -screenshot_select_area_async (SelectAreaCallback callback) +screenshot_select_area_async (SelectAreaCallback callback, + gpointer callback_data) { GdkCursor *cursor; select_area_filter_data data; @@ -243,6 +245,7 @@ screenshot_select_area_async (SelectAreaCallback callback) cb_data = g_slice_new0 (CallbackData); cb_data->callback = callback; + cb_data->callback_data = callback_data; g_signal_connect (data.window, "key-press-event", G_CALLBACK (select_area_key_press), &data); g_signal_connect (data.window, "button-press-event", G_CALLBACK (select_area_button_press), &data); |