Globally switch to saying "window_id" instead of just "window"

when dealing with native window handles. Also get rid of using
GdkNativeWindow and simply consistently use guint32 all over the
place. This is more obvious and consistent and keeps the diff to the
gtk3-port branch smaller.
This commit is contained in:
Michael Natterer 2011-02-06 12:07:55 +01:00
parent 16b020fc42
commit f4af9b549e
21 changed files with 415 additions and 415 deletions

View File

@ -53,7 +53,7 @@ gimp_gui_init (Gimp *gimp)
gimp->gui.get_theme_dir = NULL;
gimp->gui.display_get_by_id = NULL;
gimp->gui.display_get_id = NULL;
gimp->gui.display_get_window = NULL;
gimp->gui.display_get_window_id = NULL;
gimp->gui.display_create = NULL;
gimp->gui.display_delete = NULL;
gimp->gui.displays_reconnect = NULL;
@ -297,14 +297,14 @@ gimp_get_display_ID (Gimp *gimp,
}
guint32
gimp_get_display_window (Gimp *gimp,
gimp_get_display_window_id (Gimp *gimp,
GimpObject *display)
{
g_return_val_if_fail (GIMP_IS_GIMP (gimp), -1);
g_return_val_if_fail (GIMP_IS_OBJECT (display), -1);
if (gimp->gui.display_get_window)
return gimp->gui.display_get_window (display);
if (gimp->gui.display_get_window_id)
return gimp->gui.display_get_window_id (display);
return -1;
}

View File

@ -53,7 +53,7 @@ struct _GimpGui
GimpObject * (* display_get_by_id) (Gimp *gimp,
gint ID);
gint (* display_get_id) (GimpObject *display);
guint32 (* display_get_window) (GimpObject *display);
guint32 (* display_get_window_id) (GimpObject *display);
GimpObject * (* display_create) (Gimp *gimp,
GimpImage *image,
GimpUnit unit,
@ -104,7 +104,7 @@ GimpObject * gimp_get_display_by_ID (Gimp *gimp,
gint ID);
gint gimp_get_display_ID (Gimp *gimp,
GimpObject *display);
guint32 gimp_get_display_window (Gimp *gimp,
guint32 gimp_get_display_window_id (Gimp *gimp,
GimpObject *display);
GimpObject * gimp_create_display (Gimp *gimp,
GimpImage *image,

View File

@ -71,7 +71,7 @@ static void gimp_pdb_progress_progress_set_value (GimpProgress *progress,
gdouble percentage);
static gdouble gimp_pdb_progress_progress_get_value (GimpProgress *progress);
static void gimp_pdb_progress_progress_pulse (GimpProgress *progress);
static guint32 gimp_pdb_progress_progress_get_window (GimpProgress *progress);
static guint32 gimp_pdb_progress_progress_get_window_id (GimpProgress *progress);
static GObjectClass *parent_class = NULL;
@ -164,7 +164,7 @@ gimp_pdb_progress_progress_iface_init (GimpProgressInterface *iface)
iface->set_value = gimp_pdb_progress_progress_set_value;
iface->get_value = gimp_pdb_progress_progress_get_value;
iface->pulse = gimp_pdb_progress_progress_pulse;
iface->get_window = gimp_pdb_progress_progress_get_window;
iface->get_window_id = gimp_pdb_progress_progress_get_window_id;
}
static void
@ -388,7 +388,7 @@ gimp_pdb_progress_progress_pulse (GimpProgress *progress)
}
static guint32
gimp_pdb_progress_progress_get_window (GimpProgress *progress)
gimp_pdb_progress_progress_get_window_id (GimpProgress *progress)
{
GimpPdbProgress *pdb_progress = GIMP_PDB_PROGRESS (progress);

View File

@ -203,7 +203,7 @@ gimp_progress_pulse (GimpProgress *progress)
}
guint32
gimp_progress_get_window (GimpProgress *progress)
gimp_progress_get_window_id (GimpProgress *progress)
{
GimpProgressInterface *progress_iface;
@ -211,8 +211,8 @@ gimp_progress_get_window (GimpProgress *progress)
progress_iface = GIMP_PROGRESS_GET_INTERFACE (progress);
if (progress_iface->get_window)
return progress_iface->get_window (progress);
if (progress_iface->get_window_id)
return progress_iface->get_window_id (progress);
return 0;
}

View File

@ -48,7 +48,7 @@ struct _GimpProgressInterface
gdouble (* get_value) (GimpProgress *progress);
void (* pulse) (GimpProgress *progress);
guint32 (* get_window) (GimpProgress *progress);
guint32 (* get_window_id) (GimpProgress *progress);
gboolean (* message) (GimpProgress *progress,
Gimp *gimp,
@ -76,7 +76,7 @@ void gimp_progress_set_value (GimpProgress *progress,
gdouble gimp_progress_get_value (GimpProgress *progress);
void gimp_progress_pulse (GimpProgress *progress);
guint32 gimp_progress_get_window (GimpProgress *progress);
guint32 gimp_progress_get_window_id (GimpProgress *progress);
gboolean gimp_progress_message (GimpProgress *progress,
Gimp *gimp,

View File

@ -26,6 +26,7 @@
static void gimp_sub_progress_iface_init (GimpProgressInterface *iface);
static void gimp_sub_progress_finalize (GObject *object);
static GimpProgress * gimp_sub_progress_start (GimpProgress *progress,
@ -39,7 +40,7 @@ static void gimp_sub_progress_set_value (GimpProgress *progres
gdouble percentage);
static gdouble gimp_sub_progress_get_value (GimpProgress *progress);
static void gimp_sub_progress_pulse (GimpProgress *progress);
static guint32 gimp_sub_progress_get_window (GimpProgress *progress);
static guint32 gimp_sub_progress_get_window_id (GimpProgress *progress);
static gboolean gimp_sub_progress_message (GimpProgress *progress,
Gimp *gimp,
GimpMessageSeverity severity,
@ -94,7 +95,7 @@ gimp_sub_progress_iface_init (GimpProgressInterface *iface)
iface->set_value = gimp_sub_progress_set_value;
iface->get_value = gimp_sub_progress_get_value;
iface->pulse = gimp_sub_progress_pulse;
iface->get_window = gimp_sub_progress_get_window;
iface->get_window_id = gimp_sub_progress_get_window_id;
iface->message = gimp_sub_progress_message;
}
@ -163,12 +164,12 @@ gimp_sub_progress_pulse (GimpProgress *progress)
}
static guint32
gimp_sub_progress_get_window (GimpProgress *progress)
gimp_sub_progress_get_window_id (GimpProgress *progress)
{
GimpSubProgress *sub = GIMP_SUB_PROGRESS (progress);
if (sub->progress)
return gimp_progress_get_window (sub->progress);
return gimp_progress_get_window_id (sub->progress);
return 0;
}

View File

@ -97,8 +97,7 @@ static void gimp_display_get_property (GObject *object,
GValue *value,
GParamSpec *pspec);
static GimpProgress *
gimp_display_progress_start (GimpProgress *progress,
static GimpProgress * gimp_display_progress_start (GimpProgress *progress,
const gchar *message,
gboolean cancelable);
static void gimp_display_progress_end (GimpProgress *progress);
@ -109,7 +108,7 @@ static void gimp_display_progress_set_value (GimpProgress *progress,
gdouble percentage);
static gdouble gimp_display_progress_get_value (GimpProgress *progress);
static void gimp_display_progress_pulse (GimpProgress *progress);
static guint32 gimp_display_progress_get_window (GimpProgress *progress);
static guint32 gimp_display_progress_get_window_id (GimpProgress *progress);
static gboolean gimp_display_progress_message (GimpProgress *progress,
Gimp *gimp,
GimpMessageSeverity severity,
@ -185,7 +184,7 @@ gimp_display_progress_iface_init (GimpProgressInterface *iface)
iface->set_value = gimp_display_progress_set_value;
iface->get_value = gimp_display_progress_get_value;
iface->pulse = gimp_display_progress_pulse;
iface->get_window = gimp_display_progress_get_window;
iface->get_window_id = gimp_display_progress_get_window_id;
iface->message = gimp_display_progress_message;
}
@ -347,13 +346,13 @@ gimp_display_progress_pulse (GimpProgress *progress)
}
static guint32
gimp_display_progress_get_window (GimpProgress *progress)
gimp_display_progress_get_window_id (GimpProgress *progress)
{
GimpDisplay *display = GIMP_DISPLAY (progress);
GimpDisplayPrivate *private = GIMP_DISPLAY_GET_PRIVATE (display);
if (private->shell)
return gimp_progress_get_window (GIMP_PROGRESS (private->shell));
return gimp_progress_get_window_id (GIMP_PROGRESS (private->shell));
return 0;
}

View File

@ -98,12 +98,12 @@ gimp_display_shell_progress_pulse (GimpProgress *progress)
}
static guint32
gimp_display_shell_progress_get_window (GimpProgress *progress)
gimp_display_shell_progress_get_window_id (GimpProgress *progress)
{
GtkWidget *toplevel = gtk_widget_get_toplevel (GTK_WIDGET (progress));
if (GTK_IS_WINDOW (toplevel))
return (guint32) gimp_window_get_native (GTK_WINDOW (toplevel));
return gimp_window_get_native_id (GTK_WINDOW (toplevel));
return 0;
}
@ -154,6 +154,6 @@ gimp_display_shell_progress_iface_init (GimpProgressInterface *iface)
iface->set_value = gimp_display_shell_progress_set_value;
iface->get_value = gimp_display_shell_progress_get_value;
iface->pulse = gimp_display_shell_progress_pulse;
iface->get_window = gimp_display_shell_progress_get_window;
iface->get_window_id = gimp_display_shell_progress_get_window_id;
iface->message = gimp_display_shell_progress_message;
}

View File

@ -160,10 +160,10 @@ progress_error_dialog (GimpProgress *progress)
}
else
{
guint32 window = gimp_progress_get_window (progress);
guint32 window_id = gimp_progress_get_window_id (progress);
if (window)
gimp_window_set_transient_for (GTK_WINDOW (dialog), window);
if (window_id)
gimp_window_set_transient_for (GTK_WINDOW (dialog), window_id);
}
}

View File

@ -97,7 +97,7 @@ static GimpObject * gui_get_empty_display (Gimp *gimp);
static GimpObject * gui_display_get_by_ID (Gimp *gimp,
gint ID);
static gint gui_display_get_ID (GimpObject *display);
static guint32 gui_display_get_window (GimpObject *display);
static guint32 gui_display_get_window_id (GimpObject *display);
static GimpObject * gui_display_create (Gimp *gimp,
GimpImage *image,
GimpUnit unit,
@ -153,7 +153,7 @@ gui_vtable_init (Gimp *gimp)
gimp->gui.get_empty_display = gui_get_empty_display;
gimp->gui.display_get_by_id = gui_display_get_by_ID;
gimp->gui.display_get_id = gui_display_get_ID;
gimp->gui.display_get_window = gui_display_get_window;
gimp->gui.display_get_window_id = gui_display_get_window_id;
gimp->gui.display_create = gui_display_create;
gimp->gui.display_delete = gui_display_delete;
gimp->gui.displays_reconnect = gui_displays_reconnect;
@ -311,7 +311,7 @@ gui_display_get_ID (GimpObject *display)
}
static guint32
gui_display_get_window (GimpObject *display)
gui_display_get_window_id (GimpObject *display)
{
GimpDisplay *disp = GIMP_DISPLAY (display);
GimpDisplayShell *shell = gimp_display_get_shell (disp);
@ -321,7 +321,7 @@ gui_display_get_window (GimpObject *display)
GtkWidget *toplevel = gtk_widget_get_toplevel (GTK_WIDGET (shell));
if (GTK_IS_WINDOW (toplevel))
return (guint32) gimp_window_get_native (GTK_WINDOW (toplevel));
return gimp_window_get_native_id (GTK_WINDOW (toplevel));
}
return 0;
@ -499,10 +499,10 @@ gui_pdb_dialog_new (Gimp *gimp,
if (progress)
{
guint32 window = gimp_progress_get_window (progress);
guint32 window_id = gimp_progress_get_window_id (progress);
if (window)
gimp_window_set_transient_for (GTK_WINDOW (dialog), window);
if (window_id)
gimp_window_set_transient_for (GTK_WINDOW (dialog), window_id);
}
gtk_widget_show (dialog);

View File

@ -136,7 +136,7 @@ display_get_window_handle_invoker (GimpProcedure *procedure,
if (success)
{
window = (gint32) gimp_get_display_window (gimp, display);
window = (gint32) gimp_get_display_window_id (gimp, display);
}
return_vals = gimp_procedure_get_return_values (procedure, success,

View File

@ -190,7 +190,7 @@ progress_get_window_handle_invoker (GimpProcedure *procedure,
if (plug_in && plug_in->open)
{
if (! gimp->no_interface)
window = gimp_plug_in_progress_get_window (plug_in);
window = gimp_plug_in_progress_get_window_id (plug_in);
}
else
success = FALSE;

View File

@ -224,7 +224,7 @@ gimp_plug_in_progress_pulse (GimpPlugIn *plug_in)
}
guint32
gimp_plug_in_progress_get_window (GimpPlugIn *plug_in)
gimp_plug_in_progress_get_window_id (GimpPlugIn *plug_in)
{
GimpPlugInProcFrame *proc_frame;
@ -233,7 +233,7 @@ gimp_plug_in_progress_get_window (GimpPlugIn *plug_in)
proc_frame = gimp_plug_in_get_proc_frame (plug_in);
if (proc_frame->progress)
return gimp_progress_get_window (proc_frame->progress);
return gimp_progress_get_window_id (proc_frame->progress);
return 0;
}

View File

@ -34,7 +34,7 @@ void gimp_plug_in_progress_set_text (GimpPlugIn *plug_in,
void gimp_plug_in_progress_set_value (GimpPlugIn *plug_in,
gdouble percentage);
void gimp_plug_in_progress_pulse (GimpPlugIn *plug_in);
guint32 gimp_plug_in_progress_get_window (GimpPlugIn *plug_in);
guint32 gimp_plug_in_progress_get_window_id (GimpPlugIn *plug_in);
gboolean gimp_plug_in_progress_install (GimpPlugIn *plug_in,
const gchar *progress_callback);

View File

@ -86,7 +86,7 @@ static void gimp_file_dialog_progress_set_value (GimpProgress *progr
gdouble percentage);
static gdouble gimp_file_dialog_progress_get_value (GimpProgress *progress);
static void gimp_file_dialog_progress_pulse (GimpProgress *progress);
static guint32 gimp_file_dialog_progress_get_window (GimpProgress *progress);
static guint32 gimp_file_dialog_progress_get_window_id (GimpProgress *progress);
static void gimp_file_dialog_add_user_dir (GimpFileDialog *dialog,
GUserDirectory directory);
@ -162,7 +162,7 @@ gimp_file_dialog_progress_iface_init (GimpProgressInterface *iface)
iface->set_value = gimp_file_dialog_progress_set_value;
iface->get_value = gimp_file_dialog_progress_get_value;
iface->pulse = gimp_file_dialog_progress_pulse;
iface->get_window = gimp_file_dialog_progress_get_window;
iface->get_window_id = gimp_file_dialog_progress_get_window_id;
}
static void
@ -286,11 +286,11 @@ gimp_file_dialog_progress_pulse (GimpProgress *progress)
}
static guint32
gimp_file_dialog_progress_get_window (GimpProgress *progress)
gimp_file_dialog_progress_get_window_id (GimpProgress *progress)
{
GimpFileDialog *dialog = GIMP_FILE_DIALOG (progress);
return (guint32) gimp_window_get_native (GTK_WINDOW (dialog));
return gimp_window_get_native_id (GTK_WINDOW (dialog));
}

View File

@ -372,10 +372,10 @@ gimp_help_browser_error (Gimp *gimp,
if (progress)
{
guint32 window = gimp_progress_get_window (progress);
guint32 window_id = gimp_progress_get_window_id (progress);
if (window)
gimp_window_set_transient_for (GTK_WINDOW (dialog), window);
if (window_id)
gimp_window_set_transient_for (GTK_WINDOW (dialog), window_id);
}
gimp_message_box_set_primary_text (GIMP_MESSAGE_DIALOG (dialog)->box,
@ -627,10 +627,10 @@ gimp_help_query_user_manual_online (GimpIdleHelp *idle_help)
if (idle_help->progress)
{
guint32 window = gimp_progress_get_window (idle_help->progress);
guint32 window_id = gimp_progress_get_window_id (idle_help->progress);
if (window)
gimp_window_set_transient_for (GTK_WINDOW (dialog), window);
if (window_id)
gimp_window_set_transient_for (GTK_WINDOW (dialog), window_id);
}
g_signal_connect (dialog, "response",

View File

@ -822,17 +822,17 @@ gimp_window_set_hint (GtkWindow *window,
}
/**
* gimp_window_get_native:
* gimp_window_get_native_id:
* @window: a #GtkWindow
*
* This function is used to pass a window handle to plug-ins so that
* they can set their dialog windows transient to the parent window.
*
* Return value: a native window handle of the window's #GdkWindow or 0
* Return value: a native window ID of the window's #GdkWindow or 0
* if the window isn't realized yet
*/
GdkNativeWindow
gimp_window_get_native (GtkWindow *window)
guint32
gimp_window_get_native_id (GtkWindow *window)
{
g_return_val_if_fail (GTK_IS_WINDOW (window), 0);
@ -840,12 +840,12 @@ gimp_window_get_native (GtkWindow *window)
#ifdef __GNUC__
#warning gimp_window_get_native() unimplementable for the target windowing system
#endif
return (GdkNativeWindow)0;
return 0;
#endif
#ifdef GDK_WINDOWING_WIN32
if (window && gtk_widget_get_realized (GTK_WIDGET (window)))
return (GdkNativeWindow) GDK_WINDOW_HWND (gtk_widget_get_window (GTK_WIDGET (window)));
return GDK_WINDOW_HWND (gtk_widget_get_window (GTK_WIDGET (window)));
#endif
#ifdef GDK_WINDOWING_X11
@ -853,7 +853,7 @@ gimp_window_get_native (GtkWindow *window)
return GDK_WINDOW_XID (gtk_widget_get_window (GTK_WIDGET (window)));
#endif
return (GdkNativeWindow) 0;
return 0;
}
static void

View File

@ -69,7 +69,7 @@ void gimp_rgb_set_gdk_color (GimpRGB *rgb,
const GdkColor *gdk_color);
void gimp_window_set_hint (GtkWindow *window,
GimpWindowHint hint);
GdkNativeWindow gimp_window_get_native (GtkWindow *window);
guint32 gimp_window_get_native_id (GtkWindow *window);
void gimp_window_set_transient_for (GtkWindow *window,
guint32 parent_ID);
void gimp_toggle_button_set_visible (GtkToggleButton *toggle,

View File

@ -176,8 +176,8 @@ gimp_progress_bar_pulse (gpointer user_data)
gtk_main_iteration ();
}
static GdkNativeWindow
gimp_window_get_native (GtkWindow *window)
static guint32
gimp_window_get_native_id (GtkWindow *window)
{
g_return_val_if_fail (GTK_IS_WINDOW (window), 0);
@ -209,7 +209,7 @@ gimp_progress_bar_get_window (gpointer user_data)
toplevel = gtk_widget_get_toplevel (GTK_WIDGET (bar));
if (GTK_IS_WINDOW (toplevel))
return (guint32) gimp_window_get_native (GTK_WINDOW (toplevel));
return gimp_window_get_native_id (GTK_WINDOW (toplevel));
return 0;
}

View File

@ -141,7 +141,7 @@ HELP
%invoke = (
code => <<'CODE'
{
window = (gint32) gimp_get_display_window (gimp, display);
window = (gint32) gimp_get_display_window_id (gimp, display);
}
CODE
);

View File

@ -197,7 +197,7 @@ HELP
if (plug_in && plug_in->open)
{
if (! gimp->no_interface)
window = gimp_plug_in_progress_get_window (plug_in);
window = gimp_plug_in_progress_get_window_id (plug_in);
}
else
success = FALSE;