Compare commits
89 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 784242fd20 | |||
| e0807fcf54 | |||
| 8fd5b567dc | |||
| a6de3ed7b4 | |||
| 3658b8f709 | |||
| c0b03564f5 | |||
| 8535610b19 | |||
| 0e7228b267 | |||
| 5b527d6910 | |||
| eb3fd5e941 | |||
| ca192a87c2 | |||
| fa77925da2 | |||
| 172dc3e79a | |||
| cb39169ba7 | |||
| 577dfb9e2f | |||
| db7f085315 | |||
| de18859249 | |||
| 5fb999010c | |||
| 2c3a7c63ef | |||
| 078870f604 | |||
| c52d9cfc14 | |||
| e37e1dfcb0 | |||
| 2e5307daea | |||
| cb4ea3fc65 | |||
| 56033a8d27 | |||
| f7f3939b04 | |||
| 13a36e81dc | |||
| affb4ff5f4 | |||
| ee22277f18 | |||
| cc73241c7b | |||
| ac358d2507 | |||
| 9ee60777e7 | |||
| effdf3af74 | |||
| a8463953a4 | |||
| 7793aab5f0 | |||
| ecf9fa65b8 | |||
| a32933b056 | |||
| e0f3e8a7e5 | |||
| 1f9de707f7 | |||
| 8b2c3a8c1a | |||
| e7af3410cf | |||
| 84d3bfb6fd | |||
| 448551f31c | |||
| 7b8c036f8f | |||
| 747be0f499 | |||
| 9008f7702d | |||
| df0454236c | |||
| 8373b906d4 | |||
| 4b4ae4464c | |||
| 0bca6969d4 | |||
| 660087db42 | |||
| 927004178f | |||
| 1b8de2d5fa | |||
| 483d25f418 | |||
| 1d30ada735 | |||
| 8a00551871 | |||
| 0ed3a77d29 | |||
| 29b61176bb | |||
| 174c4fa7ee | |||
| 08adcb6318 | |||
| 504eb89155 | |||
| b75b5e900a | |||
| ca4ec52c54 | |||
| 908d4f1d1f | |||
| 62573f299c | |||
| c0bf48c8ab | |||
| 26f35fb941 | |||
| d49335c59a | |||
| f62c92783a | |||
| f3f4d40b89 | |||
| b0bfe606aa | |||
| 32ae97f13a | |||
| 3354d91090 | |||
| b6db96cd1a | |||
| b2ea707614 | |||
| af66faf604 | |||
| 5afc01d995 | |||
| f353ba3acb | |||
| eebf151f2a | |||
| e8d3899461 | |||
| e7bb83988f | |||
| b9b62fca0c | |||
| 03c1c604dd | |||
| 504574b6be | |||
| efb934c07f | |||
| 69adcc46c9 | |||
| 593edacb48 | |||
| f05865ad3a | |||
| 0997ffbc5b |
@@ -1,3 +1,31 @@
|
||||
Overview of Changes in GTK+ 3.23.1
|
||||
==================================
|
||||
|
||||
* Backported event controllers from GTK+ 4:
|
||||
- GtkEventControllerScroll
|
||||
- GtkEventControllerMotion
|
||||
- GtkEventControllerKey
|
||||
- GtkGestureStylus
|
||||
|
||||
* Support markup in GtkModelButtons
|
||||
|
||||
* Themes
|
||||
- The Raleigh theme has been removed
|
||||
- Expander size in HighContrast has been increased
|
||||
|
||||
* Wayland
|
||||
- Update cursor scale when needed
|
||||
- Decoration negotiation protocol fixes
|
||||
|
||||
* Windows
|
||||
- Add an EGL renderer based on ANGLE
|
||||
|
||||
* Translation updates:
|
||||
- Brazilian Portuguese
|
||||
- German
|
||||
- Hungarian
|
||||
|
||||
|
||||
Overview of Changes in GTK+ 3.23.0
|
||||
==================================
|
||||
|
||||
@@ -15,6 +43,12 @@ Overview of Changes in GTK+ 3.23.0
|
||||
- Support a completion popup for Emoji
|
||||
- Drop Ctrl-Shift-e shortcut
|
||||
|
||||
* Other new apis:
|
||||
- gdk_window_move_to_rect
|
||||
|
||||
* Wayland:
|
||||
- Use anonymous shared memory on FreeBSD
|
||||
|
||||
* Bugs fixed:
|
||||
#85 widgetDragDestFindTarget introspection data does not show nullable...
|
||||
#154 Documentation: Lifecycle of Editables inside GtkCellRenderers is no...
|
||||
@@ -24,15 +58,26 @@ Overview of Changes in GTK+ 3.23.0
|
||||
#450 Menu navigation triangle doesn't work anymore
|
||||
#792 Focus events are not always matched
|
||||
#898 emoji-chooser: search for flags doesn't work
|
||||
#997 gdk: Make gdk_window_move_to_rect public
|
||||
#1053 Scroll cursor gets left behind if a child widget steals the scroll
|
||||
#1059 -Wparentheses warnings in GTK+ headers when compiling C++ code with...
|
||||
#1065 GtkScrollbar horizontal mouse wheel scroll direction is wrong
|
||||
#1069 Thread 1 "glade" received signal SIGFPE, Arithmetic exception.
|
||||
#1088 CssGadget: Round px values up for min-width|height
|
||||
#1115 gtk icon theme searches system dirs before user dirs
|
||||
#1134 x11: Always set None pixmap for no background
|
||||
#1160 a11y/entry: Fix copy-pasteo re 2ndary icon tooltip
|
||||
#1165 InfoBar: Fix wrong type in copy-pasted param doc
|
||||
#1166 EmojiCompletion: Use Box:spacing instead of CSS
|
||||
!125 HC: Avoid same BG/FG colors in flat treeview entry
|
||||
!157 wayland: Implement 'gtk-fontconfig-timestamp' & 'gtk-modules'
|
||||
!181 W32: Don't forget to check VK_MENU and set MK_ALT
|
||||
!206 searchenginetracker: Don't leak the hits' GFiles
|
||||
407242 GtkScale: Up/Down keys decrease/increase value, which is opposite...
|
||||
686109 gtk_print_context_get_hard_margins should return page size specif...
|
||||
765327 GtkPlug scaled to half the expected size on HiDPI screens
|
||||
772817 File Chooser: Path arrow button frames are reversed and detached ...
|
||||
773299 gtk/language-names.c: Fix build on non-GCC/CLang
|
||||
775279 early calls to libepoxy cause all gtk3 programs to abort when the...
|
||||
786524 ocument GTK_OVERLAY_SCROLLING environment variable
|
||||
787867 OSX macports pango text size appears to vary between version 1.40...
|
||||
|
||||
@@ -42,6 +42,7 @@ EXTRA_DIST += \
|
||||
replace.py \
|
||||
pc_base.py \
|
||||
gtkpc.py \
|
||||
README_EGL_MSVC.txt \
|
||||
$(GENERATED_ITEMS)
|
||||
|
||||
-include $(top_srcdir)/git.mk
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
Notes on enabling EGL (ANGLE/D3D support) for Windows/Visual Studio builds
|
||||
==========================================================================
|
||||
There is now support in the GL context creation code for Windows in GDK for
|
||||
creating and using EGL (OpenGL ES 3) contexts, which can be used instead of
|
||||
the existing OpenGL (Desktop) support, especially when the graphics drivers
|
||||
do not support OpenGL adequately.
|
||||
|
||||
This support is not enabled by default in the project files. In order to do
|
||||
so, please do the following:
|
||||
|
||||
-Obtain or compile a build of recent version of ANGLE. The one that comes
|
||||
with QT 5.10.x is sufficiently recent, but not the one that comes with QT-
|
||||
5.6.x. Note that Visual Studio 2013 or later is required for building
|
||||
ANGLE from QT-5.10.x, but the Visual Studio 2013-built ANGLE DLLs does work
|
||||
without problems with GTK+ built with Visual Studio 2008~2013. You may
|
||||
need to obtain D3Dcompiler_[47|43|42].dll if it does not come with the
|
||||
system (which is part of the DirectX runtimes). Its headers and .lib
|
||||
needs to be set to be found by the compiler and linker respectively before
|
||||
building libepoxy.
|
||||
-Build libepoxy with EGL support, which has to be enabled explicitly on
|
||||
Windows builds. Pass in -Degl=yes when building libepoxy using Meson.
|
||||
Build and install, making sure the headers and .lib can be located by the
|
||||
compiler and linker respectively.
|
||||
-Open the vsX/gtk+.sln, and open the project properties in the "gdk3-win32"
|
||||
project. Under "C/C++", add GDK_WIN32_ENABLE_EGL in the "Preprocessor
|
||||
Definitions" to the existing definitions in there for the configuration
|
||||
that is being built. Then build the solution.
|
||||
-To force the use of the EGL code, set the envvar GDK_GL=(...,)gles , where (...,)
|
||||
are the other GDK_GL options desired.
|
||||
+38
-1
@@ -10,7 +10,7 @@
|
||||
|
||||
m4_define([gtk_major_version], [3])
|
||||
m4_define([gtk_minor_version], [23])
|
||||
m4_define([gtk_micro_version], [0])
|
||||
m4_define([gtk_micro_version], [1])
|
||||
m4_define([gtk_interface_age], [0])
|
||||
m4_define([gtk_binary_age],
|
||||
[m4_eval(100 * gtk_minor_version + gtk_micro_version)])
|
||||
@@ -1434,6 +1434,43 @@ else
|
||||
X11_PREFIX="$ac_default_prefix"
|
||||
fi
|
||||
|
||||
AC_ARG_ENABLE(win32-gles,
|
||||
[AS_HELP_STRING([--enable-win32-gles],
|
||||
[enable OpenGL ES rendering in Win32 backend, disabled by default])],
|
||||
[win32_gles=yes],
|
||||
[win32_gles=no])
|
||||
|
||||
if test x"$enable_win32_backend" = xyes; then
|
||||
AC_MSG_CHECKING(WGL support in epoxy)
|
||||
WGL_SUPPORT="`$PKG_CONFIG --variable=epoxy_has_wgl epoxy`"
|
||||
if test x"$WGL_SUPPORT" = x1; then
|
||||
AC_MSG_RESULT([supported])
|
||||
else
|
||||
AC_MSG_ERROR([
|
||||
*** epoxy was not built with WGL support or epoxy version is too old.
|
||||
*** WGL support in epoxy is enabled by default for all Windows builds,
|
||||
*** and is used by GTK+ uncondititonally. If it is not there, then
|
||||
*** something is very wrong.
|
||||
])
|
||||
fi
|
||||
if test x"$win32_gles" = xyes; then
|
||||
AC_MSG_CHECKING(EGL support in epoxy)
|
||||
EGL_SUPPORT="`$PKG_CONFIG --variable=epoxy_has_egl epoxy`"
|
||||
if test x"$EGL_SUPPORT" = x1; then
|
||||
AC_MSG_RESULT([supported])
|
||||
else
|
||||
AC_MSG_ERROR([
|
||||
*** epoxy was not built with EGL support or epoxy version is too old.
|
||||
*** EGL support in epoxy is disabled by default in Windows builds,
|
||||
*** you might need to rebuild epoxy with explicit --enable-egl=yes.
|
||||
*** EGL support is needed for OpenGL ES rendering.
|
||||
])
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
AM_CONDITIONAL(WIN32_GLES, test x"$platform_win32" = xyes -a x"$win32_gles" = xyes)
|
||||
|
||||
GLIB_PREFIX="`$PKG_CONFIG --variable=prefix glib-2.0`"
|
||||
ATK_PREFIX="`$PKG_CONFIG --variable=prefix atk`"
|
||||
PANGO_PREFIX="`$PKG_CONFIG --variable=prefix pango`"
|
||||
|
||||
@@ -48,6 +48,7 @@ demos_base = \
|
||||
offscreen_window2.c \
|
||||
overlay.c \
|
||||
overlay2.c \
|
||||
paint.c \
|
||||
panes.c \
|
||||
pickers.c \
|
||||
pixbufs.c \
|
||||
|
||||
@@ -151,7 +151,7 @@ query_for_toplevel (GdkScreen *screen,
|
||||
|
||||
g_object_unref (cursor);
|
||||
gtk_widget_destroy (popup);
|
||||
gdk_flush (); /* Really release the grab */
|
||||
gdk_display_flush (display); /* Really release the grab */
|
||||
|
||||
return toplevel;
|
||||
}
|
||||
|
||||
@@ -177,6 +177,7 @@
|
||||
<file>offscreen_window2.c</file>
|
||||
<file>overlay.c</file>
|
||||
<file>overlay2.c</file>
|
||||
<file>paint.c</file>
|
||||
<file>pagesetup.c</file>
|
||||
<file>panes.c</file>
|
||||
<file>pickers.c</file>
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
|
||||
#include "gtkfishbowl.h"
|
||||
|
||||
#include <math.h>
|
||||
#include "gtk/fallback-c89.c"
|
||||
|
||||
typedef struct _GtkFishbowlPrivate GtkFishbowlPrivate;
|
||||
typedef struct _GtkFishbowlChild GtkFishbowlChild;
|
||||
|
||||
@@ -0,0 +1,255 @@
|
||||
/* Paint
|
||||
*
|
||||
* Demonstrates practical handling of drawing tablets in a real world
|
||||
* usecase.
|
||||
*/
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
typedef struct
|
||||
{
|
||||
GtkEventBox parent_instance;
|
||||
cairo_surface_t *surface;
|
||||
cairo_t *cr;
|
||||
GdkRGBA draw_color;
|
||||
|
||||
GtkGesture *stylus_gesture;
|
||||
} DrawingArea;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
GtkEventBoxClass parent_class;
|
||||
} DrawingAreaClass;
|
||||
|
||||
G_DEFINE_TYPE (DrawingArea, drawing_area, GTK_TYPE_EVENT_BOX)
|
||||
|
||||
static void
|
||||
drawing_area_ensure_surface (DrawingArea *area,
|
||||
gint width,
|
||||
gint height)
|
||||
{
|
||||
if (!area->surface ||
|
||||
cairo_image_surface_get_width (area->surface) != width ||
|
||||
cairo_image_surface_get_height (area->surface) != height)
|
||||
{
|
||||
cairo_surface_t *surface;
|
||||
|
||||
surface = cairo_image_surface_create (CAIRO_FORMAT_ARGB32,
|
||||
width, height);
|
||||
if (area->surface)
|
||||
{
|
||||
cairo_t *cr;
|
||||
|
||||
cr = cairo_create (surface);
|
||||
cairo_set_source_surface (cr, area->surface, 0, 0);
|
||||
cairo_paint (cr);
|
||||
|
||||
cairo_surface_destroy (area->surface);
|
||||
cairo_destroy (area->cr);
|
||||
cairo_destroy (cr);
|
||||
}
|
||||
|
||||
area->surface = surface;
|
||||
area->cr = cairo_create (surface);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
drawing_area_size_allocate (GtkWidget *widget,
|
||||
GtkAllocation *allocation)
|
||||
{
|
||||
DrawingArea *area = (DrawingArea *) widget;
|
||||
|
||||
drawing_area_ensure_surface (area, allocation->width, allocation->height);
|
||||
|
||||
GTK_WIDGET_CLASS (drawing_area_parent_class)->size_allocate (widget, allocation);
|
||||
}
|
||||
|
||||
static void
|
||||
drawing_area_map (GtkWidget *widget)
|
||||
{
|
||||
GtkAllocation allocation;
|
||||
|
||||
GTK_WIDGET_CLASS (drawing_area_parent_class)->map (widget);
|
||||
|
||||
gdk_window_set_event_compression (gtk_widget_get_window (widget), TRUE);
|
||||
|
||||
gtk_widget_get_allocation (widget, &allocation);
|
||||
drawing_area_ensure_surface ((DrawingArea *) widget,
|
||||
allocation.width, allocation.height);
|
||||
}
|
||||
|
||||
static void
|
||||
drawing_area_unmap (GtkWidget *widget)
|
||||
{
|
||||
DrawingArea *area = (DrawingArea *) widget;
|
||||
|
||||
g_clear_pointer (&area->cr, cairo_destroy);
|
||||
g_clear_pointer (&area->surface, cairo_surface_destroy);
|
||||
|
||||
GTK_WIDGET_CLASS (drawing_area_parent_class)->unmap (widget);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
drawing_area_draw (GtkWidget *widget,
|
||||
cairo_t *cr)
|
||||
{
|
||||
DrawingArea *area = (DrawingArea *) widget;
|
||||
GtkAllocation allocation;
|
||||
|
||||
gtk_widget_get_allocation (widget, &allocation);
|
||||
|
||||
cairo_set_source_rgb (cr, 1, 1, 1);
|
||||
cairo_paint (cr);
|
||||
|
||||
cairo_set_source_surface (cr, area->surface, 0, 0);
|
||||
cairo_paint (cr);
|
||||
|
||||
cairo_set_source_rgb (cr, 0.6, 0.6, 0.6);
|
||||
cairo_rectangle (cr, 0, 0, allocation.width, allocation.height);
|
||||
cairo_stroke (cr);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static void
|
||||
drawing_area_class_init (DrawingAreaClass *klass)
|
||||
{
|
||||
GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
|
||||
|
||||
widget_class->size_allocate = drawing_area_size_allocate;
|
||||
widget_class->draw = drawing_area_draw;
|
||||
widget_class->map = drawing_area_map;
|
||||
widget_class->unmap = drawing_area_unmap;
|
||||
}
|
||||
|
||||
static void
|
||||
drawing_area_apply_stroke (DrawingArea *area,
|
||||
GdkDeviceTool *tool,
|
||||
gdouble x,
|
||||
gdouble y,
|
||||
gdouble pressure)
|
||||
{
|
||||
if (gdk_device_tool_get_tool_type (tool) == GDK_DEVICE_TOOL_TYPE_ERASER)
|
||||
{
|
||||
cairo_set_line_width (area->cr, 10 * pressure);
|
||||
cairo_set_operator (area->cr, CAIRO_OPERATOR_DEST_OUT);
|
||||
}
|
||||
else
|
||||
{
|
||||
cairo_set_line_width (area->cr, 4 * pressure);
|
||||
cairo_set_operator (area->cr, CAIRO_OPERATOR_SATURATE);
|
||||
}
|
||||
|
||||
cairo_set_source_rgba (area->cr, area->draw_color.red,
|
||||
area->draw_color.green, area->draw_color.blue,
|
||||
area->draw_color.alpha * pressure);
|
||||
|
||||
//cairo_set_source_rgba (area->cr, 0, 0, 0, pressure);
|
||||
|
||||
cairo_line_to (area->cr, x, y);
|
||||
cairo_stroke (area->cr);
|
||||
cairo_move_to (area->cr, x, y);
|
||||
}
|
||||
|
||||
static void
|
||||
stylus_gesture_down (GtkGestureStylus *gesture,
|
||||
gdouble x,
|
||||
gdouble y,
|
||||
DrawingArea *area)
|
||||
{
|
||||
cairo_new_path (area->cr);
|
||||
}
|
||||
|
||||
static void
|
||||
stylus_gesture_motion (GtkGestureStylus *gesture,
|
||||
gdouble x,
|
||||
gdouble y,
|
||||
DrawingArea *area)
|
||||
{
|
||||
GdkDeviceTool *tool;
|
||||
gdouble pressure;
|
||||
|
||||
tool = gtk_gesture_stylus_get_device_tool (gesture);
|
||||
|
||||
if (!gtk_gesture_stylus_get_axis (gesture, GDK_AXIS_PRESSURE, &pressure))
|
||||
pressure = 1;
|
||||
|
||||
drawing_area_apply_stroke (area, tool, x, y, pressure);
|
||||
gtk_widget_queue_draw (GTK_WIDGET (area));
|
||||
}
|
||||
|
||||
static void
|
||||
drawing_area_init (DrawingArea *area)
|
||||
{
|
||||
gtk_event_box_set_visible_window (GTK_EVENT_BOX (area), TRUE);
|
||||
|
||||
area->stylus_gesture = gtk_gesture_stylus_new (GTK_WIDGET (area));
|
||||
g_signal_connect (area->stylus_gesture, "down",
|
||||
G_CALLBACK (stylus_gesture_down), area);
|
||||
g_signal_connect (area->stylus_gesture, "motion",
|
||||
G_CALLBACK (stylus_gesture_motion), area);
|
||||
|
||||
area->draw_color = (GdkRGBA) { 0, 0, 0, 1 };
|
||||
}
|
||||
|
||||
GtkWidget *
|
||||
drawing_area_new (void)
|
||||
{
|
||||
return g_object_new (drawing_area_get_type (), NULL);
|
||||
}
|
||||
|
||||
void
|
||||
drawing_area_set_color (DrawingArea *area,
|
||||
GdkRGBA *color)
|
||||
{
|
||||
area->draw_color = *color;
|
||||
}
|
||||
|
||||
static void
|
||||
color_button_color_set (GtkColorButton *button,
|
||||
DrawingArea *draw_area)
|
||||
{
|
||||
GdkRGBA color;
|
||||
|
||||
gtk_color_chooser_get_rgba (GTK_COLOR_CHOOSER (button), &color);
|
||||
drawing_area_set_color (draw_area, &color);
|
||||
}
|
||||
|
||||
GtkWidget *
|
||||
do_paint (GtkWidget *toplevel)
|
||||
{
|
||||
static GtkWidget *window = NULL;
|
||||
|
||||
if (!window)
|
||||
{
|
||||
GtkWidget *draw_area, *headerbar, *colorbutton;
|
||||
|
||||
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
|
||||
|
||||
draw_area = drawing_area_new ();
|
||||
gtk_container_add (GTK_CONTAINER (window), draw_area);
|
||||
|
||||
headerbar = gtk_header_bar_new ();
|
||||
gtk_header_bar_set_title (GTK_HEADER_BAR (headerbar), "Paint");
|
||||
gtk_header_bar_set_show_close_button (GTK_HEADER_BAR (headerbar), TRUE);
|
||||
|
||||
colorbutton = gtk_color_button_new ();
|
||||
g_signal_connect (colorbutton, "color-set",
|
||||
G_CALLBACK (color_button_color_set), draw_area);
|
||||
gtk_color_chooser_set_rgba (GTK_COLOR_CHOOSER (colorbutton),
|
||||
&(GdkRGBA) { 0, 0, 0, 1 });
|
||||
|
||||
gtk_header_bar_pack_end (GTK_HEADER_BAR (headerbar), colorbutton);
|
||||
gtk_window_set_titlebar (GTK_WINDOW (window), headerbar);
|
||||
|
||||
g_signal_connect (window, "destroy",
|
||||
G_CALLBACK (gtk_widget_destroyed), &window);
|
||||
}
|
||||
|
||||
if (!gtk_widget_get_visible (window))
|
||||
gtk_widget_show_all (window);
|
||||
else
|
||||
gtk_widget_destroy (window);
|
||||
|
||||
return window;
|
||||
}
|
||||
@@ -301,6 +301,9 @@
|
||||
<chapter id="Gestures">
|
||||
<title>Gestures and event handling</title>
|
||||
<xi:include href="xml/gtkeventcontroller.xml" />
|
||||
<xi:include href="xml/gtkeventcontrollerkey.xml" />
|
||||
<xi:include href="xml/gtkeventcontrollerscroll.xml" />
|
||||
<xi:include href="xml/gtkeventcontrollermotion.xml" />
|
||||
<xi:include href="xml/gtkgesture.xml" />
|
||||
<xi:include href="xml/gtkgesturesingle.xml" />
|
||||
<xi:include href="xml/gtkgesturedrag.xml" />
|
||||
@@ -310,6 +313,7 @@
|
||||
<xi:include href="xml/gtkgestureswipe.xml" />
|
||||
<xi:include href="xml/gtkgesturerotate.xml" />
|
||||
<xi:include href="xml/gtkgesturezoom.xml" />
|
||||
<xi:include href="xml/gtkgesturestylus.xml" />
|
||||
<xi:include href="xml/gtkpadcontroller.xml" />
|
||||
</chapter>
|
||||
|
||||
|
||||
@@ -8266,6 +8266,63 @@ GtkEventControllerPriv
|
||||
gtk_event_controller_get_type
|
||||
</SECTION>
|
||||
|
||||
<SECTION>
|
||||
<FILE>gtkeventcontrollerscroll</FILE>
|
||||
<TITLE>GtkEventControllerScroll</TITLE>
|
||||
GtkEventControllerScroll
|
||||
GtkEventControllerScrollFlags
|
||||
gtk_event_controller_scroll_new
|
||||
gtk_event_controller_scroll_set_flags
|
||||
gtk_event_controller_scroll_get_flags
|
||||
|
||||
<SUBSECTION Standard>
|
||||
GTK_TYPE_EVENT_CONTROLLER_SCROLL
|
||||
GTK_EVENT_CONTROLLER_SCROLL
|
||||
GTK_EVENT_CONTROLLER_SCROLL_CLASS
|
||||
GTK_IS_EVENT_CONTROLLER_SCROLL
|
||||
GTK_IS_EVENT_CONTROLLER_SCROLL_CLASS
|
||||
GTK_EVENT_CONTROLLER_SCROLL_GET_CLASS
|
||||
|
||||
<SUBSECTION Private>
|
||||
gtk_event_controller_scroll_get_type
|
||||
</SECTION>
|
||||
|
||||
<SECTION>
|
||||
<FILE>gtkeventcontrollermotion</FILE>
|
||||
<TITLE>GtkEventControllerMotion</TITLE>
|
||||
GtkEventControllerMotion
|
||||
gtk_event_controller_motion_new
|
||||
|
||||
<SUBSECTION Standard>
|
||||
GTK_TYPE_EVENT_CONTROLLER_MOTION
|
||||
GTK_EVENT_CONTROLLER_MOTION
|
||||
GTK_EVENT_CONTROLLER_MOTION_CLASS
|
||||
GTK_IS_EVENT_CONTROLLER_MOTION
|
||||
GTK_IS_EVENT_CONTROLLER_MOTION_CLASS
|
||||
GTK_EVENT_CONTROLLER_MOTION_GET_CLASS
|
||||
|
||||
<SUBSECTION Private>
|
||||
gtk_event_controller_motion_get_type
|
||||
</SECTION>
|
||||
|
||||
<SECTION>
|
||||
<FILE>gtkeventcontrollerkey</FILE>
|
||||
<TITLE>GtkEventControllerKey</TITLE>
|
||||
GtkEventControllerKey
|
||||
gtk_event_controller_key_new
|
||||
|
||||
<SUBSECTION Standard>
|
||||
GTK_TYPE_EVENT_CONTROLLER_KEY
|
||||
GTK_EVENT_CONTROLLER_KEY
|
||||
GTK_EVENT_CONTROLLER_KEY_CLASS
|
||||
GTK_IS_EVENT_CONTROLLER_KEY
|
||||
GTK_IS_EVENT_CONTROLLER_KEY_CLASS
|
||||
GTK_EVENT_CONTROLLER_KEY_GET_CLASS
|
||||
|
||||
<SUBSECTION Private>
|
||||
gtk_event_controller_key_get_type
|
||||
</SECTION>
|
||||
|
||||
<SECTION>
|
||||
<FILE>gtkgesture</FILE>
|
||||
<TITLE>GtkGesture</TITLE>
|
||||
@@ -8490,6 +8547,30 @@ GTK_PAD_CONTROLLER_GET_CLASS
|
||||
gtk_pad_controller_get_type
|
||||
</SECTION>
|
||||
|
||||
<SECTION>
|
||||
<FILE>gtkgesturestylus</FILE>
|
||||
<TITLE>GtkGestureStylus</TITLE>
|
||||
GtkGestureStylus
|
||||
|
||||
gtk_gesture_stylus_new
|
||||
gtk_gesture_stylus_get_axis
|
||||
gtk_gesture_stylus_get_axes
|
||||
gtk_gesture_stylus_get_backlog
|
||||
gtk_gesture_stylus_get_device_tool
|
||||
|
||||
<SUBSECTION Standard>
|
||||
GTK_TYPE_GESTURE_STYLUS
|
||||
GTK_GESTURE_STYLUS
|
||||
GTK_GESTURE_STYLUS_CLASS
|
||||
GTK_IS_GESTURE_STYLUS
|
||||
GTK_IS_GESTURE_STYLUS_CLASS
|
||||
GTK_GESTURE_STYLUS_GET_CLASS
|
||||
GtkGestureStylusClass
|
||||
|
||||
<SUBSECTION Private>
|
||||
gtk_gesture_stylus_get_type
|
||||
</SECTION>
|
||||
|
||||
<SECTION>
|
||||
<FILE>gtkstacksidebar</FILE>
|
||||
GtkStackSidebar
|
||||
|
||||
@@ -65,6 +65,9 @@ gtk_entry_completion_get_type
|
||||
gtk_entry_get_type
|
||||
gtk_event_box_get_type
|
||||
gtk_event_controller_get_type
|
||||
gtk_event_controller_key_get_type
|
||||
gtk_event_controller_motion_get_type
|
||||
gtk_event_controller_scroll_get_type
|
||||
gtk_expander_get_type
|
||||
gtk_file_chooser_button_get_type
|
||||
gtk_file_chooser_dialog_get_type
|
||||
@@ -88,6 +91,7 @@ gtk_gesture_multi_press_get_type
|
||||
gtk_gesture_pan_get_type
|
||||
gtk_gesture_rotate_get_type
|
||||
gtk_gesture_single_get_type
|
||||
gtk_gesture_stylus_get_type
|
||||
gtk_gesture_swipe_get_type
|
||||
gtk_gesture_zoom_get_type
|
||||
gtk_gl_area_get_type
|
||||
|
||||
+12
-1
@@ -22,6 +22,10 @@
|
||||
|
||||
#include "gdkinternals.h"
|
||||
|
||||
#ifdef GDK_WINDOWING_WIN32
|
||||
# include "win32/gdkwin32.h"
|
||||
#endif
|
||||
|
||||
#include <epoxy/gl.h>
|
||||
#include <math.h>
|
||||
#include <string.h>
|
||||
@@ -641,6 +645,13 @@ gdk_cairo_draw_from_gl (cairo_t *cr,
|
||||
{
|
||||
/* Software fallback */
|
||||
int major, minor, version;
|
||||
gboolean es_read_bgra = FALSE;
|
||||
|
||||
#ifdef GDK_WINDOWING_WIN32
|
||||
/* on ANGLE GLES, we need to set the glReadPixel() format as GL_BGRA instead */
|
||||
if (GDK_WIN32_IS_GL_CONTEXT(paint_context))
|
||||
es_read_bgra = TRUE;
|
||||
#endif
|
||||
|
||||
gdk_gl_context_get_version (paint_context, &major, &minor);
|
||||
version = major * 100 + minor;
|
||||
@@ -683,7 +694,7 @@ gdk_cairo_draw_from_gl (cairo_t *cr,
|
||||
glReadPixels (x, y, width, height, GL_BGRA, GL_UNSIGNED_INT_8_8_8_8_REV,
|
||||
cairo_image_surface_get_data (image));
|
||||
else
|
||||
glReadPixels (x, y, width, height, GL_RGBA, GL_UNSIGNED_BYTE,
|
||||
glReadPixels (x, y, width, height, es_read_bgra ? GL_BGRA : GL_RGBA, GL_UNSIGNED_BYTE,
|
||||
cairo_image_surface_get_data (image));
|
||||
|
||||
glPixelStorei (GL_PACK_ROW_LENGTH, 0);
|
||||
|
||||
+8
-2
@@ -793,11 +793,17 @@ gdk_gl_context_check_extensions (GdkGLContext *context)
|
||||
has_npot = priv->gl_version >= 20;
|
||||
has_texture_rectangle = FALSE;
|
||||
|
||||
/* This should check for GL_NV_framebuffer_blit - see extension at:
|
||||
/* This should check for GL_NV_framebuffer_blit as well - see extension at:
|
||||
*
|
||||
* https://www.khronos.org/registry/gles/extensions/NV/NV_framebuffer_blit.txt
|
||||
*
|
||||
* for ANGLE, we can enable bit blitting if we have the
|
||||
* GL_ANGLE_framebuffer_blit extension
|
||||
*/
|
||||
priv->has_gl_framebuffer_blit = FALSE;
|
||||
if (epoxy_has_gl_extension ("GL_ANGLE_framebuffer_blit"))
|
||||
priv->has_gl_framebuffer_blit = TRUE;
|
||||
else
|
||||
priv->has_gl_framebuffer_blit = FALSE;
|
||||
|
||||
/* No OES version */
|
||||
priv->has_frame_terminator = FALSE;
|
||||
|
||||
@@ -422,6 +422,14 @@
|
||||
# define GDK_AVAILABLE_IN_3_22 _GDK_EXTERN
|
||||
#endif
|
||||
|
||||
#if GDK_VERSION_MIN_REQUIRED >= GDK_VERSION_3_24
|
||||
# define GDK_DEPRECATED_IN_3_24 GDK_DEPRECATED
|
||||
# define GDK_DEPRECATED_IN_3_24_FOR(f) GDK_DEPRECATED_FOR(f)
|
||||
#else
|
||||
# define GDK_DEPRECATED_IN_3_24 _GDK_EXTERN
|
||||
# define GDK_DEPRECATED_IN_3_24_FOR(f) _GDK_EXTERN
|
||||
#endif
|
||||
|
||||
#if GDK_VERSION_MAX_ALLOWED < GDK_VERSION_3_24
|
||||
# define GDK_AVAILABLE_IN_3_24 GDK_UNAVAILABLE(3, 24)
|
||||
#else
|
||||
|
||||
@@ -310,6 +310,9 @@ struct _GdkWaylandDeviceManagerClass
|
||||
GdkDeviceManagerClass parent_class;
|
||||
};
|
||||
|
||||
static void
|
||||
pointer_surface_update_scale (GdkDevice *device);
|
||||
|
||||
static void deliver_key_event (GdkWaylandSeat *seat,
|
||||
uint32_t time_,
|
||||
uint32_t key,
|
||||
@@ -4501,10 +4504,18 @@ static const struct zwp_tablet_seat_v2_listener tablet_seat_listener = {
|
||||
tablet_seat_handle_pad_added,
|
||||
};
|
||||
|
||||
static void
|
||||
on_monitors_changed (GdkScreen *screen,
|
||||
GdkWaylandSeat *seat)
|
||||
{
|
||||
pointer_surface_update_scale (seat->master_pointer);
|
||||
}
|
||||
|
||||
static void
|
||||
init_devices (GdkWaylandSeat *seat)
|
||||
{
|
||||
GdkWaylandDeviceManager *device_manager = GDK_WAYLAND_DEVICE_MANAGER (seat->device_manager);
|
||||
GdkWaylandDisplay *display = GDK_WAYLAND_DISPLAY (seat->display);
|
||||
|
||||
/* pointer */
|
||||
seat->master_pointer = g_object_new (GDK_TYPE_WAYLAND_DEVICE,
|
||||
@@ -4524,6 +4535,9 @@ init_devices (GdkWaylandSeat *seat)
|
||||
g_list_prepend (device_manager->devices, seat->master_pointer);
|
||||
g_signal_emit_by_name (device_manager, "device-added", seat->master_pointer);
|
||||
|
||||
g_signal_connect (display->screen, "monitors-changed",
|
||||
G_CALLBACK (on_monitors_changed), seat);
|
||||
|
||||
/* keyboard */
|
||||
seat->master_keyboard = g_object_new (GDK_TYPE_WAYLAND_DEVICE,
|
||||
"name", "Core Keyboard",
|
||||
|
||||
@@ -80,6 +80,9 @@ gboolean gdk_wayland_window_set_transient_for_exported (GdkWindo
|
||||
GDK_AVAILABLE_IN_3_22
|
||||
void gdk_wayland_window_announce_csd (GdkWindow *window);
|
||||
|
||||
GDK_AVAILABLE_IN_3_24
|
||||
void gdk_wayland_window_announce_ssd (GdkWindow *window);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __GDK_WAYLAND_WINDOW_H__ */
|
||||
|
||||
@@ -145,6 +145,7 @@ struct _GdkWindowImplWayland
|
||||
unsigned int pending_buffer_attached : 1;
|
||||
unsigned int pending_commit : 1;
|
||||
unsigned int awaiting_frame : 1;
|
||||
unsigned int using_csd : 1;
|
||||
GdkWindowTypeHint hint;
|
||||
GdkWindow *transient_for;
|
||||
GdkWindow *popup_parent;
|
||||
@@ -258,6 +259,7 @@ static void calculate_moved_to_rect_result (GdkWindow *window,
|
||||
|
||||
static gboolean gdk_wayland_window_is_exported (GdkWindow *window);
|
||||
static void gdk_wayland_window_unexport (GdkWindow *window);
|
||||
static void gdk_wayland_window_announce_decoration_mode (GdkWindow *window);
|
||||
|
||||
GType _gdk_window_impl_wayland_get_type (void);
|
||||
|
||||
@@ -388,6 +390,8 @@ G_GNUC_BEGIN_IGNORE_DEPRECATIONS
|
||||
impl->scale = gdk_screen_get_monitor_scale_factor (screen, 0);
|
||||
G_GNUC_END_IGNORE_DEPRECATIONS
|
||||
|
||||
impl->using_csd = TRUE;
|
||||
|
||||
/* logical 1x1 fake buffer */
|
||||
impl->staging_cairo_surface = cairo_image_surface_create (CAIRO_FORMAT_ARGB32,
|
||||
impl->scale,
|
||||
@@ -691,6 +695,7 @@ _gdk_wayland_display_create_window_impl (GdkDisplay *display,
|
||||
window->impl = GDK_WINDOW_IMPL (impl);
|
||||
impl->wrapper = GDK_WINDOW (window);
|
||||
impl->shortcuts_inhibitors = g_hash_table_new (NULL, NULL);
|
||||
impl->using_csd = TRUE;
|
||||
|
||||
if (window->width > 65535)
|
||||
{
|
||||
@@ -2064,19 +2069,68 @@ window_anchor_to_gravity_legacy (GdkGravity rect_anchor)
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
gdk_wayland_window_announce_csd (GdkWindow *window)
|
||||
static void
|
||||
kwin_server_decoration_mode_set (void *data, struct org_kde_kwin_server_decoration *org_kde_kwin_server_decoration, uint32_t mode)
|
||||
{
|
||||
GdkWindow *window = GDK_WINDOW (data);
|
||||
GdkWindowImplWayland *impl = GDK_WINDOW_IMPL_WAYLAND (window->impl);
|
||||
|
||||
if ((mode == ORG_KDE_KWIN_SERVER_DECORATION_MODE_SERVER && impl->using_csd) ||
|
||||
(mode == ORG_KDE_KWIN_SERVER_DECORATION_MODE_CLIENT && !impl->using_csd))
|
||||
gdk_wayland_window_announce_decoration_mode (window);
|
||||
}
|
||||
|
||||
static const struct org_kde_kwin_server_decoration_listener kwin_server_decoration_listener = {
|
||||
kwin_server_decoration_mode_set
|
||||
};
|
||||
|
||||
static void
|
||||
gdk_wayland_window_announce_decoration_mode (GdkWindow *window)
|
||||
{
|
||||
GdkWaylandDisplay *display_wayland = GDK_WAYLAND_DISPLAY (gdk_window_get_display (window));
|
||||
GdkWindowImplWayland *impl = GDK_WINDOW_IMPL_WAYLAND (window->impl);
|
||||
|
||||
if (!display_wayland->server_decoration_manager)
|
||||
return;
|
||||
impl->display_server.server_decoration =
|
||||
org_kde_kwin_server_decoration_manager_create (display_wayland->server_decoration_manager,
|
||||
impl->display_server.wl_surface);
|
||||
if (!impl->display_server.server_decoration)
|
||||
{
|
||||
impl->display_server.server_decoration =
|
||||
org_kde_kwin_server_decoration_manager_create (display_wayland->server_decoration_manager,
|
||||
impl->display_server.wl_surface);
|
||||
org_kde_kwin_server_decoration_add_listener (impl->display_server.server_decoration,
|
||||
&kwin_server_decoration_listener,
|
||||
window);
|
||||
}
|
||||
|
||||
if (impl->display_server.server_decoration)
|
||||
org_kde_kwin_server_decoration_request_mode (impl->display_server.server_decoration,
|
||||
ORG_KDE_KWIN_SERVER_DECORATION_MANAGER_MODE_CLIENT);
|
||||
{
|
||||
if (impl->using_csd)
|
||||
org_kde_kwin_server_decoration_request_mode (impl->display_server.server_decoration,
|
||||
ORG_KDE_KWIN_SERVER_DECORATION_MODE_CLIENT);
|
||||
else
|
||||
org_kde_kwin_server_decoration_request_mode (impl->display_server.server_decoration,
|
||||
ORG_KDE_KWIN_SERVER_DECORATION_MODE_SERVER);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
gdk_wayland_window_announce_csd (GdkWindow *window)
|
||||
{
|
||||
GdkWindowImplWayland *impl = GDK_WINDOW_IMPL_WAYLAND (window->impl);
|
||||
|
||||
impl->using_csd = TRUE;
|
||||
if (impl->mapped)
|
||||
gdk_wayland_window_announce_decoration_mode (window);
|
||||
}
|
||||
|
||||
void
|
||||
gdk_wayland_window_announce_ssd (GdkWindow *window)
|
||||
{
|
||||
GdkWindowImplWayland *impl = GDK_WINDOW_IMPL_WAYLAND (window->impl);
|
||||
|
||||
impl->using_csd = FALSE;
|
||||
if (impl->mapped)
|
||||
gdk_wayland_window_announce_decoration_mode (window);
|
||||
}
|
||||
|
||||
static GdkWindow *
|
||||
@@ -2906,11 +2960,13 @@ gdk_wayland_window_map (GdkWindow *window)
|
||||
else
|
||||
{
|
||||
gdk_wayland_window_create_xdg_toplevel (window);
|
||||
gdk_wayland_window_announce_decoration_mode (window);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
gdk_wayland_window_create_xdg_toplevel (window);
|
||||
gdk_wayland_window_announce_decoration_mode (window);
|
||||
}
|
||||
|
||||
impl->mapped = TRUE;
|
||||
@@ -3074,6 +3130,12 @@ gdk_wayland_window_hide_surface (GdkWindow *window)
|
||||
impl->application.was_set = FALSE;
|
||||
}
|
||||
|
||||
if (impl->display_server.server_decoration)
|
||||
{
|
||||
org_kde_kwin_server_decoration_release (impl->display_server.server_decoration);
|
||||
impl->display_server.server_decoration = NULL;
|
||||
}
|
||||
|
||||
wl_surface_destroy (impl->display_server.wl_surface);
|
||||
impl->display_server.wl_surface = NULL;
|
||||
|
||||
|
||||
@@ -17,6 +17,10 @@ AM_CPPFLAGS = \
|
||||
$(GDK_WIN32_EXTRA_CFLAGS) \
|
||||
-DGDK_COMPILATION
|
||||
|
||||
if WIN32_GLES
|
||||
AM_CPPFLAGS += "-DGDK_WIN32_ENABLE_EGL=1"
|
||||
endif #WIN32_GLES
|
||||
|
||||
LDADDS = $(GDK_DEP_LIBS)
|
||||
|
||||
noinst_LTLIBRARIES = libgdk-win32.la
|
||||
|
||||
@@ -31,6 +31,10 @@
|
||||
#include "gdkmonitor-win32.h"
|
||||
#include "gdkwin32.h"
|
||||
|
||||
#ifdef GDK_WIN32_ENABLE_EGL
|
||||
# include <epoxy/egl.h>
|
||||
#endif
|
||||
|
||||
static int debug_indent = 0;
|
||||
|
||||
static GdkMonitor *
|
||||
@@ -825,6 +829,14 @@ gdk_win32_display_dispose (GObject *object)
|
||||
|
||||
_gdk_screen_close (display_win32->screen);
|
||||
|
||||
#ifdef GDK_WIN32_ENABLE_EGL
|
||||
if (display_win32->egl_disp != EGL_NO_DISPLAY)
|
||||
{
|
||||
eglTerminate (display_win32->egl_disp);
|
||||
display_win32->egl_disp = EGL_NO_DISPLAY;
|
||||
}
|
||||
#endif
|
||||
|
||||
if (display_win32->hwnd != NULL)
|
||||
{
|
||||
DestroyWindow (display_win32->hwnd);
|
||||
|
||||
@@ -19,6 +19,10 @@
|
||||
|
||||
#include "gdkdisplayprivate.h"
|
||||
|
||||
#ifdef GDK_WIN32_ENABLE_EGL
|
||||
# include <epoxy/egl.h>
|
||||
#endif
|
||||
|
||||
#ifndef __GDK_DISPLAY__WIN32_H__
|
||||
#define __GDK_DISPLAY__WIN32_H__
|
||||
|
||||
@@ -75,6 +79,14 @@ struct _GdkWin32Display
|
||||
guint gl_version;
|
||||
HWND gl_hwnd;
|
||||
|
||||
#ifdef GDK_WIN32_ENABLE_EGL
|
||||
/* EGL (Angle) Items */
|
||||
guint have_egl : 1;
|
||||
guint egl_version;
|
||||
EGLDisplay egl_disp;
|
||||
HDC hdc_egl_temp;
|
||||
#endif
|
||||
|
||||
GPtrArray *monitors;
|
||||
|
||||
guint hasWglARBCreateContext : 1;
|
||||
@@ -83,6 +95,12 @@ struct _GdkWin32Display
|
||||
guint hasWglARBPixelFormat : 1;
|
||||
guint hasWglARBmultisample : 1;
|
||||
|
||||
#ifdef GDK_WIN32_ENABLE_EGL
|
||||
guint hasEglKHRCreateContext : 1;
|
||||
guint hasEglSurfacelessContext : 1;
|
||||
EGLint egl_min_swap_interval;
|
||||
#endif
|
||||
|
||||
/* HiDPI Items */
|
||||
guint have_at_least_win81 : 1;
|
||||
GdkWin32ProcessDpiAwareness dpi_aware_type;
|
||||
|
||||
@@ -51,6 +51,7 @@
|
||||
#include "gdkmonitorprivate.h"
|
||||
#include "gdkwin32.h"
|
||||
#include "gdkkeysyms.h"
|
||||
#include "gdkglcontext-win32.h"
|
||||
#include "gdkdevicemanager-win32.h"
|
||||
#include "gdkdeviceprivate.h"
|
||||
#include "gdkdevice-wintab.h"
|
||||
@@ -3248,6 +3249,9 @@ gdk_event_translate (MSG *msg,
|
||||
case SC_MINIMIZE:
|
||||
case SC_RESTORE:
|
||||
do_show_window (window, msg->wParam == SC_MINIMIZE ? TRUE : FALSE);
|
||||
|
||||
if (msg->wParam == SC_RESTORE)
|
||||
_gdk_win32_window_invalidate_egl_framebuffer (window);
|
||||
break;
|
||||
case SC_MAXIMIZE:
|
||||
impl = GDK_WINDOW_IMPL_WIN32 (window->impl);
|
||||
@@ -3337,6 +3341,8 @@ gdk_event_translate (MSG *msg,
|
||||
{
|
||||
MINMAXINFO our_mmi;
|
||||
|
||||
_gdk_win32_window_invalidate_egl_framebuffer (window);
|
||||
|
||||
if (_gdk_win32_window_fill_min_max_info (window, &our_mmi))
|
||||
{
|
||||
windowpos = (WINDOWPOS *) msg->lParam;
|
||||
|
||||
+594
-142
@@ -41,6 +41,10 @@
|
||||
#include <cairo.h>
|
||||
#include <epoxy/wgl.h>
|
||||
|
||||
#ifdef GDK_WIN32_ENABLE_EGL
|
||||
# include <epoxy/egl.h>
|
||||
#endif
|
||||
|
||||
G_DEFINE_TYPE (GdkWin32GLContext, gdk_win32_gl_context, GDK_TYPE_GL_CONTEXT)
|
||||
|
||||
static void
|
||||
@@ -50,6 +54,7 @@ _gdk_win32_gl_context_dispose (GObject *gobject)
|
||||
GdkWin32GLContext *context_win32 = GDK_WIN32_GL_CONTEXT (gobject);
|
||||
GdkWin32Display *display_win32 = GDK_WIN32_DISPLAY (gdk_gl_context_get_display (context));
|
||||
GdkWindow *window = gdk_gl_context_get_window (context);
|
||||
GdkWindowImplWin32 *impl = NULL;
|
||||
|
||||
if (context_win32->hglrc != NULL)
|
||||
{
|
||||
@@ -64,9 +69,28 @@ _gdk_win32_gl_context_dispose (GObject *gobject)
|
||||
ReleaseDC (display_win32->gl_hwnd, context_win32->gl_hdc);
|
||||
}
|
||||
|
||||
#ifdef GDK_WIN32_ENABLE_EGL
|
||||
if (context_win32->egl_context != EGL_NO_CONTEXT)
|
||||
{
|
||||
if (eglGetCurrentContext () == context_win32->egl_context)
|
||||
eglMakeCurrent(display_win32->egl_disp, EGL_NO_SURFACE, EGL_NO_SURFACE,
|
||||
EGL_NO_CONTEXT);
|
||||
|
||||
GDK_NOTE (OPENGL, g_message ("Destroying EGL (ANGLE) context"));
|
||||
|
||||
eglDestroyContext (display_win32->egl_disp,
|
||||
context_win32->egl_context);
|
||||
context_win32->egl_context = EGL_NO_CONTEXT;
|
||||
|
||||
impl = GDK_WINDOW_IMPL_WIN32 (window->impl);
|
||||
|
||||
ReleaseDC (display_win32->gl_hwnd, context_win32->gl_hdc);
|
||||
}
|
||||
#endif
|
||||
|
||||
if (window != NULL && window->impl != NULL)
|
||||
{
|
||||
GdkWindowImplWin32 *impl = GDK_WINDOW_IMPL_WIN32 (window->impl);
|
||||
impl = GDK_WINDOW_IMPL_WIN32 (window->impl);
|
||||
|
||||
if (impl->suppress_layered > 0)
|
||||
impl->suppress_layered--;
|
||||
@@ -117,6 +141,35 @@ gdk_gl_blit_region (GdkWindow *window, cairo_region_t *region)
|
||||
}
|
||||
}
|
||||
|
||||
static gboolean
|
||||
_get_is_egl_force_redraw (GdkWindow *window)
|
||||
{
|
||||
/* We only need to call gdk_window_invalidate_rect () if necessary */
|
||||
#ifdef GDK_WIN32_ENABLE_EGL
|
||||
if (window->gl_paint_context != NULL && gdk_gl_context_get_use_es (window->gl_paint_context))
|
||||
{
|
||||
GdkWindowImplWin32 *impl = GDK_WINDOW_IMPL_WIN32 (window->impl);
|
||||
|
||||
return impl->egl_force_redraw_all;
|
||||
}
|
||||
#endif
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static void
|
||||
_reset_egl_force_redraw (GdkWindow *window)
|
||||
{
|
||||
#ifdef GDK_WIN32_ENABLE_EGL
|
||||
if (window->gl_paint_context != NULL && gdk_gl_context_get_use_es (window->gl_paint_context))
|
||||
{
|
||||
GdkWindowImplWin32 *impl = GDK_WINDOW_IMPL_WIN32 (window->impl);
|
||||
|
||||
if (impl->egl_force_redraw_all)
|
||||
impl->egl_force_redraw_all = FALSE;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
void
|
||||
_gdk_win32_gl_context_end_frame (GdkGLContext *context,
|
||||
cairo_region_t *painted,
|
||||
@@ -126,11 +179,12 @@ _gdk_win32_gl_context_end_frame (GdkGLContext *context,
|
||||
GdkWindow *window = gdk_gl_context_get_window (context);
|
||||
GdkWin32Display *display = (GDK_WIN32_DISPLAY (gdk_gl_context_get_display (context)));
|
||||
|
||||
gboolean can_wait = display->hasWglOMLSyncControl;
|
||||
gdk_gl_context_make_current (context);
|
||||
|
||||
if (context_win32->do_frame_sync)
|
||||
if (!gdk_gl_context_get_use_es (context))
|
||||
{
|
||||
gboolean can_wait = display->hasWglOMLSyncControl;
|
||||
|
||||
if (context_win32->do_frame_sync)
|
||||
{
|
||||
glFinish ();
|
||||
@@ -147,21 +201,44 @@ _gdk_win32_gl_context_end_frame (GdkGLContext *context,
|
||||
&ust, &msc, &sbc);
|
||||
}
|
||||
}
|
||||
|
||||
if (context_win32->do_blit_swap)
|
||||
{
|
||||
glDrawBuffer(GL_FRONT);
|
||||
glReadBuffer(GL_BACK);
|
||||
gdk_gl_blit_region (window, painted);
|
||||
glDrawBuffer(GL_BACK);
|
||||
glFlush();
|
||||
|
||||
if (gdk_gl_context_has_frame_terminator (context))
|
||||
glFrameTerminatorGREMEDY ();
|
||||
}
|
||||
else
|
||||
SwapBuffers (context_win32->gl_hdc);
|
||||
}
|
||||
|
||||
if (context_win32->do_blit_swap)
|
||||
{
|
||||
glDrawBuffer(GL_FRONT);
|
||||
glReadBuffer(GL_BACK);
|
||||
gdk_gl_blit_region (window, painted);
|
||||
glDrawBuffer(GL_BACK);
|
||||
glFlush();
|
||||
|
||||
if (gdk_gl_context_has_frame_terminator (context))
|
||||
glFrameTerminatorGREMEDY ();
|
||||
}
|
||||
#ifdef GDK_WIN32_ENABLE_EGL
|
||||
else
|
||||
SwapBuffers (context_win32->gl_hdc);
|
||||
{
|
||||
EGLSurface egl_surface = _gdk_win32_window_get_egl_surface (window, context_win32->egl_config, FALSE);
|
||||
gboolean force_egl_redraw_all = _get_is_egl_force_redraw (window);
|
||||
|
||||
if (context_win32->do_blit_swap && !force_egl_redraw_all)
|
||||
gdk_gl_blit_region (window, painted);
|
||||
else if (force_egl_redraw_all)
|
||||
{
|
||||
GdkRectangle rect = {0, 0, gdk_window_get_width (window), gdk_window_get_height (window)};
|
||||
|
||||
/* We need to do gdk_window_invalidate_rect() so that we don't get glitches after maximizing or
|
||||
* restoring or using aerosnap
|
||||
*/
|
||||
gdk_window_invalidate_rect (window, &rect, TRUE);
|
||||
_reset_egl_force_redraw (window);
|
||||
}
|
||||
|
||||
eglSwapBuffers (display->egl_disp, egl_surface);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
void
|
||||
@@ -453,64 +530,152 @@ _gdk_init_dummy_context (GdkWGLDummy *dummy,
|
||||
return best_idx;
|
||||
}
|
||||
|
||||
#ifdef GDK_WIN32_ENABLE_EGL
|
||||
|
||||
#ifndef EGL_PLATFORM_ANGLE_ANGLE
|
||||
#define EGL_PLATFORM_ANGLE_ANGLE 0x3202
|
||||
#endif
|
||||
|
||||
#ifndef EGL_PLATFORM_ANGLE_TYPE_ANGLE
|
||||
#define EGL_PLATFORM_ANGLE_TYPE_ANGLE 0x3203
|
||||
#endif
|
||||
|
||||
#ifndef EGL_PLATFORM_ANGLE_TYPE_D3D11_ANGLE
|
||||
#define EGL_PLATFORM_ANGLE_TYPE_D3D11_ANGLE 0x3208
|
||||
#endif
|
||||
|
||||
static EGLDisplay
|
||||
_gdk_win32_get_egl_display (GdkWin32Display *display)
|
||||
{
|
||||
EGLDisplay disp;
|
||||
gboolean success = FALSE;
|
||||
|
||||
if (epoxy_has_egl_extension (NULL, "EGL_EXT_platform_base"))
|
||||
{
|
||||
PFNEGLGETPLATFORMDISPLAYEXTPROC getPlatformDisplay = (void *) eglGetProcAddress ("eglGetPlatformDisplayEXT");
|
||||
if (getPlatformDisplay)
|
||||
{
|
||||
EGLint disp_attr[] = {EGL_PLATFORM_ANGLE_TYPE_ANGLE, EGL_PLATFORM_ANGLE_TYPE_D3D11_ANGLE, EGL_NONE};
|
||||
|
||||
disp = getPlatformDisplay (EGL_PLATFORM_ANGLE_ANGLE, display->hdc_egl_temp, disp_attr);
|
||||
|
||||
if (disp != EGL_NO_DISPLAY)
|
||||
return disp;
|
||||
}
|
||||
}
|
||||
return eglGetDisplay (display->hdc_egl_temp);
|
||||
}
|
||||
#endif
|
||||
|
||||
static gboolean
|
||||
_gdk_win32_display_init_gl (GdkDisplay *display,
|
||||
const gboolean need_alpha_bits)
|
||||
{
|
||||
GdkWin32Display *display_win32 = GDK_WIN32_DISPLAY (display);
|
||||
gint best_idx = 0;
|
||||
GdkWGLDummy dummy;
|
||||
gboolean disable_wgl = FALSE;
|
||||
|
||||
if (display_win32->have_wgl)
|
||||
#ifdef GDK_WIN32_ENABLE_EGL
|
||||
EGLDisplay egl_disp;
|
||||
disable_wgl = (_gdk_gl_flags & GDK_GL_GLES) != 0;
|
||||
#endif
|
||||
|
||||
if (display_win32->have_wgl
|
||||
#ifdef GDK_WIN32_ENABLE_EGL
|
||||
|| display_win32->have_egl
|
||||
#endif
|
||||
)
|
||||
return TRUE;
|
||||
|
||||
memset (&dummy, 0, sizeof (GdkWGLDummy));
|
||||
if (!disable_wgl)
|
||||
{
|
||||
/* acquire and cache dummy Window (HWND & HDC) and
|
||||
* dummy GL Context, it is used to query functions
|
||||
* and used for other stuff as well
|
||||
*/
|
||||
GdkWGLDummy dummy;
|
||||
memset (&dummy, 0, sizeof (GdkWGLDummy));
|
||||
|
||||
/* acquire and cache dummy Window (HWND & HDC) and
|
||||
* dummy GL Context, it is used to query functions
|
||||
* and used for other stuff as well
|
||||
*/
|
||||
best_idx = _gdk_init_dummy_context (&dummy, need_alpha_bits);
|
||||
best_idx = _gdk_init_dummy_context (&dummy, need_alpha_bits);
|
||||
|
||||
if (best_idx == 0 || !wglMakeCurrent (dummy.hdc, dummy.hglrc))
|
||||
return FALSE;
|
||||
if (best_idx == 0 || !wglMakeCurrent (dummy.hdc, dummy.hglrc))
|
||||
return FALSE;
|
||||
|
||||
display_win32->have_wgl = TRUE;
|
||||
display_win32->gl_version = epoxy_gl_version ();
|
||||
display_win32->have_wgl = TRUE;
|
||||
display_win32->gl_version = epoxy_gl_version ();
|
||||
|
||||
display_win32->hasWglARBCreateContext =
|
||||
epoxy_has_wgl_extension (dummy.hdc, "WGL_ARB_create_context");
|
||||
display_win32->hasWglEXTSwapControl =
|
||||
epoxy_has_wgl_extension (dummy.hdc, "WGL_EXT_swap_control");
|
||||
display_win32->hasWglOMLSyncControl =
|
||||
epoxy_has_wgl_extension (dummy.hdc, "WGL_OML_sync_control");
|
||||
display_win32->hasWglARBPixelFormat =
|
||||
epoxy_has_wgl_extension (dummy.hdc, "WGL_ARB_pixel_format");
|
||||
display_win32->hasWglARBmultisample =
|
||||
epoxy_has_wgl_extension (dummy.hdc, "WGL_ARB_multisample");
|
||||
|
||||
GDK_NOTE (OPENGL,
|
||||
g_print ("WGL API version %d.%d found\n"
|
||||
" - Vendor: %s\n"
|
||||
" - Checked extensions:\n"
|
||||
"\t* WGL_ARB_pixel_format: %s\n"
|
||||
"\t* WGL_ARB_create_context: %s\n"
|
||||
"\t* WGL_EXT_swap_control: %s\n"
|
||||
"\t* WGL_OML_sync_control: %s\n"
|
||||
"\t* WGL_ARB_multisample: %s\n",
|
||||
display_win32->gl_version / 10,
|
||||
display_win32->gl_version % 10,
|
||||
glGetString (GL_VENDOR),
|
||||
display_win32->hasWglARBPixelFormat ? "yes" : "no",
|
||||
display_win32->hasWglARBCreateContext ? "yes" : "no",
|
||||
display_win32->hasWglEXTSwapControl ? "yes" : "no",
|
||||
display_win32->hasWglOMLSyncControl ? "yes" : "no",
|
||||
display_win32->hasWglARBmultisample ? "yes" : "no"));
|
||||
|
||||
wglMakeCurrent (NULL, NULL);
|
||||
|
||||
_destroy_dummy_gl_context (dummy);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
#ifdef GDK_WIN32_ENABLE_EGL
|
||||
egl_disp = _gdk_win32_get_egl_display (display_win32);
|
||||
|
||||
if (egl_disp == EGL_NO_DISPLAY ||
|
||||
!eglInitialize (egl_disp, NULL, NULL))
|
||||
{
|
||||
if (egl_disp != EGL_NO_DISPLAY)
|
||||
{
|
||||
eglTerminate (egl_disp);
|
||||
egl_disp = EGL_NO_DISPLAY;
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
display_win32->egl_disp = egl_disp;
|
||||
display_win32->have_egl = TRUE;
|
||||
display_win32->egl_version = epoxy_egl_version (egl_disp);
|
||||
|
||||
eglBindAPI(EGL_OPENGL_ES_API);
|
||||
|
||||
display_win32->hasEglSurfacelessContext =
|
||||
epoxy_has_egl_extension (egl_disp, "EGL_KHR_surfaceless_context");
|
||||
|
||||
display_win32->hasWglARBCreateContext =
|
||||
epoxy_has_wgl_extension (dummy.hdc, "WGL_ARB_create_context");
|
||||
display_win32->hasWglEXTSwapControl =
|
||||
epoxy_has_wgl_extension (dummy.hdc, "WGL_EXT_swap_control");
|
||||
display_win32->hasWglOMLSyncControl =
|
||||
epoxy_has_wgl_extension (dummy.hdc, "WGL_OML_sync_control");
|
||||
display_win32->hasWglARBPixelFormat =
|
||||
epoxy_has_wgl_extension (dummy.hdc, "WGL_ARB_pixel_format");
|
||||
display_win32->hasWglARBmultisample =
|
||||
epoxy_has_wgl_extension (dummy.hdc, "WGL_ARB_multisample");
|
||||
|
||||
GDK_NOTE (OPENGL,
|
||||
g_print ("WGL API version %d.%d found\n"
|
||||
g_print ("EGL API version %d.%d found\n"
|
||||
" - Vendor: %s\n"
|
||||
" - Checked extensions:\n"
|
||||
"\t* WGL_ARB_pixel_format: %s\n"
|
||||
"\t* WGL_ARB_create_context: %s\n"
|
||||
"\t* WGL_EXT_swap_control: %s\n"
|
||||
"\t* WGL_OML_sync_control: %s\n"
|
||||
"\t* WGL_ARB_multisample: %s\n",
|
||||
display_win32->gl_version / 10,
|
||||
display_win32->gl_version % 10,
|
||||
glGetString (GL_VENDOR),
|
||||
display_win32->hasWglARBPixelFormat ? "yes" : "no",
|
||||
display_win32->hasWglARBCreateContext ? "yes" : "no",
|
||||
display_win32->hasWglEXTSwapControl ? "yes" : "no",
|
||||
display_win32->hasWglOMLSyncControl ? "yes" : "no",
|
||||
display_win32->hasWglARBmultisample ? "yes" : "no"));
|
||||
|
||||
wglMakeCurrent (NULL, NULL);
|
||||
_destroy_dummy_gl_context (dummy);
|
||||
"\t* EGL_KHR_surfaceless_context: %s\n",
|
||||
display_win32->egl_version / 10,
|
||||
display_win32->egl_version % 10,
|
||||
eglQueryString (display_win32->egl_disp, EGL_VENDOR),
|
||||
display_win32->hasEglSurfacelessContext ? "yes" : "no"));
|
||||
|
||||
return TRUE;
|
||||
#endif
|
||||
}
|
||||
|
||||
/* Setup the legacy context after creating it */
|
||||
@@ -688,6 +853,132 @@ _set_pixformat_for_hdc (HDC hdc,
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
#ifdef GDK_WIN32_ENABLE_EGL
|
||||
|
||||
#define MAX_EGL_ATTRS 30
|
||||
|
||||
static gboolean
|
||||
find_eglconfig_for_window (GdkWin32Display *display,
|
||||
EGLConfig *egl_config_out,
|
||||
EGLint *min_swap_interval_out,
|
||||
gboolean need_alpha_bits,
|
||||
GError **error)
|
||||
{
|
||||
EGLint attrs[MAX_EGL_ATTRS];
|
||||
EGLint count;
|
||||
EGLConfig *configs, chosen_config;
|
||||
|
||||
int i = 0;
|
||||
|
||||
EGLDisplay egl_disp = display->egl_disp;
|
||||
|
||||
attrs[i++] = EGL_CONFORMANT;
|
||||
attrs[i++] = EGL_OPENGL_ES2_BIT;
|
||||
attrs[i++] = EGL_SURFACE_TYPE;
|
||||
attrs[i++] = EGL_WINDOW_BIT;
|
||||
|
||||
attrs[i++] = EGL_COLOR_BUFFER_TYPE;
|
||||
attrs[i++] = EGL_RGB_BUFFER;
|
||||
|
||||
attrs[i++] = EGL_RED_SIZE;
|
||||
attrs[i++] = 1;
|
||||
attrs[i++] = EGL_GREEN_SIZE;
|
||||
attrs[i++] = 1;
|
||||
attrs[i++] = EGL_BLUE_SIZE;
|
||||
attrs[i++] = 1;
|
||||
|
||||
if (need_alpha_bits)
|
||||
{
|
||||
attrs[i++] = EGL_ALPHA_SIZE;
|
||||
attrs[i++] = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
attrs[i++] = EGL_ALPHA_SIZE;
|
||||
attrs[i++] = EGL_DONT_CARE;
|
||||
}
|
||||
|
||||
attrs[i++] = EGL_NONE;
|
||||
g_assert (i < MAX_EGL_ATTRS);
|
||||
|
||||
if (!eglChooseConfig (display->egl_disp, attrs, NULL, 0, &count) || count < 1)
|
||||
{
|
||||
g_set_error_literal (error, GDK_GL_ERROR,
|
||||
GDK_GL_ERROR_UNSUPPORTED_FORMAT,
|
||||
_("No available configurations for the given pixel format"));
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
configs = g_new (EGLConfig, count);
|
||||
|
||||
if (!eglChooseConfig (display->egl_disp, attrs, configs, count, &count) || count < 1)
|
||||
{
|
||||
g_set_error_literal (error, GDK_GL_ERROR,
|
||||
GDK_GL_ERROR_UNSUPPORTED_FORMAT,
|
||||
_("No available configurations for the given pixel format"));
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/* Pick first valid configuration i guess? */
|
||||
chosen_config = configs[0];
|
||||
|
||||
if (!eglGetConfigAttrib (display->egl_disp, chosen_config,
|
||||
EGL_MIN_SWAP_INTERVAL, min_swap_interval_out))
|
||||
{
|
||||
g_set_error_literal (error, GDK_GL_ERROR,
|
||||
GDK_GL_ERROR_NOT_AVAILABLE,
|
||||
"Could not retrieve the minimum swap interval");
|
||||
g_free (configs);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (egl_config_out != NULL)
|
||||
*egl_config_out = chosen_config;
|
||||
|
||||
g_free (configs);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
#define N_EGL_ATTRS 16
|
||||
|
||||
static EGLContext
|
||||
_create_egl_context (EGLDisplay display,
|
||||
EGLConfig config,
|
||||
GdkGLContext *share,
|
||||
int flags,
|
||||
int major,
|
||||
int minor,
|
||||
gboolean *is_legacy)
|
||||
{
|
||||
EGLContext ctx;
|
||||
EGLint context_attribs[N_EGL_ATTRS];
|
||||
int i = 0;
|
||||
|
||||
/* ANGLE does not support the GL_OES_vertex_array_object extension, so we need to use ES3 directly */
|
||||
context_attribs[i++] = EGL_CONTEXT_CLIENT_VERSION;
|
||||
context_attribs[i++] = 3;
|
||||
|
||||
/* Specify the flags */
|
||||
context_attribs[i++] = EGL_CONTEXT_FLAGS_KHR;
|
||||
context_attribs[i++] = flags;
|
||||
|
||||
context_attribs[i++] = EGL_NONE;
|
||||
g_assert (i < N_EGL_ATTRS);
|
||||
|
||||
ctx = eglCreateContext (display,
|
||||
config,
|
||||
share != NULL ? GDK_WIN32_GL_CONTEXT (share)->egl_context
|
||||
: EGL_NO_CONTEXT,
|
||||
context_attribs);
|
||||
|
||||
if (ctx != EGL_NO_CONTEXT)
|
||||
GDK_NOTE (OPENGL, g_message ("Created EGL context[%p]", ctx));
|
||||
|
||||
return ctx;
|
||||
}
|
||||
#endif /* GDK_WIN32_ENABLE_EGL */
|
||||
|
||||
gboolean
|
||||
_gdk_win32_gl_context_realize (GdkGLContext *context,
|
||||
GError **error)
|
||||
@@ -695,83 +986,143 @@ _gdk_win32_gl_context_realize (GdkGLContext *context,
|
||||
GdkGLContext *share = gdk_gl_context_get_shared_context (context);
|
||||
GdkWin32GLContext *context_win32 = GDK_WIN32_GL_CONTEXT (context);
|
||||
|
||||
/* These are the real WGL/EGL context items that we will want to use later */
|
||||
gboolean debug_bit, compat_bit, legacy_bit;
|
||||
|
||||
/* These are the real WGL context items that we will want to use later */
|
||||
HGLRC hglrc;
|
||||
gint pixel_format;
|
||||
gboolean debug_bit, compat_bit, legacy_bit;
|
||||
gboolean use_es = FALSE;
|
||||
|
||||
/* request flags and specific versions for core (3.2+) WGL context */
|
||||
gint flags = 0;
|
||||
gint glver_major = 0;
|
||||
gint glver_minor = 0;
|
||||
gint major = 0;
|
||||
gint minor = 0;
|
||||
|
||||
#ifdef GDK_WIN32_ENABLE_EGL
|
||||
EGLContext egl_context;
|
||||
#endif
|
||||
|
||||
GdkWindow *window = gdk_gl_context_get_window (context);
|
||||
GdkWindowImplWin32 *impl = GDK_WINDOW_IMPL_WIN32 (window->impl);
|
||||
GdkWin32Display *win32_display = GDK_WIN32_DISPLAY (gdk_window_get_display (window));
|
||||
|
||||
if (!_set_pixformat_for_hdc (context_win32->gl_hdc,
|
||||
&pixel_format,
|
||||
context_win32->need_alpha_bits,
|
||||
win32_display))
|
||||
{
|
||||
g_set_error_literal (error, GDK_GL_ERROR,
|
||||
GDK_GL_ERROR_UNSUPPORTED_FORMAT,
|
||||
_("No available configurations for the given pixel format"));
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
gdk_gl_context_get_required_version (context, &glver_major, &glver_minor);
|
||||
debug_bit = gdk_gl_context_get_debug_enabled (context);
|
||||
compat_bit = gdk_gl_context_get_forward_compatible (context);
|
||||
|
||||
/* if there isn't wglCreateContextAttribsARB(), or if GDK_GL_LEGACY is set, we default to a legacy context */
|
||||
legacy_bit = !win32_display->hasWglARBCreateContext ||
|
||||
g_getenv ("GDK_GL_LEGACY") != NULL;
|
||||
|
||||
/*
|
||||
* A legacy context cannot be shared with core profile ones, so this means we
|
||||
* must stick to a legacy context if the shared context is a legacy context
|
||||
*/
|
||||
if (share != NULL && gdk_gl_context_is_legacy (share))
|
||||
if ((_gdk_gl_flags & GDK_GL_LEGACY) != 0 ||
|
||||
share != NULL && gdk_gl_context_is_legacy (share))
|
||||
legacy_bit = TRUE;
|
||||
|
||||
if (debug_bit)
|
||||
flags |= WGL_CONTEXT_DEBUG_BIT_ARB;
|
||||
if (compat_bit)
|
||||
flags |= WGL_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB;
|
||||
if ((_gdk_gl_flags & GDK_GL_GLES) != 0 ||
|
||||
(share != NULL && gdk_gl_context_get_use_es (share)))
|
||||
use_es = TRUE;
|
||||
|
||||
GDK_NOTE (OPENGL,
|
||||
g_print ("Creating %s WGL context (version:%d.%d, debug:%s, forward:%s, legacy: %s)\n",
|
||||
compat_bit ? "core" : "compat",
|
||||
glver_major,
|
||||
glver_minor,
|
||||
debug_bit ? "yes" : "no",
|
||||
compat_bit ? "yes" : "no",
|
||||
legacy_bit ? "yes" : "no"));
|
||||
gdk_gl_context_get_required_version (context, &major, &minor);
|
||||
debug_bit = gdk_gl_context_get_debug_enabled (context);
|
||||
compat_bit = gdk_gl_context_get_forward_compatible (context);
|
||||
|
||||
hglrc = _create_gl_context (context_win32->gl_hdc,
|
||||
share,
|
||||
flags,
|
||||
glver_major,
|
||||
glver_minor,
|
||||
&legacy_bit,
|
||||
win32_display->hasWglARBCreateContext);
|
||||
|
||||
if (hglrc == NULL)
|
||||
if (win32_display->have_wgl)
|
||||
{
|
||||
g_set_error_literal (error, GDK_GL_ERROR,
|
||||
GDK_GL_ERROR_NOT_AVAILABLE,
|
||||
_("Unable to create a GL context"));
|
||||
return FALSE;
|
||||
if (!_set_pixformat_for_hdc (context_win32->gl_hdc,
|
||||
&pixel_format,
|
||||
context_win32->need_alpha_bits,
|
||||
win32_display))
|
||||
{
|
||||
g_set_error_literal (error, GDK_GL_ERROR,
|
||||
GDK_GL_ERROR_UNSUPPORTED_FORMAT,
|
||||
_("No available configurations for the given pixel format"));
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/* if there isn't wglCreateContextAttribsARB(), or if GDK_GL_LEGACY is set, we default to a legacy context */
|
||||
legacy_bit = !win32_display->hasWglARBCreateContext ||
|
||||
g_getenv ("GDK_GL_LEGACY") != NULL;
|
||||
|
||||
if (debug_bit)
|
||||
flags |= WGL_CONTEXT_DEBUG_BIT_ARB;
|
||||
if (compat_bit)
|
||||
flags |= WGL_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB;
|
||||
|
||||
GDK_NOTE (OPENGL,
|
||||
g_print ("Creating %s WGL context (version:%d.%d, debug:%s, forward:%s, legacy: %s)\n",
|
||||
compat_bit ? "core" : "compat",
|
||||
major,
|
||||
minor,
|
||||
debug_bit ? "yes" : "no",
|
||||
compat_bit ? "yes" : "no",
|
||||
legacy_bit ? "yes" : "no"));
|
||||
|
||||
hglrc = _create_gl_context (context_win32->gl_hdc,
|
||||
share,
|
||||
flags,
|
||||
major,
|
||||
minor,
|
||||
&legacy_bit,
|
||||
win32_display->hasWglARBCreateContext);
|
||||
|
||||
if (hglrc == NULL)
|
||||
{
|
||||
g_set_error_literal (error, GDK_GL_ERROR,
|
||||
GDK_GL_ERROR_NOT_AVAILABLE,
|
||||
_("Unable to create a GL context"));
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
GDK_NOTE (OPENGL,
|
||||
g_print ("Created WGL context[%p], pixel_format=%d\n",
|
||||
hglrc,
|
||||
pixel_format));
|
||||
|
||||
context_win32->hglrc = hglrc;
|
||||
}
|
||||
|
||||
GDK_NOTE (OPENGL,
|
||||
g_print ("Created WGL context[%p], pixel_format=%d\n",
|
||||
hglrc,
|
||||
pixel_format));
|
||||
#ifdef GDK_WIN32_ENABLE_EGL
|
||||
if (win32_display->have_egl)
|
||||
{
|
||||
EGLContext ctx;
|
||||
|
||||
context_win32->hglrc = hglrc;
|
||||
if (debug_bit)
|
||||
flags |= EGL_CONTEXT_OPENGL_DEBUG_BIT_KHR;
|
||||
if (compat_bit)
|
||||
flags |= EGL_CONTEXT_OPENGL_FORWARD_COMPATIBLE_BIT_KHR;
|
||||
|
||||
GDK_NOTE (OPENGL, g_message ("Creating EGL context version %d.%d (debug:%s, forward:%s, legacy:%s)",
|
||||
major, minor,
|
||||
debug_bit ? "yes" : "no",
|
||||
compat_bit ? "yes" : "no",
|
||||
legacy_bit ? "yes" : "no"));
|
||||
|
||||
ctx = _create_egl_context (win32_display->egl_disp,
|
||||
context_win32->egl_config,
|
||||
share,
|
||||
flags,
|
||||
major,
|
||||
minor,
|
||||
&legacy_bit);
|
||||
|
||||
if (ctx == EGL_NO_CONTEXT)
|
||||
{
|
||||
g_set_error_literal (error, GDK_GL_ERROR,
|
||||
GDK_GL_ERROR_NOT_AVAILABLE,
|
||||
_("Unable to create a GL context"));
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
GDK_NOTE (OPENGL,
|
||||
g_print ("Created EGL context[%p]\n",
|
||||
ctx));
|
||||
|
||||
context_win32->egl_context = ctx;
|
||||
use_es = TRUE;
|
||||
}
|
||||
#endif
|
||||
|
||||
/* set whether we are using GLES */
|
||||
gdk_gl_context_set_use_es(context, use_es);
|
||||
|
||||
/* OpenGL does not work with WS_EX_LAYERED enabled, so we need to
|
||||
* disable WS_EX_LAYERED when we acquire a valid HGLRC
|
||||
@@ -804,9 +1155,21 @@ _gdk_win32_window_create_gl_context (GdkWindow *window,
|
||||
gboolean need_alpha_bits = (visual == gdk_screen_get_rgba_visual (gdk_display_get_default_screen (display)));
|
||||
|
||||
/* Acquire and store up the Windows-specific HWND and HDC */
|
||||
HWND hwnd;
|
||||
HDC hdc;
|
||||
|
||||
#ifdef GDK_WIN32_ENABLE_EGL
|
||||
EGLContext egl_context;
|
||||
EGLConfig config;
|
||||
#endif
|
||||
|
||||
display_win32->gl_hwnd = GDK_WINDOW_HWND (window);
|
||||
hdc = GetDC (display_win32->gl_hwnd);
|
||||
|
||||
#ifdef GDK_WIN32_ENABLE_EGL
|
||||
/* display_win32->hdc_egl_temp should *not* be destroyed here! It is destroyed at dispose()! */
|
||||
display_win32->hdc_egl_temp = hdc;
|
||||
#endif
|
||||
|
||||
if (!_gdk_win32_display_init_gl (display, need_alpha_bits))
|
||||
{
|
||||
g_set_error_literal (error, GDK_GL_ERROR,
|
||||
@@ -815,10 +1178,12 @@ _gdk_win32_window_create_gl_context (GdkWindow *window,
|
||||
return NULL;
|
||||
}
|
||||
|
||||
hwnd = GDK_WINDOW_HWND (window);
|
||||
hdc = GetDC (hwnd);
|
||||
|
||||
display_win32->gl_hwnd = hwnd;
|
||||
#ifdef GDK_WIN32_ENABLE_EGL
|
||||
if (display_win32->have_egl && !find_eglconfig_for_window (display_win32, &config,
|
||||
&display_win32->egl_min_swap_interval, need_alpha_bits,
|
||||
error))
|
||||
return NULL;
|
||||
#endif
|
||||
|
||||
context = g_object_new (GDK_TYPE_WIN32_GL_CONTEXT,
|
||||
"display", display,
|
||||
@@ -828,6 +1193,12 @@ _gdk_win32_window_create_gl_context (GdkWindow *window,
|
||||
|
||||
context->need_alpha_bits = need_alpha_bits;
|
||||
context->gl_hdc = hdc;
|
||||
|
||||
#ifdef GDK_WIN32_ENABLE_EGL
|
||||
if (display_win32->have_egl)
|
||||
context->egl_config = config;
|
||||
#endif
|
||||
|
||||
context->is_attached = attached;
|
||||
|
||||
return GDK_GL_CONTEXT (context);
|
||||
@@ -842,45 +1213,89 @@ _gdk_win32_display_make_gl_context_current (GdkDisplay *display,
|
||||
GdkWindow *window;
|
||||
GdkScreen *screen;
|
||||
|
||||
#if GDK_WIN32_ENABLE_EGL
|
||||
EGLSurface egl_surface;
|
||||
#endif
|
||||
|
||||
gboolean do_frame_sync = FALSE;
|
||||
|
||||
if (context == NULL)
|
||||
{
|
||||
wglMakeCurrent(NULL, NULL);
|
||||
if (display_win32->have_wgl)
|
||||
wglMakeCurrent(NULL, NULL);
|
||||
|
||||
#ifdef GDK_WIN32_ENABLE_EGL
|
||||
else if (display_win32->have_egl)
|
||||
eglMakeCurrent (display_win32->egl_disp, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT);
|
||||
#endif
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
context_win32 = GDK_WIN32_GL_CONTEXT (context);
|
||||
window = gdk_gl_context_get_window (context);
|
||||
|
||||
if (!wglMakeCurrent (context_win32->gl_hdc, context_win32->hglrc))
|
||||
if (!gdk_gl_context_get_use_es (context))
|
||||
{
|
||||
GDK_NOTE (OPENGL,
|
||||
g_print ("Making WGL context current failed\n"));
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (context_win32->is_attached && display_win32->hasWglEXTSwapControl)
|
||||
{
|
||||
window = gdk_gl_context_get_window (context);
|
||||
|
||||
/* If there is compositing there is no particular need to delay
|
||||
* the swap when drawing on the offscreen, rendering to the screen
|
||||
* happens later anyway, and its up to the compositor to sync that
|
||||
* to the vblank. */
|
||||
screen = gdk_window_get_screen (window);
|
||||
do_frame_sync = ! gdk_screen_is_composited (screen);
|
||||
|
||||
if (do_frame_sync != context_win32->do_frame_sync)
|
||||
if (!wglMakeCurrent (context_win32->gl_hdc, context_win32->hglrc))
|
||||
{
|
||||
context_win32->do_frame_sync = do_frame_sync;
|
||||
GDK_NOTE (OPENGL,
|
||||
g_print ("Making WGL context current failed\n"));
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (do_frame_sync)
|
||||
wglSwapIntervalEXT (1);
|
||||
else
|
||||
wglSwapIntervalEXT (0);
|
||||
if (context_win32->is_attached)
|
||||
{
|
||||
if (display_win32->hasWglEXTSwapControl)
|
||||
{
|
||||
/* If there is compositing there is no particular need to delay
|
||||
* the swap when drawing on the offscreen, rendering to the screen
|
||||
* happens later anyway, and its up to the compositor to sync that
|
||||
* to the vblank. */
|
||||
screen = gdk_window_get_screen (window);
|
||||
do_frame_sync = ! gdk_screen_is_composited (screen);
|
||||
|
||||
if (do_frame_sync != context_win32->do_frame_sync)
|
||||
{
|
||||
context_win32->do_frame_sync = do_frame_sync;
|
||||
|
||||
if (do_frame_sync)
|
||||
wglSwapIntervalEXT (1);
|
||||
else
|
||||
wglSwapIntervalEXT (0);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef GDK_WIN32_ENABLE_EGL
|
||||
else
|
||||
{
|
||||
if (context_win32->is_attached)
|
||||
egl_surface = _gdk_win32_window_get_egl_surface (window, context_win32->egl_config, FALSE);
|
||||
else
|
||||
{
|
||||
if (display_win32->hasEglSurfacelessContext)
|
||||
egl_surface = EGL_NO_SURFACE;
|
||||
else
|
||||
egl_surface = _gdk_win32_window_get_egl_surface (window, context_win32->egl_config, TRUE);
|
||||
}
|
||||
|
||||
if (!eglMakeCurrent (display_win32->egl_disp,
|
||||
egl_surface,
|
||||
egl_surface,
|
||||
context_win32->egl_context))
|
||||
{
|
||||
g_warning ("eglMakeCurrent failed");
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (display_win32->egl_min_swap_interval == 0)
|
||||
eglSwapInterval (display_win32->egl_disp, 0);
|
||||
else
|
||||
g_debug ("Can't disable GL swap interval");
|
||||
}
|
||||
#endif
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
@@ -901,18 +1316,55 @@ gdk_win32_display_get_wgl_version (GdkDisplay *display,
|
||||
gint *major,
|
||||
gint *minor)
|
||||
{
|
||||
GdkWin32Display *display_win32 = NULL;
|
||||
g_return_val_if_fail (GDK_IS_DISPLAY (display), FALSE);
|
||||
|
||||
if (!GDK_IS_WIN32_DISPLAY (display))
|
||||
return FALSE;
|
||||
|
||||
if (!_gdk_win32_display_init_gl (display, FALSE))
|
||||
display_win32 = GDK_WIN32_DISPLAY (display);
|
||||
|
||||
if (!_gdk_win32_display_init_gl (display, FALSE) || !display_win32->have_wgl
|
||||
#ifdef GDK_WIN32_ENABLE_EGL
|
||||
|| !display_win32->have_egl
|
||||
#endif
|
||||
)
|
||||
return FALSE;
|
||||
|
||||
if (major != NULL)
|
||||
*major = GDK_WIN32_DISPLAY (display)->gl_version / 10;
|
||||
if (minor != NULL)
|
||||
*minor = GDK_WIN32_DISPLAY (display)->gl_version % 10;
|
||||
if (display_win32->have_wgl)
|
||||
{
|
||||
if (major != NULL)
|
||||
*major = GDK_WIN32_DISPLAY (display)->gl_version / 10;
|
||||
if (minor != NULL)
|
||||
*minor = GDK_WIN32_DISPLAY (display)->gl_version % 10;
|
||||
}
|
||||
|
||||
#ifdef GDK_WIN32_ENABLE_EGL
|
||||
else if (display_win32->have_egl)
|
||||
{
|
||||
if (major != NULL)
|
||||
*major = GDK_WIN32_DISPLAY (display)->egl_version / 10;
|
||||
if (minor != NULL)
|
||||
*minor = GDK_WIN32_DISPLAY (display)->egl_version % 10;
|
||||
}
|
||||
#endif
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void
|
||||
_gdk_win32_window_invalidate_egl_framebuffer (GdkWindow *window)
|
||||
{
|
||||
/* If we are using ANGLE, we need to force redraw of the whole Window and its child windows
|
||||
* as we need to re-acquire the EGL surfaces that we rendered to upload to Cairo explicitly,
|
||||
* using gdk_window_invalidate_rect (), when we maximize or restore or use aerosnap
|
||||
*/
|
||||
#ifdef GDK_WIN32_ENABLE_EGL
|
||||
if (window->gl_paint_context != NULL && gdk_gl_context_get_use_es (window->gl_paint_context))
|
||||
{
|
||||
GdkWindowImplWin32 *impl = GDK_WINDOW_IMPL_WIN32 (window->impl);
|
||||
|
||||
impl->egl_force_redraw_all = TRUE;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -24,6 +24,10 @@
|
||||
#include <epoxy/gl.h>
|
||||
#include <epoxy/wgl.h>
|
||||
|
||||
#ifdef GDK_WIN32_ENABLE_EGL
|
||||
# include <epoxy/egl.h>
|
||||
#endif
|
||||
|
||||
#include "gdkglcontextprivate.h"
|
||||
#include "gdkdisplayprivate.h"
|
||||
#include "gdkvisual.h"
|
||||
@@ -46,6 +50,12 @@ struct _GdkWin32GLContext
|
||||
guint is_attached : 1;
|
||||
guint do_frame_sync : 1;
|
||||
guint do_blit_swap : 1;
|
||||
|
||||
#ifdef GDK_WIN32_ENABLE_EGL
|
||||
/* EGL (Angle) Context Items */
|
||||
EGLContext egl_context;
|
||||
EGLConfig egl_config;
|
||||
#endif
|
||||
};
|
||||
|
||||
struct _GdkWin32GLContextClass
|
||||
@@ -76,6 +86,9 @@ gboolean
|
||||
_gdk_win32_gl_context_realize (GdkGLContext *context,
|
||||
GError **error);
|
||||
|
||||
void
|
||||
_gdk_win32_window_invalidate_egl_framebuffer (GdkWindow *window);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __GDK_WIN32_GL_CONTEXT__ */
|
||||
|
||||
@@ -1074,6 +1074,7 @@ gdk_win32_window_destroy (GdkWindow *window,
|
||||
{
|
||||
GdkWindowImplWin32 *window_impl = GDK_WINDOW_IMPL_WIN32 (window->impl);
|
||||
GSList *tmp;
|
||||
GdkWin32Display *display = NULL;
|
||||
|
||||
g_return_if_fail (GDK_IS_WINDOW (window));
|
||||
|
||||
@@ -1096,6 +1097,22 @@ gdk_win32_window_destroy (GdkWindow *window,
|
||||
g_slist_free (window_impl->transient_children);
|
||||
window_impl->transient_children = NULL;
|
||||
|
||||
#ifdef GDK_WIN32_ENABLE_EGL
|
||||
display = GDK_WIN32_DISPLAY (gdk_window_get_display (window));
|
||||
|
||||
/* Get rid of any EGLSurfaces that we might have created */
|
||||
if (window_impl->egl_surface != EGL_NO_SURFACE)
|
||||
{
|
||||
eglDestroySurface (display->egl_disp, window_impl->egl_surface);
|
||||
window_impl->egl_surface = EGL_NO_SURFACE;
|
||||
}
|
||||
if (window_impl->egl_dummy_surface != EGL_NO_SURFACE)
|
||||
{
|
||||
eglDestroySurface (display->egl_disp, window_impl->egl_dummy_surface);
|
||||
window_impl->egl_dummy_surface = EGL_NO_SURFACE;
|
||||
}
|
||||
#endif
|
||||
|
||||
/* Remove ourself from our transient owner */
|
||||
if (window_impl->transient_owner != NULL)
|
||||
{
|
||||
@@ -1695,6 +1712,7 @@ gdk_win32_window_move_resize (GdkWindow *window,
|
||||
}
|
||||
else
|
||||
{
|
||||
_gdk_win32_window_invalidate_egl_framebuffer (window);
|
||||
if (with_move)
|
||||
{
|
||||
gdk_win32_window_move_resize_internal (window, x, y, width, height);
|
||||
@@ -4759,6 +4777,9 @@ gdk_win32_window_end_move_resize_drag (GdkWindow *window)
|
||||
GdkWindowImplWin32 *impl = GDK_WINDOW_IMPL_WIN32 (window->impl);
|
||||
GdkW32DragMoveResizeContext *context = &impl->drag_move_resize_context;
|
||||
|
||||
if (context->op == GDK_WIN32_DRAGOP_RESIZE)
|
||||
_gdk_win32_window_invalidate_egl_framebuffer (window);
|
||||
|
||||
context->op = GDK_WIN32_DRAGOP_NONE;
|
||||
|
||||
gdk_device_ungrab (context->device, GDK_CURRENT_TIME);
|
||||
@@ -5278,6 +5299,8 @@ gdk_win32_window_unmaximize (GdkWindow *window)
|
||||
GDK_WINDOW_HWND (window),
|
||||
_gdk_win32_window_state_to_string (window->state)));
|
||||
|
||||
_gdk_win32_window_invalidate_egl_framebuffer (window);
|
||||
|
||||
if (GDK_WINDOW_IS_MAPPED (window))
|
||||
GtkShowWindow (window, SW_RESTORE);
|
||||
else
|
||||
@@ -6017,6 +6040,7 @@ GtkShowWindow (GdkWindow *window,
|
||||
case SW_SHOWNA:
|
||||
case SW_SHOWNOACTIVATE:
|
||||
case SW_SHOWNORMAL:
|
||||
|
||||
if (IsWindowVisible (hwnd))
|
||||
break;
|
||||
|
||||
@@ -6276,3 +6300,35 @@ gdk_win32_window_get_handle (GdkWindow *window)
|
||||
|
||||
return GDK_WINDOW_HWND (window);
|
||||
}
|
||||
|
||||
#ifdef GDK_WIN32_ENABLE_EGL
|
||||
EGLSurface
|
||||
_gdk_win32_window_get_egl_surface (GdkWindow *window,
|
||||
EGLConfig config,
|
||||
gboolean is_dummy)
|
||||
{
|
||||
EGLSurface surface;
|
||||
GdkWin32Display *display = GDK_WIN32_DISPLAY (gdk_window_get_display (window));
|
||||
GdkWindowImplWin32 *impl = GDK_WINDOW_IMPL_WIN32 (window->impl);
|
||||
|
||||
if (is_dummy)
|
||||
{
|
||||
if (impl->egl_dummy_surface == EGL_NO_SURFACE)
|
||||
{
|
||||
EGLint attribs[] = {EGL_WIDTH, 1, EGL_WIDTH, 1, EGL_NONE};
|
||||
impl->egl_dummy_surface = eglCreatePbufferSurface (display->egl_disp,
|
||||
config,
|
||||
attribs);
|
||||
}
|
||||
return impl->egl_dummy_surface;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (impl->egl_surface == EGL_NO_SURFACE)
|
||||
impl->egl_surface = eglCreateWindowSurface (display->egl_disp, config, display->gl_hwnd, NULL);
|
||||
|
||||
return impl->egl_surface;
|
||||
}
|
||||
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -31,6 +31,10 @@
|
||||
|
||||
#include <windows.h>
|
||||
|
||||
#ifdef GDK_WIN32_ENABLE_EGL
|
||||
#include <epoxy/egl.h>
|
||||
#endif
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
/* Window implementation for Win32
|
||||
@@ -352,6 +356,12 @@ struct _GdkWindowImplWin32
|
||||
gint window_scale;
|
||||
gint unscaled_width;
|
||||
gint unscaled_height;
|
||||
|
||||
#ifdef GDK_WIN32_ENABLE_EGL
|
||||
EGLSurface egl_surface;
|
||||
EGLSurface egl_dummy_surface;
|
||||
guint egl_force_redraw_all : 1;
|
||||
#endif
|
||||
};
|
||||
|
||||
struct _GdkWindowImplWin32Class
|
||||
@@ -373,6 +383,12 @@ void _gdk_win32_window_update_style_bits (GdkWindow *window);
|
||||
|
||||
gint _gdk_win32_window_get_scale_factor (GdkWindow *window);
|
||||
|
||||
#ifdef GDK_WIN32_ENABLE_EGL
|
||||
EGLSurface _gdk_win32_window_get_egl_surface (GdkWindow *window,
|
||||
EGLConfig config,
|
||||
gboolean is_dummy);
|
||||
#endif
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __GDK_WINDOW_WIN32_H__ */
|
||||
|
||||
+16
-9
@@ -192,6 +192,9 @@ gtk_public_h_sources = \
|
||||
gtkenums.h \
|
||||
gtkeventbox.h \
|
||||
gtkeventcontroller.h \
|
||||
gtkeventcontrollerkey.h \
|
||||
gtkeventcontrollermotion.h \
|
||||
gtkeventcontrollerscroll.h \
|
||||
gtkexpander.h \
|
||||
gtkfilechooser.h \
|
||||
gtkfilechooserbutton.h \
|
||||
@@ -213,6 +216,7 @@ gtk_public_h_sources = \
|
||||
gtkgesturepan.h \
|
||||
gtkgesturerotate.h \
|
||||
gtkgesturesingle.h \
|
||||
gtkgesturestylus.h \
|
||||
gtkgestureswipe.h \
|
||||
gtkgesturezoom.h \
|
||||
gtkglarea.h \
|
||||
@@ -491,6 +495,7 @@ gtk_private_h_sources = \
|
||||
gtkgesturepanprivate.h \
|
||||
gtkgesturerotateprivate.h \
|
||||
gtkgesturesingleprivate.h \
|
||||
gtkgesturestylusprivate.h \
|
||||
gtkgestureswipeprivate.h \
|
||||
gtkgesturezoomprivate.h \
|
||||
gtkheaderbarprivate.h \
|
||||
@@ -592,7 +597,10 @@ gtk_private_h_sources = \
|
||||
gtkwin32themeprivate.h \
|
||||
gtkwindowprivate.h \
|
||||
gtktreemenu.h \
|
||||
gdkpixbufutilsprivate.h
|
||||
gdkpixbufutilsprivate.h \
|
||||
open-type-layout.h \
|
||||
language-names.h \
|
||||
script-names.h
|
||||
|
||||
# GTK+ C sources to build the library from
|
||||
gtk_base_c_sources = \
|
||||
@@ -754,6 +762,9 @@ gtk_base_c_sources = \
|
||||
gtkentrycompletion.c \
|
||||
gtkeventbox.c \
|
||||
gtkeventcontroller.c \
|
||||
gtkeventcontrollerkey.c \
|
||||
gtkeventcontrollermotion.c \
|
||||
gtkeventcontrollerscroll.c \
|
||||
gtkexpander.c \
|
||||
gtkfilechooser.c \
|
||||
gtkfilechooserbutton.c \
|
||||
@@ -783,6 +794,7 @@ gtk_base_c_sources = \
|
||||
gtkgesturepan.c \
|
||||
gtkgesturerotate.c \
|
||||
gtkgesturesingle.c \
|
||||
gtkgesturestylus.c \
|
||||
gtkgestureswipe.c \
|
||||
gtkgesturezoom.c \
|
||||
gtkglarea.c \
|
||||
@@ -1269,10 +1281,6 @@ gtk.gresource.xml: Makefile.am inspector/Makefile.inc
|
||||
$(AM_V_GEN) echo "<?xml version='1.0' encoding='UTF-8'?>" > $@; \
|
||||
echo "<gresources>" >> $@; \
|
||||
echo " <gresource prefix='/org/gtk/libgtk'>" >> $@; \
|
||||
for f in $(srcdir)/theme/Raleigh/*.css; do \
|
||||
n=`basename $$f`; \
|
||||
echo " <file alias='theme/Raleigh/gtk.css'>theme/Raleigh/$$n</file>" >> $@; \
|
||||
done; \
|
||||
echo " <file>theme/Adwaita/gtk.css</file>" >> $@; \
|
||||
echo " <file>theme/Adwaita/gtk-dark.css</file>" >> $@; \
|
||||
echo " <file>theme/Adwaita/gtk-contained.css</file>" >> $@; \
|
||||
@@ -1309,7 +1317,7 @@ gtk.gresource.xml: Makefile.am inspector/Makefile.inc
|
||||
done; \
|
||||
for f in $(srcdir)/ui/*.ui; do \
|
||||
n=`basename $$f`; \
|
||||
echo " <file compressed='true'>ui/$$n</file>" >> $@; \
|
||||
echo " <file preprocess='xml-stripblanks'>ui/$$n</file>" >> $@; \
|
||||
done; \
|
||||
for s in 16x16 22x22 24x24 32x32 48x48; do \
|
||||
for c in actions status; do \
|
||||
@@ -1322,7 +1330,7 @@ gtk.gresource.xml: Makefile.am inspector/Makefile.inc
|
||||
done; \
|
||||
for f in $(srcdir)/inspector/*.ui; do \
|
||||
n=`basename $$f`; \
|
||||
echo " <file compressed='true'>inspector/$$n</file>" >> $@; \
|
||||
echo " <file compressed='true' preprocess='xml-stripblanks'>inspector/$$n</file>" >> $@; \
|
||||
done; \
|
||||
echo " <file>inspector/logo.png</file>" >> $@; \
|
||||
echo " <file>emoji/emoji.data</file>" >> $@; \
|
||||
@@ -1393,8 +1401,7 @@ theme_sources = \
|
||||
theme/HighContrast/gtk-contained.css \
|
||||
theme/HighContrast/gtk-contained-inverse.css \
|
||||
theme/HighContrast/gtk.css \
|
||||
theme/HighContrast/gtk-inverse.css \
|
||||
theme/Raleigh/gtk-default.css
|
||||
theme/HighContrast/gtk-inverse.css
|
||||
|
||||
resource_files = $(shell $(GLIB_COMPILE_RESOURCES) --sourcedir=$(srcdir) --generate-dependencies $(builddir)/gtk.gresource.xml)
|
||||
|
||||
|
||||
@@ -94,6 +94,9 @@
|
||||
#include <gtk/gtkenums.h>
|
||||
#include <gtk/gtkeventbox.h>
|
||||
#include <gtk/gtkeventcontroller.h>
|
||||
#include <gtk/gtkeventcontrollerkey.h>
|
||||
#include <gtk/gtkeventcontrollermotion.h>
|
||||
#include <gtk/gtkeventcontrollerscroll.h>
|
||||
#include <gtk/gtkexpander.h>
|
||||
#include <gtk/gtkfixed.h>
|
||||
#include <gtk/gtkfilechooser.h>
|
||||
@@ -115,6 +118,7 @@
|
||||
#include <gtk/gtkgesturepan.h>
|
||||
#include <gtk/gtkgesturerotate.h>
|
||||
#include <gtk/gtkgesturesingle.h>
|
||||
#include <gtk/gtkgesturestylus.h>
|
||||
#include <gtk/gtkgestureswipe.h>
|
||||
#include <gtk/gtkgesturezoom.h>
|
||||
#include <gtk/gtkglarea.h>
|
||||
|
||||
@@ -1972,6 +1972,8 @@ gtk_css_provider_load_from_resource (GtkCssProvider *css_provider,
|
||||
*
|
||||
* Returns: (transfer none): The provider used for fallback styling.
|
||||
* This memory is owned by GTK+, and you must not free it.
|
||||
*
|
||||
* Deprecated: 3.24: Use gtk_css_provider_new() instead.
|
||||
**/
|
||||
GtkCssProvider *
|
||||
gtk_css_provider_get_default (void)
|
||||
|
||||
@@ -112,7 +112,7 @@ GDK_AVAILABLE_IN_3_16
|
||||
void gtk_css_provider_load_from_resource (GtkCssProvider *css_provider,
|
||||
const gchar *resource_path);
|
||||
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GDK_DEPRECATED_FOR(gtk_css_provider_new)
|
||||
GtkCssProvider * gtk_css_provider_get_default (void);
|
||||
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
|
||||
@@ -404,7 +404,8 @@ add_emoji (GtkWidget *box,
|
||||
pango_layout_get_extents (layout, &rect, NULL);
|
||||
|
||||
/* Check for fallback rendering that generates too wide items */
|
||||
if (rect.width >= 2 * chooser->emoji_max_width)
|
||||
if (pango_layout_get_unknown_glyphs_count (layout) > 0 ||
|
||||
rect.width >= 1.5 * chooser->emoji_max_width)
|
||||
{
|
||||
gtk_widget_destroy (label);
|
||||
return;
|
||||
@@ -654,7 +655,8 @@ gtk_emoji_chooser_init (GtkEmojiChooser *chooser)
|
||||
/* Get a reasonable maximum width for an emoji. We do this to
|
||||
* skip overly wide fallback rendering for certain emojis the
|
||||
* font does not contain and therefore end up being rendered
|
||||
* as multiply glyphs. */
|
||||
* as multiply glyphs.
|
||||
*/
|
||||
{
|
||||
PangoLayout *layout = gtk_widget_create_pango_layout (GTK_WIDGET (chooser), "🙂");
|
||||
PangoAttrList *attrs;
|
||||
|
||||
@@ -0,0 +1,271 @@
|
||||
/* GTK - The GIMP Toolkit
|
||||
* Copyright (C) 2017, Red Hat, Inc.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* Author(s): Carlos Garnacho <carlosg@gnome.org>
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include "gtkintl.h"
|
||||
#include "gtkprivate.h"
|
||||
#include "gtkwidgetprivate.h"
|
||||
#include "gtkeventcontrollerprivate.h"
|
||||
#include "gtkeventcontrollerkey.h"
|
||||
#include "gtkbindings.h"
|
||||
|
||||
#include <gdk/gdk.h>
|
||||
|
||||
struct _GtkEventControllerKey
|
||||
{
|
||||
GtkEventController parent_instance;
|
||||
GtkIMContext *im_context;
|
||||
GHashTable *pressed_keys;
|
||||
|
||||
const GdkEvent *current_event;
|
||||
};
|
||||
|
||||
struct _GtkEventControllerKeyClass
|
||||
{
|
||||
GtkEventControllerClass parent_class;
|
||||
};
|
||||
|
||||
enum {
|
||||
KEY_PRESSED,
|
||||
KEY_RELEASED,
|
||||
MODIFIERS,
|
||||
IM_UPDATE,
|
||||
FOCUS_IN,
|
||||
FOCUS_OUT,
|
||||
N_SIGNALS
|
||||
};
|
||||
|
||||
static guint signals[N_SIGNALS] = { 0 };
|
||||
|
||||
G_DEFINE_TYPE (GtkEventControllerKey, gtk_event_controller_key,
|
||||
GTK_TYPE_EVENT_CONTROLLER)
|
||||
|
||||
static void
|
||||
gtk_event_controller_finalize (GObject *object)
|
||||
{
|
||||
GtkEventControllerKey *key = GTK_EVENT_CONTROLLER_KEY (object);
|
||||
|
||||
g_hash_table_destroy (key->pressed_keys);
|
||||
g_clear_object (&key->im_context);
|
||||
|
||||
G_OBJECT_CLASS (gtk_event_controller_key_parent_class)->finalize (object);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
gtk_event_controller_key_handle_event (GtkEventController *controller,
|
||||
const GdkEvent *event)
|
||||
{
|
||||
GtkEventControllerKey *key = GTK_EVENT_CONTROLLER_KEY (controller);
|
||||
GdkEventType event_type = gdk_event_get_event_type (event);
|
||||
gboolean handled;
|
||||
GdkModifierType state;
|
||||
guint16 keycode;
|
||||
guint keyval;
|
||||
|
||||
if (event_type == GDK_FOCUS_CHANGE)
|
||||
{
|
||||
if (event->focus_change.in)
|
||||
g_signal_emit (controller, signals[FOCUS_IN], 0);
|
||||
else
|
||||
g_signal_emit (controller, signals[FOCUS_OUT], 0);
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (event_type != GDK_KEY_PRESS && event_type != GDK_KEY_RELEASE)
|
||||
return FALSE;
|
||||
|
||||
if (key->im_context &&
|
||||
gtk_im_context_filter_keypress (key->im_context, (GdkEventKey *) event))
|
||||
{
|
||||
g_signal_emit (controller, signals[IM_UPDATE], 0);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
if (!gdk_event_get_state (event, &state) || !event->key.is_modifier)
|
||||
return FALSE;
|
||||
|
||||
key->current_event = event;
|
||||
|
||||
if (event->key.is_modifier)
|
||||
{
|
||||
if (event_type == GDK_KEY_PRESS)
|
||||
g_signal_emit (controller, signals[MODIFIERS], 0, state, &handled);
|
||||
else
|
||||
handled = TRUE;
|
||||
|
||||
if (handled == TRUE)
|
||||
{
|
||||
key->current_event = NULL;
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
gdk_event_get_keycode (event, &keycode);
|
||||
gdk_event_get_keyval (event, &keyval);
|
||||
|
||||
if (event_type == GDK_KEY_PRESS)
|
||||
{
|
||||
g_signal_emit (controller, signals[KEY_PRESSED], 0,
|
||||
keyval, keycode, state, &handled);
|
||||
if (handled)
|
||||
g_hash_table_add (key->pressed_keys, GUINT_TO_POINTER (keyval));
|
||||
}
|
||||
else if (event_type == GDK_KEY_RELEASE)
|
||||
{
|
||||
g_signal_emit (controller, signals[KEY_RELEASED], 0,
|
||||
keyval, keycode, state);
|
||||
|
||||
handled = g_hash_table_lookup (key->pressed_keys, GUINT_TO_POINTER (keyval)) != NULL;
|
||||
g_hash_table_remove (key->pressed_keys, GUINT_TO_POINTER (keyval));
|
||||
}
|
||||
else
|
||||
handled = FALSE;
|
||||
|
||||
key->current_event = NULL;
|
||||
|
||||
return handled;
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_event_controller_key_class_init (GtkEventControllerKeyClass *klass)
|
||||
{
|
||||
GtkEventControllerClass *controller_class = GTK_EVENT_CONTROLLER_CLASS (klass);
|
||||
GObjectClass *object_class = G_OBJECT_CLASS (klass);
|
||||
|
||||
object_class->finalize = gtk_event_controller_finalize;
|
||||
controller_class->handle_event = gtk_event_controller_key_handle_event;
|
||||
|
||||
signals[KEY_PRESSED] =
|
||||
g_signal_new (I_("key-pressed"),
|
||||
GTK_TYPE_EVENT_CONTROLLER_KEY,
|
||||
G_SIGNAL_RUN_LAST,
|
||||
0, _gtk_boolean_handled_accumulator, NULL, NULL,
|
||||
G_TYPE_BOOLEAN, 3, G_TYPE_UINT, G_TYPE_UINT, GDK_TYPE_MODIFIER_TYPE);
|
||||
signals[KEY_RELEASED] =
|
||||
g_signal_new (I_("key-released"),
|
||||
GTK_TYPE_EVENT_CONTROLLER_KEY,
|
||||
G_SIGNAL_RUN_LAST,
|
||||
0, NULL, NULL, NULL,
|
||||
G_TYPE_NONE, 3, G_TYPE_UINT, G_TYPE_UINT, GDK_TYPE_MODIFIER_TYPE);
|
||||
signals[MODIFIERS] =
|
||||
g_signal_new (I_("modifiers"),
|
||||
GTK_TYPE_EVENT_CONTROLLER_KEY,
|
||||
G_SIGNAL_RUN_LAST,
|
||||
0, NULL, NULL,
|
||||
g_cclosure_marshal_BOOLEAN__FLAGS,
|
||||
G_TYPE_BOOLEAN, 1, GDK_TYPE_MODIFIER_TYPE);
|
||||
signals[IM_UPDATE] =
|
||||
g_signal_new (I_("im-update"),
|
||||
GTK_TYPE_EVENT_CONTROLLER_KEY,
|
||||
G_SIGNAL_RUN_LAST,
|
||||
0, NULL, NULL,
|
||||
g_cclosure_marshal_VOID__VOID,
|
||||
G_TYPE_NONE, 0);
|
||||
signals[FOCUS_IN] =
|
||||
g_signal_new (I_("focus-in"),
|
||||
GTK_TYPE_EVENT_CONTROLLER_KEY,
|
||||
G_SIGNAL_RUN_LAST,
|
||||
0, NULL, NULL,
|
||||
g_cclosure_marshal_VOID__VOID,
|
||||
G_TYPE_NONE, 0);
|
||||
signals[FOCUS_OUT] =
|
||||
g_signal_new (I_("focus-out"),
|
||||
GTK_TYPE_EVENT_CONTROLLER_KEY,
|
||||
G_SIGNAL_RUN_LAST,
|
||||
0, NULL, NULL,
|
||||
g_cclosure_marshal_VOID__VOID,
|
||||
G_TYPE_NONE, 0);
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_event_controller_key_init (GtkEventControllerKey *controller)
|
||||
{
|
||||
controller->pressed_keys = g_hash_table_new (NULL, NULL);
|
||||
}
|
||||
|
||||
GtkEventController *
|
||||
gtk_event_controller_key_new (GtkWidget *widget)
|
||||
{
|
||||
g_return_val_if_fail (GTK_IS_WIDGET (widget), NULL);
|
||||
|
||||
return g_object_new (GTK_TYPE_EVENT_CONTROLLER_KEY,
|
||||
"widget", widget,
|
||||
NULL);
|
||||
}
|
||||
|
||||
void
|
||||
gtk_event_controller_key_set_im_context (GtkEventControllerKey *controller,
|
||||
GtkIMContext *im_context)
|
||||
{
|
||||
g_return_if_fail (GTK_IS_EVENT_CONTROLLER_KEY (controller));
|
||||
g_return_if_fail (!im_context || GTK_IS_IM_CONTEXT (im_context));
|
||||
|
||||
if (controller->im_context)
|
||||
gtk_im_context_reset (controller->im_context);
|
||||
|
||||
g_set_object (&controller->im_context, im_context);
|
||||
}
|
||||
|
||||
/**
|
||||
* gtk_event_controller_key_get_im_context:
|
||||
* @controller: a #GtkEventControllerKey
|
||||
*
|
||||
* Gets the IM context of a key controller.
|
||||
*
|
||||
* Returns: (transfer none): the IM context
|
||||
*
|
||||
* Since: 3.24
|
||||
**/
|
||||
GtkIMContext *
|
||||
gtk_event_controller_key_get_im_context (GtkEventControllerKey *controller)
|
||||
{
|
||||
g_return_val_if_fail (GTK_IS_EVENT_CONTROLLER_KEY (controller), NULL);
|
||||
|
||||
return controller->im_context;
|
||||
}
|
||||
|
||||
gboolean
|
||||
gtk_event_controller_key_forward (GtkEventControllerKey *controller,
|
||||
GtkWidget *widget)
|
||||
{
|
||||
g_return_val_if_fail (GTK_IS_EVENT_CONTROLLER_KEY (controller), FALSE);
|
||||
g_return_val_if_fail (GTK_IS_WIDGET (widget), FALSE);
|
||||
g_return_val_if_fail (controller->current_event != NULL, FALSE);
|
||||
|
||||
if (!gtk_widget_get_realized (widget))
|
||||
gtk_widget_realize (widget);
|
||||
|
||||
if (_gtk_widget_captured_event (widget, (GdkEvent *) controller->current_event))
|
||||
return TRUE;
|
||||
if (gtk_widget_event (widget, (GdkEvent *) controller->current_event))
|
||||
return TRUE;
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
guint
|
||||
gtk_event_controller_key_get_group (GtkEventControllerKey *controller)
|
||||
{
|
||||
g_return_val_if_fail (GTK_IS_EVENT_CONTROLLER_KEY (controller), FALSE);
|
||||
g_return_val_if_fail (controller->current_event != NULL, FALSE);
|
||||
|
||||
return controller->current_event->key.group;
|
||||
}
|
||||
@@ -0,0 +1,63 @@
|
||||
/* GTK - The GIMP Toolkit
|
||||
* Copyright (C) 2017, Red Hat, Inc.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* Author(s): Carlos Garnacho <carlosg@gnome.org>
|
||||
*/
|
||||
|
||||
#ifndef __GTK_EVENT_CONTROLLER_KEY_H__
|
||||
#define __GTK_EVENT_CONTROLLER_KEY_H__
|
||||
|
||||
#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION)
|
||||
#error "Only <gtk/gtk.h> can be included directly."
|
||||
#endif
|
||||
|
||||
#include <gdk/gdk.h>
|
||||
#include <gtk/gtkeventcontroller.h>
|
||||
#include <gtk/gtkimcontext.h>
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
#define GTK_TYPE_EVENT_CONTROLLER_KEY (gtk_event_controller_key_get_type ())
|
||||
#define GTK_EVENT_CONTROLLER_KEY(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GTK_TYPE_EVENT_CONTROLLER_KEY, GtkEventControllerKey))
|
||||
#define GTK_EVENT_CONTROLLER_KEY_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), GTK_TYPE_EVENT_CONTROLLER_KEY, GtkEventControllerKeyClass))
|
||||
#define GTK_IS_EVENT_CONTROLLER_KEY(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GTK_TYPE_EVENT_CONTROLLER_KEY))
|
||||
#define GTK_IS_EVENT_CONTROLLER_KEY_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), GTK_TYPE_EVENT_CONTROLLER_KEY))
|
||||
#define GTK_EVENT_CONTROLLER_KEY_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GTK_TYPE_EVENT_CONTROLLER_KEY, GtkEventControllerKeyClass))
|
||||
|
||||
typedef struct _GtkEventControllerKey GtkEventControllerKey;
|
||||
typedef struct _GtkEventControllerKeyClass GtkEventControllerKeyClass;
|
||||
|
||||
GDK_AVAILABLE_IN_3_24
|
||||
GType gtk_event_controller_key_get_type (void) G_GNUC_CONST;
|
||||
|
||||
GDK_AVAILABLE_IN_3_24
|
||||
GtkEventController *gtk_event_controller_key_new (GtkWidget *widget);
|
||||
|
||||
GDK_AVAILABLE_IN_3_24
|
||||
void gtk_event_controller_key_set_im_context (GtkEventControllerKey *controller,
|
||||
GtkIMContext *im_context);
|
||||
GDK_AVAILABLE_IN_3_24
|
||||
GtkIMContext * gtk_event_controller_key_get_im_context (GtkEventControllerKey *controller);
|
||||
|
||||
GDK_AVAILABLE_IN_3_24
|
||||
gboolean gtk_event_controller_key_forward (GtkEventControllerKey *controller,
|
||||
GtkWidget *widget);
|
||||
GDK_AVAILABLE_IN_3_24
|
||||
guint gtk_event_controller_key_get_group (GtkEventControllerKey *controller);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __GTK_EVENT_CONTROLLER_KEY_H__ */
|
||||
@@ -0,0 +1,169 @@
|
||||
/* GTK - The GIMP Toolkit
|
||||
* Copyright (C) 2017, Red Hat, Inc.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* Author(s): Matthias Clasen <mclasen@redhat.com>
|
||||
*/
|
||||
|
||||
/**
|
||||
* SECTION:gtkeventcontrollermotion
|
||||
* @Short_description: Event controller for motion events
|
||||
* @Title: GtkEventControllerMotion
|
||||
* @See_also: #GtkEventController
|
||||
*
|
||||
* #GtkEventControllerMotion is an event controller meant for situations
|
||||
* where you need to track the position of the pointer.
|
||||
*
|
||||
* This object was added in 3.24.
|
||||
**/
|
||||
#include "config.h"
|
||||
|
||||
#include "gtkintl.h"
|
||||
#include "gtkwidget.h"
|
||||
#include "gtkeventcontrollerprivate.h"
|
||||
#include "gtkeventcontrollermotion.h"
|
||||
#include "gtktypebuiltins.h"
|
||||
#include "gtkmarshalers.h"
|
||||
|
||||
struct _GtkEventControllerMotion
|
||||
{
|
||||
GtkEventController parent_instance;
|
||||
};
|
||||
|
||||
struct _GtkEventControllerMotionClass
|
||||
{
|
||||
GtkEventControllerClass parent_class;
|
||||
};
|
||||
|
||||
enum {
|
||||
ENTER,
|
||||
LEAVE,
|
||||
MOTION,
|
||||
N_SIGNALS
|
||||
};
|
||||
|
||||
static guint signals[N_SIGNALS] = { 0 };
|
||||
|
||||
G_DEFINE_TYPE (GtkEventControllerMotion, gtk_event_controller_motion, GTK_TYPE_EVENT_CONTROLLER)
|
||||
|
||||
static gboolean
|
||||
gtk_event_controller_motion_handle_event (GtkEventController *controller,
|
||||
const GdkEvent *event)
|
||||
{
|
||||
GtkEventControllerClass *parent_class;
|
||||
GdkEventType type;
|
||||
|
||||
type = gdk_event_get_event_type (event);
|
||||
if (type == GDK_ENTER_NOTIFY)
|
||||
{
|
||||
double x, y;
|
||||
gdk_event_get_coords (event, &x, &y);
|
||||
g_signal_emit (controller, signals[ENTER], 0, x, y);
|
||||
}
|
||||
else if (type == GDK_LEAVE_NOTIFY)
|
||||
{
|
||||
g_signal_emit (controller, signals[LEAVE], 0);
|
||||
}
|
||||
else if (type == GDK_MOTION_NOTIFY)
|
||||
{
|
||||
double x, y;
|
||||
gdk_event_get_coords (event, &x, &y);
|
||||
g_signal_emit (controller, signals[MOTION], 0, x, y);
|
||||
}
|
||||
|
||||
parent_class = GTK_EVENT_CONTROLLER_CLASS (gtk_event_controller_motion_parent_class);
|
||||
|
||||
return parent_class->handle_event (controller, event);
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_event_controller_motion_class_init (GtkEventControllerMotionClass *klass)
|
||||
{
|
||||
GtkEventControllerClass *controller_class = GTK_EVENT_CONTROLLER_CLASS (klass);
|
||||
|
||||
controller_class->handle_event = gtk_event_controller_motion_handle_event;
|
||||
|
||||
/**
|
||||
* GtkEventControllerMotion::enter:
|
||||
* @controller: The object that received the signal
|
||||
* @x: the x coordinate
|
||||
* @y: the y coordinate
|
||||
*
|
||||
* Signals that the pointer has entered the widget.
|
||||
*/
|
||||
signals[ENTER] =
|
||||
g_signal_new (I_("enter"),
|
||||
GTK_TYPE_EVENT_CONTROLLER_MOTION,
|
||||
G_SIGNAL_RUN_FIRST,
|
||||
0, NULL, NULL,
|
||||
NULL,
|
||||
G_TYPE_NONE, 2, G_TYPE_DOUBLE, G_TYPE_DOUBLE);
|
||||
|
||||
/**
|
||||
* GtkEventControllerMotion::leave:
|
||||
* @controller: The object that received the signal
|
||||
*
|
||||
* Signals that pointer has left the widget.
|
||||
*/
|
||||
signals[LEAVE] =
|
||||
g_signal_new (I_("leave"),
|
||||
GTK_TYPE_EVENT_CONTROLLER_MOTION,
|
||||
G_SIGNAL_RUN_FIRST,
|
||||
0, NULL, NULL,
|
||||
NULL,
|
||||
G_TYPE_NONE, 0);
|
||||
|
||||
/**
|
||||
* GtkEventControllerMotion::motion:
|
||||
* @controller: The object that received the signal
|
||||
* @x: the x coordinate
|
||||
* @y: the y coordinate
|
||||
*
|
||||
* Emitted when the pointer moves inside the widget.
|
||||
*/
|
||||
signals[MOTION] =
|
||||
g_signal_new (I_("motion"),
|
||||
GTK_TYPE_EVENT_CONTROLLER_MOTION,
|
||||
G_SIGNAL_RUN_FIRST,
|
||||
0, NULL, NULL,
|
||||
NULL,
|
||||
G_TYPE_NONE, 2, G_TYPE_DOUBLE, G_TYPE_DOUBLE);
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_event_controller_motion_init (GtkEventControllerMotion *motion)
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* gtk_event_controller_motion_new:
|
||||
* @widget: a #GtkWidget
|
||||
*
|
||||
* Creates a new event controller that will handle motion events
|
||||
* for the given @widget.
|
||||
*
|
||||
* Returns: a new #GtkEventControllerMotion
|
||||
*
|
||||
* Since: 3.24
|
||||
**/
|
||||
GtkEventController *
|
||||
gtk_event_controller_motion_new (GtkWidget *widget)
|
||||
{
|
||||
g_return_val_if_fail (GTK_IS_WIDGET (widget), NULL);
|
||||
|
||||
return g_object_new (GTK_TYPE_EVENT_CONTROLLER_MOTION,
|
||||
"widget", widget,
|
||||
NULL);
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
/* GTK - The GIMP Toolkit
|
||||
* Copyright (C) 2017, Red Hat, Inc.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* Author(s): Matthias Clasen <mclasen@redhat.com>
|
||||
*/
|
||||
|
||||
#ifndef __GTK_EVENT_CONTROLLER_MOTION_H__
|
||||
#define __GTK_EVENT_CONTROLLER_MOTION_H__
|
||||
|
||||
#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION)
|
||||
#error "Only <gtk/gtk.h> can be included directly."
|
||||
#endif
|
||||
|
||||
#include <gdk/gdk.h>
|
||||
#include <gtk/gtkeventcontroller.h>
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
#define GTK_TYPE_EVENT_CONTROLLER_MOTION (gtk_event_controller_motion_get_type ())
|
||||
#define GTK_EVENT_CONTROLLER_MOTION(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GTK_TYPE_EVENT_CONTROLLER_MOTION, GtkEventControllerMotion))
|
||||
#define GTK_EVENT_CONTROLLER_MOTION_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), GTK_TYPE_EVENT_CONTROLLER_MOTION, GtkEventControllerMotionClass))
|
||||
#define GTK_IS_EVENT_CONTROLLER_MOTION(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GTK_TYPE_EVENT_CONTROLLER_MOTION))
|
||||
#define GTK_IS_EVENT_CONTROLLER_MOTION_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), GTK_TYPE_EVENT_CONTROLLER_MOTION))
|
||||
#define GTK_EVENT_CONTROLLER_MOTION_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GTK_TYPE_EVENT_CONTROLLER_MOTION, GtkEventControllerMotionClass))
|
||||
|
||||
typedef struct _GtkEventControllerMotion GtkEventControllerMotion;
|
||||
typedef struct _GtkEventControllerMotionClass GtkEventControllerMotionClass;
|
||||
|
||||
GDK_AVAILABLE_IN_3_24
|
||||
GType gtk_event_controller_motion_get_type (void) G_GNUC_CONST;
|
||||
|
||||
GDK_AVAILABLE_IN_3_24
|
||||
GtkEventController *gtk_event_controller_motion_new (GtkWidget *widget);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __GTK_EVENT_CONTROLLER_MOTION_H__ */
|
||||
@@ -0,0 +1,517 @@
|
||||
/* GTK - The GIMP Toolkit
|
||||
* Copyright (C) 2017, Red Hat, Inc.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* Author(s): Carlos Garnacho <carlosg@gnome.org>
|
||||
*/
|
||||
|
||||
/**
|
||||
* SECTION:gtkeventcontrollerscroll
|
||||
* @Short_description: Event controller for scroll events
|
||||
* @Title: GtkEventControllerScroll
|
||||
* @See_also: #GtkEventController
|
||||
*
|
||||
* #GtkEventControllerScroll is an event controller meant to handle
|
||||
* scroll events from mice and touchpads. It is capable of handling
|
||||
* both discrete and continuous scroll events, abstracting them both
|
||||
* on the #GtkEventControllerScroll::scroll signal (deltas in the
|
||||
* discrete case are multiples of 1).
|
||||
*
|
||||
* In the case of continuous scroll events, #GtkEventControllerScroll
|
||||
* encloses all #GtkEventControllerScroll::scroll events between two
|
||||
* #GtkEventControllerScroll::scroll-begin and #GtkEventControllerScroll::scroll-end
|
||||
* signals.
|
||||
*
|
||||
* The behavior of the event controller can be modified by the
|
||||
* flags given at creation time, or modified at a later point through
|
||||
* gtk_event_controller_scroll_set_flags() (e.g. because the scrolling
|
||||
* conditions of the widget changed).
|
||||
*
|
||||
* The controller can be set up to emit motion for either/both vertical
|
||||
* and horizontal scroll events through #GTK_EVENT_CONTROLLER_SCROLL_VERTICAL,
|
||||
* #GTK_EVENT_CONTROLLER_SCROLL_HORIZONTAL and #GTK_EVENT_CONTROLLER_SCROLL_BOTH.
|
||||
* If any axis is disabled, the respective #GtkEventControllerScroll::scroll
|
||||
* delta will be 0. Vertical scroll events will be translated to horizontal
|
||||
* motion for the devices incapable of horizontal scrolling.
|
||||
*
|
||||
* The event controller can also be forced to emit discrete events on all devices
|
||||
* through #GTK_EVENT_CONTROLLER_SCROLL_DISCRETE. This can be used to implement
|
||||
* discrete actions triggered through scroll events (e.g. switching across
|
||||
* combobox options).
|
||||
*
|
||||
* The #GTK_EVENT_CONTROLLER_SCROLL_KINETIC flag toggles the emission of the
|
||||
* #GtkEventControllerScroll::decelerate signal, emitted at the end of scrolling
|
||||
* with two X/Y velocity arguments that are consistent with the motion that
|
||||
* was received.
|
||||
*
|
||||
* This object was added in 3.24.
|
||||
**/
|
||||
#include "config.h"
|
||||
|
||||
#include "math.h"
|
||||
|
||||
#include "gtkintl.h"
|
||||
#include "gtkwidget.h"
|
||||
#include "gtkeventcontrollerprivate.h"
|
||||
#include "gtkeventcontrollerscroll.h"
|
||||
#include "gtktypebuiltins.h"
|
||||
#include "gtkmarshalers.h"
|
||||
#include "gtkprivate.h"
|
||||
|
||||
#define SCROLL_CAPTURE_THRESHOLD_MS 150
|
||||
|
||||
typedef struct
|
||||
{
|
||||
gdouble dx;
|
||||
gdouble dy;
|
||||
guint32 evtime;
|
||||
} ScrollHistoryElem;
|
||||
|
||||
struct _GtkEventControllerScroll
|
||||
{
|
||||
GtkEventController parent_instance;
|
||||
GtkEventControllerScrollFlags flags;
|
||||
GArray *scroll_history;
|
||||
|
||||
/* For discrete event coalescing */
|
||||
gdouble cur_dx;
|
||||
gdouble cur_dy;
|
||||
|
||||
guint active : 1;
|
||||
};
|
||||
|
||||
struct _GtkEventControllerScrollClass
|
||||
{
|
||||
GtkEventControllerClass parent_class;
|
||||
};
|
||||
|
||||
enum {
|
||||
SCROLL_BEGIN,
|
||||
SCROLL,
|
||||
SCROLL_END,
|
||||
DECELERATE,
|
||||
N_SIGNALS
|
||||
};
|
||||
|
||||
enum {
|
||||
PROP_0,
|
||||
PROP_FLAGS,
|
||||
N_PROPS
|
||||
};
|
||||
|
||||
static GParamSpec *pspecs[N_PROPS] = { NULL };
|
||||
static guint signals[N_SIGNALS] = { 0 };
|
||||
|
||||
G_DEFINE_TYPE (GtkEventControllerScroll, gtk_event_controller_scroll,
|
||||
GTK_TYPE_EVENT_CONTROLLER)
|
||||
|
||||
static void
|
||||
scroll_history_push (GtkEventControllerScroll *scroll,
|
||||
gdouble delta_x,
|
||||
gdouble delta_y,
|
||||
guint32 evtime)
|
||||
{
|
||||
ScrollHistoryElem new_item;
|
||||
guint i;
|
||||
|
||||
for (i = 0; i < scroll->scroll_history->len; i++)
|
||||
{
|
||||
ScrollHistoryElem *elem;
|
||||
|
||||
elem = &g_array_index (scroll->scroll_history, ScrollHistoryElem, i);
|
||||
|
||||
if (elem->evtime >= evtime - SCROLL_CAPTURE_THRESHOLD_MS)
|
||||
break;
|
||||
}
|
||||
|
||||
if (i > 0)
|
||||
g_array_remove_range (scroll->scroll_history, 0, i);
|
||||
|
||||
new_item.dx = delta_x;
|
||||
new_item.dy = delta_y;
|
||||
new_item.evtime = evtime;
|
||||
g_array_append_val (scroll->scroll_history, new_item);
|
||||
}
|
||||
|
||||
static void
|
||||
scroll_history_reset (GtkEventControllerScroll *scroll)
|
||||
{
|
||||
if (scroll->scroll_history->len == 0)
|
||||
return;
|
||||
|
||||
g_array_remove_range (scroll->scroll_history, 0,
|
||||
scroll->scroll_history->len);
|
||||
}
|
||||
|
||||
static void
|
||||
scroll_history_finish (GtkEventControllerScroll *scroll,
|
||||
gdouble *velocity_x,
|
||||
gdouble *velocity_y)
|
||||
{
|
||||
gdouble accum_dx = 0, accum_dy = 0;
|
||||
guint32 first = 0, last = 0;
|
||||
guint i;
|
||||
|
||||
*velocity_x = 0;
|
||||
*velocity_y = 0;
|
||||
|
||||
if (scroll->scroll_history->len == 0)
|
||||
return;
|
||||
|
||||
for (i = 0; i < scroll->scroll_history->len; i++)
|
||||
{
|
||||
ScrollHistoryElem *elem;
|
||||
|
||||
elem = &g_array_index (scroll->scroll_history, ScrollHistoryElem, i);
|
||||
accum_dx += elem->dx;
|
||||
accum_dy += elem->dy;
|
||||
last = elem->evtime;
|
||||
|
||||
if (i == 0)
|
||||
first = elem->evtime;
|
||||
}
|
||||
|
||||
if (last != first)
|
||||
{
|
||||
*velocity_x = (accum_dx * 1000) / (last - first);
|
||||
*velocity_y = (accum_dy * 1000) / (last - first);
|
||||
}
|
||||
|
||||
scroll_history_reset (scroll);
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_event_controller_scroll_finalize (GObject *object)
|
||||
{
|
||||
GtkEventControllerScroll *scroll = GTK_EVENT_CONTROLLER_SCROLL (object);
|
||||
|
||||
g_array_unref (scroll->scroll_history);
|
||||
|
||||
G_OBJECT_CLASS (gtk_event_controller_scroll_parent_class)->finalize (object);
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_event_controller_scroll_set_property (GObject *object,
|
||||
guint prop_id,
|
||||
const GValue *value,
|
||||
GParamSpec *pspec)
|
||||
{
|
||||
GtkEventControllerScroll *scroll = GTK_EVENT_CONTROLLER_SCROLL (object);
|
||||
|
||||
switch (prop_id)
|
||||
{
|
||||
case PROP_FLAGS:
|
||||
gtk_event_controller_scroll_set_flags (scroll, g_value_get_flags (value));
|
||||
break;
|
||||
default:
|
||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_event_controller_scroll_get_property (GObject *object,
|
||||
guint prop_id,
|
||||
GValue *value,
|
||||
GParamSpec *pspec)
|
||||
{
|
||||
GtkEventControllerScroll *scroll = GTK_EVENT_CONTROLLER_SCROLL (object);
|
||||
|
||||
switch (prop_id)
|
||||
{
|
||||
case PROP_FLAGS:
|
||||
g_value_set_flags (value, scroll->flags);
|
||||
break;
|
||||
default:
|
||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
static gboolean
|
||||
gtk_event_controller_scroll_handle_event (GtkEventController *controller,
|
||||
const GdkEvent *event)
|
||||
{
|
||||
GtkEventControllerScroll *scroll = GTK_EVENT_CONTROLLER_SCROLL (controller);
|
||||
GdkScrollDirection direction = GDK_SCROLL_SMOOTH;
|
||||
gdouble dx = 0, dy = 0;
|
||||
|
||||
if (gdk_event_get_event_type (event) != GDK_SCROLL)
|
||||
return FALSE;
|
||||
if ((scroll->flags & (GTK_EVENT_CONTROLLER_SCROLL_VERTICAL |
|
||||
GTK_EVENT_CONTROLLER_SCROLL_HORIZONTAL)) == 0)
|
||||
return FALSE;
|
||||
|
||||
/* FIXME: Handle device changes */
|
||||
|
||||
if (gdk_event_get_scroll_deltas (event, &dx, &dy))
|
||||
{
|
||||
GdkDevice *device = gdk_event_get_source_device (event);
|
||||
GdkInputSource input_source = gdk_device_get_source (device);
|
||||
|
||||
if (!scroll->active &&
|
||||
(input_source == GDK_SOURCE_TRACKPOINT ||
|
||||
input_source == GDK_SOURCE_TOUCHPAD))
|
||||
{
|
||||
g_signal_emit (controller, signals[SCROLL_BEGIN], 0);
|
||||
scroll_history_reset (scroll);
|
||||
scroll->active = TRUE;
|
||||
}
|
||||
|
||||
if ((scroll->flags & GTK_EVENT_CONTROLLER_SCROLL_VERTICAL) == 0)
|
||||
dy = 0;
|
||||
if ((scroll->flags & GTK_EVENT_CONTROLLER_SCROLL_HORIZONTAL) == 0)
|
||||
dx = 0;
|
||||
|
||||
if (scroll->flags & GTK_EVENT_CONTROLLER_SCROLL_DISCRETE)
|
||||
{
|
||||
gint steps;
|
||||
|
||||
scroll->cur_dx += dx;
|
||||
scroll->cur_dy += dy;
|
||||
dx = dy = 0;
|
||||
|
||||
if (ABS (scroll->cur_dx) >= 1)
|
||||
{
|
||||
steps = trunc (scroll->cur_dx);
|
||||
scroll->cur_dx -= steps;
|
||||
dx = steps;
|
||||
}
|
||||
|
||||
if (ABS (scroll->cur_dy) >= 1)
|
||||
{
|
||||
steps = trunc (scroll->cur_dy);
|
||||
scroll->cur_dy -= steps;
|
||||
dy = steps;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (gdk_event_get_scroll_direction (event, &direction))
|
||||
{
|
||||
switch (direction)
|
||||
{
|
||||
case GDK_SCROLL_UP:
|
||||
dy -= 1;
|
||||
break;
|
||||
case GDK_SCROLL_DOWN:
|
||||
dy += 1;
|
||||
break;
|
||||
case GDK_SCROLL_LEFT:
|
||||
dx -= 1;
|
||||
break;
|
||||
case GDK_SCROLL_RIGHT:
|
||||
dx += 1;
|
||||
break;
|
||||
default:
|
||||
g_assert_not_reached ();
|
||||
break;
|
||||
}
|
||||
|
||||
if ((scroll->flags & GTK_EVENT_CONTROLLER_SCROLL_VERTICAL) == 0)
|
||||
dy = 0;
|
||||
if ((scroll->flags & GTK_EVENT_CONTROLLER_SCROLL_HORIZONTAL) == 0)
|
||||
dx = 0;
|
||||
}
|
||||
|
||||
if (dx != 0 || dy != 0)
|
||||
{
|
||||
g_signal_emit (controller, signals[SCROLL], 0, dx, dy);
|
||||
|
||||
if (scroll->flags & GTK_EVENT_CONTROLLER_SCROLL_KINETIC)
|
||||
scroll_history_push (scroll, dx, dy, gdk_event_get_time (event));
|
||||
}
|
||||
|
||||
if (scroll->active && gdk_event_is_scroll_stop_event (event))
|
||||
{
|
||||
g_signal_emit (controller, signals[SCROLL_END], 0);
|
||||
scroll->active = FALSE;
|
||||
|
||||
if (scroll->flags & GTK_EVENT_CONTROLLER_SCROLL_KINETIC)
|
||||
{
|
||||
gdouble vel_x, vel_y;
|
||||
|
||||
scroll_history_finish (scroll, &vel_x, &vel_y);
|
||||
g_signal_emit (controller, signals[DECELERATE], 0, vel_x, vel_y);
|
||||
}
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_event_controller_scroll_class_init (GtkEventControllerScrollClass *klass)
|
||||
{
|
||||
GtkEventControllerClass *controller_class = GTK_EVENT_CONTROLLER_CLASS (klass);
|
||||
GObjectClass *object_class = G_OBJECT_CLASS (klass);
|
||||
|
||||
object_class->finalize = gtk_event_controller_scroll_finalize;
|
||||
object_class->set_property = gtk_event_controller_scroll_set_property;
|
||||
object_class->get_property = gtk_event_controller_scroll_get_property;
|
||||
|
||||
controller_class->handle_event = gtk_event_controller_scroll_handle_event;
|
||||
|
||||
/**
|
||||
* GtkEventControllerScroll:flags:
|
||||
*
|
||||
* The flags affecting event controller behavior
|
||||
*
|
||||
* Since: 3.24
|
||||
**/
|
||||
pspecs[PROP_FLAGS] =
|
||||
g_param_spec_flags ("flags",
|
||||
P_("Flags"),
|
||||
P_("Flags"),
|
||||
GTK_TYPE_EVENT_CONTROLLER_SCROLL_FLAGS,
|
||||
GTK_EVENT_CONTROLLER_SCROLL_NONE,
|
||||
GTK_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY);
|
||||
|
||||
/**
|
||||
* GtkEventControllerScroll::scroll-begin:
|
||||
* @controller: The object that received the signal
|
||||
*
|
||||
* Signals that a new scrolling operation has begun. It will
|
||||
* only be emitted on devices capable of it.
|
||||
**/
|
||||
signals[SCROLL_BEGIN] =
|
||||
g_signal_new (I_("scroll-begin"),
|
||||
GTK_TYPE_EVENT_CONTROLLER_SCROLL,
|
||||
G_SIGNAL_RUN_FIRST,
|
||||
0, NULL, NULL,
|
||||
g_cclosure_marshal_VOID__VOID,
|
||||
G_TYPE_NONE, 0);
|
||||
/**
|
||||
* GtkEventControllerScroll::scroll:
|
||||
* @controller: The object that received the signal
|
||||
* @dx: X delta
|
||||
* @dy: Y delta
|
||||
*
|
||||
* Signals that the widget should scroll by the
|
||||
* amount specified by @dx and @dy.
|
||||
**/
|
||||
signals[SCROLL] =
|
||||
g_signal_new (I_("scroll"),
|
||||
GTK_TYPE_EVENT_CONTROLLER_SCROLL,
|
||||
G_SIGNAL_RUN_FIRST,
|
||||
0, NULL, NULL,
|
||||
_gtk_marshal_VOID__DOUBLE_DOUBLE,
|
||||
G_TYPE_NONE, 2, G_TYPE_DOUBLE, G_TYPE_DOUBLE);
|
||||
/**
|
||||
* GtkEventControllerScroll::scroll-end:
|
||||
* @controller: The object that received the signal
|
||||
*
|
||||
* Signals that a new scrolling operation has finished. It will
|
||||
* only be emitted on devices capable of it.
|
||||
**/
|
||||
signals[SCROLL_END] =
|
||||
g_signal_new (I_("scroll-end"),
|
||||
GTK_TYPE_EVENT_CONTROLLER_SCROLL,
|
||||
G_SIGNAL_RUN_FIRST,
|
||||
0, NULL, NULL,
|
||||
g_cclosure_marshal_VOID__VOID,
|
||||
G_TYPE_NONE, 0);
|
||||
|
||||
/**
|
||||
* GtkEventControllerScroll::decelerate:
|
||||
* @controller: The object that received the signal
|
||||
* @vel_x: X velocity
|
||||
* @vel_y: Y velocity
|
||||
*
|
||||
* Emitted after scroll is finished if the #GTK_EVENT_CONTROLLER_SCROLL_KINETIC
|
||||
* flag is set. @vel_x and @vel_y express the initial velocity that was
|
||||
* imprinted by the scroll events. @vel_x and @vel_y are expressed in
|
||||
* pixels/ms.
|
||||
**/
|
||||
signals[DECELERATE] =
|
||||
g_signal_new (I_("decelerate"),
|
||||
GTK_TYPE_EVENT_CONTROLLER_SCROLL,
|
||||
G_SIGNAL_RUN_FIRST,
|
||||
0, NULL, NULL,
|
||||
_gtk_marshal_VOID__DOUBLE_DOUBLE,
|
||||
G_TYPE_NONE, 2, G_TYPE_DOUBLE, G_TYPE_DOUBLE);
|
||||
|
||||
g_object_class_install_properties (object_class, N_PROPS, pspecs);
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_event_controller_scroll_init (GtkEventControllerScroll *scroll)
|
||||
{
|
||||
scroll->scroll_history = g_array_new (FALSE, FALSE,
|
||||
sizeof (ScrollHistoryElem));
|
||||
}
|
||||
|
||||
/**
|
||||
* gtk_event_controller_scroll_new:
|
||||
* @widget: a #GtkWidget
|
||||
* @flags: behavior flags
|
||||
*
|
||||
* Creates a new event controller that will handle scroll events
|
||||
* for the given @widget.
|
||||
*
|
||||
* Returns: a new #GtkEventControllerScroll
|
||||
*
|
||||
* Since: 3.24
|
||||
**/
|
||||
GtkEventController *
|
||||
gtk_event_controller_scroll_new (GtkWidget *widget,
|
||||
GtkEventControllerScrollFlags flags)
|
||||
{
|
||||
g_return_val_if_fail (GTK_IS_WIDGET (widget), NULL);
|
||||
|
||||
return g_object_new (GTK_TYPE_EVENT_CONTROLLER_SCROLL,
|
||||
"widget", widget,
|
||||
"flags", flags,
|
||||
NULL);
|
||||
}
|
||||
|
||||
/**
|
||||
* gtk_event_controller_scroll_set_flags:
|
||||
* @scroll: a #GtkEventControllerScroll
|
||||
* @flags: behavior flags
|
||||
*
|
||||
* Sets the flags conditioning scroll controller behavior.
|
||||
*
|
||||
* Since: 3.24
|
||||
**/
|
||||
void
|
||||
gtk_event_controller_scroll_set_flags (GtkEventControllerScroll *scroll,
|
||||
GtkEventControllerScrollFlags flags)
|
||||
{
|
||||
g_return_if_fail (GTK_IS_EVENT_CONTROLLER_SCROLL (scroll));
|
||||
|
||||
if (scroll->flags == flags)
|
||||
return;
|
||||
|
||||
scroll->flags = flags;
|
||||
g_object_notify_by_pspec (G_OBJECT (scroll), pspecs[PROP_FLAGS]);
|
||||
}
|
||||
|
||||
/**
|
||||
* gtk_event_controller_scroll_get_flags:
|
||||
* @scroll: a #GtkEventControllerScroll
|
||||
*
|
||||
* Gets the flags conditioning the scroll controller behavior.
|
||||
*
|
||||
* Returns: the controller flags.
|
||||
*
|
||||
* Since: 3.24
|
||||
**/
|
||||
GtkEventControllerScrollFlags
|
||||
gtk_event_controller_scroll_get_flags (GtkEventControllerScroll *scroll)
|
||||
{
|
||||
g_return_val_if_fail (GTK_IS_EVENT_CONTROLLER_SCROLL (scroll),
|
||||
GTK_EVENT_CONTROLLER_SCROLL_NONE);
|
||||
|
||||
return scroll->flags;
|
||||
}
|
||||
@@ -0,0 +1,80 @@
|
||||
/* GTK - The GIMP Toolkit
|
||||
* Copyright (C) 2017, Red Hat, Inc.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* Author(s): Carlos Garnacho <carlosg@gnome.org>
|
||||
*/
|
||||
|
||||
#ifndef __GTK_EVENT_CONTROLLER_SCROLL_H__
|
||||
#define __GTK_EVENT_CONTROLLER_SCROLL_H__
|
||||
|
||||
#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION)
|
||||
#error "Only <gtk/gtk.h> can be included directly."
|
||||
#endif
|
||||
|
||||
#include <gdk/gdk.h>
|
||||
#include <gtk/gtkeventcontroller.h>
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
#define GTK_TYPE_EVENT_CONTROLLER_SCROLL (gtk_event_controller_scroll_get_type ())
|
||||
#define GTK_EVENT_CONTROLLER_SCROLL(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GTK_TYPE_EVENT_CONTROLLER_SCROLL, GtkEventControllerScroll))
|
||||
#define GTK_EVENT_CONTROLLER_SCROLL_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), GTK_TYPE_EVENT_CONTROLLER_SCROLL, GtkEventControllerScrollClass))
|
||||
#define GTK_IS_EVENT_CONTROLLER_SCROLL(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GTK_TYPE_EVENT_CONTROLLER_SCROLL))
|
||||
#define GTK_IS_EVENT_CONTROLLER_SCROLL_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), GTK_TYPE_EVENT_CONTROLLER_SCROLL))
|
||||
#define GTK_EVENT_CONTROLLER_SCROLL_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GTK_TYPE_EVENT_CONTROLLER_SCROLL, GtkEventControllerScrollClass))
|
||||
|
||||
typedef struct _GtkEventControllerScroll GtkEventControllerScroll;
|
||||
typedef struct _GtkEventControllerScrollClass GtkEventControllerScrollClass;
|
||||
|
||||
/**
|
||||
* GtkEventControllerScrollFlags:
|
||||
* @GTK_EVENT_CONTROLLER_SCROLL_NONE: Don't emit scroll.
|
||||
* @GTK_EVENT_CONTROLLER_SCROLL_VERTICAL: Emit scroll with vertical deltas.
|
||||
* @GTK_EVENT_CONTROLLER_SCROLL_HORIZONTAL: Emit scroll with horizontal deltas.
|
||||
* @GTK_EVENT_CONTROLLER_SCROLL_DISCRETE: Only emit deltas that are multiples of 1.
|
||||
* @GTK_EVENT_CONTROLLER_SCROLL_KINETIC: Emit #GtkEventControllerScroll::decelerate
|
||||
* after continuous scroll finishes.
|
||||
* @GTK_EVENT_CONTROLLER_SCROLL_BOTH_AXES: Emit scroll on both axes.
|
||||
*
|
||||
* Describes the behavior of a #GtkEventControllerScroll.
|
||||
*
|
||||
* Since: 3.24
|
||||
**/
|
||||
typedef enum {
|
||||
GTK_EVENT_CONTROLLER_SCROLL_NONE = 0,
|
||||
GTK_EVENT_CONTROLLER_SCROLL_VERTICAL = 1 << 0,
|
||||
GTK_EVENT_CONTROLLER_SCROLL_HORIZONTAL = 1 << 1,
|
||||
GTK_EVENT_CONTROLLER_SCROLL_DISCRETE = 1 << 2,
|
||||
GTK_EVENT_CONTROLLER_SCROLL_KINETIC = 1 << 3,
|
||||
GTK_EVENT_CONTROLLER_SCROLL_BOTH_AXES = (GTK_EVENT_CONTROLLER_SCROLL_VERTICAL | GTK_EVENT_CONTROLLER_SCROLL_HORIZONTAL),
|
||||
} GtkEventControllerScrollFlags;
|
||||
|
||||
GDK_AVAILABLE_IN_3_24
|
||||
GType gtk_event_controller_scroll_get_type (void) G_GNUC_CONST;
|
||||
|
||||
GDK_AVAILABLE_IN_3_24
|
||||
GtkEventController *gtk_event_controller_scroll_new (GtkWidget *widget,
|
||||
GtkEventControllerScrollFlags flags);
|
||||
GDK_AVAILABLE_IN_3_24
|
||||
void gtk_event_controller_scroll_set_flags (GtkEventControllerScroll *controller,
|
||||
GtkEventControllerScrollFlags flags);
|
||||
GDK_AVAILABLE_IN_3_24
|
||||
GtkEventControllerScrollFlags
|
||||
gtk_event_controller_scroll_get_flags (GtkEventControllerScroll *controller);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __GTK_EVENT_CONTROLLER_SCROLL_H__ */
|
||||
@@ -862,7 +862,9 @@ gtk_font_chooser_widget_init (GtkFontChooserWidget *fontchooser)
|
||||
|
||||
/* Load data and set initial style-dependent parameters */
|
||||
gtk_font_chooser_widget_load_fonts (fontchooser, TRUE);
|
||||
#if defined(HAVE_HARFBUZZ) && defined(HAVE_PANGOFT)
|
||||
gtk_font_chooser_widget_populate_features (fontchooser);
|
||||
#endif
|
||||
gtk_font_chooser_widget_set_cell_size (fontchooser);
|
||||
gtk_font_chooser_widget_take_font_desc (fontchooser, NULL);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,273 @@
|
||||
/* GTK - The GIMP Toolkit
|
||||
* Copyright (C) 2017-2018, Red Hat, Inc.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* Author(s): Carlos Garnacho <carlosg@gnome.org>
|
||||
*/
|
||||
|
||||
/**
|
||||
* SECTION:gtkgesturestylus
|
||||
* @Short_description: Gesture for stylus input
|
||||
* @Title: GtkGestureStylus
|
||||
* @See_also: #GtkGesture, #GtkGestureSingle
|
||||
*
|
||||
* #GtkGestureStylus is a #GtkGesture implementation specific to stylus
|
||||
* input. The provided signals just provide the basic information
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
#include "gtkgesturestylus.h"
|
||||
#include "gtkgesturestylusprivate.h"
|
||||
#include "gtkprivate.h"
|
||||
#include "gtkintl.h"
|
||||
#include "gtkmain.h"
|
||||
|
||||
G_DEFINE_TYPE (GtkGestureStylus, gtk_gesture_stylus, GTK_TYPE_GESTURE_SINGLE)
|
||||
|
||||
enum {
|
||||
PROXIMITY,
|
||||
DOWN,
|
||||
MOTION,
|
||||
UP,
|
||||
N_SIGNALS
|
||||
};
|
||||
|
||||
static guint signals[N_SIGNALS] = { 0, };
|
||||
|
||||
static gboolean
|
||||
gtk_gesture_stylus_handle_event (GtkEventController *controller,
|
||||
const GdkEvent *event)
|
||||
{
|
||||
GdkModifierType modifiers;
|
||||
guint n_signal;
|
||||
gdouble x, y;
|
||||
|
||||
GTK_EVENT_CONTROLLER_CLASS (gtk_gesture_stylus_parent_class)->handle_event (controller, event);
|
||||
|
||||
if (!gdk_event_get_device_tool (event))
|
||||
return FALSE;
|
||||
if (!gdk_event_get_coords (event, &x, &y))
|
||||
return FALSE;
|
||||
|
||||
switch ((guint) gdk_event_get_event_type (event))
|
||||
{
|
||||
case GDK_BUTTON_PRESS:
|
||||
n_signal = DOWN;
|
||||
break;
|
||||
case GDK_BUTTON_RELEASE:
|
||||
n_signal = UP;
|
||||
break;
|
||||
case GDK_MOTION_NOTIFY:
|
||||
gdk_event_get_state (event, &modifiers);
|
||||
|
||||
if (modifiers & GDK_BUTTON1_MASK)
|
||||
n_signal = MOTION;
|
||||
else
|
||||
n_signal = PROXIMITY;
|
||||
break;
|
||||
default:
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
g_signal_emit (controller, signals[n_signal], 0, x, y);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_gesture_stylus_class_init (GtkGestureStylusClass *klass)
|
||||
{
|
||||
GtkEventControllerClass *event_controller_class;
|
||||
|
||||
event_controller_class = GTK_EVENT_CONTROLLER_CLASS (klass);
|
||||
event_controller_class->handle_event = gtk_gesture_stylus_handle_event;
|
||||
|
||||
signals[PROXIMITY] =
|
||||
g_signal_new (I_("proximity"),
|
||||
G_TYPE_FROM_CLASS (klass),
|
||||
G_SIGNAL_RUN_LAST,
|
||||
G_STRUCT_OFFSET (GtkGestureStylusClass, proximity),
|
||||
NULL, NULL, NULL,
|
||||
G_TYPE_NONE, 2, G_TYPE_DOUBLE, G_TYPE_DOUBLE);
|
||||
signals[DOWN] =
|
||||
g_signal_new (I_("down"),
|
||||
G_TYPE_FROM_CLASS (klass),
|
||||
G_SIGNAL_RUN_LAST,
|
||||
G_STRUCT_OFFSET (GtkGestureStylusClass, down),
|
||||
NULL, NULL, NULL,
|
||||
G_TYPE_NONE, 2, G_TYPE_DOUBLE, G_TYPE_DOUBLE);
|
||||
signals[MOTION] =
|
||||
g_signal_new (I_("motion"),
|
||||
G_TYPE_FROM_CLASS (klass),
|
||||
G_SIGNAL_RUN_LAST,
|
||||
G_STRUCT_OFFSET (GtkGestureStylusClass, motion),
|
||||
NULL, NULL, NULL,
|
||||
G_TYPE_NONE, 2, G_TYPE_DOUBLE, G_TYPE_DOUBLE);
|
||||
signals[UP] =
|
||||
g_signal_new (I_("up"),
|
||||
G_TYPE_FROM_CLASS (klass),
|
||||
G_SIGNAL_RUN_LAST,
|
||||
G_STRUCT_OFFSET (GtkGestureStylusClass, up),
|
||||
NULL, NULL, NULL,
|
||||
G_TYPE_NONE, 2, G_TYPE_DOUBLE, G_TYPE_DOUBLE);
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_gesture_stylus_init (GtkGestureStylus *gesture)
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* gtk_gesture_stylus_new:
|
||||
* @widget: a #GtkWidget
|
||||
*
|
||||
* Creates a new #GtkGestureStylus.
|
||||
*
|
||||
* Returns: a newly created stylus gesture
|
||||
*
|
||||
* Since: 3.24
|
||||
**/
|
||||
GtkGesture *
|
||||
gtk_gesture_stylus_new (GtkWidget *widget)
|
||||
{
|
||||
return g_object_new (GTK_TYPE_GESTURE_STYLUS,
|
||||
"widget", widget,
|
||||
NULL);
|
||||
}
|
||||
|
||||
static const GdkEvent *
|
||||
gesture_get_current_event (GtkGestureStylus *gesture)
|
||||
{
|
||||
GdkEventSequence *sequence;
|
||||
|
||||
sequence = gtk_gesture_single_get_current_sequence (GTK_GESTURE_SINGLE (gesture));
|
||||
|
||||
return gtk_gesture_get_last_event (GTK_GESTURE (gesture), sequence);
|
||||
}
|
||||
|
||||
/**
|
||||
* gtk_gesture_stylus_get_axis:
|
||||
* @gesture: a #GtkGestureStylus
|
||||
* @axis: requested device axis
|
||||
* @value: (out): return location for the axis value
|
||||
*
|
||||
* Returns the current value for the requested @axis. This function
|
||||
* must be called from either the #GtkGestureStylus:down,
|
||||
* #GtkGestureStylus:motion, #GtkGestureStylus:up or #GtkGestureStylus:proximity
|
||||
* signals.
|
||||
*
|
||||
* Returns: #TRUE if there is a current value for the axis
|
||||
*
|
||||
* Since: 3.24
|
||||
**/
|
||||
gboolean
|
||||
gtk_gesture_stylus_get_axis (GtkGestureStylus *gesture,
|
||||
GdkAxisUse axis,
|
||||
gdouble *value)
|
||||
{
|
||||
const GdkEvent *event;
|
||||
|
||||
g_return_val_if_fail (GTK_IS_GESTURE_STYLUS (gesture), FALSE);
|
||||
g_return_val_if_fail (axis < GDK_AXIS_LAST, FALSE);
|
||||
g_return_val_if_fail (value != NULL, FALSE);
|
||||
|
||||
event = gesture_get_current_event (gesture);
|
||||
if (!event)
|
||||
return FALSE;
|
||||
|
||||
return gdk_event_get_axis (event, axis, value);
|
||||
}
|
||||
|
||||
/**
|
||||
* gtk_gesture_stylus_get_axes:
|
||||
* @gesture: a GtkGestureStylus
|
||||
* @axes: array of requested axes, terminated with #GDK_AXIS_IGNORE
|
||||
* @values: (out): return location for the axis values
|
||||
*
|
||||
* Returns the current values for the requested @axes. This function
|
||||
* must be called from either the #GtkGestureStylus:down,
|
||||
* #GtkGestureStylus:motion, #GtkGestureStylus:up or #GtkGestureStylus:proximity
|
||||
* signals.
|
||||
*
|
||||
* Returns: #TRUE if there is a current value for the axes
|
||||
*
|
||||
* Since: 3.24
|
||||
**/
|
||||
gboolean
|
||||
gtk_gesture_stylus_get_axes (GtkGestureStylus *gesture,
|
||||
GdkAxisUse axes[],
|
||||
gdouble **values)
|
||||
{
|
||||
const GdkEvent *event;
|
||||
GArray *array;
|
||||
gint i = 0;
|
||||
|
||||
g_return_val_if_fail (GTK_IS_GESTURE_STYLUS (gesture), FALSE);
|
||||
g_return_val_if_fail (values != NULL, FALSE);
|
||||
|
||||
event = gesture_get_current_event (gesture);
|
||||
if (!event)
|
||||
return FALSE;
|
||||
|
||||
array = g_array_new (TRUE, FALSE, sizeof (gdouble));
|
||||
|
||||
while (axes[i] != GDK_AXIS_IGNORE)
|
||||
{
|
||||
gdouble value;
|
||||
|
||||
if (axes[i] >= GDK_AXIS_LAST)
|
||||
{
|
||||
g_warning ("Requesting unknown axis %d, did you "
|
||||
"forget to add a last GDK_AXIS_IGNORE axis?",
|
||||
axes[i]);
|
||||
g_array_free (array, TRUE);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
gdk_event_get_axis (event, axes[i], &value);
|
||||
g_array_append_val (array, value);
|
||||
i++;
|
||||
}
|
||||
|
||||
*values = (gdouble *) g_array_free (array, FALSE);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/**
|
||||
* gtk_gesture_stylus_get_device_tool:
|
||||
* @gesture: a #GtkGestureStylus
|
||||
*
|
||||
* Returns the #GdkDeviceTool currently driving input through this gesture.
|
||||
* This function must be called from either the #GtkGestureStylus::down,
|
||||
* #GtkGestureStylus::motion, #GtkGestureStylus::up or #GtkGestureStylus::proximity
|
||||
* signal handlers.
|
||||
*
|
||||
* Returns: (nullable) (transfer none): The current stylus tool
|
||||
*
|
||||
* Since: 3.24
|
||||
**/
|
||||
GdkDeviceTool *
|
||||
gtk_gesture_stylus_get_device_tool (GtkGestureStylus *gesture)
|
||||
{
|
||||
const GdkEvent *event;
|
||||
|
||||
g_return_val_if_fail (GTK_IS_GESTURE_STYLUS (gesture), FALSE);
|
||||
|
||||
event = gesture_get_current_event (gesture);
|
||||
if (!event)
|
||||
return NULL;
|
||||
|
||||
return gdk_event_get_device_tool (event);
|
||||
}
|
||||
@@ -0,0 +1,59 @@
|
||||
/* GTK - The GIMP Toolkit
|
||||
* Copyright (C) 2017-2018, Red Hat, Inc.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* Author(s): Carlos Garnacho <carlosg@gnome.org>
|
||||
*/
|
||||
#ifndef __GTK_GESTURE_STYLUS_H__
|
||||
#define __GTK_GESTURE_STYLUS_H__
|
||||
|
||||
#include <gtk/gtkgesture.h>
|
||||
|
||||
#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION)
|
||||
#error "Only <gtk/gtk.h> can be included directly."
|
||||
#endif
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
#define GTK_TYPE_GESTURE_STYLUS (gtk_gesture_stylus_get_type ())
|
||||
#define GTK_GESTURE_STYLUS(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GTK_TYPE_GESTURE_STYLUS, GtkGestureStylus))
|
||||
#define GTK_GESTURE_STYLUS_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), GTK_TYPE_GESTURE_STYLUS, GtkGestureStylusClass))
|
||||
#define GTK_IS_GESTURE_STYLUS(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GTK_TYPE_GESTURE_STYLUS))
|
||||
#define GTK_IS_GESTURE_STYLUS_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), GTK_TYPE_GESTURE_STYLUS))
|
||||
#define GTK_GESTURE_STYLUS_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GTK_TYPE_GESTURE_STYLUS, GtkGestureStylusClass))
|
||||
|
||||
typedef struct _GtkGestureStylus GtkGestureStylus;
|
||||
typedef struct _GtkGestureStylusClass GtkGestureStylusClass;
|
||||
|
||||
GDK_AVAILABLE_IN_3_24
|
||||
GType gtk_gesture_stylus_get_type (void) G_GNUC_CONST;
|
||||
|
||||
GDK_AVAILABLE_IN_3_24
|
||||
GtkGesture * gtk_gesture_stylus_new (GtkWidget *widget);
|
||||
|
||||
GDK_AVAILABLE_IN_3_24
|
||||
gboolean gtk_gesture_stylus_get_axis (GtkGestureStylus *gesture,
|
||||
GdkAxisUse axis,
|
||||
gdouble *value);
|
||||
GDK_AVAILABLE_IN_3_24
|
||||
gboolean gtk_gesture_stylus_get_axes (GtkGestureStylus *gesture,
|
||||
GdkAxisUse axes[],
|
||||
gdouble **values);
|
||||
GDK_AVAILABLE_IN_3_24
|
||||
GdkDeviceTool * gtk_gesture_stylus_get_device_tool (GtkGestureStylus *gesture);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __GTK_GESTURE_STYLUS_H__ */
|
||||
@@ -0,0 +1,51 @@
|
||||
/* GTK - The GIMP Toolkit
|
||||
* Copyright (C) 2017-2018, Red Hat, Inc.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* Author(s): Carlos Garnacho <carlosg@gnome.org>
|
||||
*/
|
||||
#ifndef __GTK_GESTURE_STYLUS_PRIVATE_H__
|
||||
#define __GTK_GESTURE_STYLUS_PRIVATE_H__
|
||||
|
||||
#include "gtkgesturesingleprivate.h"
|
||||
#include "gtkgesturestylus.h"
|
||||
|
||||
struct _GtkGestureStylus
|
||||
{
|
||||
GtkGestureSingle parent_instance;
|
||||
};
|
||||
|
||||
struct _GtkGestureStylusClass
|
||||
{
|
||||
GtkGestureSingleClass parent_class;
|
||||
|
||||
void (*proximity) (GtkGestureStylus *gesture,
|
||||
gdouble x,
|
||||
gdouble y);
|
||||
void (*down) (GtkGestureStylus *gesture,
|
||||
gdouble x,
|
||||
gdouble y);
|
||||
void (*motion) (GtkGestureStylus *gesture,
|
||||
gdouble x,
|
||||
gdouble y);
|
||||
void (*up) (GtkGestureStylus *gesture,
|
||||
gdouble x,
|
||||
gdouble y);
|
||||
|
||||
/*< private >*/
|
||||
gpointer padding[10];
|
||||
};
|
||||
|
||||
#endif /* __GTK_GESTURE_STYLUS_PRIVATE_H__ */
|
||||
+19
-1
@@ -4106,6 +4106,24 @@ gtk_icon_info_load_icon (GtkIconInfo *icon_info,
|
||||
return icon_info->proxy_pixbuf;
|
||||
}
|
||||
|
||||
GdkPixbuf *
|
||||
gtk_icon_info_load_icon_thread_safe (GtkIconInfo *icon_info,
|
||||
GError **error)
|
||||
{
|
||||
GtkIconInfo *dup;
|
||||
GdkPixbuf *pixbuf;
|
||||
|
||||
g_return_val_if_fail (icon_info != NULL, NULL);
|
||||
g_return_val_if_fail (error == NULL || *error == NULL, NULL);
|
||||
|
||||
dup = icon_info_dup (icon_info);
|
||||
pixbuf = gtk_icon_info_load_icon (dup, error);
|
||||
|
||||
g_object_unref (dup);
|
||||
|
||||
return pixbuf;
|
||||
}
|
||||
|
||||
/**
|
||||
* gtk_icon_info_load_surface:
|
||||
* @icon_info: a #GtkIconInfo from gtk_icon_theme_lookup_icon()
|
||||
@@ -4567,7 +4585,7 @@ gtk_icon_info_load_symbolic_svg (GtkIconInfo *icon_info,
|
||||
" width=\"", width, "\"\n"
|
||||
" height=\"", height, "\">\n"
|
||||
" <style type=\"text/css\">\n"
|
||||
" rect,path {\n"
|
||||
" rect,path,ellipse,circle {\n"
|
||||
" fill: ", css_fg," !important;\n"
|
||||
" }\n"
|
||||
" .warning {\n"
|
||||
|
||||
@@ -300,6 +300,9 @@ gboolean gtk_icon_info_is_symbolic (GtkIconInfo *icon_info
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GdkPixbuf * gtk_icon_info_load_icon (GtkIconInfo *icon_info,
|
||||
GError **error);
|
||||
GDK_AVAILABLE_IN_3_24
|
||||
GdkPixbuf * gtk_icon_info_load_icon_thread_safe (GtkIconInfo *icon_info,
|
||||
GError **error);
|
||||
GDK_AVAILABLE_IN_3_10
|
||||
cairo_surface_t * gtk_icon_info_load_surface (GtkIconInfo *icon_info,
|
||||
GdkWindow *for_window,
|
||||
|
||||
@@ -174,6 +174,7 @@ enum
|
||||
PROP_ROLE,
|
||||
PROP_ICON,
|
||||
PROP_TEXT,
|
||||
PROP_USE_MARKUP,
|
||||
PROP_ACTIVE,
|
||||
PROP_MENU_NAME,
|
||||
PROP_INVERTED,
|
||||
@@ -396,6 +397,19 @@ gtk_model_button_set_text (GtkModelButton *button,
|
||||
g_object_notify_by_pspec (G_OBJECT (button), properties[PROP_TEXT]);
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_model_button_set_use_markup (GtkModelButton *button,
|
||||
gboolean use_markup)
|
||||
{
|
||||
use_markup = !!use_markup;
|
||||
if (gtk_label_get_use_markup (GTK_LABEL (button->label)) == use_markup)
|
||||
return;
|
||||
|
||||
gtk_label_set_use_markup (GTK_LABEL (button->label), use_markup);
|
||||
update_visibility (button);
|
||||
g_object_notify_by_pspec (G_OBJECT (button), properties[PROP_USE_MARKUP]);
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_model_button_set_active (GtkModelButton *button,
|
||||
gboolean active)
|
||||
@@ -518,6 +532,10 @@ gtk_model_button_get_property (GObject *object,
|
||||
g_value_set_string (value, gtk_label_get_text (GTK_LABEL (button->label)));
|
||||
break;
|
||||
|
||||
case PROP_USE_MARKUP:
|
||||
g_value_set_boolean (value, gtk_label_get_use_markup (GTK_LABEL (button->label)));
|
||||
break;
|
||||
|
||||
case PROP_ACTIVE:
|
||||
g_value_set_boolean (value, button->active);
|
||||
break;
|
||||
@@ -566,6 +584,10 @@ gtk_model_button_set_property (GObject *object,
|
||||
gtk_model_button_set_text (button, g_value_get_string (value));
|
||||
break;
|
||||
|
||||
case PROP_USE_MARKUP:
|
||||
gtk_model_button_set_use_markup (button, g_value_get_boolean (value));
|
||||
break;
|
||||
|
||||
case PROP_ACTIVE:
|
||||
gtk_model_button_set_active (button, g_value_get_boolean (value));
|
||||
break;
|
||||
@@ -1138,6 +1160,22 @@ gtk_model_button_class_init (GtkModelButtonClass *class)
|
||||
"",
|
||||
G_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY | G_PARAM_STATIC_STRINGS);
|
||||
|
||||
/**
|
||||
* GtkModelButton:use-markup:
|
||||
*
|
||||
* If %TRUE, XML tags in the text of the button are interpreted as by
|
||||
* pango_parse_markup() to format the enclosed spans of text. If %FALSE, the
|
||||
* text will be displayed verbatim.
|
||||
*
|
||||
* Since: 3.24
|
||||
*/
|
||||
properties[PROP_USE_MARKUP] =
|
||||
g_param_spec_boolean ("use-markup",
|
||||
P_("Use markup"),
|
||||
P_("The text of the button includes XML markup. See pango_parse_markup()"),
|
||||
FALSE,
|
||||
G_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY | G_PARAM_STATIC_STRINGS);
|
||||
|
||||
/**
|
||||
* GtkModelButton:active:
|
||||
*
|
||||
|
||||
+30
-10
@@ -2398,7 +2398,8 @@ volume_mount_cb (GObject *source_object,
|
||||
GAsyncResult *result,
|
||||
gpointer user_data)
|
||||
{
|
||||
GtkPlacesSidebar *sidebar = GTK_PLACES_SIDEBAR (user_data);
|
||||
GtkSidebarRow *row = GTK_SIDEBAR_ROW (user_data);
|
||||
GtkPlacesSidebar *sidebar;
|
||||
GVolume *volume;
|
||||
GError *error;
|
||||
gchar *primary;
|
||||
@@ -2406,6 +2407,7 @@ volume_mount_cb (GObject *source_object,
|
||||
GMount *mount;
|
||||
|
||||
volume = G_VOLUME (source_object);
|
||||
g_object_get (row, "sidebar", &sidebar, NULL);
|
||||
|
||||
error = NULL;
|
||||
if (!g_volume_mount_finish (volume, result, &error))
|
||||
@@ -2423,6 +2425,7 @@ volume_mount_cb (GObject *source_object,
|
||||
}
|
||||
|
||||
sidebar->mounting = FALSE;
|
||||
gtk_sidebar_row_set_busy (row, FALSE);
|
||||
|
||||
mount = g_volume_get_mount (volume);
|
||||
if (mount != NULL)
|
||||
@@ -2436,32 +2439,42 @@ volume_mount_cb (GObject *source_object,
|
||||
g_object_unref (G_OBJECT (mount));
|
||||
}
|
||||
|
||||
g_object_unref (row);
|
||||
g_object_unref (sidebar);
|
||||
}
|
||||
|
||||
static void
|
||||
mount_volume (GtkPlacesSidebar *sidebar,
|
||||
GVolume *volume)
|
||||
mount_volume (GtkSidebarRow *row,
|
||||
GVolume *volume)
|
||||
{
|
||||
GtkPlacesSidebar *sidebar;
|
||||
GMountOperation *mount_op;
|
||||
|
||||
g_object_get (row, "sidebar", &sidebar, NULL);
|
||||
|
||||
mount_op = get_mount_operation (sidebar);
|
||||
g_mount_operation_set_password_save (mount_op, G_PASSWORD_SAVE_FOR_SESSION);
|
||||
|
||||
g_object_ref (row);
|
||||
g_object_ref (sidebar);
|
||||
g_volume_mount (volume, 0, mount_op, NULL, volume_mount_cb, sidebar);
|
||||
g_volume_mount (volume, 0, mount_op, NULL, volume_mount_cb, row);
|
||||
}
|
||||
|
||||
static void
|
||||
open_drive (GtkPlacesSidebar *sidebar,
|
||||
open_drive (GtkSidebarRow *row,
|
||||
GDrive *drive,
|
||||
GtkPlacesOpenFlags open_flags)
|
||||
{
|
||||
GtkPlacesSidebar *sidebar;
|
||||
|
||||
g_object_get (row, "sidebar", &sidebar, NULL);
|
||||
|
||||
if (drive != NULL &&
|
||||
(g_drive_can_start (drive) || g_drive_can_start_degraded (drive)))
|
||||
{
|
||||
GMountOperation *mount_op;
|
||||
|
||||
gtk_sidebar_row_set_busy (row, TRUE);
|
||||
mount_op = get_mount_operation (sidebar);
|
||||
g_drive_start (drive, G_DRIVE_START_NONE, mount_op, NULL, drive_start_from_bookmark_cb, NULL);
|
||||
g_object_unref (mount_op);
|
||||
@@ -2469,15 +2482,20 @@ open_drive (GtkPlacesSidebar *sidebar,
|
||||
}
|
||||
|
||||
static void
|
||||
open_volume (GtkPlacesSidebar *sidebar,
|
||||
open_volume (GtkSidebarRow *row,
|
||||
GVolume *volume,
|
||||
GtkPlacesOpenFlags open_flags)
|
||||
{
|
||||
GtkPlacesSidebar *sidebar;
|
||||
|
||||
g_object_get (row, "sidebar", &sidebar, NULL);
|
||||
|
||||
if (volume != NULL && !sidebar->mounting)
|
||||
{
|
||||
sidebar->mounting = TRUE;
|
||||
sidebar->go_to_after_mount_open_flags = open_flags;
|
||||
mount_volume (sidebar, volume);
|
||||
gtk_sidebar_row_set_busy (row, TRUE);
|
||||
mount_volume (row, volume);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2534,11 +2552,11 @@ open_row (GtkSidebarRow *row,
|
||||
}
|
||||
else if (volume != NULL)
|
||||
{
|
||||
open_volume (sidebar, volume, open_flags);
|
||||
open_volume (row, volume, open_flags);
|
||||
}
|
||||
else if (drive != NULL)
|
||||
{
|
||||
open_drive (sidebar, drive, open_flags);
|
||||
open_drive (row, drive, open_flags);
|
||||
}
|
||||
|
||||
g_object_unref (sidebar);
|
||||
@@ -2875,7 +2893,7 @@ mount_shortcut_cb (GSimpleAction *action,
|
||||
NULL);
|
||||
|
||||
if (volume != NULL)
|
||||
mount_volume (sidebar, volume);
|
||||
mount_volume (sidebar->context_row, volume);
|
||||
|
||||
g_object_unref (volume);
|
||||
}
|
||||
@@ -4743,6 +4761,8 @@ gtk_places_sidebar_class_init (GtkPlacesSidebarClass *class)
|
||||
/**
|
||||
* GtkPlacesSidebar::show-starred-location:
|
||||
* @sidebar: the object which received the signal.
|
||||
* @open_flags: a single value from #GtkPlacesOpenFlags specifying how the
|
||||
* starred file should be opened.
|
||||
*
|
||||
* The places sidebar emits this signal when it needs the calling
|
||||
* application to present a way to show the starred files. In GNOME,
|
||||
|
||||
@@ -1226,7 +1226,10 @@ tick_cb (GtkWidget *widget,
|
||||
priv->last_iteration = iteration;
|
||||
|
||||
if (current_iterations > 3 * pulse_iterations)
|
||||
return G_SOURCE_CONTINUE;
|
||||
{
|
||||
priv->pulse1 = 0;
|
||||
return G_SOURCE_CONTINUE;
|
||||
}
|
||||
|
||||
/* advance the block */
|
||||
if (priv->activity_dir == 0)
|
||||
|
||||
@@ -757,6 +757,9 @@ gtk_css_style_render_frame_gap (GtkCssStyle *style,
|
||||
* 
|
||||
*
|
||||
* Since: 3.0
|
||||
*
|
||||
* Deprecated: 3.24: Use gtk_render_frame() instead. Themes can create gaps
|
||||
* by omitting borders via CSS.
|
||||
**/
|
||||
void
|
||||
gtk_render_frame_gap (GtkStyleContext *context,
|
||||
|
||||
+1
-1
@@ -110,7 +110,7 @@ void gtk_render_slider (GtkStyleContext *context,
|
||||
gdouble width,
|
||||
gdouble height,
|
||||
GtkOrientation orientation);
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GDK_DEPRECATED_IN_3_24_FOR(gtk_render_frame)
|
||||
void gtk_render_frame_gap (GtkStyleContext *context,
|
||||
cairo_t *cr,
|
||||
gdouble x,
|
||||
|
||||
+11
-11
@@ -745,7 +745,7 @@ gtk_scrolled_window_class_init (GtkScrolledWindowClass *class)
|
||||
* GtkScrolledWindow:propagate-natural-width:
|
||||
*
|
||||
* Whether the natural width of the child should be calculated and propagated
|
||||
* through the scrolled windows requested natural width.
|
||||
* through the scrolled window’s requested natural width.
|
||||
*
|
||||
* This is useful in cases where an attempt should be made to allocate exactly
|
||||
* enough space for the natural size of the child.
|
||||
@@ -763,7 +763,7 @@ gtk_scrolled_window_class_init (GtkScrolledWindowClass *class)
|
||||
* GtkScrolledWindow:propagate-natural-height:
|
||||
*
|
||||
* Whether the natural height of the child should be calculated and propagated
|
||||
* through the scrolled windows requested natural height.
|
||||
* through the scrolled window’s requested natural height.
|
||||
*
|
||||
* This is useful in cases where an attempt should be made to allocate exactly
|
||||
* enough space for the natural size of the child.
|
||||
@@ -790,7 +790,7 @@ gtk_scrolled_window_class_init (GtkScrolledWindowClass *class)
|
||||
* [keybinding signal][GtkBindingSignal]
|
||||
* which gets emitted when a keybinding that scrolls is pressed.
|
||||
* The horizontal or vertical adjustment is updated which triggers a
|
||||
* signal that the scrolled windows child may listen to and scroll itself.
|
||||
* signal that the scrolled window’s child may listen to and scroll itself.
|
||||
*/
|
||||
signals[SCROLL_CHILD] =
|
||||
g_signal_new (I_("scroll-child"),
|
||||
@@ -813,9 +813,9 @@ gtk_scrolled_window_class_init (GtkScrolledWindowClass *class)
|
||||
* [keybinding signal][GtkBindingSignal] which gets
|
||||
* emitted when focus is moved away from the scrolled window by a
|
||||
* keybinding. The #GtkWidget::move-focus signal is emitted with
|
||||
* @direction_type on this scrolled windows toplevel parent in the
|
||||
* @direction_type on this scrolled window’s toplevel parent in the
|
||||
* container hierarchy. The default bindings for this signal are
|
||||
* `Tab + Ctrl` and `Tab + Ctrl + Shift`.
|
||||
* `Ctrl + Tab` to move forward and `Ctrl + Shift + Tab` to move backward.
|
||||
*/
|
||||
signals[MOVE_FOCUS_OUT] =
|
||||
g_signal_new (I_("move-focus-out"),
|
||||
@@ -833,7 +833,7 @@ gtk_scrolled_window_class_init (GtkScrolledWindowClass *class)
|
||||
* @pos: edge side that was hit
|
||||
*
|
||||
* The ::edge-overshot signal is emitted whenever user initiated scrolling
|
||||
* makes the scrolledwindow firmly surpass (ie. with some edge resistance)
|
||||
* makes the scrolled window firmly surpass (i.e. with some edge resistance)
|
||||
* the lower or upper limits defined by the adjustment in that orientation.
|
||||
*
|
||||
* A similar behavior without edge resistance is provided by the
|
||||
@@ -858,7 +858,7 @@ gtk_scrolled_window_class_init (GtkScrolledWindowClass *class)
|
||||
* @pos: edge side that was reached
|
||||
*
|
||||
* The ::edge-reached signal is emitted whenever user-initiated scrolling
|
||||
* makes the scrolledwindow exactly reaches the lower or upper limits
|
||||
* makes the scrolled window exactly reach the lower or upper limits
|
||||
* defined by the adjustment in that orientation.
|
||||
*
|
||||
* A similar behavior with edge resistance is provided by the
|
||||
@@ -4822,7 +4822,7 @@ gtk_scrolled_window_get_max_content_height (GtkScrolledWindow *scrolled_window)
|
||||
* @propagate: whether to propagate natural width
|
||||
*
|
||||
* Sets whether the natural width of the child should be calculated and propagated
|
||||
* through the scrolled windows requested natural width.
|
||||
* through the scrolled window’s requested natural width.
|
||||
*
|
||||
* Since: 3.22
|
||||
*/
|
||||
@@ -4851,7 +4851,7 @@ gtk_scrolled_window_set_propagate_natural_width (GtkScrolledWindow *scrolled_win
|
||||
* @scrolled_window: a #GtkScrolledWindow
|
||||
*
|
||||
* Reports whether the natural width of the child will be calculated and propagated
|
||||
* through the scrolled windows requested natural width.
|
||||
* through the scrolled window’s requested natural width.
|
||||
*
|
||||
* Returns: whether natural width propagation is enabled.
|
||||
*
|
||||
@@ -4871,7 +4871,7 @@ gtk_scrolled_window_get_propagate_natural_width (GtkScrolledWindow *scrolled_win
|
||||
* @propagate: whether to propagate natural height
|
||||
*
|
||||
* Sets whether the natural height of the child should be calculated and propagated
|
||||
* through the scrolled windows requested natural height.
|
||||
* through the scrolled window’s requested natural height.
|
||||
*
|
||||
* Since: 3.22
|
||||
*/
|
||||
@@ -4900,7 +4900,7 @@ gtk_scrolled_window_set_propagate_natural_height (GtkScrolledWindow *scrolled_wi
|
||||
* @scrolled_window: a #GtkScrolledWindow
|
||||
*
|
||||
* Reports whether the natural height of the child will be calculated and propagated
|
||||
* through the scrolled windows requested natural height.
|
||||
* through the scrolled window’s requested natural height.
|
||||
*
|
||||
* Returns: whether natural height propagation is enabled.
|
||||
*
|
||||
|
||||
@@ -1906,8 +1906,6 @@ gtk_settings_create_for_display (GdkDisplay *display)
|
||||
#ifdef GDK_WINDOWING_WAYLAND
|
||||
if (GDK_IS_WAYLAND_DISPLAY (display))
|
||||
{
|
||||
const gchar *immodule = NULL;
|
||||
|
||||
if (gdk_wayland_display_query_registry (display,
|
||||
"gtk_text_input_manager"))
|
||||
{
|
||||
@@ -1922,9 +1920,6 @@ gtk_settings_create_for_display (GdkDisplay *display)
|
||||
*/
|
||||
settings = g_object_new (GTK_TYPE_SETTINGS, NULL);
|
||||
}
|
||||
|
||||
immodule = "wayland";
|
||||
|
||||
}
|
||||
else
|
||||
#endif
|
||||
|
||||
@@ -28,6 +28,7 @@
|
||||
#include "gtkstylecontext.h"
|
||||
#include "gtkrevealer.h"
|
||||
#include "gtkselection.h"
|
||||
#include "gtkspinner.h"
|
||||
|
||||
#ifdef HAVE_CLOUDPROVIDERS
|
||||
#include <cloudproviders/cloudprovidersaccount.h>
|
||||
@@ -57,6 +58,7 @@ struct _GtkSidebarRow
|
||||
GtkPlacesSidebar *sidebar;
|
||||
GtkWidget *event_box;
|
||||
GtkWidget *revealer;
|
||||
GtkWidget *busy_spinner;
|
||||
};
|
||||
|
||||
G_DEFINE_TYPE (GtkSidebarRow, gtk_sidebar_row, GTK_TYPE_LIST_BOX_ROW)
|
||||
@@ -621,6 +623,7 @@ gtk_sidebar_row_class_init (GtkSidebarRowClass *klass)
|
||||
gtk_widget_class_bind_template_child (widget_class, GtkSidebarRow, eject_button);
|
||||
gtk_widget_class_bind_template_child (widget_class, GtkSidebarRow, event_box);
|
||||
gtk_widget_class_bind_template_child (widget_class, GtkSidebarRow, revealer);
|
||||
gtk_widget_class_bind_template_child (widget_class, GtkSidebarRow, busy_spinner);
|
||||
|
||||
gtk_widget_class_bind_template_callback (widget_class, on_child_revealed);
|
||||
gtk_widget_class_set_css_name (widget_class, "row");
|
||||
@@ -658,3 +661,12 @@ gtk_sidebar_row_get_event_box (GtkSidebarRow *self)
|
||||
{
|
||||
return self->event_box;
|
||||
}
|
||||
|
||||
void
|
||||
gtk_sidebar_row_set_busy (GtkSidebarRow *row,
|
||||
gboolean is_busy)
|
||||
{
|
||||
g_return_if_fail (GTK_IS_SIDEBAR_ROW (row));
|
||||
|
||||
gtk_widget_set_visible (row->busy_spinner, is_busy);
|
||||
}
|
||||
|
||||
@@ -54,6 +54,8 @@ void gtk_sidebar_row_set_start_icon (GtkSidebarRow *self,
|
||||
GIcon *icon);
|
||||
void gtk_sidebar_row_set_end_icon (GtkSidebarRow *self,
|
||||
GIcon *icon);
|
||||
void gtk_sidebar_row_set_busy (GtkSidebarRow *row,
|
||||
gboolean is_busy);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
|
||||
@@ -4042,7 +4042,6 @@ gtk_text_view_size_request (GtkWidget *widget,
|
||||
requisition->height += border_width * 2;
|
||||
|
||||
requisition->height += priv->top_border + priv->bottom_border;
|
||||
requisition->width += priv->left_border + priv->right_border;
|
||||
|
||||
tmp_list = priv->children;
|
||||
while (tmp_list != NULL)
|
||||
|
||||
+22
-4
@@ -7227,7 +7227,7 @@ subtract_corners_from_region (cairo_region_t *region,
|
||||
|
||||
static void
|
||||
update_opaque_region (GtkWindow *window,
|
||||
GtkBorder *border,
|
||||
const GtkBorder *border,
|
||||
const GtkAllocation *allocation)
|
||||
{
|
||||
GtkWidget *widget = GTK_WIDGET (window);
|
||||
@@ -7489,8 +7489,13 @@ gtk_window_realize (GtkWidget *widget)
|
||||
gdk_window_set_decorations (gdk_window, 0);
|
||||
|
||||
#ifdef GDK_WINDOWING_WAYLAND
|
||||
if (priv->client_decorated && GDK_IS_WAYLAND_WINDOW (gdk_window))
|
||||
gdk_wayland_window_announce_csd (gdk_window);
|
||||
if (GDK_IS_WAYLAND_WINDOW (gdk_window))
|
||||
{
|
||||
if (priv->client_decorated)
|
||||
gdk_wayland_window_announce_csd (gdk_window);
|
||||
else
|
||||
gdk_wayland_window_announce_ssd (gdk_window);
|
||||
}
|
||||
#endif
|
||||
|
||||
if (!priv->deletable)
|
||||
@@ -9000,11 +9005,24 @@ static void
|
||||
gtk_window_style_updated (GtkWidget *widget)
|
||||
{
|
||||
GtkCssStyleChange *change = gtk_style_context_get_change (gtk_widget_get_style_context (widget));
|
||||
GtkWindow *window = GTK_WINDOW (widget);
|
||||
|
||||
GTK_WIDGET_CLASS (gtk_window_parent_class)->style_updated (widget);
|
||||
|
||||
if (!_gtk_widget_get_alloc_needed (widget) &&
|
||||
(change == NULL || gtk_css_style_change_changes_property (change, GTK_CSS_PROPERTY_BACKGROUND_COLOR)))
|
||||
{
|
||||
GtkAllocation allocation;
|
||||
GtkBorder window_border;
|
||||
|
||||
_gtk_widget_get_allocation (widget, &allocation);
|
||||
get_shadow_width (window, &window_border);
|
||||
|
||||
update_opaque_region (window, &window_border, &allocation);
|
||||
}
|
||||
|
||||
if (change == NULL || gtk_css_style_change_changes_property (change, GTK_CSS_PROPERTY_ICON_THEME))
|
||||
update_themed_icon (GTK_WINDOW (widget));
|
||||
update_themed_icon (window);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -15,6 +15,8 @@
|
||||
#include <glib.h>
|
||||
#include <glib/gi18n.h>
|
||||
#include <glib/gstdio.h>
|
||||
|
||||
#if defined (HAVE_HARFBUZZ) && defined (HAVE_PANGOFT)
|
||||
#include <hb-ot.h>
|
||||
|
||||
#include "language-names.h"
|
||||
@@ -237,3 +239,4 @@ get_language_name_for_tag (guint32 tag)
|
||||
|
||||
return get_language_name (pango_language_from_string (s));
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
#include "config.h"
|
||||
#include <glib.h>
|
||||
#include <glib/gi18n-lib.h>
|
||||
|
||||
#if defined (HAVE_HARFBUZZ) && defined (HAVE_PANGOFT)
|
||||
#include <hb-ot.h>
|
||||
|
||||
#include "script-names.h"
|
||||
@@ -182,3 +184,4 @@ get_script_name_for_tag (guint32 tag)
|
||||
|
||||
return NULL;
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -3393,8 +3393,6 @@ progressbar {
|
||||
|
||||
trough { @extend %scale_trough; }
|
||||
|
||||
&:backdrop trough { @extend %scale_trough:backdrop; } // looks like states are not passed to the trough component here
|
||||
|
||||
progress {
|
||||
@extend %scale_highlight;
|
||||
|
||||
@@ -3421,8 +3419,6 @@ progressbar {
|
||||
}
|
||||
}
|
||||
|
||||
&:backdrop progress { @extend %scale_highlight:backdrop; } // states not passed here as well
|
||||
|
||||
&.osd { // progressbar.osd used for epiphany page loading progress
|
||||
min-width: 3px;
|
||||
min-height: 3px;
|
||||
|
||||
@@ -1177,9 +1177,9 @@ scale trough, scale fill, progressbar trough { border: 1px solid #1b1f20; border
|
||||
|
||||
scale trough:disabled, scale fill:disabled, progressbar trough:disabled { background-color: #2d3234; }
|
||||
|
||||
scale trough:backdrop, scale fill:backdrop, progressbar trough:backdrop, progressbar:backdrop trough { background-color: #2c3233; border-color: #202425; transition: 200ms ease-out; }
|
||||
scale trough:backdrop, scale fill:backdrop, progressbar trough:backdrop { background-color: #2c3233; border-color: #202425; transition: 200ms ease-out; }
|
||||
|
||||
scale trough:backdrop:disabled, scale fill:backdrop:disabled, progressbar trough:backdrop:disabled, progressbar:backdrop trough:disabled { background-color: #2d3234; }
|
||||
scale trough:backdrop:disabled, scale fill:backdrop:disabled, progressbar trough:backdrop:disabled { background-color: #2d3234; }
|
||||
|
||||
row:selected scale trough:disabled, scale row:selected trough:disabled, row:selected scale fill:disabled, scale row:selected fill:disabled, row:selected progressbar trough:disabled, progressbar row:selected trough:disabled, row:selected scale trough, scale row:selected trough, row:selected scale fill, scale row:selected fill, row:selected progressbar trough, progressbar row:selected trough { border-color: #0f2b48; }
|
||||
|
||||
@@ -1191,9 +1191,9 @@ scale highlight, progressbar progress { border: 1px solid #0f2b48; border-radius
|
||||
|
||||
scale highlight:disabled, progressbar progress:disabled { background-color: transparent; border-color: transparent; }
|
||||
|
||||
scale highlight:backdrop, progressbar progress:backdrop, progressbar:backdrop progress { border-color: #0f2b48; }
|
||||
scale highlight:backdrop, progressbar progress:backdrop { border-color: #0f2b48; }
|
||||
|
||||
scale highlight:backdrop:disabled, progressbar progress:backdrop:disabled, progressbar:backdrop progress:disabled { background-color: transparent; border-color: transparent; }
|
||||
scale highlight:backdrop:disabled, progressbar progress:backdrop:disabled { background-color: transparent; border-color: transparent; }
|
||||
|
||||
row:selected scale highlight:disabled, scale row:selected highlight:disabled, row:selected progressbar progress:disabled, progressbar row:selected progress:disabled, row:selected scale highlight, scale row:selected highlight, row:selected progressbar progress, progressbar row:selected progress { border-color: #0f2b48; }
|
||||
|
||||
|
||||
@@ -1197,9 +1197,9 @@ scale trough, scale fill, progressbar trough { border: 1px solid #b6b6b3; border
|
||||
|
||||
scale trough:disabled, scale fill:disabled, progressbar trough:disabled { background-color: #f1f1f1; }
|
||||
|
||||
scale trough:backdrop, scale fill:backdrop, progressbar trough:backdrop, progressbar:backdrop trough { background-color: #dadad8; border-color: #c0c0bd; transition: 200ms ease-out; }
|
||||
scale trough:backdrop, scale fill:backdrop, progressbar trough:backdrop { background-color: #dadad8; border-color: #c0c0bd; transition: 200ms ease-out; }
|
||||
|
||||
scale trough:backdrop:disabled, scale fill:backdrop:disabled, progressbar trough:backdrop:disabled, progressbar:backdrop trough:disabled { background-color: #f1f1f1; }
|
||||
scale trough:backdrop:disabled, scale fill:backdrop:disabled, progressbar trough:backdrop:disabled { background-color: #f1f1f1; }
|
||||
|
||||
row:selected scale trough:disabled, scale row:selected trough:disabled, row:selected scale fill:disabled, scale row:selected fill:disabled, row:selected progressbar trough:disabled, progressbar row:selected trough:disabled, row:selected scale trough, scale row:selected trough, row:selected scale fill, scale row:selected fill, row:selected progressbar trough, progressbar row:selected trough { border-color: #184472; }
|
||||
|
||||
@@ -1211,9 +1211,9 @@ scale highlight, progressbar progress { border: 1px solid #184472; border-radius
|
||||
|
||||
scale highlight:disabled, progressbar progress:disabled { background-color: transparent; border-color: transparent; }
|
||||
|
||||
scale highlight:backdrop, progressbar progress:backdrop, progressbar:backdrop progress { border-color: #4a90d9; }
|
||||
scale highlight:backdrop, progressbar progress:backdrop { border-color: #4a90d9; }
|
||||
|
||||
scale highlight:backdrop:disabled, progressbar progress:backdrop:disabled, progressbar:backdrop progress:disabled { background-color: transparent; border-color: transparent; }
|
||||
scale highlight:backdrop:disabled, progressbar progress:backdrop:disabled { background-color: transparent; border-color: transparent; }
|
||||
|
||||
row:selected scale highlight:disabled, scale row:selected highlight:disabled, row:selected progressbar progress:disabled, progressbar row:selected progress:disabled, row:selected scale highlight, scale row:selected highlight, row:selected progressbar progress, progressbar row:selected progress { border-color: #184472; }
|
||||
|
||||
|
||||
@@ -1368,7 +1368,7 @@ treeview.view {
|
||||
-GtkTreeView-grid-line-pattern: '';
|
||||
-GtkTreeView-tree-line-width: 1;
|
||||
-GtkTreeView-tree-line-pattern: '';
|
||||
-GtkTreeView-expander-size: 16;
|
||||
-GtkTreeView-expander-size: 24;
|
||||
|
||||
border-left-color: mix($fg_color, $base_color, 50%); // this is actually the tree lines color,
|
||||
border-top-color: $bg_color; // while this is the grid lines color, better then nothing
|
||||
@@ -2832,8 +2832,8 @@ row.activatable {
|
||||
|
||||
expander {
|
||||
title > arrow {
|
||||
min-width: 16px;
|
||||
min-height: 16px;
|
||||
min-width: 24px;
|
||||
min-height: 24px;
|
||||
-gtk-icon-source: -gtk-icontheme('pan-end-symbolic');
|
||||
&:dir(rtl) { -gtk-icon-source: -gtk-icontheme('pan-end-symbolic-rtl'); }
|
||||
|
||||
|
||||
@@ -548,7 +548,7 @@ window.csd > .titlebar:not(headerbar) { padding: 0; background-color: transparen
|
||||
.path-bar button image { padding-top: 1px; }
|
||||
|
||||
/************** Tree Views * */
|
||||
treeview.view { -GtkTreeView-grid-line-width: 1; -GtkTreeView-grid-line-pattern: ''; -GtkTreeView-tree-line-width: 1; -GtkTreeView-tree-line-pattern: ''; -GtkTreeView-expander-size: 16; border-left-color: #888888; border-top-color: #000; }
|
||||
treeview.view { -GtkTreeView-grid-line-width: 1; -GtkTreeView-grid-line-pattern: ''; -GtkTreeView-tree-line-width: 1; -GtkTreeView-tree-line-pattern: ''; -GtkTreeView-expander-size: 24; border-left-color: #888888; border-top-color: #000; }
|
||||
|
||||
treeview.view:selected { border-radius: 0; }
|
||||
|
||||
@@ -1240,7 +1240,7 @@ row:hover, row.activatable:hover { transition: none; }
|
||||
.app-notification border, .app-notification.frame border { border-width: 0; }
|
||||
|
||||
/************* Expanders * */
|
||||
expander title > arrow { min-width: 16px; min-height: 16px; -gtk-icon-source: -gtk-icontheme("pan-end-symbolic"); }
|
||||
expander title > arrow { min-width: 24px; min-height: 24px; -gtk-icon-source: -gtk-icontheme("pan-end-symbolic"); }
|
||||
|
||||
expander title > arrow:dir(rtl) { -gtk-icon-source: -gtk-icontheme("pan-end-symbolic-rtl"); }
|
||||
|
||||
|
||||
@@ -552,7 +552,7 @@ window.csd > .titlebar:not(headerbar) { padding: 0; background-color: transparen
|
||||
.path-bar button image { padding-top: 1px; }
|
||||
|
||||
/************** Tree Views * */
|
||||
treeview.view { -GtkTreeView-grid-line-width: 1; -GtkTreeView-grid-line-pattern: ''; -GtkTreeView-tree-line-width: 1; -GtkTreeView-tree-line-pattern: ''; -GtkTreeView-expander-size: 16; border-left-color: gray; border-top-color: #fff; }
|
||||
treeview.view { -GtkTreeView-grid-line-width: 1; -GtkTreeView-grid-line-pattern: ''; -GtkTreeView-tree-line-width: 1; -GtkTreeView-tree-line-pattern: ''; -GtkTreeView-expander-size: 24; border-left-color: gray; border-top-color: #fff; }
|
||||
|
||||
treeview.view:selected { border-radius: 0; }
|
||||
|
||||
@@ -1246,7 +1246,7 @@ row:hover, row.activatable:hover { transition: none; }
|
||||
.app-notification border, .app-notification.frame border { border-width: 0; }
|
||||
|
||||
/************* Expanders * */
|
||||
expander title > arrow { min-width: 16px; min-height: 16px; -gtk-icon-source: -gtk-icontheme("pan-end-symbolic"); }
|
||||
expander title > arrow { min-width: 24px; min-height: 24px; -gtk-icon-source: -gtk-icontheme("pan-end-symbolic"); }
|
||||
|
||||
expander title > arrow:dir(rtl) { -gtk-icon-source: -gtk-icontheme("pan-end-symbolic-rtl"); }
|
||||
|
||||
|
||||
@@ -1,884 +0,0 @@
|
||||
@define-color fg_color #000;
|
||||
@define-color bg_color #dcdad5;
|
||||
@define-color text_color #000;
|
||||
@define-color base_color #fff;
|
||||
@define-color selected_bg_color #4b6983;
|
||||
@define-color selected_fg_color #fff;
|
||||
@define-color tooltip_bg_color #eee1b3;
|
||||
@define-color tooltip_fg_color #000;
|
||||
@define-color placeholder_text_color #808080;
|
||||
|
||||
@define-color info_fg_color rgb (181, 171, 156);
|
||||
@define-color info_bg_color rgb (252, 252, 189);
|
||||
@define-color warning_fg_color rgb (173, 120, 41);
|
||||
@define-color warning_bg_color rgb (250, 173, 61);
|
||||
@define-color question_fg_color rgb (97, 122, 214);
|
||||
@define-color question_bg_color rgb (138, 173, 212);
|
||||
@define-color error_fg_color rgb (166, 38, 38);
|
||||
@define-color error_bg_color rgb (237, 54, 54);
|
||||
|
||||
@define-color success_bg_color #4e9a06;
|
||||
|
||||
* {
|
||||
color: @fg_color;
|
||||
border-color: shade (@bg_color, 0.6);
|
||||
padding: 2px;
|
||||
}
|
||||
|
||||
.background, .button, .slider {
|
||||
background-color: @bg_color;
|
||||
}
|
||||
|
||||
.popover {
|
||||
border-color: darker(@bg_color);
|
||||
border-width: 1px;
|
||||
border-style: solid;
|
||||
}
|
||||
|
||||
.expander, GtkTreeView.view.expander {
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.expander:hover,
|
||||
GtkTreeView.view.expander:selected:hover {
|
||||
color: @text_color;
|
||||
}
|
||||
|
||||
GtkTreeView.dnd {
|
||||
border-color: @internal_element_color;
|
||||
border-radius: 0;
|
||||
border-width: 1px;
|
||||
border-style: solid;
|
||||
}
|
||||
|
||||
*:disabled {
|
||||
border-color: shade (@bg_color, 0.7);
|
||||
background-color: shade (@bg_color, 0.9);
|
||||
color: shade (@bg_color, 0.7);
|
||||
}
|
||||
|
||||
.entry.read-only {
|
||||
border-color: shade (@bg_color, 0.7);
|
||||
background-color: shade (@bg_color, 0.9);
|
||||
}
|
||||
|
||||
.entry:selected {
|
||||
background-color: shade (@bg_color, 0.9);
|
||||
color: @fg_color;
|
||||
}
|
||||
|
||||
.entry:selected:focus {
|
||||
background-color: @selected_bg_color;
|
||||
color: @selected_fg_color;
|
||||
}
|
||||
|
||||
.view {
|
||||
border-width: 0;
|
||||
border-radius: 0;
|
||||
background-color: @base_color;
|
||||
color: @text_color;
|
||||
}
|
||||
.view:selected {
|
||||
background-color: shade (@bg_color, 0.9);
|
||||
color: @fg_color;
|
||||
}
|
||||
|
||||
.view:selected:focus {
|
||||
background-color: @selected_bg_color;
|
||||
color: @selected_fg_color;
|
||||
}
|
||||
|
||||
.view column:sorted row,
|
||||
.view column:sorted row:hover {
|
||||
background-color: shade (@bg_color, 0.85);
|
||||
}
|
||||
|
||||
.view column:sorted row:nth-child(odd),
|
||||
.view column:sorted row:nth-child(odd):hover {
|
||||
background-color: shade (@bg_color, 0.8);
|
||||
}
|
||||
|
||||
.view row,
|
||||
.view row:hover {
|
||||
background-color: @base_color;
|
||||
color: @text_color;
|
||||
}
|
||||
|
||||
.view row:nth-child(odd),
|
||||
.view row:nth-child(odd):hover {
|
||||
background-color: shade (@base_color, 0.93);
|
||||
}
|
||||
|
||||
.view row:selected:focus {
|
||||
background-color: @selected_bg_color;
|
||||
}
|
||||
|
||||
.view row:selected {
|
||||
background-color: darker (@bg_color);
|
||||
color: @selected_fg_color;
|
||||
}
|
||||
|
||||
.view.cell.trough,
|
||||
.view.cell.trough:hover,
|
||||
.view.cell.trough:selected,
|
||||
.view.cell.trough:selected:focus {
|
||||
background-color: @bg_color;
|
||||
color: @fg_color;
|
||||
}
|
||||
|
||||
.view.cell.progressbar,
|
||||
.view.cell.progressbar:hover,
|
||||
.view.cell.progressbar:selected,
|
||||
.view.cell.progressbar:selected:focus {
|
||||
background-color: @selected_bg_color;
|
||||
color: @selected_fg_color;
|
||||
}
|
||||
|
||||
.rubberband {
|
||||
background-color: alpha (@fg_color, 0.25);
|
||||
border-color: @fg_color;
|
||||
border-style: solid;
|
||||
border-width: 1px;
|
||||
}
|
||||
|
||||
.tooltip,
|
||||
.tooltip * {
|
||||
background-color: @tooltip_bg_color;
|
||||
color: @tooltip_fg_color;
|
||||
border-color: @tooltip_fg_color;
|
||||
border-width: 1px;
|
||||
border-style: solid;
|
||||
}
|
||||
|
||||
.button,
|
||||
.slider {
|
||||
border-style: outset;
|
||||
border-width: 2px;
|
||||
}
|
||||
|
||||
.button:active, .button:checked {
|
||||
background-color: shade (@bg_color, 0.7);
|
||||
border-style: inset;
|
||||
}
|
||||
|
||||
.spinbutton.button:hover,
|
||||
.button:hover,
|
||||
.slider:hover {
|
||||
background-color: @selected_bg_color;
|
||||
color: @selected_fg_color;
|
||||
border-color: shade (@selected_bg_color, 0.7);
|
||||
}
|
||||
|
||||
.trough {
|
||||
background-color: darker (@bg_color);
|
||||
border-style: inset;
|
||||
border-width: 1px;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.entry {
|
||||
border-style: inset;
|
||||
border-width: 2px;
|
||||
background-color: @base_color;
|
||||
color: @text_color;
|
||||
}
|
||||
|
||||
.entry:disabled {
|
||||
background-color: shade (@base_color, 0.9);
|
||||
color: shade (@base_color, 0.7);
|
||||
}
|
||||
.entry:active {
|
||||
background-color: #c4c2bd;
|
||||
color: #000;
|
||||
}
|
||||
|
||||
.progressbar,
|
||||
.entry.progressbar,
|
||||
.cell.progressbar {
|
||||
background-color: @selected_bg_color;
|
||||
border-color: shade (@selected_bg_color, 0.7);
|
||||
color: @selected_fg_color;
|
||||
border-style: outset;
|
||||
border-width: 1px;
|
||||
}
|
||||
|
||||
.level-bar.indicator-discrete {
|
||||
margin: 1px;
|
||||
}
|
||||
|
||||
.level-bar.fill-block {
|
||||
background-color: @selected_bg_color;
|
||||
}
|
||||
|
||||
.level-bar.fill-block.level-low {
|
||||
background-color: @warning_bg_color;
|
||||
}
|
||||
|
||||
.level-bar.fill-block.level-high {
|
||||
background-color: @success_bg_color;
|
||||
}
|
||||
|
||||
.level-bar.fill-block.empty-fill-block {
|
||||
background-color: @base_color;
|
||||
}
|
||||
|
||||
GtkCheckButton:hover,
|
||||
GtkCheckButton:selected,
|
||||
GtkRadioButton:hover,
|
||||
GtkRadioButton:selected {
|
||||
background-color: shade (@bg_color, 1.05);
|
||||
}
|
||||
|
||||
.check, .radio,
|
||||
.cell.check, .cell.radio,
|
||||
.cell.check:hover, .cell.radio:hover {
|
||||
border-style: solid;
|
||||
border-width: 1px;
|
||||
background-color: @base_color;
|
||||
border-color: @fg_color;
|
||||
}
|
||||
|
||||
.check:checked, .radio:checked,
|
||||
.check:hover, .radio:hover {
|
||||
background-color: @base_color;
|
||||
border-color: @fg_color;
|
||||
color: @text_color;
|
||||
}
|
||||
|
||||
.check:active, .radio:active {
|
||||
background-color: darker (@bg_color);
|
||||
color: @selected_fg_color;
|
||||
border-color: @selected_fg_color;
|
||||
}
|
||||
|
||||
.check:active:focus, .radio:active:focus {
|
||||
background-color: @selected_bg_color;
|
||||
}
|
||||
|
||||
.menuitem.check, .menuitem.radio {
|
||||
color: @fg_color;
|
||||
border-style: none;
|
||||
border-width: 0;
|
||||
}
|
||||
|
||||
.popup {
|
||||
border-style: outset;
|
||||
border-width: 1px;
|
||||
}
|
||||
|
||||
.viewport {
|
||||
border-style: inset;
|
||||
border-width: 2px;
|
||||
}
|
||||
|
||||
.notebook {
|
||||
border-style: outset;
|
||||
border-width: 1px;
|
||||
}
|
||||
|
||||
.notebook tab {
|
||||
border-style: solid;
|
||||
border-width: 1px;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.notebook tab:active {
|
||||
color: @selected_fg_color;
|
||||
background-color: darker (@bg_color);
|
||||
}
|
||||
|
||||
.frame {
|
||||
border-style: inset;
|
||||
border-width: 1px;
|
||||
}
|
||||
|
||||
GtkScrolledWindow.frame {
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.menu,
|
||||
.menubar,
|
||||
.toolbar {
|
||||
border-style: outset;
|
||||
border-width: 1px;
|
||||
}
|
||||
|
||||
.menu:hover,
|
||||
.menubar:hover,
|
||||
.menuitem:hover,
|
||||
.menuitem.check:hover,
|
||||
.menuitem.radio:hover {
|
||||
background-color: @selected_bg_color;
|
||||
color: @selected_fg_color;
|
||||
}
|
||||
|
||||
GtkSpinButton.button {
|
||||
border-width: 1px;
|
||||
}
|
||||
|
||||
.scale.slider:hover,
|
||||
GtkSpinButton.button:hover {
|
||||
background-color: shade (@bg_color, 1.05);
|
||||
border-color: shade (@bg_color, 0.8);
|
||||
}
|
||||
|
||||
.scale.slider.fine-tune:active,
|
||||
.scale.slider.fine-tune:active:hover,
|
||||
.scale.slider.fine-tune.horizontal:active,
|
||||
.scale.slider.fine-tune.horizontal:active:hover {
|
||||
border-width: 5px;
|
||||
}
|
||||
|
||||
.scrollbar.slider.fine-tune {
|
||||
border-width: 5px;
|
||||
}
|
||||
|
||||
GtkSwitch.trough:active {
|
||||
background-color: @selected_bg_color;
|
||||
color: @selected_fg_color;
|
||||
}
|
||||
|
||||
GtkToggleButton.button:indeterminate {
|
||||
border-style: outset;
|
||||
border-width: 1px;
|
||||
background-color: shade (@bg_color, 0.9);
|
||||
border-color: shade (@bg_color, 0.7);
|
||||
}
|
||||
|
||||
GtkLabel:selected {
|
||||
background-color: shade (@bg_color, 0.9);
|
||||
}
|
||||
|
||||
GtkLabel:selected:focus {
|
||||
background-color: @selected_bg_color;
|
||||
}
|
||||
|
||||
.info {
|
||||
background-color: @info_bg_color;
|
||||
color: @info_fg_color;
|
||||
}
|
||||
|
||||
.warning {
|
||||
background-color: @warning_bg_color;
|
||||
color: @warning_fg_color;
|
||||
}
|
||||
|
||||
.question {
|
||||
background-color: @question_bg_color;
|
||||
color: @question_fg_color;
|
||||
}
|
||||
|
||||
.error {
|
||||
background-color: @error_bg_color;
|
||||
color: @error_fg_color;
|
||||
}
|
||||
|
||||
.highlight {
|
||||
background-color: @selected_bg_color;
|
||||
color: @selected_fg_color;
|
||||
}
|
||||
|
||||
.light-area-focus {
|
||||
color: #000;
|
||||
}
|
||||
|
||||
.dark-area-focus {
|
||||
color: #fff;
|
||||
}
|
||||
GtkCalendar.view {
|
||||
border-width: 1px;
|
||||
border-style: inset;
|
||||
padding: 1px;
|
||||
}
|
||||
|
||||
GtkCalendar.view:indeterminate {
|
||||
color: darker (@bg_color);
|
||||
}
|
||||
|
||||
GtkCalendar.header {
|
||||
background-color: @bg_color;
|
||||
border-style: outset;
|
||||
border-width: 2px;
|
||||
}
|
||||
|
||||
GtkCalendar.highlight {
|
||||
border-width: 0;
|
||||
}
|
||||
|
||||
GtkCalendar.button {
|
||||
background-color: @bg_color;
|
||||
}
|
||||
|
||||
GtkCalendar.button:hover {
|
||||
background-color: lighter (@bg_color);
|
||||
color: @fg_color;
|
||||
}
|
||||
|
||||
.menu * {
|
||||
border-width: 0;
|
||||
padding: 2px;
|
||||
}
|
||||
|
||||
@keyframes spinner {
|
||||
0% { background-image: none,
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.916667)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.833333)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.75)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.666667)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.583333)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.5)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.416667)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.333333)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.25)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.166667)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.0833333)), to(transparent)); }
|
||||
0% { background-image: -gtk-gradient(radial, center center, 0, center center, 0.5, to(currentColor), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.916667)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.833333)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.75)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.666667)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.583333)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.5)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.416667)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.333333)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.25)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.166667)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.0833333)), to(transparent)); }
|
||||
8% { background-image: -gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.916667)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.833333)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.75)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.666667)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.583333)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.5)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.416667)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.333333)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.25)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.166667)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.0833333)), to(transparent)),
|
||||
none; }
|
||||
8% { background-image: -gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.916667)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.833333)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.75)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.666667)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.583333)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.5)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.416667)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.333333)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.25)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.166667)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.0833333)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(currentColor), to(transparent)); }
|
||||
16% { background-image: -gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.833333)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.75)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.666667)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.583333)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.5)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.416667)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.333333)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.25)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.166667)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.0833333)), to(transparent)),
|
||||
none,
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.916667)), to(transparent)); }
|
||||
16% { background-image: -gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.833333)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.75)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.666667)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.583333)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.5)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.416667)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.333333)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.25)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.166667)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.0833333)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(currentColor), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.916667)), to(transparent)); }
|
||||
25% { background-image: -gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.75)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.666667)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.583333)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.5)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.416667)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.333333)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.25)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.166667)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.0833333)), to(transparent)),
|
||||
none,
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.916667)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.833333)), to(transparent)); }
|
||||
25% { background-image: -gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.75)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.666667)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.583333)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.5)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.416667)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.333333)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.25)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.166667)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.0833333)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(currentColor), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.916667)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.833333)), to(transparent)); }
|
||||
33% { background-image: -gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.666667)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.583333)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.5)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.416667)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.333333)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.25)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.166667)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.0833333)), to(transparent)),
|
||||
none,
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.916667)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.833333)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.75)), to(transparent)); }
|
||||
33% { background-image: -gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.666667)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.583333)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.5)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.416667)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.333333)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.25)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.166667)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.0833333)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(currentColor), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.916667)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.833333)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.75)), to(transparent)); }
|
||||
41% { background-image: -gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.583333)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.5)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.416667)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.333333)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.25)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.166667)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.0833333)), to(transparent)),
|
||||
none,
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.916667)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.833333)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.75)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.666667)), to(transparent)); }
|
||||
41% { background-image: -gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.583333)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.5)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.416667)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.333333)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.25)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.166667)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.0833333)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(currentColor), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.916667)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.833333)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.75)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.666667)), to(transparent)); }
|
||||
50% { background-image: -gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.5)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.416667)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.333333)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.25)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.166667)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.0833333)), to(transparent)),
|
||||
none,
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.916667)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.833333)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.75)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.666667)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.583333)), to(transparent)); }
|
||||
50% { background-image: -gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.5)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.416667)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.333333)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.25)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.166667)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.0833333)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(currentColor), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.916667)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.833333)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.75)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.666667)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.583333)), to(transparent)); }
|
||||
58% { background-image: -gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.416667)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.333333)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.25)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.166667)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.0833333)), to(transparent)),
|
||||
none,
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.916667)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.833333)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.75)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.666667)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.583333)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.5)), to(transparent)); }
|
||||
58% { background-image: -gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.416667)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.333333)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.25)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.166667)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.0833333)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(currentColor), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.916667)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.833333)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.75)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.666667)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.583333)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.5)), to(transparent)); }
|
||||
66% { background-image: -gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.333333)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.25)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.166667)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.0833333)), to(transparent)),
|
||||
none,
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.916667)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.833333)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.75)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.666667)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.583333)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.5)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.416667)), to(transparent)); }
|
||||
66% { background-image: -gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.333333)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.25)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.166667)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.0833333)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(currentColor), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.916667)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.833333)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.75)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.666667)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.583333)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.5)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.416667)), to(transparent)); }
|
||||
75% { background-image: -gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.25)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.166667)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.0833333)), to(transparent)),
|
||||
none,
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.916667)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.833333)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.75)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.666667)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.583333)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.5)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.416667)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.333333)), to(transparent)); }
|
||||
75% { background-image: -gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.25)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.166667)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.0833333)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(currentColor), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.916667)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.833333)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.75)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.666667)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.583333)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.5)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.416667)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.333333)), to(transparent)); }
|
||||
83% { background-image: -gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.166667)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.0833333)), to(transparent)),
|
||||
none,
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.916667)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.833333)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.75)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.666667)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.583333)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.5)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.416667)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.333333)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.25)), to(transparent)); }
|
||||
83% { background-image: -gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.166667)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.0833333)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(currentColor), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.916667)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.833333)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.75)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.666667)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.583333)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.5)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.416667)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.333333)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.25)), to(transparent)); }
|
||||
91% { background-image: -gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.0833333)), to(transparent)),
|
||||
none,
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.916667)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.833333)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.75)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.666667)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.583333)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.5)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.416667)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.333333)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.25)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.166667)), to(transparent)); }
|
||||
91% { background-image: -gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.0833333)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(currentColor), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.916667)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.833333)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.75)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.666667)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.583333)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.5)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.416667)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.333333)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.25)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.166667)), to(transparent)); }
|
||||
100% { background-image: none,
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.916667)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.833333)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.75)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.666667)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.583333)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.5)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.416667)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.333333)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.25)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.166667)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.0833333)), to(transparent)); }
|
||||
100% { background-image: -gtk-gradient(radial, center center, 0, center center, 0.5, to(currentColor), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.916667)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.833333)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.75)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.666667)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.583333)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.5)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.416667)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.333333)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.25)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.166667)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.0833333)), to(transparent)); }
|
||||
}
|
||||
|
||||
.spinner {
|
||||
background-color: transparent;
|
||||
background-image: -gtk-gradient(radial, center center, 0, center center, 0.5, to(currentColor), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(currentColor), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(currentColor), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(currentColor), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(currentColor), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(currentColor), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(currentColor), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(currentColor), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(currentColor), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(currentColor), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(currentColor), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(currentColor), to(transparent));
|
||||
background-position: 25.00% 6.70%, 6.70% 25.00%, 0.00% 50.00%, 6.70% 75.00%, 25.00% 93.30%, 50.00% 100.00%, 75.00% 93.30%, 93.30% 75.00%, 100.00% 50.00%, 93.30% 25.00%, 75.00% 6.70%, 50.00% 0.00%;
|
||||
background-size: 20% 20%;
|
||||
background-repeat: no-repeat;
|
||||
transition: background-image 500ms ease-out;
|
||||
}
|
||||
|
||||
.spinner:active {
|
||||
background-image: -gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.916667)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.833333)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.75)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.666667)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.583333)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.5)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.416667)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.333333)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.25)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.166667)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.0833333)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(currentColor), to(transparent));
|
||||
animation: spinner 1s infinite linear;
|
||||
}
|
||||
|
||||
/* Client side decorations */
|
||||
.titlebar {
|
||||
text-shadow: 1px 1px lighter (@bg_color);
|
||||
background-image: linear-gradient(to bottom, white, @bg_color);
|
||||
border-radius: 7px 7px 0px 0px;
|
||||
}
|
||||
|
||||
.maximized .titlebar,
|
||||
.tiled .titlebar {
|
||||
border-radius: 0;
|
||||
}
|
||||
|
||||
.titlebar.default-decoration {
|
||||
border: none;
|
||||
box-shadow: none;
|
||||
}
|
||||
|
||||
.titlebar .title {
|
||||
font-weight: bold;
|
||||
font-size: 10pt;
|
||||
}
|
||||
|
||||
.titlebar .subtitle {
|
||||
font-size: 9pt;
|
||||
}
|
||||
|
||||
.titlebar:backdrop {
|
||||
text-shadow: none;
|
||||
background-image: none;
|
||||
background-color: @bg_color;
|
||||
}
|
||||
|
||||
.titlebar .titlebutton {
|
||||
-gtk-icon-shadow: 0px 1px #ffff;
|
||||
color: shade(@fg_color, 1.8);
|
||||
background: none;
|
||||
padding: 5px 5px 6px 5px;
|
||||
|
||||
border-radius: 3px;
|
||||
border-width: 1px 1px 2px 1px;
|
||||
border-color: transparent;
|
||||
border-style: solid;
|
||||
border-image: none;
|
||||
}
|
||||
|
||||
.titlebar .titlebutton:hover {
|
||||
background-image: linear-gradient(to bottom, @bg_color, lighter (@bg_color));
|
||||
}
|
||||
|
||||
.titlebar .titlebutton:backdrop {
|
||||
border-image: none;
|
||||
background-image: none;
|
||||
}
|
||||
|
||||
.titlebar .titlebutton:active {
|
||||
background-image: linear-gradient(to bottom, #a7aba7, shade(@bg_color, 0.95));
|
||||
color: @selected_fg_color;
|
||||
-gtk-icon-shadow: none;
|
||||
}
|
||||
|
||||
.titlebar .titlebutton:backdrop {
|
||||
background-image: none;
|
||||
color: #a7aba7;
|
||||
border-image: none;
|
||||
-gtk-icon-shadow: none;
|
||||
}
|
||||
|
||||
.window-frame {
|
||||
border-color: darker (@bg_color);
|
||||
border-radius: 7px 7px 0 0;
|
||||
border-width: 1px;
|
||||
border-style: solid;
|
||||
|
||||
box-shadow: 0 2px 8px 3px alpha(black, 0.5);
|
||||
margin: 10px;
|
||||
}
|
||||
|
||||
.window-frame.tooltip.csd {
|
||||
border-radius: 1px 1px 0 0;
|
||||
box-shadow: none;
|
||||
margin: 0px;
|
||||
}
|
||||
|
||||
.window-frame.popup.csd {
|
||||
border-radius: 1px 1px 0 0;
|
||||
box-shadow: 0 1px 1px 1px alpha(black, 0.5);
|
||||
margin: 0px;
|
||||
}
|
||||
|
||||
.window-frame.popup {
|
||||
border-color: darker (@bg_color);
|
||||
border-width: 1px;
|
||||
border-style: solid;
|
||||
}
|
||||
|
||||
.window-frame.tiled {
|
||||
border-radius: 0;
|
||||
background-color: @bg_color;
|
||||
}
|
||||
|
||||
.window-frame:backdrop {
|
||||
box-shadow: 0 2px 5px 1px alpha(black, 0.5);
|
||||
}
|
||||
|
||||
.window-frame.solid-csd {
|
||||
border-radius: 0;
|
||||
margin: 2px;
|
||||
background-color: @bg_color;
|
||||
border-style: outset;
|
||||
border-width: 2px;
|
||||
box-shadow: none;
|
||||
}
|
||||
@@ -71,6 +71,15 @@
|
||||
</style>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkSpinner" id="busy_spinner">
|
||||
<property name="active">1</property>
|
||||
<property name="halign">center</property>
|
||||
<property name="valign">center</property>
|
||||
<property name="margin-start">4px</property>
|
||||
<property name="no-show-all">1</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
|
||||
@@ -336,7 +336,8 @@ gtk_im_context_thai_filter_keypress (GtkIMContext *context,
|
||||
if (is_reject)
|
||||
{
|
||||
/* reject character */
|
||||
gdk_beep ();
|
||||
GdkDisplay *display = gdk_display_get_default ();
|
||||
gdk_display_beep (display);
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
@@ -491,8 +491,13 @@ gtk_im_context_wayland_get_preedit_string (GtkIMContext *context,
|
||||
GTK_IM_CONTEXT_CLASS (parent_class)->get_preedit_string (context, str, attrs, cursor_pos);
|
||||
|
||||
/* If the parent implementation returns a len>0 string, go with it */
|
||||
if (str && *str && **str)
|
||||
return;
|
||||
if (str && *str)
|
||||
{
|
||||
if (**str)
|
||||
return;
|
||||
|
||||
g_free (*str);
|
||||
}
|
||||
|
||||
preedit_str =
|
||||
context_wayland->preedit.text ? context_wayland->preedit.text : "";
|
||||
|
||||
@@ -140,6 +140,9 @@ gtk/gtkentry.c
|
||||
gtk/gtkentrycompletion.c
|
||||
gtk/gtkeventbox.c
|
||||
gtk/gtkeventcontroller.c
|
||||
gtk/gtkeventcontrollerkey.c
|
||||
gtk/gtkeventcontrollermotion.c
|
||||
gtk/gtkeventcontrollerscroll.c
|
||||
gtk/gtkexpander.c
|
||||
gtk/gtkfilechooserbutton.c
|
||||
gtk/gtkfilechooser.c
|
||||
@@ -167,6 +170,7 @@ gtk/gtkgesturemultipress.c
|
||||
gtk/gtkgesturepan.c
|
||||
gtk/gtkgesturerotate.c
|
||||
gtk/gtkgesturesingle.c
|
||||
gtk/gtkgesturestylus.c
|
||||
gtk/gtkgestureswipe.c
|
||||
gtk/gtkgesturezoom.c
|
||||
gtk/gtkglarea.c
|
||||
|
||||
+303
-255
File diff suppressed because it is too large
Load Diff
+253
-209
File diff suppressed because it is too large
Load Diff
+312
-255
File diff suppressed because it is too large
Load Diff
+5
-2
@@ -142,6 +142,9 @@ gtk/gtkentry.c
|
||||
gtk/gtkentrycompletion.c
|
||||
gtk/gtkeventbox.c
|
||||
gtk/gtkeventcontroller.c
|
||||
gtk/gtkeventcontrollerkey.c
|
||||
gtk/gtkeventcontrollermotion.c
|
||||
gtk/gtkeventcontrollerscroll.c
|
||||
gtk/gtkexpander.c
|
||||
gtk/gtkfilechooserbutton.c
|
||||
gtk/gtkfilechooser.c
|
||||
@@ -159,7 +162,6 @@ gtk/gtkfixed.c
|
||||
gtk/gtkflowbox.c
|
||||
gtk/gtkfontbutton.c
|
||||
gtk/gtkfontchooser.c
|
||||
gtk/gtkfontchooser.c
|
||||
gtk/gtkfontchooserdialog.c
|
||||
gtk/gtkfontchooserwidget.c
|
||||
gtk/gtkframe.c
|
||||
@@ -170,6 +172,7 @@ gtk/gtkgesturemultipress.c
|
||||
gtk/gtkgesturepan.c
|
||||
gtk/gtkgesturerotate.c
|
||||
gtk/gtkgesturesingle.c
|
||||
gtk/gtkgesturestylus.c
|
||||
gtk/gtkgestureswipe.c
|
||||
gtk/gtkgesturezoom.c
|
||||
gtk/gtkglarea.c
|
||||
@@ -357,8 +360,8 @@ gtk/ui/gtkcolorchooserdialog.ui
|
||||
gtk/ui/gtkcoloreditor.ui
|
||||
gtk/ui/gtkdialog.ui
|
||||
gtk/ui/gtkemojichooser.ui
|
||||
gtk/ui/gtkfilechooserbutton.ui
|
||||
gtk/ui/gtkemojicompletion.ui
|
||||
gtk/ui/gtkfilechooserbutton.ui
|
||||
gtk/ui/gtkfilechooserdialog.ui
|
||||
gtk/ui/gtkfilechooserwidget.ui
|
||||
gtk/ui/gtkfontbutton.ui
|
||||
|
||||
@@ -168,7 +168,7 @@ int
|
||||
main(int argc, char **argv)
|
||||
{
|
||||
GError *error = NULL;
|
||||
GdkScreen *screen;
|
||||
GdkMonitor *monitor;
|
||||
GdkRectangle monitor_bounds;
|
||||
|
||||
GOptionContext *context = g_option_context_new (NULL);
|
||||
@@ -204,10 +204,8 @@ main(int argc, char **argv)
|
||||
G_CALLBACK (on_map_event), NULL);
|
||||
on_frame (0.);
|
||||
|
||||
screen = gtk_widget_get_screen (window);
|
||||
gdk_screen_get_monitor_geometry (screen,
|
||||
gdk_screen_get_primary_monitor (screen),
|
||||
&monitor_bounds);
|
||||
monitor = gdk_display_get_primary_monitor (gtk_widget_get_display (window));
|
||||
gdk_monitor_get_geometry (monitor, &monitor_bounds);
|
||||
|
||||
gtk_window_move (GTK_WINDOW (window),
|
||||
monitor_bounds.x + (monitor_bounds.width - window_width) / 2,
|
||||
|
||||
@@ -104,7 +104,7 @@ test_type (gconstpointer data)
|
||||
klass = g_type_class_ref (type);
|
||||
|
||||
if (g_type_is_a (type, GTK_TYPE_SETTINGS))
|
||||
instance = g_object_ref (gtk_settings_get_default ());
|
||||
instance = G_OBJECT (g_object_ref (gtk_settings_get_default ()));
|
||||
else if (g_type_is_a (type, GDK_TYPE_WINDOW))
|
||||
{
|
||||
GdkWindowAttr attributes;
|
||||
@@ -113,7 +113,7 @@ test_type (gconstpointer data)
|
||||
attributes.event_mask = 0;
|
||||
attributes.width = 100;
|
||||
attributes.height = 100;
|
||||
instance = g_object_ref (gdk_window_new (NULL, &attributes, 0));
|
||||
instance = G_OBJECT (g_object_ref (gdk_window_new (NULL, &attributes, 0)));
|
||||
}
|
||||
else if (g_str_equal (g_type_name (type), "GdkX11Cursor"))
|
||||
instance = g_object_new (type, "display", display, NULL);
|
||||
@@ -232,9 +232,14 @@ G_GNUC_BEGIN_IGNORE_DEPRECATIONS
|
||||
strcmp (pspec->name, "cell-area-context") == 0))
|
||||
continue;
|
||||
|
||||
if (g_type_is_a (type, GTK_TYPE_FONT_SELECTION) &&
|
||||
strcmp (pspec->name, "font") == 0)
|
||||
continue;
|
||||
G_GNUC_END_IGNORE_DEPRECATIONS
|
||||
|
||||
/* This is set in init() */
|
||||
if (g_type_is_a (type, GTK_TYPE_FONT_CHOOSER_WIDGET) &&
|
||||
strcmp (pspec->name, "tweak-action") == 0)
|
||||
continue;
|
||||
|
||||
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
|
||||
|
||||
if (g_type_is_a (type, GTK_TYPE_ICON_VIEW) &&
|
||||
(strcmp (pspec->name, "cell-area") == 0 ||
|
||||
@@ -358,9 +363,12 @@ G_GNUC_END_IGNORE_DEPRECATIONS
|
||||
continue;
|
||||
|
||||
if (g_test_verbose ())
|
||||
g_print ("Property %s.%s\n",
|
||||
g_type_name (pspec->owner_type),
|
||||
pspec->name);
|
||||
{
|
||||
g_print ("Property %s:%s\n",
|
||||
g_type_name (pspec->owner_type),
|
||||
pspec->name);
|
||||
}
|
||||
|
||||
g_value_init (&value, G_PARAM_SPEC_VALUE_TYPE (pspec));
|
||||
g_object_get_property (instance, pspec->name, &value);
|
||||
check_property ("Property", pspec, &value);
|
||||
@@ -370,7 +378,7 @@ G_GNUC_END_IGNORE_DEPRECATIONS
|
||||
|
||||
if (g_type_is_a (type, GTK_TYPE_WIDGET))
|
||||
{
|
||||
g_object_set (gtk_settings_get_default (), "gtk-theme-name", "Raleigh", NULL);
|
||||
g_object_set (gtk_settings_get_default (), "gtk-theme-name", "Adwaita", NULL);
|
||||
pspecs = gtk_widget_class_list_style_properties (GTK_WIDGET_CLASS (klass), &n_pspecs);
|
||||
|
||||
for (i = 0; i < n_pspecs; ++i)
|
||||
@@ -384,14 +392,43 @@ G_GNUC_END_IGNORE_DEPRECATIONS
|
||||
if ((pspec->flags & G_PARAM_READABLE) == 0)
|
||||
continue;
|
||||
|
||||
if (g_type_is_a (type, GTK_TYPE_BUTTON) &&
|
||||
strcmp (pspec->name, "default-border") == 0)
|
||||
/* These are overridden by Adwaita */
|
||||
if (g_type_is_a (type, GTK_TYPE_DIALOG) &&
|
||||
(strcmp (pspec->name, "action-area-border") == 0 ||
|
||||
strcmp (pspec->name, "button-spacing") == 0))
|
||||
continue;
|
||||
|
||||
if (g_type_is_a (type, GTK_TYPE_SCROLLBAR) &&
|
||||
(strcmp (pspec->name, "has-backward-stepper") == 0 ||
|
||||
strcmp (pspec->name, "has-forward-stepper") == 0))
|
||||
continue;
|
||||
|
||||
if (g_type_is_a (type, GTK_TYPE_SCROLLED_WINDOW) &&
|
||||
strcmp (pspec->name, "scrollbar-spacing") == 0)
|
||||
continue;
|
||||
|
||||
if (g_type_is_a (type, GTK_TYPE_TEXT_VIEW) &&
|
||||
strcmp (pspec->name, "error-underline-color") == 0)
|
||||
continue;
|
||||
|
||||
if (g_type_is_a (type, GTK_TYPE_TOOL_BUTTON) &&
|
||||
strcmp (pspec->name, "icon-spacing") == 0)
|
||||
continue;
|
||||
|
||||
if (g_type_is_a (type, GTK_TYPE_TOOL_ITEM_GROUP) &&
|
||||
strcmp (pspec->name, "expander-size") == 0)
|
||||
continue;
|
||||
|
||||
if (g_type_is_a (type, GTK_TYPE_TREE_VIEW) &&
|
||||
(strcmp (pspec->name, "expander-size") == 0 ||
|
||||
strcmp (pspec->name, "grid-line-pattern") == 0 ||
|
||||
strcmp (pspec->name, "horizontal-separator") == 0 ||
|
||||
strcmp (pspec->name, "tree-line-pattern") == 0))
|
||||
continue;
|
||||
|
||||
/* This is desktop-dependent */
|
||||
if (g_type_is_a (type, GTK_TYPE_WINDOW) &&
|
||||
(strcmp (pspec->name, "resize-grip-width") == 0 ||
|
||||
strcmp (pspec->name, "resize-grip-height") == 0 ||
|
||||
strcmp (pspec->name, "decoration-button-layout") == 0))
|
||||
strcmp (pspec->name, "decoration-button-layout") == 0)
|
||||
continue;
|
||||
|
||||
g_value_init (&value, G_PARAM_SPEC_VALUE_TYPE (pspec));
|
||||
|
||||
@@ -431,7 +431,7 @@ test_type (gconstpointer data)
|
||||
klass = g_type_class_ref (type);
|
||||
|
||||
if (g_type_is_a (type, GTK_TYPE_SETTINGS))
|
||||
instance = g_object_ref (gtk_settings_get_default ());
|
||||
instance = G_OBJECT (g_object_ref (gtk_settings_get_default ()));
|
||||
else if (g_type_is_a (type, GDK_TYPE_WINDOW))
|
||||
{
|
||||
GdkWindowAttr attributes;
|
||||
@@ -440,7 +440,7 @@ test_type (gconstpointer data)
|
||||
attributes.event_mask = 0;
|
||||
attributes.width = 100;
|
||||
attributes.height = 100;
|
||||
instance = g_object_ref (gdk_window_new (NULL, &attributes, 0));
|
||||
instance = G_OBJECT (g_object_ref (gdk_window_new (NULL, &attributes, 0)));
|
||||
}
|
||||
else if (g_str_equal (g_type_name (type), "GdkX11Cursor"))
|
||||
instance = g_object_new (type, "display", display, NULL);
|
||||
|
||||
Reference in New Issue
Block a user