forked from AuroraMiddleware/gtk
Use accessor functions in Win32-only code
This commit is contained in:
parent
dd36afc207
commit
f76fddb8a7
@ -44,7 +44,7 @@ WINUSERAPI HWND WINAPI GetAncestor(HWND,UINT);
|
|||||||
GdkNativeWindow
|
GdkNativeWindow
|
||||||
_gtk_plug_windowing_get_id (GtkPlug *plug)
|
_gtk_plug_windowing_get_id (GtkPlug *plug)
|
||||||
{
|
{
|
||||||
return (GdkNativeWindow) GDK_WINDOW_HWND (GTK_WIDGET (plug)->window);
|
return (GdkNativeWindow) GDK_WINDOW_HWND (gtk_widget_get_window (GTK_WIDGET (plug)));
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
@ -56,7 +56,7 @@ _gtk_plug_windowing_realize_toplevel (GtkPlug *plug)
|
|||||||
{
|
{
|
||||||
_gtk_win32_embed_send (priv->socket_window,
|
_gtk_win32_embed_send (priv->socket_window,
|
||||||
GTK_WIN32_EMBED_PARENT_NOTIFY,
|
GTK_WIN32_EMBED_PARENT_NOTIFY,
|
||||||
(WPARAM) GDK_WINDOW_HWND (GTK_WIDGET (plug)->window),
|
(WPARAM) GDK_WINDOW_HWND (gtk_widget_get_window (GTK_WIDGET (plug))),
|
||||||
GTK_WIN32_EMBED_PROTOCOL_VERSION);
|
GTK_WIN32_EMBED_PROTOCOL_VERSION);
|
||||||
_gtk_win32_embed_send (priv->socket_window,
|
_gtk_win32_embed_send (priv->socket_window,
|
||||||
GTK_WIN32_EMBED_EVENT_PLUG_MAPPED, 0, 0);
|
GTK_WIN32_EMBED_EVENT_PLUG_MAPPED, 0, 0);
|
||||||
|
@ -655,7 +655,7 @@ static HWND
|
|||||||
get_parent_hwnd (GtkWidget *widget)
|
get_parent_hwnd (GtkWidget *widget)
|
||||||
{
|
{
|
||||||
gtk_widget_realize (widget);
|
gtk_widget_realize (widget);
|
||||||
return gdk_win32_drawable_get_handle (widget->window);
|
return gdk_win32_drawable_get_handle (gtk_widget_get_window (widget));
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@ -1339,7 +1339,7 @@ plug_grab_notify (GtkWidget *widget,
|
|||||||
gboolean was_grabbed,
|
gboolean was_grabbed,
|
||||||
GtkPrintOperation *op)
|
GtkPrintOperation *op)
|
||||||
{
|
{
|
||||||
EnableWindow (GetAncestor (GDK_WINDOW_HWND (widget->window), GA_ROOT),
|
EnableWindow (GetAncestor (GDK_WINDOW_HWND (gtk_widget_get_window (widget)), GA_ROOT),
|
||||||
was_grabbed);
|
was_grabbed);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1366,7 +1366,7 @@ pageDlgProc (HWND wnd, UINT message, WPARAM wparam, LPARAM lparam)
|
|||||||
gtk_container_add (GTK_CONTAINER (plug), op->priv->custom_widget);
|
gtk_container_add (GTK_CONTAINER (plug), op->priv->custom_widget);
|
||||||
gtk_widget_show (op->priv->custom_widget);
|
gtk_widget_show (op->priv->custom_widget);
|
||||||
gtk_widget_show (plug);
|
gtk_widget_show (plug);
|
||||||
gdk_window_focus (plug->window, GDK_CURRENT_TIME);
|
gdk_window_focus (gtk_widget_get_window (plug), GDK_CURRENT_TIME);
|
||||||
|
|
||||||
/* This dialog is modal, so we grab the embed widget */
|
/* This dialog is modal, so we grab the embed widget */
|
||||||
gtk_grab_add (plug);
|
gtk_grab_add (plug);
|
||||||
|
@ -893,7 +893,7 @@ gtk_selection_add_target (GtkWidget *widget,
|
|||||||
list = gtk_selection_target_list_get (widget, selection);
|
list = gtk_selection_target_list_get (widget, selection);
|
||||||
gtk_target_list_add (list, target, 0, info);
|
gtk_target_list_add (list, target, 0, info);
|
||||||
#ifdef GDK_WINDOWING_WIN32
|
#ifdef GDK_WINDOWING_WIN32
|
||||||
gdk_win32_selection_add_targets (widget->window, selection, 1, &target);
|
gdk_win32_selection_add_targets (gtk_widget_get_window (widget), selection, 1, &target);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -929,7 +929,7 @@ gtk_selection_add_targets (GtkWidget *widget,
|
|||||||
|
|
||||||
for (i = 0; i < ntargets; ++i)
|
for (i = 0; i < ntargets; ++i)
|
||||||
atoms[i] = gdk_atom_intern (targets[i].target, FALSE);
|
atoms[i] = gdk_atom_intern (targets[i].target, FALSE);
|
||||||
gdk_win32_selection_add_targets (widget->window, selection, ntargets, atoms);
|
gdk_win32_selection_add_targets (gtk_widget_get_window (widget), selection, ntargets, atoms);
|
||||||
g_free (atoms);
|
g_free (atoms);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
@ -45,10 +45,10 @@ _gtk_socket_windowing_get_id (GtkSocket *socket)
|
|||||||
g_return_val_if_fail (GTK_IS_SOCKET (socket), 0);
|
g_return_val_if_fail (GTK_IS_SOCKET (socket), 0);
|
||||||
g_return_val_if_fail (GTK_WIDGET_ANCHORED (socket), 0);
|
g_return_val_if_fail (GTK_WIDGET_ANCHORED (socket), 0);
|
||||||
|
|
||||||
if (!gtk_widget_get_realized (socket))
|
if (!gtk_widget_get_realized (GTK_WIDGET (socket)))
|
||||||
gtk_widget_realize (GTK_WIDGET (socket));
|
gtk_widget_realize (GTK_WIDGET (socket));
|
||||||
|
|
||||||
return (GdkNativeWindow) GDK_WINDOW_HWND (GTK_WIDGET (socket)->window);
|
return (GdkNativeWindow) GDK_WINDOW_HWND (gtk_widget_get_window (GTK_WIDGET (socket)));
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -349,11 +349,11 @@ gtk_win32_embed_widget_focus (GtkWidget *widget,
|
|||||||
if (window->focus_widget)
|
if (window->focus_widget)
|
||||||
{
|
{
|
||||||
/* Wrapped off the end, clear the focus setting for the toplevel */
|
/* Wrapped off the end, clear the focus setting for the toplevel */
|
||||||
parent = window->focus_widget->parent;
|
parent = gtk_widget_get_parent (window->focus_widget);
|
||||||
while (parent)
|
while (parent)
|
||||||
{
|
{
|
||||||
gtk_container_set_focus_child (GTK_CONTAINER (parent), NULL);
|
gtk_container_set_focus_child (GTK_CONTAINER (parent), NULL);
|
||||||
parent = GTK_WIDGET (parent)->parent;
|
parent = gtk_widget_get_parent (GTK_WIDGET (parent));
|
||||||
}
|
}
|
||||||
|
|
||||||
gtk_window_set_focus (GTK_WINDOW (container), NULL);
|
gtk_window_set_focus (GTK_WINDOW (container), NULL);
|
||||||
|
@ -851,7 +851,7 @@ gtk_im_context_ime_set_preedit_font (GtkIMContext *context)
|
|||||||
PangoLanguage *pango_lang = pango_language_from_string (lang);
|
PangoLanguage *pango_lang = pango_language_from_string (lang);
|
||||||
PangoFontset *fontset =
|
PangoFontset *fontset =
|
||||||
pango_context_load_fontset (pango_context,
|
pango_context_load_fontset (pango_context,
|
||||||
widget->style->font_desc,
|
gtk_widget_get_style (widget)->font_desc,
|
||||||
pango_lang);
|
pango_lang);
|
||||||
gunichar *sample =
|
gunichar *sample =
|
||||||
g_utf8_to_ucs4 (pango_language_get_sample_string (pango_lang),
|
g_utf8_to_ucs4 (pango_language_get_sample_string (pango_lang),
|
||||||
@ -873,7 +873,7 @@ gtk_im_context_ime_set_preedit_font (GtkIMContext *context)
|
|||||||
g_object_unref (fontset);
|
g_object_unref (fontset);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
font = pango_context_load_font (pango_context, widget->style->font_desc);
|
font = pango_context_load_font (pango_context, gtk_widget_get_style (widget)->font_desc);
|
||||||
|
|
||||||
if (!font)
|
if (!font)
|
||||||
goto ERROR_OUT;
|
goto ERROR_OUT;
|
||||||
|
Loading…
Reference in New Issue
Block a user