Compare commits

..

9 Commits

Author SHA1 Message Date
Matthias Clasen fd8306f340 Remove lies
We forgot the documentation when we simplified the GtkApplication
session api.
2012-05-11 17:42:47 -04:00
Benjamin Otte e12b785653 tests: USE ALL THE WORDS! 2012-05-11 04:46:40 +02:00
Benjamin Otte fe421e1a7d listview: Reduce the amount of widgets we pre-allocate for sizing
This is getting kinda dangerous because we imply that a child is at
least 4px high by now.
2012-05-11 04:46:40 +02:00
Benjamin Otte 3bb8419dff listview: Implement scrolling 2012-05-11 04:46:40 +02:00
Benjamin Otte b5dc516704 iconview: Don't draw unallocated items
This is more a workaround for Clutter-GTK than anything else. Most of
all, it makes gnome-boxes start again.
2012-05-09 14:12:24 +02:00
Benjamin Otte e34702911b listview: Add a scrollbar
The scrollbar doesn't do anything. It's just put in the correct place.
2012-05-09 08:31:26 +02:00
Benjamin Otte 5822782963 listview: Add vfuncs for widget management
No public API yet, I don't have a good one...
2012-05-09 07:49:45 +02:00
Benjamin Otte 02bc5022fa tests: Add testlistview 2012-05-09 05:06:56 +02:00
Benjamin Otte b794cdbb0a listview: Add skeleton
The widget doesn't do very much yet. But at least it prints lots of
"Hello world".
2012-05-09 05:06:22 +02:00
154 changed files with 15895 additions and 21410 deletions
-73
View File
@@ -1,76 +1,3 @@
Overview of Changes in GTK+ 3.5.4
=================================
* GtkIconView size allocation has been rewritten to support
height-for-width and work better.
* The theming code now supports multiple backgrounds and
transitions
* Bug fixes:
162865 F1 should be the shortcut for Help/Contents, not ...
460908 gtk_paper_size_get_[width|height] doesn't support...
478344 GtkTreeRowReference falsely said to auto-subscrib...
531319 "weight-set" cellrenderertext attribute misbehave...
571254 Constructing a pixel value from components
587873 Documentation should explain MessageDialogs don't...
643490 gtk-style-context-add-provider () documentation n...
645514 Add placeholder-text property to GtkCellrendererText
646798 Add a tip about "cloning contexts"
647779 Doesn't mention GtkDialog replacements
649569 GDK_THREADS_ENTER in file_print_cb@modules/printb...
652304 themingengine: don't hardcode the slider lines in...
657322 GtkPrintSettings requires every application to wo...
659613 GtkLockButton docs are inaccurate
663072 GtkSelectionData is incorrectly documented
663991 _XOPEN_SOURCE 500 causes error in Solaris Studio ...
664646 dnd pointer lock when dragging tab between two ge...
665243 settings: Add support for disabling middle click ...
670449 Splash screen stays
671025 Constants and identifiers starting with a number ...
671249 GApplication: Allow a null application_id?
672947 GtkEntryCompletion sizing/position fixes
673237 window: Remove needless call to ensure_state_flag...
673749 Error Message When Creating Tray Icon
674192 out-of-tree build failure: demos/widget-factory/w...
674409 need a way to identify GtkApplicationWindows remo...
674549 widget receives leave event when button released
675365 immulticontext: Always check if the global contex...
675421 GtkFileChooser should set its role
675423 [Patch] doc: Add missing CDATA around a XML progr...
675501 gtkquartz.h is not the gtk+-3.5.2.tar.xz archive
675535 GtkScale in GtkToolbar: strange behaviour with do...
675809 Crash when clicking xrefs
675895 Docs for certain functions are built unconditionally
675899 Infobar not loadable by GTKBuilder (using python ...
675951 gdkx.h inclusion breaks OotSD builds
676087 gtk+ fails to build against uclibc due to isnan/i...
676196 range: use a CSS margin to shrink the trough comp...
676198 current color of a GtkColorButton should be set t...
676243 Document removing of accelerators
676329 GDK_SMOOTH_SCROLL_MASK lacks "Since"
676356 icon-theme: Allow symbolic GFileIcons
676429 no way to force showing icons in buttons
677055 gtkmenutoolbutton bug fixes
677109 Fixes for interactions between background-repeat ...
677202 docs: Add section for new 3.6 symbols
677203 docs: Fix duplicate declarations in sections
677293 GtkFontSelectionDialog partially broken on gtk 3.4
677363 grid: Add missing guard to gtk_grid_get_child_at()
* Translation updates:
Dutch
French
Galician
German
Greek
Hebrew
Italian
Norwegian bokmål
Slovenian
Spanish
Overview of Changes in GTK+ 3.5.1
=================================
+3 -11
View File
@@ -10,7 +10,7 @@
m4_define([gtk_major_version], [3])
m4_define([gtk_minor_version], [5])
m4_define([gtk_micro_version], [4])
m4_define([gtk_micro_version], [3])
m4_define([gtk_interface_age], [0])
m4_define([gtk_binary_age],
[m4_eval(100 * gtk_minor_version + gtk_micro_version)])
@@ -140,11 +140,8 @@ MATH_LIB=-lm
AC_MSG_CHECKING([for native Win32])
LIB_EXE_MACHINE_FLAG=X86
EXE_MANIFEST_ARCHITECTURE=X86
DISABLE_ON_W32=''
case "$host" in
*-*-mingw*)
dnl Comment-out certain gtk3.types.in lines
DISABLE_ON_W32='%'
os_win32=yes
gio_can_sniff=no
MATH_LIB=
@@ -161,7 +158,6 @@ case "$host" in
esac
AC_MSG_RESULT([$os_win32])
AC_SUBST(DISABLE_ON_W32)
AC_SUBST(LIB_EXE_MACHINE_FLAG)
AC_SUBST(EXE_MANIFEST_ARCHITECTURE)
@@ -361,14 +357,12 @@ else
AM_CONDITIONAL(USE_WIN32, false)
fi
DISABLE_ON_QUARTZ=''
if test "x$enable_quartz_backend" = xyes; then
cairo_backends="$cairo_backends cairo-quartz"
GDK_BACKENDS="$GDK_BACKENDS quartz"
GDK_WINDOWING="$GDK_WINDOWING
#define GDK_WINDOWING_QUARTZ"
GDK_EXTRA_LIBS="$GDK_EXTRA_LIBS -framework Cocoa"
DISABLE_ON_QUARTZ='%'
AM_CONDITIONAL(USE_QUARTZ, true)
if test "x$quartz_relocation" = xyes; then
AC_DEFINE([QUARTZ_RELOCATION], [1], [Use NSBundle functions to determine load paths for libraries, translations, etc.])
@@ -377,7 +371,7 @@ if test "x$enable_quartz_backend" = xyes; then
else
AM_CONDITIONAL(USE_QUARTZ, false)
fi
AC_SUBST(DISABLE_ON_QUARTZ)
if test "x$enable_broadway_backend" == xyes; then
GDK_BACKENDS="$GDK_BACKENDS broadway"
@@ -757,8 +751,7 @@ AC_TYPE_UID_T
# Check for round(), rint(), isnan(), isinf() and nearbyint()
AC_CHECK_LIB(m,round,,)
AC_CHECK_FUNCS(round rint nearbyint)
AC_CHECK_DECLS([isnan, isinf], [], [], [[#include <math.h>]])
AC_CHECK_FUNCS(round rint isnan isinf nearbyint)
# Checks for gdkspawn
AC_CHECK_HEADERS(crt_externs.h)
@@ -1720,7 +1713,6 @@ docs/reference/Makefile
docs/reference/gdk/Makefile
docs/reference/gdk/version.xml
docs/reference/gtk/Makefile
docs/reference/gtk/gtk3.types
docs/reference/gtk/version.xml
docs/reference/libgail-util/Makefile
docs/reference/libgail-util/version.xml
+10 -29
View File
@@ -15,9 +15,6 @@ demos = \
clipboard.c \
colorsel.c \
combobox.c \
css_accordion.c \
css_basics.c \
css_multiplebgs.c \
dialog.c \
drawingarea.c \
editable_cells.c \
@@ -46,8 +43,6 @@ demos = \
stock_browser.c \
textview.c \
textscroll.c \
theming_style_classes.c \
theming_custom_css.c \
toolpalette.c \
transparent.c \
tree_store.c \
@@ -73,13 +68,16 @@ LDADDS = \
bin_PROGRAMS = gtk3-demo gtk3-demo-application
BUILT_SOURCES = demos.h demo_resources.c
BUILT_SOURCES = demos.h application_resources.c
EXTRA_DIST += \
$(IMAGEFILES) \
demo.ui \
demo.gresource.xml \
$(RESOURCES) \
application.gresource.xml \
application.ui \
menus.ui \
gtk-logo-24.png \
gtk-logo-48.png \
org.gtk.Demo.gschema.xml
gsettings_SCHEMAS = \
@@ -93,7 +91,6 @@ demos.h: @REBUILD@ $(demos) geninclude.pl
gtk3_demo_SOURCES = \
$(demos) \
demo-common.h \
demo_resources.c \
main.c \
demos.h
@@ -103,24 +100,12 @@ gtk3_demo_LDFLAGS = -export-dynamic
gtk3_demo_application_SOURCES = \
application-standalone.c \
demo_resources.c
application_resources.c
gtk3_demo_application_LDADD = $(LDADDS)
demo_resources.c: demo.gresource.xml $(RESOURCES)
$(AM_V_GEN) $(GLIB_COMPILE_RESOURCES) --target=$@ --sourcedir=$(srcdir) --generate-source $(srcdir)/demo.gresource.xml
RESOURCES= application.ui \
menus.ui \
theming.ui \
gtk-logo-24.png \
gtk-logo-48.png \
css_accordion.css \
css_basics.css \
css_multiplebgs.css \
cssview.css \
fancy.css \
reset.css
application_resources.c: application.gresource.xml gtk-logo-24.png gtk-logo-48.png application.ui menus.ui
$(AM_V_GEN) $(GLIB_COMPILE_RESOURCES) --target=$@ --sourcedir=$(srcdir) --generate-source $(srcdir)/application.gresource.xml
IMAGEFILES= alphatest.png \
apple-red.png \
@@ -137,11 +122,7 @@ IMAGEFILES= alphatest.png \
gnu-keys.png \
gtk-logo-rgb.gif
democode_DATA = \
$(demos) \
$(IMAGEFILES) \
$(RESOURCES) \
demo.ui
democode_DATA = $(demos) $(IMAGEFILES) demo.ui
DISTCLEANFILES = demos.h
+5 -5
View File
@@ -1,4 +1,4 @@
/* Application class :: menus.ui application.ui
/* Application class
*
* Demonstrates a simple application.
*
@@ -113,7 +113,7 @@ activate_about (GSimpleAction *action,
NULL
};
pixbuf = gdk_pixbuf_new_from_resource ("/application/logos/gtk-logo-48.png", NULL);
pixbuf = gdk_pixbuf_new_from_resource ("/logos/gtk-logo-48.png", NULL);
gtk_show_about_dialog (GTK_WINDOW (window),
"program-name", "GTK+ Code Demos",
@@ -177,7 +177,7 @@ register_stock_icons (void)
factory = gtk_icon_factory_new ();
gtk_icon_factory_add_default (factory);
pixbuf = gdk_pixbuf_new_from_resource ("/application/logos/gtk-logo-24.png", NULL);
pixbuf = gdk_pixbuf_new_from_resource ("/logos/gtk-logo-24.png", NULL);
icon_set = gtk_icon_set_new_from_pixbuf (pixbuf);
gtk_icon_factory_add (factory, "demo-gtk-logo", icon_set);
@@ -295,7 +295,7 @@ startup (GApplication *app)
GMenuModel *menubar;
builder = gtk_builder_new ();
gtk_builder_add_from_resource (builder, "/application/ui/menus.ui", NULL);
gtk_builder_add_from_resource (builder, "/ui/menus.ui", NULL);
appmenu = (GMenuModel *)gtk_builder_get_object (builder, "appmenu");
menubar = (GMenuModel *)gtk_builder_get_object (builder, "menubar");
@@ -331,7 +331,7 @@ activate (GApplication *app)
window);
builder = gtk_builder_new ();
gtk_builder_add_from_resource (builder, "/application/ui/application.ui", NULL);
gtk_builder_add_from_resource (builder, "/ui/application.ui", NULL);
grid = (GtkWidget *)gtk_builder_get_object (builder, "grid");
contents = (GtkWidget *)gtk_builder_get_object (builder, "contents");
+11
View File
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<gresources>
<gresource prefix="/logos">
<file preprocess="to-pixdata">gtk-logo-24.png</file>
<file preprocess="to-pixdata">gtk-logo-48.png</file>
</gresource>
<gresource prefix="/ui">
<file preprocess="xml-stripblanks">application.ui</file>
<file preprocess="xml-stripblanks">menus.ui</file>
</gresource>
</gresources>
Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

+1 -7
View File
@@ -1,4 +1,4 @@
/* Builder :: demo.ui
/* Builder
*
* Demonstrates an interface loaded from a XML description.
*/
@@ -27,12 +27,6 @@ about_activate (GtkAction *action)
gtk_widget_hide (about_dlg);
}
G_MODULE_EXPORT void
help_activate (GtkAction *action)
{
g_print ("Help not available\n");
}
GtkWidget *
do_builder (GtkWidget *do_widget)
{
+5 -6
View File
@@ -1,9 +1,8 @@
/* Color Chooser
/* Color Selector
*
* GtkColorSelection lets the user choose a color. GtkColorSelectionDialog is
* a prebuilt dialog containing a GtkColorSelection.
*
* A GtkColorChooser lets the user choose a color. There are several
* implementations of the GtkColorChooser interface in GTK+. The
* GtkColorChooserDialog is a prebuilt dialog containing a
* GtkColorChooserWidget.
*/
#include <gtk/gtk.h>
@@ -78,7 +77,7 @@ do_colorsel (GtkWidget *do_widget)
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
gtk_window_set_screen (GTK_WINDOW (window),
gtk_widget_get_screen (do_widget));
gtk_window_set_title (GTK_WINDOW (window), "Color Chooser");
gtk_window_set_title (GTK_WINDOW (window), "Color Selection");
g_signal_connect (window, "destroy",
G_CALLBACK (gtk_widget_destroyed), &window);
-77
View File
@@ -1,77 +0,0 @@
/* CSS Theming/CSS Accordion :: css_accordion.css
*
* A simple accordion demo written using CSS transitions and multiple backgrounds
*
*/
#include <gtk/gtk.h>
static GtkWidget *window = NULL;
static void
apply_css (GtkWidget *widget, GtkStyleProvider *provider)
{
gtk_style_context_add_provider (gtk_widget_get_style_context (widget), provider, G_MAXUINT);
if (GTK_IS_CONTAINER (widget))
gtk_container_forall (GTK_CONTAINER (widget), (GtkCallback) apply_css, provider);
}
GtkWidget *
do_css_accordion (GtkWidget *do_widget)
{
if (!window)
{
GtkWidget *container, *child;
GtkStyleProvider *provider;
GBytes *bytes;
gsize data_size;
const guint8 *data;
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
gtk_window_set_transient_for (GTK_WINDOW (window), GTK_WINDOW (do_widget));
gtk_window_set_default_size (GTK_WINDOW (window), 600, 300);
g_signal_connect (window, "destroy",
G_CALLBACK (gtk_widget_destroyed), &window);
container = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
gtk_widget_set_halign (container, GTK_ALIGN_CENTER);
gtk_widget_set_valign (container, GTK_ALIGN_CENTER);
gtk_container_add (GTK_CONTAINER (window), container);
child = gtk_button_new_with_label ("This");
gtk_container_add (GTK_CONTAINER (container), child);
child = gtk_button_new_with_label ("Is");
gtk_container_add (GTK_CONTAINER (container), child);
child = gtk_button_new_with_label ("A");
gtk_container_add (GTK_CONTAINER (container), child);
child = gtk_button_new_with_label ("CSS");
gtk_container_add (GTK_CONTAINER (container), child);
child = gtk_button_new_with_label ("Accordion");
gtk_container_add (GTK_CONTAINER (container), child);
child = gtk_button_new_with_label (":-)");
gtk_container_add (GTK_CONTAINER (container), child);
provider = GTK_STYLE_PROVIDER (gtk_css_provider_new ());
bytes = g_resources_lookup_data ("/css_accordion/gtk.css", 0, NULL);
data = g_bytes_get_data (bytes, &data_size);
gtk_css_provider_load_from_data (GTK_CSS_PROVIDER (provider), (gchar *)data, data_size, NULL);
apply_css (window, provider);
}
if (!gtk_widget_get_visible (window))
gtk_widget_show_all (window);
else
{
gtk_widget_destroy (window);
window = NULL;
}
return window;
}
-52
View File
@@ -1,52 +0,0 @@
@import url("reset.css");
* {
transition-property: color, background-color, border-color, background-image, padding, border-width;
transition-duration: 1s;
font: Cantarell 20px;
}
GtkWindow {
background: linear-gradient(153deg, #151515, #151515 5px, transparent 5px) 0 0,
linear-gradient(333deg, #151515, #151515 5px, transparent 5px) 10px 5px,
linear-gradient(153deg, #222, #222 5px, transparent 5px) 0 5px,
linear-gradient(333deg, #222, #222 5px, transparent 5px) 10px 10px,
linear-gradient(90deg, #1b1b1b, #1b1b1b 10px, transparent 10px),
linear-gradient(#1d1d1d, #1d1d1d 25%, #1a1a1a 25%, #1a1a1a 50%, transparent 50%, transparent 75%, #242424 75%, #242424);
background-color: #131313;
background-size: 20px 20px;
}
.button {
color: black;
background-color: #bbb;
border-style: solid;
border-width: 2px 0 2px 2px;
border-color: #333;
padding: 12px 4px;
}
.button:first-child {
border-radius: 5px 0 0 5px;
}
.button:last-child {
border-radius: 0 5px 5px 0;
border-width: 2px;
}
.button:hover {
padding: 12px 48px;
background-color: #4870bc;
}
.button *:hover {
color: white;
}
.button:hover:active,
.button:active {
background-color: #993401;
}
-121
View File
@@ -1,121 +0,0 @@
/* CSS Theming/CSS Basics :: css_basics.css
*
* Gtk themes are written using CSS. Every widget is build of multiple items
* that you can style very similarly to a regular website.
*
*/
#include <gtk/gtk.h>
static GtkWidget *window = NULL;
static void
show_parsing_error (GtkCssProvider *provider,
GtkCssSection *section,
const GError *error,
GtkTextBuffer *buffer)
{
GtkTextIter start, end;
const char *tag_name;
gtk_text_buffer_get_iter_at_line_index (buffer,
&start,
gtk_css_section_get_start_line (section),
gtk_css_section_get_start_position (section));
gtk_text_buffer_get_iter_at_line_index (buffer,
&end,
gtk_css_section_get_end_line (section),
gtk_css_section_get_end_position (section));
if (g_error_matches (error, GTK_CSS_PROVIDER_ERROR, GTK_CSS_PROVIDER_ERROR_DEPRECATED))
tag_name = "warning";
else
tag_name = "error";
gtk_text_buffer_apply_tag_by_name (buffer, tag_name, &start, &end);
}
static void
css_text_changed (GtkTextBuffer *buffer,
GtkCssProvider *provider)
{
GtkTextIter start, end;
char *text;
gtk_text_buffer_get_start_iter (buffer, &start);
gtk_text_buffer_get_end_iter (buffer, &end);
gtk_text_buffer_remove_all_tags (buffer, &start, &end);
text = gtk_text_buffer_get_text (buffer, &start, &end, FALSE);
gtk_css_provider_load_from_data (provider, text, -1, NULL);
g_free (text);
gtk_style_context_reset_widgets (gdk_screen_get_default ());
}
static void
apply_css (GtkWidget *widget, GtkStyleProvider *provider)
{
gtk_style_context_add_provider (gtk_widget_get_style_context (widget), provider, G_MAXUINT);
if (GTK_IS_CONTAINER (widget))
gtk_container_forall (GTK_CONTAINER (widget), (GtkCallback) apply_css, provider);
}
GtkWidget *
do_css_basics (GtkWidget *do_widget)
{
if (!window)
{
GtkWidget *container, *child;
GtkStyleProvider *provider;
GtkTextBuffer *text;
GBytes *bytes;
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
gtk_window_set_transient_for (GTK_WINDOW (window), GTK_WINDOW (do_widget));
gtk_window_set_default_size (GTK_WINDOW (window), 400, 300);
g_signal_connect (window, "destroy",
G_CALLBACK (gtk_widget_destroyed), &window);
text = gtk_text_buffer_new (NULL);
gtk_text_buffer_create_tag (text,
"warning",
"underline", PANGO_UNDERLINE_SINGLE,
NULL);
gtk_text_buffer_create_tag (text,
"error",
"underline", PANGO_UNDERLINE_ERROR,
NULL);
provider = GTK_STYLE_PROVIDER (gtk_css_provider_new ());
container = gtk_scrolled_window_new (NULL, NULL);
gtk_container_add (GTK_CONTAINER (window), container);
child = gtk_text_view_new_with_buffer (text);
gtk_container_add (GTK_CONTAINER (container), child);
g_signal_connect (text,
"changed",
G_CALLBACK (css_text_changed),
provider);
bytes = g_resources_lookup_data ("/css_basics/gtk.css", 0, NULL);
gtk_text_buffer_set_text (text, g_bytes_get_data (bytes, NULL), g_bytes_get_size (bytes));
g_signal_connect (provider,
"parsing-error",
G_CALLBACK (show_parsing_error),
gtk_text_view_get_buffer (GTK_TEXT_VIEW (child)));
apply_css (window, provider);
}
if (!gtk_widget_get_visible (window))
gtk_widget_show_all (window);
else
{
gtk_widget_destroy (window);
window = NULL;
}
return window;
}
-22
View File
@@ -1,22 +0,0 @@
/* You can edit the text in this window to change the
* appearance of this Window.
* Be careful, if you screw it up, nothing might be visible
* anymore. :)
*/
/* This CSS resets all properties to their defaults values
* and overrides all user settings and the theme in use */
@import url("reset.css");
/* Set a very futuristic style by default */
* {
color: green;
font-family: Monospace;
border: 1px solid;
}
/* Make sure selections are visible */
:selected {
background-color: darkGreen;
color: black;
}
-170
View File
@@ -1,170 +0,0 @@
/* CSS Theming/Multiple Backgrounds :: css_multiplebgs.css cssview.css
*
* Gtk themes are written using CSS. Every widget is build of multiple items
* that you can style very similarly to a regular website.
*
*/
#include <gtk/gtk.h>
static GtkWidget *window = NULL;
static void
show_parsing_error (GtkCssProvider *provider,
GtkCssSection *section,
const GError *error,
GtkTextBuffer *buffer)
{
GtkTextIter start, end;
const char *tag_name;
gtk_text_buffer_get_iter_at_line_index (buffer,
&start,
gtk_css_section_get_start_line (section),
gtk_css_section_get_start_position (section));
gtk_text_buffer_get_iter_at_line_index (buffer,
&end,
gtk_css_section_get_end_line (section),
gtk_css_section_get_end_position (section));
if (g_error_matches (error, GTK_CSS_PROVIDER_ERROR, GTK_CSS_PROVIDER_ERROR_DEPRECATED))
tag_name = "warning";
else
tag_name = "error";
gtk_text_buffer_apply_tag_by_name (buffer, tag_name, &start, &end);
}
static void
css_text_changed (GtkTextBuffer *buffer,
GtkCssProvider *provider)
{
GtkTextIter start, end;
char *text;
gtk_text_buffer_get_start_iter (buffer, &start);
gtk_text_buffer_get_end_iter (buffer, &end);
gtk_text_buffer_remove_all_tags (buffer, &start, &end);
text = gtk_text_buffer_get_text (buffer, &start, &end, FALSE);
gtk_css_provider_load_from_data (provider, text, -1, NULL);
g_free (text);
gtk_style_context_reset_widgets (gdk_screen_get_default ());
}
static gboolean
drawing_area_draw (GtkWidget *widget,
cairo_t *cr)
{
GtkStyleContext *context = gtk_widget_get_style_context (widget);
gtk_render_background (context, cr,
0, 0,
gtk_widget_get_allocated_width (widget),
gtk_widget_get_allocated_height (widget));
gtk_render_frame (context, cr,
0, 0,
gtk_widget_get_allocated_width (widget),
gtk_widget_get_allocated_height (widget));
return FALSE;
}
static void
apply_css (GtkWidget *widget, GtkStyleProvider *provider)
{
gtk_style_context_add_provider (gtk_widget_get_style_context (widget), provider, G_MAXUINT);
if (GTK_IS_CONTAINER (widget))
gtk_container_forall (GTK_CONTAINER (widget), (GtkCallback) apply_css, provider);
}
GtkWidget *
do_css_multiplebgs (GtkWidget *do_widget)
{
if (!window)
{
GtkWidget *paned, *container, *child;
GtkStyleProvider *provider;
GtkTextBuffer *text;
GBytes *bytes;
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
gtk_window_set_transient_for (GTK_WINDOW (window), GTK_WINDOW (do_widget));
gtk_window_set_default_size (GTK_WINDOW (window), 400, 300);
g_signal_connect (window, "destroy",
G_CALLBACK (gtk_widget_destroyed), &window);
container = gtk_overlay_new ();
gtk_widget_add_events (container,
GDK_ENTER_NOTIFY_MASK |
GDK_LEAVE_NOTIFY_MASK |
GDK_POINTER_MOTION_MASK);
gtk_container_add (GTK_CONTAINER (window), container);
child = gtk_drawing_area_new ();
gtk_widget_set_name (child, "canvas");
g_signal_connect (child, "draw",
G_CALLBACK (drawing_area_draw), NULL);
gtk_container_add (GTK_CONTAINER (container), child);
child = gtk_button_new ();
gtk_widget_add_events (child,
GDK_ENTER_NOTIFY_MASK |
GDK_LEAVE_NOTIFY_MASK |
GDK_POINTER_MOTION_MASK);
gtk_overlay_add_overlay (GTK_OVERLAY (container), child);
gtk_widget_set_name (child, "bricks-button");
gtk_widget_set_halign (child, GTK_ALIGN_CENTER);
gtk_widget_set_valign (child, GTK_ALIGN_CENTER);
gtk_widget_set_size_request (child, 200, 80);
paned = gtk_paned_new (GTK_ORIENTATION_VERTICAL);
gtk_overlay_add_overlay (GTK_OVERLAY (container), paned);
/* Need a filler so we get a handle */
child = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
gtk_container_add (GTK_CONTAINER (paned), child);
text = gtk_text_buffer_new (NULL);
gtk_text_buffer_create_tag (text,
"warning",
"underline", PANGO_UNDERLINE_SINGLE,
NULL);
gtk_text_buffer_create_tag (text,
"error",
"underline", PANGO_UNDERLINE_ERROR,
NULL);
provider = GTK_STYLE_PROVIDER (gtk_css_provider_new ());
container = gtk_scrolled_window_new (NULL, NULL);
gtk_container_add (GTK_CONTAINER (paned), container);
child = gtk_text_view_new_with_buffer (text);
gtk_container_add (GTK_CONTAINER (container), child);
g_signal_connect (text,
"changed",
G_CALLBACK (css_text_changed),
provider);
bytes = g_resources_lookup_data ("/css_multiplebgs/gtk.css", 0, NULL);
gtk_text_buffer_set_text (text, g_bytes_get_data (bytes, NULL), g_bytes_get_size (bytes));
g_signal_connect (provider,
"parsing-error",
G_CALLBACK (show_parsing_error),
gtk_text_view_get_buffer (GTK_TEXT_VIEW (child)));
apply_css (window, provider);
}
if (!gtk_widget_get_visible (window))
gtk_widget_show_all (window);
else
{
gtk_widget_destroy (window);
window = NULL;
}
return window;
}
-136
View File
@@ -1,136 +0,0 @@
/* You can edit the text in this window to change the
* appearance of this Window.
* Be careful, if you screw it up, nothing might be visible
* anymore. :)
*/
/* This CSS resets all properties to their defaults values
* and overrides all user settings and the theme in use */
@import url("reset.css");
@import url("cssview.css");
#canvas {
transition-property: background-color, background-image;
transition-duration: 0.5s;
background-color: #4870bc;
}
/* The gradients below are adapted versions of Lea Verou's CSS3 patterns,
* licensed under the MIT license:
* Copyright (c) 2011 Lea Verou, http://lea.verou.me/
*
* See https://github.com/LeaVerou/CSS3-Patterns-Gallery
*/
/**********
* Bricks *
**********/
/*
@define-color brick_hi #d42;
@define-color brick_lo #b42;
@define-color brick_hi_backdrop #888;
@define-color brick_lo_backdrop #999;
#canvas {
background-color: #999;
background-image: linear-gradient(205deg, @brick_lo, @brick_lo 23px, transparent 23px),
linear-gradient(25deg, @brick_hi, @brick_hi 23px, transparent 23px),
linear-gradient(205deg, @brick_lo, @brick_lo 23px, transparent 23px),
linear-gradient(25deg, @brick_hi, @brick_hi 23px, transparent 23px);
background-size: 58px 58px;
background-position: 0px 6px, 4px 31px, 29px 35px, 34px 2px;
}
#canvas:backdrop {
background-color: #444;
background-image: linear-gradient(205deg, @brick_lo_backdrop, @brick_lo_backdrop 23px, transparent 23px),
linear-gradient(25deg, @brick_hi_backdrop, @brick_hi_backdrop 23px, transparent 23px),
linear-gradient(205deg, @brick_lo_backdrop, @brick_lo_backdrop 23px, transparent 23px),
linear-gradient(25deg, @brick_hi_backdrop, @brick_hi_backdrop 23px, transparent 23px);
background-size: 58px 58px;
background-position: 0px 6px, 4px 31px, 29px 35px, 34px 2px;
}
*/
/*
#bricks-button {
background-color: #eef;
background-image: url('brick.png');
background-repeat: no-repeat;
background-position: center;
}
*/
/**********
* Tartan *
**********/
/*
@define-color tartan_bg #662e2c;
@define-color tartan_bg_backdrop #333;
#canvas {
background-color: @tartan_bg;
background-image: repeating-linear-gradient(transparent, transparent 50px, rgba(0,0,0,.4) 50px,
rgba(0,0,0,.4) 53px, transparent 53px, transparent 63px,
rgba(0,0,0,.4) 63px, rgba(0,0,0,.4) 66px, transparent 66px,
transparent 116px, rgba(0,0,0,.5) 116px, rgba(0,0,0,.5) 166px,
rgba(255,255,255,.2) 166px, rgba(255,255,255,.2) 169px, rgba(0,0,0,.5) 169px,
rgba(0,0,0,.5) 179px, rgba(255,255,255,.2) 179px, rgba(255,255,255,.2) 182px,
rgba(0,0,0,.5) 182px, rgba(0,0,0,.5) 232px, transparent 232px),
repeating-linear-gradient(90deg, transparent, transparent 50px, rgba(0,0,0,.4) 50px, rgba(0,0,0,.4) 53px,
transparent 53px, transparent 63px, rgba(0,0,0,.4) 63px, rgba(0,0,0,.4) 66px,
transparent 66px, transparent 116px, rgba(0,0,0,.5) 116px, rgba(0,0,0,.5) 166px,
rgba(255,255,255,.2) 166px, rgba(255,255,255,.2) 169px, rgba(0,0,0,.5) 169px,
rgba(0,0,0,.5) 179px, rgba(255,255,255,.2) 179px, rgba(255,255,255,.2) 182px,
rgba(0,0,0,.5) 182px, rgba(0,0,0,.5) 232px, transparent 232px),
repeating-linear-gradient(-55deg, transparent, transparent 1px, rgba(0,0,0,.2) 1px, rgba(0,0,0,.2) 4px,
transparent 4px, transparent 19px, rgba(0,0,0,.2) 19px,
rgba(0,0,0,.2) 24px, transparent 24px, transparent 51px, rgba(0,0,0,.2) 51px,
rgba(0,0,0,.2) 54px, transparent 54px, transparent 74px);
}
#canvas:backdrop {
background-color: @tartan_bg_backdrop;
}
*/
/***********
* Stripes *
***********/
/*
@define-color base_bg #4870bc;
@define-color backdrop_bg #555;
#canvas {
background-color: @base_bg;
background-image: linear-gradient(to left, transparent, rgba(255,255,255,.07) 50%, transparent 50%),
linear-gradient(to left, transparent, rgba(255,255,255,.13) 50%, transparent 50%),
linear-gradient(to left, transparent, transparent 50%, rgba(255,255,255,.17) 50%),
linear-gradient(to left, transparent, transparent 50%, rgba(255,255,255,.19) 50%);
background-size: 29px, 59px, 73px, 109px;
}
#canvas:backdrop {
background-color: @backdrop_bg;
}
*/
/***************
* Lined Paper *
***************/
/*
#canvas {
background-color: #fff;
background-image: linear-gradient(90deg, transparent 79px, alpha(#f98195, 0.40) 79px, #f98195 80px, alpha(#f98195, 0.40) 81px, transparent 81px),
linear-gradient(alpha(#77c5cf, 0.60), alpha(#77c5cf, 0.60) 1px, transparent 1px);
background-size: 100% 36px;
}
#canvas:backdrop {
background-color: #f1f2f4;
background-image: linear-gradient(90deg, transparent 79px, alpha(#999, 0.40) 79px, #999 80px, alpha(#999, 0.40) 81px, transparent 81px),
linear-gradient(alpha(#bbb, 0.60), alpha(#bbb, 0.60) 1px, transparent 1px);
}
*/
-66
View File
@@ -1,66 +0,0 @@
/* You can edit the text in this window to change the
* appearance of this Window.
* Be careful, if you screw it up, nothing might be visible
* anymore. :)
*/
/* This CSS resets all properties to their defaults values
* and overrides all user settings and the theme in use */
@import url("reset.css");
@import url("cssview.css");
@keyframes move-the-image {
0% { background-position: 50.00% 75.00%, 67.68% 67.68%, 75.00% 50.00%, 67.68% 32.32%, 50.00% 25.00%, 32.32% 32.32%, 25.00% 50.00%, 32.32% 67.68%, 0% 0%; }
3.125% { background-position: 55.19% 76.11%, 72.14% 64.79%, 76.11% 44.81%, 64.79% 27.86%, 44.81% 23.89%, 27.86% 35.21%, 23.89% 55.19%, 35.21% 72.14%, 0% 0%; }
6.25% { background-position: 60.79% 76.04%, 76.04% 60.79%, 76.04% 39.21%, 60.79% 23.96%, 39.21% 23.96%, 23.96% 39.21%, 23.96% 60.79%, 39.21% 76.04%, 0% 0%; }
9.375% { background-position: 66.46% 74.64%, 79.06% 55.78%, 74.64% 33.54%, 55.78% 20.94%, 33.54% 25.36%, 20.94% 44.22%, 25.36% 66.46%, 44.22% 79.06%, 0% 0%; }
12.5% { background-position: 71.84% 71.84%, 80.89% 50.00%, 71.84% 28.16%, 50.00% 19.11%, 28.16% 28.16%, 19.11% 50.00%, 28.16% 71.84%, 50.00% 80.89%, 0% 0%; }
15.625% { background-position: 76.55% 67.74%, 81.32% 43.77%, 67.74% 23.45%, 43.77% 18.68%, 23.45% 32.26%, 18.68% 56.23%, 32.26% 76.55%, 56.23% 81.32%, 0% 0%; }
18.75% { background-position: 80.21% 62.51%, 80.21% 37.49%, 62.51% 19.79%, 37.49% 19.79%, 19.79% 37.49%, 19.79% 62.51%, 37.49% 80.21%, 62.51% 80.21%, 0% 0%; }
21.875% { background-position: 82.54% 56.47%, 77.58% 31.57%, 56.47% 17.46%, 31.57% 22.42%, 17.46% 43.53%, 22.42% 68.43%, 43.53% 82.54%, 68.43% 77.58%, 0% 0%; }
25% { background-position: 83.33% 50.00%, 73.57% 26.43%, 50.00% 16.67%, 26.43% 26.43%, 16.67% 50.00%, 26.43% 73.57%, 50.00% 83.33%, 73.57% 73.57%, 0% 0%; }
28.125% { background-position: 82.54% 43.53%, 68.43% 22.42%, 43.53% 17.46%, 22.42% 31.57%, 17.46% 56.47%, 31.57% 77.58%, 56.47% 82.54%, 77.58% 68.43%, 0% 0%; }
31.25% { background-position: 80.21% 37.49%, 62.51% 19.79%, 37.49% 19.79%, 19.79% 37.49%, 19.79% 62.51%, 37.49% 80.21%, 62.51% 80.21%, 80.21% 62.51%, 0% 0%; }
34.375% { background-position: 76.55% 32.26%, 56.23% 18.68%, 32.26% 23.45%, 18.68% 43.77%, 23.45% 67.74%, 43.77% 81.32%, 67.74% 76.55%, 81.32% 56.23%, 0% 0%; }
37.5% { background-position: 71.84% 28.16%, 50.00% 19.11%, 28.16% 28.16%, 19.11% 50.00%, 28.16% 71.84%, 50.00% 80.89%, 71.84% 71.84%, 80.89% 50.00%, 0% 0%; }
40.625% { background-position: 66.46% 25.36%, 44.22% 20.94%, 25.36% 33.54%, 20.94% 55.78%, 33.54% 74.64%, 55.78% 79.06%, 74.64% 66.46%, 79.06% 44.22%, 0% 0%; }
43.75% { background-position: 60.79% 23.96%, 39.21% 23.96%, 23.96% 39.21%, 23.96% 60.79%, 39.21% 76.04%, 60.79% 76.04%, 76.04% 60.79%, 76.04% 39.21%, 0% 0%; }
46.875% { background-position: 55.19% 23.89%, 35.21% 27.86%, 23.89% 44.81%, 27.86% 64.79%, 44.81% 76.11%, 64.79% 72.14%, 76.11% 55.19%, 72.14% 35.21%, 0% 0%; }
50% { background-position: 50.00% 25.00%, 32.32% 32.32%, 25.00% 50.00%, 32.32% 67.68%, 50.00% 75.00%, 67.68% 67.68%, 75.00% 50.00%, 67.68% 32.32%, 0% 0%; }
53.125% { background-position: 45.44% 27.07%, 30.57% 37.01%, 27.07% 54.56%, 37.01% 69.43%, 54.56% 72.93%, 69.43% 62.99%, 72.93% 45.44%, 62.99% 30.57%, 0% 0%; }
56.25% { background-position: 41.65% 29.85%, 29.85% 41.65%, 29.85% 58.35%, 41.65% 70.15%, 58.35% 70.15%, 70.15% 58.35%, 70.15% 41.65%, 58.35% 29.85%, 0% 0%; }
59.375% { background-position: 38.68% 33.06%, 30.02% 46.03%, 33.06% 61.32%, 46.03% 69.98%, 61.32% 66.94%, 69.98% 53.97%, 66.94% 38.68%, 53.97% 30.02%, 0% 0%; }
62.5% { background-position: 36.49% 36.49%, 30.89% 50.00%, 36.49% 63.51%, 50.00% 69.11%, 63.51% 63.51%, 69.11% 50.00%, 63.51% 36.49%, 50.00% 30.89%, 0% 0%; }
65.625% { background-position: 34.97% 39.96%, 32.28% 53.53%, 39.96% 65.03%, 53.53% 67.72%, 65.03% 60.04%, 67.72% 46.47%, 60.04% 34.97%, 46.47% 32.28%, 0% 0%; }
68.75% { background-position: 34.02% 43.38%, 34.02% 56.62%, 43.38% 65.98%, 56.62% 65.98%, 65.98% 56.62%, 65.98% 43.38%, 56.62% 34.02%, 43.38% 34.02%, 0% 0%; }
71.875% { background-position: 33.50% 46.72%, 36.01% 59.35%, 46.72% 66.50%, 59.35% 63.99%, 66.50% 53.28%, 63.99% 40.65%, 53.28% 33.50%, 40.65% 36.01%, 0% 0%; }
75% { background-position: 33.33% 50.00%, 38.21% 61.79%, 50.00% 66.67%, 61.79% 61.79%, 66.67% 50.00%, 61.79% 38.21%, 50.00% 33.33%, 38.21% 38.21%, 0% 0%; }
78.125% { background-position: 33.50% 53.28%, 40.65% 63.99%, 53.28% 66.50%, 63.99% 59.35%, 66.50% 46.72%, 59.35% 36.01%, 46.72% 33.50%, 36.01% 40.65%, 0% 0%; }
81.25% { background-position: 34.02% 56.62%, 43.38% 65.98%, 56.62% 65.98%, 65.98% 56.62%, 65.98% 43.38%, 56.62% 34.02%, 43.38% 34.02%, 34.02% 43.38%, 0% 0%; }
84.375% { background-position: 34.97% 60.04%, 46.47% 67.72%, 60.04% 65.03%, 67.72% 53.53%, 65.03% 39.96%, 53.53% 32.28%, 39.96% 34.97%, 32.28% 46.47%, 0% 0%; }
87.5% { background-position: 36.49% 63.51%, 50.00% 69.11%, 63.51% 63.51%, 69.11% 50.00%, 63.51% 36.49%, 50.00% 30.89%, 36.49% 36.49%, 30.89% 50.00%, 0% 0%; }
90.625% { background-position: 38.68% 66.94%, 53.97% 69.98%, 66.94% 61.32%, 69.98% 46.03%, 61.32% 33.06%, 46.03% 30.02%, 33.06% 38.68%, 30.02% 53.97%, 0% 0%; }
93.75% { background-position: 41.65% 70.15%, 58.35% 70.15%, 70.15% 58.35%, 70.15% 41.65%, 58.35% 29.85%, 41.65% 29.85%, 29.85% 41.65%, 29.85% 58.35%, 0% 0%; }
96.875% { background-position: 45.44% 72.93%, 62.99% 69.43%, 72.93% 54.56%, 69.43% 37.01%, 54.56% 27.07%, 37.01% 30.57%, 27.07% 45.44%, 30.57% 62.99%, 0% 0%; }
100% { background-position: 50.00% 75.00%, 67.68% 67.68%, 75.00% 50.00%, 67.68% 32.32%, 50.00% 25.00%, 32.32% 32.32%, 25.00% 50.00%, 32.32% 67.68%, 0% 0%; }
}
@keyframes size-the-image {
0% { background-size: 96px, 12px, 96px, 12px, 96px, 12px, 96px, 12px, 100% }
100% { background-size: 12px, 96px, 12px, 96px, 12px, 96px, 12px, 96px, 100% }
}
GtkWindow {
background-image: url("apple-red.png"),
url("gnome-applets.png"),
url("gnome-calendar.png"),
url("gnome-foot.png"),
url("gnome-gmush.png"),
url("gnome-gimp.png"),
url("gnome-gsame.png"),
url("gnu-keys.png"),
url("background.jpg");
background-position: 50.00% 75.00%, 67.68% 67.68%, 75.00% 50.00%, 67.68% 32.32%, 50.00% 25.00%, 32.32% 32.32%, 25.00% 50.00%, 32.32% 67.68%, 0% 0%;
background-repeat: no-repeat, no-repeat, no-repeat, no-repeat, no-repeat, no-repeat, no-repeat, no-repeat, repeat;
animation: move-the-image infinite linear 3s, size-the-image infinite alternate ease-in-out 0.75s;
}
-41
View File
@@ -1,41 +0,0 @@
/* Make the text editor has a nice style */
.view {
color: #2e3436;
font: Monospace;
background-color: alpha(white, 0.30);
}
.view:selected {
color: white;
background-color: #4a90d9;
}
.scrollbar.trough,
.scrollbars-junction {
background-color: alpha(white, 0.80);
}
.scrollbar.slider {
border-width: 3px;
border-style: solid;
border-radius: 10px;
border-color: transparent;
background-clip: padding-box;
background-color: #999;
}
.scrollbar.slider:prelight {
background-color: #555;
}
.pane-separator {
background-color: alpha(white, 0.80);
background-image: linear-gradient(transparent, transparent 1px, #999 1px, #999 4px, transparent 4px);
background-size: 40px auto;
background-repeat: no-repeat;
background-position: center;
}
.pane-separator:prelight {
background-image: linear-gradient(transparent, transparent 1px, #555 1px, #555 4px, transparent 4px);
}
-30
View File
@@ -1,30 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<gresources>
<gresource prefix="/application/logos">
<file preprocess="to-pixdata">gtk-logo-24.png</file>
<file preprocess="to-pixdata">gtk-logo-48.png</file>
</gresource>
<gresource prefix="/application/ui">
<file preprocess="xml-stripblanks">application.ui</file>
<file preprocess="xml-stripblanks">menus.ui</file>
</gresource>
<gresource prefix="/">
<file>cssview.css</file>
<file>reset.css</file>
</gresource>
<gresource prefix="/css_accordion">
<file alias="gtk.css">css_accordion.css</file>
</gresource>
<gresource prefix="/css_basics">
<file alias="gtk.css">css_basics.css</file>
</gresource>
<gresource prefix="/css_multiplebgs">
<file alias="gtk.css">css_multiplebgs.css</file>
</gresource>
<gresource prefix="/theming_custom_css">
<file alias="gtk.css">fancy.css</file>
</gresource>
<gresource prefix="/theming_style_classes">
<file preprocess="xml-stripblanks">theming.ui</file>
</gresource>
</gresources>
+1 -9
View File
@@ -107,14 +107,7 @@
<property name="stock_id">gtk-about</property>
<signal handler="about_activate" name="activate"/>
</object>
<accelerator key="F7"/>
</child>
<child>
<object class="GtkAction" id="Help">
<property name="name">Help</property>
<property name="stock_id">gtk-help</property>
<signal handler="help_activate" name="activate"/>
</object>
<accelerator key="F1"/>
</child>
</object>
</child>
@@ -134,7 +127,6 @@
<menuitem action="Paste" name="Paste"/>
</menu>
<menu action="HelpMenu" name="HelpMenu">
<menuitem action="Help" name="Help"/>
<menuitem action="About" name="About"/>
</menu>
</menubar>
-24
View File
@@ -1,24 +0,0 @@
GtkButton#fancy {
font-weight: bold;
background-image: linear-gradient(135deg, yellow, blue);
border-radius: 20px;
color: white;
}
GtkButton#fancy:hover {
font-weight: bold;
background-image: linear-gradient(135deg, blue, yellow);
border-radius: 20px;
color: white;
}
GtkButton#fancy:active {
font-weight: bold;
background-image: linear-gradient(yellow, yellow);
border-radius: 20px;
color: black;
}
GtkButton#fancy * {
color: inherit;
}
+6 -14
View File
@@ -7,7 +7,6 @@ typedef struct _Demo Demo;
struct _Demo
{
gchar *name;
gchar *title;
gchar *filename;
GDoDemoFunc func;
@@ -24,20 +23,13 @@ for $file (@ARGV) {
open INFO_FILE, $file or die "Cannot open '$file'\n";
$title = <INFO_FILE>;
$title =~ s@^\s*/\*\s*@@;
$extra = "";
if ($title =~ /^(.*)::(.*)$/) {
$title = $1;
$extra = " $2";
}
$title =~ s@\s*$@@;
$extra =~ s@^\s*@@;
$extra =~ s@\s*$@@;
close INFO_FILE;
print "GtkWidget *do_$basename (GtkWidget *do_widget);\n";
push @demos, {"name" => $basename, "title" => $title, "file" => "$file $extra",
push @demos, {"title" => $title, "file" => $file,
"func" => "do_$basename"};
}
@@ -65,7 +57,7 @@ foreach $href (@demos) {
$tmp = (defined @child_arrays)?($#child_arrays + 1):0;
push @child_arrays, "child$tmp";
push @demos, {"name" => "NULL", "title" => $parent_name, "file" => "NULL",
push @demos, {"title" => $parent_name, "file" => "NULL",
"func" => "NULL"};
}
}
@@ -92,7 +84,7 @@ if (defined @parents) {
print ",\n";
}
print qq ( { "$demos[$j]{name}", "$1", "$demos[$j]{file}", $demos[$j]{func}, NULL });
print qq ( { "$1", "$demos[$j]{file}", $demos[$j]{func}, NULL });
# hack ... ugly
$demos[$j]{"title"} = "foo";
@@ -146,9 +138,9 @@ foreach $href (@demos) {
if ($parents[$i] eq $href->{title}) {
if ($href->{file} eq 'NULL') {
print qq ( { NULL, "$href->{title}", NULL, $href->{func}, $child_arrays[$i] });
print qq ( { "$href->{title}", NULL, $href->{func}, $child_arrays[$i] });
} else {
print qq ( { "$href->{name}", "$href->{title}", "$href->{file}", $href->{func}, $child_arrays[$i] });
print qq ( { "$href->{title}", "$href->{file}", $href->{func}, $child_arrays[$i] });
}
$handled = 1;
@@ -161,7 +153,7 @@ foreach $href (@demos) {
next;
}
print qq ( { "$href->{name}", "$href->{title}", "$href->{file}", $href->{func}, NULL });
print qq ( { "$href->{title}", "$href->{file}", $href->{func}, NULL });
}
print ",\n";
+8 -73
View File
@@ -14,7 +14,6 @@ static GtkTextBuffer *source_buffer;
static gchar *current_file = NULL;
static GtkWidget *notebook;
enum {
TITLE_COLUMN,
@@ -515,47 +514,6 @@ fontify (void)
}
}
static GtkWidget *create_text (GtkTextBuffer **buffer, gboolean is_source);
static void
add_data_tab (const gchar *filename)
{
GtkTextBuffer *buffer = NULL;
gchar *full_filename;
GError *err = NULL;
gchar *text;
GtkWidget *widget, *label;
full_filename = demo_find_file (filename, &err);
if (!full_filename ||
!g_file_get_contents (full_filename, &text, NULL, &err))
{
g_warning ("%s", err->message);
g_error_free (err);
return;
}
widget = create_text (&buffer, FALSE);
gtk_widget_show_all (widget);
label = gtk_label_new (filename);
gtk_widget_show (label);
gtk_notebook_append_page (GTK_NOTEBOOK (notebook), widget, label);
gtk_text_buffer_set_text (buffer, text, -1);
g_free (full_filename);
g_free (text);
}
static void
remove_data_tabs (void)
{
gint i;
for (i = gtk_notebook_get_n_pages (GTK_NOTEBOOK (notebook)) - 1; i > 1; i--)
gtk_notebook_remove_page (GTK_NOTEBOOK (notebook), i);
}
void
load_file (const gchar *filename)
{
@@ -566,26 +524,15 @@ load_file (const gchar *filename)
GString *buffer = g_string_new (NULL);
int state = 0;
gboolean in_para = 0;
gchar **names;
gint i;
remove_data_tabs ();
names = g_strsplit (filename, " ", -1);
for (i = 1; names[i]; i++) {
if (strlen (names[i]) > 0)
add_data_tab (names[i]);
}
if (current_file && !strcmp (current_file, names[0]))
if (current_file && !strcmp (current_file, filename))
{
g_string_free (buffer, TRUE);
return;
}
g_free (current_file);
current_file = g_strdup (names[0]);
current_file = g_strdup (filename);
gtk_text_buffer_get_bounds (info_buffer, &start, &end);
gtk_text_buffer_delete (info_buffer, &start, &end);
@@ -593,7 +540,7 @@ load_file (const gchar *filename)
gtk_text_buffer_get_bounds (source_buffer, &start, &end);
gtk_text_buffer_delete (source_buffer, &start, &end);
full_filename = demo_find_file (names[0], &err);
full_filename = demo_find_file (filename, &err);
if (!full_filename)
{
g_warning ("%s", err->message);
@@ -625,23 +572,14 @@ load_file (const gchar *filename)
while (*p == '/' || *p == '*' || g_ascii_isspace (*p))
p++;
r = p;
while (*r != '\0')
{
while (*r != '/' && *r != ':' && *r != '\0')
r++;
if (*r == '/')
{
r++;
p = r;
}
if (r[0] == ':' && r[1] == ':')
*r = '\0';
}
while (*r != '/' && strlen (r))
r++;
if (strlen (r) > 0)
p = r + 1;
q = p + strlen (p);
while (q > p && g_ascii_isspace (*(q - 1)))
q--;
if (q > p)
{
int len_chars = g_utf8_pointer_to_offset (p, q);
@@ -657,8 +595,6 @@ load_file (const gchar *filename)
start = end;
while (*p && *p != '\n') p++;
state++;
}
break;
@@ -726,8 +662,6 @@ load_file (const gchar *filename)
fontify ();
g_string_free (buffer, TRUE);
g_strfreev (names);
}
void
@@ -994,6 +928,7 @@ int
main (int argc, char **argv)
{
GtkWidget *window;
GtkWidget *notebook;
GtkWidget *hbox;
GtkWidget *tree;
-68
View File
@@ -1,68 +0,0 @@
/* @import this colorsheet to get the default values for every property.
* This is useful when writing special CSS tests that should not be
* inluenced by themes - not even the default ones.
* Keep in mind that the output will be very ugly and not look like
* anything GTK.
* Also, when adding new style properties, please add them here.
*/
* {
color: inherit;
font-size: inherit;
background-color: initial;
font-family: inherit;
font-style: inherit;
font-variant: inherit;
font-weight: inherit;
text-shadow: inherit;
icon-shadow: inherit;
box-shadow: initial;
margin-top: initial;
margin-left: initial;
margin-bottom: initial;
margin-right: initial;
padding-top: initial;
padding-left: initial;
padding-bottom: initial;
padding-right: initial;
border-top-style: initial;
border-top-width: initial;
border-left-style: initial;
border-left-width: initial;
border-bottom-style: initial;
border-bottom-width: initial;
border-right-style: initial;
border-right-width: initial;
border-top-left-radius: initial;
border-top-right-radius: initial;
border-bottom-right-radius: initial;
border-bottom-left-radius: initial;
outline-style: initial;
outline-width: initial;
outline-offset: initial;
background-clip: initial;
background-origin: initial;
background-size: initial;
background-position: initial;
border-top-color: initial;
border-right-color: initial;
border-bottom-color: initial;
border-left-color: initial;
outline-color: initial;
background-repeat: initial;
background-image: initial;
border-image-source: initial;
border-image-repeat: initial;
border-image-slice: initial;
border-image-width: initial;
transition-property: initial;
transition-duration: initial;
transition-timing-function: initial;
transition-delay: initial;
engine: initial;
gtk-key-bindings: initial;
-GtkWidget-focus-line-width: 0;
-GtkWidget-focus-padding: 0;
-GtkNotebook-initial-gap: 0;
}
-319
View File
@@ -1,319 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<object class="GtkGrid" id="grid">
<property name="row-spacing">6</property>
<property name="orientation">vertical</property>
<child>
<object class="GtkToolbar" id="toolbar1">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="hexpand">True</property>
<property name="show-arrow">False</property>
<style>
<class name="primary-toolbar"/>
</style>
<child>
<object class="GtkToggleToolButton" id="toolbutton1">
<property name="use_action_appearance">False</property>
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="use_action_appearance">False</property>
<property name="label" translatable="yes">Normal</property>
<property name="use_underline">True</property>
<property name="is_important">True</property>
<property name="icon_name">edit-find</property>
</object>
<packing>
<property name="expand">False</property>
<property name="homogeneous">True</property>
</packing>
</child>
<child>
<object class="GtkToggleToolButton" id="toolbutton2">
<property name="use_action_appearance">False</property>
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="use_action_appearance">False</property>
<property name="label" translatable="yes">Active</property>
<property name="use_underline">True</property>
<property name="is_important">True</property>
<property name="icon_name">edit-find</property>
<property name="active">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="homogeneous">True</property>
</packing>
</child>
<child>
<object class="GtkToggleToolButton" id="toolbutton3">
<property name="use_action_appearance">False</property>
<property name="visible">True</property>
<property name="sensitive">False</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">Insensitive</property>
<property name="use_underline">True</property>
<property name="is_important">True</property>
<property name="icon_name">edit-find</property>
</object>
<packing>
<property name="expand">False</property>
<property name="homogeneous">True</property>
</packing>
</child>
<child>
<object class="GtkToggleToolButton" id="toolbutton5">
<property name="use_action_appearance">False</property>
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">Raised</property>
<property name="use_underline">True</property>
<property name="is_important">True</property>
<property name="icon_name">edit-find-symbolic</property>
<style>
<class name="raised"/>
</style>
</object>
<packing>
<property name="expand">False</property>
<property name="homogeneous">True</property>
</packing>
</child>
<child>
<object class="GtkToggleToolButton" id="toolbutton6">
<property name="use_action_appearance">False</property>
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">Raised Active</property>
<property name="use_underline">True</property>
<property name="is_important">True</property>
<property name="icon_name">edit-find-symbolic</property>
<property name="active">True</property>
<style>
<class name="raised"/>
</style>
</object>
<packing>
<property name="expand">False</property>
<property name="homogeneous">True</property>
</packing>
</child>
<child>
<object class="GtkToggleToolButton" id="toolbutton4">
<property name="use_action_appearance">False</property>
<property name="visible">True</property>
<property name="sensitive">False</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">Insensitive Active</property>
<property name="use_underline">True</property>
<property name="icon_name">edit-find</property>
<property name="is_important">True</property>
<property name="active">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="homogeneous">True</property>
</packing>
</child>
<child>
<object class="GtkToolItem" id="toolitementry">
<property name="use_action_appearance">False</property>
<property name="visible">True</property>
<property name="can_focus">False</property>
<child>
<object class="GtkEntry" id="entry1">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="invisible_char">•</property>
<property name="placeholder-text" translatable="yes">Search...</property>
<property name="secondary-icon-name">edit-find-symbolic</property>
</object>
</child>
</object>
<packing>
<property name="expand">False</property>
</packing>
</child>
<child>
<object class="GtkToolItem" id="toolitemswitch">
<property name="use_action_appearance">False</property>
<property name="visible">True</property>
<property name="can_focus">False</property>
<child>
<object class="GtkSwitch" id="switch1">
<property name="visible">True</property>
<property name="can_focus">True</property>
</object>
</child>
</object>
<packing>
<property name="expand">False</property>
</packing>
</child>
</object>
</child>
<child>
<object class="GtkBox" id="box1">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="orientation">horizontal</property>
<property name="valign">center</property>
<property name="halign">center</property>
<style>
<class name="linked"/>
</style>
<child>
<object class="GtkButton" id="button1">
<property name="label" translatable="yes">Hi, I am a button</property>
<property name="use_action_appearance">False</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="use_action_appearance">False</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkButton" id="button2">
<property name="label" translatable="yes">And I'm another button</property>
<property name="use_action_appearance">False</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="use_action_appearance">False</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkButton" id="button3">
<property name="label" translatable="yes">This is a button party!</property>
<property name="use_action_appearance">False</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="use_action_appearance">False</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">2</property>
</packing>
</child>
</object>
</child>
<child>
<object class="GtkToolbar" id="itoolbar1">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="hexpand">True</property>
<property name="icon_size">1</property>
<style>
<class name="inline-toolbar"/>
</style>
<child>
<object class="GtkToggleToolButton" id="itoolbutton1">
<property name="use_action_appearance">False</property>
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="use_action_appearance">False</property>
<property name="label" translatable="yes">Normal</property>
<property name="use_underline">True</property>
<property name="icon_name">list-add-symbolic</property>
</object>
<packing>
<property name="expand">False</property>
<property name="homogeneous">True</property>
</packing>
</child>
<child>
<object class="GtkToggleToolButton" id="itoolbutton2">
<property name="use_action_appearance">False</property>
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="use_action_appearance">False</property>
<property name="label" translatable="yes">Normal</property>
<property name="use_underline">True</property>
<property name="icon_name">list-add-symbolic</property>
</object>
<packing>
<property name="expand">False</property>
<property name="homogeneous">True</property>
</packing>
</child>
<child>
<object class="GtkToggleToolButton" id="itoolbutton3">
<property name="use_action_appearance">False</property>
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="use_action_appearance">False</property>
<property name="label" translatable="yes">Active</property>
<property name="use_underline">True</property>
<property name="icon_name">list-remove-symbolic</property>
<property name="active">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="homogeneous">True</property>
</packing>
</child>
<child>
<object class="GtkToggleToolButton" id="itoolbutton4">
<property name="use_action_appearance">False</property>
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="use_action_appearance">False</property>
<property name="label" translatable="yes">Active</property>
<property name="use_underline">True</property>
<property name="icon_name">list-remove-symbolic</property>
<property name="active">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="homogeneous">True</property>
</packing>
</child>
<child>
<object class="GtkToggleToolButton" id="itoolbutton5">
<property name="use_action_appearance">False</property>
<property name="visible">True</property>
<property name="sensitive">False</property>
<property name="can_focus">False</property>
<property name="use_action_appearance">False</property>
<property name="label" translatable="yes">Insensitive</property>
<property name="use_underline">True</property>
<property name="icon_name">edit-find-symbolic</property>
</object>
<packing>
<property name="expand">False</property>
<property name="homogeneous">True</property>
</packing>
</child>
<child>
<object class="GtkToggleToolButton" id="itoolbutton6">
<property name="use_action_appearance">False</property>
<property name="visible">True</property>
<property name="sensitive">False</property>
<property name="can_focus">False</property>
<property name="use_action_appearance">False</property>
<property name="label" translatable="yes">Insensitive Active</property>
<property name="use_underline">True</property>
<property name="icon_name">go-up-symbolic</property>
<property name="active">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="homogeneous">True</property>
</packing>
</child>
</object>
</child>
</object>
</interface>
-66
View File
@@ -1,66 +0,0 @@
/* CSS Theming/Custom CSS :: fancy.css
*
* GTK+ uses CSS for theming. If required, applications can
* install their own custom CSS style provider to achieve
* special effects.
*
* Doing this has the downside that your application will no
* longer react to the users theme preferences, so this should
* be used sparingly.
*/
#include <gtk/gtk.h>
#include "demo-common.h"
static GtkWidget *window = NULL;
GtkWidget *
do_theming_custom_css (GtkWidget *do_widget)
{
GtkWidget *box;
GtkWidget *button;
GtkCssProvider *provider;
GBytes *bytes;
if (!window)
{
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
gtk_window_set_screen (GTK_WINDOW (window),
gtk_widget_get_screen (do_widget));
gtk_window_set_title (GTK_WINDOW (window), "Custom CSS");
gtk_container_set_border_width (GTK_CONTAINER (window), 18);
g_signal_connect (window, "destroy",
G_CALLBACK (gtk_widget_destroyed), &window);
box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 6);
gtk_container_add (GTK_CONTAINER (window), box);
button = gtk_button_new_with_label ("Plain");
gtk_box_pack_start (GTK_BOX (box), button, TRUE, TRUE, 0);
button = gtk_button_new_with_label ("Fancy");
gtk_box_pack_start (GTK_BOX (box), button, TRUE, TRUE, 0);
gtk_widget_set_name (button, "fancy");
provider = gtk_css_provider_new ();
bytes = g_resources_lookup_data ("/theming_custom_css/gtk.css", 0, NULL);
gtk_css_provider_load_from_data (provider, g_bytes_get_data (bytes, NULL),
g_bytes_get_size (bytes), NULL);
gtk_style_context_add_provider_for_screen (gtk_widget_get_screen (do_widget),
GTK_STYLE_PROVIDER (provider),
GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);
g_object_unref (provider);
g_bytes_unref (bytes);
gtk_widget_show_all (box);
}
if (!gtk_widget_get_visible (window))
{
gtk_widget_show (window);
}
else
{
gtk_widget_destroy (window);
window = NULL;
}
return window;
}
-58
View File
@@ -1,58 +0,0 @@
/* CSS Theming/Style Classes :: theming.ui
*
* GTK+ uses CSS for theming. Style classes can be associated
* with widgets to inform the theme about intended rendering.
*
* This demo shows some common examples where theming features
* of GTK+ are used for certain effects: primary toolbars,
* inline toolbars and linked buttons.
*/
#include <gtk/gtk.h>
#include "demo-common.h"
static GtkWidget *window = NULL;
GtkWidget *
do_theming_style_classes (GtkWidget *do_widget)
{
GtkWidget *grid;
GtkBuilder *builder;
GError *err = NULL;
if (!window)
{
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
gtk_window_set_screen (GTK_WINDOW (window),
gtk_widget_get_screen (do_widget));
gtk_window_set_title (GTK_WINDOW (window), "Style Classes");
gtk_container_set_border_width (GTK_CONTAINER (window), 12);
g_signal_connect (window, "destroy",
G_CALLBACK (gtk_widget_destroyed), &window);
builder = gtk_builder_new ();
gtk_builder_add_from_resource (builder, "/theming_style_classes/theming.ui", NULL);
if (err)
{
g_error ("ERROR: %s\n", err->message);
return NULL;
}
grid = (GtkWidget *)gtk_builder_get_object (builder, "grid");
gtk_widget_show_all (grid);
gtk_container_add (GTK_CONTAINER (window), grid);
g_object_unref (builder);
}
if (!gtk_widget_get_visible (window))
{
gtk_widget_show (window);
}
else
{
gtk_widget_destroy (window);
window = NULL;
}
return window;
}
+2 -2
View File
@@ -32,9 +32,9 @@ IGNORE_HFILES= \
x11 \
quartz
# Extra files to add when scanning
# Extra files to add when scanning (relative to $srcdir)
EXTRA_HFILES= \
$(top_srcdir)/gdk/x11/gdkx.h
../../../gdk/x11/gdkx.h
# CFLAGS and LDFLAGS for compiling scan program. Only needed
# if $(DOC_MODULE).types is non-empty.
+2 -2
View File
@@ -10,9 +10,9 @@
<releaseinfo>
This document is for the GDK 3 library, version &version;
The latest versions can be found online at
<ulink role="online-location" url="http://developer.gnome.org/gdk3/">http://developer.gnome.org/gdk3/</ulink>.
<ulink role="online-location" url="http://developer.gnome.org/devel/gdk3/">http://developer.gnome.org/devel/gdk3/</ulink>.
If you are looking for the older GDK 2 series of libraries,
see <ulink role="online-location" url="http://developer.gnome.org/gdk/">http://developer.gnome.org/gdk/</ulink>.
see <ulink role="online-location" url="http://developer.gnome.org/devel/gdk/">http://developer.gnome.org/devel/gdk/</ulink>.
</releaseinfo>
</bookinfo>
+1 -1
View File
@@ -390,7 +390,7 @@ FIXXREF_OPTIONS=--extra-dir=../gdk/html \
include $(top_srcdir)/gtk-doc.make
# Other files to distribute
EXTRA_DIST += version.xml.in gtk3.types.in
EXTRA_DIST += version.xml.in
########################################################################
+2 -6
View File
@@ -12,9 +12,9 @@
<releaseinfo>
This document is for the GTK+ 3 library, version &version;.
The latest versions can be found online at
<ulink role="online-location" url="http://developer.gnome.org/gtk3/">http://developer.gnome.org/gtk3/</ulink>.
<ulink role="online-location" url="http://developer.gnome.org/devel/gtk3/">http://developer.gnome.org/devel/gtk3/</ulink>.
If you are looking for the older GTK+ 2 series of libraries,
see <ulink role="online-location" url="http://developer.gnome.org/gtk/">http://developer.gnome.org/gtk/</ulink>.
see <ulink role="online-location" url="http://developer.gnome.org/devel/gtk/">http://developer.gnome.org/devel/gtk/</ulink>.
</releaseinfo>
</bookinfo>
@@ -398,10 +398,6 @@
<title>Index of new symbols in 3.4</title>
<xi:include href="xml/api-index-3.4.xml"><xi:fallback /></xi:include>
</index>
<index id="api-index-3-6" role="3.6">
<title>Index of new symbols in 3.6</title>
<xi:include href="xml/api-index-3.6.xml"><xi:fallback /></xi:include>
</index>
<xi:include href="xml/annotation-glossary.xml"><xi:fallback /></xi:include>
+3 -2
View File
@@ -62,6 +62,7 @@ GtkAccelGroupActivate
GtkAccelGroupFindFunc
gtk_accel_group_disconnect
gtk_accel_group_disconnect_key
gtk_accel_group_query
gtk_accel_group_activate
gtk_accel_group_lock
gtk_accel_group_unlock
@@ -95,7 +96,6 @@ GTK_ACCEL_GROUP_GET_CLASS
GTK_ACCEL_GROUP_GET_PRIVATE
GtkAccelGroupPrivate
GtkAccelGroupEntry
gtk_accel_group_query
gtk_accel_group_get_type
</SECTION>
@@ -5691,7 +5691,7 @@ gtk_style_context_add_provider_for_screen
gtk_style_context_get
gtk_style_context_get_direction
gtk_style_context_get_junction_sides
gtk_style_context_get_parent
gtk_style_context_set_parent
gtk_style_context_get_path
gtk_style_context_get_property
gtk_style_context_get_screen
@@ -5800,6 +5800,7 @@ gtk_css_section_get_parent
gtk_css_section_get_section_type
gtk_css_section_get_start_line
gtk_css_section_get_start_position
gtk_css_section_get_type
gtk_css_section_ref
gtk_css_section_unref
<SUBSECTION Standard>
@@ -115,17 +115,17 @@ gtk_offscreen_window_get_type
gtk_orientable_get_type
gtk_overlay_get_type
gtk_page_setup_get_type
@DISABLE_ON_W32@gtk_page_setup_unix_dialog_get_type
gtk_page_setup_unix_dialog_get_type
gtk_paned_get_type
gtk_paper_size_get_type
@DISABLE_ON_W32@@DISABLE_ON_QUARTZ@gtk_plug_get_type
@DISABLE_ON_W32@gtk_printer_get_type
gtk_plug_get_type
gtk_printer_get_type
gtk_print_context_get_type
@DISABLE_ON_W32@gtk_print_job_get_type
gtk_print_job_get_type
gtk_print_operation_get_type
gtk_print_operation_preview_get_type
gtk_print_settings_get_type
@DISABLE_ON_W32@gtk_print_unix_dialog_get_type
gtk_print_unix_dialog_get_type
gtk_progress_bar_get_type
gtk_radio_action_get_type
gtk_radio_button_get_type
@@ -149,7 +149,7 @@ gtk_separator_menu_item_get_type
gtk_separator_tool_item_get_type
gtk_settings_get_type
gtk_size_group_get_type
@DISABLE_ON_W32@@DISABLE_ON_QUARTZ@gtk_socket_get_type
gtk_socket_get_type
gtk_spin_button_get_type
gtk_spinner_get_type
gtk_statusbar_get_type
+6 -13
View File
@@ -82,8 +82,9 @@
Over the years, a number of functions, and in some cases, entire
widgets have been deprecated. These deprecations are clearly spelled
out in the API reference, with hints about the recommended replacements.
The API reference for GTK+ 2 also includes an
<ulink url="http://developer.gnome.org/gtk/2.24/api-index-deprecated.html">index</ulink> of all deprecated symbols.
The API reference also includes an
<link linkend="api-index-deprecated">index</link> of all deprecated
symbols.
</para>
<para>
To verify that your program does not use any deprecated symbols,
@@ -91,14 +92,7 @@
as follows:
<programlisting>
make CFLAGS+="-DGDK_DISABLE_DEPRECATED -DGTK_DISABLE_DEPRECATED"
</programlisting>
</para>
<para>
Note that some parts of our API, such as enumeration values, are
not well covered by the deprecation warnings. In most cases, using
them will require you to also use deprecated functions, which will
trigger warnings. But some things, like the %GTK_DIALOG_NO_SEPARATOR
flag that has disappeared in GTK+ 3, may not.
</programlisting>
</para>
</section>
@@ -279,7 +273,7 @@ gdk_cairo_set_source_pixbuf() instead of cairo_set_source_surface().
<para>
Drawing layouts clipped is often used to avoid overdraw or to
allow drawing selections. Code would have looked like this:
<informalexample><programlisting>
<informalexample><programlisting>
GdkGC *gc;
/* setup */
@@ -1000,8 +994,7 @@ AM_CONDITIONAL(BUILD_x11, [test "x$have_x11" = "xyes"])
Another convenience function that can help when implementing
::draw for multi-window widgets is gtk_cairo_transform_to_window(),
which transforms a cairo context from widget-relative coordinates
to window-relative coordinates. You may want to use cairo_save() and
cairo_restore() when modifying the cairo context in your draw function.
to window-relative coordinates.
</para>
<para>
All GtkStyle drawing functions (gtk_paint_box(), etc) have been changed
+1 -1
View File
@@ -22,7 +22,7 @@ AM_CPPFLAGS = \
-I$(top_builddir) \
$(DEP_CFLAGS)
GTKDOC_LIBS = $(top_builddir)/libgail-util/libgailutil-3.la
GTKDOC_LIBS = $(top_builddir)/libgail-util/libgailutil.la
# gtkdoc-mkdb related varaibles
MKDB_OPTIONS =
@@ -10,7 +10,7 @@
<releaseinfo>
Version &version;
The latest version of this documentation can be found on-line at
<ulink role="online-location" url="http://developer.gnome.org/gail-libgail-util/unstable/">http://developer.gnome.org/gail-libgail-util/unstable/</ulink>.
<ulink role="online-location" url="http://developer.gnome.org/devel/gail-libgail-util/unstable/">http://developer.gnome.org/devel/gail-libgail-util/unstable/</ulink>.
</releaseinfo>
</bookinfo>
<chapter id="libgail-util-main">
+11 -32
View File
@@ -322,13 +322,13 @@ configure_plugins (GSimpleAction *action,
" <property name='visible'>True</property>"
" <child>"
" <object class='GtkCheckButton' id='red-plugin'>"
" <property name='label' translatable='yes'>Red Plugin - turn your text red</property>"
" <property name='label'>Red Plugin - turn your text red</property>"
" <property name='visible'>True</property>"
" </object>"
" </child>"
" <child>"
" <object class='GtkCheckButton' id='black-plugin'>"
" <property name='label' translatable='yes'>Black Plugin - turn your text black</property>"
" <property name='label'>Black Plugin - turn your text black</property>"
" <property name='visible'>True</property>"
" </object>"
" </child>"
@@ -339,7 +339,7 @@ configure_plugins (GSimpleAction *action,
" <property name='visible'>True</property>"
" <child>"
" <object class='GtkButton' id='close-button'>"
" <property name='label' translatable='yes'>Close</property>"
" <property name='label'>Close</property>"
" <property name='visible'>True</property>"
" </object>"
" </child>"
@@ -391,48 +391,27 @@ plug_man_startup (GApplication *application)
"<interface>"
" <menu id='app-menu'>"
" <section>"
" <item>"
" <attribute name='label' translatable='yes'>_About Plugman</attribute>"
" <attribute name='action'>app.about</attribute>"
" </item>"
" <item label='_About Plugman' action='app.about'/>"
" </section>"
" <section>"
" <item>"
" <attribute name='label' translatable='yes'>_Quit</attribute>"
" <attribute name='action'>app.quit</attribute>"
" <attribute name='accel'>&lt;Primary&gt;q</attribute>"
" </item>"
" <item label='_Quit' action='app.quit' accel='<Primary>q'/>"
" </section>"
" </menu>"
" <menu id='menubar'>"
" <submenu>"
" <attribute name='label' translatable='yes'>_Edit</attribute>"
" <submenu label='_Edit'>"
" <section>"
" <item>"
" <attribute name='label' translatable='yes'>_Copy</attribute>"
" <attribute name='action'>win.copy</attribute>"
" </item>"
" <item>"
" <attribute name='label' translatable='yes'>_Paste</attribute>"
" <attribute name='action'>win.paste</attribute>"
" </item>"
" <item label='_Copy' action='win.copy'/>"
" <item label='_Paste' action='win.paste'/>"
" </section>"
" <item><link name='section' id='plugins'>"
" </link></item>"
" <section>"
" <item>"
" <attribute name='label' translatable='yes'>Plugins</attribute>"
" <attribute name='action'>app.plugins</attribute>"
" </item>"
" <item label='Plugins' action='app.plugins'/>"
" </section>"
" </submenu>"
" <submenu>"
" <attribute name='label' translatable='yes'>_View</attribute>"
" <submenu label='_View'>"
" <section>"
" <item>"
" <attribute name='label' translatable='yes'>_Fullscreen</attribute>"
" <attribute name='action'>win.fullscreen</attribute>"
" </item>"
" <item label='_Fullscreen' action='win.fullscreen'/>"
" </section>"
" </submenu>"
" </menu>"
+4 -2
View File
@@ -383,9 +383,11 @@ gdk_broadway_device_window_at_position (GdkDevice *device,
screen = gdk_screen_get_default ();
root_window = gdk_screen_get_root_window (screen);
gdk_broadway_device_query_state (device, root_window, NULL, &window, NULL, NULL, win_x, win_y, mask);
res = gdk_broadway_device_query_state (device, root_window, NULL, &window, NULL, NULL, win_x, win_y, mask);
if (res)
return window;
return window;
return NULL;
}
static void
+2 -2
View File
@@ -19,7 +19,7 @@
#include <float.h>
#ifndef HAVE_DECL_ISNAN
#ifndef HAVE_ISNAN
/* it seems of the supported compilers only
* MSVC does not have isnan(), but it does
* have _isnan() which does the same as isnan()
@@ -31,7 +31,7 @@ isnan (double x)
}
#endif
#ifndef HAVE_DECL_ISINF
#ifndef HAVE_ISINF
/* Unfortunately MSVC does not have finite()
* but it does have _finite() which is the same
* as finite() except when x is a NaN
+1 -1
View File
@@ -360,7 +360,7 @@ typedef enum
* @GDK_SCROLL_LEFT: the window is scrolled to the left.
* @GDK_SCROLL_RIGHT: the window is scrolled to the right.
* @GDK_SCROLL_SMOOTH: the scrolling is determined by the delta values
* in #GdkEventScroll. See gdk_event_get_scroll_deltas(). Since: 3.4
* in #GdkEventScroll. See gdk_event_get_scroll_deltas().
*
* Specifies the direction for #GdkEventScroll.
*/
+1 -8
View File
@@ -217,13 +217,6 @@ gdk_offscreen_window_reparent (GdkWindow *window,
return was_mapped;
}
static void
gdk_offscreen_window_set_device_cursor (GdkWindow *window,
GdkDevice *device,
GdkCursor *cursor)
{
}
static void
from_embedder (GdkWindow *window,
double embedder_x, double embedder_y,
@@ -734,7 +727,7 @@ gdk_offscreen_window_class_init (GdkOffscreenWindowClass *klass)
impl_class->move_resize = gdk_offscreen_window_move_resize;
impl_class->set_background = gdk_offscreen_window_set_background;
impl_class->reparent = gdk_offscreen_window_reparent;
impl_class->set_device_cursor = gdk_offscreen_window_set_device_cursor;
impl_class->set_device_cursor = NULL;
impl_class->get_geometry = gdk_offscreen_window_get_geometry;
impl_class->get_root_coords = gdk_offscreen_window_get_root_coords;
impl_class->get_device_state = gdk_offscreen_window_get_device_state;
+1 -2
View File
@@ -148,8 +148,7 @@ parse_rgb_value (const gchar *str,
* A standard name (Taken from the X11 rgb.txt file).
* </listitem>
* <listitem>
* A hex value in the form '&num;rgb' '&num;rrggbb' '&num;rrrgggbbb'
* or '&num;rrrrggggbbbb'
* A hex value in the form '#rgb' '#rrggbb' '#rrrgggbbb' or '#rrrrggggbbbb'
* </listitem>
* <listitem>
* A RGB color in the form 'rgb(r,g,b)' (In this case the color will
+3 -3
View File
@@ -135,7 +135,7 @@ typedef struct _GdkAppLaunchContext GdkAppLaunchContext;
* in memory as 0xcc, 0xee, 0xff, 0x00.
* @GDK_MSB_FIRST: The values are stored with the most-significant byte
* first. For instance, the 32-bit value 0xffeecc would be stored
* in memory as 0x00, 0xff, 0xee, 0xcc.
* in memory as 0x00, 0xcc, 0xee, 0xff.
*
* A set of values describing the possible byte-orders
* for storing pixel values in memory.
@@ -348,8 +348,8 @@ typedef enum
* @GDK_SUBSTRUCTURE_MASK: receive events about window configuration changes of
* child windows
* @GDK_SCROLL_MASK: receive scroll events
* @GDK_TOUCH_MASK: receive touch events. Since 3.4
* @GDK_SMOOTH_SCROLL_MASK: receive smooth scrolling events. Since 3.4
* @GDK_TOUCH_MASK: receive touch events
* @GDK_SMOOTH_SCROLL_MASK: receive smooth scrolling events
* @GDK_ALL_EVENTS_MASK: the combination of all the above event masks.
*
* A set of bit-flags to indicate which events a window is to receive.
+9 -21
View File
@@ -1115,13 +1115,14 @@ test_resize (NSEvent *event, GdkWindow *toplevel, gint x, gint y)
GdkWindowImplQuartz *toplevel_impl;
gboolean lion;
/* Resizing from the resize indicator only begins if an NSLeftMouseButton
* event is received in the resizing area.
/* Resizing only begins if an NSLeftMouseButton event is received in
* the resizing area. Handle anything else.
*/
if ([event type] != NSLeftMouseDown)
return FALSE;
toplevel_impl = (GdkWindowImplQuartz *)toplevel->impl;
if ([toplevel_impl->toplevel showsResizeIndicator])
if ([event type] == NSLeftMouseDown &&
[toplevel_impl->toplevel showsResizeIndicator])
{
NSRect frame;
@@ -1149,25 +1150,12 @@ test_resize (NSEvent *event, GdkWindow *toplevel, gint x, gint y)
* the selector isRestorable to see if we're on 10.7.
* This extra check is in case the user starts
* dragging before GDK recognizes the grab.
*
* We perform this check for a button press of all buttons, because we
* do receive, for instance, a right mouse down event for a GDK window
* for x-coordinate range [-3, 0], but we do not want to forward this
* into GDK. Forwarding such events into GDK will confuse the pointer
* window finding code, because there are no GdkWindows present in
* the range [-3, 0].
*/
lion = gdk_quartz_osx_version () >= GDK_OSX_LION;
if (lion &&
([event type] == NSLeftMouseDown ||
[event type] == NSRightMouseDown ||
[event type] == NSOtherMouseDown))
{
if (x < GDK_LION_RESIZE ||
x > toplevel->width - GDK_LION_RESIZE ||
y > toplevel->height - GDK_LION_RESIZE)
return TRUE;
}
if (lion && (x < GDK_LION_RESIZE ||
x > toplevel->width - GDK_LION_RESIZE ||
y > toplevel->height - GDK_LION_RESIZE))
return TRUE;
return FALSE;
}
-1
View File
@@ -220,7 +220,6 @@ const static struct {
{ 0xf2c6, GDK_KEY_dead_circumflex },
{ 0xf302, GDK_KEY_dead_circumflex },
{ 0xf07e, GDK_KEY_dead_tilde },
{ 0xf2dc, GDK_KEY_dead_tilde },
{ 0xf303, GDK_KEY_dead_tilde },
{ 0xf342, GDK_KEY_dead_perispomeni },
{ 0xf0af, GDK_KEY_dead_macron },
+8 -7
View File
@@ -659,15 +659,16 @@ gdk_x11_display_translate_event (GdkEventTranslator *translator,
* means we hid the window ourselves, so we will have already flipped
* the iconified bit off.
*/
if (window && GDK_WINDOW_IS_MAPPED (window))
gdk_synthesize_window_state (window,
0,
GDK_WINDOW_STATE_ICONIFIED);
if (window)
{
if (GDK_WINDOW_IS_MAPPED (window))
gdk_synthesize_window_state (window,
0,
GDK_WINDOW_STATE_ICONIFIED);
_gdk_x11_window_grab_check_unmap (window, xevent->xany.serial);
}
}
if (window)
_gdk_x11_window_grab_check_unmap (window, xevent->xany.serial);
break;
case MapNotify:
+4 -2
View File
@@ -240,12 +240,12 @@ gdk_drag_context_find (GdkDisplay *display,
Window source_xid,
Window dest_xid)
{
GList *tmp_list;
GList *tmp_list = contexts;
GdkDragContext *context;
GdkX11DragContext *context_x11;
Window context_dest_xid;
for (tmp_list = contexts; tmp_list; tmp_list = tmp_list->next)
while (tmp_list)
{
context = (GdkDragContext *)tmp_list->data;
context_x11 = (GdkX11DragContext *)context;
@@ -265,6 +265,8 @@ gdk_drag_context_find (GdkDisplay *display,
(GDK_WINDOW_XID (context->source_window) == source_xid))) &&
((dest_xid == None) || (context_dest_xid == dest_xid)))
return context;
tmp_list = tmp_list->next;
}
return NULL;
+3 -2
View File
@@ -267,6 +267,7 @@ gtk_public_h_sources = \
gtklayout.h \
gtklinkbutton.h \
gtkliststore.h \
gtklistview.h \
gtklockbutton.h \
gtkmain.h \
gtkmenu.h \
@@ -726,6 +727,7 @@ gtk_base_c_sources = \
gtklayout.c \
gtklinkbutton.c \
gtkliststore.c \
gtklistview.c \
gtklockbutton.c \
gtkmain.c \
gtkmarshalers.c \
@@ -940,9 +942,8 @@ gtk_private_h_sources += $(gtk_use_quartz_private_h_sources)
endif
gtk_all_private_h_sources = \
$(gtk_private_h_sources) \
$(gtk_use_x11_private_h_sources) \
$(gtk_use_win32_private_h_sources) \
$(gtk_use_win32_private_h_sources) \
$(gtk_use_quartz_private_h_sources)
if !USE_X11
+14 -13
View File
@@ -823,11 +823,12 @@ gtk_font_selection_show_available_fonts (GtkFontSelection *fontsel)
const gchar *name = pango_font_family_get_name (families[i]);
GtkTreeIter iter;
gtk_list_store_insert_with_values (model, &iter, -1,
FAMILY_COLUMN, families[i],
FAMILY_NAME_COLUMN, name,
-1);
gtk_list_store_append (model, &iter);
gtk_list_store_set (model, &iter,
FAMILY_COLUMN, families[i],
FAMILY_NAME_COLUMN, name,
-1);
if (i == 0 || !g_ascii_strcasecmp (name, "sans"))
{
match_family = families[i];
@@ -924,10 +925,11 @@ gtk_font_selection_show_available_styles (GtkFontSelection *fontsel)
GtkTreeIter iter;
const gchar *str = pango_font_face_get_face_name (faces[i]);
gtk_list_store_insert_with_values (model, &iter, -1,
FACE_COLUMN, faces[i],
FACE_NAME_COLUMN, str,
-1);
gtk_list_store_append (model, &iter);
gtk_list_store_set (model, &iter,
FACE_COLUMN, faces[i],
FACE_NAME_COLUMN, str,
-1);
if (i == 0)
{
@@ -1034,8 +1036,8 @@ gtk_font_selection_show_available_sizes (GtkFontSelection *fontsel,
{
GtkTreeIter iter;
gtk_list_store_insert_with_values (model, &iter, -1,
SIZE_COLUMN, font_sizes[i], -1);
gtk_list_store_append (model, &iter);
gtk_list_store_set (model, &iter, SIZE_COLUMN, font_sizes[i], -1);
if (font_sizes[i] * PANGO_SCALE == priv->size)
set_cursor_to_iter (GTK_TREE_VIEW (priv->size_list), &iter);
@@ -1055,8 +1057,7 @@ gtk_font_selection_show_available_sizes (GtkFontSelection *fontsel,
found = TRUE;
}
if (!gtk_tree_model_iter_next (GTK_TREE_MODEL (model), &iter))
break;
gtk_tree_model_iter_next (GTK_TREE_MODEL (model), &iter);
}
if (!found)
+1
View File
@@ -124,6 +124,7 @@
#include <gtk/gtklayout.h>
#include <gtk/gtklinkbutton.h>
#include <gtk/gtkliststore.h>
#include <gtk/gtklistview.h>
#include <gtk/gtklockbutton.h>
#include <gtk/gtkmain.h>
#include <gtk/gtkmenu.h>
-2
View File
@@ -355,7 +355,6 @@ gtk_button_box_style_get_type
gtk_button_clicked
gtk_button_enter
gtk_button_get_alignment
gtk_button_get_always_show_image
gtk_button_get_event_window
gtk_button_get_focus_on_click
gtk_button_get_image
@@ -373,7 +372,6 @@ gtk_button_new_with_mnemonic
gtk_button_pressed
gtk_button_released
gtk_button_set_alignment
gtk_button_set_always_show_image
gtk_button_set_focus_on_click
gtk_button_set_image
gtk_button_set_image_position
+1 -1
View File
@@ -149,7 +149,7 @@ gtk_accel_group_class_init (GtkAccelGroupClass *class)
* @modifier: the modifier combination of the accelerator
* @accel_closure: the #GClosure of the accelerator
*
* The accel-changed signal is emitted when an entry
* The accel-changed signal is emitted when a #GtkAccelGroupEntry
* is added to or removed from the accel group.
*
* Widgets like #GtkAccelLabel which display an associated
-3
View File
@@ -207,9 +207,6 @@ _gtk_accel_path_is_valid (const gchar *accel_path)
* To change the accelerator during runtime programatically, use
* gtk_accel_map_change_entry().
*
* Set @accel_key and @accel_mods to 0 to request a removal of
* the accelerator.
*
* Note that @accel_path string will be stored in a #GQuark. Therefore, if you
* pass a static string, you can save some memory by interning it first with
* g_intern_static_string().
+2 -7
View File
@@ -754,7 +754,7 @@ gtk_application_class_init (GtkApplicationClass *class)
/**
* gtk_application_new:
* @application_id (allow-none): The application ID.
* @application_id: the application id
* @flags: the application flags
*
* Creates a new #GtkApplication instance.
@@ -774,12 +774,7 @@ gtk_application_class_init (GtkApplicationClass *class)
* you can explicitly call gtk_init() before creating the application
* instance.
*
* If non-%NULL, the application ID must be valid. See
* g_application_id_is_valid().
*
* If no application ID is given then some features (most notably application
* uniqueness) will be disabled. A null application ID is only allowed with
* GTK+ 3.6 or later.
* The application id must be valid. See g_application_id_is_valid().
*
* Returns: a new #GtkApplication instance
*
-2
View File
@@ -81,7 +81,6 @@
#include "gtkboxprivate.h"
#include "gtkintl.h"
#include "gtkorientable.h"
#include "gtkorientableprivate.h"
#include "gtkprivate.h"
#include "gtktypebuiltins.h"
#include "gtksizerequest.h"
@@ -355,7 +354,6 @@ gtk_box_set_property (GObject *object,
{
case PROP_ORIENTATION:
private->orientation = g_value_get_enum (value);
_gtk_orientable_set_style_classes (GTK_ORIENTABLE (box));
gtk_widget_queue_resize (GTK_WIDGET (box));
break;
case PROP_SPACING:
+1 -89
View File
@@ -91,7 +91,6 @@ enum {
PROP_IMAGE_POSITION,
PROP_ACTION_NAME,
PROP_ACTION_TARGET,
PROP_ALWAYS_SHOW_IMAGE,
/* activatable properties */
PROP_ACTIVATABLE_RELATED_ACTION,
@@ -340,25 +339,6 @@ gtk_button_class_init (GtkButtonClass *klass)
GTK_POS_LEFT,
GTK_PARAM_READWRITE));
/**
* GtkButton:always-show-image:
*
* If %TRUE, the button will ignore the #GtkSettings:gtk-button-images
* setting and always show the image, if available.
*
* Use this property if the button would be useless or hard to use
* without the image.
*
* Since: 3.6
*/
g_object_class_install_property (gobject_class,
PROP_ALWAYS_SHOW_IMAGE,
g_param_spec_boolean ("always-show-image",
P_("Always show image"),
P_("Whether the image will always be shown"),
FALSE,
GTK_PARAM_READWRITE | G_PARAM_CONSTRUCT));
g_object_class_override_property (gobject_class, PROP_ACTION_NAME, "action-name");
g_object_class_override_property (gobject_class, PROP_ACTION_TARGET, "action-target");
@@ -806,9 +786,6 @@ gtk_button_set_property (GObject *object,
case PROP_IMAGE:
gtk_button_set_image (button, (GtkWidget *) g_value_get_object (value));
break;
case PROP_ALWAYS_SHOW_IMAGE:
gtk_button_set_always_show_image (button, g_value_get_boolean (value));
break;
case PROP_RELIEF:
gtk_button_set_relief (button, g_value_get_enum (value));
break;
@@ -865,9 +842,6 @@ gtk_button_get_property (GObject *object,
case PROP_IMAGE:
g_value_set_object (value, (GObject *)priv->image);
break;
case PROP_ALWAYS_SHOW_IMAGE:
g_value_set_boolean (value, gtk_button_get_always_show_image (button));
break;
case PROP_RELIEF:
g_value_set_enum (value, priv->relief);
break;
@@ -1058,9 +1032,6 @@ gtk_button_sync_action_properties (GtkActivatable *activatable,
activatable_update_gicon (GTK_BUTTON (activatable), action);
activatable_update_icon_name (GTK_BUTTON (activatable), action);
}
gtk_button_set_always_show_image (button,
gtk_action_get_always_show_image (action));
}
static void
@@ -1122,7 +1093,7 @@ show_image (GtkButton *button)
GtkButtonPrivate *priv = button->priv;
gboolean show;
if (priv->label_text && !priv->always_show_image)
if (priv->label_text)
{
GtkSettings *settings;
@@ -1135,7 +1106,6 @@ show_image (GtkButton *button)
return show;
}
static void
gtk_button_construct_child (GtkButton *button)
{
@@ -2755,64 +2725,6 @@ gtk_button_get_image_position (GtkButton *button)
return button->priv->image_position;
}
/**
* gtk_button_set_always_show_image:
* @button: a #GtkButton
* @always_show: %TRUE if the menuitem should always show the image
*
* If %TRUE, the button will ignore the #GtkSettings:gtk-button-images
* setting and always show the image, if available.
*
* Use this property if the button would be useless or hard to use
* without the image.
*
* Since: 3.6
*/
void
gtk_button_set_always_show_image (GtkButton *button,
gboolean always_show)
{
GtkButtonPrivate *priv;
g_return_if_fail (GTK_IS_BUTTON (button));
priv = button->priv;
if (priv->always_show_image != always_show)
{
priv->always_show_image = always_show;
if (priv->image)
{
if (show_image (button))
gtk_widget_show (priv->image);
else
gtk_widget_hide (priv->image);
}
g_object_notify (G_OBJECT (button), "always-show-image");
}
}
/**
* gtk_button_get_always_show_image:
* @button: a #GtkButton
*
* Returns whether the button will ignore the #GtkSettings:gtk-button-images
* setting and always show the image, if available.
*
* Returns: %TRUE if the button will always show the image
*
* Since: 3.6
*/
gboolean
gtk_button_get_always_show_image (GtkButton *button)
{
g_return_val_if_fail (GTK_IS_BUTTON (button), FALSE);
return button->priv->always_show_image;
}
/**
* gtk_button_get_event_window:
* @button: a #GtkButton
-3
View File
@@ -116,9 +116,6 @@ GtkWidget* gtk_button_get_image (GtkButton *button);
void gtk_button_set_image_position (GtkButton *button,
GtkPositionType position);
GtkPositionType gtk_button_get_image_position (GtkButton *button);
void gtk_button_set_always_show_image (GtkButton *button,
gboolean always_show);
gboolean gtk_button_get_always_show_image (GtkButton *button);
GdkWindow* gtk_button_get_event_window (GtkButton *button);
-1
View File
@@ -59,7 +59,6 @@ struct _GtkButtonPrivate
guint use_action_appearance : 1;
guint use_stock : 1;
guint use_underline : 1;
guint always_show_image : 1;
};
void _gtk_button_set_depressed (GtkButton *button,
+3 -8
View File
@@ -41,12 +41,12 @@
* elements on a #cairo_t. Typically, one cell renderer is used to
* draw many cells on the screen. To this extent, it isn't expected that a
* CellRenderer keep any permanent state around. Instead, any state is set
* just prior to use using #GObjects property system. Then, the
* just prior to use using #GObject<!-- -->s property system. Then, the
* cell is measured using gtk_cell_renderer_get_size(). Finally, the cell
* is rendered in the correct location using gtk_cell_renderer_render().
*
* There are a number of rules that must be followed when writing a new
* #GtkCellRenderer. First and foremost, its important that a certain set
* #GtkCellRenderer. First and formost, its important that a certain set
* of properties will always yield a cell renderer of the same size,
* barring a #GtkStyle change. The #GtkCellRenderer also has a number of
* generic properties that are expected to be honored by all children.
@@ -60,11 +60,6 @@
* To make a cell renderer activatable or editable, you have to
* implement the #GtkCellRendererClass.activate or
* #GtkCellRendererClass.start_editing virtual functions, respectively.
*
* Many properties of #GtkCellRenderer and its subclasses have a
* corresponding "set" property, e.g. "cell-background-set" corresponds
* to "cell-background". These "set" properties reflect whether a property
* has been set or not. You should not set them independently.
*/
@@ -425,7 +420,7 @@ gtk_cell_renderer_class_init (GtkCellRendererClass *class)
ADD_SET_PROP ("cell-background-set", PROP_CELL_BACKGROUND_SET,
P_("Cell background set"),
P_("Whether the cell background color is set"));
P_("Whether this tag affects the cell background color"));
g_type_class_add_private (class, sizeof (GtkCellRendererPrivate));
-3
View File
@@ -619,9 +619,6 @@ gtk_color_button_clicked (GtkButton *b)
gtk_color_chooser_set_use_alpha (GTK_COLOR_CHOOSER (button->priv->cs_dialog),
button->priv->use_alpha);
gtk_color_chooser_set_rgba (GTK_COLOR_CHOOSER (button->priv->cs_dialog),
&button->priv->rgba);
gtk_window_present (GTK_WINDOW (button->priv->cs_dialog));
}
+4 -4
View File
@@ -120,7 +120,7 @@ swatch_draw (GtkWidget *widget,
{
cairo_save (cr);
_gtk_rounded_box_path (&background.padding_box, cr);
_gtk_rounded_box_path (&background.clip_box, cr);
cairo_clip_preserve (cr);
cairo_set_source_rgb (cr, 0.33, 0.33, 0.33);
@@ -159,9 +159,9 @@ swatch_draw (GtkWidget *widget,
cairo_set_source_rgba (cr, 1., 1., 1., 0.4);
else
cairo_set_source_rgba (cr, 0., 0., 0., 0.4);
_gtk_rounded_box_shrink (&background.padding_box, 3, 3, 3, 3);
_gtk_rounded_box_path (&background.padding_box, cr);
cairo_stroke (cr);
_gtk_rounded_box_shrink (&background.clip_box, 3, 3, 3, 3);
_gtk_rounded_box_path (&background.clip_box, cr);
cairo_stroke (cr);
}
if (swatch->priv->icon)
+3 -2
View File
@@ -42,7 +42,8 @@ gtk_css_custom_property_get_specified_type (GParamSpec *pspec)
static GtkCssValue *
gtk_css_custom_property_parse_value (GtkStyleProperty *property,
GtkCssParser *parser)
GtkCssParser *parser,
GFile *base)
{
GtkCssCustomProperty *custom = GTK_CSS_CUSTOM_PROPERTY (property);
GValue value = G_VALUE_INIT;
@@ -68,7 +69,7 @@ gtk_css_custom_property_parse_value (GtkStyleProperty *property,
{
g_value_init (&value, gtk_css_custom_property_get_specified_type (custom->pspec));
success = _gtk_css_style_parse_value (&value, parser);
success = _gtk_css_style_parse_value (&value, parser, base);
}
if (!success)
+1 -4
View File
@@ -229,13 +229,10 @@ GtkCssValue *
_gtk_css_font_weight_value_new (PangoWeight font_weight)
{
guint i;
gint w;
w = ((font_weight + 50) / 100) * 100;
for (i = 0; i < G_N_ELEMENTS (font_weight_values); i++)
{
if (font_weight_values[i].value == w)
if (font_weight_values[i].value == font_weight)
return _gtk_css_value_ref (&font_weight_values[i]);
}
+4 -2
View File
@@ -357,13 +357,15 @@ _gtk_css_image_can_parse (GtkCssParser *parser)
}
GtkCssImage *
_gtk_css_image_new_parse (GtkCssParser *parser)
_gtk_css_image_new_parse (GtkCssParser *parser,
GFile *base)
{
GtkCssImageClass *klass;
GtkCssImage *image;
GType image_type;
g_return_val_if_fail (parser != NULL, NULL);
g_return_val_if_fail (G_IS_FILE (base), NULL);
image_type = gtk_css_image_get_parser_type (parser);
if (image_type == G_TYPE_INVALID)
@@ -375,7 +377,7 @@ _gtk_css_image_new_parse (GtkCssParser *parser)
image = g_object_new (image_type, NULL);
klass = GTK_CSS_IMAGE_GET_CLASS (image);
if (!klass->parse (image, parser))
if (!klass->parse (image, parser, base))
{
g_object_unref (image);
return NULL;
+4 -3
View File
@@ -141,7 +141,8 @@ gtk_css_image_cross_fade_draw (GtkCssImage *image,
static gboolean
gtk_css_image_cross_fade_parse (GtkCssImage *image,
GtkCssParser *parser)
GtkCssParser *parser,
GFile *base)
{
GtkCssImageCrossFade *cross_fade = GTK_CSS_IMAGE_CROSS_FADE (image);
GtkCssValue *number;
@@ -152,7 +153,7 @@ gtk_css_image_cross_fade_parse (GtkCssImage *image,
return FALSE;
}
cross_fade->start = _gtk_css_image_new_parse (parser);
cross_fade->start = _gtk_css_image_new_parse (parser, base);
if (cross_fade->start == NULL)
return FALSE;
@@ -162,7 +163,7 @@ gtk_css_image_cross_fade_parse (GtkCssImage *image,
return FALSE;
}
cross_fade->end = _gtk_css_image_new_parse (parser);
cross_fade->end = _gtk_css_image_new_parse (parser, base);
if (cross_fade->end == NULL)
return FALSE;
+2 -1
View File
@@ -66,7 +66,8 @@ gtk_css_image_gradient_draw (GtkCssImage *image,
static gboolean
gtk_css_image_gradient_parse (GtkCssImage *image,
GtkCssParser *parser)
GtkCssParser *parser,
GFile *base)
{
GtkCssImageGradient *gradient = GTK_CSS_IMAGE_GRADIENT (image);
+2 -1
View File
@@ -222,7 +222,8 @@ gtk_css_image_linear_draw (GtkCssImage *image,
static gboolean
gtk_css_image_linear_parse (GtkCssImage *image,
GtkCssParser *parser)
GtkCssParser *parser,
GFile *base)
{
GtkCssImageLinear *linear = GTK_CSS_IMAGE_LINEAR (image);
guint i;
+4 -2
View File
@@ -65,7 +65,8 @@ struct _GtkCssImageClass
double height);
/* parse CSS, return TRUE on success */
gboolean (* parse) (GtkCssImage *image,
GtkCssParser *parser);
GtkCssParser *parser,
GFile *base);
/* print to CSS */
void (* print) (GtkCssImage *image,
GString *string);
@@ -74,7 +75,8 @@ struct _GtkCssImageClass
GType _gtk_css_image_get_type (void) G_GNUC_CONST;
gboolean _gtk_css_image_can_parse (GtkCssParser *parser);
GtkCssImage * _gtk_css_image_new_parse (GtkCssParser *parser);
GtkCssImage * _gtk_css_image_new_parse (GtkCssParser *parser,
GFile *base);
int _gtk_css_image_get_width (GtkCssImage *image);
int _gtk_css_image_get_height (GtkCssImage *image);
+3 -2
View File
@@ -62,7 +62,8 @@ gtk_css_image_url_draw (GtkCssImage *image,
static gboolean
gtk_css_image_url_parse (GtkCssImage *image,
GtkCssParser *parser)
GtkCssParser *parser,
GFile *base)
{
GtkCssImageUrl *url = GTK_CSS_IMAGE_URL (image);
GdkPixbuf *pixbuf;
@@ -71,7 +72,7 @@ gtk_css_image_url_parse (GtkCssImage *image,
GError *error = NULL;
GFileInputStream *input;
file = _gtk_css_parser_read_url (parser);
file = _gtk_css_parser_read_url (parser, base);
if (file == NULL)
return FALSE;
+2 -1
View File
@@ -67,7 +67,8 @@ gtk_css_image_win32_draw (GtkCssImage *image,
static gboolean
gtk_css_image_win32_parse (GtkCssImage *image,
GtkCssParser *parser)
GtkCssParser *parser,
GFile *base)
{
GtkCssImageWin32 *wimage = GTK_CSS_IMAGE_WIN32 (image);
char *class;
+8 -58
View File
@@ -38,31 +38,26 @@
struct _GtkCssParser
{
const char *data;
GFile *file;
GtkCssParserErrorFunc error_func;
gpointer user_data;
const char *data;
GtkCssParserErrorFunc error_func;
gpointer user_data;
const char *line_start;
guint line;
const char *line_start;
guint line;
};
GtkCssParser *
_gtk_css_parser_new (const char *data,
GFile *file,
GtkCssParserErrorFunc error_func,
gpointer user_data)
{
GtkCssParser *parser;
g_return_val_if_fail (data != NULL, NULL);
g_return_val_if_fail (file == NULL || G_IS_FILE (file), NULL);
parser = g_slice_new0 (GtkCssParser);
parser->data = data;
if (file)
parser->file = g_object_ref (file);
parser->error_func = error_func;
parser->user_data = user_data;
@@ -77,9 +72,6 @@ _gtk_css_parser_free (GtkCssParser *parser)
{
g_return_if_fail (GTK_IS_CSS_PARSER (parser));
if (parser->file)
g_object_unref (parser->file);
g_slice_free (GtkCssParser, parser);
}
@@ -125,49 +117,6 @@ _gtk_css_parser_get_position (GtkCssParser *parser)
return parser->data - parser->line_start;
}
static GFile *
gtk_css_parser_get_base_file (GtkCssParser *parser)
{
GFile *base;
if (parser->file)
{
base = g_file_get_parent (parser->file);
}
else
{
char *dir = g_get_current_dir ();
base = g_file_new_for_path (dir);
g_free (dir);
}
return base;
}
GFile *
_gtk_css_parser_get_file_for_path (GtkCssParser *parser,
const char *path)
{
GFile *base, *file;
g_return_val_if_fail (parser != NULL, NULL);
g_return_val_if_fail (path != NULL, NULL);
base = gtk_css_parser_get_base_file (parser);
file = g_file_resolve_relative_path (base, path);
g_object_unref (base);
return file;
}
GFile *
_gtk_css_parser_get_file (GtkCssParser *parser)
{
g_return_val_if_fail (parser != NULL, NULL);
return parser->file;
}
void
_gtk_css_parser_take_error (GtkCssParser *parser,
GError *error)
@@ -824,7 +773,8 @@ _gtk_css_parser_try_hash_color (GtkCssParser *parser,
}
GFile *
_gtk_css_parser_read_url (GtkCssParser *parser)
_gtk_css_parser_read_url (GtkCssParser *parser,
GFile *base)
{
gchar *path;
char *scheme;
@@ -878,7 +828,7 @@ _gtk_css_parser_read_url (GtkCssParser *parser)
}
}
file = _gtk_css_parser_get_file_for_path (parser, path);
file = g_file_resolve_relative_path (base, path);
g_free (path);
return file;
+2 -5
View File
@@ -30,7 +30,6 @@ typedef void (* GtkCssParserErrorFunc) (GtkCssParser *parser,
gpointer user_data);
GtkCssParser * _gtk_css_parser_new (const char *data,
GFile *file,
GtkCssParserErrorFunc error_func,
gpointer user_data);
void _gtk_css_parser_free (GtkCssParser *parser);
@@ -47,9 +46,6 @@ void _gtk_css_parser_error_full (GtkCssParser *parser
guint _gtk_css_parser_get_line (GtkCssParser *parser);
guint _gtk_css_parser_get_position (GtkCssParser *parser);
GFile * _gtk_css_parser_get_file (GtkCssParser *parser);
GFile * _gtk_css_parser_get_file_for_path (GtkCssParser *parser,
const char *path);
gboolean _gtk_css_parser_is_eof (GtkCssParser *parser);
gboolean _gtk_css_parser_begins_with (GtkCssParser *parser,
@@ -90,7 +86,8 @@ gboolean _gtk_css_parser_try_hash_color (GtkCssParser *parser
gboolean _gtk_css_parser_has_number (GtkCssParser *parser);
char * _gtk_css_parser_read_string (GtkCssParser *parser);
char * _gtk_css_parser_read_value (GtkCssParser *parser);
GFile * _gtk_css_parser_read_url (GtkCssParser *parser);
GFile * _gtk_css_parser_read_url (GtkCssParser *parser,
GFile *base);
void _gtk_css_parser_skip_whitespace (GtkCssParser *parser);
void _gtk_css_parser_resync (GtkCssParser *parser,
+6 -12
View File
@@ -187,18 +187,12 @@ _gtk_css_position_value_parse (GtkCssParser *parser)
}
if (names[first].name == NULL)
{
if (_gtk_css_parser_has_number (parser))
{
missing = &y;
x = _gtk_css_number_value_parse (parser,
GTK_CSS_PARSE_PERCENT
| GTK_CSS_PARSE_LENGTH);
if (x == NULL)
return NULL;
}
else
return NULL;
missing = &y;
x = _gtk_css_number_value_parse (parser,
GTK_CSS_PARSE_PERCENT
| GTK_CSS_PARSE_LENGTH);
if (x == NULL)
return NULL;
}
for (second = 0; names[second].name != NULL; second++)
+33 -8
View File
@@ -999,6 +999,8 @@ struct _GtkCssScanner
GtkCssParser *parser;
GtkCssSection *section;
GtkCssScanner *parent;
GFile *file;
GFile *base;
GSList *state;
};
@@ -1309,6 +1311,9 @@ gtk_css_scanner_destroy (GtkCssScanner *scanner)
if (scanner->section)
gtk_css_section_unref (scanner->section);
g_object_unref (scanner->provider);
if (scanner->file)
g_object_unref (scanner->file);
g_object_unref (scanner->base);
_gtk_css_parser_free (scanner->parser);
g_slice_free (GtkCssScanner, scanner);
@@ -1352,22 +1357,38 @@ gtk_css_scanner_new (GtkCssProvider *provider,
if (section)
scanner->section = gtk_css_section_ref (section);
if (file)
{
scanner->file = g_object_ref (file);
scanner->base = g_file_get_parent (file);
}
else
{
char *dir = g_get_current_dir ();
scanner->base = g_file_new_for_path (dir);
g_free (dir);
}
scanner->parser = _gtk_css_parser_new (text,
file,
gtk_css_scanner_parser_error,
scanner);
return scanner;
}
static GFile *
gtk_css_scanner_get_base_url (GtkCssScanner *scanner)
{
return scanner->base;
}
static gboolean
gtk_css_scanner_would_recurse (GtkCssScanner *scanner,
GFile *file)
{
while (scanner)
{
GFile *parser_file = _gtk_css_parser_get_file (scanner->parser);
if (parser_file && g_file_equal (parser_file, file))
if (scanner->file && g_file_equal (scanner->file, file))
return TRUE;
scanner = scanner->parent;
@@ -1384,7 +1405,8 @@ gtk_css_scanner_push_section (GtkCssScanner *scanner,
section = _gtk_css_section_new (scanner->section,
section_type,
scanner->parser);
scanner->parser,
scanner->file);
if (scanner->section)
gtk_css_section_unref (scanner->section);
@@ -1535,7 +1557,8 @@ gtk_css_provider_get_style_property (GtkStyleProvider *provider,
val->value);
found = _gtk_css_style_parse_value (value,
scanner->parser);
scanner->parser,
NULL);
gtk_css_scanner_destroy (scanner);
@@ -1870,12 +1893,13 @@ parse_import (GtkCssScanner *scanner)
char *uri;
uri = _gtk_css_parser_read_string (scanner->parser);
file = _gtk_css_parser_get_file_for_path (scanner->parser, uri);
file = g_file_resolve_relative_path (gtk_css_scanner_get_base_url (scanner), uri);
g_free (uri);
}
else
{
file = _gtk_css_parser_read_url (scanner->parser);
file = _gtk_css_parser_read_url (scanner->parser,
gtk_css_scanner_get_base_url (scanner));
}
if (file == NULL)
@@ -2177,7 +2201,8 @@ parse_declaration (GtkCssScanner *scanner,
gtk_css_scanner_push_section (scanner, GTK_CSS_SECTION_VALUE);
value = _gtk_style_property_parse_value (property,
scanner->parser);
scanner->parser,
gtk_css_scanner_get_base_url (scanner));
if (value == NULL)
{
+5 -4
View File
@@ -49,11 +49,13 @@ G_DEFINE_BOXED_TYPE (GtkCssSection, gtk_css_section, gtk_css_section_ref, gtk_cs
GtkCssSection *
_gtk_css_section_new (GtkCssSection *parent,
GtkCssSectionType type,
GtkCssParser *parser)
GtkCssParser *parser,
GFile *file)
{
GtkCssSection *section;
g_return_val_if_fail (parser != NULL, NULL);
g_return_val_if_fail (file == NULL || G_IS_FILE (file), NULL);
section = g_slice_new0 (GtkCssSection);
@@ -61,9 +63,8 @@ _gtk_css_section_new (GtkCssSection *parent,
section->section_type = type;
if (parent)
section->parent = gtk_css_section_ref (parent);
section->file = _gtk_css_parser_get_file (parser);
if (section->file)
g_object_ref (section->file);
if (file)
section->file = g_object_ref (file);
section->start_line = _gtk_css_parser_get_line (parser);
section->start_position = _gtk_css_parser_get_position (parser);
section->parser = parser;
+2 -1
View File
@@ -26,7 +26,8 @@ G_BEGIN_DECLS
GtkCssSection * _gtk_css_section_new (GtkCssSection *parent,
GtkCssSectionType type,
GtkCssParser *parser);
GtkCssParser *parser,
GFile *file);
GtkCssSection * _gtk_css_section_new_for_file (GtkCssSectionType type,
GFile *file);
+3 -2
View File
@@ -86,7 +86,8 @@ _gtk_css_shorthand_property_query (GtkStyleProperty *property,
static GtkCssValue *
gtk_css_shorthand_property_parse_value (GtkStyleProperty *property,
GtkCssParser *parser)
GtkCssParser *parser,
GFile *base)
{
GtkCssShorthandProperty *shorthand = GTK_CSS_SHORTHAND_PROPERTY (property);
GtkCssValue **data;
@@ -118,7 +119,7 @@ gtk_css_shorthand_property_parse_value (GtkStyleProperty *property,
data[i] = _gtk_css_inherit_value_new ();
}
}
else if (!shorthand->parse (shorthand, data, parser))
else if (!shorthand->parse (shorthand, data, parser, base))
{
for (i = 0; i < shorthand->subproperties->len; i++)
{
+45 -114
View File
@@ -25,7 +25,6 @@
#include <math.h>
#include "gtkcssarrayvalueprivate.h"
#include "gtkcssbgsizevalueprivate.h"
#include "gtkcssbordervalueprivate.h"
#include "gtkcsscornervalueprivate.h"
#include "gtkcsseasevalueprivate.h"
@@ -33,7 +32,6 @@
#include "gtkcssimageprivate.h"
#include "gtkcssimagevalueprivate.h"
#include "gtkcssnumbervalueprivate.h"
#include "gtkcsspositionvalueprivate.h"
#include "gtkcssrepeatvalueprivate.h"
#include "gtkcssstringvalueprivate.h"
#include "gtkcssstylefuncsprivate.h"
@@ -93,7 +91,8 @@ parse_four_numbers (GtkCssShorthandProperty *shorthand,
static gboolean
parse_margin (GtkCssShorthandProperty *shorthand,
GtkCssValue **values,
GtkCssParser *parser)
GtkCssParser *parser,
GFile *base)
{
return parse_four_numbers (shorthand,
values,
@@ -105,7 +104,8 @@ parse_margin (GtkCssShorthandProperty *shorthand,
static gboolean
parse_padding (GtkCssShorthandProperty *shorthand,
GtkCssValue **values,
GtkCssParser *parser)
GtkCssParser *parser,
GFile *base)
{
return parse_four_numbers (shorthand,
values,
@@ -118,7 +118,8 @@ parse_padding (GtkCssShorthandProperty *shorthand,
static gboolean
parse_border_width (GtkCssShorthandProperty *shorthand,
GtkCssValue **values,
GtkCssParser *parser)
GtkCssParser *parser,
GFile *base)
{
return parse_four_numbers (shorthand,
values,
@@ -131,7 +132,8 @@ parse_border_width (GtkCssShorthandProperty *shorthand,
static gboolean
parse_border_radius (GtkCssShorthandProperty *shorthand,
GtkCssValue **values,
GtkCssParser *parser)
GtkCssParser *parser,
GFile *base)
{
GtkCssValue *x[4] = { NULL, }, *y[4] = { NULL, };
guint i;
@@ -211,7 +213,8 @@ fail:
static gboolean
parse_border_color (GtkCssShorthandProperty *shorthand,
GtkCssValue **values,
GtkCssParser *parser)
GtkCssParser *parser,
GFile *base)
{
guint i;
@@ -236,7 +239,8 @@ parse_border_color (GtkCssShorthandProperty *shorthand,
static gboolean
parse_border_style (GtkCssShorthandProperty *shorthand,
GtkCssValue **values,
GtkCssParser *parser)
GtkCssParser *parser,
GFile *base)
{
guint i;
@@ -262,7 +266,8 @@ parse_border_style (GtkCssShorthandProperty *shorthand,
static gboolean
parse_border_image (GtkCssShorthandProperty *shorthand,
GtkCssValue **values,
GtkCssParser *parser)
GtkCssParser *parser,
GFile *base)
{
do
{
@@ -276,7 +281,7 @@ parse_border_image (GtkCssShorthandProperty *shorthand,
image = NULL;
else
{
image = _gtk_css_image_new_parse (parser);
image = _gtk_css_image_new_parse (parser, base);
if (image == NULL)
return FALSE;
}
@@ -328,7 +333,8 @@ parse_border_image (GtkCssShorthandProperty *shorthand,
static gboolean
parse_border_side (GtkCssShorthandProperty *shorthand,
GtkCssValue **values,
GtkCssParser *parser)
GtkCssParser *parser,
GFile *base)
{
do
{
@@ -362,7 +368,8 @@ parse_border_side (GtkCssShorthandProperty *shorthand,
static gboolean
parse_border (GtkCssShorthandProperty *shorthand,
GtkCssValue **values,
GtkCssParser *parser)
GtkCssParser *parser,
GFile *base)
{
do
{
@@ -415,7 +422,8 @@ parse_border (GtkCssShorthandProperty *shorthand,
static gboolean
parse_font (GtkCssShorthandProperty *shorthand,
GtkCssValue **values,
GtkCssParser *parser)
GtkCssParser *parser,
GFile *base)
{
PangoFontDescription *desc;
guint mask;
@@ -457,12 +465,11 @@ parse_font (GtkCssShorthandProperty *shorthand,
}
static gboolean
parse_one_background (GtkCssShorthandProperty *shorthand,
GtkCssValue **values,
GtkCssParser *parser)
parse_background (GtkCssShorthandProperty *shorthand,
GtkCssValue **values,
GtkCssParser *parser,
GFile *base)
{
GtkCssValue *value = NULL;
do
{
/* the image part */
@@ -476,7 +483,7 @@ parse_one_background (GtkCssShorthandProperty *shorthand,
image = NULL;
else
{
image = _gtk_css_image_new_parse (parser);
image = _gtk_css_image_new_parse (parser, base);
if (image == NULL)
return FALSE;
}
@@ -484,46 +491,24 @@ parse_one_background (GtkCssShorthandProperty *shorthand,
values[0] = _gtk_css_image_value_new (image);
}
else if (values[1] == NULL &&
(value = _gtk_css_position_value_parse (parser)))
(values[1] = _gtk_css_background_repeat_value_try_parse (parser)))
{
values[1] = value;
value = NULL;
if (_gtk_css_parser_try (parser, "/", TRUE) &&
(value = _gtk_css_bg_size_value_parse (parser)))
/* nothing to do here */
}
else if ((values[2] == NULL || values[3] == NULL) &&
(values[3] = _gtk_css_area_value_try_parse (parser)))
{
if (values[2] == NULL)
{
values[2] = value;
value = NULL;
values[2] = values[3];
values[3] = NULL;
}
}
else if (values[3] == NULL &&
(value = _gtk_css_background_repeat_value_try_parse (parser)))
else if (values[4] == NULL)
{
values[3] = value;
value = NULL;
}
else if ((values[4] == NULL || values[5] == NULL) &&
(value = _gtk_css_area_value_try_parse (parser)))
{
values[4] = value;
if (values[5] == NULL)
{
values[5] = values[4];
values[4] = NULL;
}
value = NULL;
}
else if (values[6] == NULL)
{
value = _gtk_css_symbolic_value_new (parser);
if (value == NULL)
values[6] = _gtk_css_value_ref (_gtk_css_style_property_get_initial_value
(_gtk_css_shorthand_property_get_subproperty (shorthand, 6)));
else
values[6] = value;
value = NULL;
values[4] = _gtk_css_symbolic_value_new (parser);
if (values[4] == NULL)
return FALSE;
}
else
{
@@ -535,69 +520,14 @@ parse_one_background (GtkCssShorthandProperty *shorthand,
}
while (!value_is_done_parsing (parser));
if (values[5] != NULL && values[4] == NULL)
values[4] = _gtk_css_value_ref (values[5]);
return TRUE;
}
static gboolean
parse_background (GtkCssShorthandProperty *shorthand,
GtkCssValue **values,
GtkCssParser *parser)
{
GtkCssValue *step_values[7];
GPtrArray *arrays[6];
guint i;
for (i = 0; i < 6; i++)
{
arrays[i] = g_ptr_array_new ();
step_values[i] = NULL;
}
step_values[6] = NULL;
do {
if (!parse_one_background (shorthand, step_values, parser))
{
for (i = 0; i < 6; i++)
{
g_ptr_array_set_free_func (arrays[i], (GDestroyNotify) _gtk_css_value_unref);
g_ptr_array_unref (arrays[i]);
return FALSE;
}
}
for (i = 0; i < 6; i++)
{
if (step_values[i] == NULL)
{
GtkCssValue *initial = _gtk_css_style_property_get_initial_value (
_gtk_css_shorthand_property_get_subproperty (shorthand, i));
step_values[i] = _gtk_css_value_ref (_gtk_css_array_value_get_nth (initial, 0));
}
g_ptr_array_add (arrays[i], step_values[i]);
step_values[i] = NULL;
}
} while (_gtk_css_parser_try (parser, ",", TRUE));
for (i = 0; i < 6; i++)
{
values[i] = _gtk_css_array_value_new_from_array ((GtkCssValue **) arrays[i]->pdata, arrays[i]->len);
g_ptr_array_unref (arrays[i]);
}
values[6] = step_values[6];
return TRUE;
}
static gboolean
parse_one_transition (GtkCssShorthandProperty *shorthand,
GtkCssValue **values,
GtkCssParser *parser)
GtkCssParser *parser,
GFile *base)
{
do
{
@@ -649,7 +579,8 @@ parse_one_transition (GtkCssShorthandProperty *shorthand,
static gboolean
parse_transition (GtkCssShorthandProperty *shorthand,
GtkCssValue **values,
GtkCssParser *parser)
GtkCssParser *parser,
GFile *base)
{
GtkCssValue *step_values[4];
GPtrArray *arrays[4];
@@ -662,7 +593,7 @@ parse_transition (GtkCssShorthandProperty *shorthand,
}
do {
if (!parse_one_transition (shorthand, step_values, parser))
if (!parse_one_transition (shorthand, step_values, parser, base))
{
for (i = 0; i < 4; i++)
{
@@ -993,7 +924,7 @@ _gtk_css_shorthand_property_init_properties (void)
"border-top-color", "border-right-color", "border-bottom-color", "border-left-color",
"border-image-source", "border-image-slice", "border-image-width", "border-image-repeat", NULL };
const char *outline_subproperties[] = { "outline-width", "outline-style", "outline-color", NULL };
const char *background_subproperties[] = { "background-image", "background-position", "background-size", "background-repeat", "background-clip", "background-origin",
const char *background_subproperties[] = { "background-image", "background-repeat", "background-clip", "background-origin",
"background-color", NULL };
const char *transition_subproperties[] = { "transition-property", "transition-duration", "transition-delay", "transition-timing-function", NULL };
+2 -1
View File
@@ -40,7 +40,8 @@ typedef struct _GtkCssShorthandPropertyClass GtkCssShorthandPropertyClass;
typedef gboolean (* GtkCssShorthandPropertyParseFunc) (GtkCssShorthandProperty *shorthand,
GtkCssValue **values,
GtkCssParser *parser);
GtkCssParser *parser,
GFile *base);
typedef void (* GtkCssShorthandPropertyAssignFunc) (GtkCssShorthandProperty *shorthand,
GtkStyleProperties *props,
GtkStateFlags state,
+25 -6
View File
@@ -49,6 +49,7 @@ static GHashTable *print_funcs = NULL;
static GHashTable *compute_funcs = NULL;
typedef gboolean (* GtkStyleParseFunc) (GtkCssParser *parser,
GFile *base,
GValue *value);
typedef void (* GtkStylePrintFunc) (const GValue *value,
GString *string);
@@ -161,6 +162,7 @@ enum_print (int value,
static gboolean
rgba_value_parse (GtkCssParser *parser,
GFile *base,
GValue *value)
{
GtkSymbolicColor *symbolic;
@@ -229,6 +231,7 @@ rgba_value_compute (GtkStyleContext *context,
static gboolean
color_value_parse (GtkCssParser *parser,
GFile *base,
GValue *value)
{
GtkSymbolicColor *symbolic;
@@ -307,6 +310,7 @@ color_value_compute (GtkStyleContext *context,
static gboolean
symbolic_color_value_parse (GtkCssParser *parser,
GFile *base,
GValue *value)
{
GtkSymbolicColor *symbolic;
@@ -337,6 +341,7 @@ symbolic_color_value_print (const GValue *value,
static gboolean
font_description_value_parse (GtkCssParser *parser,
GFile *base,
GValue *value)
{
PangoFontDescription *font_desc;
@@ -378,6 +383,7 @@ font_description_value_print (const GValue *value,
static gboolean
boolean_value_parse (GtkCssParser *parser,
GFile *base,
GValue *value)
{
if (_gtk_css_parser_try (parser, "true", TRUE) ||
@@ -411,13 +417,14 @@ boolean_value_print (const GValue *value,
static gboolean
int_value_parse (GtkCssParser *parser,
GFile *base,
GValue *value)
{
gint i;
if (_gtk_css_parser_begins_with (parser, '-'))
{
int res = _gtk_win32_theme_int_parse (parser, &i);
int res = _gtk_win32_theme_int_parse (parser, base, &i);
if (res >= 0)
{
g_value_set_int (value, i);
@@ -445,6 +452,7 @@ int_value_print (const GValue *value,
static gboolean
uint_value_parse (GtkCssParser *parser,
GFile *base,
GValue *value)
{
guint u;
@@ -468,6 +476,7 @@ uint_value_print (const GValue *value,
static gboolean
double_value_parse (GtkCssParser *parser,
GFile *base,
GValue *value)
{
gdouble d;
@@ -491,6 +500,7 @@ double_value_print (const GValue *value,
static gboolean
float_value_parse (GtkCssParser *parser,
GFile *base,
GValue *value)
{
gdouble d;
@@ -514,6 +524,7 @@ float_value_print (const GValue *value,
static gboolean
string_value_parse (GtkCssParser *parser,
GFile *base,
GValue *value)
{
char *str = _gtk_css_parser_read_string (parser);
@@ -534,6 +545,7 @@ string_value_print (const GValue *value,
static gboolean
theming_engine_value_parse (GtkCssParser *parser,
GFile *base,
GValue *value)
{
GtkThemingEngine *engine;
@@ -587,6 +599,7 @@ theming_engine_value_print (const GValue *value,
static gboolean
border_value_parse (GtkCssParser *parser,
GFile *base,
GValue *value)
{
GtkBorder border = { 0, };
@@ -599,7 +612,7 @@ border_value_parse (GtkCssParser *parser,
{
/* These are strictly speaking signed, but we want to be able to use them
for unsigned types too, as the actual ranges of values make this safe */
int res = _gtk_win32_theme_int_parse (parser, &numbers[i]);
int res = _gtk_win32_theme_int_parse (parser, base, &numbers[i]);
if (res == 0) /* Parse error, report */
return FALSE;
@@ -657,6 +670,7 @@ border_value_print (const GValue *value, GString *string)
static gboolean
gradient_value_parse (GtkCssParser *parser,
GFile *base,
GValue *value)
{
GtkGradient *gradient;
@@ -687,6 +701,7 @@ gradient_value_print (const GValue *value,
static gboolean
pattern_value_parse (GtkCssParser *parser,
GFile *base,
GValue *value)
{
if (_gtk_css_parser_try (parser, "none", TRUE))
@@ -697,7 +712,7 @@ pattern_value_parse (GtkCssParser *parser,
{
g_value_unset (value);
g_value_init (value, GTK_TYPE_GRADIENT);
return gradient_value_parse (parser, value);
return gradient_value_parse (parser, base, value);
}
else
{
@@ -710,7 +725,7 @@ pattern_value_parse (GtkCssParser *parser,
cairo_t *cr;
cairo_matrix_t matrix;
file = _gtk_css_parser_read_url (parser);
file = _gtk_css_parser_read_url (parser, base);
if (file == NULL)
return FALSE;
@@ -837,6 +852,7 @@ pattern_value_compute (GtkStyleContext *context,
static gboolean
enum_value_parse (GtkCssParser *parser,
GFile *base,
GValue *value)
{
int v;
@@ -859,6 +875,7 @@ enum_value_print (const GValue *value,
static gboolean
flags_value_parse (GtkCssParser *parser,
GFile *base,
GValue *value)
{
GFlagsClass *flags_class;
@@ -1010,6 +1027,7 @@ gtk_css_style_funcs_init (void)
* _gtk_css_style_parse_value:
* @value: the value to parse into. Must be a valid initialized #GValue
* @parser: the parser to parse from
* @base: the base URL for @parser
*
* This is the generic parsing function used for CSS values. If the
* function fails to parse a value, it will emit an error on @parser,
@@ -1019,7 +1037,8 @@ gtk_css_style_funcs_init (void)
**/
gboolean
_gtk_css_style_parse_value (GValue *value,
GtkCssParser *parser)
GtkCssParser *parser,
GFile *base)
{
GtkStyleParseFunc func;
@@ -1042,7 +1061,7 @@ _gtk_css_style_parse_value (GValue *value,
return FALSE;
}
return (*func) (parser, value);
return (*func) (parser, base, value);
}
/**
+2 -1
View File
@@ -25,7 +25,8 @@
G_BEGIN_DECLS
gboolean _gtk_css_style_parse_value (GValue *value,
GtkCssParser *parser);
GtkCssParser *parser,
GFile *base);
void _gtk_css_style_print_value (const GValue *value,
GString *string);
GtkCssValue * _gtk_css_style_compute_value (GtkStyleContext *context,
+5 -3
View File
@@ -147,7 +147,8 @@ _gtk_css_style_property_query (GtkStyleProperty *property,
static GtkCssValue *
gtk_css_style_property_parse_value (GtkStyleProperty *property,
GtkCssParser *parser)
GtkCssParser *parser,
GFile *base)
{
GtkCssStyleProperty *style_property = GTK_CSS_STYLE_PROPERTY (property);
@@ -169,7 +170,7 @@ gtk_css_style_property_parse_value (GtkStyleProperty *property,
return _gtk_css_inherit_value_new ();
}
return (* style_property->parse_value) (style_property, parser);
return (* style_property->parse_value) (style_property, parser, base);
}
static void
@@ -220,7 +221,8 @@ _gtk_css_style_property_class_init (GtkCssStylePropertyClass *klass)
static GtkCssValue *
gtk_css_style_property_real_parse_value (GtkCssStyleProperty *property,
GtkCssParser *parser)
GtkCssParser *parser,
GFile *base)
{
g_assert_not_reached ();
return NULL;
+71 -100
View File
@@ -175,7 +175,8 @@ assign_border (GtkCssStyleProperty *property,
static GtkCssValue *
color_parse (GtkCssStyleProperty *property,
GtkCssParser *parser)
GtkCssParser *parser,
GFile *base)
{
return _gtk_css_symbolic_value_new (parser);
}
@@ -252,7 +253,8 @@ font_family_parse_one (GtkCssParser *parser)
static GtkCssValue *
font_family_parse (GtkCssStyleProperty *property,
GtkCssParser *parser)
GtkCssParser *parser,
GFile *base)
{
return _gtk_css_array_value_parse (parser, font_family_parse_one, FALSE);
}
@@ -301,7 +303,8 @@ font_family_assign (GtkCssStyleProperty *property,
static GtkCssValue *
parse_pango_style (GtkCssStyleProperty *property,
GtkCssParser *parser)
GtkCssParser *parser,
GFile *base)
{
GtkCssValue *value = _gtk_css_font_style_value_try_parse (parser);
@@ -329,7 +332,8 @@ assign_pango_style (GtkCssStyleProperty *property,
static GtkCssValue *
parse_pango_weight (GtkCssStyleProperty *property,
GtkCssParser *parser)
GtkCssParser *parser,
GFile *base)
{
GtkCssValue *value = _gtk_css_font_weight_value_try_parse (parser);
@@ -357,7 +361,8 @@ assign_pango_weight (GtkCssStyleProperty *property,
static GtkCssValue *
parse_pango_variant (GtkCssStyleProperty *property,
GtkCssParser *parser)
GtkCssParser *parser,
GFile *base)
{
GtkCssValue *value = _gtk_css_font_variant_value_try_parse (parser);
@@ -385,7 +390,8 @@ assign_pango_variant (GtkCssStyleProperty *property,
static GtkCssValue *
parse_border_style (GtkCssStyleProperty *property,
GtkCssParser *parser)
GtkCssParser *parser,
GFile *base)
{
GtkCssValue *value = _gtk_css_border_style_value_try_parse (parser);
@@ -412,7 +418,9 @@ assign_border_style (GtkCssStyleProperty *property,
}
static GtkCssValue *
parse_css_area_one (GtkCssParser *parser)
parse_css_area (GtkCssStyleProperty *property,
GtkCssParser *parser,
GFile *base)
{
GtkCssValue *value = _gtk_css_area_value_try_parse (parser);
@@ -422,13 +430,6 @@ parse_css_area_one (GtkCssParser *parser)
return value;
}
static GtkCssValue *
parse_css_area (GtkCssStyleProperty *property,
GtkCssParser *parser)
{
return _gtk_css_array_value_parse (parser, parse_css_area_one, FALSE);
}
static GtkCssValue *
bindings_value_parse_one (GtkCssParser *parser)
{
@@ -454,7 +455,8 @@ bindings_value_parse_one (GtkCssParser *parser)
static GtkCssValue *
bindings_value_parse (GtkCssStyleProperty *property,
GtkCssParser *parser)
GtkCssParser *parser,
GFile *base)
{
return _gtk_css_array_value_parse (parser, bindings_value_parse_one, TRUE);
}
@@ -510,7 +512,8 @@ bindings_value_assign (GtkCssStyleProperty *property,
static GtkCssValue *
shadow_value_parse (GtkCssStyleProperty *property,
GtkCssParser *parser)
GtkCssParser *parser,
GFile *base)
{
return _gtk_css_shadows_value_parse (parser);
}
@@ -525,7 +528,8 @@ shadow_value_compute (GtkCssStyleProperty *property,
static GtkCssValue *
border_corner_radius_value_parse (GtkCssStyleProperty *property,
GtkCssParser *parser)
GtkCssParser *parser,
GFile *base)
{
return _gtk_css_corner_value_parse (parser);
}
@@ -540,7 +544,8 @@ border_corner_radius_value_compute (GtkCssStyleProperty *property,
static GtkCssValue *
css_image_value_parse (GtkCssStyleProperty *property,
GtkCssParser *parser)
GtkCssParser *parser,
GFile *base)
{
GtkCssImage *image;
@@ -548,7 +553,7 @@ css_image_value_parse (GtkCssStyleProperty *property,
image = NULL;
else
{
image = _gtk_css_image_new_parse (parser);
image = _gtk_css_image_new_parse (parser, base);
if (image == NULL)
return FALSE;
}
@@ -616,52 +621,10 @@ css_image_value_assign (GtkCssStyleProperty *property,
return _gtk_css_image_value_new (NULL);
}
static GtkCssValue *
background_image_value_parse_one (GtkCssParser *parser)
{
return css_image_value_parse (NULL, parser);
}
static GtkCssValue *
background_image_value_parse (GtkCssStyleProperty *property,
GtkCssParser *parser)
{
return _gtk_css_array_value_parse (parser, background_image_value_parse_one, FALSE);
}
static GtkCssValue *
background_image_value_compute_one (GtkCssValue *value,
GtkStyleContext *context)
{
return css_image_value_compute (NULL, context, value);
}
static GtkCssValue *
background_image_value_compute (GtkCssStyleProperty *property,
GtkStyleContext *context,
GtkCssValue *specified)
{
return _gtk_css_array_value_compute (specified, background_image_value_compute_one, context);
}
static void
background_image_value_query (GtkCssStyleProperty *property,
const GtkCssValue *css_value,
GValue *value)
{
css_image_value_query (property, _gtk_css_array_value_get_nth (css_value, 0), value);
}
static GtkCssValue *
background_image_value_assign (GtkCssStyleProperty *property,
const GValue *value)
{
return _gtk_css_array_value_new (css_image_value_assign (property, value));
}
static GtkCssValue *
font_size_parse (GtkCssStyleProperty *property,
GtkCssParser *parser)
GtkCssParser *parser,
GFile *base)
{
gdouble d;
@@ -684,7 +647,8 @@ font_size_compute (GtkCssStyleProperty *property,
static GtkCssValue *
outline_parse (GtkCssStyleProperty *property,
GtkCssParser *parser)
GtkCssParser *parser,
GFile *base)
{
return _gtk_css_number_value_parse (parser,
GTK_CSS_NUMBER_AS_PIXELS
@@ -701,7 +665,8 @@ outline_compute (GtkCssStyleProperty *property,
static GtkCssValue *
border_image_repeat_parse (GtkCssStyleProperty *property,
GtkCssParser *parser)
GtkCssParser *parser,
GFile *base)
{
GtkCssValue *value = _gtk_css_border_repeat_value_try_parse (parser);
@@ -716,7 +681,8 @@ border_image_repeat_parse (GtkCssStyleProperty *property,
static GtkCssValue *
border_image_slice_parse (GtkCssStyleProperty *property,
GtkCssParser *parser)
GtkCssParser *parser,
GFile *base)
{
return _gtk_css_border_value_parse (parser,
GTK_CSS_PARSE_PERCENT
@@ -728,7 +694,8 @@ border_image_slice_parse (GtkCssStyleProperty *property,
static GtkCssValue *
border_image_width_parse (GtkCssStyleProperty *property,
GtkCssParser *parser)
GtkCssParser *parser,
GFile *base)
{
return _gtk_css_border_value_parse (parser,
GTK_CSS_PARSE_PERCENT
@@ -765,7 +732,8 @@ transition_property_parse_one (GtkCssParser *parser)
static GtkCssValue *
transition_property_parse (GtkCssStyleProperty *property,
GtkCssParser *parser)
GtkCssParser *parser,
GFile *base)
{
return _gtk_css_array_value_parse (parser, transition_property_parse_one, FALSE);
}
@@ -778,21 +746,24 @@ transition_time_parse_one (GtkCssParser *parser)
static GtkCssValue *
transition_time_parse (GtkCssStyleProperty *property,
GtkCssParser *parser)
GtkCssParser *parser,
GFile *base)
{
return _gtk_css_array_value_parse (parser, transition_time_parse_one, FALSE);
}
static GtkCssValue *
transition_timing_function_parse (GtkCssStyleProperty *property,
GtkCssParser *parser)
GtkCssParser *parser,
GFile *base)
{
return _gtk_css_array_value_parse (parser, _gtk_css_ease_value_parse, FALSE);
}
static GtkCssValue *
engine_parse (GtkCssStyleProperty *property,
GtkCssParser *parser)
GtkCssParser *parser,
GFile *base)
{
return _gtk_css_engine_value_parse (parser);
}
@@ -815,7 +786,8 @@ engine_assign (GtkCssStyleProperty *property,
static GtkCssValue *
parse_margin (GtkCssStyleProperty *property,
GtkCssParser *parser)
GtkCssParser *parser,
GFile *base)
{
return _gtk_css_number_value_parse (parser,
GTK_CSS_NUMBER_AS_PIXELS
@@ -832,7 +804,8 @@ compute_margin (GtkCssStyleProperty *property,
static GtkCssValue *
parse_padding (GtkCssStyleProperty *property,
GtkCssParser *parser)
GtkCssParser *parser,
GFile *base)
{
return _gtk_css_number_value_parse (parser,
GTK_CSS_POSITIVE_ONLY
@@ -850,7 +823,8 @@ compute_padding (GtkCssStyleProperty *property,
static GtkCssValue *
parse_border_width (GtkCssStyleProperty *property,
GtkCssParser *parser)
GtkCssParser *parser,
GFile *base)
{
return _gtk_css_number_value_parse (parser,
GTK_CSS_POSITIVE_ONLY
@@ -878,7 +852,9 @@ compute_border_width (GtkCssStyleProperty *property,
}
static GtkCssValue *
background_repeat_value_parse_one (GtkCssParser *parser)
background_repeat_value_parse (GtkCssStyleProperty *property,
GtkCssParser *parser,
GFile *base)
{
GtkCssValue *value = _gtk_css_background_repeat_value_try_parse (parser);
@@ -891,18 +867,12 @@ background_repeat_value_parse_one (GtkCssParser *parser)
return value;
}
static GtkCssValue *
background_repeat_value_parse (GtkCssStyleProperty *property,
GtkCssParser *parser)
{
return _gtk_css_array_value_parse (parser, background_repeat_value_parse_one, FALSE);
}
static GtkCssValue *
background_size_parse (GtkCssStyleProperty *property,
GtkCssParser *parser)
GtkCssParser *parser,
GFile *base)
{
return _gtk_css_array_value_parse (parser, _gtk_css_bg_size_value_parse, FALSE);
return _gtk_css_bg_size_value_parse (parser);
}
static GtkCssValue *
@@ -910,14 +880,15 @@ background_size_compute (GtkCssStyleProperty *property,
GtkStyleContext *context,
GtkCssValue *specified)
{
return _gtk_css_array_value_compute (specified, _gtk_css_bg_size_value_compute, context);
return _gtk_css_bg_size_value_compute (specified, context);
}
static GtkCssValue *
background_position_parse (GtkCssStyleProperty *property,
GtkCssParser *parser)
GtkCssParser *parser,
GFile *base)
{
return _gtk_css_array_value_parse (parser, _gtk_css_position_value_parse, FALSE);
return _gtk_css_position_value_parse (parser);
}
static GtkCssValue *
@@ -925,7 +896,7 @@ background_position_compute (GtkCssStyleProperty *property,
GtkStyleContext *context,
GtkCssValue *specified)
{
return _gtk_css_array_value_compute (specified, _gtk_css_position_value_compute, context);
return _gtk_css_position_value_compute (specified, context);
}
/*** REGISTRATION ***/
@@ -1308,7 +1279,7 @@ _gtk_css_style_property_init_properties (void)
NULL,
NULL,
NULL,
_gtk_css_array_value_new (_gtk_css_area_value_new (GTK_CSS_AREA_BORDER_BOX)));
_gtk_css_area_value_new (GTK_CSS_AREA_BORDER_BOX));
gtk_css_style_property_register ("background-origin",
GTK_CSS_PROPERTY_BACKGROUND_ORIGIN,
G_TYPE_NONE,
@@ -1318,7 +1289,7 @@ _gtk_css_style_property_init_properties (void)
NULL,
NULL,
NULL,
_gtk_css_array_value_new (_gtk_css_area_value_new (GTK_CSS_AREA_PADDING_BOX)));
_gtk_css_area_value_new (GTK_CSS_AREA_PADDING_BOX));
gtk_css_style_property_register ("background-size",
GTK_CSS_PROPERTY_BACKGROUND_SIZE,
G_TYPE_NONE,
@@ -1328,7 +1299,7 @@ _gtk_css_style_property_init_properties (void)
background_size_compute,
NULL,
NULL,
_gtk_css_array_value_new (_gtk_css_bg_size_value_new (NULL, NULL)));
_gtk_css_bg_size_value_new (NULL, NULL));
gtk_css_style_property_register ("background-position",
GTK_CSS_PROPERTY_BACKGROUND_POSITION,
G_TYPE_NONE,
@@ -1338,8 +1309,8 @@ _gtk_css_style_property_init_properties (void)
background_position_compute,
NULL,
NULL,
_gtk_css_array_value_new (_gtk_css_position_value_new (_gtk_css_number_value_new (0, GTK_CSS_PERCENT),
_gtk_css_number_value_new (0, GTK_CSS_PERCENT))));
_gtk_css_position_value_new (_gtk_css_number_value_new (0, GTK_CSS_PERCENT),
_gtk_css_number_value_new (0, GTK_CSS_PERCENT)));
gtk_css_style_property_register ("border-top-color",
GTK_CSS_PROPERTY_BORDER_TOP_COLOR,
@@ -1411,18 +1382,18 @@ _gtk_css_style_property_init_properties (void)
NULL,
NULL,
NULL,
_gtk_css_array_value_new (_gtk_css_background_repeat_value_new (GTK_CSS_REPEAT_STYLE_REPEAT,
GTK_CSS_REPEAT_STYLE_REPEAT)));
_gtk_css_background_repeat_value_new (GTK_CSS_REPEAT_STYLE_REPEAT,
GTK_CSS_REPEAT_STYLE_REPEAT));
gtk_css_style_property_register ("background-image",
GTK_CSS_PROPERTY_BACKGROUND_IMAGE,
CAIRO_GOBJECT_TYPE_PATTERN,
GTK_STYLE_PROPERTY_ANIMATED,
background_image_value_parse,
css_image_value_parse,
NULL,
background_image_value_compute,
background_image_value_query,
background_image_value_assign,
_gtk_css_array_value_new (_gtk_css_image_value_new (NULL)));
css_image_value_compute,
css_image_value_query,
css_image_value_assign,
_gtk_css_image_value_new (NULL));
gtk_css_style_property_register ("border-image-source",
GTK_CSS_PROPERTY_BORDER_IMAGE_SOURCE,
+2 -1
View File
@@ -35,7 +35,8 @@ typedef struct _GtkCssStyleProperty GtkCssStyleProperty;
typedef struct _GtkCssStylePropertyClass GtkCssStylePropertyClass;
typedef GtkCssValue * (* GtkCssStylePropertyParseFunc) (GtkCssStyleProperty *property,
GtkCssParser *parser);
GtkCssParser *parser,
GFile *base);
typedef void (* GtkCssStylePropertyPrintFunc) (GtkCssStyleProperty *property,
const GtkCssValue *value,
GString *string);
+1
View File
@@ -35,6 +35,7 @@
#include "gtkimageprivate.h"
#include "gtkinvisible.h"
#include "gtkmain.h"
#include "gtkplug.h"
#include "gtkstock.h"
#include "gtkwindow.h"
#include "gtkintl.h"
+4 -12
View File
@@ -1594,7 +1594,7 @@ gtk_grid_attach_next_to (GtkGrid *grid,
* Gets the child of @grid whose area covers the grid
* cell whose upper left corner is at @left, @top.
*
* Returns: (transfer none): the child at the given position, or %NULL
* Returns: the child at the given position, or %NULL
*
* Since: 3.2
*/
@@ -1603,14 +1603,10 @@ gtk_grid_get_child_at (GtkGrid *grid,
gint left,
gint top)
{
GtkGridPrivate *priv;
GtkGridPrivate *priv = grid->priv;
GtkGridChild *child;
GList *list;
g_return_val_if_fail (GTK_IS_GRID (grid), NULL);
priv = grid->priv;
for (list = priv->children; list; list = list->next)
{
child = list->data;
@@ -1642,15 +1638,13 @@ void
gtk_grid_insert_row (GtkGrid *grid,
gint position)
{
GtkGridPrivate *priv;
GtkGridPrivate *priv = grid->priv;
GtkGridChild *child;
GList *list;
gint top, height;
g_return_if_fail (GTK_IS_GRID (grid));
priv = grid->priv;
for (list = priv->children; list; list = list->next)
{
child = list->data;
@@ -1688,15 +1682,13 @@ void
gtk_grid_insert_column (GtkGrid *grid,
gint position)
{
GtkGridPrivate *priv;
GtkGridPrivate *priv = grid->priv;
GtkGridChild *child;
GList *list;
gint left, width;
g_return_if_fail (GTK_IS_GRID (grid));
priv = grid->priv;
for (list = priv->children; list; list = list->next)
{
child = list->data;
-7
View File
@@ -3862,13 +3862,6 @@ gtk_icon_theme_lookup_by_gicon (GtkIconTheme *icon_theme,
info = icon_info_new ();
info->loadable = G_LOADABLE_ICON (g_object_ref (icon));
if (G_IS_FILE_ICON (icon))
{
GFile *file = g_file_icon_get_file (G_FILE_ICON (icon));
if (file != NULL)
info->filename = g_file_get_path (file);
}
info->dir_type = ICON_THEME_DIR_UNTHEMED;
info->dir_size = size;
info->desired_size = size;
+1 -10
View File
@@ -2854,10 +2854,6 @@ gtk_icon_view_layout (GtkIconView *icon_view)
gint n_columns, n_rows, n_items;
gint col, row;
GtkRequestedSize *sizes;
gboolean rtl;
rtl = gtk_widget_get_direction (GTK_WIDGET (icon_view)) == GTK_TEXT_DIR_RTL;
n_items = gtk_icon_view_get_n_items (icon_view);
@@ -2956,13 +2952,8 @@ gtk_icon_view_layout (GtkIconView *icon_view)
item->cell_area.height = sizes[row].minimum_size;
item->row = row;
item->col = col;
if (rtl)
{
item->cell_area.x = priv->width - item_width - item->cell_area.x;
item->col = n_columns - 1 - col;
}
}
priv->height += sizes[row].minimum_size + priv->item_padding + priv->row_spacing;
}
+1 -1
View File
@@ -622,7 +622,7 @@ gtk_im_context_set_surrounding (GtkIMContext *context,
* string of text holding context around the insertion point.
* If the function returns %TRUE, then you must free the result
* stored in this location with g_free().
* @cursor_index: (out): location to store byte index of the insertion
* @cursor_index: (out) location to store byte index of the insertion
* cursor within @text.
*
* Retrieves context around the insertion point. Input methods
-39
View File
@@ -364,40 +364,6 @@ check_win32_special_case_after_compact_match (GtkIMContextSimple *context_sim
#endif
#ifdef GDK_WINDOWING_QUARTZ
static gboolean
check_quartz_special_cases (GtkIMContextSimple *context_simple,
gint n_compose)
{
GtkIMContextSimplePrivate *priv = context_simple->priv;
if (n_compose == 2 &&
priv->compose_buffer[1] == GDK_KEY_space)
{
gunichar value = 0;
switch (priv->compose_buffer[0])
{
case GDK_KEY_dead_doubleacute:
value = '"'; break;
}
if (value > 0)
{
gtk_im_context_simple_commit_char (GTK_IM_CONTEXT (context_simple), value);
priv->compose_buffer[0] = 0;
GTK_NOTE (MISC, g_print ("quartz: U+%04X\n", value));
return TRUE;
}
}
return FALSE;
}
#endif
static gboolean
check_compact_table (GtkIMContextSimple *context_simple,
const GtkComposeTableCompact *table,
@@ -1102,11 +1068,6 @@ gtk_im_context_simple_filter_keypress (GtkIMContext *context,
return TRUE;
#endif
#ifdef GDK_WINDOWING_QUARTZ
if (check_quartz_special_cases (context_simple, n_compose))
return TRUE;
#endif
if (check_compact_table (context_simple, &gtk_compose_table_compact, n_compose))
return TRUE;
+5 -5
View File
@@ -1012,11 +1012,10 @@ gtk_info_bar_buildable_custom_tag_start (GtkBuildable *buildable,
{
ActionWidgetsSubParserData *parser_data;
if (parent_buildable_iface->custom_tag_start (buildable, builder, child,
tagname, parser, data))
return TRUE;
if (child)
return FALSE;
if (!child && strcmp (tagname, "action-widgets") == 0)
if (strcmp (tagname, "action-widgets") == 0)
{
parser_data = g_slice_new0 (ActionWidgetsSubParserData);
parser_data->info_bar = GTK_INFO_BAR (buildable);
@@ -1027,7 +1026,8 @@ gtk_info_bar_buildable_custom_tag_start (GtkBuildable *buildable,
return TRUE;
}
return FALSE;
return parent_buildable_iface->custom_tag_start (buildable, builder, child,
tagname, parser, data);
}
static void
+1 -4
View File
@@ -526,10 +526,7 @@ gtk_link_button_button_press (GtkWidget *widget,
if (!gtk_widget_has_focus (widget))
gtk_widget_grab_focus (widget);
/* Don't popup the menu if there's no URI set,
* otherwise the menu item will trigger a warning */
if (gdk_event_triggers_context_menu ((GdkEvent *) event) &&
GTK_LINK_BUTTON (widget)->priv->uri != NULL)
if (gdk_event_triggers_context_menu ((GdkEvent *) event))
{
gtk_link_button_do_popup (GTK_LINK_BUTTON (widget), event);
+7052
View File
File diff suppressed because it is too large Load Diff
+128
View File
@@ -0,0 +1,128 @@
/* gtklistview.h
* Copyright (C) 2012 Benjamin Otte <otte@redhat.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library 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
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION)
#error "Only <gtk/gtk.h> can be included directly."
#endif
#ifndef __GTK_LIST_VIEW_H__
#define __GTK_LIST_VIEW_H__
#include <gtk/gtkcontainer.h>
#include <gtk/gtktreemodel.h>
#include <gtk/gtkcellrenderer.h>
#include <gtk/gtkcellarea.h>
#include <gtk/gtkselection.h>
#include <gtk/gtktooltip.h>
G_BEGIN_DECLS
#define GTK_TYPE_LIST_VIEW (gtk_list_view_get_type ())
#define GTK_LIST_VIEW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_LIST_VIEW, GtkListView))
#define GTK_LIST_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_LIST_VIEW, GtkListViewClass))
#define GTK_IS_LIST_VIEW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_LIST_VIEW))
#define GTK_IS_LIST_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_LIST_VIEW))
#define GTK_LIST_VIEW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_LIST_VIEW, GtkListViewClass))
typedef struct _GtkListView GtkListView;
typedef struct _GtkListViewClass GtkListViewClass;
typedef struct _GtkListViewPrivate GtkListViewPrivate;
#if 0
/**
* GtkListViewForeachFunc:
* @list_view: a #GtkListView
* @path: The #GtkTreePath of a selected row
* @data: user data
*
* A function used by gtk_list_view_selected_foreach() to map all
* selected rows. It will be called on every selected row in the view.
*/
typedef void (* GtkListViewForeachFunc) (GtkListView *list_view,
GtkTreePath *path,
gpointer data);
#endif
struct _GtkListView
{
GtkContainer parent;
/*< private >*/
GtkListViewPrivate *priv;
};
struct _GtkListViewClass
{
GtkContainerClass parent_class;
void (* item_activated) (GtkListView *list_view,
GtkTreePath *path);
void (* selection_changed) (GtkListView *list_view);
/* Key binding signals */
void (* select_all) (GtkListView *list_view);
void (* unselect_all) (GtkListView *list_view);
void (* select_cursor_item) (GtkListView *list_view);
void (* toggle_cursor_item) (GtkListView *list_view);
gboolean (* move_cursor) (GtkListView *list_view,
GtkMovementStep step,
gint count);
gboolean (* activate_cursor_item) (GtkListView *list_view);
/* Padding for future expansion */
void (*_gtk_reserved1) (void);
void (*_gtk_reserved2) (void);
void (*_gtk_reserved3) (void);
void (*_gtk_reserved4) (void);
};
GType gtk_list_view_get_type (void) G_GNUC_CONST;
GtkWidget * gtk_list_view_new (void);
GtkWidget * gtk_list_view_new_with_model (GtkTreeModel *model);
void gtk_list_view_set_model (GtkListView *list_view,
GtkTreeModel *model);
GtkTreeModel * gtk_list_view_get_model (GtkListView *list_view);
void gtk_list_view_set_selection_mode (GtkListView *list_view,
GtkSelectionMode mode);
GtkSelectionMode gtk_list_view_get_selection_mode (GtkListView *list_view);
gboolean gtk_list_view_get_visible_range (GtkListView *list_view,
GtkTreePath **start_path,
GtkTreePath **end_path);
#if 0
/* for when we support selections, we want to imitate Iconview API */
void gtk_list_view_selected_foreach (GtkListView *list_view,
GtkListViewForeachFunc func,
gpointer data);
void gtk_list_view_select_path (GtkListView *list_view,
GtkTreePath *path);
void gtk_list_view_unselect_path (GtkListView *list_view,
GtkTreePath *path);
gboolean gtk_list_view_path_is_selected (GtkListView *list_view,
GtkTreePath *path);
GList * gtk_list_view_get_selected_items (GtkListView *list_view);
void gtk_list_view_select_all (GtkListView *list_view);
void gtk_list_view_unselect_all (GtkListView *list_view);
#endif
G_END_DECLS
#endif /* __GTK_LIST_VIEW_H__ */
+10 -10
View File
@@ -34,21 +34,21 @@
* preference dialogs to allow users to obtain and revoke authorizations
* needed to operate the controls. The required authorization is represented
* by a #GPermission object. Concrete implementations of #GPermission may use
* PolicyKit or some other authorization framework. To obtain a PolicyKit-based
* #GPermission, use polkit_permission_new().
* PolicyKit or some other authorization framework.
*
* If the user is not currently allowed to perform the action, but can obtain
* the permission, the widget looks like this
* If the user lacks the authorization but authorization can be obtained
* through authentication, the widget looks like this
* <informalexample><inlinegraphic fileref="lockbutton-locked.png"></inlinegraphic></informalexample>
* and the user can click the button to request the permission. Depending
* and the user can click the button to obtain the authorization. Depending
* on the platform, this may pop up an authentication dialog or ask the user
* to authenticate in some other way. Once the user has obtained the permission,
* the widget changes to this
* to authenticate in some other way. Once authorization is obtained, the
* widget changes to this
* <informalexample><inlinegraphic fileref="lockbutton-unlocked.png"></inlinegraphic></informalexample>
* and the permission can be dropped again by clicking the button. If the user
* is not able to obtain the permission at all, the widget looks like this
* and the authorization can be dropped by clicking the button. If the user
* is not able to obtain authorization at all, the widget looks like this
* <informalexample><inlinegraphic fileref="lockbutton-sorry.png"></inlinegraphic></informalexample>
* If the user has the permission and cannot drop it, the button is hidden.
* If the user is authorized and cannot drop the authorization, the button
* is hidden.
*
* The text (and tooltips) that are shown in the various cases can be adjusted
* with the #GtkLockButton:text-lock, #GtkLockButton:text-unlock,
+4 -1
View File
@@ -269,7 +269,7 @@ gtk_menu_tool_button_class_init (GtkMenuToolButtonClass *klass)
* The ::show-menu signal is emitted before the menu is shown.
*
* It can be used to populate the menu on demand, using
* gtk_menu_tool_button_set_menu().
* gtk_menu_tool_button_get_menu().
* Note that even if you populate the menu dynamically in this way,
* you must set an empty menu on the #GtkMenuToolButton beforehand,
@@ -305,6 +305,7 @@ menu_position_func (GtkMenu *menu,
GtkMenuToolButtonPrivate *priv = button->priv;
GtkAllocation arrow_allocation;
GtkWidget *widget = GTK_WIDGET (button);
GtkRequisition req;
GtkRequisition menu_req;
GtkOrientation orientation;
GtkTextDirection direction;
@@ -354,6 +355,8 @@ menu_position_func (GtkMenu *menu,
else
{
gdk_window_get_origin (gtk_button_get_event_window (GTK_BUTTON (priv->arrow_button)), x, y);
gtk_widget_get_preferred_size (priv->arrow_button,
&req, NULL);
gtk_widget_get_allocation (priv->arrow_button, &arrow_allocation);
+2 -4
View File
@@ -2033,7 +2033,6 @@ gtk_notebook_get_preferred_tabs_size (GtkNotebook *notebook,
gint tab_overlap;
gint tab_curvature;
gint arrow_spacing;
gint initial_gap;
gint scroll_arrow_hlength;
gint scroll_arrow_vlength;
@@ -2043,7 +2042,6 @@ gtk_notebook_get_preferred_tabs_size (GtkNotebook *notebook,
gtk_widget_style_get (widget,
"focus-line-width", &focus_width,
"focus-padding", &focus_pad,
"initial-gap", &initial_gap,
"tab-overlap", &tab_overlap,
"tab-curvature", &tab_curvature,
"arrow-spacing", &arrow_spacing,
@@ -2147,7 +2145,7 @@ gtk_notebook_get_preferred_tabs_size (GtkNotebook *notebook,
action_width += action_widget_requisition[ACTION_WIDGET_START].width;
action_width += action_widget_requisition[ACTION_WIDGET_END].width;
requisition->width = tab_width + tab_overlap + action_width + initial_gap;
requisition->width = tab_width + tab_overlap + action_width;
requisition->height = tab_height;
break;
@@ -2186,7 +2184,7 @@ gtk_notebook_get_preferred_tabs_size (GtkNotebook *notebook,
action_height += action_widget_requisition[ACTION_WIDGET_START].height;
action_height += action_widget_requisition[ACTION_WIDGET_END].height;
requisition->height = tab_height + tab_overlap + action_height + initial_gap;
requisition->height = tab_height + tab_overlap + action_height;
requisition->height = MAX (requisition->height, tab_max + tab_overlap);
-2
View File
@@ -134,8 +134,6 @@ void gtk_print_settings_set_int (GtkPrintSettings
#define GTK_PRINT_SETTINGS_RESOLUTION_X "resolution-x"
#define GTK_PRINT_SETTINGS_RESOLUTION_Y "resolution-y"
#define GTK_PRINT_SETTINGS_PRINTER_LPI "printer-lpi"
#define GTK_PRINT_SETTINGS_OUTPUT_DIR "output-dir"
#define GTK_PRINT_SETTINGS_OUTPUT_BASENAME "output-basename"
/**
* GTK_PRINT_SETTINGS_OUTPUT_FILE_FORMAT:
+21 -29
View File
@@ -2010,7 +2010,6 @@ gtk_range_draw (GtkWidget *widget,
gboolean draw_trough = TRUE;
gboolean draw_slider = TRUE;
GtkStyleContext *context;
GtkBorder margin;
context = gtk_widget_get_style_context (widget);
@@ -2108,12 +2107,6 @@ gtk_range_draw (GtkWidget *widget,
gtk_style_context_save (context);
gtk_style_context_add_class (context, GTK_STYLE_CLASS_TROUGH);
gtk_style_context_get_margin (context, widget_state, &margin);
x += margin.left;
y += margin.top;
width -= margin.left + margin.right;
height -= margin.top + margin.bottom;
if (draw_trough)
{
@@ -2243,6 +2236,13 @@ gtk_range_draw (GtkWidget *widget,
fill_y += priv->trough.height - fill_height;
}
#if 0
if (fill_level < gtk_adjustment_get_upper (priv->adjustment) - gtk_adjustment_get_page_size (priv->adjustment))
fill_detail = "trough-fill-level-full";
else
fill_detail = "trough-fill-level";
#endif
gtk_render_activity (context, cr,
fill_x, fill_y,
fill_width, fill_height);
@@ -3583,15 +3583,13 @@ gtk_range_calc_layout (GtkRange *range,
GtkRangePrivate *priv = range->priv;
gint slider_width, stepper_size, focus_width, trough_border, stepper_spacing;
gint slider_length;
GtkBorder border, trough_margin;
GtkBorder border;
gint n_steppers;
gboolean has_steppers_ab;
gboolean has_steppers_cd;
gboolean trough_under_steppers;
GdkRectangle range_rect;
GtkWidget *widget;
GtkStyleContext *context;
GtkStateFlags state;
if (!priv->need_recalc)
return;
@@ -3607,13 +3605,6 @@ gtk_range_calc_layout (GtkRange *range,
*/
widget = GTK_WIDGET (range);
context = gtk_widget_get_style_context (widget);
state = gtk_widget_get_state_flags (widget);
gtk_style_context_save (context);
gtk_style_context_add_class (context, GTK_STYLE_CLASS_TROUGH);
gtk_style_context_get_margin (context, state, &trough_margin);
gtk_style_context_restore (context);
gtk_range_get_props (range,
&slider_width, &stepper_size,
@@ -3732,16 +3723,16 @@ gtk_range_calc_layout (GtkRange *range,
/* Now the trough is the remaining space between steppers B and C,
* if any, minus spacing
*/
priv->trough.x = range_rect.x + trough_margin.left;
priv->trough.y = priv->stepper_b.y + priv->stepper_b.height + stepper_spacing * has_steppers_ab + trough_margin.top;
priv->trough.width = range_rect.width - trough_margin.left - trough_margin.right;
priv->trough.height = priv->stepper_c.y - priv->trough.y - stepper_spacing * has_steppers_cd - trough_margin.bottom;
priv->trough.x = range_rect.x;
priv->trough.y = priv->stepper_b.y + priv->stepper_b.height + stepper_spacing * has_steppers_ab;
priv->trough.width = range_rect.width;
priv->trough.height = priv->stepper_c.y - priv->trough.y - stepper_spacing * has_steppers_cd;
/* Slider fits into the trough, with stepper_spacing on either side,
* and the size/position based on the adjustment or fixed, depending.
*/
priv->slider.x = range_rect.x + focus_width + trough_border;
priv->slider.width = range_rect.width - (focus_width + trough_border) * 2;
priv->slider.x = priv->trough.x + focus_width + trough_border;
priv->slider.width = priv->trough.width - (focus_width + trough_border) * 2;
/* Compute slider position/length */
{
@@ -3880,16 +3871,17 @@ gtk_range_calc_layout (GtkRange *range,
/* Now the trough is the remaining space between steppers B and C,
* if any
*/
priv->trough.x = priv->stepper_b.x + priv->stepper_b.width + stepper_spacing * has_steppers_ab + trough_margin.left;
priv->trough.y = range_rect.y + trough_margin.top;
priv->trough.width = priv->stepper_c.x - priv->trough.x - stepper_spacing * has_steppers_cd - trough_margin.right;
priv->trough.height = range_rect.height - trough_margin.top - trough_margin.bottom;
priv->trough.x = priv->stepper_b.x + priv->stepper_b.width + stepper_spacing * has_steppers_ab;
priv->trough.y = range_rect.y;
priv->trough.width = priv->stepper_c.x - priv->trough.x - stepper_spacing * has_steppers_cd;
priv->trough.height = range_rect.height;
/* Slider fits into the trough, with stepper_spacing on either side,
* and the size/position based on the adjustment or fixed, depending.
*/
priv->slider.y = range_rect.y + focus_width + trough_border;
priv->slider.height = range_rect.height - (focus_width + trough_border) * 2;
priv->slider.y = priv->trough.y + focus_width + trough_border;
priv->slider.height = priv->trough.height - (focus_width + trough_border) * 2;
/* Compute slider position/length */
{
+2 -2
View File
@@ -26,8 +26,8 @@
* export ftw() and friends only if _XOPEN_SOURCE and _GNU_SOURCE
* are defined. see bug #444097.
*/
#define _XOPEN_SOURCE 600
#define _GNU_SOURCE
#define _XOPEN_SOURCE 500
#define _GNU_SOURCE
#ifdef HAVE_FTW_H
#include <ftw.h>
+3 -3
View File
@@ -28,7 +28,6 @@
#include "config.h"
#include <string.h>
#include <stdlib.h>
#include "gtkstatusicon.h"
@@ -1329,9 +1328,10 @@ round_pixel_size (GtkWidget *widget,
for (s = GTK_ICON_SIZE_MENU; s <= GTK_ICON_SIZE_DIALOG; s++)
{
if (gtk_icon_size_lookup_for_settings (settings, s, &w, &h))
if (gtk_icon_size_lookup_for_settings (settings, s, &w, &h) &&
w <= pixel_size && h <= pixel_size)
{
d = MAX (abs (pixel_size - w), abs (pixel_size - h));
d = MAX (pixel_size - w, pixel_size - h);
if (d < dist)
{
dist = d;
+1 -1
View File
@@ -369,7 +369,7 @@ static const GtkStockItem builtin_items [] =
/* This is a navigation label as in "go up" */
{ GTK_STOCK_GO_UP, NC_("Stock label, navigation", "_Up"), 0, 0, GETTEXT_PACKAGE "-navigation" },
{ GTK_STOCK_HARDDISK, NC_("Stock label", "_Hard Disk"), 0, 0, GETTEXT_PACKAGE },
{ GTK_STOCK_HELP, NC_("Stock label", "_Help"), 0, GDK_KEY_F1, GETTEXT_PACKAGE },
{ GTK_STOCK_HELP, NC_("Stock label", "_Help"), PRIMARY_MODIFIER, 'h', GETTEXT_PACKAGE },
{ GTK_STOCK_HOME, NC_("Stock label", "_Home"), 0, 0, GETTEXT_PACKAGE },
{ GTK_STOCK_INDENT, NC_("Stock label", "Increase Indent"), 0, 0, GETTEXT_PACKAGE },
{ GTK_STOCK_UNINDENT, NC_("Stock label", "Decrease Indent"), 0, 0, GETTEXT_PACKAGE },

Some files were not shown because too many files have changed in this diff Show More