Merge branch 'master' into treeview-refactor

This commit is contained in:
Tristan Van Berkom 2010-12-08 15:24:49 +09:00
commit a47a557fc3
73 changed files with 3793 additions and 4809 deletions

42
NEWS
View File

@ -1,3 +1,45 @@
Overview of Changes from GTK+ 2.91.5 to 2.91.6
==============================================
* Deprecations, cleanups and API changes:
- GdkDrawable and some X11-specific APIs have been removed
- GtkStyle and GtkRcStyle have been deprecated
- The GdkWindowClass enumeration is now GdkWindowWindowClass
- gdk_window_get_geometry lost its depth argument
- The old, unused gtk_decorated_window_... functions have
been removed.
* GtkComboBox has gained an 'active id' property that is
intended for easy binding to settings
* GtkAppChooser: A new family of widgets that allow choosing
an application to open a file. This is strongly based on
the corresponding nautilus dialog, which it is replacing.
* The GtkStyleContext branch has been merged, changing the APIs
that are used to do themed drawing, and the theme engine interfaces.
Among the new classes are GtkStyleContext (replacing GtkStyle) and
GtkCssProvider (replacing the gtkrc parser). The migration guide
contains a chapter about porting from GtkStyle to GtkStyleContext.
* Bugs fixed:
549720 Add a way to hide GtkScale's slider
582557 need open with dialog box to use with IBM's Lotus Notes...
619148 "active ID" properties (GtkComboBox)
636060 use ATK_DEFINE_TYPE where possible
636129 invalid uninstantiatable type `(null)' in cast to `GtkSpinner'
636388 gtk3-demo craches (segfault) when pressing a key in the textarea...
636511 New style override functions do not work on textview
* Updated translations:
Estonian
Galician
Hebrew
Persian
Slovenian
Spanish
Overview of Changes from GTK+ 2.91.4 to 2.91.5
==============================================

View File

@ -10,7 +10,7 @@
m4_define([gtk_major_version], [2])
m4_define([gtk_minor_version], [91])
m4_define([gtk_micro_version], [6])
m4_define([gtk_micro_version], [7])
m4_define([gtk_interface_age], [0])
m4_define([gtk_binary_age],
[m4_eval(100 * gtk_minor_version + gtk_micro_version)])
@ -19,7 +19,7 @@ m4_define([gtk_version],
# This is the X.Y used in -lgtk-FOO-X.Y
m4_define([gtk_api_version], [3.0])
AC_PREREQ([2.64])
AC_PREREQ([2.62])
AC_INIT([gtk+], [gtk_version],
[http://bugzilla.gnome.org/enter_bug.cgi?product=gtk%2B],
[gtk+])

View File

@ -328,7 +328,7 @@ HTML_IMAGES = \
$(srcdir)/images/layout-tbrl.png \
$(srcdir)/images/window-default.png \
$(srcdir)/images/hello-world.png \
$(srcdir)/images/switch.png
$(srcdir)/images/switch.png \
$(srcdir)/images/linear.png \
$(srcdir)/images/ease.png \
$(srcdir)/images/ease-in-out.png \

View File

@ -5406,6 +5406,12 @@ gtk_widget_path_iter_set_widget_type
gtk_widget_path_length
gtk_widget_path_new
gtk_widget_path_prepend_type
<SUBSECTION Standard>
GTK_TYPE_WIDGET_PATH
<SUBSECTION Private>
gtk_widget_path_get_type
</SECTION>
<SECTION>

View File

@ -1,6 +1,7 @@
<?xml version="1.0"?>
<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
"http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [
<!ENTITY % local.common.attrib "xmlns:xi CDATA #FIXED 'http://www.w3.org/2003/XInclude'">
]>
<chapter id="gtk-migrating-2-to-3">
<title>Migrating from GTK+ 2.x to GTK+ 3</title>
@ -954,6 +955,8 @@ gtk_arrow_draw (GtkWidget *widget,
</para>
</section>
<xi:include href="migrating-GtkStyleContext.xml" />
</section>
</chapter>

View File

@ -1,9 +1,9 @@
<?xml version="1.0"?>
<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
<!DOCTYPE section PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
"http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [
]>
<chapter id="gtk-migrating-GtkStyleContext">
<title>Migrating from GtkStyle to GtkStyleContext</title>
<section id="gtk-migrating-GtkStyleContext">
<title>Theming changes</title>
<para>
In GTK+ 3.0, #GtkStyleContext was added to replace #GtkStyle and
@ -14,7 +14,7 @@
porting applications, libraries and widgets.
</para>
<refsect2 id="gtk-migrating-GtkStyleContext-themes">
<section id="gtk-migrating-GtkStyleContext-themes">
<title>Migrating themes</title>
<para>
@ -27,9 +27,9 @@
with possible variants such as the dark theme being named
<filename>gtk-dark.css</filename> in the same directory.
</para>
</refsect2>
</section>
<refsect2 id="gtk-migrating-theme-GtkStyleContext-engines">
<section id="gtk-migrating-theme-GtkStyleContext-engines">
<title>Migrating theme engines</title>
<para>
@ -141,9 +141,9 @@
attempt to handle.
</para>
</refsect2>
</section>
<refsect2 id="gtk-migrating-GtkStyleContext-parser-extensions">
<section id="gtk-migrating-GtkStyleContext-parser-extensions">
<title>Extending the CSS parser</title>
<para>
@ -175,9 +175,9 @@
style property can be modified in CSS as
<literal>-GtkWidget-focus-line-width</literal>.
</para>
</refsect2>
</section>
<refsect2 id="gtk-migrating-GtkStyleContext-css">
<section id="gtk-migrating-GtkStyleContext-css">
<title>Using the CSS file format</title>
<para>
@ -358,6 +358,15 @@
independently.
</para>
<para>
In the same vein, the light, dark and mid color variants that
were available in GtkStyle should be replaced by a combination of
symbolic colors and custom CSS, where necessary. text_aa should
really not be used anywhere, anyway, and the white and black colors
that were available in GtkStyle can just be replaced by literal
GdkRGBA structs.
</para>
<para>
Access to colors has also changed a bit. With #GtkStyle, the common
way to access colors is:
@ -393,9 +402,9 @@
It is worth mentioning that the new file format does not support
custom keybindings nor stock icon mappings as the RC format did.
</para>
</refsect2>
</section>
<refsect2 id="gtk-migrating-GtkStyleContext-checklist">
<section id="gtk-migrating-GtkStyleContext-checklist">
<title>A checklist for widgets</title>
<para>
@ -486,15 +495,34 @@
</listitem>
<listitem>
<para>
Replace all <literal>gtk_paint_*()</literal> calls with corresponding
<literal>gtk_render_*()</literal> calls. The most distinctive changes
are the use of #GtkStateFlags to represent the widget state and the
lack of #GtkShadowType. For gtk_render_check() and gtk_render_option(),
the @shadow_type parameter is replaced by the #GTK_STATE_FLAG_ACTIVE
and #GTK_STATE_FLAG_INCONSISTENT state flags. For things such as
pressed/unpressed button states, #GTK_STATE_FLAG_ACTIVE is used, and
the CSS may style normal/active states differently to render
<literal>gtk_render_*()</literal> calls.
</para>
<para>
The most distinctive changes are the use of #GtkStateFlags to
represent the widget state and the lack of #GtkShadowType. Note
that widget state is now passed implicitly via the context, so
to render in a certain state, you have to temporarily set the
state on the context, as in the following example:
</para>
<example>
<title>Rendering with a specific state</title>
<programlisting>
gtk_style_context_save (context);
gtk_style_context_set_state (context, GTK_STATE_FLAG_ACTIVE);
gtk_render_check (context, cr, x, y, width, height);
gtk_style_context_restore (context);
</programlisting>
</example>
<para>
For gtk_render_check() and gtk_render_option(), the @shadow_type
parameter is replaced by the #GTK_STATE_FLAG_ACTIVE and
#GTK_STATE_FLAG_INCONSISTENT state flags. For things such as
pressed/unpressed button states, #GTK_STATE_FLAG_ACTIVE is used,
and the CSS may style normal/active states differently to render
outset/inset borders, respectively.
</para>
</listitem>
<listitem>
@ -515,9 +543,9 @@
of this is merely a guideline. Widgets may choose to follow it or not.
</listitem>
</orderedlist>
</refsect2>
</section>
<refsect2 id="gtk-migrating-GtkStyleContext-parsing">
<section id="gtk-migrating-GtkStyleContext-parsing">
<title>Parsing of custom resources</title>
<para>
As a consequence of the RC format going away, calling gtk_rc_parse() or
@ -534,9 +562,9 @@
by implementing the #GtkStyleProvider interface yourself. This is
an advanced feature that should be rarely used.
</para>
</refsect2>
</section>
<refsect2 id="gtk-migrating-GtkStyleContext-bonus-points">
<section id="gtk-migrating-GtkStyleContext-bonus-points">
<title>Bonus points</title>
<para>
@ -627,5 +655,5 @@
</para>
</listitem>
</orderedlist>
</refsect2>
</chapter>
</section>
</section>

View File

@ -764,10 +764,11 @@ _gdk_display_enable_motion_hints (GdkDisplay *display,
* gdk_display_get_device_state:
* @display: a #GdkDisplay.
* @device: device to query status to.
* @screen: location to store the #GdkScreen the @device is on, or %NULL.
* @x: location to store root window X coordinate of @device, or %NULL.
* @y: location to store root window Y coordinate of @device, or %NULL.
* @mask: location to store current modifier mask for @device, or %NULL.
* @screen: (out) (transfer none) (allow-none): location to store the #GdkScreen
* the @device is on, or %NULL.
* @x: (out) (allow-none): location to store root window X coordinate of @device, or %NULL.
* @y: (out) (allow-none): location to store root window Y coordinate of @device, or %NULL.
* @mask: (out) (allow-none): location to store current modifier mask for @device, or %NULL.
*
* Gets the current location and state of @device for a given display.
*
@ -804,8 +805,10 @@ gdk_display_get_device_state (GdkDisplay *display,
* gdk_display_get_window_at_device_position:
* @display: a #GdkDisplay.
* @device: #GdkDevice to query info to.
* @win_x: return location for the X coordinate of the device location, relative to the window origin, or %NULL.
* @win_y: return location for the Y coordinate of the device location, relative to the window origin, or %NULL.
* @win_x: (out) (allow-none): return location for the X coordinate of the device location,
* relative to the window origin, or %NULL.
* @win_y: (out) (allow-none): return location for the Y coordinate of the device location,
* relative to the window origin, or %NULL.
*
* Obtains the window underneath @device, returning the location of the device in @win_x and @win_y. Returns
* %NULL if the window tree under @device is not known to GDK (for example, belongs to another application).
@ -839,8 +842,8 @@ gdk_display_get_window_at_device_position (GdkDisplay *display,
/**
* gdk_display_set_device_hooks:
* @display: a #GdkDisplay.
* @new_hooks: a table of pointers to functions for getting quantities related to all
* devices position, or %NULL to restore the default table.
* @new_hooks: (allow-none): a table of pointers to functions for getting quantities related
* to all devices position, or %NULL to restore the default table.
*
* This function allows for hooking into the operation of getting the current location of any
* #GdkDevice on a particular #GdkDisplay. This is only useful for such low-level tools as
@ -1054,7 +1057,7 @@ multihead_default_window_at_pointer (GdkDisplay *display,
/**
* gdk_display_set_pointer_hooks:
* @display: a #GdkDisplay
* @new_hooks: a table of pointers to functions for getting
* @new_hooks: (allow-none): a table of pointers to functions for getting
* quantities related to the current pointer position,
* or %NULL to restore the default table.
*
@ -1155,7 +1158,7 @@ singlehead_default_window_at_pointer (GdkScreen *screen,
/**
* gdk_set_pointer_hooks:
* @new_hooks: a table of pointers to functions for getting
* @new_hooks: (allow-none): a table of pointers to functions for getting
* quantities related to the current pointer position,
* or %NULL to restore the default table.
*
@ -1745,8 +1748,8 @@ _gdk_display_pointer_info_foreach (GdkDisplay *display,
* gdk_device_grab_info_libgtk_only:
* @display: the display for which to get the grab information
* @device: device to get the grab information from
* @grab_window: location to store current grab window
* @owner_events: location to store boolean indicating whether
* @grab_window: (out) (transfer none): location to store current grab window
* @owner_events: (out): location to store boolean indicating whether
* the @owner_events flag to gdk_keyboard_grab() or
* gdk_pointer_grab() was %TRUE.
*

View File

@ -385,10 +385,6 @@ void _gdk_windowing_window_process_updates_recurse (GdkWindow *window,
void _gdk_windowing_before_process_all_updates (void);
void _gdk_windowing_after_process_all_updates (void);
/* Return the number of bits-per-pixel for images of the specified depth. */
gint _gdk_windowing_get_bits_for_depth (GdkDisplay *display,
gint depth);
#define GDK_WINDOW_IS_MAPPED(window) (((window)->state & GDK_WINDOW_STATE_WITHDRAWN) == 0)

View File

@ -549,8 +549,7 @@ gdk_offscreen_window_get_geometry (GdkWindow *window,
gint *x,
gint *y,
gint *width,
gint *height,
gint *depth)
gint *height)
{
if (!GDK_WINDOW_DESTROYED (window))
{
@ -562,8 +561,6 @@ gdk_offscreen_window_get_geometry (GdkWindow *window,
*width = window->width;
if (height)
*height = window->height;
if (depth)
*depth = window->depth;
}
}

View File

@ -32,11 +32,31 @@
* SECTION:rgba_colors
* @Short_description: RGBA colors
* @Title: RGBA Colors
*
* The #GdkRGBA struct is a convenient way to pass rgba colors around.
* It's based on cairo's way to deal with colors and mirros its behavior.
* All values are in the range from 0.0 to 1.0 inclusive. So the color
* (0.0, 0.0, 0.0, 0.0) represents transparent black and
* (1.0, 1.0, 1.0, 1.0) is opaque white. Other values will be clamped
* to this range when drawing.
*/
G_DEFINE_BOXED_TYPE (GdkRGBA, gdk_rgba,
gdk_rgba_copy, gdk_rgba_free)
/**
* GdkRGBA:
* @red: The intensity of the red channel from 0.0 to 1.0 inclusive.
* @green: The intensity of the green channel from 0.0 to 1.0 inclusive.
* @blue: The intensity of the blue channel from 0.0 to 1.0 inclusive.
* @alpha: The opacity of the color from 0.0 for completely translucent to
* 1.0 for opaque.
*
* The GdkRGBA structure is used to pass around color data. When using it
* as struct members or on the stack, you want to use the struct directly
* and not allocate it.
*/
/**
* gdk_rgba_copy:
* @rgba: a #GdkRGBA
@ -49,7 +69,7 @@ G_DEFINE_BOXED_TYPE (GdkRGBA, gdk_rgba,
* Since: 3.0
**/
GdkRGBA *
gdk_rgba_copy (GdkRGBA *rgba)
gdk_rgba_copy (const GdkRGBA *rgba)
{
GdkRGBA *copy;

View File

@ -45,7 +45,7 @@ struct _GdkRGBA
#define GDK_TYPE_RGBA (gdk_rgba_get_type ())
GdkRGBA * gdk_rgba_copy (GdkRGBA *rgba);
GdkRGBA * gdk_rgba_copy (const GdkRGBA *rgba);
void gdk_rgba_free (GdkRGBA *rgba);
gboolean gdk_rgba_parse (GdkRGBA *rgba,

View File

@ -304,7 +304,7 @@ gdk_screen_get_monitor_at_window (GdkScreen *screen,
g_return_val_if_fail (GDK_IS_SCREEN (screen), -1);
gdk_window_get_geometry (window, &win_rect.x, &win_rect.y, &win_rect.width,
&win_rect.height, NULL);
&win_rect.height);
gdk_window_get_origin (window, &win_rect.x, &win_rect.y);
num_monitors = gdk_screen_get_n_monitors (screen);

View File

@ -6809,7 +6809,6 @@ gdk_window_set_device_cursor (GdkWindow *window,
* @y: (out) (allow-none): return location for Y coordinate of window (relative to its parent)
* @width: (out) (allow-none): return location for width of window
* @height: (out) (allow-none): return location for height of window
* @depth: (out) (allow-none): return location for bit depth of window
*
* Any of the return location arguments to this function may be %NULL,
* if you aren't interested in getting the value of that field.
@ -6839,8 +6838,7 @@ gdk_window_get_geometry (GdkWindow *window,
gint *x,
gint *y,
gint *width,
gint *height,
gint *depth)
gint *height)
{
GdkWindow *parent;
GdkWindowImplClass *impl_class;
@ -6861,8 +6859,7 @@ gdk_window_get_geometry (GdkWindow *window,
{
impl_class = GDK_WINDOW_IMPL_GET_CLASS (window->impl);
impl_class->get_geometry (window, x, y,
width, height,
depth);
width, height);
/* This reports the position wrt to the native parent, we need to convert
it to be relative to the client side parent */
parent = window->parent;
@ -6884,8 +6881,6 @@ gdk_window_get_geometry (GdkWindow *window,
*width = window->width;
if (height)
*height = window->height;
if (depth)
*depth = window->depth;
}
}
}

View File

@ -474,7 +474,6 @@ struct _GdkPointerHooks
gint *win_y);
};
typedef struct _GdkWindowObject GdkWindowObject;
typedef struct _GdkWindowClass GdkWindowClass;
#define GDK_TYPE_WINDOW (gdk_window_get_type ())
@ -720,8 +719,7 @@ void gdk_window_get_geometry (GdkWindow *window,
gint *x,
gint *y,
gint *width,
gint *height,
gint *depth);
gint *height);
int gdk_window_get_width (GdkWindow *window);
int gdk_window_get_height (GdkWindow *window);
void gdk_window_get_position (GdkWindow *window,

View File

@ -91,8 +91,7 @@ struct _GdkWindowImplClass
gint *x,
gint *y,
gint *width,
gint *height,
gint *depth);
gint *height);
gint (* get_root_coords) (GdkWindow *window,
gint x,
gint y,

View File

@ -68,8 +68,7 @@
-(void)drawRect:(NSRect)rect
{
GdkRectangle gdk_rect;
GdkWindowObject *private = GDK_WINDOW_OBJECT (gdk_window);
GdkWindowImplQuartz *impl = GDK_WINDOW_IMPL_QUARTZ (private->impl);
GdkWindowImplQuartz *impl = GDK_WINDOW_IMPL_QUARTZ (gdk_window->impl);
const NSRect *drawn_rects;
NSInteger count;
int i;
@ -78,7 +77,7 @@
if (GDK_WINDOW_DESTROYED (gdk_window))
return;
if (!(private->event_mask & GDK_EXPOSURE_MASK))
if (!(gdk_window->event_mask & GDK_EXPOSURE_MASK))
return;
if (NSEqualRects (rect, NSZeroRect))
@ -127,8 +126,7 @@
*/
-(void)updateTrackingRect
{
GdkWindowObject *private = GDK_WINDOW_OBJECT (gdk_window);
GdkWindowImplQuartz *impl = GDK_WINDOW_IMPL_QUARTZ (private->impl);
GdkWindowImplQuartz *impl = GDK_WINDOW_IMPL_QUARTZ (gdk_window->impl);
NSRect rect;
if (!impl->toplevel)

View File

@ -140,7 +140,6 @@
-(void)windowDidMove:(NSNotification *)aNotification
{
GdkWindow *window = [[self contentView] gdkWindow];
GdkWindowObject *private = (GdkWindowObject *)window;
GdkEvent *event;
_gdk_quartz_window_update_position (window);
@ -148,10 +147,10 @@
/* Synthesize a configure event */
event = gdk_event_new (GDK_CONFIGURE);
event->configure.window = g_object_ref (window);
event->configure.x = private->x;
event->configure.y = private->y;
event->configure.width = private->width;
event->configure.height = private->height;
event->configure.x = window->x;
event->configure.y = window->y;
event->configure.width = window->width;
event->configure.height = window->height;
_gdk_event_queue_append (gdk_display_get_default (), event);
}
@ -160,23 +159,22 @@
{
NSRect content_rect = [self contentRectForFrameRect:[self frame]];
GdkWindow *window = [[self contentView] gdkWindow];
GdkWindowObject *private = (GdkWindowObject *)window;
GdkEvent *event;
private->width = content_rect.size.width;
private->height = content_rect.size.height;
window->width = content_rect.size.width;
window->height = content_rect.size.height;
[[self contentView] setFrame:NSMakeRect (0, 0, private->width, private->height)];
[[self contentView] setFrame:NSMakeRect (0, 0, window->width, window->height)];
_gdk_window_update_size (window);
/* Synthesize a configure event */
event = gdk_event_new (GDK_CONFIGURE);
event->configure.window = g_object_ref (window);
event->configure.x = private->x;
event->configure.y = private->y;
event->configure.width = private->width;
event->configure.height = private->height;
event->configure.x = window->x;
event->configure.y = window->y;
event->configure.width = window->width;
event->configure.height = window->height;
_gdk_event_queue_append (gdk_display_get_default (), event);
}
@ -199,8 +197,7 @@
-(BOOL)canBecomeMainWindow
{
GdkWindow *window = [[self contentView] gdkWindow];
GdkWindowObject *private = (GdkWindowObject *)window;
GdkWindowImplQuartz *impl = GDK_WINDOW_IMPL_QUARTZ (private->impl);
GdkWindowImplQuartz *impl = GDK_WINDOW_IMPL_QUARTZ (window->impl);
switch (impl->type_hint)
{
@ -229,16 +226,15 @@
-(BOOL)canBecomeKeyWindow
{
GdkWindow *window = [[self contentView] gdkWindow];
GdkWindowObject *private = (GdkWindowObject *)window;
GdkWindowImplQuartz *impl = GDK_WINDOW_IMPL_QUARTZ (private->impl);
GdkWindowImplQuartz *impl = GDK_WINDOW_IMPL_QUARTZ (window->impl);
if (!private->accept_focus)
if (!window->accept_focus)
return NO;
/* Popup windows should not be able to get focused in the window
* manager sense, it's only handled through grabs.
*/
if (private->window_type == GDK_WINDOW_TEMP)
if (window->window_type == GDK_WINDOW_TEMP)
return NO;
switch (impl->type_hint)
@ -268,8 +264,7 @@
- (void)showAndMakeKey:(BOOL)makeKey
{
GdkWindow *window = [[self contentView] gdkWindow];
GdkWindowObject *private = (GdkWindowObject *)window;
GdkWindowImplQuartz *impl = GDK_WINDOW_IMPL_QUARTZ (private->impl);
GdkWindowImplQuartz *impl = GDK_WINDOW_IMPL_QUARTZ (window->impl);
inShowOrHide = YES;
@ -284,8 +279,7 @@
- (void)hide
{
GdkWindow *window = [[self contentView] gdkWindow];
GdkWindowObject *private = (GdkWindowObject *)window;
GdkWindowImplQuartz *impl = GDK_WINDOW_IMPL_QUARTZ (private->impl);
GdkWindowImplQuartz *impl = GDK_WINDOW_IMPL_QUARTZ (window->impl);
inShowOrHide = YES;
[impl->toplevel orderOut:nil];

View File

@ -27,8 +27,6 @@ libgdk_quartz_la_SOURCES = \
gdkdevicemanager-core.c \
gdkdisplay-quartz.c \
gdkdnd-quartz.c \
gdkdrawable-quartz.c \
gdkdrawable-quartz.h \
gdkevents-quartz.c \
gdkeventloop-quartz.c \
gdkgeometry-quartz.c \

View File

@ -188,8 +188,7 @@ gdk_device_core_query_state_helper (GdkWindow *window,
gint *y,
GdkModifierType *mask)
{
GdkWindowObject *toplevel;
GdkWindowObject *private;
GdkWindow *toplevel;
NSPoint point;
gint x_tmp, y_tmp;
GdkWindow *found_window;
@ -204,7 +203,7 @@ gdk_device_core_query_state_helper (GdkWindow *window,
return NULL;
}
toplevel = GDK_WINDOW_OBJECT (gdk_window_get_effective_toplevel (window));
toplevel = gdk_window_get_effective_toplevel (window);
*mask = _gdk_quartz_events_get_current_event_mask ();
@ -220,15 +219,14 @@ gdk_device_core_query_state_helper (GdkWindow *window,
NSWindow *nswindow;
impl = GDK_WINDOW_IMPL_QUARTZ (toplevel->impl);
private = GDK_WINDOW_OBJECT (toplevel);
nswindow = impl->toplevel;
point = [nswindow mouseLocationOutsideOfEventStream];
x_tmp = point.x;
y_tmp = private->height - point.y;
y_tmp = toplevel->height - point.y;
window = (GdkWindow *)toplevel;
window = toplevel;
}
found_window = _gdk_quartz_window_find_child (window, x_tmp, y_tmp,

View File

@ -1,232 +0,0 @@
/* gdkdrawable-quartz.c
*
* Copyright (C) 2005-2007 Imendio AB
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
#include "config.h"
#include <sys/time.h>
#include <cairo-quartz.h>
#include "gdkprivate-quartz.h"
static gpointer parent_class;
static cairo_user_data_key_t gdk_quartz_cairo_key;
typedef struct {
GdkDrawable *drawable;
CGContextRef cg_context;
} GdkQuartzCairoSurfaceData;
static void
gdk_quartz_cairo_surface_destroy (void *data)
{
GdkQuartzCairoSurfaceData *surface_data = data;
GdkDrawableImplQuartz *impl = GDK_DRAWABLE_IMPL_QUARTZ (surface_data->drawable);
impl->cairo_surface = NULL;
gdk_quartz_drawable_release_context (surface_data->drawable,
surface_data->cg_context);
g_free (surface_data);
}
static cairo_surface_t *
gdk_quartz_create_cairo_surface (GdkDrawable *drawable,
int width,
int height)
{
CGContextRef cg_context;
GdkQuartzCairoSurfaceData *surface_data;
cairo_surface_t *surface;
cg_context = gdk_quartz_drawable_get_context (drawable, TRUE);
if (!cg_context)
return NULL;
surface_data = g_new (GdkQuartzCairoSurfaceData, 1);
surface_data->drawable = drawable;
surface_data->cg_context = cg_context;
surface = cairo_quartz_surface_create_for_cg_context (cg_context,
width, height);
cairo_surface_set_user_data (surface, &gdk_quartz_cairo_key,
surface_data,
gdk_quartz_cairo_surface_destroy);
return surface;
}
static cairo_surface_t *
gdk_quartz_ref_cairo_surface (GdkDrawable *drawable)
{
GdkDrawableImplQuartz *impl = GDK_DRAWABLE_IMPL_QUARTZ (drawable);
if (GDK_IS_WINDOW_IMPL_QUARTZ (drawable) &&
GDK_WINDOW_DESTROYED (impl->wrapper))
return NULL;
if (!impl->cairo_surface)
{
impl->cairo_surface =
gdk_quartz_create_cairo_surface (drawable,
gdk_window_get_width (impl->wrapper),
gdk_window_get_height (impl->wrapper));
}
else
cairo_surface_reference (impl->cairo_surface);
return impl->cairo_surface;
}
static void
gdk_drawable_impl_quartz_finalize (GObject *object)
{
G_OBJECT_CLASS (parent_class)->finalize (object);
}
static void
gdk_drawable_impl_quartz_class_init (GdkDrawableImplQuartzClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
GdkDrawableClass *drawable_class = GDK_DRAWABLE_CLASS (klass);
parent_class = g_type_class_peek_parent (klass);
object_class->finalize = gdk_drawable_impl_quartz_finalize;
drawable_class->ref_cairo_surface = gdk_quartz_ref_cairo_surface;
drawable_class->create_cairo_surface = gdk_quartz_create_cairo_surface;
}
GType
gdk_drawable_impl_quartz_get_type (void)
{
static GType object_type = 0;
if (!object_type)
{
const GTypeInfo object_info =
{
sizeof (GdkDrawableImplQuartzClass),
(GBaseInitFunc) NULL,
(GBaseFinalizeFunc) NULL,
(GClassInitFunc) gdk_drawable_impl_quartz_class_init,
NULL, /* class_finalize */
NULL, /* class_data */
sizeof (GdkDrawableImplQuartz),
0, /* n_preallocs */
(GInstanceInitFunc) NULL,
};
object_type = g_type_register_static (GDK_TYPE_DRAWABLE,
"GdkDrawableImplQuartz",
&object_info, 0);
}
return object_type;
}
CGContextRef
gdk_quartz_drawable_get_context (GdkDrawable *drawable,
gboolean antialias)
{
if (!GDK_DRAWABLE_IMPL_QUARTZ_GET_CLASS (drawable)->get_context)
{
g_warning ("%s doesn't implement GdkDrawableImplQuartzClass::get_context()",
G_OBJECT_TYPE_NAME (drawable));
return NULL;
}
return GDK_DRAWABLE_IMPL_QUARTZ_GET_CLASS (drawable)->get_context (drawable, antialias);
}
void
gdk_quartz_drawable_release_context (GdkDrawable *drawable,
CGContextRef cg_context)
{
if (!GDK_DRAWABLE_IMPL_QUARTZ_GET_CLASS (drawable)->release_context)
{
g_warning ("%s doesn't implement GdkDrawableImplQuartzClass::release_context()",
G_OBJECT_TYPE_NAME (drawable));
return;
}
GDK_DRAWABLE_IMPL_QUARTZ_GET_CLASS (drawable)->release_context (drawable, cg_context);
}
/* Help preventing "beam sync penalty" where CG makes all graphics code
* block until the next vsync if we try to flush (including call display on
* a view) too often. We do this by limiting the manual flushing done
* outside of expose calls to less than some frequency when measured over
* the last 4 flushes. This is a bit arbitray, but seems to make it possible
* for some quick manual flushes (such as gtkruler or gimp's marching ants)
* without hitting the max flush frequency.
*
* If drawable NULL, no flushing is done, only registering that a flush was
* done externally.
*/
void
_gdk_quartz_drawable_flush (GdkDrawable *drawable)
{
static struct timeval prev_tv;
static gint intervals[4];
static gint index;
struct timeval tv;
gint ms;
gettimeofday (&tv, NULL);
ms = (tv.tv_sec - prev_tv.tv_sec) * 1000 + (tv.tv_usec - prev_tv.tv_usec) / 1000;
intervals[index++ % 4] = ms;
if (drawable)
{
ms = intervals[0] + intervals[1] + intervals[2] + intervals[3];
/* ~25Hz on average. */
if (ms > 4*40)
{
if (GDK_IS_WINDOW_IMPL_QUARTZ (drawable))
{
GdkWindowImplQuartz *window_impl = GDK_WINDOW_IMPL_QUARTZ (drawable);
[window_impl->toplevel flushWindow];
}
prev_tv = tv;
}
}
else
prev_tv = tv;
}
void
_gdk_quartz_drawable_finish (GdkDrawable *drawable)
{
GdkDrawableImplQuartz *impl = GDK_DRAWABLE_IMPL_QUARTZ (drawable);
if (impl->cairo_surface)
{
cairo_surface_finish (impl->cairo_surface);
cairo_surface_set_user_data (impl->cairo_surface, &gdk_quartz_cairo_key,
NULL, NULL);
impl->cairo_surface = NULL;
}
}

View File

@ -1,71 +0,0 @@
/* gdkdrawable-quartz.h
*
* Copyright (C) 2005 Imendio AB
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
#ifndef __GDK_DRAWABLE_QUARTZ_H__
#define __GDK_DRAWABLE_QUARTZ_H__
#include <gdk/gdkdrawable.h>
#include <AppKit/AppKit.h>
G_BEGIN_DECLS
/* Drawable implementation for Quartz
*/
typedef struct _GdkDrawableImplQuartz GdkDrawableImplQuartz;
typedef struct _GdkDrawableImplQuartzClass GdkDrawableImplQuartzClass;
#define GDK_TYPE_DRAWABLE_IMPL_QUARTZ (gdk_drawable_impl_quartz_get_type ())
#define GDK_DRAWABLE_IMPL_QUARTZ(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), GDK_TYPE_DRAWABLE_IMPL_QUARTZ, GdkDrawableImplQuartz))
#define GDK_DRAWABLE_IMPL_QUARTZ_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GDK_TYPE_DRAWABLE_IMPL_QUARTZ, GdkDrawableImplQuartzClass))
#define GDK_IS_DRAWABLE_IMPL_QUARTZ(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), GDK_TYPE_DRAWABLE_IMPL_QUARTZ))
#define GDK_IS_DRAWABLE_IMPL_QUARTZ_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GDK_TYPE_DRAWABLE_IMPL_QUARTZ))
#define GDK_DRAWABLE_IMPL_QUARTZ_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_DRAWABLE_IMPL_QUARTZ, GdkDrawableImplQuartzClass))
struct _GdkDrawableImplQuartz
{
GdkDrawable parent_instance;
GdkDrawable *wrapper;
cairo_surface_t *cairo_surface;
};
struct _GdkDrawableImplQuartzClass
{
GdkDrawableClass parent_class;
/* vtable */
CGContextRef (*get_context) (GdkDrawable* drawable,
gboolean antialias);
void (*release_context) (GdkDrawable *drawable,
CGContextRef cg_context);
};
GType gdk_drawable_impl_quartz_get_type (void);
CGContextRef gdk_quartz_drawable_get_context (GdkDrawable *drawable,
gboolean antialias);
void gdk_quartz_drawable_release_context (GdkDrawable *drawable,
CGContextRef context);
G_END_DECLS
#endif /* __GDK_DRAWABLE_QUARTZ_H__ */

View File

@ -374,7 +374,6 @@ generate_motion_event (GdkWindow *window)
NSPoint screen_point;
NSWindow *nswindow;
GdkQuartzView *view;
GdkWindowObject *private;
GdkEvent *event;
gint x, y, x_root, y_root;
GdkDisplay *display;
@ -383,8 +382,7 @@ generate_motion_event (GdkWindow *window)
event->any.window = NULL;
event->any.send_event = TRUE;
private = (GdkWindowObject *)window;
nswindow = ((GdkWindowImplQuartz *)private->impl)->toplevel;
nswindow = ((GdkWindowImplQuartz *)window->impl)->toplevel;
view = (GdkQuartzView *)[nswindow contentView];
display = gdk_window_get_display (window);
@ -396,7 +394,7 @@ generate_motion_event (GdkWindow *window)
point = [nswindow convertScreenToBase:screen_point];
x = point.x;
y = private->height - point.y;
y = window->height - point.y;
event->any.type = GDK_MOTION_NOTIFY;
event->motion.window = window;
@ -464,7 +462,6 @@ _gdk_quartz_events_send_enter_notify_event (GdkWindow *window)
NSPoint point;
NSPoint screen_point;
NSWindow *nswindow;
GdkWindowObject *private;
GdkEvent *event;
gint x, y, x_root, y_root;
@ -472,8 +469,7 @@ _gdk_quartz_events_send_enter_notify_event (GdkWindow *window)
event->any.window = NULL;
event->any.send_event = FALSE;
private = (GdkWindowObject *)window;
nswindow = ((GdkWindowImplQuartz *)private->impl)->toplevel;
nswindow = ((GdkWindowImplQuartz *)window->impl)->toplevel;
screen_point = [NSEvent mouseLocation];
@ -482,7 +478,7 @@ _gdk_quartz_events_send_enter_notify_event (GdkWindow *window)
point = [nswindow convertScreenToBase:screen_point];
x = point.x;
y = private->height - point.y;
y = window->height - point.y;
event->crossing.window = window;
event->crossing.subwindow = NULL;
@ -503,13 +499,12 @@ _gdk_quartz_events_send_enter_notify_event (GdkWindow *window)
void
_gdk_quartz_events_send_map_event (GdkWindow *window)
{
GdkWindowObject *private = (GdkWindowObject *)window;
GdkWindowImplQuartz *impl = GDK_WINDOW_IMPL_QUARTZ (private->impl);
GdkWindowImplQuartz *impl = GDK_WINDOW_IMPL_QUARTZ (window->impl);
if (!impl->toplevel)
return;
if (private->event_mask & GDK_STRUCTURE_MASK)
if (window->event_mask & GDK_STRUCTURE_MASK)
{
GdkEvent event;
@ -533,17 +528,15 @@ find_toplevel_under_pointer (GdkDisplay *display,
toplevel = info->toplevel_under_pointer;
if (toplevel && WINDOW_IS_TOPLEVEL (toplevel))
{
GdkWindowObject *private;
NSWindow *nswindow;
NSPoint point;
private = (GdkWindowObject *)toplevel;
nswindow = ((GdkWindowImplQuartz *)private->impl)->toplevel;
nswindow = ((GdkWindowImplQuartz *)toplevel->impl)->toplevel;
point = [nswindow convertScreenToBase:screen_point];
*x = point.x;
*y = private->height - point.y;
*y = toplevel->height - point.y;
}
return toplevel;
@ -599,13 +592,11 @@ find_toplevel_for_mouse_event (NSEvent *nsevent,
GdkQuartzView *view;
GdkDisplay *display;
GdkDeviceGrabInfo *grab;
GdkWindowObject *private;
view = (GdkQuartzView *)[[nsevent window] contentView];
toplevel = [view gdkWindow];
display = gdk_window_get_display (toplevel);
private = GDK_WINDOW_OBJECT (toplevel);
event_type = [nsevent type];
point = [nsevent locationInWindow];
@ -657,18 +648,16 @@ find_toplevel_for_mouse_event (NSEvent *nsevent,
{
/* Finally check the grab window. */
GdkWindow *grab_toplevel;
GdkWindowObject *grab_private;
NSWindow *grab_nswindow;
grab_toplevel = gdk_window_get_effective_toplevel (grab->window);
grab_private = (GdkWindowObject *)grab_toplevel;
grab_nswindow = ((GdkWindowImplQuartz *)grab_private->impl)->toplevel;
grab_nswindow = ((GdkWindowImplQuartz *)grab_toplevel->impl)->toplevel;
point = [grab_nswindow convertScreenToBase:screen_point];
/* Note: x_root and y_root are already right. */
*x = point.x;
*y = grab_private->height - point.y;
*y = grab_toplevel->height - point.y;
return grab_toplevel;
}
@ -699,13 +688,11 @@ find_toplevel_for_mouse_event (NSEvent *nsevent,
if (toplevel_under_pointer
&& WINDOW_IS_TOPLEVEL (toplevel_under_pointer))
{
GdkWindowObject *toplevel_private;
GdkWindowImplQuartz *toplevel_impl;
toplevel = toplevel_under_pointer;
toplevel_private = (GdkWindowObject *)toplevel;
toplevel_impl = (GdkWindowImplQuartz *)toplevel_private->impl;
toplevel_impl = (GdkWindowImplQuartz *)toplevel->impl;
if ([toplevel_impl->toplevel showsResizeIndicator])
{
@ -756,17 +743,15 @@ find_window_for_ns_event (NSEvent *nsevent,
NSPoint screen_point;
NSEventType event_type;
GdkWindow *toplevel;
GdkWindowObject *private;
view = (GdkQuartzView *)[[nsevent window] contentView];
toplevel = [view gdkWindow];
private = GDK_WINDOW_OBJECT (toplevel);
point = [nsevent locationInWindow];
screen_point = [[nsevent window] convertBaseToScreen:point];
*x = point.x;
*y = private->height - point.y;
*y = toplevel->height - point.y;
_gdk_quartz_window_nspoint_to_gdk_xy (screen_point, x_root, y_root);
@ -934,11 +919,8 @@ fill_scroll_event (GdkWindow *window,
gint y_root,
GdkScrollDirection direction)
{
GdkWindowObject *private;
NSPoint point;
private = GDK_WINDOW_OBJECT (window);
point = [nsevent locationInWindow];
event->any.type = GDK_SCROLL;
@ -1083,17 +1065,13 @@ synthesize_crossing_event (GdkWindow *window,
gint x_root,
gint y_root)
{
GdkWindowObject *private;
private = GDK_WINDOW_OBJECT (window);
switch ([nsevent type])
{
case NSMouseEntered:
/* Enter events are considered always to be from the root window as we
* can't know for sure from what window we enter.
*/
if (!(private->event_mask & GDK_ENTER_NOTIFY_MASK))
if (!(window->event_mask & GDK_ENTER_NOTIFY_MASK))
return FALSE;
fill_crossing_event (window, event, nsevent,
@ -1109,7 +1087,7 @@ synthesize_crossing_event (GdkWindow *window,
* since there is no way to reliably get information about what new
* window is entered when exiting one.
*/
if (!(private->event_mask & GDK_LEAVE_NOTIFY_MASK))
if (!(window->event_mask & GDK_LEAVE_NOTIFY_MASK))
return FALSE;
fill_crossing_event (window, event, nsevent,
@ -1220,14 +1198,13 @@ gdk_event_translate (GdkEvent *event,
/* Apply any window filters. */
if (GDK_IS_WINDOW (window))
{
GdkWindowObject *filter_private = (GdkWindowObject *) window;
GdkFilterReturn result;
if (filter_private->filters)
if (window->filters)
{
g_object_ref (window);
result = gdk_event_apply_filters (nsevent, event, &filter_private->filters);
result = gdk_event_apply_filters (nsevent, event, &window->filters);
g_object_unref (window);
@ -1248,8 +1225,7 @@ gdk_event_translate (GdkEvent *event,
event_type == NSOtherMouseDown ||
event_type == NSLeftMouseDown))
{
GdkWindowObject *private = (GdkWindowObject *)window;
GdkWindowImplQuartz *impl = GDK_WINDOW_IMPL_QUARTZ (private->impl);
GdkWindowImplQuartz *impl = GDK_WINDOW_IMPL_QUARTZ (window->impl);
if (![NSApp isActive])
{

View File

@ -29,8 +29,7 @@ _gdk_quartz_window_translate (GdkWindow *window,
gint dy)
{
cairo_region_t *invalidate, *scrolled;
GdkWindowObject *private = (GdkWindowObject *)window;
GdkWindowImplQuartz *impl = (GdkWindowImplQuartz *)private->impl;
GdkWindowImplQuartz *impl = (GdkWindowImplQuartz *)window->impl;
GdkRectangle extents;
cairo_region_get_extents (area, &extents);

View File

@ -65,7 +65,7 @@ _gdk_input_select_device_events (GdkWindow *impl_window,
GdkDevice *device)
{
guint event_mask;
GdkWindowObject *w;
GdkWindow *w;
GdkInputWindow *iw;
GdkInputMode mode;
gboolean has_cursor;
@ -73,7 +73,7 @@ _gdk_input_select_device_events (GdkWindow *impl_window,
GList *l;
event_mask = 0;
iw = ((GdkWindowObject *)impl_window)->input_window;
iw = impl_window->input_window;
g_object_get (device,
"type", &type,
@ -140,16 +140,14 @@ gdk_input_set_extension_events (GdkWindow *window,
gint mask,
GdkExtensionMode mode)
{
GdkWindowObject *window_private;
GdkWindowObject *impl_window;
GList *tmp_list;
GdkInputWindow *iw;
GdkWindow *impl_window;
g_return_if_fail (window != NULL);
g_return_if_fail (GDK_WINDOW_IS_QUARTZ (window));
window_private = (GdkWindowObject*) window;
impl_window = (GdkWindowObject *)_gdk_window_get_impl_window (window);
impl_window = (GdkWindow *)_gdk_window_get_impl_window (window);
if (mode == GDK_EXTENSION_EVENTS_NONE)
mask = 0;
@ -166,7 +164,7 @@ gdk_input_set_extension_events (GdkWindow *window,
iw->grabbed = FALSE;
_gdk_input_windows = g_list_append (_gdk_input_windows, iw);
window_private->extension_events = mask;
window->extension_events = mask;
/* Add enter window events to the event mask */
/* FIXME, this is not needed for XINPUT_NONE */
@ -183,7 +181,7 @@ gdk_input_set_extension_events (GdkWindow *window,
g_free (iw);
}
window_private->extension_events = 0;
window->extension_events = 0;
}
for (tmp_list = _gdk_input_devices; tmp_list; tmp_list = tmp_list->next)

View File

@ -62,7 +62,7 @@ extern GdkWindow *_gdk_root;
extern GdkDragContext *_gdk_quartz_drag_source_context;
#define GDK_WINDOW_IS_QUARTZ(win) (GDK_IS_WINDOW_IMPL_QUARTZ (((GdkWindowObject *)win)->impl))
#define GDK_WINDOW_IS_QUARTZ(win) (GDK_IS_WINDOW_IMPL_QUARTZ (((GdkWindow *)win)->impl))
/* Initialization */
void _gdk_windowing_update_window_sizes (GdkScreen *screen);
@ -130,10 +130,6 @@ void _gdk_quartz_event_loop_release_event (NSEvent *event);
GdkEventType _gdk_quartz_keys_event_type (NSEvent *event);
gboolean _gdk_quartz_keys_is_modifier (guint keycode);
/* Drawable */
void _gdk_quartz_drawable_finish (GdkDrawable *drawable);
void _gdk_quartz_drawable_flush (GdkDrawable *drawable);
/* Geometry */
void _gdk_quartz_window_scroll (GdkWindow *window,
gint dx,

File diff suppressed because it is too large Load Diff

View File

@ -21,9 +21,9 @@
#ifndef __GDK_WINDOW_QUARTZ_H__
#define __GDK_WINDOW_QUARTZ_H__
#include <gdk/quartz/gdkdrawable-quartz.h>
#import <gdk/quartz/GdkQuartzView.h>
#import <gdk/quartz/GdkQuartzWindow.h>
#include "gdk/gdkwindowimpl.h"
G_BEGIN_DECLS
@ -42,7 +42,9 @@ typedef struct _GdkWindowImplQuartzClass GdkWindowImplQuartzClass;
struct _GdkWindowImplQuartz
{
GdkDrawableImplQuartz parent_instance;
GdkWindowImpl parent_instance;
GdkWindow *wrapper;
NSWindow *toplevel;
NSTrackingRectTag tracking_rect;
@ -60,15 +62,26 @@ struct _GdkWindowImplQuartz
GList *sorted_children;
cairo_region_t *needs_display_region;
cairo_surface_t *cairo_surface;
};
struct _GdkWindowImplQuartzClass
{
GdkDrawableImplQuartzClass parent_class;
GdkWindowImplClass parent_class;
CGContextRef (* get_context) (GdkWindowImplQuartz *window,
gboolean antialias);
void (* release_context) (GdkWindowImplQuartz *window,
CGContextRef cg_context);
};
GType _gdk_window_impl_quartz_get_type (void);
CGContextRef gdk_quartz_window_get_context (GdkWindowImplQuartz *window,
gboolean antialias);
void gdk_quartz_window_release_context (GdkWindowImplQuartz *window,
CGContextRef context);
/* Root window implementation for Quartz
*/

View File

@ -1800,8 +1800,7 @@ gdk_win32_window_get_geometry (GdkWindow *window,
gint *x,
gint *y,
gint *width,
gint *height,
gint *depth)
gint *height)
{
if (!window)
window = _gdk_root;
@ -1848,8 +1847,6 @@ gdk_win32_window_get_geometry (GdkWindow *window,
*width = rect.right - rect.left;
if (height)
*height = rect.bottom - rect.top;
if (depth)
*depth = gdk_window_get_visual (window)->depth;
GDK_NOTE (MISC, g_print ("gdk_win32_window_get_geometry: %p: %ldx%ldx%d@%+ld%+ld\n",
GDK_WINDOW_HWND (window),

View File

@ -559,7 +559,7 @@ gdk_window_cache_new (GdkScreen *screen)
toplevel_windows = gdk_screen_get_toplevel_windows (screen);
for (list = toplevel_windows; list; list = list->next) {
window = GDK_WINDOW (list->data);
gdk_window_get_geometry (window, &x, &y, &width, &height, NULL);
gdk_window_get_geometry (window, &x, &y, &width, &height);
gdk_window_cache_add (result, GDK_WINDOW_XID (window),
x, y, width, height,
gdk_window_is_visible (window));

View File

@ -450,7 +450,7 @@ gdk_x11_screen_get_monitor_output (GdkScreen *screen,
* gdk_screen_get_monitor_geometry:
* @screen: a #GdkScreen
* @monitor_num: the monitor number, between 0 and gdk_screen_get_n_monitors (screen)
* @dest: (out) (allow-none): a #GdkRectangle to be filled with the monitor geometry
* @dest: (out caller-allocates) (allow-none): a #GdkRectangle to be filled with the monitor geometry
*
* Retrieves the #GdkRectangle representing the size and position of
* the individual monitor within the entire screen area.

View File

@ -2739,8 +2739,7 @@ gdk_window_x11_get_geometry (GdkWindow *window,
gint *x,
gint *y,
gint *width,
gint *height,
gint *depth)
gint *height)
{
Window root;
gint tx;
@ -2764,8 +2763,6 @@ gdk_window_x11_get_geometry (GdkWindow *window,
*width = twidth;
if (height)
*height = theight;
if (depth)
*depth = tdepth;
}
}
@ -3229,7 +3226,7 @@ _gdk_windowing_window_at_device_position (GdkDisplay *display,
pointer_window = child;
break;
}
gdk_window_get_geometry (window, NULL, NULL, &width, &height, NULL);
gdk_window_get_geometry (window, NULL, NULL, &width, &height);
if (winx >= 0 && winy >= 0 && winx < width && winy < height)
{
/* A childless toplevel, or below another window? */
@ -5096,7 +5093,7 @@ calculate_unmoving_origin (MoveResizeData *mv_resize)
{
gdk_window_get_frame_extents (mv_resize->moveresize_window, &rect);
gdk_window_get_geometry (mv_resize->moveresize_window,
NULL, NULL, &width, &height, NULL);
NULL, NULL, &width, &height);
switch (mv_resize->moveresize_geometry.win_gravity)
{

View File

@ -432,7 +432,6 @@ gtk_private_h_sources = \
gtktoolpaletteprivate.h \
gtktreedatalist.h \
gtktreeprivate.h \
gtkwindow-decorate.h \
gtkwidgetprivate.h \
$(gtk_clipboard_dnd_h_sources) \
$(gtk_appchooser_impl_h_sources)
@ -674,7 +673,6 @@ gtk_base_c_sources = \
gtkvseparator.c \
gtkwidget.c \
gtkwidgetpath.c \
gtkwindow-decorate.c \
gtkwindow.c \
$(gtk_clipboard_dnd_c_sources) \
$(gtk_appchooser_impl_c_sources)

View File

@ -265,6 +265,7 @@ gtk_border_copy
gtk_border_free
gtk_border_get_type G_GNUC_CONST
gtk_border_new G_GNUC_MALLOC
gtk_border_style_get_type G_GNUC_CONST
gtk_box_get_homogeneous
gtk_box_get_spacing
gtk_box_get_type G_GNUC_CONST
@ -656,6 +657,7 @@ gtk_container_get_focus_chain
gtk_container_get_focus_child
gtk_container_get_focus_hadjustment
gtk_container_get_focus_vadjustment
gtk_container_get_path_for_child
gtk_container_get_resize_mode
gtk_container_get_type G_GNUC_CONST
gtk_container_propagate_draw
@ -670,16 +672,28 @@ gtk_container_set_reallocate_redraws
gtk_container_set_resize_mode
gtk_container_unset_focus_chain
gtk_corner_type_get_type G_GNUC_CONST
gtk_css_provider_error_get_type
gtk_css_provider_error_quark
gtk_css_provider_get_default
gtk_css_provider_get_named
gtk_css_provider_get_type
gtk_css_provider_load_from_data
gtk_css_provider_load_from_file
gtk_css_provider_load_from_path
gtk_css_provider_new
gtk_custom_paper_unix_dialog_get_type G_GNUC_CONST
gtk_debug_flag_get_type G_GNUC_CONST
gtk_decorated_window_calculate_frame_size
gtk_decorated_window_init
gtk_decorated_window_move_resize_window
gtk_decorated_window_set_title
gtk_delete_type_get_type G_GNUC_CONST
gtk_dest_defaults_get_type G_GNUC_CONST
gtk_device_grab_add
gtk_device_grab_remove
gtk_gradient_add_color_stop
gtk_gradient_get_type
gtk_gradient_new_linear
gtk_gradient_new_radial
gtk_gradient_ref
gtk_gradient_resolve
gtk_gradient_unref
gtk_dialog_add_action_widget
gtk_dialog_add_button
gtk_dialog_add_buttons G_GNUC_NULL_TERMINATED
@ -1097,6 +1111,7 @@ gtk_icon_info_get_filename
gtk_icon_info_get_type G_GNUC_CONST
gtk_icon_info_load_icon
gtk_icon_info_load_symbolic
gtk_icon_info_load_symbolic_for_context
gtk_icon_info_load_symbolic_for_style
gtk_icon_info_new_for_pixbuf
gtk_icon_info_set_raw_coordinates
@ -1312,6 +1327,7 @@ gtk_invisible_get_type G_GNUC_CONST
gtk_invisible_new
gtk_invisible_new_for_screen
gtk_invisible_set_screen
gtk_junction_sides_get_type G_GNUC_CONST
gtk_justification_get_type G_GNUC_CONST
gtk_key_snooper_install
gtk_key_snooper_remove
@ -1494,6 +1510,13 @@ gtk_misc_get_padding
gtk_misc_get_type G_GNUC_CONST
gtk_misc_set_alignment
gtk_misc_set_padding
gtk_modifier_style_get_type
gtk_modifier_style_map_color
gtk_modifier_style_new
gtk_modifier_style_set_background_color
gtk_modifier_style_set_color
gtk_modifier_style_set_color_property
gtk_modifier_style_set_font
gtk_mount_operation_get_parent
gtk_mount_operation_get_screen
gtk_mount_operation_get_type G_GNUC_CONST
@ -2121,7 +2144,23 @@ gtk_recent_manager_new
gtk_recent_manager_purge_items
gtk_recent_manager_remove_item
gtk_recent_sort_type_get_type G_GNUC_CONST
gtk_region_flags_get_type G_GNUC_CONST
gtk_relief_style_get_type G_GNUC_CONST
gtk_render_activity
gtk_render_arrow
gtk_render_background
gtk_render_check
gtk_render_expander
gtk_render_extension
gtk_render_focus
gtk_render_frame
gtk_render_frame_gap
gtk_render_handle
gtk_render_icon_pixbuf
gtk_render_layout
gtk_render_line
gtk_render_option
gtk_render_slider
gtk_requisition_copy
gtk_requisition_free
gtk_requisition_get_type G_GNUC_CONST
@ -2287,6 +2326,7 @@ gtk_spinner_new
gtk_spinner_start
gtk_spinner_stop
gtk_spin_type_get_type G_GNUC_CONST
gtk_state_flags_get_type G_GNUC_CONST
gtk_state_type_get_type G_GNUC_CONST
gtk_statusbar_get_context_id
gtk_statusbar_get_message_area
@ -2344,17 +2384,94 @@ gtk_switch_new
gtk_switch_set_active
gtk_style_apply_default_background
gtk_style_attach
gtk_style_context_add_class
gtk_style_context_add_provider
gtk_style_context_add_provider_for_screen
gtk_style_context_add_region
gtk_style_context_get
gtk_style_context_get_background_color
gtk_style_context_get_border
gtk_style_context_get_border_color
gtk_style_context_get_color
gtk_style_context_get_direction
gtk_style_context_get_junction_sides
gtk_style_context_get_margin
gtk_style_context_get_padding
gtk_style_context_get_path
gtk_style_context_get_property
gtk_style_context_get_screen
gtk_style_context_get_state
gtk_style_context_get_style
gtk_style_context_get_style_property
gtk_style_context_get_style_valist
gtk_style_context_get_type
gtk_style_context_get_valist
gtk_style_context_has_class
gtk_style_context_has_region
gtk_style_context_invalidate
gtk_style_context_list_classes
gtk_style_context_list_regions
gtk_style_context_lookup_color
gtk_style_context_lookup_icon_set
gtk_style_context_new
gtk_style_context_notify_state_change
gtk_style_context_pop_animatable_region
gtk_style_context_push_animatable_region
gtk_style_context_remove_class
gtk_style_context_remove_provider
gtk_style_context_remove_provider_for_screen
gtk_style_context_remove_region
gtk_style_context_reset_widgets
gtk_style_context_restore
gtk_style_context_save
gtk_style_context_set_background
gtk_style_context_set_direction
gtk_style_context_set_junction_sides
gtk_style_context_set_path
gtk_style_context_set_screen
gtk_style_context_set_state
gtk_style_context_state_is_running
gtk_style_copy
gtk_style_detach
gtk_style_get
gtk_style_get_style_property
gtk_style_get_type G_GNUC_CONST
gtk_style_get_valist
gtk_style_has_context
gtk_style_lookup_color
gtk_style_lookup_icon_set
gtk_style_new
gtk_style_properties_clear
gtk_style_properties_get
gtk_style_properties_get_property
gtk_style_properties_get_style
gtk_style_properties_get_type
gtk_style_properties_get_valist
gtk_style_properties_lookup_color
gtk_style_properties_lookup_property
gtk_style_properties_map_color
gtk_style_properties_merge
gtk_style_properties_new
gtk_style_properties_register_property
gtk_style_properties_set
gtk_style_properties_set_property
gtk_style_properties_set_valist
gtk_style_properties_unset_property
gtk_style_provider_get_icon_factory
gtk_style_provider_get_style
gtk_style_provider_get_style_property
gtk_style_provider_get_type
gtk_style_render_icon
gtk_style_set_background
gtk_symbolic_color_get_type
gtk_symbolic_color_new_alpha
gtk_symbolic_color_new_literal
gtk_symbolic_color_new_mix
gtk_symbolic_color_new_name
gtk_symbolic_color_new_shade
gtk_symbolic_color_ref
gtk_symbolic_color_resolve
gtk_symbolic_color_unref
gtk_table_attach
gtk_table_attach_defaults
gtk_table_get_col_spacing
@ -2728,6 +2845,31 @@ gtk_text_window_type_get_type G_GNUC_CONST
gtk_theme_engine_create_rc_style
gtk_theme_engine_get
gtk_theme_engine_get_type G_GNUC_CONST
gtk_theming_engine_get
gtk_theming_engine_get_background_color
gtk_theming_engine_get_border
gtk_theming_engine_get_border_color
gtk_theming_engine_get_color
gtk_theming_engine_get_direction
gtk_theming_engine_get_junction_sides
gtk_theming_engine_get_margin
gtk_theming_engine_get_padding
gtk_theming_engine_get_path
gtk_theming_engine_get_property
gtk_theming_engine_get_screen
gtk_theming_engine_get_state
gtk_theming_engine_get_style
gtk_theming_engine_get_style_property
gtk_theming_engine_get_style_valist
gtk_theming_engine_get_type
gtk_theming_engine_get_valist
gtk_theming_engine_has_class
gtk_theming_engine_has_region
gtk_theming_engine_load
gtk_theming_engine_lookup_color
gtk_theming_engine_register_property
gtk_theming_engine_state_is_running
gtk_theming_module_get_type
gtk_toggle_action_get_active
gtk_toggle_action_get_draw_as_radio
gtk_toggle_action_get_type G_GNUC_CONST
@ -3279,6 +3421,7 @@ gtk_widget_get_no_show_all
gtk_widget_get_pango_context
gtk_widget_get_parent
gtk_widget_get_parent_window
gtk_widget_get_path
gtk_widget_get_pointer
gtk_widget_get_preferred_height
gtk_widget_get_preferred_height_for_width
@ -3295,7 +3438,9 @@ gtk_widget_get_sensitive
gtk_widget_get_settings
gtk_widget_get_size_request
gtk_widget_get_state
gtk_widget_get_state_flags
gtk_widget_get_style
gtk_widget_get_style_context
gtk_widget_get_support_multidevice
gtk_widget_get_tooltip_markup
gtk_widget_get_tooltip_text
@ -3342,9 +3487,38 @@ gtk_widget_modify_text
gtk_widget_new
gtk_widget_override_background_color
gtk_widget_override_color
gtk_widget_override_cursor
gtk_widget_override_font
gtk_widget_override_symbolic_color
gtk_widget_path
gtk_widget_path_append_type
gtk_widget_path_copy
gtk_widget_path_free
gtk_widget_path_get_type G_GNUC_CONST
gtk_widget_path_get_widget_type
gtk_widget_path_has_parent
gtk_widget_path_is_type
gtk_widget_path_iter_add_class
gtk_widget_path_iter_add_region
gtk_widget_path_iter_clear_classes
gtk_widget_path_iter_clear_regions
gtk_widget_path_iter_get_name
gtk_widget_path_iter_get_widget_type
gtk_widget_path_iter_has_class
gtk_widget_path_iter_has_name
gtk_widget_path_iter_has_qclass
gtk_widget_path_iter_has_qname
gtk_widget_path_iter_has_qregion
gtk_widget_path_iter_has_region
gtk_widget_path_iter_list_classes
gtk_widget_path_iter_list_regions
gtk_widget_path_iter_remove_class
gtk_widget_path_iter_remove_region
gtk_widget_path_iter_set_name
gtk_widget_path_iter_set_widget_type
gtk_widget_path_length
gtk_widget_path_new
gtk_widget_path_prepend_type
gtk_widget_pop_composite_child
gtk_widget_push_composite_child
gtk_widget_queue_compute_expand
@ -3362,6 +3536,7 @@ gtk_widget_render_icon_pixbuf
gtk_widget_reparent
gtk_widget_reset_rc_styles
gtk_widget_reset_shapes
gtk_widget_reset_style
gtk_widget_send_expose
gtk_widget_send_focus_change
gtk_widget_set_accel_path
@ -3397,6 +3572,7 @@ gtk_widget_set_redraw_on_allocate
gtk_widget_set_sensitive
gtk_widget_set_size_request
gtk_widget_set_state
gtk_widget_set_state_flags
gtk_widget_set_style
gtk_widget_set_support_multidevice
gtk_widget_set_tooltip_markup
@ -3424,6 +3600,7 @@ gtk_widget_trigger_tooltip_query
gtk_widget_unmap
gtk_widget_unparent
gtk_widget_unrealize
gtk_widget_unset_state_flags
#ifdef GDK_WINDOWING_WIN32
gtk_win32_embed_widget_get_type G_GNUC_CONST
#endif

View File

@ -44,12 +44,12 @@ struct Gtk9Slice
gint ref_count;
};
G_DEFINE_BOXED_TYPE (Gtk9Slice, gtk_9slice,
gtk_9slice_ref, gtk_9slice_unref)
G_DEFINE_BOXED_TYPE (Gtk9Slice, _gtk_9slice,
_gtk_9slice_ref, _gtk_9slice_unref)
Gtk9Slice *
gtk_9slice_new (GdkPixbuf *pixbuf,
_gtk_9slice_new (GdkPixbuf *pixbuf,
gdouble distance_top,
gdouble distance_bottom,
gdouble distance_left,
@ -264,7 +264,7 @@ render_corner (cairo_t *cr,
}
void
gtk_9slice_render (Gtk9Slice *slice,
_gtk_9slice_render (Gtk9Slice *slice,
cairo_t *cr,
gdouble x,
gdouble y,
@ -347,7 +347,7 @@ gtk_9slice_render (Gtk9Slice *slice,
}
Gtk9Slice *
gtk_9slice_ref (Gtk9Slice *slice)
_gtk_9slice_ref (Gtk9Slice *slice)
{
g_return_val_if_fail (slice != NULL, NULL);
@ -356,7 +356,7 @@ gtk_9slice_ref (Gtk9Slice *slice)
}
void
gtk_9slice_unref (Gtk9Slice *slice)
_gtk_9slice_unref (Gtk9Slice *slice)
{
g_return_if_fail (slice != NULL);

View File

@ -27,16 +27,16 @@ G_BEGIN_DECLS
/* Dummy typedefs */
typedef struct Gtk9Slice Gtk9Slice;
#define GTK_TYPE_9SLICE (gtk_9slice_get_type ())
#define GTK_TYPE_9SLICE (_gtk_9slice_get_type ())
typedef enum {
GTK_SLICE_REPEAT,
GTK_SLICE_STRETCH
} GtkSliceSideModifier;
GType gtk_9slice_get_type (void) G_GNUC_CONST;
GType _gtk_9slice_get_type (void) G_GNUC_CONST;
Gtk9Slice * gtk_9slice_new (GdkPixbuf *pixbuf,
Gtk9Slice * _gtk_9slice_new (GdkPixbuf *pixbuf,
gdouble distance_top,
gdouble distance_bottom,
gdouble distance_left,
@ -44,10 +44,10 @@ Gtk9Slice * gtk_9slice_new (GdkPixbuf *pixbuf,
GtkSliceSideModifier horizontal_modifier,
GtkSliceSideModifier vertical_modifier);
Gtk9Slice * gtk_9slice_ref (Gtk9Slice *slice);
void gtk_9slice_unref (Gtk9Slice *slice);
Gtk9Slice * _gtk_9slice_ref (Gtk9Slice *slice);
void _gtk_9slice_unref (Gtk9Slice *slice);
void gtk_9slice_render (Gtk9Slice *slice,
void _gtk_9slice_render (Gtk9Slice *slice,
cairo_t *cr,
gdouble x,
gdouble y,

View File

@ -30,7 +30,7 @@ struct GtkAnimationDescription
};
GtkAnimationDescription *
gtk_animation_description_new (gdouble duration,
_gtk_animation_description_new (gdouble duration,
GtkTimelineProgressType progress_type,
gboolean loop)
{
@ -46,32 +46,32 @@ gtk_animation_description_new (gdouble duration,
}
gdouble
gtk_animation_description_get_duration (GtkAnimationDescription *desc)
_gtk_animation_description_get_duration (GtkAnimationDescription *desc)
{
return desc->duration;
}
GtkTimelineProgressType
gtk_animation_description_get_progress_type (GtkAnimationDescription *desc)
_gtk_animation_description_get_progress_type (GtkAnimationDescription *desc)
{
return desc->progress_type;
}
gboolean
gtk_animation_description_get_loop (GtkAnimationDescription *desc)
_gtk_animation_description_get_loop (GtkAnimationDescription *desc)
{
return (desc->loop != 0);
}
GtkAnimationDescription *
gtk_animation_description_ref (GtkAnimationDescription *desc)
_gtk_animation_description_ref (GtkAnimationDescription *desc)
{
desc->ref_count++;
return desc;
}
void
gtk_animation_description_unref (GtkAnimationDescription *desc)
_gtk_animation_description_unref (GtkAnimationDescription *desc)
{
desc->ref_count--;
@ -80,7 +80,7 @@ gtk_animation_description_unref (GtkAnimationDescription *desc)
}
GtkAnimationDescription *
gtk_animation_description_from_string (const gchar *str)
_gtk_animation_description_from_string (const gchar *str)
{
gchar timing_function[16] = { 0, };
gchar duration_unit[3] = { 0, };
@ -120,18 +120,18 @@ gtk_animation_description_from_string (const gchar *str)
return NULL;
}
return gtk_animation_description_new ((gdouble) duration, progress_type, loop);
return _gtk_animation_description_new ((gdouble) duration, progress_type, loop);
}
GType
gtk_animation_description_get_type (void)
_gtk_animation_description_get_type (void)
{
static GType type = 0;
if (G_UNLIKELY (!type))
type = g_boxed_type_register_static (I_("GtkAnimationDescription"),
(GBoxedCopyFunc) gtk_animation_description_ref,
(GBoxedFreeFunc) gtk_animation_description_unref);
(GBoxedCopyFunc) _gtk_animation_description_ref,
(GBoxedFreeFunc) _gtk_animation_description_unref);
return type;
}

View File

@ -27,22 +27,22 @@ G_BEGIN_DECLS
/* Dummy typedefs */
typedef struct GtkAnimationDescription GtkAnimationDescription;
#define GTK_TYPE_ANIMATION_DESCRIPTION (gtk_animation_description_get_type ())
#define GTK_TYPE_ANIMATION_DESCRIPTION (_gtk_animation_description_get_type ())
GType gtk_animation_description_get_type (void) G_GNUC_CONST;
GType _gtk_animation_description_get_type (void) G_GNUC_CONST;
GtkAnimationDescription * gtk_animation_description_new (gdouble duration,
GtkAnimationDescription * _gtk_animation_description_new (gdouble duration,
GtkTimelineProgressType progress_type,
gboolean loop);
gdouble gtk_animation_description_get_duration (GtkAnimationDescription *desc);
GtkTimelineProgressType gtk_animation_description_get_progress_type (GtkAnimationDescription *desc);
gboolean gtk_animation_description_get_loop (GtkAnimationDescription *desc);
gdouble _gtk_animation_description_get_duration (GtkAnimationDescription *desc);
GtkTimelineProgressType _gtk_animation_description_get_progress_type (GtkAnimationDescription *desc);
gboolean _gtk_animation_description_get_loop (GtkAnimationDescription *desc);
GtkAnimationDescription * gtk_animation_description_ref (GtkAnimationDescription *desc);
void gtk_animation_description_unref (GtkAnimationDescription *desc);
GtkAnimationDescription * _gtk_animation_description_ref (GtkAnimationDescription *desc);
void _gtk_animation_description_unref (GtkAnimationDescription *desc);
GtkAnimationDescription * gtk_animation_description_from_string (const gchar *str);
GtkAnimationDescription * _gtk_animation_description_from_string (const gchar *str);
G_END_DECLS

View File

@ -108,7 +108,7 @@ search_for_mimetype_ready_cb (GObject *source,
GtkAppChooserDialog *self = user_data;
GError *error = NULL;
gtk_app_chooser_online_search_for_mimetype_finish (online, res, &error);
_gtk_app_chooser_online_search_for_mimetype_finish (online, res, &error);
if (error != NULL)
{
@ -128,7 +128,7 @@ online_button_clicked_cb (GtkButton *b,
{
GtkAppChooserDialog *self = user_data;
gtk_app_chooser_online_search_for_mimetype_async (self->priv->online,
_gtk_app_chooser_online_search_for_mimetype_async (self->priv->online,
self->priv->content_type,
GTK_WINDOW (self),
search_for_mimetype_ready_cb,
@ -142,7 +142,7 @@ app_chooser_online_get_default_ready_cb (GObject *source,
{
GtkAppChooserDialog *self = user_data;
self->priv->online = gtk_app_chooser_online_get_default_finish (source, res);
self->priv->online = _gtk_app_chooser_online_get_default_finish (source, res);
if (self->priv->online != NULL)
{
@ -164,7 +164,7 @@ app_chooser_online_get_default_ready_cb (GObject *source,
static void
ensure_online_button (GtkAppChooserDialog *self)
{
gtk_app_chooser_online_get_default_async (app_chooser_online_get_default_ready_cb, self);
_gtk_app_chooser_online_get_default_async (app_chooser_online_get_default_ready_cb, self);
}
/* An application is valid if:

View File

@ -30,19 +30,17 @@
#include <gio/gio.h>
#define gtk_app_chooser_online_get_type _gtk_app_chooser_online_get_type
static void gtk_app_chooser_online_default_init (GtkAppChooserOnlineInterface *iface);
G_DEFINE_INTERFACE_WITH_CODE (GtkAppChooserOnline, gtk_app_chooser_online, G_TYPE_OBJECT,
G_DEFINE_INTERFACE_WITH_CODE (GtkAppChooserOnline, _gtk_app_chooser_online, G_TYPE_OBJECT,
g_type_interface_add_prerequisite (g_define_type_id, G_TYPE_ASYNC_INITABLE);)
static void
gtk_app_chooser_online_default_init (GtkAppChooserOnlineInterface *iface)
_gtk_app_chooser_online_default_init (GtkAppChooserOnlineInterface *iface)
{
/* do nothing */
}
GtkAppChooserOnline *
gtk_app_chooser_online_get_default_finish (GObject *source,
_gtk_app_chooser_online_get_default_finish (GObject *source,
GAsyncResult *result)
{
GtkAppChooserOnline *retval;
@ -54,7 +52,7 @@ gtk_app_chooser_online_get_default_finish (GObject *source,
}
void
gtk_app_chooser_online_get_default_async (GAsyncReadyCallback callback,
_gtk_app_chooser_online_get_default_async (GAsyncReadyCallback callback,
gpointer user_data)
{
GIOExtensionPoint *ep;
@ -76,7 +74,7 @@ gtk_app_chooser_online_get_default_async (GAsyncReadyCallback callback,
}
void
gtk_app_chooser_online_search_for_mimetype_async (GtkAppChooserOnline *self,
_gtk_app_chooser_online_search_for_mimetype_async (GtkAppChooserOnline *self,
const gchar *content_type,
GtkWindow *parent,
GAsyncReadyCallback callback,
@ -92,7 +90,7 @@ gtk_app_chooser_online_search_for_mimetype_async (GtkAppChooserOnline *self,
}
gboolean
gtk_app_chooser_online_search_for_mimetype_finish (GtkAppChooserOnline *self,
_gtk_app_chooser_online_search_for_mimetype_finish (GtkAppChooserOnline *self,
GAsyncResult *res,
GError **error)
{

View File

@ -56,17 +56,17 @@ struct _GtkAppChooserOnlineInterface {
GType _gtk_app_chooser_online_get_type (void) G_GNUC_CONST;
void gtk_app_chooser_online_get_default_async (GAsyncReadyCallback callback,
void _gtk_app_chooser_online_get_default_async (GAsyncReadyCallback callback,
gpointer user_data);
GtkAppChooserOnline * gtk_app_chooser_online_get_default_finish (GObject *source,
GtkAppChooserOnline * _gtk_app_chooser_online_get_default_finish (GObject *source,
GAsyncResult *result);
void gtk_app_chooser_online_search_for_mimetype_async (GtkAppChooserOnline *self,
void _gtk_app_chooser_online_search_for_mimetype_async (GtkAppChooserOnline *self,
const gchar *content_type,
GtkWindow *parent,
GAsyncReadyCallback callback,
gpointer user_data);
gboolean gtk_app_chooser_online_search_for_mimetype_finish (GtkAppChooserOnline *self,
gboolean _gtk_app_chooser_online_search_for_mimetype_finish (GtkAppChooserOnline *self,
GAsyncResult *res,
GError **error);

View File

@ -134,7 +134,7 @@ pk_search_mime_async (GtkAppChooserOnline *obj,
self->priv->result = g_simple_async_result_new (G_OBJECT (self),
callback, user_data,
gtk_app_chooser_online_search_for_mimetype_async);
_gtk_app_chooser_online_search_for_mimetype_async);
#ifdef GDK_WINDOWING_X11
window = gtk_widget_get_window (GTK_WIDGET (parent));
@ -243,7 +243,7 @@ app_chooser_online_pk_init_async (GAsyncInitable *init,
self->priv->init_result = g_simple_async_result_new (G_OBJECT (self),
callback, user_data,
gtk_app_chooser_online_get_default_async);
_gtk_app_chooser_online_get_default_async);
self->priv->watch_id =
g_bus_watch_name (G_BUS_TYPE_SESSION,

View File

@ -402,13 +402,13 @@ gtk_app_chooser_sort_func (GtkTreeModel *model,
/* they're both recommended/falback or not, so if one is a heading, wins */
if (a_heading)
{
return -1;
retval = -1;
goto out;
}
if (b_heading)
{
return 1;
retval = 1;
goto out;
}

View File

@ -2478,7 +2478,7 @@ gtk_assistant_get_accessible (GtkWidget *widget)
typedef struct _GtkAssistantAccessible GtkAssistantAccessible;
typedef struct _GtkAssistantAccessibleClass GtkAssistantAccessibleClass;
ATK_DEFINE_TYPE (GtkAssistantAccessible, gtk_assistant_accessible, GTK_TYPE_ASSISTANT);
ATK_DEFINE_TYPE (GtkAssistantAccessible, _gtk_assistant_accessible, GTK_TYPE_ASSISTANT);
static gint
gtk_assistant_accessible_get_n_children (AtkObject *accessible)
@ -2537,7 +2537,7 @@ gtk_assistant_accessible_ref_child (AtkObject *accessible,
}
static void
gtk_assistant_accessible_class_init (GtkAssistantAccessibleClass *klass)
_gtk_assistant_accessible_class_init (GtkAssistantAccessibleClass *klass)
{
AtkObjectClass *atk_class = ATK_OBJECT_CLASS (klass);
@ -2546,7 +2546,7 @@ gtk_assistant_accessible_class_init (GtkAssistantAccessibleClass *klass)
}
static void
gtk_assistant_accessible_init (GtkAssistantAccessible *self)
_gtk_assistant_accessible_init (GtkAssistantAccessible *self)
{
}
@ -2561,7 +2561,7 @@ G_DEFINE_TYPE (GtkAssistantAccessibleFactory,
static GType
gtk_assistant_accessible_factory_get_accessible_type (void)
{
return gtk_assistant_accessible_get_type ();
return _gtk_assistant_accessible_get_type ();
}
static AtkObject*
@ -2569,7 +2569,7 @@ gtk_assistant_accessible_factory_create_accessible (GObject *obj)
{
AtkObject *accessible;
accessible = g_object_new (gtk_assistant_accessible_get_type (), NULL);
accessible = g_object_new (_gtk_assistant_accessible_get_type (), NULL);
atk_object_initialize (accessible, obj);
return accessible;

View File

@ -971,6 +971,7 @@ static void
gtk_button_construct_child (GtkButton *button)
{
GtkButtonPrivate *priv = button->priv;
GtkStyleContext *context;
GtkStockItem item;
GtkWidget *child;
GtkWidget *label;
@ -986,7 +987,9 @@ gtk_button_construct_child (GtkButton *button)
if (!priv->label_text && !priv->image)
return;
gtk_widget_style_get (GTK_WIDGET (button),
context = gtk_widget_get_style_context (GTK_WIDGET (button));
gtk_style_context_get_style (context,
"image-spacing", &image_spacing,
NULL);
@ -1302,8 +1305,6 @@ gtk_button_realize (GtkWidget *widget)
priv->event_window = gdk_window_new (window,
&attributes, attributes_mask);
gdk_window_set_user_data (priv->event_window, button);
gtk_widget_style_attach (widget);
}
static void
@ -1350,7 +1351,8 @@ gtk_button_unmap (GtkWidget *widget)
}
static void
gtk_button_update_image_spacing (GtkButton *button)
gtk_button_update_image_spacing (GtkButton *button,
GtkStyleContext *context)
{
GtkButtonPrivate *priv = button->priv;
GtkWidget *child;
@ -1369,7 +1371,7 @@ gtk_button_update_image_spacing (GtkButton *button)
child = gtk_bin_get_child (GTK_BIN (child));
if (GTK_IS_BOX (child))
{
gtk_widget_style_get (GTK_WIDGET (button),
gtk_style_context_get_style (context,
"image-spacing", &spacing,
NULL);
@ -1381,7 +1383,11 @@ gtk_button_update_image_spacing (GtkButton *button)
static void
gtk_button_style_updated (GtkWidget *widget)
{
gtk_button_update_image_spacing (GTK_BUTTON (widget));
GtkStyleContext *context;
context = gtk_widget_get_style_context (widget);
gtk_button_update_image_spacing (GTK_BUTTON (widget), context);
}
static void
@ -1391,12 +1397,16 @@ gtk_button_get_props (GtkButton *button,
GtkBorder *inner_border,
gboolean *interior_focus)
{
GtkWidget *widget = GTK_WIDGET (button);
GtkStyleContext *context;
GtkBorder *tmp_border;
context = gtk_widget_get_style_context (GTK_WIDGET (button));
if (default_border)
{
gtk_widget_style_get (widget, "default-border", &tmp_border, NULL);
gtk_style_context_get_style (context,
"default-border", &tmp_border,
NULL);
if (tmp_border)
{
@ -1409,7 +1419,9 @@ gtk_button_get_props (GtkButton *button,
if (default_outside_border)
{
gtk_widget_style_get (widget, "default-outside-border", &tmp_border, NULL);
gtk_style_context_get_style (context,
"default-outside-border", &tmp_border,
NULL);
if (tmp_border)
{
@ -1422,7 +1434,9 @@ gtk_button_get_props (GtkButton *button,
if (inner_border)
{
gtk_widget_style_get (widget, "inner-border", &tmp_border, NULL);
gtk_style_context_get_style (context,
"inner-border", &tmp_border,
NULL);
if (tmp_border)
{
@ -1434,7 +1448,11 @@ gtk_button_get_props (GtkButton *button,
}
if (interior_focus)
gtk_widget_style_get (widget, "interior-focus", interior_focus, NULL);
{
gtk_style_context_get_style (context,
"interior-focus", interior_focus,
NULL);
}
}
static void
@ -1447,25 +1465,25 @@ gtk_button_size_allocate (GtkWidget *widget,
GtkStyleContext *context;
GtkStateFlags state;
GtkWidget *child;
GtkBorder default_border;
GtkBorder inner_border, *border;
GtkBorder inner_border;
GtkBorder *border;
gint focus_width;
gint focus_pad;
context = gtk_widget_get_style_context (widget);
state = gtk_widget_get_state_flags (widget);
gtk_style_context_get (context, state,
"border-width", &border,
NULL);
gtk_button_get_props (button, &default_border, NULL, &inner_border, NULL);
gtk_widget_style_get (GTK_WIDGET (widget),
gtk_style_context_get_style (context,
"focus-line-width", &focus_width,
"focus-padding", &focus_pad,
NULL);
gtk_style_context_get (context, state,
"border-width", &border,
NULL);
gtk_widget_set_allocation (widget, allocation);
if (gtk_widget_get_realized (widget))
@ -1514,7 +1532,7 @@ gtk_button_size_allocate (GtkWidget *widget,
gint child_displacement_x;
gint child_displacement_y;
gtk_widget_style_get (widget,
gtk_style_context_get_style (context,
"child-displacement-x", &child_displacement_x,
"child-displacement-y", &child_displacement_y,
NULL);
@ -1556,14 +1574,16 @@ _gtk_button_paint (GtkButton *button,
widget = GTK_WIDGET (button);
context = gtk_widget_get_style_context (widget);
state = gtk_widget_get_state_flags (widget);
gtk_button_get_props (button, &default_border, &default_outside_border, NULL, &interior_focus);
gtk_widget_style_get (widget,
gtk_style_context_get_style (context,
"focus-line-width", &focus_width,
"focus-padding", &focus_pad,
NULL);
gtk_widget_get_allocation (widget, &allocation);
context = gtk_widget_get_style_context (widget);
window = gtk_widget_get_window (widget);
x = 0;
@ -1614,7 +1634,7 @@ _gtk_button_paint (GtkButton *button,
gboolean displace_focus;
GtkBorder *border;
gtk_widget_style_get (widget,
gtk_style_context_get_style (context,
"child-displacement-y", &child_displacement_y,
"child-displacement-x", &child_displacement_x,
"displace-focus", &displace_focus,
@ -1906,24 +1926,24 @@ gtk_button_get_size (GtkWidget *widget,
{
GtkButton *button = GTK_BUTTON (widget);
GtkStyleContext *context;
GtkStateFlags state;
GtkWidget *child;
GtkBorder default_border;
GtkBorder inner_border;
GtkStateFlags state;
GtkBorder *border;
gint focus_width;
gint focus_pad;
gint minimum, natural;
context = gtk_widget_get_style_context (widget);
state = gtk_widget_get_state_flags (widget);
gtk_button_get_props (button, &default_border, NULL, &inner_border, NULL);
gtk_widget_style_get (GTK_WIDGET (widget),
gtk_style_context_get_style (context,
"focus-line-width", &focus_width,
"focus-padding", &focus_pad,
NULL);
context = gtk_widget_get_style_context (GTK_WIDGET (widget));
state = gtk_widget_get_state_flags (GTK_WIDGET (widget));
gtk_style_context_get (context, state,
"border-width", &border,
NULL);

View File

@ -604,6 +604,7 @@ gtk_cell_renderer_progress_render (GtkCellRenderer *cell,
clip.y = bar_position;
}
if (bar_size > 0)
gtk_paint_box (style,
cr,
GTK_STATE_SELECTED, GTK_SHADOW_OUT,

View File

@ -144,32 +144,6 @@
* }
* ]]></programlisting>
*
* Furthermore, in order to ensure correct height-for-width requests it is important
* to check the input width against the real required minimum width. This can
* easily be achieved as follows:
*
* <programlisting><![CDATA[
* static void
* foo_container_get_preferred_height_for_width (GtkWidget *widget, gint for_width,
* gint *min_height, gint *nat_height)
* {
* if (i_am_in_height_for_width_mode)
* {
* gint min_width;
*
* GTK_WIDGET_GET_CLASS (widget)->get_preferred_width (widget, &min_width, NULL);
*
* for_width = MAX (min_width, for_width);
*
* execute_real_height_for_width_request_code (widget, for_width, min_height, nat_height);
* }
* else
* {
* ... fall back on virtual results as mentioned in the previous example ...
* }
* }
* ]]></programlisting>
*
* Height for width requests are generally implemented in terms of a virtual allocation
* of widgets in the input orientation. Assuming an height-for-width request mode, a container
* would implement the <function>get_preferred_height_for_width()</function> virtual function by first calling
@ -327,6 +301,7 @@ static void gtk_container_adjust_size_request (GtkWidget *widget,
gint *natural_size);
static void gtk_container_adjust_size_allocation (GtkWidget *widget,
GtkOrientation orientation,
gint *minimum_size,
gint *natural_size,
gint *allocated_pos,
gint *allocated_size);
@ -1809,6 +1784,7 @@ gtk_container_adjust_size_request (GtkWidget *widget,
static void
gtk_container_adjust_size_allocation (GtkWidget *widget,
GtkOrientation orientation,
gint *minimum_size,
gint *natural_size,
gint *allocated_pos,
gint *allocated_size)
@ -1821,7 +1797,7 @@ gtk_container_adjust_size_allocation (GtkWidget *widget,
if (!GTK_CONTAINER_GET_CLASS (widget)->handle_border_width)
{
parent_class->adjust_size_allocation (widget, orientation,
natural_size, allocated_pos,
minimum_size, natural_size, allocated_pos,
allocated_size);
return;
}
@ -1845,6 +1821,7 @@ gtk_container_adjust_size_allocation (GtkWidget *widget,
else
{
*allocated_pos += border_width;
*minimum_size -= border_width * 2;
*natural_size -= border_width * 2;
}
@ -1856,7 +1833,7 @@ gtk_container_adjust_size_allocation (GtkWidget *widget,
* and padding values.
*/
parent_class->adjust_size_allocation (widget, orientation,
natural_size, allocated_pos,
minimum_size, natural_size, allocated_pos,
allocated_size);
}

View File

@ -791,11 +791,6 @@ static gboolean gtk_css_provider_load_from_path_internal (GtkCssProvider *css_p
gboolean reset,
GError **error);
enum {
CSS_PROVIDER_PARSE_ERROR
};
GQuark
gtk_css_provider_error_quark (void)
{
@ -1456,7 +1451,7 @@ scanner_apply_scope (GScanner *scanner,
if (scope == SCOPE_VALUE)
{
scanner->config->cset_identifier_first = G_CSET_a_2_z G_CSET_A_2_Z G_CSET_DIGITS "@#-_";
scanner->config->cset_identifier_nth = G_CSET_a_2_z G_CSET_A_2_Z G_CSET_DIGITS "@#-_ (),.%\t\n'/\"";
scanner->config->cset_identifier_nth = G_CSET_a_2_z G_CSET_A_2_Z G_CSET_DIGITS "@#-_ +(),.%\t\n'/\"";
scanner->config->scan_identifier_1char = TRUE;
}
else if (scope == SCOPE_SELECTOR)
@ -2142,8 +2137,8 @@ symbolic_color_parse (const gchar *str,
if (*end != '\0')
{
g_set_error_literal (error,
gtk_css_provider_error_quark (),
CSS_PROVIDER_PARSE_ERROR,
GTK_CSS_PROVIDER_ERROR,
GTK_CSS_PROVIDER_ERROR_FAILED,
"Could not parse symbolic color");
if (color)
@ -2412,7 +2407,6 @@ path_parse_str (GtkCssProvider *css_provider,
{
gchar *path, *chr;
const gchar *start, *end;
start = str;
if (g_str_has_prefix (str, "url"))
@ -2519,8 +2513,8 @@ path_parse (GtkCssProvider *css_provider,
if (*end != '\0')
{
g_set_error_literal (error,
gtk_css_provider_error_quark (),
CSS_PROVIDER_PARSE_ERROR,
GTK_CSS_PROVIDER_ERROR,
GTK_CSS_PROVIDER_ERROR_FAILED,
"Error parsing path");
g_free (path);
path = NULL;
@ -2621,7 +2615,7 @@ slice_parse_str (GtkCssProvider *css_provider,
return NULL;
}
slice = gtk_9slice_new (pixbuf,
slice = _gtk_9slice_new (pixbuf,
distance_top, distance_bottom,
distance_left, distance_right,
mods[0], mods[1]);
@ -2739,28 +2733,30 @@ css_provider_parse_value (GtkCssProvider *css_provider,
if (type == GDK_TYPE_RGBA ||
type == GDK_TYPE_COLOR)
{
GdkRGBA color;
GdkColor rgb;
GdkRGBA rgba;
GdkColor color;
if (type == GDK_TYPE_RGBA &&
gdk_rgba_parse (&color, value_str))
g_value_set_boxed (value, &color);
gdk_rgba_parse (&rgba, value_str))
g_value_set_boxed (value, &rgba);
else if (type == GDK_TYPE_COLOR &&
gdk_color_parse (value_str, &rgb))
g_value_set_boxed (value, &rgb);
gdk_color_parse (value_str, &color))
g_value_set_boxed (value, &color);
else
{
GtkSymbolicColor *symbolic_color;
symbolic_color = symbolic_color_parse_str (value_str, &end);
if (!symbolic_color)
return FALSE;
if (symbolic_color)
{
g_value_unset (value);
g_value_init (value, GTK_TYPE_SYMBOLIC_COLOR);
g_value_take_boxed (value, symbolic_color);
}
else
parsed = FALSE;
}
}
else if (type == PANGO_TYPE_FONT_DESCRIPTION)
{
@ -2790,13 +2786,16 @@ css_provider_parse_value (GtkCssProvider *css_provider,
GtkThemingEngine *engine;
engine = gtk_theming_engine_load (value_str);
if (engine)
g_value_set_object (value, engine);
else
parsed = FALSE;
}
else if (type == GTK_TYPE_ANIMATION_DESCRIPTION)
{
GtkAnimationDescription *desc;
desc = gtk_animation_description_from_string (value_str);
desc = _gtk_animation_description_from_string (value_str);
if (desc)
g_value_take_boxed (value, desc);
@ -2878,7 +2877,10 @@ css_provider_parse_value (GtkCssProvider *css_provider,
if (!enum_value)
{
g_warning ("Unknown value '%s' for enum type '%s'",
g_set_error (error,
GTK_CSS_PROVIDER_ERROR,
GTK_CSS_PROVIDER_ERROR_FAILED,
"Unknown value '%s' for enum type '%s'",
value_str, g_type_name (type));
parsed = FALSE;
}
@ -2912,7 +2914,10 @@ css_provider_parse_value (GtkCssProvider *css_provider,
if (!flag_value)
{
g_warning ("Unknown flag '%s' for type '%s'",
g_set_error (error,
GTK_CSS_PROVIDER_ERROR,
GTK_CSS_PROVIDER_ERROR_FAILED,
"Unknown flag '%s' for type '%s'",
value_str, g_type_name (type));
parsed = FALSE;
}
@ -2928,7 +2933,10 @@ css_provider_parse_value (GtkCssProvider *css_provider,
if (!flag_value)
{
g_warning ("Unknown flag '%s' for type '%s'",
g_set_error (error,
GTK_CSS_PROVIDER_ERROR,
GTK_CSS_PROVIDER_ERROR_FAILED,
"Unknown flag '%s' for type '%s'",
value_str, g_type_name (type));
parsed = FALSE;
}
@ -2953,7 +2961,11 @@ css_provider_parse_value (GtkCssProvider *css_provider,
}
else
{
g_warning ("Cannot parse string '%s' for type %s", value_str, g_type_name (type));
g_set_error (error,
GTK_CSS_PROVIDER_ERROR,
GTK_CSS_PROVIDER_ERROR_FAILED,
"Cannot parse string '%s' for type %s",
value_str, g_type_name (type));
parsed = FALSE;
}
@ -2966,8 +2978,8 @@ css_provider_parse_value (GtkCssProvider *css_provider,
if (error && !*error)
g_set_error_literal (error,
gtk_css_provider_error_quark (),
CSS_PROVIDER_PARSE_ERROR,
GTK_CSS_PROVIDER_ERROR,
GTK_CSS_PROVIDER_ERROR_FAILED,
"Failed to parse value");
}
@ -3320,6 +3332,9 @@ parse_stylesheet (GtkCssProvider *css_provider,
GError **error)
{
GtkCssProviderPrivate *priv;
gboolean result;
result = TRUE;
priv = css_provider->priv;
g_scanner_get_next_token (priv->scanner);
@ -3333,8 +3348,27 @@ parse_stylesheet (GtkCssProvider *css_provider,
expected_token = parse_rule (css_provider, priv->scanner, &err);
if (expected_token != G_TOKEN_NONE)
{
/* If a GError was passed in, propagate the error and bail out,
* else report a warning and keep going
*/
if (error != NULL)
{
result = FALSE;
if (err)
g_propagate_error (error, err);
else
g_set_error_literal (error,
GTK_CSS_PROVIDER_ERROR,
GTK_CSS_PROVIDER_ERROR_FAILED,
"Error parsing stylesheet");
break;
}
else
{
scanner_report_warning (css_provider, expected_token, err);
g_clear_error (&err);
}
while (!g_scanner_eof (priv->scanner) &&
priv->scanner->token != G_TOKEN_RIGHT_CURLY)
@ -3343,11 +3377,10 @@ parse_stylesheet (GtkCssProvider *css_provider,
else
css_provider_commit (css_provider);
g_clear_error (&err);
g_scanner_get_next_token (priv->scanner);
}
return TRUE;
return result;
}
/**

View File

@ -6704,7 +6704,7 @@ gtk_icon_view_autoscroll (GtkIconView *icon_view)
window = gtk_widget_get_window (GTK_WIDGET (icon_view));
gdk_window_get_pointer (window, &px, &py, NULL);
gdk_window_get_geometry (window, &x, &y, &width, &height, NULL);
gdk_window_get_geometry (window, &x, &y, &width, &height);
/* see if we are near the edge. */
voffset = py - (y + 2 * SCROLL_EDGE_SIZE);

View File

@ -2273,8 +2273,10 @@ gtk_label_get_link_colors (GtkWidget *widget,
GdkColor **link_color,
GdkColor **visited_link_color)
{
gtk_widget_ensure_style (widget);
gtk_widget_style_get (widget,
GtkStyleContext *context;
context = gtk_widget_get_style_context (widget);
gtk_style_context_get_style (context,
"link-color", link_color,
"visited-link-color", visited_link_color,
NULL);
@ -3007,13 +3009,31 @@ gtk_label_clear_layout (GtkLabel *label)
}
}
static PangoFontMetrics *
get_font_metrics (PangoContext *context, GtkWidget *widget)
{
GtkStyleContext *style_context;
PangoFontDescription *font;
PangoFontMetrics *retval;
style_context = gtk_widget_get_style_context (widget);
gtk_style_context_get (style_context, 0, "font", &font, NULL);
retval = pango_context_get_metrics (context,
font,
pango_context_get_language (context));
if (font != NULL)
pango_font_description_free (font);
return retval;
}
static void
get_label_width (GtkLabel *label,
gint *minimum,
gint *natural)
{
GtkWidgetAuxInfo *aux_info;
GtkLabelPrivate *priv;
PangoLayout *layout;
PangoContext *context;
@ -3022,14 +3042,10 @@ get_label_width (GtkLabel *label,
gint char_width, digit_width, char_pixels, text_width, ellipsize_chars, guess_width;
priv = label->priv;
aux_info = _gtk_widget_get_aux_info (GTK_WIDGET (label), FALSE);
layout = pango_layout_copy (priv->layout);
context = pango_layout_get_context (layout);
metrics = pango_context_get_metrics (context,
gtk_widget_get_style (GTK_WIDGET (label))->font_desc,
pango_context_get_language (context));
metrics = get_font_metrics (context, GTK_WIDGET (label));
char_width = pango_font_metrics_get_approximate_char_width (metrics);
digit_width = pango_font_metrics_get_approximate_digit_width (metrics);
char_pixels = MAX (char_width, digit_width);
@ -3108,12 +3124,17 @@ get_label_width (GtkLabel *label,
}
/* if a width-request is set, use that as the requested label width */
if ((priv->wrap || priv->ellipsize || priv->width_chars > 0 || priv->max_width_chars > 0) &&
aux_info && aux_info->width > 0)
if (priv->wrap || priv->ellipsize || priv->width_chars > 0 || priv->max_width_chars > 0)
{
GtkWidgetAuxInfo *aux_info;
aux_info = _gtk_widget_get_aux_info (GTK_WIDGET (label), FALSE);
if (aux_info && aux_info->width > 0)
{
*minimum = aux_info->width * PANGO_SCALE;
*natural = MAX (*natural, *minimum);
}
}
g_object_unref (layout);
}
@ -3143,10 +3164,7 @@ get_label_wrap_width (GtkLabel *label)
layout = pango_layout_copy (priv->layout);
context = pango_layout_get_context (layout);
metrics = pango_context_get_metrics (context,
gtk_widget_get_style (GTK_WIDGET (label))->font_desc,
pango_context_get_language (context));
metrics = get_font_metrics (context, GTK_WIDGET (label));
char_width = pango_font_metrics_get_approximate_char_width (metrics);
digit_width = pango_font_metrics_get_approximate_digit_width (metrics);
char_pixels = MAX (char_width, digit_width);
@ -3353,9 +3371,7 @@ get_single_line_height (GtkWidget *widget,
gint ascent, descent;
context = pango_layout_get_context (layout);
metrics = pango_context_get_metrics (context, gtk_widget_get_style (widget)->font_desc,
pango_context_get_language (context));
metrics = get_font_metrics (context, widget);
ascent = pango_font_metrics_get_ascent (metrics);
descent = pango_font_metrics_get_descent (metrics);
pango_font_metrics_unref (metrics);

View File

@ -282,11 +282,15 @@ gtk_modifier_style_set_color_property (GtkModifierStyle *style,
}
if (color)
{
g_hash_table_insert (priv->color_properties, str,
gdk_rgba_copy (color));
}
else
{
g_hash_table_remove (priv->color_properties, str);
g_free (str);
}
g_signal_emit (style, signals[CHANGED], 0);
g_free (str);
}

View File

@ -217,22 +217,25 @@ compute_size_for_orientation (GtkWidget *widget,
}
else
{
int ignored_position = 0;
int natural_height;
gint ignored_position = 0;
gint minimum_height;
gint natural_height;
/* Pull the base natural height from the cache as it's needed to adjust
* the proposed 'for_size' */
gtk_widget_get_preferred_height (widget, NULL, &natural_height);
gtk_widget_get_preferred_height (widget, &minimum_height, &natural_height);
/* convert for_size to unadjusted height (for_size is a proposed allocation) */
GTK_WIDGET_GET_CLASS (widget)->adjust_size_allocation (widget,
GTK_ORIENTATION_VERTICAL,
&minimum_height,
&natural_height,
&ignored_position,
&for_size);
push_recursion_check (widget, orientation, for_size);
GTK_WIDGET_GET_CLASS (widget)->get_preferred_width_for_height (widget, for_size,
GTK_WIDGET_GET_CLASS (widget)->get_preferred_width_for_height (widget,
MAX (for_size, minimum_height),
&min_size, &nat_size);
pop_recursion_check (widget, orientation);
}
@ -248,21 +251,24 @@ compute_size_for_orientation (GtkWidget *widget,
else
{
int ignored_position = 0;
int minimum_width;
int natural_width;
/* Pull the base natural width from the cache as it's needed to adjust
* the proposed 'for_size' */
gtk_widget_get_preferred_width (widget, NULL, &natural_width);
gtk_widget_get_preferred_width (widget, &minimum_width, &natural_width);
/* convert for_size to unadjusted width (for_size is a proposed allocation) */
GTK_WIDGET_GET_CLASS (widget)->adjust_size_allocation (widget,
GTK_ORIENTATION_HORIZONTAL,
&minimum_width,
&natural_width,
&ignored_position,
&for_size);
push_recursion_check (widget, orientation, for_size);
GTK_WIDGET_GET_CLASS (widget)->get_preferred_height_for_width (widget, for_size,
GTK_WIDGET_GET_CLASS (widget)->get_preferred_height_for_width (widget,
MAX (for_size, minimum_width),
&min_size, &nat_size);
pop_recursion_check (widget, orientation);
}

View File

@ -345,7 +345,7 @@ typedef AtkObjectFactory GtkSpinnerAccessibleFactory;
typedef AtkObjectFactoryClass GtkSpinnerAccessibleFactoryClass;
G_DEFINE_TYPE (GtkSpinnerAccessibleFactory,
gtk_spinner_accessible_factory,
_gtk_spinner_accessible_factory,
ATK_TYPE_OBJECT_FACTORY);
static GType
@ -366,14 +366,14 @@ gtk_spinner_accessible_factory_create_accessible (GObject *obj)
}
static void
gtk_spinner_accessible_factory_class_init (AtkObjectFactoryClass *klass)
_gtk_spinner_accessible_factory_class_init (AtkObjectFactoryClass *klass)
{
klass->create_accessible = gtk_spinner_accessible_factory_create_accessible;
klass->get_accessible_type = gtk_spinner_accessible_factory_get_accessible_type;
}
static void
gtk_spinner_accessible_factory_init (AtkObjectFactory *factory)
_gtk_spinner_accessible_factory_init (AtkObjectFactory *factory)
{
}
@ -402,7 +402,7 @@ gtk_spinner_get_accessible (GtkWidget *widget)
if (g_type_is_a (derived_atk_type, GTK_TYPE_ACCESSIBLE))
atk_registry_set_factory_type (registry,
GTK_TYPE_SPINNER,
gtk_spinner_accessible_factory_get_type ());
_gtk_spinner_accessible_factory_get_type ());
first_time = FALSE;
}

View File

@ -1753,40 +1753,6 @@ _cairo_draw_line (cairo_t *cr,
cairo_restore (cr);
}
static void
_cairo_draw_rectangle (cairo_t *cr,
GdkColor *color,
gboolean filled,
gint x,
gint y,
gint width,
gint height)
{
gdk_cairo_set_source_color (cr, color);
if (filled)
{
cairo_rectangle (cr, x, y, width, height);
cairo_fill (cr);
}
else
{
cairo_rectangle (cr, x + 0.5, y + 0.5, width, height);
cairo_stroke (cr);
}
}
static void
_cairo_draw_point (cairo_t *cr,
GdkColor *color,
gint x,
gint y)
{
gdk_cairo_set_source_color (cr, color);
cairo_rectangle (cr, x, y, 1, 1);
cairo_fill (cr);
}
static void
transform_detail_string (const gchar *detail,
GtkStyleContext *context)
@ -2020,153 +1986,6 @@ gtk_default_draw_vline (GtkStyle *style,
gtk_style_context_restore (context);
}
static void
draw_thin_shadow (GtkStyle *style,
cairo_t *cr,
GtkStateType state,
gint x,
gint y,
gint width,
gint height)
{
GdkColor *gc1, *gc2;
gc1 = &style->light[state];
gc2 = &style->dark[state];
_cairo_draw_line (cr, gc1,
x, y + height - 1, x + width - 1, y + height - 1);
_cairo_draw_line (cr, gc1,
x + width - 1, y, x + width - 1, y + height - 1);
_cairo_draw_line (cr, gc2,
x, y, x + width - 2, y);
_cairo_draw_line (cr, gc2,
x, y, x, y + height - 2);
}
static void
draw_spinbutton_shadow (GtkStyle *style,
cairo_t *cr,
GtkStateType state,
GtkTextDirection direction,
gint x,
gint y,
gint width,
gint height)
{
if (direction == GTK_TEXT_DIR_LTR)
{
_cairo_draw_line (cr, &style->dark[state],
x, y, x + width - 1, y);
_cairo_draw_line (cr, &style->black,
x, y + 1, x + width - 2, y + 1);
_cairo_draw_line (cr, &style->black,
x + width - 2, y + 2, x + width - 2, y + height - 3);
_cairo_draw_line (cr, &style->light[state],
x + width - 1, y + 1, x + width - 1, y + height - 2);
_cairo_draw_line (cr, &style->light[state],
x, y + height - 1, x + width - 1, y + height - 1);
_cairo_draw_line (cr, &style->bg[state],
x, y + height - 2, x + width - 2, y + height - 2);
_cairo_draw_line (cr, &style->black,
x, y + 2, x, y + height - 3);
}
else
{
_cairo_draw_line (cr, &style->dark[state],
x, y, x + width - 1, y);
_cairo_draw_line (cr, &style->dark[state],
x, y + 1, x, y + height - 1);
_cairo_draw_line (cr, &style->black,
x + 1, y + 1, x + width - 1, y + 1);
_cairo_draw_line (cr, &style->black,
x + 1, y + 2, x + 1, y + height - 2);
_cairo_draw_line (cr, &style->black,
x + width - 1, y + 2, x + width - 1, y + height - 3);
_cairo_draw_line (cr, &style->light[state],
x + 1, y + height - 1, x + width - 1, y + height - 1);
_cairo_draw_line (cr, &style->bg[state],
x + 2, y + height - 2, x + width - 1, y + height - 2);
}
}
static void
draw_menu_shadow (GtkStyle *style,
cairo_t *cr,
GtkStateType state,
gint x,
gint y,
gint width,
gint height)
{
if (style->ythickness > 0)
{
if (style->ythickness > 1)
{
_cairo_draw_line (cr, &style->dark[state],
x + 1, y + height - 2,
x + width - 2, y + height - 2);
_cairo_draw_line (cr, &style->black,
x, y + height - 1, x + width - 1, y + height - 1);
}
else
{
_cairo_draw_line (cr, &style->dark[state],
x + 1, y + height - 1, x + width - 1, y + height - 1);
}
}
if (style->xthickness > 0)
{
if (style->xthickness > 1)
{
_cairo_draw_line (cr, &style->dark[state],
x + width - 2, y + 1,
x + width - 2, y + height - 2);
_cairo_draw_line (cr, &style->black,
x + width - 1, y, x + width - 1, y + height - 1);
}
else
{
_cairo_draw_line (cr, &style->dark[state],
x + width - 1, y + 1, x + width - 1, y + height - 1);
}
}
/* Light around top and left */
if (style->ythickness > 0)
_cairo_draw_line (cr, &style->black,
x, y, x + width - 2, y);
if (style->xthickness > 0)
_cairo_draw_line (cr, &style->black,
x, y, x, y + height - 2);
if (style->ythickness > 1)
_cairo_draw_line (cr, &style->light[state],
x + 1, y + 1, x + width - 3, y + 1);
if (style->xthickness > 1)
_cairo_draw_line (cr, &style->light[state],
x + 1, y + 1, x + 1, y + height - 3);
}
static GtkTextDirection
get_direction (GtkWidget *widget)
{
GtkTextDirection dir;
if (widget)
dir = gtk_widget_get_direction (widget);
else
dir = GTK_TEXT_DIR_LTR;
return dir;
}
static void
gtk_default_draw_shadow (GtkStyle *style,
cairo_t *cr,
@ -2250,75 +2069,6 @@ draw_arrow (cairo_t *cr,
cairo_restore (cr);
}
static void
calculate_arrow_geometry (GtkArrowType arrow_type,
gint *x,
gint *y,
gint *width,
gint *height)
{
gint w = *width;
gint h = *height;
switch (arrow_type)
{
case GTK_ARROW_UP:
case GTK_ARROW_DOWN:
w += (w % 2) - 1;
h = (w / 2 + 1);
if (h > *height)
{
h = *height;
w = 2 * h - 1;
}
if (arrow_type == GTK_ARROW_DOWN)
{
if (*height % 2 == 1 || h % 2 == 0)
*height += 1;
}
else
{
if (*height % 2 == 0 || h % 2 == 0)
*height -= 1;
}
break;
case GTK_ARROW_RIGHT:
case GTK_ARROW_LEFT:
h += (h % 2) - 1;
w = (h / 2 + 1);
if (w > *width)
{
w = *width;
h = 2 * w - 1;
}
if (arrow_type == GTK_ARROW_RIGHT)
{
if (*width % 2 == 1 || w % 2 == 0)
*width += 1;
}
else
{
if (*width % 2 == 0 || w % 2 == 0)
*width -= 1;
}
break;
default:
/* should not be reached */
break;
}
*x += (*width - w) / 2;
*y += (*height - h) / 2;
*height = h;
*width = w;
}
static void
gtk_default_draw_arrow (GtkStyle *style,
cairo_t *cr,
@ -2548,16 +2298,6 @@ option_menu_get_props (GtkWidget *widget,
*indicator_spacing = default_option_indicator_spacing;
}
static gboolean
background_is_solid (GtkStyle *style,
GtkStateType type)
{
if (style->background[type] == NULL)
return FALSE;
return cairo_pattern_get_type (style->background[type]) == CAIRO_PATTERN_TYPE_SOLID;
}
static void
gtk_default_draw_box (GtkStyle *style,
cairo_t *cr,
@ -2624,23 +2364,6 @@ gtk_default_draw_box (GtkStyle *style,
gtk_style_context_restore (context);
}
static GdkColor *
get_darkened (const GdkColor *color,
gint darken_count)
{
GdkColor src = *color;
GdkColor shaded = *color;
while (darken_count)
{
_gtk_style_shade (&src, &shaded, 0.93);
src = shaded;
--darken_count;
}
return gdk_color_copy (&shaded);
}
static void
gtk_default_draw_flat_box (GtkStyle *style,
cairo_t *cr,
@ -3170,32 +2893,6 @@ gtk_default_draw_slider (GtkStyle *style,
gtk_style_context_restore (context);
}
static void
draw_dot (cairo_t *cr,
GdkColor *light,
GdkColor *dark,
gint x,
gint y,
gushort size)
{
size = CLAMP (size, 2, 3);
if (size == 2)
{
_cairo_draw_point (cr, light, x, y);
_cairo_draw_point (cr, light, x+1, y+1);
}
else if (size == 3)
{
_cairo_draw_point (cr, light, x, y);
_cairo_draw_point (cr, light, x+1, y);
_cairo_draw_point (cr, light, x, y+1);
_cairo_draw_point (cr, dark, x+1, y+2);
_cairo_draw_point (cr, dark, x+2, y+1);
_cairo_draw_point (cr, dark, x+2, y+2);
}
}
static void
gtk_default_draw_handle (GtkStyle *style,
cairo_t *cr,

View File

@ -495,7 +495,7 @@ enum {
LAST_SIGNAL
};
guint signals[LAST_SIGNAL] = { 0 };
static guint signals[LAST_SIGNAL] = { 0 };
static GQuark provider_list_quark = 0;
@ -842,19 +842,19 @@ animation_info_new (GtkStyleContext *context,
info = g_slice_new0 (AnimationInfo);
info->rectangles = g_array_new (FALSE, FALSE, sizeof (cairo_rectangle_int_t));
info->timeline = gtk_timeline_new (duration);
info->timeline = _gtk_timeline_new (duration);
info->window = g_object_ref (window);
info->state = state;
info->target_value = target_value;
info->region_id = region_id;
gtk_timeline_set_progress_type (info->timeline, progress_type);
gtk_timeline_set_loop (info->timeline, loop);
_gtk_timeline_set_progress_type (info->timeline, progress_type);
_gtk_timeline_set_loop (info->timeline, loop);
if (!loop && !target_value)
{
gtk_timeline_set_direction (info->timeline, GTK_TIMELINE_DIRECTION_BACKWARD);
gtk_timeline_rewind (info->timeline);
_gtk_timeline_set_direction (info->timeline, GTK_TIMELINE_DIRECTION_BACKWARD);
_gtk_timeline_rewind (info->timeline);
}
g_signal_connect (info->timeline, "frame",
@ -862,7 +862,7 @@ animation_info_new (GtkStyleContext *context,
g_signal_connect (info->timeline, "finished",
G_CALLBACK (timeline_finished_cb), context);
gtk_timeline_start (info->timeline);
_gtk_timeline_start (info->timeline);
return info;
}
@ -1076,7 +1076,7 @@ build_icon_factories (GtkStyleContext *context,
}
}
GtkWidgetPath *
static GtkWidgetPath *
create_query_path (GtkStyleContext *context)
{
GtkStyleContextPrivate *priv;
@ -1628,7 +1628,7 @@ gtk_style_context_state_is_running (GtkStyleContext *context,
context_has_animatable_region (context, info->region_id))
{
if (progress)
*progress = gtk_timeline_get_progress (info->timeline);
*progress = _gtk_timeline_get_progress (info->timeline);
return TRUE;
}
@ -2855,9 +2855,9 @@ gtk_style_context_notify_state_change (GtkStyleContext *context,
if (!desc)
return;
if (gtk_animation_description_get_duration (desc) == 0)
if (_gtk_animation_description_get_duration (desc) == 0)
{
gtk_animation_description_unref (desc);
_gtk_animation_description_unref (desc);
return;
}
@ -2867,37 +2867,37 @@ gtk_style_context_notify_state_change (GtkStyleContext *context,
info->target_value != state_value)
{
/* Target values are the opposite */
if (!gtk_timeline_get_loop (info->timeline))
if (!_gtk_timeline_get_loop (info->timeline))
{
/* Reverse the animation */
if (gtk_timeline_get_direction (info->timeline) == GTK_TIMELINE_DIRECTION_FORWARD)
gtk_timeline_set_direction (info->timeline, GTK_TIMELINE_DIRECTION_BACKWARD);
if (_gtk_timeline_get_direction (info->timeline) == GTK_TIMELINE_DIRECTION_FORWARD)
_gtk_timeline_set_direction (info->timeline, GTK_TIMELINE_DIRECTION_BACKWARD);
else
gtk_timeline_set_direction (info->timeline, GTK_TIMELINE_DIRECTION_FORWARD);
_gtk_timeline_set_direction (info->timeline, GTK_TIMELINE_DIRECTION_FORWARD);
info->target_value = state_value;
}
else
{
/* Take it out of its looping state */
gtk_timeline_set_loop (info->timeline, FALSE);
_gtk_timeline_set_loop (info->timeline, FALSE);
}
}
else if (!info &&
(!gtk_animation_description_get_loop (desc) ||
(!_gtk_animation_description_get_loop (desc) ||
state_value))
{
info = animation_info_new (context, region_id,
gtk_animation_description_get_duration (desc),
gtk_animation_description_get_progress_type (desc),
gtk_animation_description_get_loop (desc),
_gtk_animation_description_get_duration (desc),
_gtk_animation_description_get_progress_type (desc),
_gtk_animation_description_get_loop (desc),
state, state_value, window);
priv->animations = g_slist_prepend (priv->animations, info);
priv->animations_invalidated = TRUE;
}
gtk_animation_description_unref (desc);
_gtk_animation_description_unref (desc);
}
/**
@ -3383,6 +3383,8 @@ gtk_render_check (GtkStyleContext *context,
g_return_if_fail (GTK_IS_STYLE_CONTEXT (context));
g_return_if_fail (cr != NULL);
g_return_if_fail (width > 0);
g_return_if_fail (height > 0);
priv = context->priv;
engine_class = GTK_THEMING_ENGINE_GET_CLASS (priv->theming_engine);
@ -3427,6 +3429,8 @@ gtk_render_option (GtkStyleContext *context,
g_return_if_fail (GTK_IS_STYLE_CONTEXT (context));
g_return_if_fail (cr != NULL);
g_return_if_fail (width > 0);
g_return_if_fail (height > 0);
priv = context->priv;
engine_class = GTK_THEMING_ENGINE_GET_CLASS (priv->theming_engine);
@ -3469,6 +3473,7 @@ gtk_render_arrow (GtkStyleContext *context,
g_return_if_fail (GTK_IS_STYLE_CONTEXT (context));
g_return_if_fail (cr != NULL);
g_return_if_fail (size > 0);
priv = context->priv;
engine_class = GTK_THEMING_ENGINE_GET_CLASS (priv->theming_engine);
@ -3514,6 +3519,8 @@ gtk_render_background (GtkStyleContext *context,
g_return_if_fail (GTK_IS_STYLE_CONTEXT (context));
g_return_if_fail (cr != NULL);
g_return_if_fail (width > 0);
g_return_if_fail (height > 0);
priv = context->priv;
engine_class = GTK_THEMING_ENGINE_GET_CLASS (priv->theming_engine);
@ -3560,6 +3567,8 @@ gtk_render_frame (GtkStyleContext *context,
g_return_if_fail (GTK_IS_STYLE_CONTEXT (context));
g_return_if_fail (cr != NULL);
g_return_if_fail (width > 0);
g_return_if_fail (height > 0);
priv = context->priv;
engine_class = GTK_THEMING_ENGINE_GET_CLASS (priv->theming_engine);
@ -3603,6 +3612,8 @@ gtk_render_expander (GtkStyleContext *context,
g_return_if_fail (GTK_IS_STYLE_CONTEXT (context));
g_return_if_fail (cr != NULL);
g_return_if_fail (width > 0);
g_return_if_fail (height > 0);
priv = context->priv;
engine_class = GTK_THEMING_ENGINE_GET_CLASS (priv->theming_engine);
@ -3643,6 +3654,8 @@ gtk_render_focus (GtkStyleContext *context,
g_return_if_fail (GTK_IS_STYLE_CONTEXT (context));
g_return_if_fail (cr != NULL);
g_return_if_fail (width > 0);
g_return_if_fail (height > 0);
priv = context->priv;
engine_class = GTK_THEMING_ENGINE_GET_CLASS (priv->theming_engine);
@ -3677,6 +3690,7 @@ gtk_render_layout (GtkStyleContext *context,
PangoRectangle extents;
g_return_if_fail (GTK_IS_STYLE_CONTEXT (context));
g_return_if_fail (PANGO_IS_LAYOUT (layout));
g_return_if_fail (cr != NULL);
priv = context->priv;
@ -3763,6 +3777,8 @@ gtk_render_slider (GtkStyleContext *context,
g_return_if_fail (GTK_IS_STYLE_CONTEXT (context));
g_return_if_fail (cr != NULL);
g_return_if_fail (width > 0);
g_return_if_fail (height > 0);
priv = context->priv;
engine_class = GTK_THEMING_ENGINE_GET_CLASS (priv->theming_engine);
@ -3813,6 +3829,16 @@ gtk_render_frame_gap (GtkStyleContext *context,
g_return_if_fail (GTK_IS_STYLE_CONTEXT (context));
g_return_if_fail (cr != NULL);
g_return_if_fail (width > 0);
g_return_if_fail (height > 0);
g_return_if_fail (xy0_gap < xy1_gap);
g_return_if_fail (xy0_gap >= 0);
if (gap_side == GTK_POS_LEFT ||
gap_side == GTK_POS_RIGHT)
g_return_if_fail (xy1_gap <= height);
else
g_return_if_fail (xy1_gap <= width);
priv = context->priv;
engine_class = GTK_THEMING_ENGINE_GET_CLASS (priv->theming_engine);
@ -3860,6 +3886,8 @@ gtk_render_extension (GtkStyleContext *context,
g_return_if_fail (GTK_IS_STYLE_CONTEXT (context));
g_return_if_fail (cr != NULL);
g_return_if_fail (width > 0);
g_return_if_fail (height > 0);
priv = context->priv;
engine_class = GTK_THEMING_ENGINE_GET_CLASS (priv->theming_engine);
@ -3903,6 +3931,8 @@ gtk_render_handle (GtkStyleContext *context,
g_return_if_fail (GTK_IS_STYLE_CONTEXT (context));
g_return_if_fail (cr != NULL);
g_return_if_fail (width > 0);
g_return_if_fail (height > 0);
priv = context->priv;
engine_class = GTK_THEMING_ENGINE_GET_CLASS (priv->theming_engine);
@ -3941,6 +3971,8 @@ gtk_render_activity (GtkStyleContext *context,
g_return_if_fail (GTK_IS_STYLE_CONTEXT (context));
g_return_if_fail (cr != NULL);
g_return_if_fail (width > 0);
g_return_if_fail (height > 0);
priv = context->priv;
engine_class = GTK_THEMING_ENGINE_GET_CLASS (priv->theming_engine);

View File

@ -889,19 +889,13 @@ gtk_theming_module_load (GTypeModule *type_module)
module_path = _gtk_find_module (name, "theming-engines");
if (!module_path)
{
g_warning (_("Unable to locate theme engine in module path: \"%s\","), name);
return FALSE;
}
module = g_module_open (module_path, G_MODULE_BIND_LAZY | G_MODULE_BIND_LOCAL);
g_free (module_path);
if (!module)
{
g_warning ("%s", g_module_error ());
return FALSE;
}
if (!g_module_symbol (module, "theme_init",
(gpointer *) &theming_module->init) ||
@ -910,7 +904,6 @@ gtk_theming_module_load (GTypeModule *type_module)
!g_module_symbol (module, "create_engine",
(gpointer *) &theming_module->create_engine))
{
g_warning ("%s", g_module_error ());
g_module_close (module);
return FALSE;
@ -1971,8 +1964,8 @@ gtk_theming_engine_render_frame (GtkThemingEngine *engine,
if (slice)
{
gtk_9slice_render (slice, cr, x, y, width, height);
gtk_9slice_unref (slice);
_gtk_9slice_render (slice, cr, x, y, width, height);
_gtk_9slice_unref (slice);
}
else if (border_style != GTK_BORDER_STYLE_NONE)
render_frame_internal (engine, cr,

View File

@ -76,20 +76,20 @@ static void gtk_timeline_get_property (GObject *object,
guint prop_id,
GValue *value,
GParamSpec *pspec);
static void gtk_timeline_finalize (GObject *object);
static void _gtk_timeline_finalize (GObject *object);
G_DEFINE_TYPE (GtkTimeline, gtk_timeline, G_TYPE_OBJECT)
G_DEFINE_TYPE (GtkTimeline, _gtk_timeline, G_TYPE_OBJECT)
static void
gtk_timeline_class_init (GtkTimelineClass *klass)
_gtk_timeline_class_init (GtkTimelineClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
object_class->set_property = gtk_timeline_set_property;
object_class->get_property = gtk_timeline_get_property;
object_class->finalize = gtk_timeline_finalize;
object_class->finalize = _gtk_timeline_finalize;
g_object_class_install_property (object_class,
PROP_FPS,
@ -163,7 +163,7 @@ gtk_timeline_class_init (GtkTimelineClass *klass)
}
static void
gtk_timeline_init (GtkTimeline *timeline)
_gtk_timeline_init (GtkTimeline *timeline)
{
GtkTimelinePriv *priv;
@ -194,19 +194,19 @@ gtk_timeline_set_property (GObject *object,
switch (prop_id)
{
case PROP_FPS:
gtk_timeline_set_fps (timeline, g_value_get_uint (value));
_gtk_timeline_set_fps (timeline, g_value_get_uint (value));
break;
case PROP_DURATION:
gtk_timeline_set_duration (timeline, g_value_get_uint (value));
_gtk_timeline_set_duration (timeline, g_value_get_uint (value));
break;
case PROP_LOOP:
gtk_timeline_set_loop (timeline, g_value_get_boolean (value));
_gtk_timeline_set_loop (timeline, g_value_get_boolean (value));
break;
case PROP_DIRECTION:
gtk_timeline_set_direction (timeline, g_value_get_enum (value));
_gtk_timeline_set_direction (timeline, g_value_get_enum (value));
break;
case PROP_SCREEN:
gtk_timeline_set_screen (timeline,
_gtk_timeline_set_screen (timeline,
GDK_SCREEN (g_value_get_object (value)));
break;
default:
@ -249,7 +249,7 @@ gtk_timeline_get_property (GObject *object,
}
static void
gtk_timeline_finalize (GObject *object)
_gtk_timeline_finalize (GObject *object)
{
GtkTimelinePriv *priv;
GtkTimeline *timeline;
@ -266,10 +266,10 @@ gtk_timeline_finalize (GObject *object)
if (priv->timer)
g_timer_destroy (priv->timer);
G_OBJECT_CLASS (gtk_timeline_parent_class)->finalize (object);
G_OBJECT_CLASS (_gtk_timeline_parent_class)->finalize (object);
}
gdouble
static gdouble
calculate_progress (gdouble linear_progress,
GtkTimelineProgressType progress_type)
{
@ -354,7 +354,7 @@ gtk_timeline_run_frame (GtkTimeline *timeline)
return FALSE;
}
else
gtk_timeline_rewind (timeline);
_gtk_timeline_rewind (timeline);
}
return TRUE;
@ -369,7 +369,7 @@ gtk_timeline_run_frame (GtkTimeline *timeline)
* Return Value: the newly created #GtkTimeline
**/
GtkTimeline *
gtk_timeline_new (guint duration)
_gtk_timeline_new (guint duration)
{
return g_object_new (GTK_TYPE_TIMELINE,
"duration", duration,
@ -377,7 +377,7 @@ gtk_timeline_new (guint duration)
}
GtkTimeline *
gtk_timeline_new_for_screen (guint duration,
_gtk_timeline_new_for_screen (guint duration,
GdkScreen *screen)
{
return g_object_new (GTK_TYPE_TIMELINE,
@ -393,7 +393,7 @@ gtk_timeline_new_for_screen (guint duration,
* Runs the timeline from the current frame.
**/
void
gtk_timeline_start (GtkTimeline *timeline)
_gtk_timeline_start (GtkTimeline *timeline)
{
GtkTimelinePriv *priv;
GtkSettings *settings;
@ -440,7 +440,7 @@ gtk_timeline_start (GtkTimeline *timeline)
* Pauses the timeline.
**/
void
gtk_timeline_pause (GtkTimeline *timeline)
_gtk_timeline_pause (GtkTimeline *timeline)
{
GtkTimelinePriv *priv;
@ -464,7 +464,7 @@ gtk_timeline_pause (GtkTimeline *timeline)
* Rewinds the timeline.
**/
void
gtk_timeline_rewind (GtkTimeline *timeline)
_gtk_timeline_rewind (GtkTimeline *timeline)
{
GtkTimelinePriv *priv;
@ -472,7 +472,7 @@ gtk_timeline_rewind (GtkTimeline *timeline)
priv = timeline->priv;
if (gtk_timeline_get_direction(timeline) != GTK_TIMELINE_DIRECTION_FORWARD)
if (_gtk_timeline_get_direction (timeline) != GTK_TIMELINE_DIRECTION_FORWARD)
priv->progress = priv->last_progress = 1.;
else
priv->progress = priv->last_progress = 0.;
@ -496,7 +496,7 @@ gtk_timeline_rewind (GtkTimeline *timeline)
* Return Value: %TRUE if the timeline is running
**/
gboolean
gtk_timeline_is_running (GtkTimeline *timeline)
_gtk_timeline_is_running (GtkTimeline *timeline)
{
GtkTimelinePriv *priv;
@ -516,7 +516,7 @@ gtk_timeline_is_running (GtkTimeline *timeline)
* Return Value: frames per second
**/
guint
gtk_timeline_get_fps (GtkTimeline *timeline)
_gtk_timeline_get_fps (GtkTimeline *timeline)
{
GtkTimelinePriv *priv;
@ -535,7 +535,7 @@ gtk_timeline_get_fps (GtkTimeline *timeline)
* the timeline will play.
**/
void
gtk_timeline_set_fps (GtkTimeline *timeline,
_gtk_timeline_set_fps (GtkTimeline *timeline,
guint fps)
{
GtkTimelinePriv *priv;
@ -547,7 +547,7 @@ gtk_timeline_set_fps (GtkTimeline *timeline,
priv->fps = fps;
if (gtk_timeline_is_running (timeline))
if (_gtk_timeline_is_running (timeline))
{
g_source_remove (priv->source_id);
priv->source_id = gdk_threads_add_timeout (FRAME_INTERVAL (priv->fps),
@ -568,7 +568,7 @@ gtk_timeline_set_fps (GtkTimeline *timeline,
* Return Value: %TRUE if the timeline loops
**/
gboolean
gtk_timeline_get_loop (GtkTimeline *timeline)
_gtk_timeline_get_loop (GtkTimeline *timeline)
{
GtkTimelinePriv *priv;
@ -587,7 +587,7 @@ gtk_timeline_get_loop (GtkTimeline *timeline)
* when it has reached the end.
**/
void
gtk_timeline_set_loop (GtkTimeline *timeline,
_gtk_timeline_set_loop (GtkTimeline *timeline,
gboolean loop)
{
GtkTimelinePriv *priv;
@ -604,7 +604,7 @@ gtk_timeline_set_loop (GtkTimeline *timeline,
}
void
gtk_timeline_set_duration (GtkTimeline *timeline,
_gtk_timeline_set_duration (GtkTimeline *timeline,
guint duration)
{
GtkTimelinePriv *priv;
@ -621,7 +621,7 @@ gtk_timeline_set_duration (GtkTimeline *timeline,
}
guint
gtk_timeline_get_duration (GtkTimeline *timeline)
_gtk_timeline_get_duration (GtkTimeline *timeline)
{
GtkTimelinePriv *priv;
@ -640,7 +640,7 @@ gtk_timeline_get_duration (GtkTimeline *timeline)
* Sets the direction of the timeline.
**/
void
gtk_timeline_set_direction (GtkTimeline *timeline,
_gtk_timeline_set_direction (GtkTimeline *timeline,
GtkTimelineDirection direction)
{
GtkTimelinePriv *priv;
@ -660,7 +660,7 @@ gtk_timeline_set_direction (GtkTimeline *timeline,
* Return Value: direction
**/
GtkTimelineDirection
gtk_timeline_get_direction (GtkTimeline *timeline)
_gtk_timeline_get_direction (GtkTimeline *timeline)
{
GtkTimelinePriv *priv;
@ -671,7 +671,7 @@ gtk_timeline_get_direction (GtkTimeline *timeline)
}
void
gtk_timeline_set_screen (GtkTimeline *timeline,
_gtk_timeline_set_screen (GtkTimeline *timeline,
GdkScreen *screen)
{
GtkTimelinePriv *priv;
@ -690,7 +690,7 @@ gtk_timeline_set_screen (GtkTimeline *timeline,
}
GdkScreen *
gtk_timeline_get_screen (GtkTimeline *timeline)
_gtk_timeline_get_screen (GtkTimeline *timeline)
{
GtkTimelinePriv *priv;
@ -701,7 +701,7 @@ gtk_timeline_get_screen (GtkTimeline *timeline)
}
gdouble
gtk_timeline_get_progress (GtkTimeline *timeline)
_gtk_timeline_get_progress (GtkTimeline *timeline)
{
GtkTimelinePriv *priv;
@ -712,7 +712,7 @@ gtk_timeline_get_progress (GtkTimeline *timeline)
}
GtkTimelineProgressType
gtk_timeline_get_progress_type (GtkTimeline *timeline)
_gtk_timeline_get_progress_type (GtkTimeline *timeline)
{
GtkTimelinePriv *priv;
@ -723,7 +723,7 @@ gtk_timeline_get_progress_type (GtkTimeline *timeline)
}
void
gtk_timeline_set_progress_type (GtkTimeline *timeline,
_gtk_timeline_set_progress_type (GtkTimeline *timeline,
GtkTimelineProgressType progress_type)
{
GtkTimelinePriv *priv;

View File

@ -26,7 +26,7 @@
G_BEGIN_DECLS
#define GTK_TYPE_TIMELINE (gtk_timeline_get_type ())
#define GTK_TYPE_TIMELINE (_gtk_timeline_get_type ())
#define GTK_TIMELINE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_TIMELINE, GtkTimeline))
#define GTK_TIMELINE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_TIMELINE, GtkTimelineClass))
#define GTK_IS_TIMELINE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_TIMELINE))
@ -73,42 +73,42 @@ struct GtkTimelineClass
};
GType gtk_timeline_get_type (void) G_GNUC_CONST;
GType _gtk_timeline_get_type (void) G_GNUC_CONST;
GtkTimeline *gtk_timeline_new (guint duration);
GtkTimeline *gtk_timeline_new_for_screen (guint duration,
GtkTimeline * _gtk_timeline_new (guint duration);
GtkTimeline * _gtk_timeline_new_for_screen (guint duration,
GdkScreen *screen);
void gtk_timeline_start (GtkTimeline *timeline);
void gtk_timeline_pause (GtkTimeline *timeline);
void gtk_timeline_rewind (GtkTimeline *timeline);
void _gtk_timeline_start (GtkTimeline *timeline);
void _gtk_timeline_pause (GtkTimeline *timeline);
void _gtk_timeline_rewind (GtkTimeline *timeline);
gboolean gtk_timeline_is_running (GtkTimeline *timeline);
gboolean _gtk_timeline_is_running (GtkTimeline *timeline);
guint gtk_timeline_get_fps (GtkTimeline *timeline);
void gtk_timeline_set_fps (GtkTimeline *timeline,
guint _gtk_timeline_get_fps (GtkTimeline *timeline);
void _gtk_timeline_set_fps (GtkTimeline *timeline,
guint fps);
gboolean gtk_timeline_get_loop (GtkTimeline *timeline);
void gtk_timeline_set_loop (GtkTimeline *timeline,
gboolean _gtk_timeline_get_loop (GtkTimeline *timeline);
void _gtk_timeline_set_loop (GtkTimeline *timeline,
gboolean loop);
guint gtk_timeline_get_duration (GtkTimeline *timeline);
void gtk_timeline_set_duration (GtkTimeline *timeline,
guint _gtk_timeline_get_duration (GtkTimeline *timeline);
void _gtk_timeline_set_duration (GtkTimeline *timeline,
guint duration);
GdkScreen *gtk_timeline_get_screen (GtkTimeline *timeline);
void gtk_timeline_set_screen (GtkTimeline *timeline,
GdkScreen * _gtk_timeline_get_screen (GtkTimeline *timeline);
void _gtk_timeline_set_screen (GtkTimeline *timeline,
GdkScreen *screen);
GtkTimelineDirection gtk_timeline_get_direction (GtkTimeline *timeline);
void gtk_timeline_set_direction (GtkTimeline *timeline,
GtkTimelineDirection _gtk_timeline_get_direction (GtkTimeline *timeline);
void _gtk_timeline_set_direction (GtkTimeline *timeline,
GtkTimelineDirection direction);
gdouble gtk_timeline_get_progress (GtkTimeline *timeline);
gdouble _gtk_timeline_get_progress (GtkTimeline *timeline);
GtkTimelineProgressType gtk_timeline_get_progress_type (GtkTimeline *timeline);
void gtk_timeline_set_progress_type (GtkTimeline *timeline,
GtkTimelineProgressType _gtk_timeline_get_progress_type (GtkTimeline *timeline);
void _gtk_timeline_set_progress_type (GtkTimeline *timeline,
GtkTimelineProgressType progress_type);

View File

@ -641,6 +641,7 @@ static void gtk_widget_real_adjust_size_request (GtkWidget
gint *natural_size);
static void gtk_widget_real_adjust_size_allocation (GtkWidget *widget,
GtkOrientation orientation,
gint *minimum_size,
gint *natural_size,
gint *allocated_pos,
gint *allocated_size);
@ -1519,6 +1520,12 @@ gtk_widget_class_init (GtkWidgetClass *klass)
* The ::style-set signal is emitted when a new style has been set
* on a widget. Note that style-modifying functions like
* gtk_widget_modify_base() also cause this signal to be emitted.
*
* Note that this signal is emitted for changes to the deprecated
* #GtkStyle. To track changes to the #GtkStyleContext associated
* with a widget, use the #GtkWidget::style-updated signal.
*
* Deprecated:3.0: Use the #GtkWidget::style-updated signal
*/
widget_signals[STYLE_SET] =
g_signal_new (I_("style-set"),
@ -1530,6 +1537,16 @@ gtk_widget_class_init (GtkWidgetClass *klass)
G_TYPE_NONE, 1,
GTK_TYPE_STYLE);
/**
* GtkWidget::style-updated:
* @widget: the object on which the signal is emitted
*
* The ::style-updated signal is emitted when the #GtkStyleContext
* of a widget is changed. Note that style-modifying functions like
* gtk_widget_override_color() also cause this signal to be emitted.
*
* Since: 3.0
*/
widget_signals[STYLE_UPDATED] =
g_signal_new (I_("style-updated"),
G_TYPE_FROM_CLASS (gobject_class),
@ -4097,10 +4114,10 @@ _gtk_widget_start_state_transitions (GtkWidget *widget)
if (animation_desc)
{
if (gtk_animation_description_get_loop (animation_desc))
if (_gtk_animation_description_get_loop (animation_desc))
_gtk_widget_notify_state_change (widget, flag, TRUE);
gtk_animation_description_unref (animation_desc);
_gtk_animation_description_unref (animation_desc);
}
flag >>= 1;
@ -4636,7 +4653,7 @@ gtk_widget_size_allocate (GtkWidget *widget,
gboolean alloc_needed;
gboolean size_changed;
gboolean position_changed;
gint natural_width, natural_height;
gint natural_width, natural_height, dummy;
gint min_width, min_height;
priv = widget->priv;
@ -4681,7 +4698,7 @@ gtk_widget_size_allocate (GtkWidget *widget,
* when aligning implicitly.
*/
gtk_widget_get_preferred_width (widget, &min_width, &natural_width);
gtk_widget_get_preferred_height_for_width (widget, real_allocation.width, NULL, &natural_height);
gtk_widget_get_preferred_height_for_width (widget, real_allocation.width, &dummy, &natural_height);
}
else
{
@ -4690,18 +4707,20 @@ gtk_widget_size_allocate (GtkWidget *widget,
* when aligning implicitly.
*/
gtk_widget_get_preferred_height (widget, &min_height, &natural_height);
gtk_widget_get_preferred_width_for_height (widget, real_allocation.height, NULL, &natural_width);
gtk_widget_get_preferred_width_for_height (widget, real_allocation.height, &dummy, &natural_width);
}
/* Now that we have the right natural height and width, go ahead and remove any margins from the
* allocated sizes and possibly limit them to the natural sizes */
GTK_WIDGET_GET_CLASS (widget)->adjust_size_allocation (widget,
GTK_ORIENTATION_HORIZONTAL,
&dummy,
&natural_width,
&adjusted_allocation.x,
&adjusted_allocation.width);
GTK_WIDGET_GET_CLASS (widget)->adjust_size_allocation (widget,
GTK_ORIENTATION_VERTICAL,
&dummy,
&natural_height,
&adjusted_allocation.y,
&adjusted_allocation.height);
@ -5026,10 +5045,12 @@ adjust_for_align(GtkAlign align,
static void
adjust_for_margin(gint start_margin,
gint end_margin,
gint *minimum_size,
gint *natural_size,
gint *allocated_pos,
gint *allocated_size)
{
*minimum_size -= (start_margin + end_margin);
*natural_size -= (start_margin + end_margin);
*allocated_pos += start_margin;
*allocated_size -= (start_margin + end_margin);
@ -5038,6 +5059,7 @@ adjust_for_margin(gint start_margin,
static void
gtk_widget_real_adjust_size_allocation (GtkWidget *widget,
GtkOrientation orientation,
gint *minimum_size,
gint *natural_size,
gint *allocated_pos,
gint *allocated_size)
@ -5050,7 +5072,8 @@ gtk_widget_real_adjust_size_allocation (GtkWidget *widget,
{
adjust_for_margin (aux_info->margin.left,
aux_info->margin.right,
natural_size, allocated_pos, allocated_size);
minimum_size, natural_size,
allocated_pos, allocated_size);
adjust_for_align (aux_info->halign,
natural_size, allocated_pos, allocated_size);
}
@ -5058,7 +5081,8 @@ gtk_widget_real_adjust_size_allocation (GtkWidget *widget,
{
adjust_for_margin (aux_info->margin.top,
aux_info->margin.bottom,
natural_size, allocated_pos, allocated_size);
minimum_size, natural_size,
allocated_pos, allocated_size);
adjust_for_align (aux_info->valign,
natural_size, allocated_pos, allocated_size);
}
@ -7935,6 +7959,11 @@ modifier_style_changed (GtkModifierStyle *style,
context = gtk_widget_get_style_context (widget);
gtk_style_context_invalidate (context);
g_signal_emit (widget,
widget_signals[STYLE_SET],
0,
widget->priv->style);
}
static GtkModifierStyle *
@ -8188,11 +8217,6 @@ gtk_widget_modify_fg (GtkWidget *widget,
}
else
gtk_widget_override_color (widget, state, NULL);
g_signal_emit (widget,
widget_signals[STYLE_SET],
0,
widget->priv->style);
}
/**
@ -8258,11 +8282,6 @@ gtk_widget_modify_bg (GtkWidget *widget,
}
else
gtk_widget_override_background_color (widget, state, NULL);
g_signal_emit (widget,
widget_signals[STYLE_SET],
0,
widget->priv->style);
}
/**
@ -8327,36 +8346,6 @@ gtk_widget_modify_base (GtkWidget *widget,
gtk_widget_modify_color_component (widget, GTK_RC_BASE, state, color);
}
static void
modify_color_property (GtkWidget *widget,
GtkRcStyle *rc_style,
const char *name,
const GdkColor *color)
{
GQuark type_name = g_type_qname (G_OBJECT_TYPE (widget));
GQuark property_name = g_quark_from_string (name);
if (color)
{
GtkRcProperty rc_property = {0};
char *color_name;
rc_property.type_name = type_name;
rc_property.property_name = property_name;
rc_property.origin = NULL;
color_name = gdk_color_to_string (color);
g_value_init (&rc_property.value, G_TYPE_STRING);
g_value_take_string (&rc_property.value, color_name);
_gtk_rc_style_set_rc_property (rc_style, &rc_property);
g_value_unset (&rc_property.value);
}
else
_gtk_rc_style_unset_rc_property (rc_style, type_name, property_name);
}
/**
* gtk_widget_modify_cursor:
* @widget: a #GtkWidget
@ -8396,11 +8385,6 @@ gtk_widget_modify_cursor (GtkWidget *widget,
secondary_rgba.alpha = 1;
gtk_widget_override_cursor (widget, &primary_rgba, &secondary_rgba);
g_signal_emit (widget,
widget_signals[STYLE_SET],
0,
widget->priv->style);
}
/**
@ -8421,11 +8405,6 @@ gtk_widget_modify_font (GtkWidget *widget,
g_return_if_fail (GTK_IS_WIDGET (widget));
gtk_widget_override_font (widget, font_desc);
g_signal_emit (widget,
widget_signals[STYLE_SET],
0,
widget->priv->style);
}
static void
@ -8707,6 +8686,15 @@ reset_style_recurse (GtkWidget *widget, gpointer data)
NULL);
}
/**
* gtk_widget_reset_style:
* @widget: a #GtkWidget
*
* Updates the style context of @widget and all descendents
* by updating its widget path.
*
* Since: 3.0
*/
void
gtk_widget_reset_style (GtkWidget *widget)
{
@ -8776,7 +8764,7 @@ gtk_widget_peek_pango_context (GtkWidget *widget)
*
* If you create and keep a #PangoLayout using this context, you must
* deal with changes to the context by calling pango_layout_context_changed()
* on the layout in response to the #GtkWidget::style-set and
* on the layout in response to the #GtkWidget::style-updated and
* #GtkWidget::direction-changed signals for the widget.
*
* Return value: (transfer none): the #PangoContext for the widget.
@ -8892,7 +8880,7 @@ gtk_widget_create_pango_context (GtkWidget *widget)
* If you keep a #PangoLayout created in this way around, in order to
* notify the layout of changes to the base direction or font of this
* widget, you must call pango_layout_context_changed() in response to
* the #GtkWidget::style-set and #GtkWidget::direction-changed signals
* the #GtkWidget::style-updated and #GtkWidget::direction-changed signals
* for the widget.
*
* Return value: (transfer full): the new #PangoLayout

View File

@ -415,6 +415,7 @@ struct _GtkWidgetClass
gint *natural_size);
void (* adjust_size_allocation) (GtkWidget *widget,
GtkOrientation orientation,
gint *minimum_size,
gint *natural_size,
gint *allocated_pos,
gint *allocated_size);

View File

@ -31,7 +31,9 @@ G_BEGIN_DECLS
typedef struct _GtkWidgetPath GtkWidgetPath;
#define GTK_TYPE_WIDGET_PATH (gtk_widget_path_get_type ())
GType gtk_widget_path_get_type (void) G_GNUC_CONST;
GtkWidgetPath * gtk_widget_path_new (void);
GtkWidgetPath * gtk_widget_path_copy (const GtkWidgetPath *path);

View File

@ -1,808 +0,0 @@
/* GTK - The GIMP Toolkit
* Copyright (C) 2001 Red Hat, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
/*
* Authors: Alexander Larsson <alexl@redhat.com>
*/
#include "config.h"
#include "gtkprivate.h"
#include "gtkwindow.h"
#include "gtkmain.h"
#include "gtkwindow-decorate.h"
#include "gtkintl.h"
#ifdef DECORATE_WINDOWS
typedef enum
{
GTK_WINDOW_REGION_TITLE,
GTK_WINDOW_REGION_MAXIMIZE,
GTK_WINDOW_REGION_CLOSE,
GTK_WINDOW_REGION_BR_RESIZE
} GtkWindowRegionType;
typedef struct _GtkWindowRegion GtkWindowRegion;
typedef struct _GtkWindowDecoration GtkWindowDecoration;
struct _GtkWindowRegion
{
GdkRectangle rect;
GtkWindowRegionType type;
};
typedef enum
{
RESIZE_TOP_LEFT,
RESIZE_TOP,
RESIZE_TOP_RIGHT,
RESIZE_RIGHT,
RESIZE_BOTTOM_RIGHT,
RESIZE_BOTTOM,
RESIZE_BOTTOM_LEFT,
RESIZE_LEFT,
RESIZE_NONE,
} GtkWindowResizeType;
struct _GtkWindowDecoration
{
gint n_regions;
GtkWindowRegion *regions;
gint last_x, last_y;
gint last_w, last_h;
PangoLayout *title_layout;
GtkWindowResizeType resize;
guint moving : 1;
guint closing : 1;
guint maximizing : 1;
guint maximized : 1;
guint maximizable : 1;
guint decorated : 1;
guint real_inner_move : 1;
guint focused : 1;
};
#define DECORATION_BORDER_TOP 15
#define DECORATION_BORDER_LEFT 3
#define DECORATION_BORDER_RIGHT 3
#define DECORATION_BORDER_BOTTOM 3
#define DECORATION_BORDER_TOT_X (DECORATION_BORDER_LEFT + DECORATION_BORDER_RIGHT)
#define DECORATION_BORDER_TOT_Y (DECORATION_BORDER_TOP + DECORATION_BORDER_BOTTOM)
#define DECORATION_BUTTON_SIZE 9
#define DECORATION_BUTTON_Y_OFFSET 2
#define DECORATION_TITLE_FONT "Sans 9"
static void gtk_decorated_window_recalculate_regions (GtkWindow *window);
static GtkWindowRegionType gtk_decorated_window_region_type (GtkWindow *window,
gint x,
gint y);
static gint gtk_decorated_window_frame_event (GtkWindow *window,
GdkEvent *event);
static gint gtk_decorated_window_button_press (GtkWidget *widget,
GdkEventButton *event);
static gint gtk_decorated_window_button_release (GtkWidget *widget,
GdkEventButton *event);
static gint gtk_decorated_window_motion_notify (GtkWidget *widget,
GdkEventMotion *event);
static gint gtk_decorated_window_window_state (GtkWidget *widget,
GdkEventWindowState *event);
static void gtk_decorated_window_paint (GtkWidget *widget,
GdkRectangle *area);
static gint gtk_decorated_window_focus_change (GtkWidget *widget,
GdkEventFocus *event);
static void gtk_decorated_window_realize (GtkWindow *window);
static void gtk_decorated_window_unrealize (GtkWindow *window);
static void
gtk_decoration_free (GtkWindowDecoration *deco)
{
g_free (deco->regions);
deco->regions = NULL;
deco->n_regions = 0;
g_free (deco);
}
void
gtk_decorated_window_init (GtkWindow *window)
{
GtkWindowDecoration *deco;
deco = g_new (GtkWindowDecoration, 1);
deco->n_regions = 0;
deco->regions = NULL;
deco->title_layout = NULL;
deco->resize = RESIZE_NONE;
deco->moving = FALSE;
deco->decorated = TRUE;
deco->closing = FALSE;
deco->maximizing = FALSE;
deco->maximized = FALSE;
deco->maximizable = FALSE;
deco->real_inner_move = FALSE;
g_object_set_data_full (G_OBJECT (window), I_("gtk-window-decoration"), deco,
(GDestroyNotify) gtk_decoration_free);
gtk_window_set_has_frame (window, TRUE);
g_signal_connect (window,
"frame-event",
G_CALLBACK (gtk_decorated_window_frame_event),
window);
g_signal_connect (window,
"focus-in-event",
G_CALLBACK (gtk_decorated_window_focus_change),
window);
g_signal_connect (window,
"focus-out-event",
G_CALLBACK (gtk_decorated_window_focus_change),
window);
g_signal_connect (window,
"realize",
G_CALLBACK (gtk_decorated_window_realize),
window);
g_signal_connect (window,
"unrealize",
G_CALLBACK (gtk_decorated_window_unrealize),
window);
}
static inline GtkWindowDecoration *
get_decoration (GtkWindow *window)
{
return (GtkWindowDecoration *)g_object_get_data (G_OBJECT (window), "gtk-window-decoration");
}
void
gtk_decorated_window_set_title (GtkWindow *window,
const gchar *title)
{
GtkWindowDecoration *deco = get_decoration (window);
if (deco->title_layout)
pango_layout_set_text (deco->title_layout, title, -1);
}
void
gtk_decorated_window_calculate_frame_size (GtkWindow *window)
{
GdkWMDecoration decorations;
GtkWindowDecoration *deco = get_decoration (window);
if (gdk_window_get_decorations (GTK_WIDGET (window)->window,
&decorations))
{
if ((decorations & GDK_DECOR_BORDER) &&
(decorations & GDK_DECOR_TITLE))
{
deco->decorated = TRUE;
if ((decorations & GDK_DECOR_MAXIMIZE) &&
(gtk_window_get_type_hint (window) == GDK_WINDOW_TYPE_HINT_NORMAL))
deco->maximizable = TRUE;
}
else
deco->decorated = FALSE;
}
else
{
deco->decorated = (window->type != GTK_WINDOW_POPUP);
deco->maximizable = (gtk_window_get_type_hint (window) == GDK_WINDOW_TYPE_HINT_NORMAL);
}
if (deco->decorated)
gtk_window_set_frame_dimensions (window,
DECORATION_BORDER_LEFT,
DECORATION_BORDER_TOP,
DECORATION_BORDER_RIGHT,
DECORATION_BORDER_BOTTOM);
else
gtk_window_set_frame_dimensions (window, 0, 0, 0, 0);
gtk_decorated_window_recalculate_regions (window);
}
static gboolean
gtk_decorated_window_inner_change (GdkWindow *win,
gint x, gint y,
gint width, gint height,
gpointer user_data)
{
GtkWindow *window = (GtkWindow *)user_data;
GtkWidget *widget = GTK_WIDGET (window);
GtkWindowDecoration *deco = get_decoration (window);
if (deco->real_inner_move)
{
deco->real_inner_move = FALSE;
return FALSE;
}
deco->real_inner_move = TRUE;
gdk_window_move_resize (widget->window,
window->frame_left, window->frame_top,
width, height);
gdk_window_move_resize (window->frame,
x - window->frame_left, y - window->frame_top,
width + window->frame_left + window->frame_right,
height + window->frame_top + window->frame_bottom);
return TRUE;
}
static void
gtk_decorated_window_inner_get_pos (GdkWindow *win,
gint *x, gint *y,
gpointer user_data)
{
GtkWindow *window = (GtkWindow *)user_data;
gdk_window_get_position (window->frame, x, y);
*x += window->frame_left;
*y += window->frame_top;
}
static void
gtk_decorated_window_realize (GtkWindow *window)
{
GtkWindowDecoration *deco = get_decoration (window);
GtkWidget *widget = GTK_WIDGET (window);
PangoFontDescription *font_desc;
deco->title_layout = gtk_widget_create_pango_layout (widget,
(window->title)?window->title:"");
font_desc = pango_font_description_from_string(DECORATION_TITLE_FONT);
pango_layout_set_font_description (deco->title_layout, font_desc);
pango_font_description_free (font_desc);
}
static void
gtk_decorated_window_unrealize (GtkWindow *window)
{
GtkWindowDecoration *deco = get_decoration (window);
if (deco->title_layout)
{
g_object_unref (deco->title_layout);
deco->title_layout = NULL;
}
}
static gint
gtk_decorated_window_frame_event (GtkWindow *window, GdkEvent *event)
{
GtkWindowDecoration *deco = get_decoration (window);
GtkWidget *widget = GTK_WIDGET (window);
GdkEventExpose *expose_event;
switch (event->type)
{
case GDK_EXPOSE:
expose_event = (GdkEventExpose *)event;
if (deco->decorated)
gtk_decorated_window_paint (widget, &expose_event->area);
return TRUE;
break;
case GDK_CONFIGURE:
gtk_decorated_window_recalculate_regions (window);
break;
case GDK_MOTION_NOTIFY:
return gtk_decorated_window_motion_notify (widget, (GdkEventMotion *)event);
break;
case GDK_BUTTON_PRESS:
return gtk_decorated_window_button_press (widget, (GdkEventButton *)event);
break;
case GDK_BUTTON_RELEASE:
return gtk_decorated_window_button_release (widget, (GdkEventButton *)event);
case GDK_WINDOW_STATE:
return gtk_decorated_window_window_state (widget, (GdkEventWindowState *)event);
default:
break;
}
return FALSE;
}
static gint
gtk_decorated_window_focus_change (GtkWidget *widget,
GdkEventFocus *event)
{
GtkWindow *window = GTK_WINDOW(widget);
GtkWindowDecoration *deco = get_decoration (window);
deco->focused = event->in;
gdk_window_invalidate_rect (window->frame, NULL, FALSE);
return FALSE;
}
static gint
gtk_decorated_window_motion_notify (GtkWidget *widget,
GdkEventMotion *event)
{
GtkWindow *window;
GtkWindowDecoration *deco;
GdkModifierType mask;
GdkWindow *win;
gint x, y;
gint win_x, win_y, win_w, win_h;
window = GTK_WINDOW (widget);
deco = get_decoration (window);
if (!deco->decorated)
return TRUE;
win = widget->window;
gdk_window_get_pointer (window->frame, &x, &y, &mask);
gdk_window_get_position (window->frame, &win_x, &win_y);
win_x += DECORATION_BORDER_LEFT;
win_y += DECORATION_BORDER_TOP;
gdk_window_get_geometry (win, NULL, NULL, &win_w, &win_h, NULL);
if (deco->moving)
{
int dx, dy;
dx = x - deco->last_x;
dy = y - deco->last_y;
gtk_window_move (window, win_x + dx, win_y + dy);
}
if (deco->resize != RESIZE_NONE)
{
int w, h;
w = win_w;
h = win_h;
switch(deco->resize) {
case RESIZE_BOTTOM_RIGHT:
w = x - DECORATION_BORDER_TOT_X;
h = y - DECORATION_BORDER_TOT_Y;
break;
case RESIZE_RIGHT:
w = x - DECORATION_BORDER_TOT_X;
break;
case RESIZE_BOTTOM:
h = y - DECORATION_BORDER_TOT_Y;
break;
case RESIZE_TOP_LEFT:
case RESIZE_TOP:
case RESIZE_TOP_RIGHT:
case RESIZE_BOTTOM_LEFT:
case RESIZE_LEFT:
default:
g_warning ("Resize mode %d not handled yet.\n", deco->resize);
break;
}
if ((w > 0) && (h > 0))
{
_gtk_window_constrain_size (window, w,h, &w, &h);
if ((w != win_w) || (h != win_h))
gdk_window_resize (widget->window, w, h);
}
}
return TRUE;
}
static GtkWindowRegionType
gtk_decorated_window_region_type (GtkWindow *window, gint x, gint y)
{
GtkWindowDecoration *deco = get_decoration (window);
int i;
for (i=0;i<deco->n_regions;i++)
{
if ((x > deco->regions[i].rect.x) &&
(x - deco->regions[i].rect.x < deco->regions[i].rect.width) &&
(y > deco->regions[i].rect.y) &&
(y - deco->regions[i].rect.y < deco->regions[i].rect.height))
return deco->regions[i].type;
}
return -1;
}
static gint
gtk_decorated_window_button_press (GtkWidget *widget,
GdkEventButton *event)
{
GtkWindow *window;
GtkWindowRegionType type;
GtkWindowDecoration *deco;
gint x, y;
window = GTK_WINDOW (widget);
deco = get_decoration (window);
if (!deco->decorated)
return TRUE;
x = event->x;
y = event->y;
type = gtk_decorated_window_region_type (window, x, y);
switch (type)
{
case GTK_WINDOW_REGION_TITLE:
if (!deco->maximized && event->state & GDK_BUTTON1_MASK)
{
deco->last_x = x;
deco->last_y = y;
deco->moving = TRUE;
}
break;
case GTK_WINDOW_REGION_MAXIMIZE:
if (event->state & GDK_BUTTON1_MASK)
deco->maximizing = TRUE;
break;
case GTK_WINDOW_REGION_CLOSE:
if (event->state & GDK_BUTTON1_MASK)
deco->closing = TRUE;
break;
case GTK_WINDOW_REGION_BR_RESIZE:
if (!deco->maximized)
{
if (event->state & GDK_BUTTON1_MASK)
deco->resize = RESIZE_BOTTOM_RIGHT;
deco->last_x = x;
deco->last_y = y;
}
break;
default:
break;
}
return TRUE;
}
static gint
gtk_decorated_window_button_release (GtkWidget *widget,
GdkEventButton *event)
{
GtkWindow *window;
GtkWindowRegionType type;
GtkWindowDecoration *deco;
window = GTK_WINDOW (widget);
deco = get_decoration (window);
if (deco->closing)
{
type = gtk_decorated_window_region_type (window, event->x, event->y);
if (type == GTK_WINDOW_REGION_CLOSE)
{
GdkEvent *event = gdk_event_new (GDK_DELETE);
event->any.type = GDK_DELETE;
event->any.window = g_object_ref (widget->window);
event->any.send_event = TRUE;
gtk_main_do_event (event);
gdk_event_free (event);
}
}
else if (deco->maximizing)
{
type = gtk_decorated_window_region_type (window, event->x, event->y);
if (type == GTK_WINDOW_REGION_MAXIMIZE)
{
if (deco->maximized)
gtk_window_unmaximize (window);
else
gtk_window_maximize (window);
}
}
deco->closing = FALSE;
deco->maximizing = FALSE;
deco->moving = FALSE;
deco->resize = RESIZE_NONE;
return TRUE;
}
static gint
gtk_decorated_window_window_state (GtkWidget *widget,
GdkEventWindowState *event)
{
GtkWindow *window;
GtkWindowDecoration *deco;
GdkWindowObject *priv;
window = GTK_WINDOW (widget);
deco = get_decoration (window);
priv = GDK_WINDOW_OBJECT (window->frame);
if (event->changed_mask & GDK_WINDOW_STATE_MAXIMIZED)
{
if (event->new_window_state & GDK_WINDOW_STATE_MAXIMIZED)
{
int w, h;
gdk_window_get_geometry (widget->window, NULL, NULL,
&deco->last_w, &deco->last_h, NULL);
gdk_window_get_origin (widget->window, &deco->last_x, &deco->last_y);
w = gdk_screen_get_width(gdk_screen_get_default()) - DECORATION_BORDER_TOT_X;
h = gdk_screen_get_height(gdk_screen_get_default()) - DECORATION_BORDER_TOT_Y;
_gtk_window_constrain_size (window, w, h, &w, &h);
if (w != deco->last_w || h != deco->last_h)
{
gtk_window_move (window, DECORATION_BORDER_LEFT, DECORATION_BORDER_TOP);
gdk_window_resize (widget->window, w, h);
deco->maximized = TRUE;
}
}
else
{
gtk_window_move (window, deco->last_x, deco->last_y);
_gtk_window_constrain_size (window, deco->last_w, deco->last_h,
&deco->last_w, &deco->last_h);
gdk_window_resize (widget->window, deco->last_w, deco->last_h);
deco->maximized = FALSE;
}
}
return TRUE;
}
static void
gtk_decorated_window_paint (GtkWidget *widget,
GdkRectangle *area)
{
GtkWindow *window = GTK_WINDOW (widget);
GtkWindowDecoration *deco = get_decoration (window);
gint x1, y1, x2, y2;
GtkStateType border_state;
cairo_t *cr;
if (deco->decorated)
{
GdkWindow *frame;
gint width, height;
frame = window->frame;
gdk_drawable_get_size (frame, &width, &height);
/* Top */
gtk_paint_flat_box (widget->style, frame, GTK_STATE_NORMAL,
GTK_SHADOW_NONE, area, widget, "base",
0, 0,
width, DECORATION_BORDER_TOP);
/* Bottom */
gtk_paint_flat_box (widget->style, frame, GTK_STATE_NORMAL,
GTK_SHADOW_NONE, area, widget, "base",
0, height - DECORATION_BORDER_BOTTOM,
width, DECORATION_BORDER_BOTTOM);
/* Left */
gtk_paint_flat_box (widget->style, frame, GTK_STATE_NORMAL,
GTK_SHADOW_NONE, area, widget, "base",
0, DECORATION_BORDER_TOP,
DECORATION_BORDER_LEFT, height - DECORATION_BORDER_TOT_Y);
/* Right */
gtk_paint_flat_box (widget->style, frame, GTK_STATE_NORMAL,
GTK_SHADOW_NONE, area, widget, "base",
width - DECORATION_BORDER_RIGHT, DECORATION_BORDER_TOP,
DECORATION_BORDER_RIGHT, height - DECORATION_BORDER_TOT_Y);
/* Border: */
if (deco->focused)
border_state = GTK_STATE_SELECTED;
else
border_state = GTK_STATE_PRELIGHT;
gtk_paint_box (widget->style, frame, border_state,
GTK_SHADOW_OUT, area, widget, "base",
0, 0, width, height);
gtk_paint_box (widget->style, frame, border_state,
GTK_SHADOW_IN, area, widget, "base",
DECORATION_BORDER_LEFT - 2, DECORATION_BORDER_TOP - 2,
width - (DECORATION_BORDER_LEFT + DECORATION_BORDER_RIGHT) + 3,
height - (DECORATION_BORDER_TOP + DECORATION_BORDER_BOTTOM) + 3);
cr = gdk_cairo_create (frame);
cairo_set_line_width (cr, 1.0);
cairo_set_line_cap (cr, CAIRO_LINE_CAP_SQUARE);
if (area)
{
gdk_cairo_rectangle (cr, &area);
cairo_clip (cr);
}
if (deco->maximizable)
{
/* Maximize button: */
x1 = width - (DECORATION_BORDER_LEFT * 2) - (DECORATION_BUTTON_SIZE * 2);
y1 = DECORATION_BUTTON_Y_OFFSET;
x2 = x1 + DECORATION_BUTTON_SIZE;
y2 = y1 + DECORATION_BUTTON_SIZE;
gdk_cairo_set_source_color (cr, &widget->style->bg[widget->state]);
cairo_rectangle (cr, x1, y1, x2 - x1, y2 - y1);
cairo_fill (cr);
gdk_cairo_set_source_rgb (cr, 0, 0, 0);
cairo_rectangle (cr, x1 + 1, y1 + 1, x2 - x1 - 3, 1);
cairo_move_to (cr, x1 + 1.5, y1 + 1.5);
cairo_line_to (cr, x2 - 1.5, y1 + 1.5);
cairo_rectangle (cr, x1 + 1.5, y1 + 2.5, DECORATION_BUTTON_SIZE - 3, DECORATION_BUTTON_SIZE - 4);
cairo_stroke (cr);
}
/* Close button: */
x1 = width - DECORATION_BORDER_LEFT - DECORATION_BUTTON_SIZE;
y1 = DECORATION_BUTTON_Y_OFFSET;
x2 = width - DECORATION_BORDER_LEFT;
y2 = DECORATION_BUTTON_Y_OFFSET + DECORATION_BUTTON_SIZE;
gdk_cairo_set_source_color (cr, &widget->style->bg[widget->state]);
cairo_rectangle (cr, x1, y1, x2 - x1, y2 - y1);
cairo_fill (cr);
/* draw an X */
cairo_move_to (cr, x1 + 0.5, y1 + 0.5);
cairo_line_to (cr, x2 - 0.5, y2 - 0.5);
cairo_move_to (cr, x1 + 0.5, y2 - 0.5);
cairo_line_to (cr, x2 - 0.5, y1 + 0.5);
cairo_stroke (cr);
/* Title */
if (deco->title_layout)
{
gdk_cairo_set_source_color (cr, widget->style->fg [border_state]);
pango_cairo_show_layout (cr, deco->title_layout);
}
cairo_destroy (cr);
}
}
static void
gtk_decorated_window_recalculate_regions (GtkWindow *window)
{
gint n_regions;
gint width, height;
GtkWindowRegion *region;
GtkWindowDecoration *deco = get_decoration (window);
n_regions = 0;
if (!deco->decorated)
return;
n_regions += 2; /* close, Title */
if (deco->maximizable)
n_regions += 1;
if (gtk_window_get_resizable (window))
n_regions += 2;
if (deco->n_regions != n_regions)
{
g_free (deco->regions);
deco->regions = g_new (GtkWindowRegion, n_regions);
deco->n_regions = n_regions;
}
width = GTK_WIDGET (window)->allocation.width + DECORATION_BORDER_TOT_X;
height = GTK_WIDGET (window)->allocation.height + DECORATION_BORDER_TOT_Y;
region = deco->regions;
/* Maximize button */
if (deco->maximizable)
{
region->rect.x = width - (DECORATION_BORDER_LEFT * 2) - (DECORATION_BUTTON_SIZE * 2);
region->rect.y = DECORATION_BUTTON_Y_OFFSET;
region->rect.width = DECORATION_BUTTON_SIZE;
region->rect.height = DECORATION_BUTTON_SIZE;
region->type = GTK_WINDOW_REGION_MAXIMIZE;
region++;
}
/* Close button */
region->rect.x = width - DECORATION_BORDER_LEFT - DECORATION_BUTTON_SIZE;
region->rect.y = DECORATION_BUTTON_Y_OFFSET;
region->rect.width = DECORATION_BUTTON_SIZE;
region->rect.height = DECORATION_BUTTON_SIZE;
region->type = GTK_WINDOW_REGION_CLOSE;
region++;
/* title bar */
region->rect.x = 0;
region->rect.y = 0;
region->rect.width = width;
region->rect.height = DECORATION_BORDER_TOP;
region->type = GTK_WINDOW_REGION_TITLE;
region++;
if (gtk_window_get_resizable (window))
{
region->rect.x = width - (DECORATION_BORDER_RIGHT + 10);
region->rect.y = height - DECORATION_BORDER_BOTTOM;
region->rect.width = DECORATION_BORDER_RIGHT + 10;
region->rect.height = DECORATION_BORDER_BOTTOM;
region->type = GTK_WINDOW_REGION_BR_RESIZE;
region++;
region->rect.x = width - DECORATION_BORDER_RIGHT;
region->rect.y = height - (DECORATION_BORDER_BOTTOM + 10);
region->rect.width = DECORATION_BORDER_RIGHT;
region->rect.height = DECORATION_BORDER_BOTTOM + 10;
region->type = GTK_WINDOW_REGION_BR_RESIZE;
region++;
}
}
void
gtk_decorated_window_move_resize_window (GtkWindow *window,
gint x,
gint y,
gint width,
gint height)
{
GtkWidget *widget = GTK_WIDGET (window);
GtkWindowDecoration *deco = get_decoration (window);
deco->real_inner_move = TRUE;
gdk_window_move_resize (widget->window,
x, y, width, height);
}
#else
void
gtk_decorated_window_init (GtkWindow *window)
{
}
void
gtk_decorated_window_calculate_frame_size (GtkWindow *window)
{
}
void
gtk_decorated_window_set_title (GtkWindow *window,
const gchar *title)
{
}
void
gtk_decorated_window_move_resize_window (GtkWindow *window,
gint x,
gint y,
gint width,
gint height)
{
gdk_window_move_resize (gtk_widget_get_window (GTK_WIDGET (window)),
x, y, width, height);
}
#endif

View File

@ -1,41 +0,0 @@
/* GTK - The GIMP Toolkit
* Copyright (C) 2001 Red Hat, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
/*
* Authors: Alexander Larsson <alexl@redhat.com>
*/
#ifndef __GTK_WINDOW_DECORATE_H__
#define __GTK_WINDOW_DECORATE_H__
G_BEGIN_DECLS
void gtk_decorated_window_init (GtkWindow *window);
void gtk_decorated_window_calculate_frame_size (GtkWindow *window);
void gtk_decorated_window_set_title (GtkWindow *window,
const gchar *title);
void gtk_decorated_window_move_resize_window (GtkWindow *window,
gint x,
gint y,
gint width,
gint height);
G_END_DECLS
#endif /* __GTK_WINDOW_DECORATE_H__ */

View File

@ -37,7 +37,6 @@
#include "gtkprivate.h"
#include "gtkrc.h"
#include "gtkwindow.h"
#include "gtkwindow-decorate.h"
#include "gtkbindings.h"
#include "gtkkeyhash.h"
#include "gtkmain.h"
@ -1135,8 +1134,6 @@ gtk_window_init (GtkWindow *window)
priv->has_user_ref_count = TRUE;
toplevel_list = g_slist_prepend (toplevel_list, window);
gtk_decorated_window_init (window);
g_signal_connect (priv->screen, "composited-changed",
G_CALLBACK (gtk_window_on_composited_changed), window);
}
@ -1584,8 +1581,6 @@ gtk_window_set_title (GtkWindow *window,
{
gdk_window_set_title (gtk_widget_get_window (widget),
priv->title);
gtk_decorated_window_set_title (window, title);
}
g_object_notify (G_OBJECT (window), "title");
@ -4671,11 +4666,6 @@ gtk_window_show (GtkWidget *widget)
was_realized = TRUE;
}
/* Must be done after the windows are realized,
* so that the decorations can be read
*/
gtk_decorated_window_calculate_frame_size (window);
/* We only send configure request if we didn't just finish
* creating the window; if we just created the window
* then we created it with widget->allocation anyhow.
@ -7583,7 +7573,7 @@ gtk_window_set_frame_dimensions (GtkWindow *window,
width = allocation.width + left + right;
height = allocation.height + top + bottom;
gdk_window_resize (priv->frame, width, height);
gtk_decorated_window_move_resize_window (window,
gdk_window_move_resize (gtk_widget_get_window (GTK_WIDGET (window)),
left, top,
allocation.width,
allocation.height);

View File

@ -6,6 +6,7 @@ INCLUDES = \
-I$(top_srcdir)/gdk \
-DGDK_DISABLE_DEPRECATED \
-DGTK_DISABLE_DEPRECATED \
-DSRCDIR=\""$(abs_srcdir)"\" \
$(GTK_DEBUG_FLAGS) \
$(GTK_DEP_CFLAGS)

View File

@ -26,11 +26,11 @@ test_parse_at (void)
gboolean res;
gint i;
const gchar *valid[] = {
"@import \"test.css\";",
"@import 'test.css';",
"@import url(\"test.css\");",
"@import url('test.css');",
"@import\nurl (\t\"test.css\" ) ;",
"@import \"" SRCDIR "/test.css\";",
"@import '" SRCDIR "/test.css';",
"@import url(\"" SRCDIR "/test.css\");",
"@import url('" SRCDIR "/test.css');",
"@import\nurl (\t\"" SRCDIR "/test.css\" ) ;",
"@define-color bg_color #f9a039;",
"@define-color color @bg_color;",
"@define-color color rgb(100, 99, 88);",
@ -48,8 +48,8 @@ test_parse_at (void)
};
const gchar *invalid[] = {
"@import test.css ;",
"@import url ( \"test.css\" xyz );",
"@import " SRCDIR "/test.css ;",
"@import url ( \"" SRCDIR "/test.css\" xyz );",
"@import url(\");",
"@import url(');",
"@import url(\"abc');",
@ -77,6 +77,8 @@ test_parse_at (void)
{
provider = gtk_css_provider_new ();
res = gtk_css_provider_load_from_data (provider, valid[i], -1, &error);
if (error)
g_print ("parsing '%s': got unexpected error: %s\n", valid[i], error->message);
g_assert_no_error (error);
g_assert (res);
@ -217,8 +219,8 @@ test_parse_declarations (void)
" center center, 0.8, \n"
" color-stop (0.0,#fff),\n"
" color-stop (1.0,#000))}\n",
"* { border-image: url (\"test.png\") 3 4 3 4 stretch }",
"* { border-image: url (\"test.png\") 3 4 3 4 repeat stretch}",
"* { border-image: url (\"" SRCDIR "/test.png\") 3 4 3 4 stretch }",
"* { border-image: url (\"" SRCDIR "/test.png\") 3 4 3 4 repeat stretch}",
"* { transition: 150ms ease-in-out }",
"* { transition: 1s linear loop }",
NULL

View File

@ -4,6 +4,10 @@ if USE_WIN32
wimp = ms-windows
endif
SUBDIRS = $(wimp) pixbuf
# the theme engines need to be ported to GtkThemingEngine
# SUBDIRS = $(wimp) pixbuf
DIST_SUBDIRS = ms-windows pixbuf
-include $(top_srcdir)/git.mk

View File

@ -209,7 +209,6 @@ gtk/gtkvscrollbar.c
gtk/gtkvseparator.c
gtk/gtkwidget.c
gtk/gtkwindow.c
gtk/gtkwindow-decorate.c
gtk/paper_names.c
gtk/paper_names_offsets.c
gtk/updateiconcache.c

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -210,7 +210,6 @@ gtk/gtkvscrollbar.c
gtk/gtkvseparator.c
gtk/gtkwidget.c
gtk/gtkwindow.c
gtk/gtkwindow-decorate.c
gtk/paper_names_offsets.c
gtk/updateiconcache.c
modules/input/gtkimcontextxim.c

398
po/gl.po

File diff suppressed because it is too large Load Diff

169
po/nb.po
View File

@ -6,9 +6,9 @@
msgid ""
msgstr ""
"Project-Id-Version: gtk+ 2.92.x\n"
"Report-Msgid-Bugs-To:\n"
"POT-Creation-Date: 2010-11-20 11:47+0100\n"
"PO-Revision-Date: 2010-11-20 11:48+0100\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2010-12-06 18:12+0100\n"
"PO-Revision-Date: 2010-12-06 18:13+0100\n"
"Last-Translator: Torstein Adolf Winterseth <kvikende@fsfe.org>\n"
"Language-Team: Norwegian Nynorsk <i18n-nn@lister.ping.uio.no>\n"
"Language: nn\n"
@ -77,7 +77,7 @@ msgstr "Feilsøkingsflagg som skal settes for GDK"
#. Placeholder in --gdk-no-debug=FLAGS in --help output
#. Placeholder in --gtk-debug=FLAGS in --help output
#. Placeholder in --gtk-no-debug=FLAGS in --help output
#: ../gdk/gdk.c:177 ../gdk/gdk.c:180 ../gtk/gtkmain.c:525 ../gtk/gtkmain.c:528
#: ../gdk/gdk.c:177 ../gdk/gdk.c:180 ../gtk/gtkmain.c:523 ../gtk/gtkmain.c:526
msgid "FLAGS"
msgstr "FLAGG"
@ -301,17 +301,17 @@ msgstr "Størrelse på paletten i 8-bits modus"
msgid "COLORS"
msgstr "FARGER"
#: ../gdk/x11/gdkapplaunchcontext-x11.c:312
#: ../gdk/x11/gdkapplaunchcontext-x11.c:305
#, c-format
msgid "Starting %s"
msgstr "Starter %s"
#: ../gdk/x11/gdkapplaunchcontext-x11.c:316
#: ../gdk/x11/gdkapplaunchcontext-x11.c:318
#, c-format
msgid "Opening %s"
msgstr "Åpner %s"
#: ../gdk/x11/gdkapplaunchcontext-x11.c:321
#: ../gdk/x11/gdkapplaunchcontext-x11.c:323
#, c-format
msgid "Opening %d Item"
msgid_plural "Opening %d Items"
@ -788,23 +788,23 @@ msgstr "Høy_re:"
msgid "Paper Margins"
msgstr "Papirmarger"
#: ../gtk/gtkentry.c:8630 ../gtk/gtktextview.c:8229
#: ../gtk/gtkentry.c:8793 ../gtk/gtktextview.c:8229
msgid "Input _Methods"
msgstr "Inndata_metoder"
#: ../gtk/gtkentry.c:8644 ../gtk/gtktextview.c:8243
#: ../gtk/gtkentry.c:8807 ../gtk/gtktextview.c:8243
msgid "_Insert Unicode Control Character"
msgstr "Sett _inn Unicode kontrolltegn"
#: ../gtk/gtkentry.c:10044
#: ../gtk/gtkentry.c:10207
msgid "Caps Lock and Num Lock are on"
msgstr "Caps Lock og Num Lock er på"
#: ../gtk/gtkentry.c:10046
#: ../gtk/gtkentry.c:10209
msgid "Num Lock is on"
msgstr "Num Lock er på"
#: ../gtk/gtkentry.c:10048
#: ../gtk/gtkentry.c:10211
msgid "Caps Lock is on"
msgstr "Caps Lock er på"
@ -1205,7 +1205,7 @@ msgstr "Valg av skrift"
msgid "Error loading icon: %s"
msgstr "Feil under lasting av ikon: %s"
#: ../gtk/gtkicontheme.c:1355
#: ../gtk/gtkicontheme.c:1352
#, c-format
msgid ""
"Could not find the icon '%s'. The '%s' theme\n"
@ -1218,12 +1218,12 @@ msgstr ""
"Du kan finne en kopi av det på:\n"
"\t%s"
#: ../gtk/gtkicontheme.c:1536
#: ../gtk/gtkicontheme.c:1533
#, c-format
msgid "Icon '%s' not present in theme"
msgstr "Ikon «%s» er ikke tilstede i tema"
#: ../gtk/gtkicontheme.c:3057
#: ../gtk/gtkicontheme.c:3054
msgid "Failed to load icon"
msgstr "Feil under lasting av ikon"
@ -1248,12 +1248,12 @@ msgid "System (%s)"
msgstr "System (%s)"
#. Open Link
#: ../gtk/gtklabel.c:6214
#: ../gtk/gtklabel.c:6243
msgid "_Open Link"
msgstr "_Åpne lenke"
#. Copy Link Address
#: ../gtk/gtklabel.c:6226
#: ../gtk/gtklabel.c:6255
msgid "Copy _Link Address"
msgstr "Kopier _lenkas adresse"
@ -1266,27 +1266,27 @@ msgid "Invalid URI"
msgstr "Ugyldig URI"
#. Description of --gtk-module=MODULES in --help output
#: ../gtk/gtkmain.c:518
#: ../gtk/gtkmain.c:516
msgid "Load additional GTK+ modules"
msgstr "Last tilleggsmoduler for GTK+"
#. Placeholder in --gtk-module=MODULES in --help output
#: ../gtk/gtkmain.c:519
#: ../gtk/gtkmain.c:517
msgid "MODULES"
msgstr "MODULER"
#. Description of --g-fatal-warnings in --help output
#: ../gtk/gtkmain.c:521
#: ../gtk/gtkmain.c:519
msgid "Make all warnings fatal"
msgstr "La alle advarsler være fatale"
#. Description of --gtk-debug=FLAGS in --help output
#: ../gtk/gtkmain.c:524
#: ../gtk/gtkmain.c:522
msgid "GTK+ debugging flags to set"
msgstr "Feilsøkingsflagg som skal settes for GTK+"
#. Description of --gtk-no-debug=FLAGS in --help output
#: ../gtk/gtkmain.c:527
#: ../gtk/gtkmain.c:525
msgid "GTK+ debugging flags to unset"
msgstr "Feilsøkingsflagg som skal fjernes for GTK+"
@ -1295,20 +1295,20 @@ msgstr "Feilsøkingsflagg som skal fjernes for GTK+"
#. * Do *not* translate it to "predefinito:LTR", if it
#. * it isn't default:LTR or default:RTL it will not work
#.
#: ../gtk/gtkmain.c:790
#: ../gtk/gtkmain.c:788
msgid "default:LTR"
msgstr "default:LTR"
#: ../gtk/gtkmain.c:855
#: ../gtk/gtkmain.c:852
#, c-format
msgid "Cannot open display: %s"
msgstr "Kan ikke åpne skjerm: %s"
#: ../gtk/gtkmain.c:914
#: ../gtk/gtkmain.c:911
msgid "GTK+ Options"
msgstr "Alternativer for GTK+"
#: ../gtk/gtkmain.c:914
#: ../gtk/gtkmain.c:911
msgid "Show GTK+ Options"
msgstr "Vis alternativer for GTK+"
@ -1393,7 +1393,7 @@ msgstr "Z Shell"
msgid "Cannot end process with PID %d: %s"
msgstr "Kan ikke avslutte prosess med PID %d: %s"
#: ../gtk/gtknotebook.c:4756 ../gtk/gtknotebook.c:7319
#: ../gtk/gtknotebook.c:4758 ../gtk/gtknotebook.c:7353
#, c-format
msgid "Page %u"
msgstr "Side %u"
@ -1937,12 +1937,12 @@ msgstr "Noen innstillinger i dialogen er i konflikt"
msgid "Print"
msgstr "Skriv ut"
#: ../gtk/gtkrc.c:2834
#: ../gtk/gtkrc.c:2855
#, c-format
msgid "Unable to find include file: \"%s\""
msgstr "Kan ikke finne include-fil: «%s»"
#: ../gtk/gtkrc.c:3470 ../gtk/gtkrc.c:3473
#: ../gtk/gtkrc.c:3491 ../gtk/gtkrc.c:3494
#, c-format
msgid "Unable to locate image file in pixmap_path: \"%s\""
msgstr "Klarte ikke å finne bildefil i pixmap_path: «%s»"
@ -2049,14 +2049,15 @@ msgstr "Kan ikke finne en oppføring med URI «%s»"
#: ../gtk/gtkrecentmanager.c:2437
#, c-format
msgid "No registered application with name '%s' for item with URI '%s' found"
msgstr "Ingen registrerte programmer med navn «%s» funnet for oppføring med URI «%s»"
msgstr ""
"Ingen registrerte programmer med navn «%s» funnet for oppføring med URI «%s»"
#: ../gtk/gtkspinner.c:456
#: ../gtk/gtkspinner.c:326
msgctxt "throbbing progress animation widget"
msgid "Spinner"
msgstr "Spinner"
#: ../gtk/gtkspinner.c:457
#: ../gtk/gtkspinner.c:327
msgid "Provides visual indication of progress"
msgstr "Gir visuell indikasjon av framdrift"
@ -2564,6 +2565,32 @@ msgctxt "Stock label"
msgid "Zoom _Out"
msgstr "Zoom _ut"
#. Translators: if the "on" state label requires more than three
#. * glyphs then use MEDIUM VERTICAL BAR (U+2759) as the text for
#. * the state
#.
#: ../gtk/gtkswitch.c:296 ../gtk/gtkswitch.c:339 ../gtk/gtkswitch.c:531
msgctxt "switch"
msgid "ON"
msgstr "PÅ"
#. Translators: if the "off" state label requires more than three
#. * glyphs then use WHITE CIRCLE (U+25CB) as the text for the state
#.
#: ../gtk/gtkswitch.c:304 ../gtk/gtkswitch.c:340 ../gtk/gtkswitch.c:552
msgctxt "switch"
msgid "OFF"
msgstr "AV"
#: ../gtk/gtkswitch.c:943
msgctxt "light switch widget"
msgid "Switch"
msgstr "Bryter"
#: ../gtk/gtkswitch.c:944
msgid "Switches between on and off states"
msgstr "Bytter mellom av/på tilstand"
#: ../gtk/gtktextbufferrichtext.c:650
#, c-format
msgid "Unknown error when trying to deserialize %s"
@ -2574,107 +2601,107 @@ msgstr "Ukjent feil ved forsøk på å deserialisere %s"
msgid "No deserialize function found for format %s"
msgstr "Ingen de-serialiseringsfunksjon funnet for format %s"
#: ../gtk/gtktextbufferserialize.c:803 ../gtk/gtktextbufferserialize.c:829
#: ../gtk/gtktextbufferserialize.c:799 ../gtk/gtktextbufferserialize.c:825
#, c-format
msgid "Both \"id\" and \"name\" were found on the <%s> element"
msgstr "Både «id» og «name» ble finnet i element <%s>"
#: ../gtk/gtktextbufferserialize.c:813 ../gtk/gtktextbufferserialize.c:839
#: ../gtk/gtktextbufferserialize.c:809 ../gtk/gtktextbufferserialize.c:835
#, c-format
msgid "The attribute \"%s\" was found twice on the <%s> element"
msgstr "Attributten «%s» ble funnet to ganger på element <%s>"
#: ../gtk/gtktextbufferserialize.c:855
#: ../gtk/gtktextbufferserialize.c:851
#, c-format
msgid "<%s> element has invalid ID \"%s\""
msgstr "Element <%s> har ugyldig ID «%s»"
#: ../gtk/gtktextbufferserialize.c:865
#: ../gtk/gtktextbufferserialize.c:861
#, c-format
msgid "<%s> element has neither a \"name\" nor an \"id\" attribute"
msgstr "Element <%s> har ikke et «name»- eller «id»-element"
#: ../gtk/gtktextbufferserialize.c:952
#: ../gtk/gtktextbufferserialize.c:948
#, c-format
msgid "Attribute \"%s\" repeated twice on the same <%s> element"
msgstr "Attributt «%s» gjentatt to ganger på samme <%s>-element"
#: ../gtk/gtktextbufferserialize.c:970 ../gtk/gtktextbufferserialize.c:995
#: ../gtk/gtktextbufferserialize.c:966 ../gtk/gtktextbufferserialize.c:991
#, c-format
msgid "Attribute \"%s\" is invalid on <%s> element in this context"
msgstr "Attributt «%s» er ugyldig på <%s>-element i denne konteksten"
#: ../gtk/gtktextbufferserialize.c:1034
#: ../gtk/gtktextbufferserialize.c:1030
#, c-format
msgid "Tag \"%s\" has not been defined."
msgstr "Tagg «%s» er ikke definert."
#: ../gtk/gtktextbufferserialize.c:1046
#: ../gtk/gtktextbufferserialize.c:1042
msgid "Anonymous tag found and tags can not be created."
msgstr "Anonym tagg funnet og tagger kan ikke opprettes."
#: ../gtk/gtktextbufferserialize.c:1057
#: ../gtk/gtktextbufferserialize.c:1053
#, c-format
msgid "Tag \"%s\" does not exist in buffer and tags can not be created."
msgstr "Tagg «%s» eksisterer ikke i bufferen og tagger kan ikke opprettes."
#: ../gtk/gtktextbufferserialize.c:1156 ../gtk/gtktextbufferserialize.c:1231
#: ../gtk/gtktextbufferserialize.c:1336 ../gtk/gtktextbufferserialize.c:1410
#: ../gtk/gtktextbufferserialize.c:1152 ../gtk/gtktextbufferserialize.c:1227
#: ../gtk/gtktextbufferserialize.c:1332 ../gtk/gtktextbufferserialize.c:1406
#, c-format
msgid "Element <%s> is not allowed below <%s>"
msgstr "Element <%s> er ikke tillatt under <%s>"
#: ../gtk/gtktextbufferserialize.c:1187
#: ../gtk/gtktextbufferserialize.c:1183
#, c-format
msgid "\"%s\" is not a valid attribute type"
msgstr "«%s» er ikke en gyldig type attributt"
#: ../gtk/gtktextbufferserialize.c:1195
#: ../gtk/gtktextbufferserialize.c:1191
#, c-format
msgid "\"%s\" is not a valid attribute name"
msgstr "«%s» er ikke et gyldig attributtnavn"
#: ../gtk/gtktextbufferserialize.c:1205
#: ../gtk/gtktextbufferserialize.c:1201
#, c-format
msgid ""
"\"%s\" could not be converted to a value of type \"%s\" for attribute \"%s\""
msgstr ""
"«%s» kunne ikke konverteres til en verdi av type «%s» for attributt «%s»"
#: ../gtk/gtktextbufferserialize.c:1214
#: ../gtk/gtktextbufferserialize.c:1210
#, c-format
msgid "\"%s\" is not a valid value for attribute \"%s\""
msgstr "«%s» er ikke en gyldig verdi for attributt «%s»"
#: ../gtk/gtktextbufferserialize.c:1299
#: ../gtk/gtktextbufferserialize.c:1295
#, c-format
msgid "Tag \"%s\" already defined"
msgstr "Tagg «%s» er allerede definert"
#: ../gtk/gtktextbufferserialize.c:1312
#: ../gtk/gtktextbufferserialize.c:1308
#, c-format
msgid "Tag \"%s\" has invalid priority \"%s\""
msgstr "Tagg «%s» har ugyldig prioritet «%s»"
#: ../gtk/gtktextbufferserialize.c:1365
#: ../gtk/gtktextbufferserialize.c:1361
#, c-format
msgid "Outermost element in text must be <text_view_markup> not <%s>"
msgstr "Det ytterste elementet i en tekst må være <text_view_markup> ikke <%s>"
#: ../gtk/gtktextbufferserialize.c:1374 ../gtk/gtktextbufferserialize.c:1390
#: ../gtk/gtktextbufferserialize.c:1370 ../gtk/gtktextbufferserialize.c:1386
#, c-format
msgid "A <%s> element has already been specified"
msgstr "Et element <%s> er allerede spesifisert"
#: ../gtk/gtktextbufferserialize.c:1396
#: ../gtk/gtktextbufferserialize.c:1392
msgid "A <text> element can't occur before a <tags> element"
msgstr "Et <text>-element kan ikke brukes før et <tags>-element"
#: ../gtk/gtktextbufferserialize.c:1796
#: ../gtk/gtktextbufferserialize.c:1792
msgid "Serialized data is malformed"
msgstr "Serialiserte data har feil utforming"
#: ../gtk/gtktextbufferserialize.c:1874
#: ../gtk/gtktextbufferserialize.c:1870
msgid ""
"Serialized data is malformed. First section isn't GTKTEXTBUFFERCONTENTS-0001"
msgstr ""
@ -3632,81 +3659,81 @@ msgstr "Klarte ikke å skrive mappeindeks\n"
msgid "Failed to rewrite header\n"
msgstr "Klarte ikke skrive om hode\n"
#: ../gtk/updateiconcache.c:1463
#: ../gtk/updateiconcache.c:1488
#, c-format
msgid "Failed to open file %s : %s\n"
msgstr "Klarte ikke å åpne fil %s: %s\n"
#: ../gtk/updateiconcache.c:1471
#: ../gtk/updateiconcache.c:1496 ../gtk/updateiconcache.c:1526
#, c-format
msgid "Failed to write cache file: %s\n"
msgstr "Klarte ikke å skrive bufferfil: %s\n"
#: ../gtk/updateiconcache.c:1507
#: ../gtk/updateiconcache.c:1537
#, c-format
msgid "The generated cache was invalid.\n"
msgstr "Generert buffer var ugyldig.\n"
#: ../gtk/updateiconcache.c:1521
#: ../gtk/updateiconcache.c:1551
#, c-format
msgid "Could not rename %s to %s: %s, removing %s then.\n"
msgstr "Klarte ikke å endre navn på %s til %s: %s, fjerner %s.\n"
#: ../gtk/updateiconcache.c:1535
#: ../gtk/updateiconcache.c:1565
#, c-format
msgid "Could not rename %s to %s: %s\n"
msgstr "Klarte ikke å endre navn på %s til %s: %s\n"
#: ../gtk/updateiconcache.c:1545
#: ../gtk/updateiconcache.c:1575
#, c-format
msgid "Could not rename %s back to %s: %s.\n"
msgstr "Klarte ikke å endre navn på %s tilbake til %s: %s\n"
#: ../gtk/updateiconcache.c:1572
#: ../gtk/updateiconcache.c:1602
#, c-format
msgid "Cache file created successfully.\n"
msgstr "Oppretting av bufferfil fullført.\n"
#: ../gtk/updateiconcache.c:1611
#: ../gtk/updateiconcache.c:1641
msgid "Overwrite an existing cache, even if up to date"
msgstr "Overskriv en eksisterende buffer, selv om den er oppdatert"
#: ../gtk/updateiconcache.c:1612
#: ../gtk/updateiconcache.c:1642
msgid "Don't check for the existence of index.theme"
msgstr "Ikke sjekk om index.theme eksisterer"
#: ../gtk/updateiconcache.c:1613
#: ../gtk/updateiconcache.c:1643
msgid "Don't include image data in the cache"
msgstr "Ikke ta med bildedata i bufferen"
#: ../gtk/updateiconcache.c:1614
#: ../gtk/updateiconcache.c:1644
msgid "Output a C header file"
msgstr "Skriv ut en C-headerfil"
#: ../gtk/updateiconcache.c:1615
#: ../gtk/updateiconcache.c:1645
msgid "Turn off verbose output"
msgstr "Slå av ekstra utdata"
#: ../gtk/updateiconcache.c:1616
#: ../gtk/updateiconcache.c:1646
msgid "Validate existing icon cache"
msgstr "Valider eksisterende ikonbuffer"
#: ../gtk/updateiconcache.c:1683
#: ../gtk/updateiconcache.c:1713
#, c-format
msgid "File not found: %s\n"
msgstr "Fil ikke funnet %s\n"
#: ../gtk/updateiconcache.c:1689
#: ../gtk/updateiconcache.c:1719
#, c-format
msgid "Not a valid icon cache: %s\n"
msgstr "Ikke en gyldig ikonbuffer: %s\n"
#: ../gtk/updateiconcache.c:1702
#: ../gtk/updateiconcache.c:1732
#, c-format
msgid "No theme index file.\n"
msgstr "Ingen indeksfil for tema.\n"
#: ../gtk/updateiconcache.c:1706
#: ../gtk/updateiconcache.c:1736
#, c-format
msgid ""
"No theme index file in '%s'.\n"