Compare commits

..

18 Commits

Author SHA1 Message Date
Benjamin Otte 1af58dc4ee entry: Use cssnodeutils for the widget node 2015-03-22 02:44:41 +01:00
Benjamin Otte cb1cf06744 cssnodeutils: Implement margins 2015-03-20 18:55:27 +01:00
Benjamin Otte c5d00ae119 css: Add min-width/height CSS properties
Use them for the minimum size during size requests.
2015-03-20 14:59:36 +01:00
Benjamin Otte 15582ef9c1 entry: Make progressbar a CssNode 2015-03-20 14:59:28 +01:00
Benjamin Otte 0e57785af7 entry: Set insensitive state on icon css node
... instead of doing it on-demand.
2015-03-20 14:59:28 +01:00
Benjamin Otte 52f58f1637 entry: Use the :active state for pressed icons 2015-03-20 14:59:28 +01:00
Benjamin Otte cd87252130 entry: Set the prelight flag on the CSS node 2015-03-20 14:59:28 +01:00
Benjamin Otte 85d86d61de cssnode: Add gtk_css_node_add/remove_state() API
This mirrors gtk_css_node_add/remove_class() APIs and allows you to
specify a (set of) state(s) to set or unset.

These functions are purely convenience.
2015-03-20 14:59:28 +01:00
Benjamin Otte 0d01ceb415 entry: Prelight icons when pressed
There's no reason to not keep them in the prelight state, theme authors
can override a prelight effect in :active if they want.
2015-03-20 14:59:28 +01:00
Benjamin Otte aa005486de entry: Ignore the "icon-prelight" style property
Always prelight icons. CSS is powerful enough to let people keep the
appearance the same upon prelight.
2015-03-20 14:59:27 +01:00
Benjamin Otte cdd26d0d01 entry: Set style classes on entry icons upon state change 2015-03-20 14:59:27 +01:00
Benjamin Otte f408c59869 entry: Add a cssnode for icons 2015-03-20 14:59:27 +01:00
Benjamin Otte 4326e38b90 cssnode: Make classes APIs string-based
Using quarks is a bad idea now that we are calling the CssNode API
directly.
2015-03-20 14:59:27 +01:00
Benjamin Otte 0f488064a2 box: Port to cssnodeutils 2015-03-20 14:59:27 +01:00
Benjamin Otte e6c7e038c8 switch: Port to cssnodeutils 2015-03-20 14:59:27 +01:00
Benjamin Otte 18bd973014 cssnodeutils: Add a bunch of utility functions for using nodes
The idea is to wrap size request, size allocation and drawing each into
a function that takes care of the CSS box and then calls a callback to
request/allocate/draw the contents.

The idea is that complex widgets then nest these calls for all the css
nodes they need to handle.
2015-03-20 14:59:27 +01:00
Benjamin Otte dae2d9ec27 switch: Port to GtkCssNode
This is a simple port, no code modifications so far other than replacing
gtk_style_context_save() with gtk_style_context_save_to_node().
2015-03-20 14:59:27 +01:00
Benjamin Otte c0c79eee03 stylecontext: Add gtk_style_context_save_to_node()
To be used instead of gtk_style_context_save() with persistent nodes.
2015-03-20 14:59:27 +01:00
92 changed files with 30307 additions and 31318 deletions
+2 -2
View File
@@ -9,8 +9,8 @@
# set GTK_BINARY_AGE and GTK_INTERFACE_AGE to 0.
m4_define([gtk_major_version], [3])
m4_define([gtk_minor_version], [17])
m4_define([gtk_micro_version], [0])
m4_define([gtk_minor_version], [15])
m4_define([gtk_micro_version], [12])
m4_define([gtk_interface_age], [0])
m4_define([gtk_binary_age],
[m4_eval(100 * gtk_minor_version + gtk_micro_version)])
+9 -12
View File
@@ -33,7 +33,8 @@ static GtkWidget *
create_menu (gint depth)
{
GtkWidget *menu;
GtkRadioMenuItem *last_item;
GtkWidget *menuitem;
GSList *group;
char buf[32];
int i, j;
@@ -41,24 +42,20 @@ create_menu (gint depth)
return NULL;
menu = gtk_menu_new ();
last_item = NULL;
group = NULL;
for (i = 0, j = 1; i < 5; i++, j++)
{
GtkWidget *menu_item;
sprintf (buf, "item %2d - %d", depth, j);
menuitem = gtk_radio_menu_item_new_with_label (group, buf);
group = gtk_radio_menu_item_get_group (GTK_RADIO_MENU_ITEM (menuitem));
menu_item = gtk_radio_menu_item_new_with_label_from_widget (NULL, buf);
gtk_radio_menu_item_join_group (GTK_RADIO_MENU_ITEM (menu_item), last_item);
last_item = GTK_RADIO_MENU_ITEM (menu_item);
gtk_menu_shell_append (GTK_MENU_SHELL (menu), menu_item);
gtk_widget_show (menu_item);
gtk_menu_shell_append (GTK_MENU_SHELL (menu), menuitem);
gtk_widget_show (menuitem);
if (i == 3)
gtk_widget_set_sensitive (menu_item, FALSE);
gtk_widget_set_sensitive (menuitem, FALSE);
gtk_menu_item_set_submenu (GTK_MENU_ITEM (menu_item), create_menu (depth - 1));
gtk_menu_item_set_submenu (GTK_MENU_ITEM (menuitem), create_menu (depth - 1));
}
return menu;
-4
View File
@@ -467,10 +467,6 @@
<title>Index of new symbols in 3.16</title>
<xi:include href="xml/api-index-3.16.xml"><xi:fallback /></xi:include>
</index>
<index id="api-index-3-18" role="3.18">
<title>Index of new symbols in 3.18</title>
<xi:include href="xml/api-index-3.18.xml"><xi:fallback /></xi:include>
</index>
<xi:include href="xml/annotation-glossary.xml"><xi:fallback /></xi:include>
-1
View File
@@ -2771,7 +2771,6 @@ gtk_radio_menu_item_new_with_label_from_widget
gtk_radio_menu_item_new_with_mnemonic_from_widget
gtk_radio_menu_item_set_group
gtk_radio_menu_item_get_group
gtk_radio_menu_item_join_group
<SUBSECTION Standard>
GTK_RADIO_MENU_ITEM
GTK_IS_RADIO_MENU_ITEM
+3 -4
View File
@@ -52,8 +52,7 @@ get_vertex_type_name (int type)
}
static guint
create_shader (int type,
const char *code)
create_shader (int type, const char const *code)
{
guint shader;
int status;
@@ -86,8 +85,8 @@ create_shader (int type,
static void
make_program (GdkGLContextProgram *program,
const char *vertex_shader_code,
const char *fragment_shader_code)
const char const *vertex_shader_code,
const char const *fragment_shader_code)
{
guint vertex_shader, fragment_shader;
int status;
-24
View File
@@ -142,16 +142,6 @@
*/
#define GDK_VERSION_3_16 (G_ENCODE_VERSION (3, 16))
/**
* GDK_VERSION_3_18:
*
* A macro that evaluates to the 3.18 version of GDK, in a format
* that can be used by the C pre-processor.
*
* Since: 3.18
*/
#define GDK_VERSION_3_18 (G_ENCODE_VERSION (3, 18))
/* evaluates to the current stable version; for development cycles,
* this means the next stable target
*/
@@ -350,19 +340,5 @@
# define GDK_AVAILABLE_IN_3_16 _GDK_EXTERN
#endif
#if GDK_VERSION_MIN_REQUIRED >= GDK_VERSION_3_18
# define GDK_DEPRECATED_IN_3_18 GDK_DEPRECATED
# define GDK_DEPRECATED_IN_3_18_FOR(f) GDK_DEPRECATED_FOR(f)
#else
# define GDK_DEPRECATED_IN_3_18 _GDK_EXTERN
# define GDK_DEPRECATED_IN_3_18_FOR(f) _GDK_EXTERN
#endif
#if GDK_VERSION_MAX_ALLOWED < GDK_VERSION_3_18
# define GDK_AVAILABLE_IN_3_18 GDK_UNAVAILABLE(3, 18)
#else
# define GDK_AVAILABLE_IN_3_18 _GDK_EXTERN
#endif
#endif /* __GDK_VERSION_MACROS_H__ */
+3 -3
View File
@@ -30,13 +30,13 @@
#define GDK_TYPE_MIR_WINDOW (gdk_mir_window_get_type ())
#define GDK_IS_MIR_WINDOW(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), GDK_TYPE_MIR_WINDOW))
GDK_AVAILABLE_IN_3_16
GDK_AVAILABLE_IN_3_10
GType gdk_mir_display_get_type (void);
GDK_AVAILABLE_IN_3_16
GDK_AVAILABLE_IN_3_10
MirConnection *gdk_mir_display_get_mir_connection (GdkDisplay *display);
GDK_AVAILABLE_IN_3_16
GDK_AVAILABLE_IN_3_10
GType gdk_mir_window_get_type (void);
GDK_AVAILABLE_IN_3_16
+2
View File
@@ -461,6 +461,7 @@ gdk_x11_gl_context_texture_from_surface (GdkGLContext *paint_context,
glGenTextures (1, &texture_id);
glBindTexture (target, texture_id);
glEnable (target);
glTexParameteri (target, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
glTexParameteri (target, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
@@ -525,6 +526,7 @@ gdk_x11_gl_context_texture_from_surface (GdkGLContext *paint_context,
glXReleaseTexImageEXT (glx_pixmap->display, glx_pixmap->drawable,
GLX_FRONT_LEFT_EXT);
glDisable (target);
glDeleteTextures (1, &texture_id);
glx_pixmap_destroy(glx_pixmap);
+2
View File
@@ -399,6 +399,7 @@ gtk_private_h_sources = \
gtkcssmatcherprivate.h \
gtkcssnodeprivate.h \
gtkcssnodedeclarationprivate.h \
gtkcssnodeutilsprivate.h \
gtkcssnumbervalueprivate.h \
gtkcssparserprivate.h \
gtkcsspathnodeprivate.h \
@@ -633,6 +634,7 @@ gtk_base_c_sources = \
gtkcssmatcher.c \
gtkcssnode.c \
gtkcssnodedeclaration.c \
gtkcssnodeutils.c \
gtkcssnumbervalue.c \
gtkcssparser.c \
gtkcsspathnode.c \
-8
View File
@@ -509,11 +509,6 @@ gtk_text_view_accessible_get_character_extents (AtkText *text,
GdkWindow *window;
gint x_widget, y_widget, x_window, y_window;
*x = 0;
*y = 0;
*width = 0;
*height = 0;
widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (text));
if (widget == NULL)
return;
@@ -524,9 +519,6 @@ gtk_text_view_accessible_get_character_extents (AtkText *text,
gtk_text_view_get_iter_location (view, &iter, &rectangle);
window = gtk_text_view_get_window (view, GTK_TEXT_WINDOW_WIDGET);
if (window == NULL)
return;
gdk_window_get_origin (window, &x_widget, &y_widget);
*height = rectangle.height;
+2 -2
View File
@@ -1111,7 +1111,7 @@ gtk_font_selection_size_activate (GtkWidget *w,
const gchar *text;
text = gtk_entry_get_text (GTK_ENTRY (priv->size_entry));
new_size = (int) MAX (0.1, atof (text) * PANGO_SCALE + 0.5);
new_size = MAX (0.1, atof (text) * PANGO_SCALE + 0.5);
if (priv->size != new_size)
gtk_font_selection_set_size (fontsel, new_size);
@@ -1130,7 +1130,7 @@ gtk_font_selection_size_focus_out (GtkWidget *w,
const gchar *text;
text = gtk_entry_get_text (GTK_ENTRY (priv->size_entry));
new_size = (int) MAX (0.1, atof (text) * PANGO_SCALE + 0.5);
new_size = MAX (0.1, atof (text) * PANGO_SCALE + 0.5);
gtk_font_selection_set_size (fontsel, new_size);
+2 -2
View File
@@ -77,7 +77,7 @@ struct _GtkHandleBoxPrivate
{
/* Properties */
GtkPositionType handle_position;
gint snap_edge;
GtkPositionType snap_edge;
GtkShadowType shadow_type;
gboolean child_detached;
/* Properties */
@@ -1051,7 +1051,7 @@ gtk_handle_box_get_snap_edge (GtkHandleBox *handle_box)
{
g_return_val_if_fail (GTK_IS_HANDLE_BOX (handle_box), (GtkPositionType)-1);
return (GtkPositionType)handle_box->priv->snap_edge;
return handle_box->priv->snap_edge;
}
/**
+3 -3
View File
@@ -2945,17 +2945,17 @@ gtk_icon_factory_buildable_custom_tag_end (GtkBuildable *buildable,
}
if (source_data->icon_name)
gtk_icon_source_set_icon_name (icon_source, source_data->icon_name);
if ((gint)source_data->size != -1)
if (source_data->size != -1)
{
gtk_icon_source_set_size (icon_source, source_data->size);
gtk_icon_source_set_size_wildcarded (icon_source, FALSE);
}
if ((gint)source_data->direction != -1)
if (source_data->direction != -1)
{
gtk_icon_source_set_direction (icon_source, source_data->direction);
gtk_icon_source_set_direction_wildcarded (icon_source, FALSE);
}
if ((gint)source_data->state != -1)
if (source_data->state != -1)
{
gtk_icon_source_set_state (icon_source, source_data->state);
gtk_icon_source_set_state_wildcarded (icon_source, FALSE);
+1 -1
View File
@@ -95,7 +95,7 @@ real_add (const GtkStockItem *items,
gpointer old_key, old_value;
const GtkStockItem *item = &items[i];
if (replace_primary && (guint)item->modifier == PRIMARY_MODIFIER)
if (replace_primary && item->modifier == PRIMARY_MODIFIER)
{
item = gtk_stock_item_copy (item);
((GtkStockItem *)item)->modifier = (NON_STATIC_MASK |
+113 -72
View File
@@ -78,6 +78,7 @@
#include "gtkbox.h"
#include "gtkboxprivate.h"
#include "gtkcssnodeprivate.h"
#include "gtkcssnodeutilsprivate.h"
#include "gtkintl.h"
#include "gtkorientable.h"
#include "gtkorientableprivate.h"
@@ -436,14 +437,12 @@ static gboolean
gtk_box_draw (GtkWidget *widget,
cairo_t *cr)
{
GtkStyleContext *context;
GtkAllocation alloc;
context = gtk_widget_get_style_context (widget);
gtk_widget_get_allocation (widget, &alloc);
gtk_render_background (context, cr, 0, 0, alloc.width, alloc.height);
gtk_render_frame (context, cr, 0, 0, alloc.width, alloc.height);
gtk_css_node_draw (gtk_widget_get_css_node (widget),
cr,
gtk_widget_get_allocated_width (widget),
gtk_widget_get_allocated_height (widget),
NULL,
widget);
return GTK_WIDGET_CLASS (gtk_box_parent_class)->draw (widget, cr);
}
@@ -473,9 +472,13 @@ count_expand_children (GtkBox *box,
}
static void
gtk_box_size_allocate_no_center (GtkWidget *widget,
GtkAllocation *allocation)
gtk_box_size_allocate_no_center (GtkCssNode *cssnode,
const GtkAllocation *allocation,
int baseline,
GtkAllocation *out_clip,
gpointer data)
{
GtkWidget *widget = GTK_WIDGET (data);
GtkBox *box = GTK_BOX (widget);
GtkBoxPrivate *private = box->priv;
GtkBoxChild *child;
@@ -485,12 +488,12 @@ gtk_box_size_allocate_no_center (GtkWidget *widget,
GtkTextDirection direction;
GtkAllocation child_allocation;
GtkAllocation child_clip;
GtkRequestedSize *sizes;
gint child_minimum_baseline, child_natural_baseline;
gint minimum_above, natural_above;
gint minimum_below, natural_below;
gboolean have_baseline;
gint baseline;
GtkPackType packing;
@@ -500,8 +503,7 @@ gtk_box_size_allocate_no_center (GtkWidget *widget,
gint x = 0, y = 0, i;
gint child_size;
gtk_widget_set_allocation (widget, allocation);
*out_clip = *allocation;
count_expand_children (box, &nvis_children, &nexpand_children);
@@ -680,7 +682,6 @@ gtk_box_size_allocate_no_center (GtkWidget *widget,
}
}
baseline = gtk_widget_get_allocated_baseline (widget);
if (baseline == -1 && have_baseline)
{
gint height = MAX (1, allocation->height);
@@ -799,18 +800,21 @@ gtk_box_size_allocate_no_center (GtkWidget *widget,
}
}
gtk_widget_size_allocate_with_baseline (child->widget, &child_allocation, baseline);
gtk_widget_get_clip (child->widget, &child_clip);
gdk_rectangle_union (out_clip, out_clip, &child_clip);
i++;
}
}
_gtk_widget_set_simple_clip (widget, NULL);
}
static void
gtk_box_size_allocate_with_center (GtkWidget *widget,
GtkAllocation *allocation)
gtk_box_size_allocate_with_center (GtkCssNode *cssnode,
const GtkAllocation *allocation,
int baseline,
GtkAllocation *out_clip,
gpointer data)
{
GtkWidget *widget = GTK_WIDGET (data);
GtkBox *box = GTK_BOX (widget);
GtkBoxPrivate *priv = box->priv;
GtkBoxChild *child;
@@ -818,14 +822,13 @@ gtk_box_size_allocate_with_center (GtkWidget *widget,
gint nvis[2];
gint nexp[2];
GtkTextDirection direction;
GtkAllocation child_allocation;
GtkAllocation child_allocation, child_clip;
GtkRequestedSize *sizes[2];
GtkRequestedSize center_req;
gint child_minimum_baseline, child_natural_baseline;
gint minimum_above, natural_above;
gint minimum_below, natural_below;
gboolean have_baseline;
gint baseline;
gint idx[2];
gint center_pos;
gint center_size;
@@ -839,8 +842,6 @@ gtk_box_size_allocate_with_center (GtkWidget *widget,
gint x = 0, y = 0, i;
gint child_size;
gtk_widget_set_allocation (widget, allocation);
nvis[0] = nvis[1] = 0;
nexp[0] = nexp[1] = 0;
for (children = priv->children; children; children = children->next)
@@ -872,6 +873,8 @@ gtk_box_size_allocate_with_center (GtkWidget *widget,
min_size[0] = nat_size[0] = nvis[0] * priv->spacing;
min_size[1] = nat_size[1] = nvis[1] * priv->spacing;
*out_clip = *allocation;
/* Retrieve desired size for visible children. */
idx[0] = idx[1] = 0;
for (children = priv->children; children; children = children->next)
@@ -1026,7 +1029,6 @@ gtk_box_size_allocate_with_center (GtkWidget *widget,
}
}
baseline = gtk_widget_get_allocated_baseline (widget);
if (baseline == -1 && have_baseline)
{
gint height = MAX (1, allocation->height);
@@ -1140,6 +1142,8 @@ gtk_box_size_allocate_with_center (GtkWidget *widget,
}
}
gtk_widget_size_allocate_with_baseline (child->widget, &child_allocation, baseline);
gtk_widget_get_clip (child->widget, &child_clip);
gdk_rectangle_union (out_clip, out_clip, &child_clip);
i++;
}
@@ -1171,9 +1175,10 @@ gtk_box_size_allocate_with_center (GtkWidget *widget,
child_allocation.y = center_pos;
child_allocation.height = center_size;
}
gtk_widget_size_allocate_with_baseline (priv->center->widget, &child_allocation, baseline);
_gtk_widget_set_simple_clip (widget, NULL);
gtk_widget_size_allocate_with_baseline (priv->center->widget, &child_allocation, baseline);
gtk_widget_get_clip (priv->center->widget, &child_clip);
gdk_rectangle_union (out_clip, out_clip, &child_clip);
}
static void
@@ -1181,12 +1186,20 @@ gtk_box_size_allocate (GtkWidget *widget,
GtkAllocation *allocation)
{
GtkBox *box = GTK_BOX (widget);
GtkAllocation clip;
if (box->priv->center &&
gtk_widget_get_visible (box->priv->center->widget))
gtk_box_size_allocate_with_center (widget, allocation);
else
gtk_box_size_allocate_no_center (widget, allocation);
gtk_widget_set_allocation (widget, allocation);
gtk_css_node_allocate (gtk_widget_get_css_node (widget),
allocation,
gtk_widget_get_allocated_baseline (widget),
&clip,
box->priv->center && gtk_widget_get_visible (box->priv->center->widget)
? gtk_box_size_allocate_with_center
: gtk_box_size_allocate_no_center,
box);
gtk_widget_set_clip (widget, &clip);
}
static GType
@@ -1666,22 +1679,6 @@ gtk_box_get_size (GtkWidget *widget,
*natural_baseline = nat_baseline;
}
static void
gtk_box_get_preferred_width (GtkWidget *widget,
gint *minimum_size,
gint *natural_size)
{
gtk_box_get_size (widget, GTK_ORIENTATION_HORIZONTAL, minimum_size, natural_size, NULL, NULL);
}
static void
gtk_box_get_preferred_height (GtkWidget *widget,
gint *minimum_size,
gint *natural_size)
{
gtk_box_get_size (widget, GTK_ORIENTATION_VERTICAL, minimum_size, natural_size, NULL, NULL);
}
static void
gtk_box_compute_size_for_opposing_orientation (GtkBox *box,
gint avail_size,
@@ -1965,19 +1962,74 @@ gtk_box_compute_size_for_orientation (GtkBox *box,
*natural_size = required_natural;
}
static void
gtk_box_get_preferred_size (GtkCssNode *cssnode,
GtkOrientation orientation,
gint for_size,
gint *minimum,
gint *natural,
gint *minimum_baseline,
gint *natural_baseline,
gpointer data)
{
GtkWidget *widget = data;
GtkBox *box = GTK_BOX (widget);
GtkBoxPrivate *priv = box->priv;
if (for_size < 0)
{
gtk_box_get_size (widget, orientation, minimum, natural, minimum_baseline, natural_baseline);
}
else
{
if (priv->orientation == orientation)
gtk_box_compute_size_for_orientation (box, for_size, minimum, natural);
else
gtk_box_compute_size_for_opposing_orientation (box, for_size, minimum, natural, minimum_baseline, natural_baseline);
}
}
static void
gtk_box_get_preferred_width (GtkWidget *widget,
gint *minimum_size,
gint *natural_size)
{
gtk_css_node_get_preferred_size (gtk_widget_get_css_node (widget),
GTK_ORIENTATION_HORIZONTAL,
-1,
minimum_size, natural_size,
NULL, NULL,
gtk_box_get_preferred_size,
widget);
}
static void
gtk_box_get_preferred_height (GtkWidget *widget,
gint *minimum_size,
gint *natural_size)
{
gtk_css_node_get_preferred_size (gtk_widget_get_css_node (widget),
GTK_ORIENTATION_VERTICAL,
-1,
minimum_size, natural_size,
NULL, NULL,
gtk_box_get_preferred_size,
widget);
}
static void
gtk_box_get_preferred_width_for_height (GtkWidget *widget,
gint height,
gint *minimum_width,
gint *natural_width)
{
GtkBox *box = GTK_BOX (widget);
GtkBoxPrivate *private = box->priv;
if (private->orientation == GTK_ORIENTATION_VERTICAL)
gtk_box_compute_size_for_opposing_orientation (box, height, minimum_width, natural_width, NULL, NULL);
else
gtk_box_compute_size_for_orientation (box, height, minimum_width, natural_width);
gtk_css_node_get_preferred_size (gtk_widget_get_css_node (widget),
GTK_ORIENTATION_HORIZONTAL,
height,
minimum_width, natural_width,
NULL, NULL,
gtk_box_get_preferred_size,
widget);
}
static void
@@ -1988,24 +2040,13 @@ gtk_box_get_preferred_height_and_baseline_for_width (GtkWidget *widget,
gint *minimum_baseline,
gint *natural_baseline)
{
GtkBox *box = GTK_BOX (widget);
GtkBoxPrivate *private = box->priv;
if (width < 0)
gtk_box_get_size (widget, GTK_ORIENTATION_VERTICAL, minimum_height, natural_height, minimum_baseline, natural_baseline);
else
{
if (private->orientation == GTK_ORIENTATION_HORIZONTAL)
gtk_box_compute_size_for_opposing_orientation (box, width, minimum_height, natural_height, minimum_baseline, natural_baseline);
else
{
if (minimum_baseline)
*minimum_baseline = -1;
if (natural_baseline)
*natural_baseline = -1;
gtk_box_compute_size_for_orientation (box, width, minimum_height, natural_height);
}
}
gtk_css_node_get_preferred_size (gtk_widget_get_css_node (widget),
GTK_ORIENTATION_VERTICAL,
width,
minimum_height, natural_height,
minimum_baseline, natural_baseline,
gtk_box_get_preferred_size,
widget);
}
static void
+43 -84
View File
@@ -25,32 +25,6 @@
#include <math.h>
#include <string.h>
/*
* Gets the size for a single box blur.
*
* Much of this, the 3 * sqrt(2 * pi) / 4, is the known value for
* approximating a Gaussian using box blurs. This yields quite a good
* approximation for a Gaussian. For more details, see:
* http://www.w3.org/TR/SVG11/filters.html#feGaussianBlurElement
* https://bugzilla.mozilla.org/show_bug.cgi?id=590039#c19
*/
#define GAUSSIAN_SCALE_FACTOR ((3.0 * sqrt(2 * G_PI) / 4))
#define get_box_filter_size(radius) ((int)(GAUSSIAN_SCALE_FACTOR * (radius)))
/* Sadly, clang is picky about get_box_filter_size(2) not being a
* constant expression, thus we have to use precomputed values.
*/
#define BOX_FILTER_SIZE_2 3
#define BOX_FILTER_SIZE_3 5
#define BOX_FILTER_SIZE_4 7
#define BOX_FILTER_SIZE_5 9
#define BOX_FILTER_SIZE_6 11
#define BOX_FILTER_SIZE_7 13
#define BOX_FILTER_SIZE_8 15
#define BOX_FILTER_SIZE_9 16
#define BOX_FILTER_SIZE_10 18
/* This applies a single box blur pass to a horizontal range of pixels;
* since the box blur has the same weight for all pixels, we can
* implement an efficient sliding window algorithm where we add
@@ -86,37 +60,18 @@ blur_xspan (guchar *row,
* only divide down after all three passes. (SSE parallel implementation
* of the divide step is possible.)
*/
#define BLUR_ROW_KERNEL(D) \
for (i = -(D) + offset; i < row_width + offset; i++) \
{ \
if (i >= 0 && i < row_width) \
sum += row[i]; \
\
if (i >= offset) \
{ \
if (i >= (D)) \
sum -= row[i - (D)]; \
\
tmp_buffer[i - offset] = (sum + (D) / 2) / (D); \
} \
} \
break;
/* We unroll the values for d for radius 2-10 to avoid a generic
* divide operation (not radius 1, because its a no-op) */
switch (d)
for (i = -d + offset; i < row_width + offset; i++)
{
case BOX_FILTER_SIZE_2: BLUR_ROW_KERNEL (BOX_FILTER_SIZE_2);
case BOX_FILTER_SIZE_3: BLUR_ROW_KERNEL (BOX_FILTER_SIZE_3);
case BOX_FILTER_SIZE_4: BLUR_ROW_KERNEL (BOX_FILTER_SIZE_4);
case BOX_FILTER_SIZE_5: BLUR_ROW_KERNEL (BOX_FILTER_SIZE_5);
case BOX_FILTER_SIZE_6: BLUR_ROW_KERNEL (BOX_FILTER_SIZE_6);
case BOX_FILTER_SIZE_7: BLUR_ROW_KERNEL (BOX_FILTER_SIZE_7);
case BOX_FILTER_SIZE_8: BLUR_ROW_KERNEL (BOX_FILTER_SIZE_8);
case BOX_FILTER_SIZE_9: BLUR_ROW_KERNEL (BOX_FILTER_SIZE_9);
case BOX_FILTER_SIZE_10: BLUR_ROW_KERNEL (BOX_FILTER_SIZE_10);
default: BLUR_ROW_KERNEL (d);
if (i >= 0 && i < row_width)
sum += row[i];
if (i >= offset)
{
if (i >= d)
sum -= row[i - d];
tmp_buffer[i - offset] = (sum + d / 2) / d;
}
}
memcpy (row, tmp_buffer, row_width);
@@ -185,35 +140,45 @@ flip_buffer (guchar *dst_buffer,
#undef BLOCK_SIZE
}
/*
* Gets the size for a single box blur.
*
* Much of this, the 3 * sqrt(2 * pi) / 4, is the known value for
* approximating a Gaussian using box blurs. This yields quite a good
* approximation for a Gaussian. For more details, see:
* http://www.w3.org/TR/SVG11/filters.html#feGaussianBlurElement
* https://bugzilla.mozilla.org/show_bug.cgi?id=590039#c19
*/
#define GAUSSIAN_SCALE_FACTOR ((3.0 * sqrt(2 * G_PI) / 4))
static int
get_box_filter_size (double radius)
{
return GAUSSIAN_SCALE_FACTOR * radius;
}
static void
_boxblur (guchar *buffer,
int width,
int height,
int radius,
GtkBlurFlags flags)
_boxblur (guchar *buffer,
int width,
int height,
int radius)
{
guchar *flipped_buffer;
int d = get_box_filter_size (radius);
flipped_buffer = g_malloc (width * height);
if (flags & GTK_BLUR_Y)
{
/* Step 1: swap rows and columns */
flip_buffer (flipped_buffer, buffer, width, height);
/* Step 1: swap rows and columns */
flip_buffer (flipped_buffer, buffer, width, height);
/* Step 2: blur rows (really columns) */
blur_rows (flipped_buffer, buffer, height, width, d);
/* Step 2: blur rows (really columns) */
blur_rows (flipped_buffer, buffer, height, width, d);
/* Step 3: swap rows and columns */
flip_buffer (buffer, flipped_buffer, height, width);
}
/* Step 3: swap rows and columns */
flip_buffer (buffer, flipped_buffer, height, width);
if (flags & GTK_BLUR_X)
{
/* Step 4: blur rows */
blur_rows (buffer, flipped_buffer, width, height, d);
}
/* Step 4: blur rows */
blur_rows (buffer, flipped_buffer, width, height, d);
g_free (flipped_buffer);
}
@@ -227,8 +192,7 @@ _boxblur (guchar *buffer,
*/
void
_gtk_cairo_blur_surface (cairo_surface_t* surface,
double radius_d,
GtkBlurFlags flags)
double radius_d)
{
int radius = radius_d;
@@ -236,12 +200,7 @@ _gtk_cairo_blur_surface (cairo_surface_t* surface,
g_return_if_fail (cairo_surface_get_type (surface) == CAIRO_SURFACE_TYPE_IMAGE);
g_return_if_fail (cairo_image_surface_get_format (surface) == CAIRO_FORMAT_A8);
/* The code doesn't actually do any blurring for radius 1, as it
* ends up with box filter size 1 */
if (radius <= 1)
return;
if ((flags & (GTK_BLUR_X|GTK_BLUR_Y)) == 0)
if (radius == 0)
return;
/* Before we mess with the surface, execute any pending drawing. */
@@ -250,7 +209,7 @@ _gtk_cairo_blur_surface (cairo_surface_t* surface,
_boxblur (cairo_image_surface_get_data (surface),
cairo_image_surface_get_stride (surface),
cairo_image_surface_get_height (surface),
radius, flags);
radius);
/* Inform cairo we altered the surface contents. */
cairo_surface_mark_dirty (surface);
+1 -9
View File
@@ -29,16 +29,8 @@
G_BEGIN_DECLS
typedef enum {
GTK_BLUR_NONE = 0,
GTK_BLUR_X = 1<<0,
GTK_BLUR_Y = 1<<1,
GTK_BLUR_REPEAT = 1<<2
} GtkBlurFlags;
void _gtk_cairo_blur_surface (cairo_surface_t *surface,
double radius,
GtkBlurFlags flags);;
double radius);
int _gtk_cairo_blur_compute_pixels (double radius);
G_END_DECLS
+41 -21
View File
@@ -1941,6 +1941,34 @@ gtk_container_queue_resize_handler (GtkContainer *container)
}
}
static void
_gtk_container_queue_resize_internal (GtkContainer *container,
gboolean invalidate_only)
{
GtkWidget *widget;
g_return_if_fail (GTK_IS_CONTAINER (container));
widget = GTK_WIDGET (container);
do
{
_gtk_widget_set_alloc_needed (widget, TRUE);
_gtk_size_request_cache_clear (_gtk_widget_peek_request_cache (widget));
G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
if (GTK_IS_RESIZE_CONTAINER (widget))
break;
G_GNUC_END_IGNORE_DEPRECATIONS;
widget = gtk_widget_get_parent (widget);
}
while (widget);
if (widget && !invalidate_only)
gtk_container_queue_resize_handler (GTK_CONTAINER (widget));
}
void
_gtk_container_queue_restyle (GtkContainer *container)
{
@@ -1971,28 +1999,20 @@ _gtk_container_queue_restyle (GtkContainer *container)
void
_gtk_container_queue_resize (GtkContainer *container)
{
GtkWidget *widget;
_gtk_container_queue_resize_internal (container, FALSE);
}
g_return_if_fail (GTK_IS_CONTAINER (container));
widget = GTK_WIDGET (container);
do
{
_gtk_widget_set_alloc_needed (widget, TRUE);
_gtk_size_request_cache_clear (_gtk_widget_peek_request_cache (widget));
G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
if (GTK_IS_RESIZE_CONTAINER (widget))
break;
G_GNUC_END_IGNORE_DEPRECATIONS;
widget = gtk_widget_get_parent (widget);
}
while (widget);
if (widget)
gtk_container_queue_resize_handler (GTK_CONTAINER (widget));
/**
* _gtk_container_resize_invalidate:
* @container: a #GtkContainer
*
* Invalidates cached sizes like _gtk_container_queue_resize() but doesn't
* actually queue the resize container for resize.
*/
void
_gtk_container_resize_invalidate (GtkContainer *container)
{
_gtk_container_queue_resize_internal (container, TRUE);
}
void
+1
View File
@@ -28,6 +28,7 @@ G_BEGIN_DECLS
GList * _gtk_container_get_all_children (GtkContainer *container);
void _gtk_container_queue_resize (GtkContainer *container);
void _gtk_container_queue_restyle (GtkContainer *container);
void _gtk_container_resize_invalidate (GtkContainer *container);
void _gtk_container_clear_resize_widgets (GtkContainer *container);
gchar* _gtk_container_child_composite_name (GtkContainer *container,
GtkWidget *child);
+1 -1
View File
@@ -333,7 +333,7 @@ static GtkCssValue font_variant_values[] = {
GtkCssValue *
_gtk_css_font_variant_value_new (PangoVariant font_variant)
{
g_return_val_if_fail ((gint)font_variant < G_N_ELEMENTS (font_variant_values), NULL);
g_return_val_if_fail (font_variant < G_N_ELEMENTS (font_variant_values), NULL);
return _gtk_css_value_ref (&font_variant_values[font_variant]);
}
+1 -1
View File
@@ -306,7 +306,7 @@ static gboolean
gtk_css_matcher_node_has_class (const GtkCssMatcher *matcher,
GQuark class_name)
{
return gtk_css_node_has_class (matcher->node.node, class_name);
return gtk_css_node_has_qclass (matcher->node.node, class_name);
}
static gboolean
+68 -8
View File
@@ -579,6 +579,12 @@ gtk_css_node_init (GtkCssNode *cssnode)
cssnode->visible = TRUE;
}
GtkCssNode *
gtk_css_node_new (void)
{
return g_object_new (GTK_TYPE_CSS_NODE, NULL);
}
static GdkFrameClock *
gtk_css_node_get_frame_clock_or_null (GtkCssNode *cssnode)
{
@@ -944,6 +950,22 @@ gtk_css_node_get_state (GtkCssNode *cssnode)
return gtk_css_node_declaration_get_state (cssnode->decl);
}
void
gtk_css_node_add_state (GtkCssNode *cssnode,
GtkStateFlags state_flags)
{
gtk_css_node_set_state (cssnode,
gtk_css_node_get_state (cssnode) | state_flags);
}
void
gtk_css_node_remove_state (GtkCssNode *cssnode,
GtkStateFlags state_flags)
{
gtk_css_node_set_state (cssnode,
gtk_css_node_get_state (cssnode) & ~state_flags);
}
void
gtk_css_node_set_junction_sides (GtkCssNode *cssnode,
GtkJunctionSides junction_sides)
@@ -966,7 +988,7 @@ gtk_css_node_clear_classes (GtkCssNode *cssnode)
for (l = list; l; l = l->next)
{
gtk_css_node_remove_class (cssnode, GPOINTER_TO_UINT (l->data));
gtk_css_node_remove_class (cssnode, l->data);
}
g_list_free (list);
@@ -986,7 +1008,7 @@ gtk_css_node_set_classes (GtkCssNode *cssnode,
{
for (i = 0; classes[i] != NULL; i++)
{
gtk_css_node_add_class (cssnode, g_quark_from_string (classes[i]));
gtk_css_node_add_class (cssnode, classes[i]);
}
}
@@ -1016,9 +1038,13 @@ gtk_css_node_get_classes (GtkCssNode *cssnode)
void
gtk_css_node_add_class (GtkCssNode *cssnode,
GQuark style_class)
const char *style_class)
{
if (gtk_css_node_declaration_add_class (&cssnode->decl, style_class))
GQuark class_quark;
class_quark = g_quark_from_string (style_class);
if (gtk_css_node_declaration_add_class (&cssnode->decl, class_quark))
{
gtk_css_node_invalidate (cssnode, GTK_CSS_CHANGE_CLASS);
g_object_notify_by_pspec (G_OBJECT (cssnode), cssnode_properties[PROP_CLASSES]);
@@ -1027,9 +1053,15 @@ gtk_css_node_add_class (GtkCssNode *cssnode,
void
gtk_css_node_remove_class (GtkCssNode *cssnode,
GQuark style_class)
const char *style_class)
{
if (gtk_css_node_declaration_remove_class (&cssnode->decl, style_class))
GQuark class_quark;
class_quark = g_quark_try_string (style_class);
if (class_quark == 0)
return;
if (gtk_css_node_declaration_remove_class (&cssnode->decl, class_quark))
{
gtk_css_node_invalidate (cssnode, GTK_CSS_CHANGE_CLASS);
g_object_notify_by_pspec (G_OBJECT (cssnode), cssnode_properties[PROP_CLASSES]);
@@ -1038,15 +1070,43 @@ gtk_css_node_remove_class (GtkCssNode *cssnode,
gboolean
gtk_css_node_has_class (GtkCssNode *cssnode,
GQuark style_class)
const char *style_class)
{
GQuark class_quark;
class_quark = g_quark_try_string (style_class);
if (class_quark == 0)
return FALSE;
return gtk_css_node_has_qclass (cssnode, class_quark);
}
gboolean
gtk_css_node_has_qclass (GtkCssNode *cssnode,
GQuark style_class)
{
return gtk_css_node_declaration_has_class (cssnode->decl, style_class);
}
static void
quarks_to_strings (GList *list)
{
GList *l;
for (l = list; l; l = l->next)
{
l->data = (char *) g_quark_to_string (GPOINTER_TO_UINT (l->data));
}
}
GList *
gtk_css_node_list_classes (GtkCssNode *cssnode)
{
return gtk_css_node_declaration_list_classes (cssnode->decl);
GList *list = gtk_css_node_declaration_list_classes (cssnode->decl);
quarks_to_strings (list);
return list;
}
void
+10 -2
View File
@@ -95,6 +95,8 @@ struct _GtkCssNodeClass
GType gtk_css_node_get_type (void) G_GNUC_CONST;
GtkCssNode * gtk_css_node_new (void);
void gtk_css_node_set_parent (GtkCssNode *cssnode,
GtkCssNode *parent);
void gtk_css_node_set_after (GtkCssNode *cssnode,
@@ -120,6 +122,10 @@ const char * gtk_css_node_get_id (GtkCssNode *
void gtk_css_node_set_state (GtkCssNode *cssnode,
GtkStateFlags state_flags);
GtkStateFlags gtk_css_node_get_state (GtkCssNode *cssnode);
void gtk_css_node_add_state (GtkCssNode *cssnode,
GtkStateFlags state_flags);
void gtk_css_node_remove_state (GtkCssNode *cssnode,
GtkStateFlags state_flags);
void gtk_css_node_set_junction_sides (GtkCssNode *cssnode,
GtkJunctionSides junction_sides);
GtkJunctionSides gtk_css_node_get_junction_sides (GtkCssNode *cssnode);
@@ -127,10 +133,12 @@ void gtk_css_node_set_classes (GtkCssNode *
const char **classes);
char ** gtk_css_node_get_classes (GtkCssNode *cssnode);
void gtk_css_node_add_class (GtkCssNode *cssnode,
GQuark style_class);
const char *style_class);
void gtk_css_node_remove_class (GtkCssNode *cssnode,
GQuark style_class);
const char *style_class);
gboolean gtk_css_node_has_class (GtkCssNode *cssnode,
const char *style_class);
gboolean gtk_css_node_has_qclass (GtkCssNode *cssnode,
GQuark style_class);
GList * gtk_css_node_list_classes (GtkCssNode *cssnode);
void gtk_css_node_add_region (GtkCssNode *cssnode,
+300
View File
@@ -0,0 +1,300 @@
/* GTK - The GIMP Toolkit
* Copyright (C) 2014 Benjamin Otte <otte@gnome.org>
*
* 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, see <http://www.gnu.org/licenses/>.
*/
#include "config.h"
#include "gtkcssnodeutilsprivate.h"
#include <math.h>
#include "gtkcssnumbervalueprivate.h"
#include "gtkcssshadowsvalueprivate.h"
#include "gtkcssstyleprivate.h"
#include "gtkcssstylepropertyprivate.h"
#include "gtkrenderbackgroundprivate.h"
#include "gtkrenderborderprivate.h"
void
gtk_css_node_style_changed_for_widget (GtkCssNode *node,
GtkCssStyle *old_style,
GtkCssStyle *new_style,
GtkWidget *widget)
{
static GtkBitmask *affects_size = NULL;
GtkBitmask *changes;
changes = gtk_css_style_get_difference (old_style, new_style);
if (G_UNLIKELY (affects_size == NULL))
affects_size = _gtk_css_style_property_get_mask_affecting (GTK_CSS_AFFECTS_SIZE | GTK_CSS_AFFECTS_CLIP);
if (_gtk_bitmask_intersects (changes, affects_size))
gtk_widget_queue_resize (widget);
else
gtk_widget_queue_draw (widget);
_gtk_bitmask_free (changes);
}
static gint
get_number (GtkCssStyle *style,
guint property)
{
double d = _gtk_css_number_value_get (gtk_css_style_get_value (style, property), 100);
if (d < 1)
return ceil (d);
else
return floor (d);
}
static void
get_box_margin (GtkCssStyle *style,
GtkBorder *margin)
{
margin->top = get_number (style, GTK_CSS_PROPERTY_MARGIN_TOP);
margin->left = get_number (style, GTK_CSS_PROPERTY_MARGIN_LEFT);
margin->bottom = get_number (style, GTK_CSS_PROPERTY_MARGIN_BOTTOM);
margin->right = get_number (style, GTK_CSS_PROPERTY_MARGIN_RIGHT);
}
static void
get_box_border (GtkCssStyle *style,
GtkBorder *border)
{
border->top = get_number (style, GTK_CSS_PROPERTY_BORDER_TOP_WIDTH);
border->left = get_number (style, GTK_CSS_PROPERTY_BORDER_LEFT_WIDTH);
border->bottom = get_number (style, GTK_CSS_PROPERTY_BORDER_BOTTOM_WIDTH);
border->right = get_number (style, GTK_CSS_PROPERTY_BORDER_RIGHT_WIDTH);
}
static void
get_box_padding (GtkCssStyle *style,
GtkBorder *border)
{
border->top = get_number (style, GTK_CSS_PROPERTY_PADDING_TOP);
border->left = get_number (style, GTK_CSS_PROPERTY_PADDING_LEFT);
border->bottom = get_number (style, GTK_CSS_PROPERTY_PADDING_BOTTOM);
border->right = get_number (style, GTK_CSS_PROPERTY_PADDING_RIGHT);
}
static void
get_content_size_func_default (GtkCssNode *cssnode,
GtkOrientation orientation,
gint for_size,
gint *minimum,
gint *natural,
gint *minimum_baseline,
gint *natural_baseline,
gpointer unused)
{
*minimum = 0;
*natural = 0;
if (minimum_baseline)
*minimum_baseline = 0;
if (natural_baseline)
*natural_baseline = 0;
}
void
gtk_css_node_get_preferred_size (GtkCssNode *cssnode,
GtkOrientation orientation,
gint for_size,
gint *minimum,
gint *natural,
gint *minimum_baseline,
gint *natural_baseline,
GtkCssNodeSizeFunc get_content_size_func,
gpointer get_content_size_data)
{
GtkCssStyle *style;
GtkBorder margin, border, padding;
int min_size, extra_size, extra_opposite, extra_baseline;
if (!get_content_size_func)
get_content_size_func = get_content_size_func_default;
style = gtk_css_node_get_style (cssnode);
get_box_margin (style, &margin);
get_box_border (style, &border);
get_box_padding (style, &padding);
if (orientation == GTK_ORIENTATION_HORIZONTAL)
{
extra_size = margin.left + margin.right + border.left + border.right + padding.left + padding.right;
extra_opposite = margin.top + margin.bottom + border.top + border.bottom + padding.top + padding.bottom;
extra_baseline = margin.left + border.left + padding.left;
min_size = get_number (style, GTK_CSS_PROPERTY_MIN_WIDTH);
}
else
{
extra_size = margin.top + margin.bottom + border.top + border.bottom + padding.top + padding.bottom;
extra_opposite = margin.left + margin.right + border.left + border.right + padding.left + padding.right;
extra_baseline = margin.top + border.top + padding.top;
min_size = get_number (style, GTK_CSS_PROPERTY_MIN_HEIGHT);
}
if (for_size > -1)
for_size -= extra_opposite;
if (minimum_baseline)
*minimum_baseline = -1;
if (natural_baseline)
*natural_baseline = -1;
get_content_size_func (cssnode,
orientation,
for_size,
minimum, natural,
minimum_baseline, natural_baseline,
get_content_size_data);
g_warn_if_fail (*minimum <= *natural);
*minimum = MAX (min_size, *minimum);
*natural = MAX (min_size, *natural);
*minimum += extra_size;
*natural += extra_size;
if (minimum_baseline && *minimum_baseline > -1)
*minimum_baseline += extra_baseline;
if (natural_baseline && *natural_baseline > -1)
*natural_baseline += extra_baseline;
}
static void
allocate_func_default (GtkCssNode *cssnode,
const GtkAllocation *allocation,
int baseline,
GtkAllocation *out_clip,
gpointer unused)
{
*out_clip = *allocation;
}
void
gtk_css_node_allocate (GtkCssNode *cssnode,
const GtkAllocation *allocation,
int baseline,
GtkAllocation *out_clip,
GtkCssNodeAllocateFunc allocate_func,
gpointer allocate_data)
{
GtkAllocation content_allocation, clip;
GtkBorder margin, border, padding, shadow, extents;
GtkCssStyle *style;
if (out_clip == NULL)
out_clip = &clip;
if (!allocate_func)
allocate_func = allocate_func_default;
style = gtk_css_node_get_style (cssnode);
get_box_margin (style, &margin);
get_box_border (style, &border);
get_box_padding (style, &padding);
extents.top = margin.top + border.top + padding.top;
extents.right = margin.right + border.right + padding.right;
extents.bottom = margin.bottom + border.bottom + padding.bottom;
extents.left = margin.left + border.left + padding.left;
content_allocation.x = allocation->x + extents.left;
content_allocation.y = allocation->y + extents.top;
content_allocation.width = allocation->width - extents.left - extents.right;
content_allocation.height = allocation->height - extents.top - extents.bottom;
if (baseline >= 0)
baseline += extents.top;
g_assert (content_allocation.width >= 0);
g_assert (content_allocation.height >= 0);
allocate_func (cssnode, &content_allocation, baseline, out_clip, allocate_data);
_gtk_css_shadows_value_get_extents (gtk_css_style_get_value (style, GTK_CSS_PROPERTY_BOX_SHADOW), &shadow);
out_clip->x -= extents.left + shadow.left - margin.left;
out_clip->y -= extents.top + shadow.top - margin.top;
out_clip->width += extents.left + extents.right + shadow.left + shadow.right - margin.left - margin.right;
out_clip->height += extents.top + extents.bottom + shadow.top + shadow.bottom - margin.top - margin.bottom;
}
static gboolean
draw_contents_func_default (GtkCssNode *cssnode,
cairo_t *cr,
int width,
int height,
gpointer unused)
{
return FALSE;
}
void
gtk_css_node_draw (GtkCssNode *cssnode,
cairo_t *cr,
int width,
int height,
GtkCssNodeDrawFunc draw_contents_func,
gpointer draw_contents_data)
{
GtkBorder margin, border, padding;
gboolean draw_focus;
GtkCssStyle *style;
int contents_width, contents_height;
if (draw_contents_func == NULL)
draw_contents_func = draw_contents_func_default;
style = gtk_css_node_get_style (cssnode);
get_box_margin (style, &margin);
get_box_border (style, &border);
get_box_padding (style, &padding);
gtk_css_style_render_background (style,
cr,
margin.left,
margin.top,
width - margin.left - margin.right,
height - margin.top - margin.bottom,
gtk_css_node_get_junction_sides (cssnode));
gtk_css_style_render_border (style,
cr,
margin.left,
margin.top,
width - margin.left - margin.right,
height - margin.top - margin.bottom,
0,
gtk_css_node_get_junction_sides (cssnode));
cairo_translate (cr,
margin.left + border.left + padding.left,
margin.top + border.top + padding.top);
contents_width = width - margin.left - margin.right - border.left - border.right - padding.left - padding.right;
contents_height = height - margin.top - margin.bottom - border.top - border.bottom - padding.top - padding.bottom;
draw_focus = draw_contents_func (cssnode, cr, contents_width, contents_height, draw_contents_data);
cairo_translate (cr,
- (margin.left + border.left + padding.left),
- (margin.top + border.top + padding.top));
if (draw_focus)
gtk_css_style_render_outline (style,
cr,
margin.left,
margin.top,
width - margin.left - margin.right,
height - margin.top - margin.bottom);
}
+75
View File
@@ -0,0 +1,75 @@
/* GTK - The GIMP Toolkit
* Copyright (C) 2014 Benjamin Otte <otte@gnome.org>
*
* 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, see <http://www.gnu.org/licenses/>.
*/
#ifndef __GTK_CSS_NODE_UTILS_PRIVATE_H__
#define __GTK_CSS_NODE_UTILS_PRIVATE_H__
#include <gtk/gtkwidget.h>
#include "gtk/gtkcssnodeprivate.h"
G_BEGIN_DECLS
void gtk_css_node_style_changed_for_widget (GtkCssNode *node,
GtkCssStyle *old_style,
GtkCssStyle *new_style,
GtkWidget *widget);
typedef void (* GtkCssNodeSizeFunc) (GtkCssNode *cssnode,
GtkOrientation orientation,
gint for_size,
gint *minimum,
gint *natural,
gint *minimum_baseline,
gint *natural_baseline,
gpointer get_content_size_data);
void gtk_css_node_get_preferred_size (GtkCssNode *cssnode,
GtkOrientation orientation,
gint for_size,
gint *minimum,
gint *natural,
gint *minimum_baseline,
gint *natural_baseline,
GtkCssNodeSizeFunc get_content_size_func,
gpointer get_content_size_data);
typedef void (* GtkCssNodeAllocateFunc) (GtkCssNode *cssnode,
const GtkAllocation *allocation,
int baseline,
GtkAllocation *out_clip,
gpointer allocate_data);
void gtk_css_node_allocate (GtkCssNode *cssnode,
const GtkAllocation *allocation,
int baseline,
GtkAllocation *out_clip,
GtkCssNodeAllocateFunc allocate_func,
gpointer allocate_data);
typedef gboolean (* GtkCssNodeDrawFunc) (GtkCssNode *cssnode,
cairo_t *cr,
int width,
int height,
gpointer data);
void gtk_css_node_draw (GtkCssNode *cssnode,
cairo_t *cr,
int width,
int height,
GtkCssNodeDrawFunc draw_contents_func,
gpointer draw_contents_data);
G_END_DECLS
#endif /* __GTK_CSS_NODE_UTILS_PRIVATE_H__ */
+20 -61
View File
@@ -297,10 +297,7 @@ static gboolean
needs_blur (const GtkCssValue *shadow)
{
double radius = _gtk_css_number_value_get (shadow->radius, 0);
/* The code doesn't actually do any blurring for radius 1, as it
* ends up with box filter size 1 */
if (radius <= 1.0)
if (radius == 0.0)
return FALSE;
return TRUE;
@@ -310,15 +307,12 @@ static const cairo_user_data_key_t original_cr_key;
static cairo_t *
gtk_css_shadow_value_start_drawing (const GtkCssValue *shadow,
cairo_t *cr,
GtkBlurFlags blur_flags)
cairo_t *cr)
{
cairo_rectangle_int_t clip_rect;
cairo_surface_t *surface;
cairo_t *blur_cr;
gdouble radius, clip_radius;
gboolean blur_x = (blur_flags & GTK_BLUR_X) != 0;
gboolean blur_y = (blur_flags & GTK_BLUR_Y) != 0;
if (!needs_blur (shadow))
return cr;
@@ -328,22 +322,12 @@ gtk_css_shadow_value_start_drawing (const GtkCssValue *shadow,
radius = _gtk_css_number_value_get (shadow->radius, 0);
clip_radius = _gtk_cairo_blur_compute_pixels (radius);
if (blur_flags & GTK_BLUR_REPEAT)
{
if (!blur_x)
clip_rect.width = 1;
if (!blur_y)
clip_rect.height = 1;
}
/* Create a larger surface to center the blur. */
surface = cairo_surface_create_similar_image (cairo_get_target (cr),
CAIRO_FORMAT_A8,
clip_rect.width + (blur_x ? 2 * clip_radius : 0),
clip_rect.height + (blur_y ? 2 * clip_radius : 0));
cairo_surface_set_device_offset (surface,
(blur_x ? clip_radius : 0) - clip_rect.x,
(blur_y ? clip_radius : 0) - clip_rect.y);
clip_rect.width + 2 * clip_radius,
clip_rect.height + 2 * clip_radius);
cairo_surface_set_device_offset (surface, clip_radius - clip_rect.x, clip_radius - clip_rect.y);
blur_cr = cairo_create (surface);
cairo_set_user_data (blur_cr, &original_cr_key, cairo_reference (cr), (cairo_destroy_func_t) cairo_destroy);
@@ -358,24 +342,9 @@ gtk_css_shadow_value_start_drawing (const GtkCssValue *shadow,
return blur_cr;
}
void
mask_surface_repeat (cairo_t *cr,
cairo_surface_t *surface)
{
cairo_pattern_t *pattern;
pattern = cairo_pattern_create_for_surface (surface);
cairo_pattern_set_extend (pattern, CAIRO_EXTEND_REPEAT);
cairo_mask (cr, pattern);
cairo_pattern_destroy (pattern);
}
static cairo_t *
gtk_css_shadow_value_finish_drawing (const GtkCssValue *shadow,
cairo_t *cr,
GtkBlurFlags blur_flags)
cairo_t *cr)
{
gdouble radius;
cairo_t *original_cr;
@@ -389,16 +358,12 @@ gtk_css_shadow_value_finish_drawing (const GtkCssValue *shadow,
/* Blur the surface. */
surface = cairo_get_target (cr);
radius = _gtk_css_number_value_get (shadow->radius, 0);
_gtk_cairo_blur_surface (surface, radius, blur_flags);
_gtk_cairo_blur_surface (surface, radius);
gdk_cairo_set_source_rgba (original_cr, _gtk_css_rgba_value_get_rgba (shadow->color));
if (blur_flags & GTK_BLUR_REPEAT)
mask_surface_repeat (original_cr, surface);
else
cairo_mask_surface (original_cr, surface, 0, 0);
cairo_mask_surface (original_cr, surface, 0, 0);
cairo_destroy (cr);
cairo_surface_destroy (surface);
return original_cr;
@@ -460,7 +425,7 @@ make_blurred_pango_surface (cairo_t *existing_cr,
cr = cairo_create (surface);
cairo_move_to (cr, 0, 0);
_gtk_pango_fill_layout (cr, layout);
_gtk_cairo_blur_surface (surface, radius * x_scale, GTK_BLUR_X | GTK_BLUR_Y);
_gtk_cairo_blur_surface (surface, radius * x_scale);
cairo_destroy (cr);
@@ -547,14 +512,14 @@ _gtk_css_shadow_value_paint_icon (const GtkCssValue *shadow,
pattern = cairo_pattern_reference (cairo_get_source (cr));
gdk_cairo_set_source_rgba (cr, _gtk_css_rgba_value_get_rgba (shadow->color));
cr = gtk_css_shadow_value_start_drawing (shadow, cr, GTK_BLUR_X | GTK_BLUR_Y);
cr = gtk_css_shadow_value_start_drawing (shadow, cr);
cairo_translate (cr,
_gtk_css_number_value_get (shadow->hoffset, 0),
_gtk_css_number_value_get (shadow->voffset, 0));
cairo_mask (cr, pattern);
cr = gtk_css_shadow_value_finish_drawing (shadow, cr, GTK_BLUR_X | GTK_BLUR_Y);
cr = gtk_css_shadow_value_finish_drawing (shadow, cr);
cairo_restore (cr);
cairo_pattern_destroy (pattern);
@@ -602,18 +567,16 @@ draw_shadow (const GtkCssValue *shadow,
cairo_t *cr,
GtkRoundedBox *box,
GtkRoundedBox *clip_box,
GtkBlurFlags blur_flags)
gboolean blur)
{
cairo_t *shadow_cr;
gboolean do_blur;
if (has_empty_clip (cr))
return;
gdk_cairo_set_source_rgba (cr, _gtk_css_rgba_value_get_rgba (shadow->color));
do_blur = (blur_flags & (GTK_BLUR_X | GTK_BLUR_Y)) != 0;
if (do_blur)
shadow_cr = gtk_css_shadow_value_start_drawing (shadow, cr, blur_flags);
if (blur)
shadow_cr = gtk_css_shadow_value_start_drawing (shadow, cr);
else
shadow_cr = cr;
@@ -624,8 +587,8 @@ draw_shadow (const GtkCssValue *shadow,
cairo_fill (shadow_cr);
if (do_blur)
gtk_css_shadow_value_finish_drawing (shadow, shadow_cr, blur_flags);
if (blur)
gtk_css_shadow_value_finish_drawing (shadow, shadow_cr);
}
void
@@ -681,7 +644,7 @@ _gtk_css_shadow_value_paint_box (const GtkCssValue *shadow,
_gtk_rounded_box_shrink (&clip_box, -clip_radius, -clip_radius, -clip_radius, -clip_radius);
if (!needs_blur (shadow))
draw_shadow (shadow, cr, &box, &clip_box, GTK_BLUR_NONE);
draw_shadow (shadow, cr, &box, &clip_box, FALSE);
else
{
int i, x1, x2, y1, y2;
@@ -751,7 +714,7 @@ _gtk_css_shadow_value_paint_box (const GtkCssValue *shadow,
/* Also clip with remaining to ensure we never draw any area twice */
gdk_cairo_region (cr, remaining);
cairo_clip (cr);
draw_shadow (shadow, cr, &box, &clip_box, GTK_BLUR_X | GTK_BLUR_Y);
draw_shadow (shadow, cr, &box, &clip_box, TRUE);
cairo_restore (cr);
/* We drew the region, remove it from remaining */
@@ -765,11 +728,8 @@ _gtk_css_shadow_value_paint_box (const GtkCssValue *shadow,
/* Then the sides */
for (i = 0; i < 4; i++)
{
GtkBlurFlags blur_flags = GTK_BLUR_REPEAT;
if (i == GTK_CSS_TOP || i == GTK_CSS_BOTTOM)
{
blur_flags |= GTK_BLUR_Y;
x1 = floor (box.box.x - clip_radius);
x2 = ceil (box.box.x + box.box.width + clip_radius);
}
@@ -786,7 +746,6 @@ _gtk_css_shadow_value_paint_box (const GtkCssValue *shadow,
if (i == GTK_CSS_LEFT || i == GTK_CSS_RIGHT)
{
blur_flags |= GTK_BLUR_X;
y1 = floor (box.box.y - clip_radius);
y2 = ceil (box.box.y + box.box.height + clip_radius);
}
@@ -807,7 +766,7 @@ _gtk_css_shadow_value_paint_box (const GtkCssValue *shadow,
/* Also clip with remaining to ensure we never draw any area twice */
gdk_cairo_region (cr, remaining);
cairo_clip (cr);
draw_shadow (shadow, cr, &box, &clip_box, blur_flags);
draw_shadow (shadow, cr, &box, &clip_box, TRUE);
cairo_restore (cr);
/* We drew the region, remove it from remaining */
@@ -823,7 +782,7 @@ _gtk_css_shadow_value_paint_box (const GtkCssValue *shadow,
cairo_save (cr);
gdk_cairo_region (cr, remaining);
cairo_clip (cr);
draw_shadow (shadow, cr, &box, &clip_box, GTK_BLUR_NONE);
draw_shadow (shadow, cr, &box, &clip_box, FALSE);
cairo_restore (cr);
cairo_region_destroy (remaining);
+28
View File
@@ -804,6 +804,15 @@ border_image_width_parse (GtkCssStyleProperty *property,
FALSE);
}
static GtkCssValue *
minmax_parse (GtkCssStyleProperty *property,
GtkCssParser *parser)
{
return _gtk_css_number_value_parse (parser,
GTK_CSS_PARSE_LENGTH
| GTK_CSS_POSITIVE_ONLY);
}
static GtkCssValue *
transition_property_parse_one (GtkCssParser *parser)
{
@@ -1529,6 +1538,25 @@ _gtk_css_style_property_init_properties (void)
NULL,
_gtk_css_transform_value_new_none ());
gtk_css_style_property_register ("min-width",
GTK_CSS_PROPERTY_MIN_WIDTH,
G_TYPE_NONE,
GTK_STYLE_PROPERTY_ANIMATED,
GTK_CSS_AFFECTS_SIZE,
minmax_parse,
NULL,
NULL,
_gtk_css_number_value_new (0, GTK_CSS_PX));
gtk_css_style_property_register ("min-height",
GTK_CSS_PROPERTY_MIN_HEIGHT,
G_TYPE_NONE,
GTK_STYLE_PROPERTY_ANIMATED,
GTK_CSS_AFFECTS_SIZE,
minmax_parse,
NULL,
NULL,
_gtk_css_number_value_new (0, GTK_CSS_PX));
gtk_css_style_property_register ("transition-property",
GTK_CSS_PROPERTY_TRANSITION_PROPERTY,
G_TYPE_NONE,
+2
View File
@@ -164,6 +164,8 @@ enum { /*< skip >*/
GTK_CSS_PROPERTY_ICON_SHADOW,
GTK_CSS_PROPERTY_ICON_STYLE,
GTK_CSS_PROPERTY_ICON_TRANSFORM,
GTK_CSS_PROPERTY_MIN_WIDTH,
GTK_CSS_PROPERTY_MIN_HEIGHT,
GTK_CSS_PROPERTY_TRANSITION_PROPERTY,
GTK_CSS_PROPERTY_TRANSITION_DURATION,
GTK_CSS_PROPERTY_TRANSITION_TIMING_FUNCTION,
-3
View File
@@ -54,9 +54,6 @@ gtk_css_widget_node_style_changed (GtkCssNode *cssnode,
node = GTK_CSS_WIDGET_NODE (cssnode);
if (node->widget)
gtk_widget_clear_path (node->widget);
GTK_CSS_NODE_CLASS (gtk_css_widget_node_parent_class)->style_changed (cssnode, old_style, new_style);
diff = gtk_css_style_get_difference (new_style, old_style);
+10 -26
View File
@@ -228,8 +228,6 @@ static gboolean gtk_drag_dest_drop (GtkWidget *widget,
gint x,
gint y,
guint time);
static void gtk_drag_dest_set_widget (GtkDragDestInfo *info,
GtkWidget *widget);
static GtkDragDestInfo * gtk_drag_get_dest_info (GdkDragContext *context,
gboolean create);
@@ -1640,7 +1638,7 @@ _gtk_drag_dest_handle_event (GtkWidget *toplevel,
if (info->widget)
{
gtk_drag_dest_leave (info->widget, context, event->dnd.time);
gtk_drag_dest_set_widget (info, NULL);
info->widget = NULL;
}
break;
@@ -1660,7 +1658,7 @@ _gtk_drag_dest_handle_event (GtkWidget *toplevel,
if (info->widget)
{
gtk_drag_dest_leave (info->widget, context, event->dnd.time);
gtk_drag_dest_set_widget (info, NULL);
info->widget = NULL;
}
}
@@ -1692,7 +1690,7 @@ _gtk_drag_dest_handle_event (GtkWidget *toplevel,
if (info->widget && !found)
{
gtk_drag_dest_leave (info->widget, context, event->dnd.time);
gtk_drag_dest_set_widget (info, NULL);
info->widget = NULL;
}
/* Send a reply.
@@ -1920,12 +1918,15 @@ gtk_drag_find_widget (GtkWidget *widget,
found = callback (widget, context, x, y, time);
/* If so, send a "drag-leave" to the last widget */
if (found && info->widget != widget)
if (found)
{
if (info->widget)
gtk_drag_dest_leave (info->widget, context, time);
if (info->widget && info->widget != widget)
{
gtk_drag_dest_leave (info->widget, context, time);
}
gtk_drag_dest_set_widget (info, widget);
info->widget = widget;
g_object_add_weak_pointer (G_OBJECT (widget), (gpointer *) &info->widget);
}
}
@@ -2007,26 +2008,9 @@ gtk_drag_proxy_begin (GtkWidget *widget,
dest_info->proxy_source = source_info;
}
static void
gtk_drag_dest_set_widget (GtkDragDestInfo *info,
GtkWidget *widget)
{
if (info->widget)
g_object_remove_weak_pointer (G_OBJECT (info->widget), (gpointer *) &info->widget);
info->widget = widget;
if (info->widget)
g_object_add_weak_pointer (G_OBJECT (info->widget), (gpointer *) &info->widget);
}
static void
gtk_drag_dest_info_destroy (gpointer data)
{
GtkDragDestInfo *info = (GtkDragDestInfo *)data;
gtk_drag_dest_set_widget (info, NULL);
g_slice_free (GtkDragDestInfo, data);
}
+197 -126
View File
@@ -34,6 +34,7 @@
#include "gtkbindings.h"
#include "gtkcelleditable.h"
#include "gtkclipboard.h"
#include "gtkcssnodeutilsprivate.h"
#include "gtkdebug.h"
#include "gtkdnd.h"
#include "gtkentry.h"
@@ -174,6 +175,8 @@ struct _GtkEntryPrivate
GtkGesture *drag_gesture;
GtkGesture *multipress_gesture;
GtkCssNode *progress_node;
gfloat xalign;
gint ascent; /* font ascent in pango units */
@@ -235,12 +238,12 @@ struct _GtkEntryPrivate
struct _EntryIconInfo
{
GdkWindow *window;
GtkCssNode *css_node;
gchar *tooltip;
guint insensitive : 1;
guint nonactivatable : 1;
guint prelight : 1;
guint in_drag : 1;
guint pressed : 1;
GdkDragAction actions;
GtkTargetList *target_list;
@@ -1509,13 +1512,17 @@ gtk_entry_class_init (GtkEntryClass *class)
* icons prelight on mouseover.
*
* Since: 2.16
*
* Deprecated: 3.18: Activatable icons are always prelit on hover.
* Just don't style the :hover style if you don't want them to
* look different.
*/
gtk_widget_class_install_style_property (widget_class,
g_param_spec_boolean ("icon-prelight",
P_("Icon Prelight"),
P_("Whether activatable icons should prelight when hovered"),
TRUE,
GTK_PARAM_READABLE|G_PARAM_EXPLICIT_NOTIFY));
GTK_PARAM_READABLE|G_PARAM_EXPLICIT_NOTIFY|G_PARAM_DEPRECATED));
/**
* GtkEntry:progress-border:
@@ -2691,7 +2698,7 @@ find_invisible_char (GtkWidget *widget)
static void
gtk_entry_init (GtkEntry *entry)
{
GtkStyleContext *context;
GtkCssNode *widget_node;
GtkEntryPrivate *priv;
entry->priv = gtk_entry_get_instance_private (entry);
@@ -2735,8 +2742,8 @@ gtk_entry_init (GtkEntry *entry)
g_signal_connect (priv->im_context, "delete-surrounding",
G_CALLBACK (gtk_entry_delete_surrounding_cb), entry);
context = gtk_widget_get_style_context (GTK_WIDGET (entry));
gtk_style_context_add_class (context, GTK_STYLE_CLASS_ENTRY);
widget_node = gtk_widget_get_css_node (GTK_WIDGET (entry));
gtk_css_node_add_class (widget_node, GTK_STYLE_CLASS_ENTRY);
gtk_entry_update_cached_style_values (entry);
@@ -2753,6 +2760,16 @@ gtk_entry_init (GtkEntry *entry)
G_CALLBACK (gtk_entry_multipress_gesture_pressed), entry);
gtk_gesture_single_set_button (GTK_GESTURE_SINGLE (priv->multipress_gesture), 0);
gtk_gesture_single_set_exclusive (GTK_GESTURE_SINGLE (priv->multipress_gesture), TRUE);
priv->progress_node = gtk_css_node_new ();
gtk_css_node_set_widget_type (priv->progress_node, GTK_TYPE_ENTRY);
gtk_css_node_add_class (priv->progress_node, GTK_STYLE_CLASS_ENTRY);
gtk_css_node_add_class (priv->progress_node, GTK_STYLE_CLASS_PROGRESSBAR);
gtk_css_node_set_parent (priv->progress_node, widget_node);
gtk_css_node_set_state (priv->progress_node, gtk_css_node_get_state (widget_node));
g_signal_connect_object (priv->progress_node, "style-changed", G_CALLBACK (gtk_css_node_style_changed_for_widget), entry, 0);
g_object_unref (priv->progress_node);
}
static void
@@ -2791,47 +2808,6 @@ gtk_entry_ensure_text_handles (GtkEntry *entry)
G_CALLBACK (gtk_entry_handle_drag_finished), entry);
}
static void
gtk_entry_prepare_context_for_icon (GtkEntry *entry,
GtkStyleContext *context,
GtkEntryIconPosition icon_pos)
{
GtkEntryPrivate *priv = entry->priv;
EntryIconInfo *icon_info = priv->icons[icon_pos];
GtkWidget *widget;
GtkStateFlags state;
widget = GTK_WIDGET (entry);
state = gtk_widget_get_state_flags (widget);
state &= ~(GTK_STATE_FLAG_PRELIGHT);
if ((state & GTK_STATE_FLAG_INSENSITIVE) || icon_info->insensitive)
state |= GTK_STATE_FLAG_INSENSITIVE;
else if (icon_info->prelight)
state |= GTK_STATE_FLAG_PRELIGHT;
gtk_style_context_save (context);
gtk_style_context_set_state (context, state);
gtk_style_context_add_class (context, GTK_STYLE_CLASS_IMAGE);
if (gtk_widget_get_direction (GTK_WIDGET (entry)) == GTK_TEXT_DIR_RTL)
{
if (icon_pos == GTK_ENTRY_ICON_PRIMARY)
gtk_style_context_add_class (context, GTK_STYLE_CLASS_RIGHT);
else
gtk_style_context_add_class (context, GTK_STYLE_CLASS_LEFT);
}
else
{
if (icon_pos == GTK_ENTRY_ICON_PRIMARY)
gtk_style_context_add_class (context, GTK_STYLE_CLASS_LEFT);
else
gtk_style_context_add_class (context, GTK_STYLE_CLASS_RIGHT);
}
}
static gint
get_icon_width (GtkEntry *entry,
GtkEntryIconPosition icon_pos)
@@ -2847,7 +2823,7 @@ get_icon_width (GtkEntry *entry,
return 0;
context = gtk_widget_get_style_context (GTK_WIDGET (entry));
gtk_entry_prepare_context_for_icon (entry, context, icon_pos);
gtk_style_context_save_to_node (context, priv->icons[icon_pos]->css_node);
state = gtk_style_context_get_state (context);
gtk_style_context_get_padding (context, state, &padding);
@@ -3002,6 +2978,8 @@ gtk_entry_finalize (GObject *object)
{
if ((icon_info = priv->icons[i]) != NULL)
{
g_object_unref (icon_info->css_node);
if (icon_info->target_list != NULL)
{
gtk_target_list_unref (icon_info->target_list);
@@ -3195,6 +3173,7 @@ realize_icon_info (GtkWidget *widget,
GDK_BUTTON_RELEASE_MASK |
GDK_BUTTON1_MOTION_MASK |
GDK_BUTTON3_MOTION_MASK |
GDK_POINTER_MOTION_HINT_MASK |
GDK_POINTER_MOTION_MASK |
GDK_ENTER_NOTIFY_MASK |
GDK_LEAVE_NOTIFY_MASK);
@@ -3212,12 +3191,85 @@ realize_icon_info (GtkWidget *widget,
}
static void
update_state_for_icon_infos (GtkWidget *widget)
{
GtkCssNode *cssnode, *first_node, *last_node;
GtkEntry *entry = GTK_ENTRY (widget);
GtkEntryPrivate *priv = entry->priv;
GtkStateFlags state;
#define NOT_INHERITED (GTK_STATE_FLAG_PRELIGHT | GTK_STATE_FLAG_ACTIVE)
cssnode = gtk_widget_get_css_node (widget);
state = gtk_widget_get_state_flags (widget);
if (priv->icons[GTK_ENTRY_ICON_PRIMARY])
gtk_css_node_set_state (priv->icons[GTK_ENTRY_ICON_PRIMARY]->css_node,
(state & ~NOT_INHERITED)
| (gtk_css_node_get_state (priv->icons[GTK_ENTRY_ICON_PRIMARY]->css_node) & NOT_INHERITED)
| (priv->icons[GTK_ENTRY_ICON_PRIMARY]->insensitive ? GTK_STATE_FLAG_INSENSITIVE : 0));
if (priv->icons[GTK_ENTRY_ICON_SECONDARY])
gtk_css_node_set_state (priv->icons[GTK_ENTRY_ICON_SECONDARY]->css_node,
(state & ~NOT_INHERITED)
| (gtk_css_node_get_state (priv->icons[GTK_ENTRY_ICON_SECONDARY]->css_node) & NOT_INHERITED)
| (priv->icons[GTK_ENTRY_ICON_SECONDARY]->insensitive ? GTK_STATE_FLAG_INSENSITIVE : 0));
if (state & GTK_STATE_FLAG_DIR_RTL)
{
first_node = priv->icons[GTK_ENTRY_ICON_SECONDARY] ? priv->icons[GTK_ENTRY_ICON_SECONDARY]->css_node : NULL;
last_node = priv->icons[GTK_ENTRY_ICON_PRIMARY] ? priv->icons[GTK_ENTRY_ICON_PRIMARY]->css_node : NULL;
}
else
{
first_node = priv->icons[GTK_ENTRY_ICON_PRIMARY] ? priv->icons[GTK_ENTRY_ICON_PRIMARY]->css_node : NULL;
last_node = priv->icons[GTK_ENTRY_ICON_SECONDARY] ? priv->icons[GTK_ENTRY_ICON_SECONDARY]->css_node : NULL;
}
if (first_node)
{
if (first_node != gtk_css_node_get_first_child (cssnode))
gtk_css_node_set_before (first_node, gtk_css_node_get_first_child (cssnode));
gtk_css_node_remove_class (first_node, GTK_STYLE_CLASS_RIGHT);
gtk_css_node_add_class (first_node, GTK_STYLE_CLASS_LEFT);
}
if (last_node)
{
if (last_node != gtk_css_node_get_last_child (cssnode))
gtk_css_node_set_after (last_node, gtk_css_node_get_last_child (cssnode));
gtk_css_node_remove_class (last_node, GTK_STYLE_CLASS_LEFT);
gtk_css_node_add_class (last_node, GTK_STYLE_CLASS_RIGHT);
}
#undef NOT_INHERITED
}
static void
icon_node_style_changed_cb (GtkCssNode *node,
GtkCssStyle *old_style,
GtkCssStyle *new_style,
GtkWidget *widget)
{
GtkEntry *entry = GTK_ENTRY (widget);
GtkEntryPrivate *priv = entry->priv;
GtkIconHelper *icon_helper;
gtk_css_node_style_changed_for_widget (node, old_style, new_style, widget);
if (priv->icons[GTK_ENTRY_ICON_PRIMARY] && priv->icons[GTK_ENTRY_ICON_PRIMARY]->css_node == node)
icon_helper = priv->icons[GTK_ENTRY_ICON_PRIMARY]->icon_helper;
else
icon_helper = priv->icons[GTK_ENTRY_ICON_SECONDARY]->icon_helper;
_gtk_icon_helper_invalidate (icon_helper);
}
static EntryIconInfo*
construct_icon_info (GtkWidget *widget,
GtkEntryIconPosition icon_pos)
{
GtkEntry *entry = GTK_ENTRY (widget);
GtkEntryPrivate *priv = entry->priv;
GtkCssNode *widget_node;
EntryIconInfo *icon_info;
g_return_val_if_fail (priv->icons[icon_pos] == NULL, NULL);
@@ -3228,6 +3280,14 @@ construct_icon_info (GtkWidget *widget,
icon_info->icon_helper = _gtk_icon_helper_new ();
_gtk_icon_helper_set_force_scale_pixbuf (icon_info->icon_helper, TRUE);
icon_info->css_node = gtk_css_node_new ();
widget_node = gtk_widget_get_css_node (widget);
gtk_css_node_add_class (icon_info->css_node, GTK_STYLE_CLASS_ENTRY);
gtk_css_node_add_class (icon_info->css_node, GTK_STYLE_CLASS_IMAGE);
gtk_css_node_set_parent (icon_info->css_node, widget_node);
g_signal_connect_object (icon_info->css_node, "style-changed", G_CALLBACK (icon_node_style_changed_cb), widget, 0);
update_state_for_icon_infos (widget);
if (gtk_widget_get_realized (widget))
realize_icon_info (widget, icon_pos);
@@ -3313,6 +3373,7 @@ gtk_entry_realize (GtkWidget *widget)
GDK_BUTTON_RELEASE_MASK |
GDK_BUTTON1_MOTION_MASK |
GDK_BUTTON3_MOTION_MASK |
GDK_POINTER_MOTION_HINT_MASK |
GDK_POINTER_MOTION_MASK |
GDK_ENTER_NOTIFY_MASK |
GDK_LEAVE_NOTIFY_MASK);
@@ -3427,14 +3488,19 @@ _gtk_entry_get_borders (GtkEntry *entry,
}
static void
gtk_entry_get_preferred_width (GtkWidget *widget,
gint *minimum,
gint *natural)
gtk_entry_get_content_width (GtkCssNode *cssnode,
GtkOrientation orientation,
gint for_size,
gint *minimum,
gint *natural,
gint *minimum_baseline,
gint *natural_baseline,
gpointer data)
{
GtkEntry *entry = GTK_ENTRY (widget);
GtkWidget *widget = GTK_WIDGET(data);
GtkEntry *entry = GTK_ENTRY (data);
GtkEntryPrivate *priv = entry->priv;
PangoFontMetrics *metrics;
GtkBorder borders;
PangoContext *context;
gint icon_width, i;
gint min, nat;
@@ -3442,8 +3508,6 @@ gtk_entry_get_preferred_width (GtkWidget *widget,
gint digit_width;
gint char_pixels;
_gtk_entry_get_borders (entry, &borders);
context = gtk_widget_get_pango_context (widget);
metrics = pango_context_get_metrics (context,
pango_context_get_font_description (context),
@@ -3456,14 +3520,14 @@ gtk_entry_get_preferred_width (GtkWidget *widget,
pango_font_metrics_unref (metrics);
if (priv->width_chars < 0)
min = MIN_ENTRY_WIDTH + borders.left + borders.right;
min = MIN_ENTRY_WIDTH;
else
min = char_pixels * priv->width_chars + borders.left + borders.right;
min = char_pixels * priv->width_chars;
if (priv->max_width_chars < 0)
nat = MIN_ENTRY_WIDTH + borders.left + borders.right;
nat = MIN_ENTRY_WIDTH;
else
nat = char_pixels * priv->max_width_chars + borders.left + borders.right;
nat = char_pixels * priv->max_width_chars;
icon_width = 0;
for (i = 0; i < MAX_ICONS; i++)
@@ -3477,17 +3541,33 @@ gtk_entry_get_preferred_width (GtkWidget *widget,
}
static void
gtk_entry_get_preferred_height_and_baseline_for_width (GtkWidget *widget,
gint width,
gint *minimum,
gint *natural,
gint *minimum_baseline,
gint *natural_baseline)
gtk_entry_get_preferred_width (GtkWidget *widget,
gint *minimum,
gint *natural)
{
GtkEntry *entry = GTK_ENTRY (widget);
gtk_css_node_get_preferred_size (gtk_widget_get_css_node (widget),
GTK_ORIENTATION_HORIZONTAL,
-1,
minimum, natural,
NULL, NULL,
gtk_entry_get_content_width,
widget);
}
static void
gtk_entry_get_content_height (GtkCssNode *cssnode,
GtkOrientation orientation,
gint for_size,
gint *minimum,
gint *natural,
gint *minimum_baseline,
gint *natural_baseline,
gpointer data)
{
GtkWidget *widget = GTK_WIDGET(data);
GtkEntry *entry = GTK_ENTRY (data);
GtkEntryPrivate *priv = entry->priv;
PangoFontMetrics *metrics;
GtkBorder borders;
PangoContext *context;
gint height, baseline;
PangoLayout *layout;
@@ -3503,14 +3583,11 @@ gtk_entry_get_preferred_height_and_baseline_for_width (GtkWidget *widget,
priv->descent = pango_font_metrics_get_descent (metrics);
pango_font_metrics_unref (metrics);
_gtk_entry_get_borders (entry, &borders);
pango_layout_get_pixel_size (layout, NULL, &height);
height = MAX (height, PANGO_PIXELS (priv->ascent + priv->descent));
height += borders.top + borders.bottom;
baseline = pango_layout_get_baseline (layout) / PANGO_SCALE;
baseline += borders.top;
*minimum = height;
*natural = height;
@@ -3520,6 +3597,23 @@ gtk_entry_get_preferred_height_and_baseline_for_width (GtkWidget *widget,
*natural_baseline = baseline;
}
static void
gtk_entry_get_preferred_height_and_baseline_for_width (GtkWidget *widget,
gint width,
gint *minimum,
gint *natural,
gint *minimum_baseline,
gint *natural_baseline)
{
gtk_css_node_get_preferred_size (gtk_widget_get_css_node (widget),
GTK_ORIENTATION_VERTICAL,
width,
minimum, natural,
minimum_baseline, natural_baseline,
gtk_entry_get_content_height,
widget);
}
static void
gtk_entry_get_preferred_height (GtkWidget *widget,
gint *minimum,
@@ -3734,7 +3828,6 @@ should_prelight (GtkEntry *entry,
{
GtkEntryPrivate *priv = entry->priv;
EntryIconInfo *icon_info = priv->icons[icon_pos];
gboolean prelight;
if (!icon_info)
return FALSE;
@@ -3742,14 +3835,7 @@ should_prelight (GtkEntry *entry,
if (icon_info->nonactivatable && icon_info->target_list == NULL)
return FALSE;
if (icon_info->pressed)
return FALSE;
gtk_widget_style_get (GTK_WIDGET (entry),
"icon-prelight", &prelight,
NULL);
return prelight;
return TRUE;
}
static void
@@ -3780,7 +3866,7 @@ draw_icon (GtkWidget *widget,
gtk_cairo_transform_to_window (cr, widget, icon_info->window);
context = gtk_widget_get_style_context (widget);
gtk_entry_prepare_context_for_icon (entry, context, icon_pos);
gtk_style_context_save_to_node (context, priv->icons[icon_pos]->css_node);
_gtk_icon_helper_get_size (icon_info->icon_helper, context,
&pix_width, &pix_height);
state = gtk_style_context_get_state (context);
@@ -3837,18 +3923,6 @@ gtk_entry_draw_frame (GtkWidget *widget,
cairo_restore (cr);
}
static void
gtk_entry_prepare_context_for_progress (GtkEntry *entry,
GtkStyleContext *context)
{
GtkEntryPrivate *private = entry->priv;
gtk_style_context_save (context);
gtk_style_context_add_class (context, GTK_STYLE_CLASS_PROGRESSBAR);
if (private->progress_pulse_mode)
gtk_style_context_add_class (context, GTK_STYLE_CLASS_PULSE);
}
static void
get_progress_area (GtkWidget *widget,
gint *x,
@@ -3897,7 +3971,7 @@ get_progress_area (GtkWidget *widget,
}
}
gtk_entry_prepare_context_for_progress (entry, context);
gtk_style_context_save_to_node (context, private->progress_node);
gtk_style_context_get_margin (context, state, &margin);
gtk_style_context_restore (context);
@@ -3951,7 +4025,7 @@ gtk_entry_draw_progress (GtkWidget *widget,
if ((width <= 0) || (height <= 0))
return;
gtk_entry_prepare_context_for_progress (entry, context);
gtk_style_context_save_to_node (context, entry->priv->progress_node);
gtk_render_background (context, cr, x, y, width, height);
gtk_render_frame (context, cr, x, y, width, height);
@@ -4021,10 +4095,7 @@ gtk_entry_enter_notify (GtkWidget *widget,
if (icon_info != NULL && event->window == icon_info->window)
{
if (should_prelight (entry, i))
{
icon_info->prelight = TRUE;
gtk_widget_queue_draw (widget);
}
gtk_css_node_add_state (icon_info->css_node, GTK_STATE_FLAG_PRELIGHT);
break;
}
@@ -4049,13 +4120,10 @@ gtk_entry_leave_notify (GtkWidget *widget,
{
/* a grab means that we may never see the button release */
if (event->mode == GDK_CROSSING_GRAB || event->mode == GDK_CROSSING_GTK_GRAB)
icon_info->pressed = FALSE;
gtk_css_node_remove_state (icon_info->css_node, GTK_STATE_FLAG_ACTIVE);
if (should_prelight (entry, i))
{
icon_info->prelight = FALSE;
gtk_widget_queue_draw (widget);
}
gtk_css_node_remove_state (icon_info->css_node, GTK_STATE_FLAG_PRELIGHT);
break;
}
@@ -4295,15 +4363,10 @@ gtk_entry_event (GtkWidget *widget,
case GDK_BUTTON_PRESS:
case GDK_2BUTTON_PRESS:
case GDK_3BUTTON_PRESS:
if (should_prelight (GTK_ENTRY (widget), i))
{
icon_info->prelight = FALSE;
gtk_widget_queue_draw (widget);
}
priv->start_x = x;
priv->start_y = y;
icon_info->pressed = TRUE;
gtk_css_node_add_state (icon_info->css_node, GTK_STATE_FLAG_ACTIVE);
icon_info->device = device;
if (!icon_info->nonactivatable)
@@ -4316,7 +4379,7 @@ gtk_entry_event (GtkWidget *widget,
break;
/* Fall through */
case GDK_MOTION_NOTIFY:
if (icon_info->pressed &&
if ((gtk_css_node_get_state (icon_info->css_node) & GTK_STATE_FLAG_ACTIVE) &&
icon_info->target_list != NULL &&
gtk_drag_check_threshold (widget,
priv->start_x,
@@ -4342,18 +4405,9 @@ gtk_entry_event (GtkWidget *widget,
icon_info->current_sequence = NULL;
/* Fall through */
case GDK_BUTTON_RELEASE:
icon_info->pressed = FALSE;
gtk_css_node_remove_state (icon_info->css_node, GTK_STATE_FLAG_ACTIVE);
icon_info->device = NULL;
if (should_prelight (GTK_ENTRY (widget), i) &&
x >= 0 && y >= 0 &&
x < gdk_window_get_width (icon_info->window) &&
y < gdk_window_get_height (icon_info->window))
{
icon_info->prelight = TRUE;
gtk_widget_queue_draw (widget);
}
if (!icon_info->nonactivatable)
g_signal_emit (widget, signals[ICON_RELEASE], 0, i, event);
@@ -5073,6 +5127,8 @@ gtk_entry_state_flags_changed (GtkWidget *widget,
gtk_editable_select_region (GTK_EDITABLE (entry), priv->current_pos, priv->current_pos);
}
update_state_for_icon_infos (widget);
gtk_entry_update_cached_style_values (entry);
}
@@ -6497,7 +6553,7 @@ gtk_entry_draw_text (GtkEntry *entry,
gtk_style_context_get_color (context, state, &text_color);
/* Get foreground color for progressbars */
gtk_entry_prepare_context_for_progress (entry, context);
gtk_style_context_save_to_node (context, priv->progress_node);
gtk_style_context_get_color (context, state, &bar_text_color);
gtk_style_context_restore (context);
@@ -7437,6 +7493,8 @@ gtk_entry_clear (GtkEntry *entry,
if (GDK_IS_WINDOW (icon_info->window))
gdk_window_hide (icon_info->window);
gtk_css_node_set_visible (icon_info->css_node, FALSE);
storage_type = _gtk_icon_helper_get_storage_type (icon_info->icon_helper);
switch (storage_type)
@@ -7484,7 +7542,7 @@ gtk_entry_ensure_pixbuf (GtkEntry *entry,
GdkPixbuf *pix;
context = gtk_widget_get_style_context (GTK_WIDGET (entry));
gtk_entry_prepare_context_for_icon (entry, context, icon_pos);
gtk_style_context_save_to_node (context, priv->icons[icon_pos]->css_node);
pix = _gtk_icon_helper_ensure_pixbuf (icon_info->icon_helper,
context);
@@ -8494,6 +8552,8 @@ gtk_entry_set_icon_from_pixbuf (GtkEntry *entry,
_gtk_icon_helper_set_icon_size (icon_info->icon_helper,
GTK_ICON_SIZE_MENU);
gtk_css_node_set_visible (icon_info->css_node, TRUE);
if (icon_pos == GTK_ENTRY_ICON_PRIMARY)
{
g_object_notify (G_OBJECT (entry), "primary-icon-pixbuf");
@@ -8560,6 +8620,8 @@ gtk_entry_set_icon_from_stock (GtkEntry *entry,
{
_gtk_icon_helper_set_stock_id (icon_info->icon_helper, new_id, GTK_ICON_SIZE_MENU);
gtk_css_node_set_visible (icon_info->css_node, TRUE);
if (icon_pos == GTK_ENTRY_ICON_PRIMARY)
{
g_object_notify (G_OBJECT (entry), "primary-icon-stock");
@@ -8627,6 +8689,8 @@ gtk_entry_set_icon_from_icon_name (GtkEntry *entry,
{
_gtk_icon_helper_set_icon_name (icon_info->icon_helper, new_name, GTK_ICON_SIZE_MENU);
gtk_css_node_set_visible (icon_info->css_node, TRUE);
if (icon_pos == GTK_ENTRY_ICON_PRIMARY)
{
g_object_notify (G_OBJECT (entry), "primary-icon-name");
@@ -8693,6 +8757,8 @@ gtk_entry_set_icon_from_gicon (GtkEntry *entry,
{
_gtk_icon_helper_set_gicon (icon_info->icon_helper, icon, GTK_ICON_SIZE_MENU);
gtk_css_node_set_visible (icon_info->css_node, TRUE);
if (icon_pos == GTK_ENTRY_ICON_PRIMARY)
{
g_object_notify (G_OBJECT (entry), "primary-icon-gicon");
@@ -8959,14 +9025,15 @@ gtk_entry_set_icon_sensitive (GtkEntry *entry,
{
icon_info->insensitive = !sensitive;
icon_info->pressed = FALSE;
icon_info->prelight = FALSE;
gtk_css_node_remove_state (icon_info->css_node, GTK_STATE_FLAG_PRELIGHT | GTK_STATE_FLAG_ACTIVE);
if (!gtk_widget_is_sensitive (GTK_WIDGET (entry)) || icon_info->insensitive)
gtk_css_node_add_state (icon_info->css_node, GTK_STATE_FLAG_INSENSITIVE);
else
gtk_css_node_remove_state (icon_info->css_node, GTK_STATE_FLAG_INSENSITIVE);
if (gtk_widget_get_realized (GTK_WIDGET (entry)))
update_cursors (GTK_WIDGET (entry));
gtk_widget_queue_draw (GTK_WIDGET (entry));
g_object_notify (G_OBJECT (entry),
icon_pos == GTK_ENTRY_ICON_PRIMARY ? "primary-icon-sensitive" : "secondary-icon-sensitive");
}
@@ -9478,7 +9545,7 @@ check_undo_icon_grab (GtkEntry *entry,
!gtk_widget_device_is_shadowed (GTK_WIDGET (entry), info->device))
return;
info->pressed = FALSE;
gtk_css_node_remove_state (info->css_node, GTK_STATE_FLAG_ACTIVE);
info->current_sequence = NULL;
info->device = NULL;
}
@@ -10552,6 +10619,8 @@ gtk_entry_start_pulse_mode (GtkEntry *entry)
priv->progress_pulse_mode = TRUE;
priv->tick_id = gtk_widget_add_tick_callback (GTK_WIDGET (entry), tick_cb, NULL, NULL);
gtk_css_node_add_class (priv->progress_node, GTK_STYLE_CLASS_PULSE);
priv->progress_fraction = 0.0;
priv->progress_pulse_way_back = FALSE;
priv->progress_pulse_current = 0.0;
@@ -10572,6 +10641,8 @@ gtk_entry_stop_pulse_mode (GtkEntry *entry)
priv->progress_pulse_mode = FALSE;
gtk_widget_remove_tick_callback (GTK_WIDGET (entry), priv->tick_id);
priv->tick_id = 0;
gtk_css_node_remove_class (priv->progress_node, GTK_STYLE_CLASS_PULSE);
}
}
+3 -4
View File
@@ -1033,12 +1033,11 @@ gtk_file_chooser_button_destroy (GtkWidget *widget)
priv->dialog = NULL;
}
if (priv->model && gtk_tree_model_get_iter_first (priv->model, &iter))
if (priv->model && gtk_tree_model_get_iter_first (priv->model, &iter)) do
{
do
model_free_row_data (button, &iter);
while (gtk_tree_model_iter_next (priv->model, &iter));
model_free_row_data (button, &iter);
}
while (gtk_tree_model_iter_next (priv->model, &iter));
if (priv->dnd_select_folder_cancellable)
{
+1 -1
View File
@@ -876,7 +876,7 @@ _gtk_icon_helper_get_size (GtkIconHelper *self,
width = gdk_pixbuf_animation_get_width (self->priv->animation);
height = gdk_pixbuf_animation_get_height (self->priv->animation);
}
else if (self->priv->icon_size != GTK_ICON_SIZE_INVALID)
else if (self->priv->icon_size != -1)
{
ensure_icon_size (self, context, &width, &height);
}
+17 -90
View File
@@ -155,9 +155,6 @@ static void gtk_image_size_allocate (GtkWidget *widget,
static void gtk_image_unmap (GtkWidget *widget);
static void gtk_image_realize (GtkWidget *widget);
static void gtk_image_unrealize (GtkWidget *widget);
static void gtk_image_get_preferred_size (GtkImage *image,
gint *width_out,
gint *height_out);
static void gtk_image_get_preferred_width (GtkWidget *widget,
gint *minimum,
gint *natural);
@@ -937,8 +934,8 @@ gtk_image_set_from_file (GtkImage *image,
priv = image->priv;
g_object_freeze_notify (G_OBJECT (image));
gtk_image_reset (image);
gtk_image_clear (image);
if (filename == NULL)
{
@@ -951,7 +948,9 @@ gtk_image_set_from_file (GtkImage *image,
if (anim == NULL)
{
gtk_image_set_from_icon_name (image, "image-missing", DEFAULT_ICON_SIZE);
gtk_image_set_from_icon_name (image,
"image-missing",
DEFAULT_ICON_SIZE);
g_object_thaw_notify (G_OBJECT (image));
return;
}
@@ -972,21 +971,7 @@ gtk_image_set_from_file (GtkImage *image,
g_object_unref (anim);
priv->filename = g_strdup (filename);
if (gtk_widget_get_visible (GTK_WIDGET (image)))
{
gint width, height;
gtk_image_get_preferred_size (image, &width, &height);
if (width != gtk_widget_get_allocated_width (GTK_WIDGET (image)) ||
height != gtk_widget_get_allocated_height (GTK_WIDGET (image)))
gtk_widget_queue_resize (GTK_WIDGET (image));
else
gtk_widget_queue_draw (GTK_WIDGET (image));
}
g_object_notify (G_OBJECT (image), "file");
g_object_thaw_notify (G_OBJECT (image));
}
@@ -1023,7 +1008,9 @@ gtk_image_set_from_resource (GtkImage *image,
if (animation == NULL)
{
gtk_image_set_from_icon_name (image, "image-missing", DEFAULT_ICON_SIZE);
gtk_image_set_from_icon_name (image,
"image-missing",
DEFAULT_ICON_SIZE);
g_object_thaw_notify (G_OBJECT (image));
return;
}
@@ -1059,29 +1046,18 @@ gtk_image_set_from_pixbuf (GtkImage *image,
GtkImagePrivate *priv;
g_return_if_fail (GTK_IS_IMAGE (image));
g_return_if_fail (pixbuf == NULL || GDK_IS_PIXBUF (pixbuf));
g_return_if_fail (pixbuf == NULL ||
GDK_IS_PIXBUF (pixbuf));
priv = image->priv;
g_object_freeze_notify (G_OBJECT (image));
gtk_image_reset (image);
gtk_image_clear (image);
if (pixbuf != NULL)
_gtk_icon_helper_set_pixbuf (priv->icon_helper, pixbuf);
if (gtk_widget_get_visible (GTK_WIDGET (image)))
{
gint width, height;
gtk_image_get_preferred_size (image, &width, &height);
if (width != gtk_widget_get_allocated_width (GTK_WIDGET (image)) ||
height != gtk_widget_get_allocated_height (GTK_WIDGET (image)))
gtk_widget_queue_resize (GTK_WIDGET (image));
else
gtk_widget_queue_draw (GTK_WIDGET (image));
}
g_object_notify (G_OBJECT (image), "pixbuf");
g_object_thaw_notify (G_OBJECT (image));
@@ -1195,7 +1171,7 @@ gtk_image_set_from_animation (GtkImage *image,
if (animation)
g_object_ref (animation);
gtk_image_reset (image);
gtk_image_clear (image);
if (animation != NULL)
{
@@ -1203,18 +1179,6 @@ gtk_image_set_from_animation (GtkImage *image,
g_object_unref (animation);
}
if (gtk_widget_get_visible (GTK_WIDGET (image)))
{
gint width, height;
gtk_image_get_preferred_size (image, &width, &height);
if (width != gtk_widget_get_allocated_width (GTK_WIDGET (image)) ||
height != gtk_widget_get_allocated_height (GTK_WIDGET (image)))
gtk_widget_queue_resize (GTK_WIDGET (image));
else
gtk_widget_queue_draw (GTK_WIDGET (image));
}
g_object_notify (G_OBJECT (image), "pixbuf-animation");
g_object_thaw_notify (G_OBJECT (image));
@@ -1245,8 +1209,7 @@ gtk_image_set_from_icon_name (GtkImage *image,
g_object_freeze_notify (G_OBJECT (image));
new_name = g_strdup (icon_name);
gtk_image_reset (image);
gtk_image_clear (image);
if (new_name)
{
@@ -1254,18 +1217,6 @@ gtk_image_set_from_icon_name (GtkImage *image,
g_free (new_name);
}
if (gtk_widget_get_visible (GTK_WIDGET (image)))
{
gint width, height;
gtk_image_get_preferred_size (image, &width, &height);
if (width != gtk_widget_get_allocated_width (GTK_WIDGET (image)) ||
height != gtk_widget_get_allocated_height (GTK_WIDGET (image)))
gtk_widget_queue_resize (GTK_WIDGET (image));
else
gtk_widget_queue_draw (GTK_WIDGET (image));
}
g_object_notify (G_OBJECT (image), "icon-name");
g_object_notify (G_OBJECT (image), "icon-size");
@@ -1298,7 +1249,7 @@ gtk_image_set_from_gicon (GtkImage *image,
if (icon)
g_object_ref (icon);
gtk_image_reset (image);
gtk_image_clear (image);
if (icon)
{
@@ -1306,18 +1257,6 @@ gtk_image_set_from_gicon (GtkImage *image,
g_object_unref (icon);
}
if (gtk_widget_get_visible (GTK_WIDGET (image)))
{
gint width, height;
gtk_image_get_preferred_size (image, &width, &height);
if (width != gtk_widget_get_allocated_width (GTK_WIDGET (image)) ||
height != gtk_widget_get_allocated_height (GTK_WIDGET (image)))
gtk_widget_queue_resize (GTK_WIDGET (image));
else
gtk_widget_queue_draw (GTK_WIDGET (image));
}
g_object_notify (G_OBJECT (image), "gicon");
g_object_notify (G_OBJECT (image), "icon-size");
@@ -1348,7 +1287,7 @@ gtk_image_set_from_surface (GtkImage *image,
if (surface)
cairo_surface_reference (surface);
gtk_image_reset (image);
gtk_image_clear (image);
if (surface)
{
@@ -1356,18 +1295,6 @@ gtk_image_set_from_surface (GtkImage *image,
cairo_surface_destroy (surface);
}
if (gtk_widget_get_visible (GTK_WIDGET (image)))
{
gint width, height;
gtk_image_get_preferred_size (image, &width, &height);
if (width != gtk_widget_get_allocated_width (GTK_WIDGET (image)) ||
height != gtk_widget_get_allocated_height (GTK_WIDGET (image)))
gtk_widget_queue_resize (GTK_WIDGET (image));
else
gtk_widget_queue_draw (GTK_WIDGET (image));
}
g_object_notify (G_OBJECT (image), "surface");
g_object_thaw_notify (G_OBJECT (image));
+2 -1
View File
@@ -5357,7 +5357,8 @@ gtk_label_create_window (GtkLabel *label)
GDK_BUTTON_RELEASE_MASK |
GDK_LEAVE_NOTIFY_MASK |
GDK_BUTTON_MOTION_MASK |
GDK_POINTER_MOTION_MASK;
GDK_POINTER_MOTION_MASK |
GDK_POINTER_MOTION_HINT_MASK;
attributes_mask = GDK_WA_X | GDK_WA_Y | GDK_WA_NOREDIR;
if (gtk_widget_is_sensitive (widget) && priv->select_info && priv->select_info->selectable)
{
+1 -1
View File
@@ -890,7 +890,7 @@ set_align_widget_pointer (GtkMenuButton *menu_button,
priv->align_widget = align_widget;
if (priv->align_widget)
if (align_widget)
g_object_add_weak_pointer (G_OBJECT (priv->align_widget), (gpointer *) &priv->align_widget);
}
+8 -5
View File
@@ -1436,10 +1436,13 @@ create_show_processes_dialog (GtkMountOperation *op,
gtk_box_pack_start (GTK_BOX (content_area), vbox, TRUE, TRUE, 0);
if (secondary != NULL)
s = g_strdup_printf ("<big><b>%s</b></big>\n\n%s", primary, secondary);
{
s = g_strdup_printf ("<big><b>%s</b></big>\n\n%s", primary, secondary);
}
else
s = g_strdup_printf ("%s", primary);
{
s = g_strdup_printf ("%s", primary);
}
g_free (primary);
label = gtk_label_new (NULL);
gtk_label_set_markup (GTK_LABEL (label), s);
@@ -1515,8 +1518,8 @@ create_show_processes_dialog (GtkMountOperation *op,
priv->process_list_store = list_store;
priv->process_tree_view = tree_view;
/* set pointers to NULL when dialog goes away */
g_object_add_weak_pointer (G_OBJECT (priv->process_list_store), (gpointer *) &priv->process_list_store);
g_object_add_weak_pointer (G_OBJECT (priv->process_tree_view), (gpointer *) &priv->process_tree_view);
g_object_add_weak_pointer (G_OBJECT (list_store), (gpointer *) &priv->process_list_store);
g_object_add_weak_pointer (G_OBJECT (tree_view), (gpointer *) &priv->process_tree_view);
g_object_unref (list_store);
g_object_ref (op);
+2 -3
View File
@@ -24,7 +24,6 @@
#if defined(HAVE__NL_PAPER_HEIGHT) && defined(HAVE__NL_PAPER_WIDTH)
#include <langinfo.h>
#endif
#include <math.h>
#include "gtkpapersize.h"
#include "gtkprintutils.h"
@@ -443,8 +442,8 @@ gtk_paper_size_new_from_ipp (const gchar *ipp_name,
x_dimension = _gtk_print_convert_from_mm (standard_names_offsets[i].width, GTK_UNIT_POINTS);
y_dimension = _gtk_print_convert_from_mm (standard_names_offsets[i].height, GTK_UNIT_POINTS);
if (fabs (x_dimension - width) <= PAPER_SIZE_TOLERANCE &&
fabs (y_dimension - height) <= PAPER_SIZE_TOLERANCE)
if (abs (x_dimension - width) <= PAPER_SIZE_TOLERANCE &&
abs (y_dimension - height) <= PAPER_SIZE_TOLERANCE)
{
display_name = g_strdup (g_dpgettext2 (GETTEXT_PACKAGE,
"paper size",
+1 -1
View File
@@ -1785,7 +1785,7 @@ _gtk_print_operation_set_status (GtkPrintOperation *op,
NC_("print operation status", "Finished with error")
};
if (status > GTK_PRINT_STATUS_FINISHED_ABORTED)
if (status < 0 || status > GTK_PRINT_STATUS_FINISHED_ABORTED)
status = GTK_PRINT_STATUS_FINISHED_ABORTED;
if (string == NULL)
+1 -1
View File
@@ -207,7 +207,7 @@ static GObject *gtk_print_unix_dialog_buildable_get_internal_child (GtkBuildabl
GtkBuilder *builder,
const gchar *childname);
static const gchar common_paper_sizes[][16] = {
static const gchar const common_paper_sizes[][16] = {
"na_letter",
"na_legal",
"iso_a4",
+8 -66
View File
@@ -208,8 +208,6 @@ gtk_radio_menu_item_set_group (GtkRadioMenuItem *radio_menu_item,
tmp_item->priv->group = priv->group;
}
_gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (radio_menu_item), FALSE);
}
else
{
@@ -284,7 +282,7 @@ gtk_radio_menu_item_new_with_mnemonic (GSList *group,
/**
* gtk_radio_menu_item_new_from_widget: (constructor)
* @group: (allow-none): An existing #GtkRadioMenuItem
* @group: An existing #GtkRadioMenuItem
*
* Creates a new #GtkRadioMenuItem adding it to the same group as @group.
*
@@ -297,7 +295,7 @@ gtk_radio_menu_item_new_from_widget (GtkRadioMenuItem *group)
{
GSList *list = NULL;
g_return_val_if_fail (group == NULL || GTK_IS_RADIO_MENU_ITEM (group), NULL);
g_return_val_if_fail (GTK_IS_RADIO_MENU_ITEM (group), NULL);
if (group)
list = gtk_radio_menu_item_get_group (group);
@@ -307,8 +305,8 @@ gtk_radio_menu_item_new_from_widget (GtkRadioMenuItem *group)
/**
* gtk_radio_menu_item_new_with_mnemonic_from_widget: (constructor)
* @group: (allow-none): An existing #GtkRadioMenuItem
* @label: (allow-none): the text of the button, with an underscore in front of the
* @group: An existing #GtkRadioMenuItem
* @label: the text of the button, with an underscore in front of the
* mnemonic character
*
* Creates a new GtkRadioMenuItem containing a label. The label will be
@@ -327,7 +325,7 @@ gtk_radio_menu_item_new_with_mnemonic_from_widget (GtkRadioMenuItem *group,
{
GSList *list = NULL;
g_return_val_if_fail (group == NULL || GTK_IS_RADIO_MENU_ITEM (group), NULL);
g_return_val_if_fail (GTK_IS_RADIO_MENU_ITEM (group), NULL);
if (group)
list = gtk_radio_menu_item_get_group (group);
@@ -337,8 +335,8 @@ gtk_radio_menu_item_new_with_mnemonic_from_widget (GtkRadioMenuItem *group,
/**
* gtk_radio_menu_item_new_with_label_from_widget: (constructor)
* @group: (allow-none): an existing #GtkRadioMenuItem
* @label: (allow-none): the text for the label
* @group: an existing #GtkRadioMenuItem
* @label: the text for the label
*
* Creates a new GtkRadioMenuItem whose child is a simple GtkLabel.
* The new #GtkRadioMenuItem is added to the same group as @group.
@@ -353,7 +351,7 @@ gtk_radio_menu_item_new_with_label_from_widget (GtkRadioMenuItem *group,
{
GSList *list = NULL;
g_return_val_if_fail (group == NULL || GTK_IS_RADIO_MENU_ITEM (group), NULL);
g_return_val_if_fail (GTK_IS_RADIO_MENU_ITEM (group), NULL);
if (group)
list = gtk_radio_menu_item_get_group (group);
@@ -558,59 +556,3 @@ gtk_radio_menu_item_activate (GtkMenuItem *menu_item)
gtk_widget_queue_draw (GTK_WIDGET (radio_menu_item));
}
/**
* gtk_radio_menu_item_join_group:
* @radio_menu_item: a #GtkRadioMenuItem
* @group_source: (allow-none): a #GtkRadioMenuItem whose group we are
* joining, or %NULL to remove the @radio_menu_item from its current
* group
*
* Joins a #GtkRadioMenuItem object to the group of another #GtkRadioMenuItem
* object.
*
* This function should be used by language bindings to avoid the memory
* manangement of the opaque #GSList of gtk_radio_menu_item_get_group()
* and gtk_radio_menu_item_set_group().
*
* A common way to set up a group of #GtkRadioMenuItem instances is:
*
* |[
* GtkRadioMenuItem *last_item = NULL;
*
* while ( ...more items to add... )
* {
* GtkRadioMenuItem *radio_item;
*
* radio_item = gtk_radio_menu_item_new (...);
*
* gtk_radio_menu_item_join_group (radio_item, last_item);
* last_item = radio_item;
* }
* ]|
*
* Since: 3.18
*/
void
gtk_radio_menu_item_join_group (GtkRadioMenuItem *radio_menu_item,
GtkRadioMenuItem *group_source)
{
g_return_if_fail (GTK_IS_RADIO_MENU_ITEM (radio_menu_item));
g_return_if_fail (group_source == NULL || GTK_IS_RADIO_MENU_ITEM (group_source));
if (group_source != NULL)
{
GSList *group = gtk_radio_menu_item_get_group (group_source);
if (group == NULL)
{
/* if the group source does not have a group, we force one */
gtk_radio_menu_item_set_group (group_source, NULL);
group = gtk_radio_menu_item_get_group (group_source);
}
gtk_radio_menu_item_set_group (radio_menu_item, group);
}
else
gtk_radio_menu_item_set_group (radio_menu_item, NULL);
}
-4
View File
@@ -95,10 +95,6 @@ GDK_AVAILABLE_IN_ALL
void gtk_radio_menu_item_set_group (GtkRadioMenuItem *radio_menu_item,
GSList *group);
GDK_AVAILABLE_IN_3_18
void gtk_radio_menu_item_join_group (GtkRadioMenuItem *radio_menu_item,
GtkRadioMenuItem *group_source);
G_END_DECLS
#endif /* __GTK_RADIO_MENU_ITEM_H__ */
+8 -7
View File
@@ -1650,13 +1650,14 @@ gtk_range_realize (GtkWidget *widget)
attributes.height = allocation.height;
attributes.wclass = GDK_INPUT_ONLY;
attributes.event_mask = gtk_widget_get_events (widget);
attributes.event_mask |= GDK_BUTTON_PRESS_MASK |
GDK_BUTTON_RELEASE_MASK |
GDK_SCROLL_MASK |
GDK_SMOOTH_SCROLL_MASK |
GDK_ENTER_NOTIFY_MASK |
GDK_LEAVE_NOTIFY_MASK |
GDK_POINTER_MOTION_MASK;
attributes.event_mask |= (GDK_BUTTON_PRESS_MASK |
GDK_BUTTON_RELEASE_MASK |
GDK_SCROLL_MASK |
GDK_SMOOTH_SCROLL_MASK |
GDK_ENTER_NOTIFY_MASK |
GDK_LEAVE_NOTIFY_MASK |
GDK_POINTER_MOTION_MASK |
GDK_POINTER_MOTION_HINT_MASK);
attributes_mask = GDK_WA_X | GDK_WA_Y;
+1 -1
View File
@@ -1189,7 +1189,7 @@ gtk_render_icon_pixbuf (GtkStyleContext *context,
GtkIconSize size)
{
g_return_val_if_fail (GTK_IS_STYLE_CONTEXT (context), NULL);
g_return_val_if_fail (size > GTK_ICON_SIZE_INVALID || size == (GtkIconSize)-1, NULL);
g_return_val_if_fail (size > GTK_ICON_SIZE_INVALID || size == -1, NULL);
g_return_val_if_fail (source != NULL, NULL);
return gtk_do_render_icon_pixbuf (context, source, size);
+30 -34
View File
@@ -344,15 +344,18 @@ gtk_search_bar_get_property (GObject *object,
}
}
static void gtk_search_bar_set_entry (GtkSearchBar *bar,
GtkEntry *entry);
static void
gtk_search_bar_dispose (GObject *object)
{
GtkSearchBar *bar = GTK_SEARCH_BAR (object);
GtkSearchBarPrivate *priv = gtk_search_bar_get_instance_private (bar);
gtk_search_bar_set_entry (bar, NULL);
if (priv->entry)
{
g_signal_handlers_disconnect_by_func (priv->entry, entry_key_pressed_event_cb, bar);
g_object_remove_weak_pointer (G_OBJECT (priv->entry), (gpointer *) &priv->entry);
priv->entry = NULL;
}
G_OBJECT_CLASS (gtk_search_bar_parent_class)->dispose (object);
}
@@ -468,35 +471,6 @@ gtk_search_bar_new (void)
return g_object_new (GTK_TYPE_SEARCH_BAR, NULL);
}
static void
gtk_search_bar_set_entry (GtkSearchBar *bar,
GtkEntry *entry)
{
GtkSearchBarPrivate *priv = gtk_search_bar_get_instance_private (bar);
if (priv->entry != NULL)
{
if (GTK_IS_SEARCH_ENTRY (priv->entry))
g_signal_handlers_disconnect_by_func (priv->entry, stop_search_cb, bar);
else
g_signal_handlers_disconnect_by_func (priv->entry, entry_key_pressed_event_cb, bar);
g_object_remove_weak_pointer (G_OBJECT (priv->entry), (gpointer *) &priv->entry);
}
priv->entry = GTK_WIDGET (entry);
if (priv->entry != NULL)
{
g_object_add_weak_pointer (G_OBJECT (priv->entry), (gpointer *) &priv->entry);
if (GTK_IS_SEARCH_ENTRY (priv->entry))
g_signal_connect (priv->entry, "stop-search",
G_CALLBACK (stop_search_cb), bar);
else
g_signal_connect (priv->entry, "key-press-event",
G_CALLBACK (entry_key_pressed_event_cb), bar);
}
}
/**
* gtk_search_bar_connect_entry:
* @bar: a #GtkSearchBar
@@ -513,10 +487,32 @@ void
gtk_search_bar_connect_entry (GtkSearchBar *bar,
GtkEntry *entry)
{
GtkSearchBarPrivate *priv = gtk_search_bar_get_instance_private (bar);
g_return_if_fail (GTK_IS_SEARCH_BAR (bar));
g_return_if_fail (entry == NULL || GTK_IS_ENTRY (entry));
gtk_search_bar_set_entry (bar, entry);
if (priv->entry != NULL)
{
if (GTK_IS_SEARCH_ENTRY (priv->entry))
g_signal_handlers_disconnect_by_func (priv->entry, stop_search_cb, bar);
else
g_signal_handlers_disconnect_by_func (priv->entry, entry_key_pressed_event_cb, bar);
g_object_remove_weak_pointer (G_OBJECT (priv->entry), (gpointer *) &priv->entry);
priv->entry = NULL;
}
if (entry != NULL)
{
priv->entry = GTK_WIDGET (entry);
g_object_add_weak_pointer (G_OBJECT (priv->entry), (gpointer *) &priv->entry);
if (GTK_IS_SEARCH_ENTRY (priv->entry))
g_signal_connect (priv->entry, "stop-search",
G_CALLBACK (stop_search_cb), bar);
else
g_signal_connect (priv->entry, "key-press-event",
G_CALLBACK (entry_key_pressed_event_cb), bar);
}
}
/**
+18 -1
View File
@@ -23,9 +23,26 @@
G_BEGIN_DECLS
/*
* GtkQueueResizeFlags:
* @GTK_QUEUE_RESIZE_INVALIDATE_ONLY: invalidate all cached sizes
* as we would normally do when a widget is queued for resize,
* but dont actually add the toplevel resize container to the
* resize queue. Useful if we want to change the size of a widget
* see how that would affect the overall layout, then restore
* the old size.
*
* Flags that affect the operation of queueing a widget for resize.
*/
typedef enum
{
GTK_QUEUE_RESIZE_INVALIDATE_ONLY = 1 << 0
} GtkQueueResizeFlags;
GHashTable * _gtk_size_group_get_widget_peers (GtkWidget *for_widget,
GtkOrientation orientation);
void _gtk_size_group_queue_resize (GtkWidget *widget);
void _gtk_size_group_queue_resize (GtkWidget *widget,
GtkQueueResizeFlags flags);
G_END_DECLS
+20 -14
View File
@@ -203,7 +203,8 @@ _gtk_size_group_get_widget_peers (GtkWidget *for_widget,
}
static void
real_queue_resize (GtkWidget *widget)
real_queue_resize (GtkWidget *widget,
GtkQueueResizeFlags flags)
{
GtkWidget *container;
@@ -217,13 +218,17 @@ real_queue_resize (GtkWidget *widget)
if (container)
{
_gtk_container_queue_resize (GTK_CONTAINER (container));
if (flags & GTK_QUEUE_RESIZE_INVALIDATE_ONLY)
_gtk_container_resize_invalidate (GTK_CONTAINER (container));
else
_gtk_container_queue_resize (GTK_CONTAINER (container));
}
}
static void
queue_resize_on_widget (GtkWidget *widget,
gboolean check_siblings)
queue_resize_on_widget (GtkWidget *widget,
gboolean check_siblings,
GtkQueueResizeFlags flags)
{
GtkWidget *parent = widget;
@@ -236,7 +241,7 @@ queue_resize_on_widget (GtkWidget *widget,
if (widget == parent && !check_siblings)
{
real_queue_resize (widget);
real_queue_resize (widget, flags);
parent = gtk_widget_get_parent (parent);
continue;
}
@@ -245,7 +250,7 @@ queue_resize_on_widget (GtkWidget *widget,
if (!widget_groups)
{
if (widget == parent)
real_queue_resize (widget);
real_queue_resize (widget, flags);
parent = gtk_widget_get_parent (parent);
continue;
@@ -259,14 +264,14 @@ queue_resize_on_widget (GtkWidget *widget,
if (current == parent)
{
if (widget == parent)
real_queue_resize (parent);
real_queue_resize (parent, flags);
}
else if (current == widget)
{
g_warning ("A container and its child are part of this SizeGroup");
}
else
queue_resize_on_widget (current, FALSE);
queue_resize_on_widget (current, FALSE, flags);
}
g_hash_table_destroy (widgets);
@@ -279,14 +284,14 @@ queue_resize_on_widget (GtkWidget *widget,
if (current == parent)
{
if (widget == parent)
real_queue_resize (parent);
real_queue_resize (parent, flags);
}
else if (current == widget)
{
g_warning ("A container and its child are part of this SizeGroup");
}
else
queue_resize_on_widget (current, FALSE);
queue_resize_on_widget (current, FALSE, flags);
}
g_hash_table_destroy (widgets);
@@ -296,12 +301,12 @@ queue_resize_on_widget (GtkWidget *widget,
}
static void
queue_resize_on_group (GtkSizeGroup *size_group)
queue_resize_on_group (GtkSizeGroup *size_group)
{
GtkSizeGroupPrivate *priv = size_group->priv;
if (priv->widgets)
queue_resize_on_widget (priv->widgets->data, TRUE);
queue_resize_on_widget (priv->widgets->data, TRUE, 0);
}
static void
@@ -631,9 +636,10 @@ gtk_size_group_get_widgets (GtkSizeGroup *size_group)
* Queue a resize on a widget, and on all other widgets grouped with this widget.
**/
void
_gtk_size_group_queue_resize (GtkWidget *widget)
_gtk_size_group_queue_resize (GtkWidget *widget,
GtkQueueResizeFlags flags)
{
queue_resize_on_widget (widget, TRUE);
queue_resize_on_widget (widget, TRUE, flags);
}
typedef struct {
+1 -1
View File
@@ -1093,7 +1093,7 @@ gtk_spin_button_realize (GtkWidget *widget)
attributes.event_mask = gtk_widget_get_events (widget);
attributes.event_mask |= GDK_EXPOSURE_MASK | GDK_BUTTON_PRESS_MASK
| GDK_BUTTON_RELEASE_MASK | GDK_LEAVE_NOTIFY_MASK | GDK_ENTER_NOTIFY_MASK
| GDK_POINTER_MOTION_MASK;
| GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK;
attributes_mask = GDK_WA_X | GDK_WA_Y | GDK_WA_VISUAL;
+38 -24
View File
@@ -1193,6 +1193,37 @@ gtk_style_context_get_parent (GtkStyleContext *context)
return context->priv->parent;
}
/*
* gtk_style_context_save_to_node:
* @context: a #GtkStyleContext
* @node: the node to save to
*
* Saves the @context state, so temporary modifications done through
* gtk_style_context_add_class(), gtk_style_context_remove_class(),
* gtk_style_context_set_state(), etc. and rendering using
* gtk_render_background() or similar functions are done using the
* given @node.
*
* To undo, call gtk_style_context_restore().
*
* The matching call to gtk_style_context_restore() must be done
* before GTK returns to the main loop.
**/
void
gtk_style_context_save_to_node (GtkStyleContext *context,
GtkCssNode *node)
{
GtkStyleContextPrivate *priv;
g_return_if_fail (GTK_IS_STYLE_CONTEXT (context));
g_return_if_fail (GTK_IS_CSS_NODE (node));
priv = context->priv;
priv->saved_nodes = g_slist_prepend (priv->saved_nodes, priv->cssnode);
priv->cssnode = g_object_ref (node);
}
/**
* gtk_style_context_save:
* @context: a #GtkStyleContext
@@ -1226,8 +1257,9 @@ gtk_style_context_save (GtkStyleContext *context)
gtk_css_node_set_parent (cssnode, gtk_style_context_get_root (context));
gtk_css_node_set_widget_type (cssnode, gtk_css_node_get_widget_type (priv->cssnode));
priv->saved_nodes = g_slist_prepend (priv->saved_nodes, priv->cssnode);
priv->cssnode = cssnode;
gtk_style_context_save_to_node (context, cssnode);
g_object_unref (cssnode);
}
/**
@@ -1283,15 +1315,13 @@ gtk_style_context_add_class (GtkStyleContext *context,
const gchar *class_name)
{
GtkStyleContextPrivate *priv;
GQuark class_quark;
g_return_if_fail (GTK_IS_STYLE_CONTEXT (context));
g_return_if_fail (class_name != NULL);
priv = context->priv;
class_quark = g_quark_from_string (class_name);
gtk_css_node_add_class (priv->cssnode, class_quark);
gtk_css_node_add_class (priv->cssnode, class_name);
}
/**
@@ -1308,19 +1338,13 @@ gtk_style_context_remove_class (GtkStyleContext *context,
const gchar *class_name)
{
GtkStyleContextPrivate *priv;
GQuark class_quark;
g_return_if_fail (GTK_IS_STYLE_CONTEXT (context));
g_return_if_fail (class_name != NULL);
class_quark = g_quark_try_string (class_name);
if (!class_quark)
return;
priv = context->priv;
gtk_css_node_remove_class (priv->cssnode, class_quark);
gtk_css_node_remove_class (priv->cssnode, class_name);
}
/**
@@ -1340,19 +1364,13 @@ gtk_style_context_has_class (GtkStyleContext *context,
const gchar *class_name)
{
GtkStyleContextPrivate *priv;
GQuark class_quark;
g_return_val_if_fail (GTK_IS_STYLE_CONTEXT (context), FALSE);
g_return_val_if_fail (class_name != NULL, FALSE);
class_quark = g_quark_try_string (class_name);
if (!class_quark)
return FALSE;
priv = context->priv;
return gtk_css_node_has_class (priv->cssnode, class_quark);
return gtk_css_node_has_class (priv->cssnode, class_name);
}
static void
@@ -1383,16 +1401,12 @@ GList *
gtk_style_context_list_classes (GtkStyleContext *context)
{
GtkStyleContextPrivate *priv;
GList *classes;
g_return_val_if_fail (GTK_IS_STYLE_CONTEXT (context), NULL);
priv = context->priv;
classes = gtk_css_node_list_classes (priv->cssnode);
quarks_to_strings (classes);
return classes;
return gtk_css_node_list_classes (priv->cssnode);
}
/**
+3
View File
@@ -36,6 +36,9 @@ const char * gtk_style_context_get_id (GtkStyleContext *c
GtkStyleProviderPrivate *
gtk_style_context_get_style_provider (GtkStyleContext *context);
void gtk_style_context_save_to_node (GtkStyleContext *context,
GtkCssNode *node);
const GtkBitmask *
_gtk_style_context_get_changes (GtkStyleContext *context);
+177 -130
View File
@@ -42,15 +42,18 @@
#include "gtkswitch.h"
#include "deprecated/gtkactivatable.h"
#include "deprecated/gtktoggleaction.h"
#include "gtkintl.h"
#include "gtkprivate.h"
#include "deprecated/gtktoggleaction.h"
#include "gtkwidget.h"
#include "gtkmarshalers.h"
#include "gtkapplicationprivate.h"
#include "gtkactionable.h"
#include "a11y/gtkswitchaccessible.h"
#include "gtkactionhelper.h"
#include "gtkcssnodeprivate.h"
#include "gtkcssnodeutilsprivate.h"
#include "gtkstylecontextprivate.h"
#include "gtkwidgetprivate.h"
#include "fallback-c89.c"
@@ -66,6 +69,8 @@ struct _GtkSwitchPrivate
GtkGesture *pan_gesture;
GtkGesture *multipress_gesture;
GtkCssNode *slider_node;
double handle_pos;
gint64 start_time;
gint64 end_time;
@@ -254,9 +259,7 @@ gtk_switch_pan_gesture_pan (GtkGesturePan *gesture,
context = gtk_widget_get_style_context (widget);
state = gtk_widget_get_state_flags (widget);
gtk_style_context_save (context);
gtk_style_context_remove_class (context, GTK_STYLE_CLASS_TROUGH);
gtk_style_context_add_class (context, GTK_STYLE_CLASS_SLIDER);
gtk_style_context_save_to_node (context, priv->slider_node);
gtk_style_context_get_padding (context, state, &padding);
gtk_style_context_restore (context);
@@ -344,55 +347,99 @@ gtk_switch_activate (GtkSwitch *sw)
}
static void
gtk_switch_get_preferred_width (GtkWidget *widget,
gint *minimum,
gint *natural)
gtk_switch_get_slider_size (GtkCssNode *cssnode,
GtkOrientation orientation,
gint for_size,
gint *minimum,
gint *natural,
gint *minimum_baseline,
gint *natural_baseline,
gpointer data)
{
GtkStyleContext *context;
GtkStateFlags state;
GtkBorder padding;
gint width, slider_width;
PangoLayout *layout;
PangoRectangle logical_rect;
context = gtk_widget_get_style_context (widget);
state = gtk_style_context_get_state (context);
gtk_style_context_save (context);
gtk_style_context_remove_class (context, GTK_STYLE_CLASS_TROUGH);
gtk_style_context_add_class (context, GTK_STYLE_CLASS_SLIDER);
gtk_style_context_get_padding (context, state, &padding);
width = padding.left + padding.right;
gtk_style_context_restore (context);
GtkWidget *widget = GTK_WIDGET (data);
gint slider_width;
gtk_widget_style_get (widget,
"slider-width", &slider_width,
NULL);
if (orientation == GTK_ORIENTATION_VERTICAL)
slider_width *= 0.6;
*minimum = slider_width;
*natural = slider_width;
}
static void
gtk_switch_get_content_size (GtkCssNode *cssnode,
GtkOrientation orientation,
gint for_size,
gint *minimum,
gint *natural,
gint *minimum_baseline,
gint *natural_baseline,
gpointer data)
{
GtkWidget *widget;
GtkSwitch *self;
GtkSwitchPrivate *priv;
gint slider_minimum, slider_natural;
PangoLayout *layout;
PangoRectangle on_rect, off_rect;
widget = GTK_WIDGET (data);
self = GTK_SWITCH (data);
priv = self->priv;
gtk_css_node_get_preferred_size (priv->slider_node,
orientation,
-1,
&slider_minimum, &slider_natural,
NULL, NULL,
gtk_switch_get_slider_size,
self);
/* Translators: if the "on" state label requires more than three
* glyphs then use MEDIUM VERTICAL BAR (U+2759) as the text for
* the state
*/
layout = gtk_widget_create_pango_layout (widget, C_("switch", "ON"));
pango_layout_get_extents (layout, NULL, &logical_rect);
pango_extents_to_pixels (&logical_rect, NULL);
width += MAX (logical_rect.width, slider_width);
pango_layout_get_pixel_extents (layout, NULL, &on_rect);
/* Translators: if the "off" state label requires more than three
* glyphs then use WHITE CIRCLE (U+25CB) as the text for the state
*/
pango_layout_set_text (layout, C_("switch", "OFF"), -1);
pango_layout_get_extents (layout, NULL, &logical_rect);
pango_extents_to_pixels (&logical_rect, NULL);
width += MAX (logical_rect.width, slider_width);
pango_layout_get_pixel_extents (layout, NULL, &off_rect);
g_object_unref (layout);
*minimum = width;
*natural = width;
if (orientation == GTK_ORIENTATION_HORIZONTAL)
{
int text_width = MAX (on_rect.width, off_rect.width);
*minimum = 2 * MAX (slider_minimum, text_width);
*natural = 2 * MAX (slider_natural, text_width);
}
else
{
int text_height = MAX (on_rect.height, off_rect.height);
*minimum = MAX (slider_minimum, text_height);
*natural = MAX (slider_natural, text_height);
}
}
static void
gtk_switch_get_preferred_width (GtkWidget *widget,
gint *minimum,
gint *natural)
{
gtk_css_node_get_preferred_size (gtk_widget_get_css_node (widget),
GTK_ORIENTATION_HORIZONTAL,
-1,
minimum, natural,
NULL, NULL,
gtk_switch_get_content_size,
widget);
}
static void
@@ -400,47 +447,34 @@ gtk_switch_get_preferred_height (GtkWidget *widget,
gint *minimum,
gint *natural)
{
GtkStyleContext *context;
GtkStateFlags state;
GtkBorder padding;
gint height, slider_width, min_height;
PangoLayout *layout;
PangoRectangle logical_rect;
gchar *str;
gtk_css_node_get_preferred_size (gtk_widget_get_css_node (widget),
GTK_ORIENTATION_VERTICAL,
-1,
minimum, natural,
NULL, NULL,
gtk_switch_get_content_size,
widget);
}
context = gtk_widget_get_style_context (widget);
state = gtk_style_context_get_state (context);
static void
gtk_switch_allocate_contents (GtkCssNode *cssnode,
const GtkAllocation *allocation,
int baseline,
GtkAllocation *out_clip,
gpointer data)
{
GtkSwitch *self = data;
GtkSwitchPrivate *priv = self->priv;
gtk_style_context_save (context);
gtk_style_context_remove_class (context, GTK_STYLE_CLASS_TROUGH);
gtk_style_context_add_class (context, GTK_STYLE_CLASS_SLIDER);
gtk_style_context_get_padding (context, state, &padding);
height = padding.top + padding.bottom;
gtk_style_context_restore (context);
gtk_widget_style_get (widget,
"slider-width", &slider_width,
NULL);
min_height = slider_width * 0.6;
str = g_strdup_printf ("%s%s",
C_("switch", "ON"),
C_("switch", "OFF"));
layout = gtk_widget_create_pango_layout (widget, str);
pango_layout_get_extents (layout, NULL, &logical_rect);
pango_extents_to_pixels (&logical_rect, NULL);
height += MAX (min_height, logical_rect.height);
g_object_unref (layout);
g_free (str);
*minimum = height;
*natural = height;
/* We pretend to allocate the full area to the slider. That way both
* potential left and right clip overlap gets correctly computed.
*/
gtk_css_node_allocate (priv->slider_node,
allocation,
baseline,
out_clip,
NULL,
NULL);
}
static void
@@ -448,6 +482,7 @@ gtk_switch_size_allocate (GtkWidget *widget,
GtkAllocation *allocation)
{
GtkSwitchPrivate *priv = GTK_SWITCH (widget)->priv;
GtkAllocation clip;
gtk_widget_set_allocation (widget, allocation);
@@ -458,7 +493,14 @@ gtk_switch_size_allocate (GtkWidget *widget,
allocation->width,
allocation->height);
_gtk_widget_set_simple_clip (widget, NULL);
gtk_css_node_allocate (gtk_widget_get_css_node (widget),
allocation,
gtk_widget_get_allocated_baseline (widget),
&clip,
gtk_switch_allocate_contents,
widget);
gtk_widget_set_clip (widget, &clip);
}
static void
@@ -487,6 +529,7 @@ gtk_switch_realize (GtkWidget *widget)
attributes.event_mask |= (GDK_BUTTON_PRESS_MASK |
GDK_BUTTON_RELEASE_MASK |
GDK_BUTTON1_MOTION_MASK |
GDK_POINTER_MOTION_HINT_MASK |
GDK_POINTER_MOTION_MASK |
GDK_ENTER_NOTIFY_MASK |
GDK_LEAVE_NOTIFY_MASK);
@@ -542,9 +585,7 @@ gtk_switch_paint_handle (GtkWidget *widget,
{
GtkStyleContext *context = gtk_widget_get_style_context (widget);
gtk_style_context_save (context);
gtk_style_context_remove_class (context, GTK_STYLE_CLASS_TROUGH);
gtk_style_context_add_class (context, GTK_STYLE_CLASS_SLIDER);
gtk_style_context_save_to_node (context, GTK_SWITCH (widget)->priv->slider_node);
gtk_render_slider (context, cr,
box->x, box->y,
@@ -555,48 +596,31 @@ gtk_switch_paint_handle (GtkWidget *widget,
}
static gboolean
gtk_switch_draw (GtkWidget *widget,
cairo_t *cr)
gtk_switch_render_slider (GtkCssNode *cssnode,
cairo_t *cr,
int width,
int height,
gpointer data)
{
GtkWidget *widget = GTK_WIDGET (data);
return gtk_widget_has_visible_focus (widget);
}
static gboolean
gtk_switch_render_trough (GtkCssNode *cssnode,
cairo_t *cr,
int width,
int height,
gpointer data)
{
GtkWidget *widget = GTK_WIDGET (data);
GtkSwitchPrivate *priv = GTK_SWITCH (widget)->priv;
GtkStyleContext *context;
GdkRectangle handle;
GtkStyleContext *context = gtk_widget_get_style_context (widget);
PangoLayout *layout;
PangoRectangle rect;
gint label_x, label_y;
GtkBorder padding;
GtkStateFlags state;
gint x, y, width, height;
context = gtk_widget_get_style_context (widget);
state = gtk_widget_get_state_flags (widget);
gtk_style_context_save (context);
gtk_style_context_remove_class (context, GTK_STYLE_CLASS_TROUGH);
gtk_style_context_add_class (context, GTK_STYLE_CLASS_SLIDER);
gtk_style_context_get_padding (context, state, &padding);
gtk_style_context_restore (context);
x = 0;
y = 0;
width = gtk_widget_get_allocated_width (widget);
height = gtk_widget_get_allocated_height (widget);
gtk_render_background (context, cr, x, y, width, height);
gtk_render_frame (context, cr, x, y, width, height);
width -= padding.left + padding.right;
height -= padding.top + padding.bottom;
x += padding.left;
y += padding.top;
handle.y = y;
handle.width = width / 2;
handle.height = height;
gint slider_offset;
/* Translators: if the "on" state label requires more than three
* glyphs then use MEDIUM VERTICAL BAR (U+2759) as the text for
@@ -604,11 +628,10 @@ gtk_switch_draw (GtkWidget *widget,
*/
layout = gtk_widget_create_pango_layout (widget, C_("switch", "ON"));
pango_layout_get_extents (layout, NULL, &rect);
pango_extents_to_pixels (&rect, NULL);
pango_layout_get_pixel_extents (layout, NULL, &rect);
label_x = x + ((width / 2) - rect.width) / 2;
label_y = y + (height - rect.height) / 2;
label_x = ((width / 2) - rect.width) / 2;
label_y = (height - rect.height) / 2;
gtk_render_layout (context, cr, label_x, label_y, layout);
@@ -619,26 +642,40 @@ gtk_switch_draw (GtkWidget *widget,
*/
layout = gtk_widget_create_pango_layout (widget, C_("switch", "OFF"));
pango_layout_get_extents (layout, NULL, &rect);
pango_extents_to_pixels (&rect, NULL);
pango_layout_get_pixel_extents (layout, NULL, &rect);
label_x = x + (width / 2) + ((width / 2) - rect.width) / 2;
label_y = y + (height - rect.height) / 2;
label_x = (width / 2) + ((width / 2) - rect.width) / 2;
label_y = (height - rect.height) / 2;
gtk_render_layout (context, cr, label_x, label_y, layout);
g_object_unref (layout);
handle.x = x + round (priv->handle_pos * width / 2);
slider_offset = round (priv->handle_pos * (width - width / 2));
cairo_translate (cr, slider_offset, 0);
gtk_switch_paint_handle (widget, cr, &handle);
gtk_css_node_draw (priv->slider_node,
cr,
width / 2,
height,
gtk_switch_render_slider,
widget);
if (gtk_widget_has_visible_focus (widget))
{
gtk_render_focus (context, cr,
handle.x, handle.y,
handle.width, handle.height);
}
cairo_translate (cr, -slider_offset, 0);
return FALSE;
}
static gboolean
gtk_switch_draw (GtkWidget *widget,
cairo_t *cr)
{
gtk_css_node_draw (gtk_widget_get_css_node (widget),
cr,
gtk_widget_get_allocated_width (widget),
gtk_widget_get_allocated_height (widget),
gtk_switch_render_trough,
widget);
return FALSE;
}
@@ -994,6 +1031,7 @@ gtk_switch_init (GtkSwitch *self)
GtkSwitchPrivate *priv;
GtkStyleContext *context;
GtkGesture *gesture;
GtkCssNode *widget_node;
priv = self->priv = gtk_switch_get_instance_private (self);
@@ -1001,6 +1039,15 @@ gtk_switch_init (GtkSwitch *self)
gtk_widget_set_has_window (GTK_WIDGET (self), FALSE);
gtk_widget_set_can_focus (GTK_WIDGET (self), TRUE);
widget_node = gtk_widget_get_css_node (GTK_WIDGET (self));
priv->slider_node = gtk_css_node_new ();
gtk_css_node_set_widget_type (priv->slider_node, GTK_TYPE_SWITCH);
gtk_css_node_add_class (priv->slider_node, GTK_STYLE_CLASS_SLIDER);
gtk_css_node_set_parent (priv->slider_node, widget_node);
gtk_css_node_set_state (priv->slider_node, gtk_css_node_get_state (widget_node));
g_signal_connect_object (priv->slider_node, "style-changed", G_CALLBACK (gtk_css_node_style_changed_for_widget), self, 0);
g_object_unref (priv->slider_node);
gesture = gtk_gesture_multi_press_new (GTK_WIDGET (self));
gtk_gesture_single_set_touch_only (GTK_GESTURE_SINGLE (gesture), FALSE);
gtk_gesture_single_set_exclusive (GTK_GESTURE_SINGLE (gesture), TRUE);
+2 -2
View File
@@ -555,8 +555,8 @@ gtk_text_tag_class_init (GtkTextTagClass *klass)
g_object_class_install_property (object_class,
PROP_STRIKETHROUGH_RGBA,
g_param_spec_boxed ("strikethrough-rgba",
P_("Strikethrough RGBA"),
P_("Color of strikethrough for this text"),
P_("Strike-through RGBA"),
P_("Color of strike-through for this text"),
GDK_TYPE_RGBA,
GTK_PARAM_READWRITE));
+11 -10
View File
@@ -5992,7 +5992,7 @@ gtk_text_view_move_cursor (GtkTextView *text_view,
gtk_text_view_move_viewport (text_view, scroll_step, count);
if ((old_xpos == gtk_adjustment_get_target_value (priv->hadjustment) &&
old_ypos == gtk_adjustment_get_target_value (priv->vadjustment)) &&
leave_direction != (GtkDirectionType)-1 &&
leave_direction != -1 &&
!gtk_widget_keynav_failed (GTK_WIDGET (text_view),
leave_direction))
{
@@ -6165,7 +6165,7 @@ gtk_text_view_move_cursor (GtkTextView *text_view,
if (step == GTK_MOVEMENT_DISPLAY_LINES)
gtk_text_view_set_virtual_cursor_pos (text_view, cursor_x_pos, -1);
}
else if (leave_direction != (GtkDirectionType)-1)
else if (leave_direction != -1)
{
if (!gtk_widget_keynav_failed (GTK_WIDGET (text_view),
leave_direction))
@@ -9421,14 +9421,15 @@ text_window_realize (GtkTextWindow *win,
attributes.y = 0;
attributes.width = win->allocation.width;
attributes.height = win->allocation.height;
attributes.event_mask = gtk_widget_get_events (win->widget)
| GDK_EXPOSURE_MASK
| GDK_SCROLL_MASK
| GDK_SMOOTH_SCROLL_MASK
| GDK_KEY_PRESS_MASK
| GDK_BUTTON_PRESS_MASK
| GDK_BUTTON_RELEASE_MASK
| GDK_POINTER_MOTION_MASK;
attributes.event_mask = (GDK_EXPOSURE_MASK |
GDK_SCROLL_MASK |
GDK_SMOOTH_SCROLL_MASK |
GDK_KEY_PRESS_MASK |
GDK_BUTTON_PRESS_MASK |
GDK_BUTTON_RELEASE_MASK |
GDK_POINTER_MOTION_MASK |
GDK_POINTER_MOTION_HINT_MASK |
gtk_widget_get_events (win->widget));
win->bin_window = gdk_window_new (win->window,
&attributes,
+1 -1
View File
@@ -904,7 +904,7 @@ gtk_tooltip_set_last_window (GtkTooltip *tooltip,
tooltip->last_window = window;
if (tooltip->last_window)
if (window)
g_object_add_weak_pointer (G_OBJECT (tooltip->last_window),
(gpointer *) &tooltip->last_window);
+1
View File
@@ -1360,6 +1360,7 @@ _gtk_tree_view_column_realize_button (GtkTreeViewColumn *column)
(GDK_BUTTON_PRESS_MASK |
GDK_BUTTON_RELEASE_MASK |
GDK_POINTER_MOTION_MASK |
GDK_POINTER_MOTION_HINT_MASK |
GDK_KEY_PRESS_MASK);
attributes_mask = GDK_WA_CURSOR | GDK_WA_X | GDK_WA_Y;
attr.cursor = gdk_cursor_new_for_display
+69 -18
View File
@@ -925,7 +925,8 @@ static gboolean setup_template_child (GtkWidgetTemplat
static void gtk_widget_set_usize_internal (GtkWidget *widget,
gint width,
gint height);
gint height,
GtkQueueResizeFlags flags);
static void gtk_widget_add_events_internal (GtkWidget *widget,
GdkDevice *device,
@@ -3812,10 +3813,10 @@ gtk_widget_set_property (GObject *object,
gtk_container_add (GTK_CONTAINER (g_value_get_object (value)), widget);
break;
case PROP_WIDTH_REQUEST:
gtk_widget_set_usize_internal (widget, g_value_get_int (value), -2);
gtk_widget_set_usize_internal (widget, g_value_get_int (value), -2, 0);
break;
case PROP_HEIGHT_REQUEST:
gtk_widget_set_usize_internal (widget, -2, g_value_get_int (value));
gtk_widget_set_usize_internal (widget, -2, g_value_get_int (value), 0);
break;
case PROP_VISIBLE:
gtk_widget_set_visible (widget, g_value_get_boolean (value));
@@ -5747,7 +5748,7 @@ gtk_widget_queue_resize (GtkWidget *widget)
if (gtk_widget_get_realized (widget))
gtk_widget_queue_draw (widget);
_gtk_size_group_queue_resize (widget);
_gtk_size_group_queue_resize (widget, 0);
}
/**
@@ -5764,7 +5765,7 @@ gtk_widget_queue_resize_no_redraw (GtkWidget *widget)
{
g_return_if_fail (GTK_IS_WIDGET (widget));
_gtk_size_group_queue_resize (widget);
_gtk_size_group_queue_resize (widget, 0);
}
/**
@@ -10956,7 +10957,8 @@ gtk_widget_error_bell (GtkWidget *widget)
static void
gtk_widget_set_usize_internal (GtkWidget *widget,
gint width,
gint height)
gint height,
GtkQueueResizeFlags flags)
{
GtkWidgetAuxInfo *aux_info;
gboolean changed = FALSE;
@@ -10967,20 +10969,25 @@ gtk_widget_set_usize_internal (GtkWidget *widget,
if (width > -2 && aux_info->width != width)
{
g_object_notify (G_OBJECT (widget), "width-request");
if ((flags & GTK_QUEUE_RESIZE_INVALIDATE_ONLY) == 0)
g_object_notify (G_OBJECT (widget), "width-request");
aux_info->width = width;
changed = TRUE;
}
if (height > -2 && aux_info->height != height)
{
g_object_notify (G_OBJECT (widget), "height-request");
if ((flags & GTK_QUEUE_RESIZE_INVALIDATE_ONLY) == 0)
g_object_notify (G_OBJECT (widget), "height-request");
aux_info->height = height;
changed = TRUE;
}
if (gtk_widget_get_visible (widget) && changed)
{
gtk_widget_queue_resize (widget);
if ((flags & GTK_QUEUE_RESIZE_INVALIDATE_ONLY) == 0)
gtk_widget_queue_resize (widget);
else
_gtk_size_group_queue_resize (widget, GTK_QUEUE_RESIZE_INVALIDATE_ONLY);
}
g_object_thaw_notify (G_OBJECT (widget));
@@ -11037,7 +11044,7 @@ gtk_widget_set_size_request (GtkWidget *widget,
if (height == 0)
height = 1;
gtk_widget_set_usize_internal (widget, width, height);
gtk_widget_set_usize_internal (widget, width, height, 0);
}
@@ -11073,6 +11080,52 @@ gtk_widget_get_size_request (GtkWidget *widget,
*height = aux_info->height;
}
/**
* _gtk_widget_override_size_request:
* @widget: a #GtkWidget
* @width: new forced minimum width
* @height: new forced minimum height
* @old_width: location to store previous forced minimum width
* @old_height: location to store previous forced minumum height
*
* Temporarily establishes a forced minimum size for a widget; this
* is used by GtkWindow when calculating the size to add to the
* windows geometry widget. Cached sizes for the widget and its
* parents are invalidated, so that subsequent calls to the size
* negotiation machinery produce the overriden result, but the
* widget is not queued for relayout or redraw. The old size must
* be restored with _gtk_widget_restore_size_request() or things
* will go screwy.
*/
void
_gtk_widget_override_size_request (GtkWidget *widget,
int width,
int height,
int *old_width,
int *old_height)
{
gtk_widget_get_size_request (widget, old_width, old_height);
gtk_widget_set_usize_internal (widget, width, height,
GTK_QUEUE_RESIZE_INVALIDATE_ONLY);
}
/**
* _gtk_widget_restore_size_request:
* @widget: a #GtkWidget
* @old_width: saved forced minimum size
* @old_height: saved forced minimum size
*
* Undoes the operation of_gtk_widget_override_size_request().
*/
void
_gtk_widget_restore_size_request (GtkWidget *widget,
int old_width,
int old_height)
{
gtk_widget_set_usize_internal (widget, old_width, old_height,
GTK_QUEUE_RESIZE_INVALIDATE_ONLY);
}
/**
* gtk_widget_set_events:
* @widget: a #GtkWidget
@@ -15207,12 +15260,14 @@ gtk_widget_real_set_has_tooltip (GtkWidget *widget,
gdk_window_set_events (priv->window,
gdk_window_get_events (priv->window) |
GDK_LEAVE_NOTIFY_MASK |
GDK_POINTER_MOTION_MASK);
GDK_POINTER_MOTION_MASK |
GDK_POINTER_MOTION_HINT_MASK);
if (gtk_widget_get_has_window (widget))
gtk_widget_add_events (widget,
GDK_LEAVE_NOTIFY_MASK |
GDK_POINTER_MOTION_MASK);
GDK_POINTER_MOTION_MASK |
GDK_POINTER_MOTION_HINT_MASK);
}
g_object_set_qdata (G_OBJECT (widget), quark_has_tooltip,
@@ -16284,7 +16339,7 @@ gtk_widget_path_append_for_widget (GtkWidgetPath *path,
classes = gtk_css_node_list_classes (widget->priv->cssnode);
for (l = classes; l; l = l->next)
gtk_widget_path_iter_add_class (path, pos, g_quark_to_string (GPOINTER_TO_UINT (l->data)));
gtk_widget_path_iter_add_class (path, pos, l->data);
g_list_free (classes);
}
@@ -16347,18 +16402,14 @@ gtk_widget_get_path (GtkWidget *widget)
}
void
gtk_widget_clear_path (GtkWidget *widget)
_gtk_widget_style_context_invalidated (GtkWidget *widget)
{
if (widget->priv->path)
{
gtk_widget_path_free (widget->priv->path);
widget->priv->path = NULL;
}
}
void
_gtk_widget_style_context_invalidated (GtkWidget *widget)
{
if (gtk_widget_get_realized (widget))
g_signal_emit (widget, widget_signals[STYLE_UPDATED], 0);
else
+2 -2
View File
@@ -497,8 +497,8 @@ gtk_widget_path_iter_get_siblings (const GtkWidgetPath *path,
{
GtkPathElement *elem;
g_return_val_if_fail (path != NULL, NULL);
g_return_val_if_fail (path->elems->len != 0, NULL);
g_return_val_if_fail (path != NULL, G_TYPE_INVALID);
g_return_val_if_fail (path->elems->len != 0, G_TYPE_INVALID);
if (pos < 0 || pos >= path->elems->len)
pos = path->elems->len - 1;
+8 -1
View File
@@ -63,6 +63,14 @@ void _gtk_widget_add_attached_window (GtkWidget *widget,
void _gtk_widget_remove_attached_window (GtkWidget *widget,
GtkWindow *window);
void _gtk_widget_override_size_request (GtkWidget *widget,
int width,
int height,
int *old_width,
int *old_height);
void _gtk_widget_restore_size_request (GtkWidget *widget,
int old_width,
int old_height);
void _gtk_widget_get_preferred_size_for_size (GtkWidget *widget,
GtkOrientation orientation,
gint size,
@@ -140,7 +148,6 @@ gboolean _gtk_widget_captured_event (GtkWidget *widget,
GdkEvent *event);
GtkWidgetPath * _gtk_widget_create_path (GtkWidget *widget);
void gtk_widget_clear_path (GtkWidget *widget);
void _gtk_widget_invalidate_style_context (GtkWidget *widget,
GtkCssChange change);
void _gtk_widget_style_context_invalidated (GtkWidget *widget);
+108 -51
View File
@@ -227,7 +227,8 @@ struct _GtkWindowPrivate
guint gravity : 5; /* GdkGravity */
guint csd_requested : 1;
guint client_decorated : 1; /* Decorations drawn client-side */
guint use_client_shadow : 1; /* Decorations use client-side shadows */
guint custom_title : 1; /* app-provided titlebar if CSD can't
* be enabled */
guint maximized : 1;
guint fullscreen : 1;
guint tiled : 1;
@@ -335,6 +336,7 @@ struct _GtkWindowGeometryInfo
*/
GdkGeometry geometry; /* Geometry hints */
GdkWindowHints mask;
GtkWidget *widget; /* subwidget to which hints apply */
/* from last gtk_window_resize () - if > 0, indicates that
* we should resize to this size.
*/
@@ -3867,6 +3869,7 @@ gtk_window_get_geometry_info (GtkWindow *window,
info->last.configure_request.y = 0;
info->last.configure_request.width = -1;
info->last.configure_request.height = -1;
info->widget = NULL;
info->mask = 0;
priv->geometry_info = info;
}
@@ -3877,9 +3880,7 @@ gtk_window_get_geometry_info (GtkWindow *window,
/**
* gtk_window_set_geometry_hints:
* @window: a #GtkWindow
* @geometry_widget: (allow-none): widget the geometry hints used to be applied to
* or %NULL. Since 3.18 this argument is ignored and GTK behaves as if %NULL was
* set.
* @geometry_widget: (allow-none): widget the geometry hints will be applied to or %NULL
* @geometry: (allow-none): struct containing geometry information or %NULL
* @geom_mask: mask indicating which struct fields should be paid attention to
*
@@ -3902,6 +3903,17 @@ gtk_window_set_geometry_hints (GtkWindow *window,
info = gtk_window_get_geometry_info (window, TRUE);
if (info->widget)
g_signal_handlers_disconnect_by_func (info->widget,
gtk_widget_destroyed,
&info->widget);
info->widget = geometry_widget;
if (info->widget)
g_signal_connect (geometry_widget, "destroy",
G_CALLBACK (gtk_widget_destroyed),
&info->widget);
if (geometry)
info->geometry = *geometry;
@@ -3935,7 +3947,7 @@ unset_titlebar (GtkWindow *window)
}
static gboolean
gtk_window_supports_client_shadow (GtkWindow *window)
gtk_window_supports_csd (GtkWindow *window)
{
GtkWidget *widget = GTK_WIDGET (window);
@@ -3985,21 +3997,13 @@ gtk_window_enable_csd (GtkWindow *window)
GtkWidget *widget = GTK_WIDGET (window);
GdkVisual *visual;
/* We need a visual with alpha for client shadows */
if (priv->use_client_shadow)
{
visual = gdk_screen_get_rgba_visual (gtk_widget_get_screen (widget));
if (visual != NULL)
gtk_widget_set_visual (widget, visual);
gtk_style_context_add_class (gtk_widget_get_style_context (widget), GTK_STYLE_CLASS_CSD);
}
else
{
gtk_style_context_add_class (gtk_widget_get_style_context (widget), "solid-csd");
}
/* We need a visual with alpha */
visual = gdk_screen_get_rgba_visual (gtk_widget_get_screen (widget));
g_assert (visual != NULL);
gtk_widget_set_visual (widget, visual);
priv->client_decorated = TRUE;
gtk_style_context_add_class (gtk_widget_get_style_context (widget), GTK_STYLE_CLASS_CSD);
}
static void
@@ -4034,6 +4038,7 @@ gtk_window_set_titlebar (GtkWindow *window,
{
GtkWidget *widget = GTK_WIDGET (window);
GtkWindowPrivate *priv = window->priv;
GdkVisual *visual;
gboolean was_mapped;
g_return_if_fail (GTK_IS_WINDOW (window));
@@ -4054,15 +4059,18 @@ gtk_window_set_titlebar (GtkWindow *window,
if (titlebar == NULL)
{
priv->custom_title = FALSE;
priv->client_decorated = FALSE;
gtk_style_context_remove_class (gtk_widget_get_style_context (widget), GTK_STYLE_CLASS_CSD);
goto out;
}
priv->use_client_shadow = gtk_window_supports_client_shadow (window);
if (gtk_window_supports_csd (window))
gtk_window_enable_csd (window);
else
priv->custom_title = TRUE;
gtk_window_enable_csd (window);
priv->title_box = titlebar;
gtk_widget_set_parent (priv->title_box, widget);
if (GTK_IS_HEADER_BAR (titlebar))
@@ -4072,6 +4080,10 @@ gtk_window_set_titlebar (GtkWindow *window,
on_titlebar_title_notify (GTK_HEADER_BAR (titlebar), NULL, window);
}
visual = gdk_screen_get_rgba_visual (gtk_widget_get_screen (widget));
if (visual)
gtk_widget_set_visual (widget, visual);
gtk_style_context_add_class (gtk_widget_get_style_context (titlebar),
GTK_STYLE_CLASS_TITLEBAR);
@@ -4159,6 +4171,8 @@ gtk_window_set_decorated (GtkWindow *window,
{
if (priv->client_decorated)
gdk_window_set_decorations (gdk_window, 0);
else if (priv->custom_title)
gdk_window_set_decorations (gdk_window, GDK_DECOR_BORDER);
else
gdk_window_set_decorations (gdk_window, GDK_DECOR_ALL);
}
@@ -5637,6 +5651,10 @@ gtk_window_finalize (GObject *object)
if (priv->geometry_info)
{
if (priv->geometry_info->widget)
g_signal_handlers_disconnect_by_func (priv->geometry_info->widget,
gtk_widget_destroyed,
&priv->geometry_info->widget);
g_free (priv->geometry_info);
}
@@ -5791,8 +5809,7 @@ create_decoration (GtkWidget *widget)
GtkWindow *window = GTK_WINDOW (widget);
GtkWindowPrivate *priv = window->priv;
priv->use_client_shadow = gtk_window_supports_client_shadow (window);
if (!priv->use_client_shadow)
if (!gtk_window_supports_csd (window))
return;
gtk_window_enable_csd (window);
@@ -6609,7 +6626,7 @@ update_border_windows (GtkWindow *window)
border.right + handle, border.top + handle);
gdk_window_move_resize (priv->border_window[GDK_WINDOW_EDGE_SOUTH_WEST],
window_border.left - border.left, window_border.top + height - handle,
border.left + handle, border.bottom + handle);
window_border.left + handle, border.bottom + handle);
gdk_window_move_resize (priv->border_window[GDK_WINDOW_EDGE_SOUTH_EAST],
window_border.left + width - handle, window_border.top + height - handle,
border.right + handle, border.bottom + handle);
@@ -6875,7 +6892,7 @@ update_realized_window_properties (GtkWindow *window,
{
GtkWindowPrivate *priv = window->priv;
if (priv->client_decorated && priv->use_client_shadow)
if (priv->client_decorated)
update_shadow_width (window, window_border);
update_opaque_region (window, window_border, child_allocation);
@@ -7018,7 +7035,8 @@ gtk_window_realize (GtkWidget *widget)
GDK_FOCUS_CHANGE_MASK |
GDK_STRUCTURE_MASK);
if (priv->decorated && priv->client_decorated)
if (priv->decorated &&
(priv->client_decorated || priv->custom_title))
attributes.event_mask |= GDK_POINTER_MOTION_MASK;
attributes.type_hint = priv->type_hint;
@@ -7093,6 +7111,8 @@ gtk_window_realize (GtkWidget *widget)
if (!priv->decorated || priv->client_decorated)
gdk_window_set_decorations (gdk_window, 0);
else if (priv->custom_title)
gdk_window_set_decorations (gdk_window, GDK_DECOR_BORDER);
if (!priv->deletable)
gdk_window_set_functions (gdk_window, GDK_FUNC_ALL | GDK_FUNC_CLOSE);
@@ -9508,6 +9528,56 @@ gtk_window_compute_hints (GtkWindow *window,
*new_flags = 0;
}
if (geometry_info && geometry_info->widget)
{
/* If the geometry widget is set, then the hints really apply to that
* widget. This is pretty much meaningless unless the window layout
* is such that the rest of the window adds fixed size borders to
* the geometry widget. Our job is to figure the size of the borders;
* We do that by asking how big the toplevel would be if the
* geometry widget was *really big*.
*
* +----------+
* |AAAAAAAAA | At small sizes, the minimum sizes of widgets
* |GGGGG B| in the border can confuse things
* |GGGGG B|
* | B|
* +----------+
*
* +-----------+
* |AAAAAAAAA | When the geometry widget is large, things are
* |GGGGGGGGGGB| clearer.
* |GGGGGGGGGGB|
* |GGGGGGGGGG |
* +-----------+
*/
#define TEMPORARY_SIZE 10000 /* 10,000 pixels should be bigger than real widget sizes */
GtkRequisition req;
int current_width, current_height;
_gtk_widget_override_size_request (geometry_info->widget,
TEMPORARY_SIZE, TEMPORARY_SIZE,
&current_width, &current_height);
gtk_widget_get_preferred_size (widget,
&req, NULL);
_gtk_widget_restore_size_request (geometry_info->widget,
current_width, current_height);
extra_width = req.width - TEMPORARY_SIZE;
extra_height = req.height - TEMPORARY_SIZE;
if (extra_width < 0 || extra_height < 0)
{
g_warning("Toplevel size doesn't seem to directly depend on the "
"size of the geometry widget from gtk_window_set_geometry_hints(). "
"The geometry widget might not be in the window, or it might not "
"be packed into the window appropriately");
extra_width = MAX(extra_width, 0);
extra_height = MAX(extra_height, 0);
}
#undef TEMPORARY_SIZE
}
/* We don't want to set GDK_HINT_POS in here, we just set it
* in gtk_window_move_resize() when we want the position
* honored.
@@ -9619,31 +9689,18 @@ gtk_window_draw (GtkWidget *widget,
add_window_frame_style_class (context);
if (priv->use_client_shadow)
{
gtk_render_background (context, cr,
window_border.left, window_border.top,
allocation.width -
(window_border.left + window_border.right),
allocation.height -
(window_border.top + window_border.bottom));
gtk_render_frame (context, cr,
window_border.left, window_border.top,
allocation.width -
(window_border.left + window_border.right),
allocation.height -
(window_border.top + window_border.bottom));
}
else
{
gtk_render_background (context, cr, 0, 0,
allocation.width,
allocation.height);
gtk_render_frame (context, cr, 0, 0,
allocation.width,
allocation.height);
}
gtk_render_background (context, cr,
window_border.left, window_border.top,
allocation.width -
(window_border.left + window_border.right),
allocation.height -
(window_border.top + window_border.bottom));
gtk_render_frame (context, cr,
window_border.left, window_border.top,
allocation.width -
(window_border.left + window_border.right),
allocation.height -
(window_border.top + window_border.bottom));
gtk_style_context_restore (context);
}
@@ -10409,7 +10466,7 @@ gtk_window_set_screen (GtkWindow *window,
}
g_object_notify (G_OBJECT (window), "screen");
if (was_rgba && priv->use_client_shadow)
if (was_rgba)
{
GdkVisual *visual;
-7
View File
@@ -3227,13 +3227,6 @@ GtkVolumeButton.button { padding: 8px; }
0 0 0 1px transparentize($_wm_border,0.1);
}
}
&.solid-csd {
border-radius: 0;
margin: 4px;
background-color: $backdrop_bg_color;
border: solid 1px $backdrop_borders_color;
box-shadow: none;
}
}
// Window Close button
-6
View File
@@ -4245,12 +4245,6 @@ GtkVolumeButton.button, .header-bar GtkVolumeButton.button.titlebutton,
.window-frame.csd.message-dialog {
border-radius: 7px;
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2), 0 0 0 1px rgba(28, 31, 31, 0.8); }
.window-frame.solid-csd {
border-radius: 0;
margin: 4px;
background-color: #393f3f;
border: solid 1px #1e2222;
box-shadow: none; }
.header-bar .titlebutton.button,
.titlebar .titlebutton.button {
-6
View File
@@ -4417,12 +4417,6 @@ GtkVolumeButton.button, .header-bar GtkVolumeButton.button.titlebutton,
.window-frame.csd.message-dialog {
border-radius: 7px;
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2), 0 0 0 1px rgba(0, 0, 0, 0.13); }
.window-frame.solid-csd {
border-radius: 0;
margin: 4px;
background-color: #ededed;
border: solid 1px #a8a8a8;
box-shadow: none; }
.header-bar .titlebutton.button,
.titlebar .titlebutton.button {
+1 -8
View File
@@ -583,7 +583,7 @@ $_dot_color: $selected_bg_color;
&:backdrop {
color: $backdrop_fg_color;
@extend %undecorated_button;
&:hover { color: $selected_fg_color; background-color: $selected_bg_color; }
&:hover { color: $selected_fg_color; background-color: selected_bg_color; }
}
&:insensitive { color: $insensitive_fg_color; }
}
@@ -2260,13 +2260,6 @@ GtkColorChooserWidget #add-color-button {
box-shadow: none;
}
}
&.solid-csd {
border-radius: 0;
margin: 4px;
background-color: $backdrop_bg_color;
border: solid 1px $backdrop_borders_color;
box-shadow: none;
}
}
// Window Close button
+3 -8
View File
@@ -175,7 +175,8 @@
box-shadow: none; }
.label:insensitive, .label:backdrop:insensitive {
color: #7f7f7f; }
color: #7f7f7f;
background-color: white; }
/*********************
* Spinner Animation *
@@ -781,7 +782,7 @@
color: #000; }
.menuitem.button.flat:backdrop:hover {
color: #fff;
background-color: #000; }
background-color: selected_bg_color; }
.menuitem.button.flat:insensitive {
color: #7f7f7f; }
@@ -2511,12 +2512,6 @@ GtkColorChooserWidget #add-color-button {
.window-frame.csd.tooltip {
border-radius: 5px;
box-shadow: none; }
.window-frame.solid-csd {
border-radius: 0;
margin: 4px;
background-color: #fff;
border: solid 1px #8b8b8b;
box-shadow: none; }
.button.titlebutton {
padding: 8px;
-9
View File
@@ -872,12 +872,3 @@ GtkCalendar.button:hover {
.window-frame:backdrop {
box-shadow: 0 2px 5px 1px alpha(black, 0.5);
}
.window-frame.solid-csd {
border-radius: 0;
margin: 2px;
background-color: @bg_color;
border-style: outset;
border-width: 2px;
box-shadow: none;
}
-1
View File
@@ -118,7 +118,6 @@ gtk/gtkcolorscale.c
gtk/gtkcolorswatch.c
gtk/gtkcombobox.c
gtk/gtkcontainer.c
gtk/gtkcssnode.c
gtk/gtkcssprovider.c
gtk/gtkcssshorthandproperty.c
gtk/gtkcssstyleproperty.c
-3
View File
@@ -60,7 +60,6 @@ gtk/inspector/classes-list.ui
gtk/inspector/classes-list.ui.h
gtk/inspector/css-editor.ui
gtk/inspector/css-editor.ui.h
gtk/inspector/css-node-tree.ui
gtk/inspector/data-list.ui
gtk/inspector/data-list.ui.h
gtk/inspector/general.ui
@@ -168,8 +167,6 @@ testsuite/reftests/border-image-url.ref.ui
testsuite/reftests/border-image-url-scaled.ref.ui
testsuite/reftests/border-image-url-scaled.ui
testsuite/reftests/border-image-url.ui
testsuite/reftests/box-order.ref.ui
testsuite/reftests/box-order.ui
testsuite/reftests/box-packing.ui
testsuite/reftests/box-pseudo-classes.ref.ui
testsuite/reftests/box-pseudo-classes.ui
+2208 -2208
View File
File diff suppressed because it is too large Load Diff
+2229 -2261
View File
File diff suppressed because it is too large Load Diff
+2311 -2311
View File
File diff suppressed because it is too large Load Diff
+2209 -2216
View File
File diff suppressed because it is too large Load Diff
+1132 -932
View File
File diff suppressed because it is too large Load Diff
+294 -331
View File
File diff suppressed because it is too large Load Diff
+2783 -3737
View File
File diff suppressed because it is too large Load Diff
+292 -324
View File
File diff suppressed because it is too large Load Diff
-2
View File
@@ -118,7 +118,6 @@ gtk/gtkcolorscale.c
gtk/gtkcolorswatch.c
gtk/gtkcombobox.c
gtk/gtkcontainer.c
gtk/gtkcssnode.c
gtk/gtkcssprovider.c
gtk/gtkcssshorthandproperty.c
gtk/gtkcssstyleproperty.c
@@ -290,7 +289,6 @@ gtk/inspector/classes-list.c
gtk/inspector/classes-list.ui
gtk/inspector/css-editor.c
gtk/inspector/css-editor.ui
gtk/inspector/css-node-tree.ui
gtk/inspector/data-list.ui
gtk/inspector/general.c
gtk/inspector/general.ui
-2
View File
@@ -94,8 +94,6 @@ testsuite/reftests/border-image-url.ref.ui
testsuite/reftests/border-image-url-scaled.ref.ui
testsuite/reftests/border-image-url-scaled.ui
testsuite/reftests/border-image-url.ui
testsuite/reftests/box-order.ref.ui
testsuite/reftests/box-order.ui
testsuite/reftests/box-packing.ui
testsuite/reftests/box-pseudo-classes.ref.ui
testsuite/reftests/box-pseudo-classes.ui
+730 -156
View File
File diff suppressed because it is too large Load Diff
+1919 -2063
View File
File diff suppressed because it is too large Load Diff
+1670 -1673
View File
File diff suppressed because it is too large Load Diff
+1656 -1641
View File
File diff suppressed because it is too large Load Diff
+1666 -1704
View File
File diff suppressed because it is too large Load Diff
+194 -204
View File
File diff suppressed because it is too large Load Diff
+1742 -1973
View File
File diff suppressed because it is too large Load Diff
+282 -222
View File
File diff suppressed because it is too large Load Diff
+87 -95
View File
@@ -13,8 +13,8 @@ msgid ""
msgstr ""
"Project-Id-Version: gtk+\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2015-03-23 22:08+0000\n"
"PO-Revision-Date: 2015-03-24 09:52+0900\n"
"POT-Creation-Date: 2015-03-11 10:18+0000\n"
"PO-Revision-Date: 2015-03-12 02:52+0900\n"
"Last-Translator: Changwoo Ryu <cwryu@debian.org>\n"
"Language-Team: Gnome Korea <gnome-kr@googlegroups.com>\n"
"Language: Korean\n"
@@ -1060,10 +1060,6 @@ msgctxt "Stock label"
msgid "Zoom _Out"
msgstr "축소(_O)"
#: gtk/a11y/gtkmenubuttonaccessible.c:102 gtk/inspector/window.ui:356
msgid "Menu"
msgstr "메뉴"
#: gtk/a11y/gtkmenuitemaccessible.c:445
msgctxt "Action description"
msgid "Clicks the menuitem"
@@ -1241,7 +1237,7 @@ msgstr ""
#: gtk/gtkmountoperation.c:543 gtk/gtkpagesetupunixdialog.c:196
#: gtk/gtkprintbackend.c:763 gtk/gtkprinteroptionwidget.c:545
#: gtk/gtkprintunixdialog.c:665 gtk/gtkprintunixdialog.c:738
#: gtk/gtkwindow.c:11925 gtk/inspector/css-editor.c:199
#: gtk/gtkwindow.c:11917 gtk/inspector/css-editor.c:199
#: gtk/ui/gtkappchooserdialog.ui:79 gtk/ui/gtkassistant.ui:169
#: gtk/ui/gtkcolorchooserdialog.ui:38 gtk/ui/gtkfontchooserdialog.ui:35
msgid "_Cancel"
@@ -1290,7 +1286,7 @@ msgid "_Apply"
msgstr "적용(_A)"
#: gtk/deprecated/gtkfontsel.c:1698 gtk/gtkmessagedialog.c:936
#: gtk/gtkmessagedialog.c:958 gtk/gtkprintbackend.c:764 gtk/gtkwindow.c:11926
#: gtk/gtkmessagedialog.c:958 gtk/gtkprintbackend.c:764 gtk/gtkwindow.c:11918
#: gtk/inspector/classes-list.c:127
msgid "_OK"
msgstr "확인(_O)"
@@ -2145,31 +2141,31 @@ msgstr "오른쪽(_R):"
msgid "Paper Margins"
msgstr "용지 여백"
#: gtk/gtkentry.c:9615 gtk/gtkentry.c:9768 gtk/gtklabel.c:6596
#: gtk/gtkentry.c:9629 gtk/gtkentry.c:9782 gtk/gtklabel.c:6597
#: gtk/gtktextview.c:9037 gtk/gtktextview.c:9225
msgid "Cu_t"
msgstr "잘라내기(_T)"
#: gtk/gtkentry.c:9619 gtk/gtkentry.c:9771 gtk/gtklabel.c:6597
#: gtk/gtkentry.c:9633 gtk/gtkentry.c:9785 gtk/gtklabel.c:6598
#: gtk/gtktextview.c:9041 gtk/gtktextview.c:9229
msgid "_Copy"
msgstr "복사(_C)"
#: gtk/gtkentry.c:9623 gtk/gtkentry.c:9774 gtk/gtklabel.c:6598
#: gtk/gtkentry.c:9637 gtk/gtkentry.c:9788 gtk/gtklabel.c:6599
#: gtk/gtktextview.c:9043 gtk/gtktextview.c:9231
msgid "_Paste"
msgstr "붙여넣기(_P)"
#: gtk/gtkentry.c:9626 gtk/gtklabel.c:6600 gtk/gtktextview.c:9046
#: gtk/gtkentry.c:9640 gtk/gtklabel.c:6601 gtk/gtktextview.c:9046
msgid "_Delete"
msgstr "삭제(_D)"
#: gtk/gtkentry.c:9637 gtk/gtklabel.c:6609 gtk/gtktextview.c:9060
#: gtk/gtkentry.c:9651 gtk/gtklabel.c:6610 gtk/gtktextview.c:9060
msgid "Select _All"
msgstr "모두 선택(_A)"
# Caps Lock 키보드 위에 쓰여 있는 글이므로 번역/음역하지 않는다
#: gtk/gtkentry.c:10835
#: gtk/gtkentry.c:10849
msgid "Caps Lock is on"
msgstr "Caps Lock이 켜져 있습니다"
@@ -2189,7 +2185,7 @@ msgstr "(없음)"
msgid "_Open"
msgstr "열기(_O)"
#: gtk/gtkfilechooserbutton.c:2138
#: gtk/gtkfilechooserbutton.c:2137
msgid "Other…"
msgstr "기타…"
@@ -2285,7 +2281,7 @@ msgstr "폴더를 파일보다 앞에 정렬(_F)"
#. this is the header for the location column in the print dialog
#: gtk/gtkfilechooserwidget.c:2018 gtk/inspector/style-prop-list.ui:118
#: gtk/ui/gtkfilechooserwidget.ui:259 gtk/ui/gtkprintunixdialog.ui:135
#: gtk/ui/gtkfilechooserwidget.ui:259 gtk/ui/gtkprintunixdialog.ui:137
msgid "Location"
msgstr "위치"
@@ -2403,7 +2399,7 @@ msgstr "OpenGL 컨텍스트 만들기 실패"
msgid "Application menu"
msgstr "프로그램 메뉴"
#: gtk/gtkheaderbar.c:479 gtk/gtkwindow.c:8586
#: gtk/gtkheaderbar.c:479 gtk/gtkwindow.c:8591
msgid "Close"
msgstr "닫기"
@@ -2454,12 +2450,12 @@ msgid "Error"
msgstr "오류"
#. Open Link
#: gtk/gtklabel.c:6577
#: gtk/gtklabel.c:6578
msgid "_Open Link"
msgstr "링크 열기(_O)"
#. Copy Link Address
#: gtk/gtklabel.c:6586
#: gtk/gtklabel.c:6587
msgid "Copy _Link Address"
msgstr "링크 주소 복사(_L)"
@@ -2602,6 +2598,10 @@ msgstr "GTK+ 옵션 표시"
msgid "default:LTR"
msgstr "default:LTR"
#: gtk/gtkmenubutton.c:640 gtk/inspector/window.ui:356
msgid "Menu"
msgstr "메뉴"
#: gtk/gtkmessagedialog.c:948
msgid "_No"
msgstr "아니요(_N)"
@@ -2696,12 +2696,12 @@ msgstr "Z 셸"
msgid "Cannot end process with PID %d: %s"
msgstr "PID %d 프로세스를 끝낼 수 없습니다: %s"
#: gtk/gtknotebook.c:5173 gtk/gtknotebook.c:7904
#: gtk/gtknotebook.c:5167 gtk/gtknotebook.c:7896
#, c-format
msgid "Page %u"
msgstr "%u페이지"
#: gtk/gtkpagesetup.c:652 gtk/gtkpapersize.c:986 gtk/gtkpapersize.c:1026
#: gtk/gtkpagesetup.c:652 gtk/gtkpapersize.c:985 gtk/gtkpapersize.c:1025
msgid "Not a valid page setup file"
msgstr "올바른 페이지 설정 파일이 아닙니다"
@@ -2733,7 +2733,7 @@ msgid "Manage Custom Sizes…"
msgstr "사용자 설정 크기 관리…"
#: gtk/gtkpagesetupunixdialog.c:900 gtk/ui/gtkpagesetupunixdialog.ui:31
#: gtk/ui/gtkprintunixdialog.ui:1029
#: gtk/ui/gtkprintunixdialog.ui:1031
msgid "Page Setup"
msgstr "페이지 설정"
@@ -2930,7 +2930,7 @@ msgstr "빼기(_E)"
msgid "_Detect Media"
msgstr "미디어 검색(_D)"
#: gtk/gtkplacessidebar.c:4165
#: gtk/gtkplacessidebar.c:4167
msgid "Computer"
msgstr "컴퓨터"
@@ -3287,7 +3287,7 @@ msgstr "검색"
#. * glyphs then use MEDIUM VERTICAL BAR (U+2759) as the text for
#. * the state
#.
#: gtk/gtkswitch.c:379 gtk/gtkswitch.c:431 gtk/gtkswitch.c:605
#: gtk/gtkswitch.c:379 gtk/gtkswitch.c:431 gtk/gtkswitch.c:606
msgctxt "switch"
msgid "ON"
msgstr "켬"
@@ -3295,7 +3295,7 @@ msgstr "켬"
#. 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:387 gtk/gtkswitch.c:432 gtk/gtkswitch.c:620
#: gtk/gtkswitch.c:387 gtk/gtkswitch.c:432 gtk/gtkswitch.c:621
msgctxt "switch"
msgid "OFF"
msgstr "끔"
@@ -3482,12 +3482,12 @@ msgctxt "volume percentage"
msgid "%d%%"
msgstr "%d%%"
#: gtk/gtkwindow.c:11913
#: gtk/gtkwindow.c:11905
#, c-format
msgid "Do you want to use GTK+ Inspector?"
msgstr "GTK+ 인스펙터를 사용하시겠습니까?"
#: gtk/gtkwindow.c:11915
#: gtk/gtkwindow.c:11907
#, c-format
msgid ""
"GTK+ Inspector is an interactive debugger that lets you explore and modify "
@@ -3498,7 +3498,7 @@ msgstr ""
"그램의 내부 구조를 살펴 보거나 수정할 수 있습니다. GTK+ 인스펙터를 사용했을 "
"때 프로그램이 멈추거나 이상 동작으로 중지할 수도 있습니다."
#: gtk/gtkwindow.c:11920
#: gtk/gtkwindow.c:11912
msgid "Don't show this message again"
msgstr "이 메시지 다시 보지 않기"
@@ -3706,26 +3706,18 @@ msgid "Accessible role"
msgstr "접근성 역할"
#: gtk/inspector/misc-info.ui:507
msgid "Accessible name"
msgstr "접근성 이름"
#: gtk/inspector/misc-info.ui:541
msgid "Accessible description"
msgstr "접근성 설명"
#: gtk/inspector/misc-info.ui:575
msgid "Mapped"
msgstr "매핑됨"
#: gtk/inspector/misc-info.ui:611
#: gtk/inspector/misc-info.ui:543
msgid "Realized"
msgstr "실재화함"
#: gtk/inspector/misc-info.ui:647
#: gtk/inspector/misc-info.ui:579
msgid "Is Toplevel"
msgstr "최상위 여부"
#: gtk/inspector/misc-info.ui:683
#: gtk/inspector/misc-info.ui:615
msgid "Child Visible"
msgstr "하위 표시"
@@ -3928,7 +3920,7 @@ msgstr "자체"
msgid "Cumulative"
msgstr "누적"
#: gtk/inspector/statistics.ui:165
#: gtk/inspector/statistics.ui:164
msgid "Enable statistics with GOBJECT_DEBUG=instance-count"
msgstr "GOBJECT_DEBUG=instance-count 변수로 통계 기능 사용"
@@ -4144,7 +4136,7 @@ msgstr "리소스"
msgid "Visual"
msgstr "겉 모양"
#: gtk/inspector/window.ui:436 gtk/ui/gtkprintunixdialog.ui:497
#: gtk/inspector/window.ui:436 gtk/ui/gtkprintunixdialog.ui:499
msgid "General"
msgstr "일반"
@@ -5200,7 +5192,7 @@ msgstr "조건에 맞는 글꼴이 없습니다. 검색 조건을 바꿔서 다
msgid "_Format for:"
msgstr "다음 프린터에 대한 형식(_F):"
#: gtk/ui/gtkpagesetupunixdialog.ui:88 gtk/ui/gtkprintunixdialog.ui:901
#: gtk/ui/gtkpagesetupunixdialog.ui:88 gtk/ui/gtkprintunixdialog.ui:903
msgid "_Paper size:"
msgstr "용지 크기(_P):"
@@ -5208,19 +5200,19 @@ msgstr "용지 크기(_P):"
msgid "_Orientation:"
msgstr "방향(_O):"
#: gtk/ui/gtkpagesetupunixdialog.ui:179 gtk/ui/gtkprintunixdialog.ui:957
#: gtk/ui/gtkpagesetupunixdialog.ui:179 gtk/ui/gtkprintunixdialog.ui:959
msgid "Portrait"
msgstr "세로 방향"
#: gtk/ui/gtkpagesetupunixdialog.ui:229 gtk/ui/gtkprintunixdialog.ui:959
#: gtk/ui/gtkpagesetupunixdialog.ui:229 gtk/ui/gtkprintunixdialog.ui:961
msgid "Reverse portrait"
msgstr "뒤집힌 세로 방향"
#: gtk/ui/gtkpagesetupunixdialog.ui:279 gtk/ui/gtkprintunixdialog.ui:958
#: gtk/ui/gtkpagesetupunixdialog.ui:279 gtk/ui/gtkprintunixdialog.ui:960
msgid "Landscape"
msgstr "가로 방향"
#: gtk/ui/gtkpagesetupunixdialog.ui:328 gtk/ui/gtkprintunixdialog.ui:960
#: gtk/ui/gtkpagesetupunixdialog.ui:328 gtk/ui/gtkprintunixdialog.ui:962
msgid "Reverse landscape"
msgstr "뒤집힌 가로 방향"
@@ -5232,37 +5224,37 @@ msgstr "아래 경로"
msgid "Up Path"
msgstr "위 경로"
#: gtk/ui/gtkprintunixdialog.ui:124
#: gtk/ui/gtkprintunixdialog.ui:126
msgid "Printer"
msgstr "프린터"
#. this is the header for the printer status column in the print dialog
#: gtk/ui/gtkprintunixdialog.ui:146
#: gtk/ui/gtkprintunixdialog.ui:148
msgid "Status"
msgstr "상태"
#: gtk/ui/gtkprintunixdialog.ui:208
#: gtk/ui/gtkprintunixdialog.ui:210
msgid "Range"
msgstr "범위"
#: gtk/ui/gtkprintunixdialog.ui:231
#: gtk/ui/gtkprintunixdialog.ui:233
msgid "_All Pages"
msgstr "모든 페이지(_A)"
#: gtk/ui/gtkprintunixdialog.ui:249
#: gtk/ui/gtkprintunixdialog.ui:251
msgid "C_urrent Page"
msgstr "현재 페이지(_U)"
#: gtk/ui/gtkprintunixdialog.ui:269
#: gtk/ui/gtkprintunixdialog.ui:271
msgid "Se_lection"
msgstr "선택(_L)"
#: gtk/ui/gtkprintunixdialog.ui:288
#: gtk/ui/gtkprintunixdialog.ui:290
msgid "Pag_es:"
msgstr "페이지(_E):"
#: gtk/ui/gtkprintunixdialog.ui:292 gtk/ui/gtkprintunixdialog.ui:313
#: gtk/ui/gtkprintunixdialog.ui:320
#: gtk/ui/gtkprintunixdialog.ui:294 gtk/ui/gtkprintunixdialog.ui:315
#: gtk/ui/gtkprintunixdialog.ui:322
msgid ""
"Specify one or more page ranges,\n"
" e.g. 13, 7, 11"
@@ -5270,105 +5262,105 @@ msgstr ""
"페이지 범위를 지정하십시오.\n"
" 예) 13, 7, 11"
#: gtk/ui/gtkprintunixdialog.ui:319
#: gtk/ui/gtkprintunixdialog.ui:321
msgid "Pages"
msgstr "페이지"
#: gtk/ui/gtkprintunixdialog.ui:361
#: gtk/ui/gtkprintunixdialog.ui:363
msgid "Copies"
msgstr "인쇄 매수"
#: gtk/ui/gtkprintunixdialog.ui:388
#: gtk/ui/gtkprintunixdialog.ui:390
msgid "Copie_s:"
msgstr "인쇄 매수(_S):"
#: gtk/ui/gtkprintunixdialog.ui:418
#: gtk/ui/gtkprintunixdialog.ui:420
msgid "C_ollate"
msgstr "한 부씩 인쇄(_O)"
#: gtk/ui/gtkprintunixdialog.ui:436
#: gtk/ui/gtkprintunixdialog.ui:438
msgid "_Reverse"
msgstr "마지막 페이지부터(_R)"
#: gtk/ui/gtkprintunixdialog.ui:527
#: gtk/ui/gtkprintunixdialog.ui:529
msgid "Layout"
msgstr "배치"
#: gtk/ui/gtkprintunixdialog.ui:554
#: gtk/ui/gtkprintunixdialog.ui:556
msgid "T_wo-sided:"
msgstr "양면(_W):"
#: gtk/ui/gtkprintunixdialog.ui:587
#: gtk/ui/gtkprintunixdialog.ui:589
msgid "Pages per _side:"
msgstr "한 장당 페이지 수(_S):"
#: gtk/ui/gtkprintunixdialog.ui:622
#: gtk/ui/gtkprintunixdialog.ui:624
msgid "Page or_dering:"
msgstr "페이지 순서(_D):"
#: gtk/ui/gtkprintunixdialog.ui:656
#: gtk/ui/gtkprintunixdialog.ui:658
msgid "_Only print:"
msgstr "다음만 인쇄(_O):"
#: gtk/ui/gtkprintunixdialog.ui:676
#: gtk/ui/gtkprintunixdialog.ui:678
msgid "All sheets"
msgstr "모든 페이지"
#: gtk/ui/gtkprintunixdialog.ui:677
#: gtk/ui/gtkprintunixdialog.ui:679
msgid "Even sheets"
msgstr "짝수 페이지"
#: gtk/ui/gtkprintunixdialog.ui:678
#: gtk/ui/gtkprintunixdialog.ui:680
msgid "Odd sheets"
msgstr "홀수 페이지"
#: gtk/ui/gtkprintunixdialog.ui:694
#: gtk/ui/gtkprintunixdialog.ui:696
msgid "Sc_ale:"
msgstr "크기 조정(_A):"
#: gtk/ui/gtkprintunixdialog.ui:775
#: gtk/ui/gtkprintunixdialog.ui:777
msgid "Paper"
msgstr "용지"
#: gtk/ui/gtkprintunixdialog.ui:802
#: gtk/ui/gtkprintunixdialog.ui:804
msgid "Paper _type:"
msgstr "용지 종류(_T):"
#: gtk/ui/gtkprintunixdialog.ui:835
#: gtk/ui/gtkprintunixdialog.ui:837
msgid "Paper _source:"
msgstr "용지 공급(_S):"
#: gtk/ui/gtkprintunixdialog.ui:868
#: gtk/ui/gtkprintunixdialog.ui:870
msgid "Output t_ray:"
msgstr "출력 트레이(_R):"
#: gtk/ui/gtkprintunixdialog.ui:936
#: gtk/ui/gtkprintunixdialog.ui:938
msgid "Or_ientation:"
msgstr "방향(_I):"
#: gtk/ui/gtkprintunixdialog.ui:1054
#: gtk/ui/gtkprintunixdialog.ui:1056
msgid "Job Details"
msgstr "작업 상세 정보"
#: gtk/ui/gtkprintunixdialog.ui:1081
#: gtk/ui/gtkprintunixdialog.ui:1083
msgid "Pri_ority:"
msgstr "우선순위(_O):"
#: gtk/ui/gtkprintunixdialog.ui:1113
#: gtk/ui/gtkprintunixdialog.ui:1115
msgid "_Billing info:"
msgstr "요금 정보(_B):"
#: gtk/ui/gtkprintunixdialog.ui:1169
#: gtk/ui/gtkprintunixdialog.ui:1171
msgid "Print Document"
msgstr "문서 인쇄"
#. this is one of the choices for the print at option in the print dialog
#: gtk/ui/gtkprintunixdialog.ui:1192
#: gtk/ui/gtkprintunixdialog.ui:1194
msgid "_Now"
msgstr "지금(_N)"
#. this is one of the choices for the print at option in the print dialog. It also serves as the label for an entry that allows the user to enter a time.
#: gtk/ui/gtkprintunixdialog.ui:1211
#: gtk/ui/gtkprintunixdialog.ui:1213
msgid "A_t:"
msgstr "시각(_T):"
@@ -5376,9 +5368,9 @@ msgstr "시각(_T):"
# ( https://bugzilla.gnome.org/show_bug.cgi?id=568571 )
#
#. Ability to parse the am/pm format depends on actual locale. You can remove the am/pm values below for your locale if they are not supported.
#: gtk/ui/gtkprintunixdialog.ui:1216 gtk/ui/gtkprintunixdialog.ui:1218
#: gtk/ui/gtkprintunixdialog.ui:1240 gtk/ui/gtkprintunixdialog.ui:1242
#: gtk/ui/gtkprintunixdialog.ui:1249
#: gtk/ui/gtkprintunixdialog.ui:1218 gtk/ui/gtkprintunixdialog.ui:1220
#: gtk/ui/gtkprintunixdialog.ui:1242 gtk/ui/gtkprintunixdialog.ui:1244
#: gtk/ui/gtkprintunixdialog.ui:1251
msgid ""
"Specify the time of print,\n"
" e.g. 1530, 235 pm, 141520, 114630 am, 4 pm"
@@ -5386,58 +5378,58 @@ msgstr ""
"인쇄 시각을 지정합니다.\n"
" 예) 1530, 오후 235, 141520, 오전 114630, 오후 4"
#: gtk/ui/gtkprintunixdialog.ui:1248
#: gtk/ui/gtkprintunixdialog.ui:1250
msgid "Time of print"
msgstr "인쇄 시각"
#. this is one of the choices for the print at option in the print dialog. It means that the print job will not be printed until it explicitly gets 'released'.
#: gtk/ui/gtkprintunixdialog.ui:1264
#: gtk/ui/gtkprintunixdialog.ui:1266
msgid "On _hold"
msgstr "보류(_H)"
#: gtk/ui/gtkprintunixdialog.ui:1269 gtk/ui/gtkprintunixdialog.ui:1270
#: gtk/ui/gtkprintunixdialog.ui:1271 gtk/ui/gtkprintunixdialog.ui:1272
msgid "Hold the job until it is explicitly released"
msgstr "작업 보류, 직접 보류 상태를 풀 때까지"
#: gtk/ui/gtkprintunixdialog.ui:1314
#: gtk/ui/gtkprintunixdialog.ui:1316
msgid "Add Cover Page"
msgstr "표지 사용"
#. this is the label used for the option in the print dialog that controls the front cover page.
#: gtk/ui/gtkprintunixdialog.ui:1341
#: gtk/ui/gtkprintunixdialog.ui:1343
msgid "Be_fore:"
msgstr "앞에(_F):"
#. this is the label used for the option in the print dialog that controls the back cover page.
#: gtk/ui/gtkprintunixdialog.ui:1373
#: gtk/ui/gtkprintunixdialog.ui:1375
msgid "_After:"
msgstr "뒤에(_A):"
#: gtk/ui/gtkprintunixdialog.ui:1429
#: gtk/ui/gtkprintunixdialog.ui:1431
msgid "Job"
msgstr "작업"
#. This will appear as a tab label in the print dialog.
#: gtk/ui/gtkprintunixdialog.ui:1493
#: gtk/ui/gtkprintunixdialog.ui:1495
msgid "Image Quality"
msgstr "그림 화질"
#. This will appear as a tab label in the print dialog.
#: gtk/ui/gtkprintunixdialog.ui:1557
#: gtk/ui/gtkprintunixdialog.ui:1559
msgid "Color"
msgstr "색"
#. This will appear as a tab label in the print dialog.
#. It's a typographical term, as in "Binding and finishing"
#: gtk/ui/gtkprintunixdialog.ui:1621
#: gtk/ui/gtkprintunixdialog.ui:1623
msgid "Finishing"
msgstr "마무리"
#: gtk/ui/gtkprintunixdialog.ui:1667
#: gtk/ui/gtkprintunixdialog.ui:1669
msgid "Advanced"
msgstr "고급"
#: gtk/ui/gtkprintunixdialog.ui:1696
#: gtk/ui/gtkprintunixdialog.ui:1698
msgid "Some of the settings in the dialog conflict"
msgstr "대화 상자의 설정이 충돌합니다"
+2069 -3211
View File
File diff suppressed because it is too large Load Diff
+122 -130
View File
@@ -18,8 +18,8 @@ msgid ""
msgstr ""
"Project-Id-Version: gtk+\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2015-03-23 17:28+0100\n"
"PO-Revision-Date: 2015-03-23 17:29+0100\n"
"POT-Creation-Date: 2015-03-05 23:44+0100\n"
"PO-Revision-Date: 2015-03-05 23:47+0100\n"
"Last-Translator: Piotr Drąg <piotrdrag@gmail.com>\n"
"Language-Team: Polish <gnomepl@aviary.pl>\n"
"Language: pl\n"
@@ -94,7 +94,7 @@ msgstr "ZNACZNIKI"
msgid "GDK debugging flags to unset"
msgstr "Wyczyszczone znaczniki debugowania biblioteki GDK"
#: gdk/gdkwindow.c:2739
#: gdk/gdkwindow.c:2736
msgid "GL support disabled via GDK_DEBUG"
msgstr "Obsługa GL została wyłączona przez zmienną GDK_DEBUG"
@@ -1044,10 +1044,6 @@ msgctxt "Stock label"
msgid "Zoom _Out"
msgstr "Po_mniejsz"
#: gtk/a11y/gtkmenubuttonaccessible.c:102 gtk/inspector/window.ui:356
msgid "Menu"
msgstr "Menu"
#: gtk/a11y/gtkmenuitemaccessible.c:445
msgctxt "Action description"
msgid "Clicks the menuitem"
@@ -1226,7 +1222,7 @@ msgstr ""
#: gtk/gtkmountoperation.c:543 gtk/gtkpagesetupunixdialog.c:196
#: gtk/gtkprintbackend.c:763 gtk/gtkprinteroptionwidget.c:545
#: gtk/gtkprintunixdialog.c:665 gtk/gtkprintunixdialog.c:738
#: gtk/gtkwindow.c:11925 gtk/inspector/css-editor.c:199
#: gtk/gtkwindow.c:11907 gtk/inspector/css-editor.c:199
#: gtk/ui/gtkappchooserdialog.ui:79 gtk/ui/gtkassistant.ui:169
#: gtk/ui/gtkcolorchooserdialog.ui:38 gtk/ui/gtkfontchooserdialog.ui:35
msgid "_Cancel"
@@ -1275,7 +1271,7 @@ msgid "_Apply"
msgstr "_Zastosuj"
#: gtk/deprecated/gtkfontsel.c:1698 gtk/gtkmessagedialog.c:936
#: gtk/gtkmessagedialog.c:958 gtk/gtkprintbackend.c:764 gtk/gtkwindow.c:11926
#: gtk/gtkmessagedialog.c:958 gtk/gtkprintbackend.c:764 gtk/gtkwindow.c:11908
#: gtk/inspector/classes-list.c:127
msgid "_OK"
msgstr "_OK"
@@ -2132,30 +2128,30 @@ msgstr "_Prawy:"
msgid "Paper Margins"
msgstr "Marginesy papieru"
#: gtk/gtkentry.c:9615 gtk/gtkentry.c:9768 gtk/gtklabel.c:6596
#: gtk/gtkentry.c:9626 gtk/gtkentry.c:9779 gtk/gtklabel.c:6597
#: gtk/gtktextview.c:9037 gtk/gtktextview.c:9225
msgid "Cu_t"
msgstr "_Wytnij"
#: gtk/gtkentry.c:9619 gtk/gtkentry.c:9771 gtk/gtklabel.c:6597
#: gtk/gtkentry.c:9630 gtk/gtkentry.c:9782 gtk/gtklabel.c:6598
#: gtk/gtktextview.c:9041 gtk/gtktextview.c:9229
msgid "_Copy"
msgstr "S_kopiuj"
#: gtk/gtkentry.c:9623 gtk/gtkentry.c:9774 gtk/gtklabel.c:6598
#: gtk/gtkentry.c:9634 gtk/gtkentry.c:9785 gtk/gtklabel.c:6599
#: gtk/gtktextview.c:9043 gtk/gtktextview.c:9231
msgid "_Paste"
msgstr "Wk_lej"
#: gtk/gtkentry.c:9626 gtk/gtklabel.c:6600 gtk/gtktextview.c:9046
#: gtk/gtkentry.c:9637 gtk/gtklabel.c:6601 gtk/gtktextview.c:9046
msgid "_Delete"
msgstr "_Usuń"
#: gtk/gtkentry.c:9637 gtk/gtklabel.c:6609 gtk/gtktextview.c:9060
#: gtk/gtkentry.c:9648 gtk/gtklabel.c:6610 gtk/gtktextview.c:9060
msgid "Select _All"
msgstr "Z_aznacz wszystko"
#: gtk/gtkentry.c:10835
#: gtk/gtkentry.c:10848
msgid "Caps Lock is on"
msgstr "Klawisz Caps Lock jest włączony"
@@ -2175,7 +2171,7 @@ msgstr "(Brak)"
msgid "_Open"
msgstr "_Otwórz"
#: gtk/gtkfilechooserbutton.c:2138
#: gtk/gtkfilechooserbutton.c:2137
msgid "Other…"
msgstr "Inne…"
@@ -2378,7 +2374,7 @@ msgstr "Wybór czcionki"
#: gtk/gtkfontbutton.c:1182 gtk/inspector/general.c:226
#: gtk/inspector/general.c:227 gtk/inspector/gestures.c:128
#: gtk/inspector/prop-editor.c:1200 gtk/inspector/size-groups.c:252
#: modules/printbackends/cups/gtkprintbackendcups.c:5224
#: modules/printbackends/cups/gtkprintbackendcups.c:5208
msgid "None"
msgstr "Brak"
@@ -2390,7 +2386,7 @@ msgstr "Utworzenie kontekstu OpenGL się nie powiodło"
msgid "Application menu"
msgstr "Menu programu"
#: gtk/gtkheaderbar.c:479 gtk/gtkwindow.c:8586
#: gtk/gtkheaderbar.c:479 gtk/gtkwindow.c:8581
msgid "Close"
msgstr "Zamknij"
@@ -2441,12 +2437,12 @@ msgid "Error"
msgstr "Błąd"
#. Open Link
#: gtk/gtklabel.c:6577
#: gtk/gtklabel.c:6578
msgid "_Open Link"
msgstr "_Otwórz odnośnik"
#. Copy Link Address
#: gtk/gtklabel.c:6586
#: gtk/gtklabel.c:6587
msgid "Copy _Link Address"
msgstr "S_kopiuj adres odnośnika"
@@ -2589,6 +2585,10 @@ msgstr "Wyświetla opcje biblioteki GTK+"
msgid "default:LTR"
msgstr "default:LTR"
#: gtk/gtkmenubutton.c:640 gtk/inspector/window.ui:356
msgid "Menu"
msgstr "Menu"
#: gtk/gtkmessagedialog.c:948
msgid "_No"
msgstr "_Nie"
@@ -2683,12 +2683,12 @@ msgstr "Powłoka Z"
msgid "Cannot end process with PID %d: %s"
msgstr "Nie można zakończyć procesu o PID %d: %s"
#: gtk/gtknotebook.c:5173 gtk/gtknotebook.c:7904
#: gtk/gtknotebook.c:5165 gtk/gtknotebook.c:7893
#, c-format
msgid "Page %u"
msgstr "Strona %u"
#: gtk/gtkpagesetup.c:652 gtk/gtkpapersize.c:986 gtk/gtkpapersize.c:1026
#: gtk/gtkpagesetup.c:652 gtk/gtkpapersize.c:985 gtk/gtkpapersize.c:1025
msgid "Not a valid page setup file"
msgstr "Nieprawidłowy plik ustawień strony"
@@ -2916,7 +2916,7 @@ msgstr "Wy_suń"
msgid "_Detect Media"
msgstr "Wy_kryj nośnik"
#: gtk/gtkplacessidebar.c:4165
#: gtk/gtkplacessidebar.c:4167
msgid "Computer"
msgstr "Komputer"
@@ -3029,7 +3029,7 @@ msgstr "Brak papieru"
#. Translators: this is a printer status.
#: gtk/gtkprintoperation-win32.c:620
#: modules/printbackends/cups/gtkprintbackendcups.c:2509
#: modules/printbackends/cups/gtkprintbackendcups.c:2493
msgid "Paused"
msgstr "Wstrzymane"
@@ -3097,42 +3097,42 @@ msgstr "Pobieranie informacji o drukarce…"
#. * multiple pages on a sheet when printing
#.
#: gtk/gtkprintunixdialog.c:3101
#: modules/printbackends/cups/gtkprintbackendcups.c:5173
#: modules/printbackends/cups/gtkprintbackendcups.c:5157
msgid "Left to right, top to bottom"
msgstr "Od lewej do prawej, z góry do dołu"
#: gtk/gtkprintunixdialog.c:3101
#: modules/printbackends/cups/gtkprintbackendcups.c:5173
#: modules/printbackends/cups/gtkprintbackendcups.c:5157
msgid "Left to right, bottom to top"
msgstr "Od lewej do prawej, z dołu na górę"
#: gtk/gtkprintunixdialog.c:3102
#: modules/printbackends/cups/gtkprintbackendcups.c:5174
#: modules/printbackends/cups/gtkprintbackendcups.c:5158
msgid "Right to left, top to bottom"
msgstr "Od prawej do lewej, z góry na dół"
#: gtk/gtkprintunixdialog.c:3102
#: modules/printbackends/cups/gtkprintbackendcups.c:5174
#: modules/printbackends/cups/gtkprintbackendcups.c:5158
msgid "Right to left, bottom to top"
msgstr "Od prawej do lewej, z dołu na górę"
#: gtk/gtkprintunixdialog.c:3103
#: modules/printbackends/cups/gtkprintbackendcups.c:5175
#: modules/printbackends/cups/gtkprintbackendcups.c:5159
msgid "Top to bottom, left to right"
msgstr "Z góry do dołu, od lewej do prawej"
#: gtk/gtkprintunixdialog.c:3103
#: modules/printbackends/cups/gtkprintbackendcups.c:5175
#: modules/printbackends/cups/gtkprintbackendcups.c:5159
msgid "Top to bottom, right to left"
msgstr "Z góry do dołu, od prawej do lewej"
#: gtk/gtkprintunixdialog.c:3104
#: modules/printbackends/cups/gtkprintbackendcups.c:5176
#: modules/printbackends/cups/gtkprintbackendcups.c:5160
msgid "Bottom to top, left to right"
msgstr "Z dołu do góry, od lewej do prawej"
#: gtk/gtkprintunixdialog.c:3104
#: modules/printbackends/cups/gtkprintbackendcups.c:5176
#: modules/printbackends/cups/gtkprintbackendcups.c:5160
msgid "Bottom to top, right to left"
msgstr "Z dołu do góry, od prawej do lewej"
@@ -3140,7 +3140,7 @@ msgstr "Z dołu do góry, od prawej do lewej"
#. * dialog that controls in what order multiple pages are arranged
#.
#: gtk/gtkprintunixdialog.c:3108 gtk/gtkprintunixdialog.c:3121
#: modules/printbackends/cups/gtkprintbackendcups.c:5253
#: modules/printbackends/cups/gtkprintbackendcups.c:5237
msgid "Page Ordering"
msgstr "Kolejność stron"
@@ -3275,7 +3275,7 @@ msgstr "Wyszukaj"
#. * glyphs then use MEDIUM VERTICAL BAR (U+2759) as the text for
#. * the state
#.
#: gtk/gtkswitch.c:379 gtk/gtkswitch.c:431 gtk/gtkswitch.c:605
#: gtk/gtkswitch.c:379 gtk/gtkswitch.c:431 gtk/gtkswitch.c:606
msgctxt "switch"
msgid "ON"
msgstr "|"
@@ -3284,7 +3284,7 @@ msgstr "|"
#. 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:387 gtk/gtkswitch.c:432 gtk/gtkswitch.c:620
#: gtk/gtkswitch.c:387 gtk/gtkswitch.c:432 gtk/gtkswitch.c:621
msgctxt "switch"
msgid "OFF"
msgstr "◯"
@@ -3470,12 +3470,12 @@ msgctxt "volume percentage"
msgid "%d%%"
msgstr "%d%%"
#: gtk/gtkwindow.c:11913
#: gtk/gtkwindow.c:11895
#, c-format
msgid "Do you want to use GTK+ Inspector?"
msgstr "Użyć Inspektora biblioteki GTK+?"
#: gtk/gtkwindow.c:11915
#: gtk/gtkwindow.c:11897
#, c-format
msgid ""
"GTK+ Inspector is an interactive debugger that lets you explore and modify "
@@ -3486,7 +3486,7 @@ msgstr ""
"i modyfikowanie wnętrza programu GTK+. Jego użycie może spowodować awarię "
"lub uszkodzenie programu."
#: gtk/gtkwindow.c:11920
#: gtk/gtkwindow.c:11902
msgid "Don't show this message again"
msgstr "Bez wyświetlania ponownie"
@@ -3691,26 +3691,18 @@ msgid "Accessible role"
msgstr "Rola dostępności"
#: gtk/inspector/misc-info.ui:507
msgid "Accessible name"
msgstr "Nazwa dostępności"
#: gtk/inspector/misc-info.ui:541
msgid "Accessible description"
msgstr "Opis dostępności"
#: gtk/inspector/misc-info.ui:575
msgid "Mapped"
msgstr "Mapowane"
#: gtk/inspector/misc-info.ui:611
#: gtk/inspector/misc-info.ui:543
msgid "Realized"
msgstr "Zrealizowane"
#: gtk/inspector/misc-info.ui:647
#: gtk/inspector/misc-info.ui:579
msgid "Is Toplevel"
msgstr "Jest najwyższego poziomu"
#: gtk/inspector/misc-info.ui:683
#: gtk/inspector/misc-info.ui:615
msgid "Child Visible"
msgstr "Element potomny jest widoczny"
@@ -3913,7 +3905,7 @@ msgstr "Własny"
msgid "Cumulative"
msgstr "Przyrastający"
#: gtk/inspector/statistics.ui:165
#: gtk/inspector/statistics.ui:164
msgid "Enable statistics with GOBJECT_DEBUG=instance-count"
msgstr "Włączenie statystyk za pomocą zmiennej GOBJECT_DEBUG=instance-count"
@@ -4069,7 +4061,7 @@ msgstr "Wyświetla wszystkie zasoby"
#. Translators: "Miscellaneous" is the label for a button, that opens
#. up an extra panel of settings in a print dialog.
#: gtk/inspector/window.ui:257
#: modules/printbackends/cups/gtkprintbackendcups.c:4288
#: modules/printbackends/cups/gtkprintbackendcups.c:4272
msgid "Miscellaneous"
msgstr "Różne"
@@ -5668,253 +5660,253 @@ msgstr "Bezczynna"
msgid "Pages per _sheet:"
msgstr "Stron _na kartkę:"
#: modules/printbackends/cups/gtkprintbackendcups.c:1090
#: modules/printbackends/cups/gtkprintbackendcups.c:1399
#: modules/printbackends/cups/gtkprintbackendcups.c:1074
#: modules/printbackends/cups/gtkprintbackendcups.c:1383
msgid "Username:"
msgstr "Nazwa użytkownika:"
#: modules/printbackends/cups/gtkprintbackendcups.c:1091
#: modules/printbackends/cups/gtkprintbackendcups.c:1408
#: modules/printbackends/cups/gtkprintbackendcups.c:1075
#: modules/printbackends/cups/gtkprintbackendcups.c:1392
msgid "Password:"
msgstr "Hasło:"
#: modules/printbackends/cups/gtkprintbackendcups.c:1130
#: modules/printbackends/cups/gtkprintbackendcups.c:1421
#: modules/printbackends/cups/gtkprintbackendcups.c:1114
#: modules/printbackends/cups/gtkprintbackendcups.c:1405
#, c-format
msgid "Authentication is required to print document “%s” on printer %s"
msgstr ""
"Wymagane jest uwierzytelnienie, aby wydrukować dokument \"%s\" na drukarce %s"
#: modules/printbackends/cups/gtkprintbackendcups.c:1132
#: modules/printbackends/cups/gtkprintbackendcups.c:1116
#, c-format
msgid "Authentication is required to print a document on %s"
msgstr "Wymagane jest uwierzytelnienie, aby wydrukować dokument na %s"
#: modules/printbackends/cups/gtkprintbackendcups.c:1136
#: modules/printbackends/cups/gtkprintbackendcups.c:1120
#, c-format
msgid "Authentication is required to get attributes of job “%s”"
msgstr "Wymagane jest uwierzytelnienie, aby pobrać atrybuty zadania \"%s\""
#: modules/printbackends/cups/gtkprintbackendcups.c:1138
#: modules/printbackends/cups/gtkprintbackendcups.c:1122
msgid "Authentication is required to get attributes of a job"
msgstr "Wymagane jest uwierzytelnienie, aby pobrać atrybuty zadania"
#: modules/printbackends/cups/gtkprintbackendcups.c:1142
#: modules/printbackends/cups/gtkprintbackendcups.c:1126
#, c-format
msgid "Authentication is required to get attributes of printer %s"
msgstr "Wymagane jest uwierzytelnienie, aby pobrać atrybuty drukarki %s"
#: modules/printbackends/cups/gtkprintbackendcups.c:1144
#: modules/printbackends/cups/gtkprintbackendcups.c:1128
msgid "Authentication is required to get attributes of a printer"
msgstr "Wymagane jest uwierzytelnienie, aby pobrać atrybuty drukarki"
#: modules/printbackends/cups/gtkprintbackendcups.c:1147
#: modules/printbackends/cups/gtkprintbackendcups.c:1131
#, c-format
msgid "Authentication is required to get default printer of %s"
msgstr "Wymagane jest uwierzytelnienie, aby pobrać domyślną drukarkę z %s"
#: modules/printbackends/cups/gtkprintbackendcups.c:1150
#: modules/printbackends/cups/gtkprintbackendcups.c:1134
#, c-format
msgid "Authentication is required to get printers from %s"
msgstr "Wymagane jest uwierzytelnienie, aby pobrać drukarki od %s"
#: modules/printbackends/cups/gtkprintbackendcups.c:1155
#: modules/printbackends/cups/gtkprintbackendcups.c:1139
#, c-format
msgid "Authentication is required to get a file from %s"
msgstr "Wymagane jest uwierzytelnienie, aby pobrać plik z %s"
#: modules/printbackends/cups/gtkprintbackendcups.c:1157
#: modules/printbackends/cups/gtkprintbackendcups.c:1141
#, c-format
msgid "Authentication is required on %s"
msgstr "Wymagane jest uwierzytelnienie na %s"
#: modules/printbackends/cups/gtkprintbackendcups.c:1393
#: modules/printbackends/cups/gtkprintbackendcups.c:1377
msgid "Domain:"
msgstr "Domena:"
#: modules/printbackends/cups/gtkprintbackendcups.c:1423
#: modules/printbackends/cups/gtkprintbackendcups.c:1407
#, c-format
msgid "Authentication is required to print document “%s”"
msgstr "Wymagane jest uwierzytelnienie, aby wydrukować dokument \"%s\""
#: modules/printbackends/cups/gtkprintbackendcups.c:1428
#: modules/printbackends/cups/gtkprintbackendcups.c:1412
#, c-format
msgid "Authentication is required to print this document on printer %s"
msgstr ""
"Wymagane jest uwierzytelnienie, aby wydrukować ten dokument na drukarce %s"
#: modules/printbackends/cups/gtkprintbackendcups.c:1430
#: modules/printbackends/cups/gtkprintbackendcups.c:1414
msgid "Authentication is required to print this document"
msgstr "Wymagane jest uwierzytelnienie, aby wydrukować dokument"
#: modules/printbackends/cups/gtkprintbackendcups.c:1867
#: modules/printbackends/cups/gtkprintbackendcups.c:1851
#, c-format
msgid "Printer “%s” is low on toner."
msgstr "W drukarce \"%s\" kończy się toner."
#: modules/printbackends/cups/gtkprintbackendcups.c:1868
#: modules/printbackends/cups/gtkprintbackendcups.c:1852
#, c-format
msgid "Printer “%s” has no toner left."
msgstr "W drukarce \"%s\" skończył się toner."
#. Translators: "Developer" like on photo development context
#: modules/printbackends/cups/gtkprintbackendcups.c:1870
#: modules/printbackends/cups/gtkprintbackendcups.c:1854
#, c-format
msgid "Printer “%s” is low on developer."
msgstr "Niski poziom wywoływacza w drukarce \"%s\"."
#. Translators: "Developer" like on photo development context
#: modules/printbackends/cups/gtkprintbackendcups.c:1872
#: modules/printbackends/cups/gtkprintbackendcups.c:1856
#, c-format
msgid "Printer “%s” is out of developer."
msgstr "Brak wywoływacza w drukarce \"%s\"."
#. Translators: "marker" is one color bin of the printer
#: modules/printbackends/cups/gtkprintbackendcups.c:1874
#: modules/printbackends/cups/gtkprintbackendcups.c:1858
#, c-format
msgid "Printer “%s” is low on at least one marker supply."
msgstr "W drukarce \"%s\" kończy się co najmniej jedna składowa kolorów."
#. Translators: "marker" is one color bin of the printer
#: modules/printbackends/cups/gtkprintbackendcups.c:1876
#: modules/printbackends/cups/gtkprintbackendcups.c:1860
#, c-format
msgid "Printer “%s” is out of at least one marker supply."
msgstr "W drukarce \"%s\" skończyła się co najmniej jedna składowa kolorów."
#: modules/printbackends/cups/gtkprintbackendcups.c:1877
#: modules/printbackends/cups/gtkprintbackendcups.c:1861
#, c-format
msgid "The cover is open on printer “%s”."
msgstr "Pokrywa drukarki \"%s\" jest otwarta."
#: modules/printbackends/cups/gtkprintbackendcups.c:1878
#: modules/printbackends/cups/gtkprintbackendcups.c:1862
#, c-format
msgid "The door is open on printer “%s”."
msgstr "Drzwiczki drukarki \"%s\" są otwarte."
#: modules/printbackends/cups/gtkprintbackendcups.c:1879
#: modules/printbackends/cups/gtkprintbackendcups.c:1863
#, c-format
msgid "Printer “%s” is low on paper."
msgstr "W podajniku drukarki \"%s\" kończy się papier."
#: modules/printbackends/cups/gtkprintbackendcups.c:1880
#: modules/printbackends/cups/gtkprintbackendcups.c:1864
#, c-format
msgid "Printer “%s” is out of paper."
msgstr "W podajniku drukarki \"%s\" skończył się papier."
#: modules/printbackends/cups/gtkprintbackendcups.c:1881
#: modules/printbackends/cups/gtkprintbackendcups.c:1865
#, c-format
msgid "Printer “%s” is currently offline."
msgstr "Drukarka \"%s\" jest obecnie w trybie offline."
#: modules/printbackends/cups/gtkprintbackendcups.c:1882
#: modules/printbackends/cups/gtkprintbackendcups.c:1866
#, c-format
msgid "There is a problem on printer “%s”."
msgstr "Wystąpił problem z drukarką \"%s\"."
#. Translators: this is a printer status.
#: modules/printbackends/cups/gtkprintbackendcups.c:2506
#: modules/printbackends/cups/gtkprintbackendcups.c:2490
msgid "Paused; Rejecting Jobs"
msgstr "Wstrzymana, Odrzuca zadania"
#. Translators: this is a printer status.
#: modules/printbackends/cups/gtkprintbackendcups.c:2512
#: modules/printbackends/cups/gtkprintbackendcups.c:2496
msgid "Rejecting Jobs"
msgstr "Odrzuca zadania"
#. Translators: this string connects multiple printer states together.
#: modules/printbackends/cups/gtkprintbackendcups.c:2554
#: modules/printbackends/cups/gtkprintbackendcups.c:2538
msgid "; "
msgstr ", "
#: modules/printbackends/cups/gtkprintbackendcups.c:4239
#: modules/printbackends/cups/gtkprintbackendcups.c:4306
#: modules/printbackends/cups/gtkprintbackendcups.c:4223
#: modules/printbackends/cups/gtkprintbackendcups.c:4290
msgid "Two Sided"
msgstr "Dwustronne"
#: modules/printbackends/cups/gtkprintbackendcups.c:4240
#: modules/printbackends/cups/gtkprintbackendcups.c:4224
msgid "Paper Type"
msgstr "Rodzaj papieru"
#: modules/printbackends/cups/gtkprintbackendcups.c:4241
#: modules/printbackends/cups/gtkprintbackendcups.c:4225
msgid "Paper Source"
msgstr "Źródło papieru"
#: modules/printbackends/cups/gtkprintbackendcups.c:4242
#: modules/printbackends/cups/gtkprintbackendcups.c:4226
msgid "Output Tray"
msgstr "Tacka wyjściowa"
#: modules/printbackends/cups/gtkprintbackendcups.c:4243
#: modules/printbackends/cups/gtkprintbackendcups.c:4227
msgid "Resolution"
msgstr "Rozdzielczość"
#: modules/printbackends/cups/gtkprintbackendcups.c:4244
#: modules/printbackends/cups/gtkprintbackendcups.c:4228
msgid "GhostScript pre-filtering"
msgstr "Wstępne filtrowanie GhostScript"
#: modules/printbackends/cups/gtkprintbackendcups.c:4253
#: modules/printbackends/cups/gtkprintbackendcups.c:4237
msgid "One Sided"
msgstr "Jednostronne"
#. Translators: this is an option of "Two Sided"
#: modules/printbackends/cups/gtkprintbackendcups.c:4255
#: modules/printbackends/cups/gtkprintbackendcups.c:4239
msgid "Long Edge (Standard)"
msgstr "Grzbiet wzdłuż dłuższej krawędzi (standard)"
#. Translators: this is an option of "Two Sided"
#: modules/printbackends/cups/gtkprintbackendcups.c:4257
#: modules/printbackends/cups/gtkprintbackendcups.c:4241
msgid "Short Edge (Flip)"
msgstr "Grzbiet wzdłuż krótszej krawędzi (obrót)"
#. Translators: this is an option of "Paper Source"
#: modules/printbackends/cups/gtkprintbackendcups.c:4259
#: modules/printbackends/cups/gtkprintbackendcups.c:4261
#: modules/printbackends/cups/gtkprintbackendcups.c:4269
#: modules/printbackends/cups/gtkprintbackendcups.c:4243
#: modules/printbackends/cups/gtkprintbackendcups.c:4245
#: modules/printbackends/cups/gtkprintbackendcups.c:4253
msgid "Auto Select"
msgstr "Wybór automatyczny"
#. Translators: this is an option of "Paper Source"
#. Translators: this is an option of "Resolution"
#: modules/printbackends/cups/gtkprintbackendcups.c:4263
#: modules/printbackends/cups/gtkprintbackendcups.c:4265
#: modules/printbackends/cups/gtkprintbackendcups.c:4267
#: modules/printbackends/cups/gtkprintbackendcups.c:4271
#: modules/printbackends/cups/gtkprintbackendcups.c:4778
#: modules/printbackends/cups/gtkprintbackendcups.c:4247
#: modules/printbackends/cups/gtkprintbackendcups.c:4249
#: modules/printbackends/cups/gtkprintbackendcups.c:4251
#: modules/printbackends/cups/gtkprintbackendcups.c:4255
#: modules/printbackends/cups/gtkprintbackendcups.c:4762
msgid "Printer Default"
msgstr "Domyślne drukarki"
#. Translators: this is an option of "GhostScript"
#: modules/printbackends/cups/gtkprintbackendcups.c:4273
#: modules/printbackends/cups/gtkprintbackendcups.c:4257
msgid "Embed GhostScript fonts only"
msgstr "Osadzanie tylko czcionek GhostScript"
#. Translators: this is an option of "GhostScript"
#: modules/printbackends/cups/gtkprintbackendcups.c:4275
#: modules/printbackends/cups/gtkprintbackendcups.c:4259
msgid "Convert to PS level 1"
msgstr "Konwertowanie do PS level 1"
#. Translators: this is an option of "GhostScript"
#: modules/printbackends/cups/gtkprintbackendcups.c:4277
#: modules/printbackends/cups/gtkprintbackendcups.c:4261
msgid "Convert to PS level 2"
msgstr "Konwertowanie do PS level 2"
#. Translators: this is an option of "GhostScript"
#: modules/printbackends/cups/gtkprintbackendcups.c:4279
#: modules/printbackends/cups/gtkprintbackendcups.c:4263
msgid "No pre-filtering"
msgstr "Bez wstępnego filtrowania"
#: modules/printbackends/cups/gtkprintbackendcups.c:4314
#: modules/printbackends/cups/gtkprintbackendcups.c:4298
msgctxt "sides"
msgid "One Sided"
msgstr "Jednostronne"
#. Translators: this is an option of "Two Sided"
#: modules/printbackends/cups/gtkprintbackendcups.c:4316
#: modules/printbackends/cups/gtkprintbackendcups.c:4300
msgctxt "sides"
msgid "Long Edge (Standard)"
msgstr "Grzbiet wzdłuż dłuższej krawędzi (standard)"
#. Translators: this is an option of "Two Sided"
#: modules/printbackends/cups/gtkprintbackendcups.c:4318
#: modules/printbackends/cups/gtkprintbackendcups.c:4302
msgctxt "sides"
msgid "Short Edge (Flip)"
msgstr "Grzbiet wzdłuż krótszej krawędzi (obrót)"
@@ -5922,78 +5914,78 @@ msgstr "Grzbiet wzdłuż krótszej krawędzi (obrót)"
#. Translators: These strings name the possible values of the
#. * job priority option in the print dialog
#.
#: modules/printbackends/cups/gtkprintbackendcups.c:5168
#: modules/printbackends/cups/gtkprintbackendcups.c:5152
msgid "Urgent"
msgstr "Ważne"
#: modules/printbackends/cups/gtkprintbackendcups.c:5168
#: modules/printbackends/cups/gtkprintbackendcups.c:5152
msgid "High"
msgstr "Wysoki"
#: modules/printbackends/cups/gtkprintbackendcups.c:5168
#: modules/printbackends/cups/gtkprintbackendcups.c:5152
msgid "Medium"
msgstr "Średni"
#: modules/printbackends/cups/gtkprintbackendcups.c:5168
#: modules/printbackends/cups/gtkprintbackendcups.c:5152
msgid "Low"
msgstr "Niski"
#. Translators, this string is used to label the job priority option
#. * in the print dialog
#.
#: modules/printbackends/cups/gtkprintbackendcups.c:5198
#: modules/printbackends/cups/gtkprintbackendcups.c:5182
msgid "Job Priority"
msgstr "Priorytet"
#. Translators, this string is used to label the billing info entry
#. * in the print dialog
#.
#: modules/printbackends/cups/gtkprintbackendcups.c:5209
#: modules/printbackends/cups/gtkprintbackendcups.c:5193
msgid "Billing Info"
msgstr "Informacje o opłatach"
#: modules/printbackends/cups/gtkprintbackendcups.c:5224
#: modules/printbackends/cups/gtkprintbackendcups.c:5208
msgid "Classified"
msgstr "Sklasyfikowane"
#: modules/printbackends/cups/gtkprintbackendcups.c:5224
#: modules/printbackends/cups/gtkprintbackendcups.c:5208
msgid "Confidential"
msgstr "Poufne"
#: modules/printbackends/cups/gtkprintbackendcups.c:5224
#: modules/printbackends/cups/gtkprintbackendcups.c:5208
msgid "Secret"
msgstr "Tajne"
#: modules/printbackends/cups/gtkprintbackendcups.c:5224
#: modules/printbackends/cups/gtkprintbackendcups.c:5208
msgid "Standard"
msgstr "Standardowe"
#: modules/printbackends/cups/gtkprintbackendcups.c:5224
#: modules/printbackends/cups/gtkprintbackendcups.c:5208
msgid "Top Secret"
msgstr "Ściśle tajne"
#: modules/printbackends/cups/gtkprintbackendcups.c:5224
#: modules/printbackends/cups/gtkprintbackendcups.c:5208
msgid "Unclassified"
msgstr "Niesklasyfikowane"
#. Translators, this string is used to label the pages-per-sheet option
#. * in the print dialog
#.
#: modules/printbackends/cups/gtkprintbackendcups.c:5235
#: modules/printbackends/cups/gtkprintbackendcups.c:5219
msgid "Pages per Sheet"
msgstr "Stron na kartkę"
#. Translators, this is the label used for the option in the print
#. * dialog that controls the front cover page.
#.
#: modules/printbackends/cups/gtkprintbackendcups.c:5295
#: modules/printbackends/cups/gtkprintbackendcups.c:5279
msgid "Before"
msgstr "Przed"
#. Translators, this is the label used for the option in the print
#. * dialog that controls the back cover page.
#.
#: modules/printbackends/cups/gtkprintbackendcups.c:5310
#: modules/printbackends/cups/gtkprintbackendcups.c:5294
msgid "After"
msgstr "Po"
@@ -6001,14 +5993,14 @@ msgstr "Po"
#. * a print job is printed. Possible values are 'now', a specified time,
#. * or 'on hold'
#.
#: modules/printbackends/cups/gtkprintbackendcups.c:5330
#: modules/printbackends/cups/gtkprintbackendcups.c:5314
msgid "Print at"
msgstr "Wydruk o"
#. Translators: this is the name of the option that allows the user
#. * to specify a time when a print job will be printed.
#.
#: modules/printbackends/cups/gtkprintbackendcups.c:5341
#: modules/printbackends/cups/gtkprintbackendcups.c:5325
msgid "Print at time"
msgstr "Wydruk o czasie"
@@ -6017,17 +6009,17 @@ msgstr "Wydruk o czasie"
#. * the width and height in points. E.g: "Custom
#. * 230.4x142.9"
#.
#: modules/printbackends/cups/gtkprintbackendcups.c:5383
#: modules/printbackends/cups/gtkprintbackendcups.c:5367
#, c-format
msgid "Custom %s×%s"
msgstr "Własny %s×%s"
#: modules/printbackends/cups/gtkprintbackendcups.c:5484
#: modules/printbackends/cups/gtkprintbackendcups.c:5468
msgid "Printer Profile"
msgstr "Profil drukarki"
#. TRANSLATORS: this is when color profile information is unavailable
#: modules/printbackends/cups/gtkprintbackendcups.c:5491
#: modules/printbackends/cups/gtkprintbackendcups.c:5475
msgid "Unavailable"
msgstr "Niedostępne"
+3223 -2831
View File
File diff suppressed because it is too large Load Diff
-6
View File
@@ -34,7 +34,6 @@ noinst_PROGRAMS = $(TEST_PROGS) \
animated-revealing \
motion-compression \
scrolling-performance \
blur-performance \
simple \
flicker \
print-editor \
@@ -188,7 +187,6 @@ animated_revealing_DEPENDENCIES = $(TEST_DEPS)
flicker_DEPENDENCIES = $(TEST_DEPS)
motion_compression_DEPENDENCIES = $(TEST_DEPS)
scrolling_performance_DEPENDENCIES = $(TEST_DEPS)
blur_performance_DEPENDENCIES = $(TEST_DEPS)
simple_DEPENDENCIES = $(TEST_DEPS)
print_editor_DEPENDENCIES = $(TEST_DEPS)
video_timer_DEPENDENCIES = $(TEST_DEPS)
@@ -320,10 +318,6 @@ scrolling_performance_SOURCES = \
variable.c \
variable.h
blur_performance_SOURCES = \
blur-performance.c \
../gtk/gtkcairoblur.c
video_timer_SOURCES = \
video-timer.c \
variable.c \
-54
View File
@@ -1,54 +0,0 @@
/* -*- mode: C; c-basic-offset: 2; indent-tabs-mode: nil; -*- */
#include <gtk/gtkcairoblurprivate.h>
static void
init_surface (cairo_t *cr)
{
int w = cairo_image_surface_get_width (cairo_get_target (cr));
int h = cairo_image_surface_get_height (cairo_get_target (cr));
cairo_set_source_rgb (cr, 0, 0, 0);
cairo_fill (cr);
cairo_set_source_rgb (cr, 1, 1, 1);
cairo_arc (cr, w/2, h/2, w/2, 0, 2*G_PI);
cairo_fill (cr);
}
int
main (int argc, char **argv)
{
cairo_surface_t *surface;
cairo_t *cr;
GTimer *timer;
double msec;
int i, j;
int size;
timer = g_timer_new ();
size = 2000;
surface = cairo_image_surface_create (CAIRO_FORMAT_A8, size, size);
cr = cairo_create (surface);
/* We do everything three times, first two as warmup */
for (j = 0; j < 2; j++)
{
for (i = 1; i < 16; i++)
{
init_surface (cr);
g_timer_start (timer);
_gtk_cairo_blur_surface (surface, i, GTK_BLUR_X | GTK_BLUR_Y);
msec = g_timer_elapsed (timer, NULL) * 1000;
if (j == 1)
g_print ("Radius %2d: %.2f msec, %.2f kpixels/msec:\n", i, msec, size*size/(msec*1000));
}
}
g_timer_destroy (timer);
return 0;
}
+3 -29
View File
@@ -39,7 +39,6 @@ typedef enum {
static char *arg_output_dir = NULL;
static char *arg_base_dir = NULL;
static char *arg_direction = NULL;
static char *arg_compare_dir = NULL;
static const GOptionEntry test_args[] = {
{ "output", 'o', 0, G_OPTION_ARG_FILENAME, &arg_output_dir,
@@ -48,8 +47,6 @@ static const GOptionEntry test_args[] = {
"Directory to run tests from", "DIR" },
{ "direction", 0, 0, G_OPTION_ARG_STRING, &arg_direction,
"Set text direction", "ltr|rtl" },
{ "compare-with", 0, 0, G_OPTION_ARG_FILENAME, &arg_compare_dir,
"Directory to compare with", "DIR" },
{ NULL }
};
@@ -178,28 +175,6 @@ get_test_file (const char *test_file,
return g_string_free (file, FALSE);
}
static char *
get_reference_image (const char *ui_file)
{
char *base;
char *reference_image;
if (!arg_compare_dir)
return NULL;
get_components_of_test_file (ui_file, NULL, &base);
reference_image = g_strconcat (arg_compare_dir, G_DIR_SEPARATOR_S, base, ".out.png", NULL);
g_free (base);
if (!g_file_test (reference_image, G_FILE_TEST_EXISTS))
{
g_free (reference_image);
return NULL;
}
return reference_image;
}
static GtkStyleProvider *
add_extra_css (const char *testname,
const char *extension)
@@ -259,10 +234,9 @@ test_ui_file (GFile *file)
provider = add_extra_css (ui_file, ".css");
ui_image = reftest_snapshot_ui_file (ui_file);
if ((reference_file = get_reference_image (ui_file)) != NULL)
reference_image = cairo_image_surface_create_from_png (reference_file);
else if ((reference_file = get_test_file (ui_file, ".ref.ui", TRUE)) != NULL)
reference_file = get_test_file (ui_file, ".ref.ui", TRUE);
if (reference_file)
reference_image = reftest_snapshot_ui_file (reference_file);
else
{